@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.
- package/dist/nutui.es.js +1932 -3372
- package/dist/nutui.umd.js +1929 -3370
- package/dist/packages/_es/ActionSheet.js +2 -5
- package/dist/packages/_es/Address.js +162 -250
- package/dist/packages/_es/AddressList.js +229 -307
- package/dist/packages/_es/Animate.js +1 -1
- package/dist/packages/_es/Audio.js +1 -1
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/AvatarGroup.js +1 -1
- package/dist/packages/_es/BackTop.js +1 -1
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +1 -1
- package/dist/packages/_es/Calendar.js +1 -1
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +1 -1
- package/dist/packages/_es/Cascader.js +2 -5
- package/dist/packages/_es/Category.js +1 -1
- package/dist/packages/_es/CategoryPane.js +1 -1
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +2 -2
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +4 -11
- package/dist/packages/_es/CollapseItem.js +8 -5
- package/dist/packages/_es/Comment.js +1 -1
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +2 -10
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +8 -17
- package/dist/packages/_es/Dialog.js +38 -63
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Ecard.js +1 -1
- package/dist/packages/_es/Elevator.js +2 -2
- package/dist/packages/_es/Ellipsis.js +1 -1
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +39 -31
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +2 -2
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +1 -1
- package/dist/packages/_es/ImagePreview.js +126 -220
- package/dist/packages/_es/Indicator.js +4 -4
- package/dist/packages/_es/InfiniteLoading.js +1 -1
- package/dist/packages/_es/Input.js +107 -123
- package/dist/packages/_es/InputNumber.js +1 -1
- package/dist/packages/_es/Invoice.js +1 -1
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +1 -1
- package/dist/packages/_es/Menu.js +14 -1
- package/dist/packages/_es/MenuItem.js +10 -7
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +5 -7
- package/dist/packages/_es/NumberKeyboard.js +4 -4
- package/dist/packages/_es/OverLay.js +60 -63
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +25 -50
- package/dist/packages/_es/Popover.js +111 -930
- package/dist/packages/_es/Popup.js +105 -217
- package/dist/packages/_es/Price.js +1 -1
- package/dist/packages/_es/Progress.js +1 -1
- package/dist/packages/_es/Radio.js +1 -1
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +4 -4
- package/dist/packages/_es/SideNavBar.js +1 -1
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +1 -1
- package/dist/packages/_es/Sku.js +4 -7
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +1 -1
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +1 -1
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +1 -1
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +1 -1
- package/dist/packages/_es/TabbarItem.js +2 -2
- package/dist/packages/_es/Table.js +1 -1
- package/dist/packages/_es/Tabs.js +2 -2
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +1 -1
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +4 -4
- package/dist/packages/_es/Toast.js +5 -6
- package/dist/packages/_es/TrendArrow.js +1 -1
- package/dist/packages/_es/Uploader.js +2 -2
- package/dist/packages/_es/Video.js +1 -1
- package/dist/packages/_es/WaterMark.js +1 -1
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +22 -2
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/index4.js +1 -1
- package/dist/packages/_es/index5.js +1 -1
- package/dist/packages/_es/interceptor.js +32 -0
- package/dist/packages/_es/mountComponent.js +42 -0
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/props.js +80 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/style.css +1 -1
- package/dist/packages/address/index.scss +7 -2
- package/dist/packages/addresslist/index.scss +61 -101
- package/dist/packages/imagepreview/index.scss +9 -1
- package/dist/packages/inputnumber/index.scss +5 -1
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/menuitem/index.scss +0 -15
- package/dist/packages/notify/index.scss +2 -2
- package/dist/packages/overlay/index.scss +2 -1
- package/dist/packages/picker/index.scss +20 -12
- package/dist/packages/popover/index.scss +191 -363
- package/dist/packages/popup/index.scss +3 -14
- package/dist/smartips/attributes.json +59 -55
- package/dist/smartips/tags.json +16 -19
- package/dist/smartips/web-types.json +115 -113
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +54 -55
- package/dist/styles/themes/jdb.scss +54 -55
- package/dist/styles/themes/jddkh.scss +54 -55
- package/dist/styles/themes/jdt.scss +54 -55
- package/dist/styles/variables.scss +9 -0
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +61 -57
- package/dist/types/__VUE/address/index.vue.d.ts +74 -94
- package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +29 -9
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +4 -13
- package/dist/types/__VUE/addresslist/components/SwipeShell.vue.d.ts +9 -9
- package/dist/types/__VUE/addresslist/index.vue.d.ts +23 -20
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cascader/index.vue.d.ts +49 -54
- package/dist/types/__VUE/cell/index.vue.d.ts +1 -1
- package/dist/types/__VUE/countdown/index.vue.d.ts +0 -1
- package/dist/types/__VUE/countdown/util.d.ts +0 -1
- package/dist/types/__VUE/datepicker/index.vue.d.ts +57 -62
- package/dist/types/__VUE/dialog/index.d.ts +0 -3
- package/dist/types/__VUE/dialog/index.vue.d.ts +52 -61
- package/dist/types/__VUE/divider/index.vue.d.ts +1 -1
- package/dist/types/__VUE/fixednav/index.vue.d.ts +1 -1
- package/dist/types/__VUE/form/common.d.ts +4 -2
- package/dist/types/__VUE/form/index.vue.d.ts +4 -4
- package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/index.vue.d.ts +1 -1
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +27 -20
- package/dist/types/__VUE/imagepreview/index.d.ts +19 -5
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +57 -43
- package/dist/types/__VUE/imagepreview/types.d.ts +44 -0
- package/dist/types/__VUE/indicator/index.vue.d.ts +1 -0
- package/dist/types/__VUE/input/index.vue.d.ts +35 -23
- package/dist/types/__VUE/inputnumber/index.vue.d.ts +1 -1
- package/dist/types/__VUE/invoice/index.vue.d.ts +1 -1
- package/dist/types/__VUE/menu/index.vue.d.ts +1 -1
- package/dist/types/__VUE/menuitem/index.vue.d.ts +3 -3
- package/dist/types/__VUE/notify/index.vue.d.ts +3 -3
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +4 -4
- package/dist/types/__VUE/overlay/index.vue.d.ts +12 -13
- package/dist/types/__VUE/picker/Column.vue.d.ts +0 -2
- package/dist/types/__VUE/picker/index.vue.d.ts +59 -66
- package/dist/types/__VUE/popover/index.vue.d.ts +40 -143
- package/dist/types/__VUE/popup/common.d.ts +103 -0
- package/dist/types/__VUE/popup/index.vue.d.ts +57 -1593
- package/dist/types/__VUE/popup/props.d.ts +82 -0
- package/dist/types/__VUE/rate/index.vue.d.ts +1 -1
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +5 -5
- package/dist/types/__VUE/sku/index.vue.d.ts +59 -64
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tabbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -3
- package/dist/types/__VUE/video/index.vue.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +1 -2
- package/package.json +2 -3
- package/dist/packages/_es/PullRefresh.js +0 -349
- package/dist/packages/pullrefresh/index.scss +0 -71
- package/dist/types/__VUE/addresslist/components/LongPressShell.vue.d.ts +0 -47
- package/dist/types/__VUE/datepicker/utils.d.ts +0 -5
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +0 -5
- package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -128
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +0 -20
- 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,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;
|