@nutui/nutui 4.0.12-beta.1 → 4.0.12
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 +1 -1
- package/dist/nutui.js +1 -1
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +111 -78
- package/dist/packages/_es/Address.js +375 -250
- package/dist/packages/_es/AddressList.js +354 -269
- package/dist/packages/_es/Animate.js +58 -41
- package/dist/packages/_es/Audio.js +197 -128
- package/dist/packages/_es/AudioOperate.js +71 -60
- package/dist/packages/_es/Avatar.js +89 -66
- package/dist/packages/_es/AvatarGroup.js +31 -23
- package/dist/packages/_es/Backtop.js +99 -59
- package/dist/packages/_es/Badge.js +47 -36
- package/dist/packages/_es/Barrage.js +147 -68
- package/dist/packages/_es/Button.js +66 -47
- package/dist/packages/_es/Calendar.js +157 -135
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +56 -42
- package/dist/packages/_es/Cascader.js +474 -315
- package/dist/packages/_es/Category.js +39 -29
- package/dist/packages/_es/CategoryPane.js +83 -57
- package/dist/packages/_es/Cell.js +71 -56
- package/dist/packages/_es/CellGroup.js +27 -19
- package/dist/packages/_es/Checkbox.js +156 -109
- package/dist/packages/_es/CheckboxGroup.js +59 -38
- package/dist/packages/_es/CircleProgress.js +96 -67
- package/dist/packages/_es/Col.js +31 -23
- package/dist/packages/_es/Collapse.js +58 -33
- package/dist/packages/_es/CollapseItem.js +108 -78
- package/dist/packages/_es/Comment.js +279 -207
- package/dist/packages/_es/ConfigProvider.js +55 -37
- package/dist/packages/_es/Countdown.js +212 -100
- package/dist/packages/_es/Countup.js +445 -232
- package/dist/packages/_es/DatePicker.js +265 -162
- package/dist/packages/_es/Dialog.js +213 -161
- package/dist/packages/_es/Divider.js +57 -42
- package/dist/packages/_es/Drag.js +153 -70
- package/dist/packages/_es/Ecard.js +104 -64
- package/dist/packages/_es/Elevator.js +219 -143
- package/dist/packages/_es/Ellipsis.js +178 -95
- package/dist/packages/_es/Empty.js +39 -23
- package/dist/packages/_es/FixedNav.js +116 -93
- package/dist/packages/_es/Form.js +178 -107
- package/dist/packages/_es/FormItem.js +61 -48
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +84 -58
- package/dist/packages/_es/Image.js +130 -90
- package/dist/packages/_es/ImagePreview.js +412 -256
- package/dist/packages/_es/Indicator.js +34 -30
- package/dist/packages/_es/InfiniteLoading.js +136 -83
- package/dist/packages/_es/Input.js +264 -160
- package/dist/packages/_es/InputNumber.js +117 -81
- package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
- package/dist/packages/_es/Invoice.js +130 -104
- package/dist/packages/_es/Layout.js +4 -3
- package/dist/packages/_es/List.js +215 -117
- package/dist/packages/_es/Menu.js +150 -95
- package/dist/packages/_es/MenuItem.js +154 -109
- package/dist/packages/_es/Navbar.js +119 -103
- package/dist/packages/_es/Noticebar.js +312 -197
- package/dist/packages/_es/Notify.js +166 -110
- package/dist/packages/_es/NumberKeyboard.js +202 -127
- package/dist/packages/_es/Overlay.js +80 -52
- package/dist/packages/_es/Pagination.js +100 -70
- package/dist/packages/_es/Picker.js +437 -275
- package/dist/packages/_es/Popover.js +225 -122
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +82 -44
- package/dist/packages/_es/Progress.js +79 -63
- package/dist/packages/_es/PullRefresh.js +173 -95
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +347 -204
- package/dist/packages/_es/Rate.js +141 -92
- package/dist/packages/_es/Row.js +27 -21
- package/dist/packages/_es/Searchbar.js +174 -123
- package/dist/packages/_es/ShortPassword.js +93 -69
- package/dist/packages/_es/SideNavbar.js +80 -49
- package/dist/packages/_es/SideNavbarItem.js +32 -22
- package/dist/packages/_es/Signature.js +146 -83
- package/dist/packages/_es/Skeleton.js +130 -110
- package/dist/packages/_es/Sku.js +343 -250
- package/dist/packages/_es/Step.js +86 -59
- package/dist/packages/_es/Steps.js +31 -26
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +74 -52
- package/dist/packages/_es/Swipe.js +155 -83
- package/dist/packages/_es/Swiper.js +311 -174
- package/dist/packages/_es/SwiperItem.js +44 -28
- package/dist/packages/_es/Switch.js +68 -55
- package/dist/packages/_es/TabPane.js +41 -30
- package/dist/packages/_es/Tabbar.js +52 -41
- package/dist/packages/_es/TabbarItem.js +82 -61
- package/dist/packages/_es/Table.js +165 -109
- package/dist/packages/_es/Tabs.js +388 -240
- package/dist/packages/_es/Tag.js +61 -44
- package/dist/packages/_es/Textarea.js +124 -80
- package/dist/packages/_es/TimeDetail.js +76 -49
- package/dist/packages/_es/TimePannel.js +48 -34
- package/dist/packages/_es/TimeSelect.js +68 -47
- package/dist/packages/_es/Toast.js +218 -144
- package/dist/packages/_es/Tour.js +192 -138
- package/dist/packages/_es/TrendArrow.js +77 -57
- package/dist/packages/_es/Uploader.js +359 -234
- package/dist/packages/_es/Video.js +316 -191
- package/dist/packages/_es/Watermark.js +117 -84
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
- package/dist/packages/_es/common-b9a5e726.js +145 -0
- package/dist/packages/_es/component-81a4c1d0.js +145 -0
- package/dist/packages/_es/index-29892cda.js +33 -0
- package/dist/packages/_es/index-43c34ac6.js +30 -0
- package/dist/packages/_es/index-54d03fc1.js +8 -0
- package/dist/packages/_es/index-79c5dc33.js +10 -0
- package/dist/packages/_es/index-7a7385e4.js +67 -0
- package/dist/packages/_es/index-87422be8.js +942 -0
- package/dist/packages/_es/index-da0a7662.js +259 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
- package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
- package/dist/packages/_es/raf-729dad54.js +25 -0
- package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
- package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
- package/dist/packages/locale/lang/en-US.js +39 -36
- package/dist/packages/locale/lang/id-ID.js +39 -36
- package/dist/packages/locale/lang/index.js +44 -22
- package/dist/packages/locale/lang/zh-CN.js +38 -35
- package/dist/packages/locale/lang/zh-TW.js +38 -35
- package/dist/resolver/index.js +26 -1
- package/dist/resolver/index.mjs +17 -14
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +50 -50
- package/dist/styles/themes/jdb.scss +50 -50
- package/dist/styles/themes/jddkh.scss +50 -50
- package/dist/styles/themes/jdt.scss +50 -50
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
- package/dist/packages/_es/common-d218746f.js +0 -116
- package/dist/packages/_es/component-234624bc.js +0 -89
- package/dist/packages/_es/index-14dfadc4.js +0 -561
- package/dist/packages/_es/index-192a3ef6.js +0 -29
- package/dist/packages/_es/index-360c5092.js +0 -210
- package/dist/packages/_es/index-496e6e05.js +0 -24
- package/dist/packages/_es/index-50eed3d9.js +0 -7
- package/dist/packages/_es/index-53ec2d4d.js +0 -34
- package/dist/packages/_es/index-fadb0974.js +0 -8
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
- package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
- package/dist/packages/_es/pxCheck-38173291.js +0 -4
- package/dist/packages/_es/raf-a74f1a06.js +0 -16
- package/dist/packages/_es/renderIcon-47498b32.js +0 -5
- package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { useSlots
|
|
2
|
-
import { c as
|
|
3
|
-
import { Checked
|
|
4
|
-
import { _ as
|
|
1
|
+
import { useSlots, ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createVNode } from "vue";
|
|
2
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
3
|
+
import { Checked } from "@nutui/icons-vue";
|
|
4
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
5
5
|
import "../locale/lang";
|
|
6
|
-
const { create
|
|
7
|
-
|
|
6
|
+
const { create } = createComponent("progress");
|
|
7
|
+
const _sfc_main = create({
|
|
8
|
+
components: { Checked },
|
|
8
9
|
props: {
|
|
9
10
|
percentage: {
|
|
10
11
|
type: [Number, String],
|
|
11
12
|
default: 0,
|
|
12
|
-
required:
|
|
13
|
+
required: true
|
|
13
14
|
},
|
|
14
15
|
size: {
|
|
15
16
|
type: String,
|
|
@@ -25,11 +26,11 @@ const { create: T } = w("progress"), B = T({
|
|
|
25
26
|
},
|
|
26
27
|
textInside: {
|
|
27
28
|
type: Boolean,
|
|
28
|
-
default:
|
|
29
|
+
default: false
|
|
29
30
|
},
|
|
30
31
|
showText: {
|
|
31
32
|
type: Boolean,
|
|
32
|
-
default:
|
|
33
|
+
default: true
|
|
33
34
|
},
|
|
34
35
|
strokeColor: {
|
|
35
36
|
type: String,
|
|
@@ -45,86 +46,101 @@ const { create: T } = w("progress"), B = T({
|
|
|
45
46
|
},
|
|
46
47
|
isShowPercentage: {
|
|
47
48
|
type: Boolean,
|
|
48
|
-
default:
|
|
49
|
+
default: true
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
|
-
setup(
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
setup(props) {
|
|
53
|
+
const slotDefault = !!useSlots().default;
|
|
54
|
+
const height = ref(props.strokeWidth + "px");
|
|
55
|
+
const progressOuter = ref();
|
|
56
|
+
const insideText = ref();
|
|
57
|
+
const percentage = computed(() => {
|
|
58
|
+
return props.percentage >= 100 ? 100 : props.percentage;
|
|
59
|
+
});
|
|
60
|
+
const bgStyle = computed(() => {
|
|
61
|
+
return {
|
|
62
|
+
width: percentage.value + "%",
|
|
63
|
+
background: props.strokeColor || ""
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
const textStyle = computed(() => {
|
|
67
|
+
return {
|
|
68
|
+
color: props.textColor || ""
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
onMounted(() => {
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
height,
|
|
75
|
+
percentage,
|
|
76
|
+
bgStyle,
|
|
77
|
+
textStyle,
|
|
78
|
+
progressOuter,
|
|
79
|
+
insideText,
|
|
80
|
+
slotDefault
|
|
67
81
|
};
|
|
68
82
|
}
|
|
69
|
-
})
|
|
83
|
+
});
|
|
84
|
+
const _hoisted_1 = { class: "nut-progress" };
|
|
85
|
+
const _hoisted_2 = {
|
|
70
86
|
key: 0,
|
|
71
87
|
class: "nut-progress-text"
|
|
72
88
|
};
|
|
73
|
-
function
|
|
74
|
-
const
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
class:
|
|
89
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
90
|
+
const _component_Checked = resolveComponent("Checked");
|
|
91
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
92
|
+
createElementVNode("div", {
|
|
93
|
+
class: normalizeClass(["nut-progress-outer", [_ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "", _ctx.size ? "nut-progress-" + _ctx.size : ""]]),
|
|
78
94
|
ref: "progressOuter",
|
|
79
|
-
style:
|
|
95
|
+
style: normalizeStyle({ height: _ctx.height })
|
|
80
96
|
}, [
|
|
81
|
-
|
|
82
|
-
class:
|
|
83
|
-
style:
|
|
97
|
+
createElementVNode("div", {
|
|
98
|
+
class: normalizeClass(["nut-progress-inner", _ctx.status == "active" ? "nut-active" : ""]),
|
|
99
|
+
style: normalizeStyle(_ctx.bgStyle)
|
|
84
100
|
}, null, 6),
|
|
85
|
-
|
|
101
|
+
_ctx.showText && _ctx.textInside && !_ctx.slotDefault ? (openBlock(), createElementBlock("div", {
|
|
86
102
|
key: 0,
|
|
87
103
|
class: "nut-progress-text nut-progress-insidetext",
|
|
88
104
|
ref: "insideText",
|
|
89
|
-
style:
|
|
90
|
-
lineHeight:
|
|
91
|
-
left: `${
|
|
92
|
-
transform: `translate(-${+
|
|
93
|
-
background:
|
|
105
|
+
style: normalizeStyle({
|
|
106
|
+
lineHeight: _ctx.height,
|
|
107
|
+
left: `${_ctx.percentage}%`,
|
|
108
|
+
transform: `translate(-${+_ctx.percentage}%,-50%)`,
|
|
109
|
+
background: _ctx.textBackground || _ctx.strokeColor
|
|
94
110
|
})
|
|
95
111
|
}, [
|
|
96
|
-
|
|
97
|
-
style:
|
|
98
|
-
},
|
|
99
|
-
], 4)) :
|
|
100
|
-
|
|
112
|
+
createElementVNode("span", {
|
|
113
|
+
style: normalizeStyle(_ctx.textStyle)
|
|
114
|
+
}, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)
|
|
115
|
+
], 4)) : createCommentVNode("", true),
|
|
116
|
+
_ctx.showText && _ctx.textInside && _ctx.slotDefault ? (openBlock(), createElementBlock("div", {
|
|
101
117
|
key: 1,
|
|
102
118
|
ref: "insideText",
|
|
103
|
-
style:
|
|
104
|
-
position:
|
|
105
|
-
top:
|
|
106
|
-
left: `${
|
|
107
|
-
transform: `translate(-${+
|
|
119
|
+
style: normalizeStyle({
|
|
120
|
+
position: `absolute`,
|
|
121
|
+
top: `50%`,
|
|
122
|
+
left: `${_ctx.percentage}%`,
|
|
123
|
+
transform: `translate(-${+_ctx.percentage}%,-50%)`
|
|
108
124
|
})
|
|
109
125
|
}, [
|
|
110
|
-
|
|
111
|
-
], 4)) :
|
|
126
|
+
renderSlot(_ctx.$slots, "default")
|
|
127
|
+
], 4)) : createCommentVNode("", true)
|
|
112
128
|
], 6),
|
|
113
|
-
|
|
114
|
-
|
|
129
|
+
_ctx.showText && !_ctx.textInside ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
130
|
+
_ctx.status == "active" || _ctx.status == "" ? (openBlock(), createElementBlock("span", {
|
|
115
131
|
key: 0,
|
|
116
|
-
style:
|
|
117
|
-
},
|
|
118
|
-
|
|
132
|
+
style: normalizeStyle(_ctx.textStyle)
|
|
133
|
+
}, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)) : _ctx.status == "icon" ? renderSlot(_ctx.$slots, "icon-name", { key: 1 }, () => [
|
|
134
|
+
createVNode(_component_Checked, {
|
|
119
135
|
width: "15px",
|
|
120
136
|
height: "15px",
|
|
121
137
|
color: "#439422"
|
|
122
138
|
})
|
|
123
|
-
]) :
|
|
124
|
-
])) :
|
|
139
|
+
]) : createCommentVNode("", true)
|
|
140
|
+
])) : createCommentVNode("", true)
|
|
125
141
|
]);
|
|
126
142
|
}
|
|
127
|
-
const
|
|
143
|
+
const Progress = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
128
144
|
export {
|
|
129
|
-
|
|
145
|
+
Progress as default
|
|
130
146
|
};
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { ref, reactive, computed, watch, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
21
|
+
import { c as createComponent, l as getScrollTopRoot } from "./component-81a4c1d0.js";
|
|
22
|
+
import { u as useTouch } from "./index-7a7385e4.js";
|
|
23
|
+
import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
|
|
24
|
+
import { u as useScrollParent } from "./index-43c34ac6.js";
|
|
25
|
+
import { Loading } from "@nutui/icons-vue";
|
|
26
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
20
27
|
import "../locale/lang";
|
|
21
|
-
const { componentName
|
|
28
|
+
const { componentName, create, translate } = createComponent("pull-refresh");
|
|
29
|
+
const _sfc_main = create({
|
|
22
30
|
props: {
|
|
23
31
|
modelValue: {
|
|
24
32
|
type: Boolean,
|
|
25
|
-
default:
|
|
33
|
+
default: false
|
|
26
34
|
},
|
|
27
35
|
pullingTxt: {
|
|
28
36
|
type: String,
|
|
29
|
-
default:
|
|
37
|
+
default: translate("pulling")
|
|
30
38
|
},
|
|
31
39
|
loosingTxt: {
|
|
32
40
|
type: String,
|
|
33
|
-
default:
|
|
41
|
+
default: translate("loosing")
|
|
34
42
|
},
|
|
35
43
|
loadingTxt: {
|
|
36
44
|
type: String,
|
|
37
|
-
default:
|
|
45
|
+
default: translate("loading")
|
|
38
46
|
},
|
|
39
47
|
// completeTxt: {
|
|
40
48
|
// type: String,
|
|
@@ -54,100 +62,170 @@ const { componentName: ee, create: te, translate: h } = O("pull-refresh"), le =
|
|
|
54
62
|
}
|
|
55
63
|
},
|
|
56
64
|
emits: ["change", "refresh", "update:modelValue"],
|
|
57
|
-
components: { Loading
|
|
58
|
-
setup(
|
|
59
|
-
const
|
|
60
|
-
|
|
65
|
+
components: { Loading },
|
|
66
|
+
setup(props, { emit, slots }) {
|
|
67
|
+
const touch = useTouch();
|
|
68
|
+
const scroller = ref();
|
|
69
|
+
const scrollParent = useScrollParent(scroller);
|
|
70
|
+
const state = reactive({
|
|
71
|
+
isPullRefresh: false,
|
|
61
72
|
distance: 0,
|
|
62
73
|
status: "normal"
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
});
|
|
75
|
+
const classes = computed(() => {
|
|
76
|
+
const prefixCls = componentName;
|
|
77
|
+
return {
|
|
78
|
+
[prefixCls]: true
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
const getPullStatus = computed(() => {
|
|
82
|
+
switch (state.status) {
|
|
67
83
|
case "pulling":
|
|
68
|
-
return
|
|
84
|
+
return !slots.pulling ? props.pullingTxt : "";
|
|
69
85
|
case "loosing":
|
|
70
|
-
return
|
|
86
|
+
return !slots.loosing ? props.loosingTxt : "";
|
|
71
87
|
case "loading":
|
|
72
|
-
return
|
|
88
|
+
return !slots.loading ? props.loadingTxt : "";
|
|
73
89
|
}
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
});
|
|
91
|
+
const getStyle = computed(() => {
|
|
92
|
+
return {
|
|
93
|
+
transitionDuration: `${props.duration}s`,
|
|
94
|
+
transform: state.distance ? `translate3d(0,${state.distance}px, 0)` : ""
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
const getHeightStyle = computed(() => {
|
|
98
|
+
const styles = {};
|
|
99
|
+
if (props.headHeight != 50)
|
|
100
|
+
styles.height = pxCheck(props.headHeight);
|
|
101
|
+
return styles;
|
|
102
|
+
});
|
|
103
|
+
const timing = (distance) => {
|
|
104
|
+
const pullDistance = +(props.pullDistance || props.headHeight);
|
|
105
|
+
let moveDistance = distance;
|
|
106
|
+
if (distance > pullDistance) {
|
|
107
|
+
if (distance < pullDistance * 2) {
|
|
108
|
+
moveDistance = (distance + pullDistance) / 2;
|
|
109
|
+
} else {
|
|
110
|
+
moveDistance = pullDistance + distance / 4;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return Math.round(moveDistance);
|
|
114
|
+
};
|
|
115
|
+
const setPullStatus = (distance, isLoading) => {
|
|
116
|
+
const pullDistance = +(props.pullDistance || props.headHeight);
|
|
117
|
+
state.distance = distance;
|
|
118
|
+
if (isLoading) {
|
|
119
|
+
state.status = "loading";
|
|
120
|
+
} else if (distance === 0) {
|
|
121
|
+
state.status = "normal";
|
|
122
|
+
} else if (distance < pullDistance) {
|
|
123
|
+
state.status = "pulling";
|
|
124
|
+
} else {
|
|
125
|
+
state.status = "loosing";
|
|
126
|
+
}
|
|
127
|
+
emit("change", { status: state.status, distance });
|
|
128
|
+
};
|
|
129
|
+
const isCanTouch = () => state.status !== "loading" && state.status !== "complete";
|
|
130
|
+
const isScrollTop = () => {
|
|
131
|
+
if (scrollParent.value == window) {
|
|
132
|
+
return getScrollTopRoot() == 0;
|
|
133
|
+
} else {
|
|
134
|
+
return scrollParent.value && scrollParent.value.scrollTop == 0;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const touchStart = (event) => {
|
|
138
|
+
if (isCanTouch()) {
|
|
139
|
+
if (isScrollTop()) {
|
|
140
|
+
touch.start(event);
|
|
141
|
+
state.isPullRefresh = true;
|
|
142
|
+
} else {
|
|
143
|
+
state.distance = 0;
|
|
144
|
+
state.isPullRefresh = false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const touchMove = (event) => {
|
|
149
|
+
if (isCanTouch()) {
|
|
150
|
+
touch.move(event);
|
|
151
|
+
const { deltaY } = touch;
|
|
152
|
+
if (touch.isVertical() && deltaY.value > 0 && state.isPullRefresh) {
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
setPullStatus(timing(deltaY.value));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const touchEnd = () => {
|
|
159
|
+
if (state.isPullRefresh && isCanTouch() && touch.deltaY.value) {
|
|
160
|
+
if (state.status === "loosing") {
|
|
161
|
+
setPullStatus(+props.headHeight, true);
|
|
162
|
+
emit("update:modelValue", true);
|
|
163
|
+
nextTick(() => emit("refresh"));
|
|
164
|
+
} else {
|
|
165
|
+
setPullStatus(0);
|
|
166
|
+
}
|
|
94
167
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
a.reset();
|
|
168
|
+
setTimeout(() => {
|
|
169
|
+
touch.reset();
|
|
98
170
|
}, 0);
|
|
99
171
|
};
|
|
100
|
-
|
|
101
|
-
() =>
|
|
102
|
-
(
|
|
103
|
-
|
|
172
|
+
watch(
|
|
173
|
+
() => props.modelValue,
|
|
174
|
+
(val) => {
|
|
175
|
+
if (val) {
|
|
176
|
+
setPullStatus(+props.headHeight, true);
|
|
177
|
+
} else {
|
|
178
|
+
setPullStatus(0);
|
|
179
|
+
}
|
|
104
180
|
}
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
181
|
+
);
|
|
182
|
+
return __spreadProps(__spreadValues({
|
|
183
|
+
classes,
|
|
184
|
+
scroller
|
|
185
|
+
}, toRefs(state)), {
|
|
186
|
+
touchStart,
|
|
187
|
+
touchMove,
|
|
188
|
+
touchEnd,
|
|
189
|
+
getStyle,
|
|
190
|
+
translate,
|
|
191
|
+
slots,
|
|
192
|
+
getHeightStyle,
|
|
193
|
+
getPullStatus
|
|
117
194
|
});
|
|
118
195
|
}
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
196
|
+
});
|
|
197
|
+
const _hoisted_1 = { class: "nut-pull-refresh-container-topbox-text" };
|
|
198
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
199
|
+
const _component_Loading = resolveComponent("Loading");
|
|
200
|
+
return openBlock(), createElementBlock("div", {
|
|
201
|
+
class: normalizeClass(_ctx.classes),
|
|
124
202
|
ref: "scroller",
|
|
125
|
-
onTouchstart:
|
|
126
|
-
onTouchmove:
|
|
127
|
-
onTouchend:
|
|
203
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
|
|
204
|
+
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.touchMove && _ctx.touchMove(...args)),
|
|
205
|
+
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
128
206
|
}, [
|
|
129
|
-
|
|
207
|
+
createElementVNode("div", {
|
|
130
208
|
class: "nut-pull-refresh-container",
|
|
131
|
-
style:
|
|
209
|
+
style: normalizeStyle(_ctx.getStyle)
|
|
132
210
|
}, [
|
|
133
|
-
|
|
211
|
+
createElementVNode("div", {
|
|
134
212
|
class: "nut-pull-refresh-container-topbox",
|
|
135
|
-
style:
|
|
213
|
+
style: normalizeStyle(_ctx.getHeightStyle)
|
|
136
214
|
}, [
|
|
137
|
-
|
|
215
|
+
_ctx.status == "loading" && !_ctx.slots.loading ? (openBlock(), createBlock(_component_Loading, {
|
|
138
216
|
key: 0,
|
|
139
217
|
class: "nut-icon-loading nut-pull-refresh-container-topbox-icon"
|
|
140
|
-
})) :
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
218
|
+
})) : createCommentVNode("", true),
|
|
219
|
+
createElementVNode("div", _hoisted_1, toDisplayString(_ctx.getPullStatus), 1),
|
|
220
|
+
_ctx.status == "pulling" ? renderSlot(_ctx.$slots, "pulling", { key: 1 }) : createCommentVNode("", true),
|
|
221
|
+
_ctx.status == "loosing" ? renderSlot(_ctx.$slots, "loosing", { key: 2 }) : createCommentVNode("", true),
|
|
222
|
+
_ctx.status == "loading" ? renderSlot(_ctx.$slots, "loading", { key: 3 }) : createCommentVNode("", true)
|
|
145
223
|
], 4),
|
|
146
|
-
|
|
224
|
+
renderSlot(_ctx.$slots, "default")
|
|
147
225
|
], 4)
|
|
148
226
|
], 34);
|
|
149
227
|
}
|
|
150
|
-
const
|
|
228
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
151
229
|
export {
|
|
152
|
-
|
|
230
|
+
index as default
|
|
153
231
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-a8856969.js";
|
|
2
2
|
import "vue";
|
|
3
|
-
import "./component-
|
|
3
|
+
import "./component-81a4c1d0.js";
|
|
4
4
|
import "../locale/lang";
|
|
5
5
|
import "@nutui/icons-vue";
|
|
6
|
-
import "./pxCheck-
|
|
6
|
+
import "./pxCheck-c6b9f6b7.js";
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
_sfc_main as default
|
|
9
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-22dfc112.js";
|
|
2
2
|
import "vue";
|
|
3
|
-
import "./component-
|
|
3
|
+
import "./component-81a4c1d0.js";
|
|
4
4
|
import "../locale/lang";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_sfc_main as default
|
|
7
7
|
};
|