@nutui/nutui 3.1.22-beta.0 → 3.1.22
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/CHANGELOG.md +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +4203 -19263
- package/dist/nutui.umd.js +4208 -19368
- package/dist/packages/_es/ActionSheet.js +17 -167
- package/dist/packages/_es/Address.js +110 -552
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Animate.js +22 -0
- package/dist/packages/_es/Audio.js +53 -274
- package/dist/packages/_es/AudioOperate.js +13 -121
- package/dist/packages/_es/Avatar.js +38 -177
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +30 -237
- package/dist/packages/_es/CalendarItem.js +2 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +147 -523
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +32 -84
- package/dist/packages/_es/CollapseItem.js +59 -272
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/ConfigProvider.js +13 -0
- package/dist/packages/_es/CountDown.js +56 -256
- package/dist/packages/_es/CountUp.js +140 -556
- package/dist/packages/_es/DatePicker.js +98 -332
- package/dist/packages/_es/Dialog.js +60 -271
- package/dist/packages/_es/Divider.js +13 -82
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +58 -212
- package/dist/packages/_es/Ellipsis.js +64 -0
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/Image.js +31 -0
- package/dist/packages/_es/ImagePreview.js +77 -309
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +57 -268
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +18 -124
- package/dist/packages/_es/Menu.js +45 -118
- package/dist/packages/_es/MenuItem.js +37 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +74 -397
- package/dist/packages/_es/Notify.js +72 -246
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +131 -474
- package/dist/packages/_es/OverLay.js +24 -113
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +129 -469
- package/dist/packages/_es/Popover.js +318 -975
- package/dist/packages/_es/Popup.js +55 -313
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +84 -354
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +83 -427
- package/dist/packages/_es/Rate.js +35 -137
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +37 -257
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +24 -99
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +41 -179
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +84 -509
- package/dist/packages/_es/Step.js +20 -133
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +17 -100
- package/dist/packages/_es/Swipe.js +41 -197
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +18 -196
- package/dist/packages/_es/Tabs.js +43 -217
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +18 -98
- package/dist/packages/_es/TimePannel.js +14 -66
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +71 -329
- package/dist/packages/_es/Uploader.js +104 -468
- package/dist/packages/_es/Video.js +74 -350
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +164 -682
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/animate/index.scss +299 -0
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +18 -1
- package/dist/packages/checkbox/index.scss +16 -0
- package/dist/packages/configprovider/index.scss +2 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/ellipsis/index.scss +12 -0
- package/dist/packages/formitem/index.scss +12 -0
- package/dist/packages/griditem/index.scss +11 -0
- package/dist/packages/image/index.scss +39 -0
- package/dist/packages/imagepreview/index.scss +21 -2
- package/dist/packages/input/index.scss +26 -1
- package/dist/packages/inputnumber/index.scss +21 -0
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/menu/index.scss +45 -36
- package/dist/packages/menuitem/index.scss +4 -0
- package/dist/packages/navbar/index.scss +9 -0
- package/dist/packages/pagination/index.scss +19 -0
- package/dist/packages/radio/index.scss +19 -0
- package/dist/packages/range/index.scss +19 -0
- package/dist/packages/rate/index.scss +1 -1
- package/dist/packages/searchbar/index.scss +21 -0
- package/dist/packages/switch/index.scss +4 -3
- package/dist/packages/tabbar/index.scss +5 -0
- package/dist/packages/tabbaritem/index.scss +7 -0
- package/dist/packages/tabpane/index.scss +6 -0
- package/dist/packages/tabs/index.scss +22 -0
- package/dist/packages/textarea/index.scss +8 -0
- package/dist/smartips/attributes.json +192 -12
- package/dist/smartips/tags.json +70 -10
- package/dist/smartips/web-types.json +6945 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/config.json +3 -1
- package/dist/styles/font/demo_index.html +49 -3
- package/dist/styles/font/iconfont.css +11 -3
- package/dist/styles/font/iconfont.js +15 -15
- package/dist/styles/font/iconfont.json +14 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +54 -50
- package/dist/styles/themes/jdb.scss +54 -50
- package/dist/styles/themes/jdt.scss +54 -50
- package/dist/styles/variables-jdb.scss +22 -1
- package/dist/styles/variables-jdt.scss +22 -1
- package/dist/styles/variables.scss +22 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +2 -2
- package/dist/types/__VUE/address/index.vue.d.ts +4 -4
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
- package/dist/types/__VUE/animate/type.d.ts +6 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +5 -5
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +4 -4
- package/dist/types/__VUE/button/index.vue.d.ts +6 -6
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +3 -1
- package/dist/types/__VUE/comment/index.vue.d.ts +2 -2
- package/dist/types/__VUE/configprovider/common.d.ts +20 -0
- package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +25 -10
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/index.vue.d.ts +105 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
- package/dist/types/__VUE/input/index.vue.d.ts +6 -6
- package/dist/types/__VUE/inputnumber/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
- package/dist/types/__VUE/menuitem/index.vue.d.ts +12 -3
- package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
- package/dist/types/__VUE/notify/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
- package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/radio/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +4 -4
- package/dist/types/__VUE/rate/common.d.ts +149 -0
- package/dist/types/__VUE/rate/index.vue.d.ts +15 -5
- package/dist/types/__VUE/skeleton/index.vue.d.ts +4 -4
- package/dist/types/__VUE/sku/index.vue.d.ts +2 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/sticky/index.vue.d.ts +4 -4
- package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tag/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +10 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +5 -5
- package/dist/types/__VUE/uploader/index.vue.d.ts +6 -6
- package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +5 -1
- package/package.json +6 -3
|
@@ -1,151 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22
|
|
2
|
+
* @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { useSlots, ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createBlock } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { useSlots as e, ref as t, computed as r, onMounted as s, resolveComponent as o, openBlock as n, createElementBlock as a, createElementVNode as i, normalizeClass as l, normalizeStyle as u, toDisplayString as p, createCommentVNode as g, renderSlot as c, createBlock as d } from "vue";
|
|
7
|
+
import { c as f } from "./component.js";
|
|
8
|
+
import { _ as y } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { create } =
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
default: "base"
|
|
21
|
-
},
|
|
22
|
-
status: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: ""
|
|
25
|
-
},
|
|
26
|
-
strokeWidth: {
|
|
27
|
-
type: [Number, String],
|
|
28
|
-
default: ""
|
|
29
|
-
},
|
|
30
|
-
textInside: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: false
|
|
33
|
-
},
|
|
34
|
-
showText: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: true
|
|
37
|
-
},
|
|
38
|
-
strokeColor: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: ""
|
|
41
|
-
},
|
|
42
|
-
textColor: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: ""
|
|
45
|
-
},
|
|
46
|
-
textBackground: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: ""
|
|
49
|
-
},
|
|
50
|
-
iconName: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: "checked"
|
|
53
|
-
},
|
|
54
|
-
iconColor: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: "#439422"
|
|
57
|
-
},
|
|
58
|
-
isShowPercentage: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: true
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
setup(props, { emit }) {
|
|
64
|
-
const slotDefault = !!useSlots().default;
|
|
65
|
-
const height = ref(props.strokeWidth + "px");
|
|
66
|
-
const progressOuter = ref();
|
|
67
|
-
const insideText = ref();
|
|
68
|
-
const bgStyle = computed(() => {
|
|
69
|
-
return {
|
|
70
|
-
width: props.percentage + "%",
|
|
71
|
-
background: props.strokeColor || ""
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
const textStyle = computed(() => {
|
|
75
|
-
return {
|
|
76
|
-
color: props.textColor || ""
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
onMounted(() => {
|
|
80
|
-
});
|
|
81
|
-
return {
|
|
82
|
-
height,
|
|
83
|
-
bgStyle,
|
|
84
|
-
textStyle,
|
|
85
|
-
progressOuter,
|
|
86
|
-
insideText,
|
|
87
|
-
slotDefault
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
const _hoisted_1 = { class: "nut-progress" };
|
|
92
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
93
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
94
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
95
|
-
createElementVNode("div", {
|
|
96
|
-
class: normalizeClass(["nut-progress-outer", [_ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "", _ctx.size ? "nut-progress-" + _ctx.size : ""]]),
|
|
97
|
-
ref: "progressOuter",
|
|
98
|
-
style: normalizeStyle({ height: _ctx.height })
|
|
99
|
-
}, [
|
|
100
|
-
createElementVNode("div", {
|
|
101
|
-
class: normalizeClass(["nut-progress-inner", _ctx.status == "active" ? "nut-active" : ""]),
|
|
102
|
-
style: normalizeStyle(_ctx.bgStyle)
|
|
103
|
-
}, [
|
|
104
|
-
_ctx.showText && _ctx.textInside && !_ctx.slotDefault ? (openBlock(), createElementBlock("div", {
|
|
105
|
-
key: 0,
|
|
106
|
-
class: "nut-progress-text nut-progress-insidetext",
|
|
107
|
-
ref: "insideText",
|
|
108
|
-
style: normalizeStyle({
|
|
109
|
-
lineHeight: _ctx.height,
|
|
110
|
-
left: `${_ctx.percentage}%`,
|
|
111
|
-
transform: `translate(-${+_ctx.percentage}%,-50%)`,
|
|
112
|
-
background: _ctx.textBackground || _ctx.strokeColor
|
|
113
|
-
})
|
|
114
|
-
}, [
|
|
115
|
-
createElementVNode("span", {
|
|
116
|
-
style: normalizeStyle(_ctx.textStyle)
|
|
117
|
-
}, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)
|
|
118
|
-
], 4)) : createCommentVNode("", true),
|
|
119
|
-
_ctx.showText && _ctx.textInside && _ctx.slotDefault ? (openBlock(), createElementBlock("div", {
|
|
120
|
-
key: 1,
|
|
121
|
-
ref: "insideText",
|
|
122
|
-
style: normalizeStyle({
|
|
123
|
-
position: `absolute`,
|
|
124
|
-
top: `50%`,
|
|
125
|
-
left: `${_ctx.percentage}%`,
|
|
126
|
-
transform: `translate(-${+_ctx.percentage}%,-50%)`
|
|
127
|
-
})
|
|
128
|
-
}, [
|
|
129
|
-
renderSlot(_ctx.$slots, "default")
|
|
130
|
-
], 4)) : createCommentVNode("", true)
|
|
131
|
-
], 6)
|
|
132
|
-
], 6),
|
|
133
|
-
_ctx.showText && !_ctx.textInside ? (openBlock(), createElementBlock("div", {
|
|
134
|
-
key: 0,
|
|
135
|
-
class: "nut-progress-text",
|
|
136
|
-
style: normalizeStyle({ lineHeight: _ctx.height })
|
|
137
|
-
}, [
|
|
138
|
-
_ctx.status == "active" || _ctx.status == "" ? (openBlock(), createElementBlock("span", {
|
|
139
|
-
key: 0,
|
|
140
|
-
style: normalizeStyle(_ctx.textStyle)
|
|
141
|
-
}, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)) : _ctx.status == "icon" ? (openBlock(), createBlock(_component_nut_icon, {
|
|
142
|
-
key: 1,
|
|
143
|
-
size: "16px",
|
|
144
|
-
name: _ctx.iconName,
|
|
145
|
-
color: _ctx.iconColor
|
|
146
|
-
}, null, 8, ["name", "color"])) : createCommentVNode("", true)
|
|
147
|
-
], 4)) : createCommentVNode("", true)
|
|
148
|
-
]);
|
|
149
|
-
}
|
|
150
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
151
|
-
export { index as default };
|
|
10
|
+
const { create: x } = f("progress"), h = x({ props: { percentage: { type: [Number, String], default: 0, required: true }, size: { type: String, default: "base" }, status: { type: String, default: "" }, strokeWidth: { type: [Number, String], default: "" }, textInside: { type: Boolean, default: false }, showText: { type: Boolean, default: true }, strokeColor: { type: String, default: "" }, textColor: { type: String, default: "" }, textBackground: { type: String, default: "" }, iconName: { type: String, default: "checked" }, iconColor: { type: String, default: "#439422" }, isShowPercentage: { type: Boolean, default: true } }, setup(o2, { emit: n2 }) {
|
|
11
|
+
const a2 = !!e().default, i2 = t(o2.strokeWidth + "px"), l2 = t(), u2 = t(), p2 = r(() => ({ width: o2.percentage + "%", background: o2.strokeColor || "" })), g2 = r(() => ({ color: o2.textColor || "" }));
|
|
12
|
+
return s(() => {
|
|
13
|
+
}), { height: i2, bgStyle: p2, textStyle: g2, progressOuter: l2, insideText: u2, slotDefault: a2 };
|
|
14
|
+
} }), m = { class: "nut-progress" };
|
|
15
|
+
var S = y(h, [["render", function(e2, t2, r2, s2, f2, y2) {
|
|
16
|
+
const x2 = o("nut-icon");
|
|
17
|
+
return n(), a("div", m, [i("div", { class: l(["nut-progress-outer", [e2.showText && !e2.textInside ? "nut-progress-outer-part" : "", e2.size ? "nut-progress-" + e2.size : ""]]), ref: "progressOuter", style: u({ height: e2.height }) }, [i("div", { class: l(["nut-progress-inner", e2.status == "active" ? "nut-active" : ""]), style: u(e2.bgStyle) }, [e2.showText && e2.textInside && !e2.slotDefault ? (n(), a("div", { key: 0, class: "nut-progress-text nut-progress-insidetext", ref: "insideText", style: u({ lineHeight: e2.height, left: `${e2.percentage}%`, transform: `translate(-${+e2.percentage}%,-50%)`, background: e2.textBackground || e2.strokeColor }) }, [i("span", { style: u(e2.textStyle) }, p(e2.percentage) + p(e2.isShowPercentage ? "%" : ""), 5)], 4)) : g("", true), e2.showText && e2.textInside && e2.slotDefault ? (n(), a("div", { key: 1, ref: "insideText", style: u({ position: "absolute", top: "50%", left: `${e2.percentage}%`, transform: `translate(-${+e2.percentage}%,-50%)` }) }, [c(e2.$slots, "default")], 4)) : g("", true)], 6)], 6), e2.showText && !e2.textInside ? (n(), a("div", { key: 0, class: "nut-progress-text", style: u({ lineHeight: e2.height }) }, [e2.status == "active" || e2.status == "" ? (n(), a("span", { key: 0, style: u(e2.textStyle) }, p(e2.percentage) + p(e2.isShowPercentage ? "%" : ""), 5)) : e2.status == "icon" ? (n(), d(x2, { key: 1, size: "16px", name: e2.iconName, color: e2.iconColor }, null, 8, ["name", "color"])) : g("", true)], 4)) : g("", true)]);
|
|
18
|
+
}]]);
|
|
19
|
+
export { S as default };
|
|
@@ -1,364 +1,94 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
1
|
/*!
|
|
18
|
-
* @nutui/nutui v3.1.22
|
|
2
|
+
* @nutui/nutui v3.1.22 Fri Jun 24 2022 18:11:16 GMT+0800 (中国标准时间)
|
|
19
3
|
* (c) 2022 @jdf2e.
|
|
20
4
|
* Released under the MIT License.
|
|
21
5
|
*/
|
|
22
|
-
import { ref, toRefs, reactive, computed, onMounted, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, toDisplayString, renderSlot } from "vue";
|
|
23
|
-
import { c as
|
|
24
|
-
import { _ as
|
|
6
|
+
import { ref as e, toRefs as t, reactive as l, computed as a, onMounted as o, openBlock as u, createElementBlock as r, normalizeStyle as n, createElementVNode as s, normalizeClass as i, toDisplayString as v, renderSlot as c } from "vue";
|
|
7
|
+
import { c as d } from "./component.js";
|
|
8
|
+
import { _ as h } from "./plugin-vue_export-helper.js";
|
|
25
9
|
import "../locale/lang";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (x > y && x > MIN_DISTANCE) {
|
|
29
|
-
return "horizontal";
|
|
30
|
-
}
|
|
31
|
-
if (y > x && y > MIN_DISTANCE) {
|
|
32
|
-
return "vertical";
|
|
33
|
-
}
|
|
34
|
-
return "";
|
|
10
|
+
function f(e2, t2) {
|
|
11
|
+
(typeof e2.cancelable != "boolean" || e2.cancelable) && e2.preventDefault(), t2 && e2.stopPropagation();
|
|
35
12
|
}
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
offsetX.value
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
deltaY.value = touch.clientY - startY.value;
|
|
62
|
-
offsetX.value = Math.abs(deltaX.value);
|
|
63
|
-
offsetY.value = Math.abs(deltaY.value);
|
|
64
|
-
if (!direction.value) {
|
|
65
|
-
direction.value = getDirection(offsetX.value, offsetY.value);
|
|
13
|
+
const { componentName: p, create: m } = d("pullrefresh"), g = m({ props: { useWindow: { type: Boolean, default: true }, containerId: { type: String, default: "" }, disabled: { type: Boolean, default: false }, direction: { type: String, default: "vertical" }, pullingText: { type: Object, default: { top: "\u4E0B\u62C9\u5237\u65B0", bottom: "\u4E0A\u62C9\u52A0\u8F7D", left: "\u5DE6\u6ED1\u5237\u65B0", right: "\u53F3\u6ED1\u52A0\u8F7D" } }, loosingText: { type: Object, default: { top: "\u677E\u624B\u91CA\u653E\u5237\u65B0", bottom: "\u677E\u624B\u91CA\u653E\u5237\u65B0", left: "\u91CA\u653E\u5237\u65B0", right: "\u52A0\u8F7D\u66F4\u591A" } }, loadingText: { type: Object, default: { top: "\u52A0\u8F7D\u4E2D...", bottom: "\u52A0\u8F7D\u4E2D...", left: "\u52A0\u8F7D\u4E2D...", right: "\u52A0\u8F7D\u4E2D..." } } }, emits: ["refresh", "downRefresh"], setup(u2, { emit: r2 }) {
|
|
14
|
+
const { containerId: n2, useWindow: s2, direction: i2, disabled: v2 } = t(u2), c2 = e(false), d2 = e(false), h2 = e(false), p2 = e(false), m2 = l({ status: "normal", distance: 0, duration: 0 });
|
|
15
|
+
let g2 = document.documentElement || document.body;
|
|
16
|
+
const b2 = e(null), T2 = function() {
|
|
17
|
+
const t2 = e(0), l2 = e(0), a2 = e(0), o2 = e(0), u3 = e(0), r3 = e(0), n3 = e(""), s3 = () => {
|
|
18
|
+
a2.value = 0, o2.value = 0, u3.value = 0, r3.value = 0, n3.value = "";
|
|
19
|
+
};
|
|
20
|
+
return { move: (e2) => {
|
|
21
|
+
const s4 = e2.touches[0];
|
|
22
|
+
var i3, v3;
|
|
23
|
+
a2.value = s4.clientX - t2.value, o2.value = s4.clientY - l2.value, u3.value = Math.abs(a2.value), r3.value = Math.abs(o2.value), n3.value || (n3.value = (i3 = u3.value) > (v3 = r3.value) && i3 > 10 ? "horizontal" : v3 > i3 && v3 > 10 ? "vertical" : "");
|
|
24
|
+
}, start: (e2) => {
|
|
25
|
+
s3(), t2.value = e2.touches[0].clientX, l2.value = e2.touches[0].clientY;
|
|
26
|
+
}, reset: s3, startX: t2, startY: l2, deltaX: a2, deltaY: o2, offsetX: u3, offsetY: r3, direction: n3, isVertical: () => n3.value === "vertical", isHorizontal: () => n3.value === "horizontal" };
|
|
27
|
+
}(), x = a(() => {
|
|
28
|
+
let e2 = {};
|
|
29
|
+
const { deltaY: t2, deltaX: l2 } = T2;
|
|
30
|
+
return i2.value == "vertical" && (c2.value && t2.value > 0 || d2.value && t2.value < 0) && T2.isVertical() && (e2 = { transitionDuration: `${m2.duration}ms`, transform: m2.distance ? `translate3d(0,${m2.distance}px, 0)` : "translate3d(0,0,0)" }), i2.value == "horizontal" && (h2.value && l2.value > 0 || p2.value && l2.value < 0) && T2.isHorizontal() && (e2 = { transitionDuration: `${m2.duration}ms`, transform: m2.distance ? `translate3d(${m2.distance}px, 0,0)` : "translate3d(0,0,0)" }), e2;
|
|
31
|
+
}), y = a(() => {
|
|
32
|
+
let e2 = {};
|
|
33
|
+
if (i2.value == "vertical" && d2.value && T2.deltaY.value < 0 && T2.isVertical()) {
|
|
34
|
+
e2 = { height: (Math.abs(m2.distance) < 50 ? -m2.distance : 50) + "px" };
|
|
35
|
+
}
|
|
36
|
+
if (i2.value == "horizontal" && p2.value && T2.deltaX.value < 0 && T2.isVertical()) {
|
|
37
|
+
e2 = { width: (Math.abs(m2.distance) < 50 ? -m2.distance : 50) + "px" };
|
|
66
38
|
}
|
|
39
|
+
return e2;
|
|
40
|
+
}), z = a(() => {
|
|
41
|
+
const { status: e2, distance: t2 } = m2, l2 = i2.value == "vertical" ? "top" : "left";
|
|
42
|
+
return e2 == "loading" && (c2.value || h2.value) && t2 > 0 ? u2.loadingText[l2] : e2 == "pulling" && (c2.value || h2.value) && t2 > 0 ? u2.pullingText[l2] : e2 == "loosing" && (c2.value || h2.value) && t2 > 0 ? u2.loosingText[l2] : "";
|
|
43
|
+
}), M = a(() => {
|
|
44
|
+
const { status: e2, distance: t2 } = m2, l2 = i2.value == "vertical" ? "bottom" : "right";
|
|
45
|
+
return e2 == "loading" && (d2.value || p2.value) && t2 < 0 ? u2.loadingText[l2] : e2 == "pulling" && (d2.value || p2.value) && t2 < 0 ? u2.pullingText[l2] : e2 == "loosing" && (d2.value || p2.value) && t2 < 0 ? u2.loosingText[l2] : "";
|
|
46
|
+
}), w = () => m2.status !== "loading" && !v2.value, S = (e2, t2) => {
|
|
47
|
+
m2.distance = e2, t2 ? m2.status = "loading" : e2 === 0 ? m2.status = "normal" : Math.abs(e2) < 50 ? m2.status = "pulling" : m2.status = "loosing";
|
|
67
48
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
isVertical,
|
|
80
|
-
isHorizontal
|
|
49
|
+
o(() => {
|
|
50
|
+
const e2 = (t2 = b2, n2.value != "" ? document.querySelector(`#${n2.value}`) : t2 && t2.parentNode);
|
|
51
|
+
var t2;
|
|
52
|
+
let l2 = document.documentElement || document.body;
|
|
53
|
+
s2.value === false && (l2 = e2), g2 = l2;
|
|
54
|
+
});
|
|
55
|
+
const X = (e2) => {
|
|
56
|
+
const t2 = 50;
|
|
57
|
+
return e2 > t2 && (e2 = e2 < 100 ? t2 + (e2 - t2) / 2 : 75 + (e2 - 100) / 4), Math.round(e2);
|
|
58
|
+
}, Y = () => {
|
|
59
|
+
S(0);
|
|
81
60
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
const { componentName, create } = createComponent("pullrefresh");
|
|
91
|
-
const _sfc_main = create({
|
|
92
|
-
props: {
|
|
93
|
-
useWindow: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
default: true
|
|
96
|
-
},
|
|
97
|
-
containerId: {
|
|
98
|
-
type: String,
|
|
99
|
-
default: ""
|
|
100
|
-
},
|
|
101
|
-
disabled: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
default: false
|
|
104
|
-
},
|
|
105
|
-
direction: {
|
|
106
|
-
type: String,
|
|
107
|
-
default: "vertical"
|
|
108
|
-
},
|
|
109
|
-
pullingText: {
|
|
110
|
-
type: Object,
|
|
111
|
-
default: {
|
|
112
|
-
top: "\u4E0B\u62C9\u5237\u65B0",
|
|
113
|
-
bottom: "\u4E0A\u62C9\u52A0\u8F7D",
|
|
114
|
-
left: "\u5DE6\u6ED1\u5237\u65B0",
|
|
115
|
-
right: "\u53F3\u6ED1\u52A0\u8F7D"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
loosingText: {
|
|
119
|
-
type: Object,
|
|
120
|
-
default: {
|
|
121
|
-
top: "\u677E\u624B\u91CA\u653E\u5237\u65B0",
|
|
122
|
-
bottom: "\u677E\u624B\u91CA\u653E\u5237\u65B0",
|
|
123
|
-
left: "\u91CA\u653E\u5237\u65B0",
|
|
124
|
-
right: "\u52A0\u8F7D\u66F4\u591A"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
loadingText: {
|
|
128
|
-
type: Object,
|
|
129
|
-
default: {
|
|
130
|
-
top: "\u52A0\u8F7D\u4E2D...",
|
|
131
|
-
bottom: "\u52A0\u8F7D\u4E2D...",
|
|
132
|
-
left: "\u52A0\u8F7D\u4E2D...",
|
|
133
|
-
right: "\u52A0\u8F7D\u4E2D..."
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
emits: ["refresh", "downRefresh"],
|
|
138
|
-
setup(props, { emit }) {
|
|
139
|
-
const { containerId, useWindow, direction, disabled } = toRefs(props);
|
|
140
|
-
const reachTop = ref(false);
|
|
141
|
-
const reachBottom = ref(false);
|
|
142
|
-
const reachLeft = ref(false);
|
|
143
|
-
const reachRight = ref(false);
|
|
144
|
-
const state = reactive({
|
|
145
|
-
status: "normal",
|
|
146
|
-
distance: 0,
|
|
147
|
-
duration: 0
|
|
148
|
-
});
|
|
149
|
-
let scrollEl = document.documentElement || document.body;
|
|
150
|
-
const scroller = ref(null);
|
|
151
|
-
const touch = useTouch();
|
|
152
|
-
const getStyle = computed(() => {
|
|
153
|
-
let style = {};
|
|
154
|
-
const { deltaY, deltaX } = touch;
|
|
155
|
-
if (direction.value == "vertical" && (reachTop.value && deltaY.value > 0 || reachBottom.value && deltaY.value < 0) && touch.isVertical()) {
|
|
156
|
-
style = {
|
|
157
|
-
transitionDuration: `${state.duration}ms`,
|
|
158
|
-
transform: state.distance ? `translate3d(0,${state.distance}px, 0)` : `translate3d(0,0,0)`
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
if (direction.value == "horizontal" && (reachLeft.value && deltaX.value > 0 || reachRight.value && deltaX.value < 0) && touch.isHorizontal()) {
|
|
162
|
-
style = {
|
|
163
|
-
transitionDuration: `${state.duration}ms`,
|
|
164
|
-
transform: state.distance ? `translate3d(${state.distance}px, 0,0)` : `translate3d(0,0,0)`
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
return style;
|
|
168
|
-
});
|
|
169
|
-
const getBottomStyle = computed(() => {
|
|
170
|
-
let style = {};
|
|
171
|
-
if (direction.value == "vertical" && reachBottom.value && touch.deltaY.value < 0 && touch.isVertical()) {
|
|
172
|
-
const dis = Math.abs(state.distance) < 50 ? -state.distance : 50;
|
|
173
|
-
style = {
|
|
174
|
-
height: dis + "px"
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
if (direction.value == "horizontal" && reachRight.value && touch.deltaX.value < 0 && touch.isVertical()) {
|
|
178
|
-
const dis = Math.abs(state.distance) < 50 ? -state.distance : 50;
|
|
179
|
-
style = {
|
|
180
|
-
width: dis + "px"
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
return style;
|
|
184
|
-
});
|
|
185
|
-
const refreshTopTem = computed(() => {
|
|
186
|
-
const { status, distance } = state;
|
|
187
|
-
const tag = direction.value == "vertical" ? "top" : "left";
|
|
188
|
-
if (status == "loading" && (reachTop.value || reachLeft.value) && distance > 0) {
|
|
189
|
-
return props.loadingText[tag];
|
|
190
|
-
}
|
|
191
|
-
if (status == "pulling" && (reachTop.value || reachLeft.value) && distance > 0) {
|
|
192
|
-
return props.pullingText[tag];
|
|
193
|
-
}
|
|
194
|
-
if (status == "loosing" && (reachTop.value || reachLeft.value) && distance > 0) {
|
|
195
|
-
return props.loosingText[tag];
|
|
196
|
-
}
|
|
197
|
-
return "";
|
|
198
|
-
});
|
|
199
|
-
const refreshBottomTem = computed(() => {
|
|
200
|
-
const { status, distance } = state;
|
|
201
|
-
const tag = direction.value == "vertical" ? "bottom" : "right";
|
|
202
|
-
if (status == "loading" && (reachBottom.value || reachRight.value) && distance < 0) {
|
|
203
|
-
return props.loadingText[tag];
|
|
204
|
-
}
|
|
205
|
-
if (status == "pulling" && (reachBottom.value || reachRight.value) && distance < 0) {
|
|
206
|
-
return props.pullingText[tag];
|
|
207
|
-
}
|
|
208
|
-
if (status == "loosing" && (reachBottom.value || reachRight.value) && distance < 0) {
|
|
209
|
-
return props.loosingText[tag];
|
|
210
|
-
}
|
|
211
|
-
return "";
|
|
212
|
-
});
|
|
213
|
-
const isTouchable = () => state.status !== "loading" && !disabled.value;
|
|
214
|
-
const setStatus = (distance, isLoading) => {
|
|
215
|
-
state.distance = distance;
|
|
216
|
-
if (isLoading) {
|
|
217
|
-
state.status = "loading";
|
|
218
|
-
} else if (distance === 0) {
|
|
219
|
-
state.status = "normal";
|
|
220
|
-
} else if (Math.abs(distance) < 50) {
|
|
221
|
-
state.status = "pulling";
|
|
222
|
-
} else {
|
|
223
|
-
state.status = "loosing";
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
const getParentElement = (el) => {
|
|
227
|
-
if (containerId.value != "") {
|
|
228
|
-
return document.querySelector(`#${containerId.value}`);
|
|
229
|
-
}
|
|
230
|
-
return el && el.parentNode;
|
|
231
|
-
};
|
|
232
|
-
onMounted(() => {
|
|
233
|
-
const parentElement = getParentElement(scroller);
|
|
234
|
-
let scrollElCopy = document.documentElement || document.body;
|
|
235
|
-
if (useWindow.value === false) {
|
|
236
|
-
scrollElCopy = parentElement;
|
|
237
|
-
}
|
|
238
|
-
scrollEl = scrollElCopy;
|
|
239
|
-
});
|
|
240
|
-
const ease = (distance) => {
|
|
241
|
-
const headHeight = 50;
|
|
242
|
-
if (distance > headHeight) {
|
|
243
|
-
if (distance < headHeight * 2) {
|
|
244
|
-
distance = headHeight + (distance - headHeight) / 2;
|
|
245
|
-
} else {
|
|
246
|
-
distance = headHeight * 1.5 + (distance - headHeight * 2) / 4;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return Math.round(distance);
|
|
250
|
-
};
|
|
251
|
-
const refreshDone = () => {
|
|
252
|
-
setStatus(0);
|
|
253
|
-
};
|
|
254
|
-
const touchStart = (event) => {
|
|
255
|
-
if (isTouchable()) {
|
|
256
|
-
if (direction.value == "vertical") {
|
|
257
|
-
const top = "scrollTop" in scrollEl ? scrollEl.scrollTop : 0;
|
|
258
|
-
reachTop.value = Math.max(top, 0) == 0 ? true : false;
|
|
259
|
-
const { scrollHeight, clientHeight, scrollTop } = scrollEl;
|
|
260
|
-
reachBottom.value = clientHeight + scrollTop == scrollHeight ? true : false;
|
|
261
|
-
if (reachTop.value || reachBottom.value) {
|
|
262
|
-
state.duration = 0;
|
|
263
|
-
touch.start(event);
|
|
264
|
-
}
|
|
265
|
-
} else {
|
|
266
|
-
const { scrollWidth, clientWidth, scrollLeft } = scrollEl;
|
|
267
|
-
const left = "scrollLeft" in scrollEl ? scrollEl.scrollLeft : 0;
|
|
268
|
-
reachLeft.value = Math.max(left, 0) == 0 ? true : false;
|
|
269
|
-
reachRight.value = clientWidth + scrollLeft == scrollWidth ? true : false;
|
|
270
|
-
if (reachLeft.value || reachRight.value) {
|
|
271
|
-
state.duration = 0;
|
|
272
|
-
touch.start(event);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
61
|
+
return { scroller: b2, touchStart: (e2) => {
|
|
62
|
+
if (w())
|
|
63
|
+
if (i2.value == "vertical") {
|
|
64
|
+
const t2 = "scrollTop" in g2 ? g2.scrollTop : 0;
|
|
65
|
+
c2.value = Math.max(t2, 0) == 0;
|
|
66
|
+
const { scrollHeight: l2, clientHeight: a2, scrollTop: o2 } = g2;
|
|
67
|
+
d2.value = a2 + o2 == l2, (c2.value || d2.value) && (m2.duration = 0, T2.start(e2));
|
|
275
68
|
} else {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
emit("downRefresh", refreshDone);
|
|
303
|
-
}
|
|
304
|
-
if (direction.value == "vertical" && reachBottom.value && deltaY.value < 0) {
|
|
305
|
-
dis = -50;
|
|
306
|
-
emit("refresh", refreshDone);
|
|
307
|
-
}
|
|
308
|
-
if (direction.value == "horizontal" && reachLeft.value && deltaX.value > 0) {
|
|
309
|
-
dis = 50;
|
|
310
|
-
emit("downRefresh", refreshDone);
|
|
311
|
-
}
|
|
312
|
-
if (direction.value == "horizontal" && reachRight.value && deltaX.value < 0) {
|
|
313
|
-
dis = -50;
|
|
314
|
-
emit("refresh", refreshDone);
|
|
315
|
-
}
|
|
316
|
-
setStatus(dis, true);
|
|
317
|
-
} else {
|
|
318
|
-
setStatus(0);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
return __spreadValues({
|
|
323
|
-
scroller,
|
|
324
|
-
touchStart,
|
|
325
|
-
touchMove,
|
|
326
|
-
touchEnd,
|
|
327
|
-
getStyle,
|
|
328
|
-
reachBottom,
|
|
329
|
-
reachTop,
|
|
330
|
-
reachRight,
|
|
331
|
-
reachLeft,
|
|
332
|
-
getBottomStyle,
|
|
333
|
-
refreshTopTem,
|
|
334
|
-
refreshBottomTem
|
|
335
|
-
}, toRefs(state));
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
const _hoisted_1 = {
|
|
339
|
-
class: "pullrefresh-content",
|
|
340
|
-
ref: "pull"
|
|
341
|
-
};
|
|
342
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
343
|
-
return openBlock(), createElementBlock("view", {
|
|
344
|
-
class: "nut-pullrefresh",
|
|
345
|
-
ref: "scroller",
|
|
346
|
-
style: normalizeStyle(_ctx.getStyle),
|
|
347
|
-
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
|
|
348
|
-
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.touchMove && _ctx.touchMove(...args)),
|
|
349
|
-
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
350
|
-
}, [
|
|
351
|
-
createElementVNode("view", {
|
|
352
|
-
class: normalizeClass(["pullrefresh-top", _ctx.direction == "horizontal" ? "pullrefresh-top-h" : "pullrefresh-top-v"])
|
|
353
|
-
}, toDisplayString(_ctx.refreshTopTem), 3),
|
|
354
|
-
createElementVNode("view", _hoisted_1, [
|
|
355
|
-
renderSlot(_ctx.$slots, "default")
|
|
356
|
-
], 512),
|
|
357
|
-
createElementVNode("view", {
|
|
358
|
-
class: normalizeClass(["pullrefresh-bottom", _ctx.direction == "horizontal" ? "pullrefresh-bottom-h" : "pullrefresh-bottom-v"]),
|
|
359
|
-
style: normalizeStyle(_ctx.getBottomStyle)
|
|
360
|
-
}, toDisplayString(_ctx.refreshBottomTem), 7)
|
|
361
|
-
], 36);
|
|
362
|
-
}
|
|
363
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
364
|
-
export { index as default };
|
|
69
|
+
const { scrollWidth: t2, clientWidth: l2, scrollLeft: a2 } = g2, o2 = "scrollLeft" in g2 ? g2.scrollLeft : 0;
|
|
70
|
+
h2.value = Math.max(o2, 0) == 0, p2.value = l2 + a2 == t2, (h2.value || p2.value) && (m2.duration = 0, T2.start(e2));
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
f(e2);
|
|
74
|
+
}, touchMove: (e2) => {
|
|
75
|
+
if (w()) {
|
|
76
|
+
const { deltaY: t2, deltaX: l2 } = T2;
|
|
77
|
+
T2.move(e2), i2.value == "vertical" && (d2.value && t2.value < 0 || c2.value && t2.value >= 0) && T2.isVertical() && (f(e2), S(X(t2.value))), i2.value == "horizontal" && (h2.value && l2.value >= 0 || p2.value && l2.value < 0) && T2.isHorizontal() && (f(e2), S(X(l2.value)));
|
|
78
|
+
} else
|
|
79
|
+
f(e2);
|
|
80
|
+
}, touchEnd: () => {
|
|
81
|
+
if (w()) {
|
|
82
|
+
const { deltaY: e2, deltaX: t2 } = T2;
|
|
83
|
+
if (m2.status === "loosing") {
|
|
84
|
+
let l2 = 0;
|
|
85
|
+
i2.value == "vertical" && c2.value && e2.value > 0 && (l2 = 50, r2("downRefresh", Y)), i2.value == "vertical" && d2.value && e2.value < 0 && (l2 = -50, r2("refresh", Y)), i2.value == "horizontal" && h2.value && t2.value > 0 && (l2 = 50, r2("downRefresh", Y)), i2.value == "horizontal" && p2.value && t2.value < 0 && (l2 = -50, r2("refresh", Y)), S(l2, true);
|
|
86
|
+
} else
|
|
87
|
+
S(0);
|
|
88
|
+
}
|
|
89
|
+
}, getStyle: x, reachBottom: d2, reachTop: c2, reachRight: p2, reachLeft: h2, getBottomStyle: y, refreshTopTem: z, refreshBottomTem: M, ...t(m2) };
|
|
90
|
+
} }), b = { class: "pullrefresh-content", ref: "pull" };
|
|
91
|
+
var T = h(g, [["render", function(e2, t2, l2, a2, o2, d2) {
|
|
92
|
+
return u(), r("view", { class: "nut-pullrefresh", ref: "scroller", style: n(e2.getStyle), onTouchstart: t2[0] || (t2[0] = (...t3) => e2.touchStart && e2.touchStart(...t3)), onTouchmove: t2[1] || (t2[1] = (...t3) => e2.touchMove && e2.touchMove(...t3)), onTouchend: t2[2] || (t2[2] = (...t3) => e2.touchEnd && e2.touchEnd(...t3)) }, [s("view", { class: i(["pullrefresh-top", e2.direction == "horizontal" ? "pullrefresh-top-h" : "pullrefresh-top-v"]) }, v(e2.refreshTopTem), 3), s("view", b, [c(e2.$slots, "default")], 512), s("view", { class: i(["pullrefresh-bottom", e2.direction == "horizontal" ? "pullrefresh-bottom-h" : "pullrefresh-bottom-v"]), style: n(e2.getBottomStyle) }, v(e2.refreshBottomTem), 7)], 36);
|
|
93
|
+
}]]);
|
|
94
|
+
export { T as default };
|