@nutui/nutui 3.1.19-beta.1 → 3.1.19-beta.2
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/README.md +9 -8
- package/dist/nutui.es.js +2875 -3576
- package/dist/nutui.umd.js +2965 -3579
- package/dist/packages/_es/ActionSheet.js +18 -12
- package/dist/packages/_es/Address.js +69 -78
- package/dist/packages/_es/Audio.js +12 -12
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +3 -3
- package/dist/packages/_es/BackTop.js +110 -68
- package/dist/packages/_es/Badge.js +3 -3
- package/dist/packages/_es/Barrage.js +55 -62
- package/dist/packages/_es/Button.js +2 -2
- package/dist/packages/_es/Calendar.js +27 -32
- package/dist/packages/_es/CalendarItem.js +3 -3
- package/dist/packages/_es/Card.js +5 -6
- package/dist/packages/_es/Cascader.js +7 -7
- package/dist/packages/_es/Cell.js +11 -4
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +13 -3
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +40 -149
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +8 -34
- package/dist/packages/_es/CollapseItem.js +59 -90
- package/dist/packages/_es/CountDown.js +5 -5
- package/dist/packages/_es/CountUp.js +51 -43
- package/dist/packages/_es/DatePicker.js +20 -21
- package/dist/packages/_es/Dialog.js +91 -12
- package/dist/packages/_es/Divider.js +4 -4
- package/dist/packages/_es/Drag.js +54 -92
- package/dist/packages/_es/Elevator.js +50 -75
- package/dist/packages/_es/Empty.js +3 -3
- package/dist/packages/_es/FixedNav.js +10 -11
- package/dist/packages/_es/Form.js +5 -9
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +26 -8
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +83 -14
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +107 -93
- package/dist/packages/_es/Input.js +8 -8
- package/dist/packages/_es/InputNumber.js +16 -23
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +34 -41
- package/dist/packages/_es/Menu.js +12 -15
- package/dist/packages/_es/MenuItem.js +7 -7
- package/dist/packages/_es/Navbar.js +4 -3
- package/dist/packages/_es/NoticeBar.js +40 -47
- package/dist/packages/_es/Notify.js +166 -27
- package/dist/packages/_es/NumberKeyboard.js +18 -8
- package/dist/packages/_es/OldPicker.js +120 -122
- package/dist/packages/_es/OverLay.js +25 -5
- package/dist/packages/_es/Pagination.js +14 -13
- package/dist/packages/_es/Picker.js +16 -39
- package/dist/packages/_es/Popover.js +29 -154
- package/dist/packages/_es/Popup.js +69 -6
- package/dist/packages/_es/Price.js +5 -17
- package/dist/packages/_es/Progress.js +8 -18
- package/dist/packages/_es/PullRefresh.js +1 -1
- package/dist/packages/_es/Radio.js +14 -4
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +33 -46
- package/dist/packages/_es/Rate.js +19 -16
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +11 -12
- package/dist/packages/_es/ShortPassword.js +67 -89
- package/dist/packages/_es/SideNavBar.js +16 -5
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +88 -69
- package/dist/packages/_es/Skeleton.js +11 -8
- package/dist/packages/_es/Sku.js +57 -49
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +23 -28
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +26 -39
- package/dist/packages/_es/Swiper.js +14 -32
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +3 -3
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +3 -3
- package/dist/packages/_es/TabbarItem.js +21 -11
- package/dist/packages/_es/Table.js +13 -13
- package/dist/packages/_es/Tabs.js +20 -21
- package/dist/packages/_es/Tag.js +4 -4
- package/dist/packages/_es/TextArea.js +42 -44
- package/dist/packages/_es/TimeDetail.js +3 -4
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +7 -8
- package/dist/packages/_es/Toast.js +170 -41
- package/dist/packages/_es/Uploader.js +138 -109
- package/dist/packages/_es/Video.js +9 -8
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +135 -3
- package/dist/packages/_es/index.js +6 -44
- package/dist/packages/_es/index2.js +31 -8
- package/dist/packages/_es/index3.js +7 -58
- package/dist/packages/_es/index4.js +56 -413
- package/dist/packages/_es/{index.taro.js → index5.js} +113 -140
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +19 -0
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +42 -42
- package/dist/styles/themes/jdt.scss +42 -42
- package/dist/types/__VUE/actionsheet/index.d.ts +269 -0
- package/dist/types/__VUE/address/index.d.ts +386 -0
- package/dist/types/__VUE/audio/index.d.ts +92 -0
- package/dist/types/__VUE/audiooperate/index.d.ts +68 -0
- package/dist/types/__VUE/avatar/index.d.ts +66 -0
- package/dist/types/__VUE/backtop/index.d.ts +105 -0
- package/dist/types/__VUE/badge/index.d.ts +94 -0
- package/dist/types/__VUE/barrage/index.d.ts +80 -0
- package/dist/types/__VUE/button/index.d.ts +116 -0
- package/dist/types/__VUE/calendar/index.d.ts +155 -0
- package/dist/types/__VUE/calendaritem/index.d.ts +195 -0
- package/dist/types/__VUE/card/index.d.ts +81 -0
- package/dist/types/__VUE/cascader/cascader-item.d.ts +76 -0
- package/dist/types/__VUE/cascader/helper.d.ts +8 -0
- package/dist/types/__VUE/cascader/index.d.ts +76 -0
- package/dist/types/__VUE/cascader/tree.d.ts +17 -0
- package/dist/types/__VUE/cascader/types.d.ts +30 -0
- package/dist/types/__VUE/cell/index.d.ts +109 -0
- package/dist/types/__VUE/cellgroup/index.d.ts +38 -0
- package/dist/types/__VUE/checkbox/index.d.ts +102 -0
- package/dist/types/__VUE/checkboxgroup/index.d.ts +39 -0
- package/dist/types/__VUE/circleprogress/index.d.ts +66 -0
- package/dist/types/__VUE/col/index.d.ts +42 -0
- package/dist/types/__VUE/collapse/index.d.ts +104 -0
- package/dist/types/__VUE/collapseitem/index.d.ts +83 -0
- package/dist/types/__VUE/countdown/index.d.ts +90 -0
- package/dist/types/__VUE/countup/index.d.ts +216 -0
- package/dist/types/__VUE/datepicker/index.d.ts +347 -0
- package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
- package/dist/types/__VUE/dialog/index.d.ts +306 -0
- package/dist/types/__VUE/divider/index.d.ts +47 -0
- package/dist/types/__VUE/drag/index.d.ts +61 -0
- package/dist/types/__VUE/elevator/index.d.ts +71 -0
- package/dist/types/__VUE/empty/index.d.ts +46 -0
- package/dist/types/__VUE/fixednav/index.d.ts +96 -0
- package/dist/types/__VUE/form/common.d.ts +20 -0
- package/dist/types/__VUE/form/index.d.ts +32 -0
- package/dist/types/__VUE/form/types.d.ts +13 -0
- package/dist/types/__VUE/formitem/index.d.ts +120 -0
- package/dist/types/__VUE/formitem/types.d.ts +10 -0
- package/dist/types/__VUE/grid/common.d.ts +91 -0
- package/dist/types/__VUE/grid/index.d.ts +100 -0
- package/dist/types/__VUE/griditem/index.d.ts +80 -0
- package/dist/types/__VUE/icon/index.d.ts +74 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +125 -0
- package/dist/types/__VUE/indicator/index.d.ts +70 -0
- package/dist/types/__VUE/infiniteloading/index.d.ts +140 -0
- package/dist/types/__VUE/input/index.d.ts +336 -0
- package/dist/types/__VUE/input/util.d.ts +5 -0
- package/dist/types/__VUE/inputnumber/index.d.ts +117 -0
- package/dist/types/__VUE/layout/index.d.ts +13 -0
- package/dist/types/__VUE/list/index.d.ts +48 -0
- package/dist/types/__VUE/menu/index.d.ts +51 -0
- package/dist/types/__VUE/menuitem/index.d.ts +77 -0
- package/dist/types/__VUE/navbar/index.d.ts +84 -0
- package/dist/types/__VUE/noticebar/index.d.ts +209 -0
- package/dist/types/__VUE/notify/index.d.ts +103 -0
- package/dist/types/__VUE/numberkeyboard/index.d.ts +123 -0
- package/dist/types/__VUE/oldpicker/Column.d.ts +96 -0
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
- package/dist/types/__VUE/oldpicker/index.d.ts +360 -0
- package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
- package/dist/types/__VUE/overlay/index.d.ts +1614 -0
- package/dist/types/__VUE/pagination/index.d.ts +112 -0
- package/dist/types/__VUE/picker/Column.d.ts +90 -0
- package/dist/types/__VUE/picker/index.d.ts +342 -0
- package/dist/types/__VUE/picker/types.d.ts +26 -0
- package/dist/types/__VUE/popover/index.d.ts +233 -0
- package/dist/types/__VUE/popup/index.d.ts +1734 -0
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
- package/dist/types/__VUE/price/index.d.ts +87 -0
- package/dist/types/__VUE/progress/index.d.ts +137 -0
- package/dist/types/__VUE/pullrefresh/index.d.ts +128 -0
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +20 -0
- package/dist/types/__VUE/pullrefresh/util.d.ts +6 -0
- package/dist/types/__VUE/radio/index.d.ts +90 -0
- package/dist/types/__VUE/radiogroup/index.d.ts +48 -0
- package/dist/types/__VUE/range/index.d.ts +156 -0
- package/dist/types/__VUE/rate/index.d.ts +142 -0
- package/dist/types/__VUE/row/index.d.ts +63 -0
- package/dist/types/__VUE/searchbar/index.d.ts +100 -0
- package/dist/types/__VUE/shortpassword/index.d.ts +136 -0
- package/dist/types/__VUE/sidenavbar/index.d.ts +36 -0
- package/dist/types/__VUE/sidenavbaritem/index.d.ts +41 -0
- package/dist/types/__VUE/signature/index.d.ts +73 -0
- package/dist/types/__VUE/skeleton/common.d.ts +63 -0
- package/dist/types/__VUE/skeleton/index.d.ts +117 -0
- package/dist/types/__VUE/sku/components/SkuHeader.d.ts +27 -0
- package/dist/types/__VUE/sku/components/SkuOperate.d.ts +70 -0
- package/dist/types/__VUE/sku/components/SkuSelect.d.ts +30 -0
- package/dist/types/__VUE/sku/components/SkuStepper.d.ts +67 -0
- package/dist/types/__VUE/sku/index.d.ts +300 -0
- package/dist/types/__VUE/step/index.d.ts +70 -0
- package/dist/types/__VUE/steps/index.d.ts +47 -0
- package/dist/types/__VUE/sticky/index.d.ts +63 -0
- package/dist/types/__VUE/subsidenavbar/index.d.ts +54 -0
- package/dist/types/__VUE/swipe/index.d.ts +69 -0
- package/dist/types/__VUE/swiper/index.d.ts +163 -0
- package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
- package/dist/types/__VUE/swiperitem/index.d.ts +24 -0
- package/dist/types/__VUE/switch/index.d.ts +136 -0
- package/dist/types/__VUE/tabbar/index.d.ts +84 -0
- package/dist/types/__VUE/tabbaritem/index.d.ts +108 -0
- package/dist/types/__VUE/table/common.d.ts +54 -0
- package/dist/types/__VUE/table/index.d.ts +75 -0
- package/dist/types/__VUE/table/renderColumn.d.ts +20 -0
- package/dist/types/__VUE/table/types.d.ts +19 -0
- package/dist/types/__VUE/tabpane/index.d.ts +47 -0
- package/dist/types/__VUE/tabs/index.d.ts +128 -0
- package/dist/types/__VUE/tag/index.d.ts +89 -0
- package/dist/types/__VUE/textarea/index.d.ts +120 -0
- package/dist/types/__VUE/timedetail/index.d.ts +48 -0
- package/dist/types/__VUE/timepannel/index.d.ts +43 -0
- package/dist/types/__VUE/timeselect/index.d.ts +82 -0
- package/dist/types/__VUE/toast/index.d.ts +149 -0
- package/dist/types/__VUE/uploader/index.d.ts +258 -0
- package/dist/types/__VUE/uploader/uploader.d.ts +25 -0
- package/dist/types/__VUE/video/index.d.ts +123 -0
- package/dist/{index.d.ts → types/index.d.ts} +0 -0
- package/dist/types/nutui.d.ts +92 -0
- package/package.json +14 -5
- package/dist/nutui.d.ts +0 -104
- package/dist/packages/_es/use-lock-scroll.js +0 -23
- package/dist/packages/_es/util.js +0 -47
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { inject, getCurrentInstance, onUnmounted, computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, Fragment, createBlock, toDisplayString } from "vue";
|
|
7
|
+
import { u as useRouter } from "./index.js";
|
|
7
8
|
import { c as createComponent } from "./component.js";
|
|
8
9
|
import { p as pxCheck } from "./pxCheck.js";
|
|
9
10
|
import { G as GRID_KEY } from "./common.js";
|
|
@@ -15,10 +16,10 @@ function useInject(key) {
|
|
|
15
16
|
const { add, remove, internalChildren } = parent;
|
|
16
17
|
add(instance);
|
|
17
18
|
onUnmounted(() => remove(instance));
|
|
18
|
-
const
|
|
19
|
+
const index2 = computed(() => internalChildren.indexOf(instance));
|
|
19
20
|
return {
|
|
20
21
|
parent,
|
|
21
|
-
index
|
|
22
|
+
index: index2
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
return {
|
|
@@ -40,6 +41,17 @@ const _sfc_main = create({
|
|
|
40
41
|
},
|
|
41
42
|
iconColor: {
|
|
42
43
|
type: String
|
|
44
|
+
},
|
|
45
|
+
to: {
|
|
46
|
+
type: [String, Object]
|
|
47
|
+
},
|
|
48
|
+
url: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ""
|
|
51
|
+
},
|
|
52
|
+
replace: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
43
55
|
}
|
|
44
56
|
},
|
|
45
57
|
emits: ["click"],
|
|
@@ -47,7 +59,7 @@ const _sfc_main = create({
|
|
|
47
59
|
const Parent = useInject(GRID_KEY);
|
|
48
60
|
if (!Parent.parent)
|
|
49
61
|
return;
|
|
50
|
-
const
|
|
62
|
+
const index2 = Parent.index;
|
|
51
63
|
const parent = Parent.parent.props;
|
|
52
64
|
const rootClass = computed(() => {
|
|
53
65
|
const prefixCls = componentName;
|
|
@@ -63,7 +75,7 @@ const _sfc_main = create({
|
|
|
63
75
|
style.paddingTop = `${100 / +parent.columnNum}%`;
|
|
64
76
|
} else if (parent.gutter) {
|
|
65
77
|
style.paddingRight = pxCheck(parent.gutter);
|
|
66
|
-
if (
|
|
78
|
+
if (index2.value >= parent.columnNum) {
|
|
67
79
|
style.marginTop = pxCheck(parent.gutter);
|
|
68
80
|
}
|
|
69
81
|
}
|
|
@@ -79,7 +91,7 @@ const _sfc_main = create({
|
|
|
79
91
|
[`${prefixCls}--square`]: parent.square,
|
|
80
92
|
[`${prefixCls}--reverse`]: parent.reverse,
|
|
81
93
|
[`${prefixCls}--${parent.direction}`]: !!parent.direction,
|
|
82
|
-
[`${prefixCls}--clickable`]: parent.clickable
|
|
94
|
+
[`${prefixCls}--clickable`]: parent.clickable || props.to || props.url
|
|
83
95
|
};
|
|
84
96
|
});
|
|
85
97
|
const iconProps = computed(() => {
|
|
@@ -89,8 +101,14 @@ const _sfc_main = create({
|
|
|
89
101
|
color: props.iconColor || parent.iconColor
|
|
90
102
|
};
|
|
91
103
|
});
|
|
104
|
+
const router = useRouter();
|
|
92
105
|
const handleClick = (event) => {
|
|
93
106
|
emit("click", event);
|
|
107
|
+
if (props.to && router) {
|
|
108
|
+
router[props.replace ? "replace" : "push"](props.to);
|
|
109
|
+
} else if (props.url) {
|
|
110
|
+
props.replace ? location.replace(props.url) : location.href = props.url;
|
|
111
|
+
}
|
|
94
112
|
};
|
|
95
113
|
return {
|
|
96
114
|
rootClass,
|
|
@@ -127,5 +145,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
127
145
|
], 2)
|
|
128
146
|
], 6);
|
|
129
147
|
}
|
|
130
|
-
var
|
|
131
|
-
export {
|
|
148
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
149
|
+
export { index as default };
|
|
@@ -17,24 +17,26 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
20
24
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.19-beta.
|
|
25
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
22
26
|
* (c) 2022 @jdf2e.
|
|
23
27
|
* Released under the MIT License.
|
|
24
28
|
*/
|
|
25
|
-
import { toRefs, reactive, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withModifiers, createElementBlock, Fragment, renderList, createCommentVNode, toDisplayString } from "vue";
|
|
29
|
+
import { toRefs, reactive, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withModifiers, createElementBlock, Fragment, renderList, createVNode, createCommentVNode, toDisplayString, render, h } from "vue";
|
|
26
30
|
import { c as createComponent } from "./component.js";
|
|
27
31
|
import Popup from "./Popup.js";
|
|
32
|
+
import Video from "./Video.js";
|
|
28
33
|
import Swiper from "./Swiper.js";
|
|
29
34
|
import SwiperItem from "./SwiperItem.js";
|
|
30
35
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
31
|
-
import "./use-lock-scroll.js";
|
|
32
36
|
import "./OverLay.js";
|
|
33
37
|
import "./Icon.js";
|
|
34
38
|
import "./pxCheck.js";
|
|
35
|
-
import "./
|
|
36
|
-
import "./index2.js";
|
|
37
|
-
import "@tarojs/taro";
|
|
39
|
+
import "./index3.js";
|
|
38
40
|
const { componentName, create } = createComponent("imagepreview");
|
|
39
41
|
const _sfc_main = create({
|
|
40
42
|
props: {
|
|
@@ -46,6 +48,10 @@ const _sfc_main = create({
|
|
|
46
48
|
type: Array,
|
|
47
49
|
default: () => []
|
|
48
50
|
},
|
|
51
|
+
videos: {
|
|
52
|
+
type: Array,
|
|
53
|
+
default: () => []
|
|
54
|
+
},
|
|
49
55
|
contentClose: {
|
|
50
56
|
type: Boolean,
|
|
51
57
|
default: false
|
|
@@ -65,11 +71,16 @@ const _sfc_main = create({
|
|
|
65
71
|
autoplay: {
|
|
66
72
|
type: [Number, String],
|
|
67
73
|
default: 3e3
|
|
74
|
+
},
|
|
75
|
+
isWrapTeleport: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
68
78
|
}
|
|
69
79
|
},
|
|
70
80
|
emits: ["close"],
|
|
71
81
|
components: {
|
|
72
82
|
[Popup.name]: Popup,
|
|
83
|
+
[Video.name]: Video,
|
|
73
84
|
[Swiper.name]: Swiper,
|
|
74
85
|
[SwiperItem.name]: SwiperItem
|
|
75
86
|
},
|
|
@@ -113,9 +124,7 @@ const _sfc_main = create({
|
|
|
113
124
|
return Math.hypot(Math.abs(second.x - first.x), Math.abs(second.y - first.y));
|
|
114
125
|
};
|
|
115
126
|
const scaleNow = () => {
|
|
116
|
-
|
|
117
|
-
state.eleImg.style.transform = "scale(" + state.store.scale + ")";
|
|
118
|
-
}
|
|
127
|
+
state.eleImg.style.transform = "scale(" + state.store.scale + ")";
|
|
119
128
|
};
|
|
120
129
|
const onTouchStart = (event) => {
|
|
121
130
|
const curTouchTime = new Date().getTime();
|
|
@@ -190,7 +199,7 @@ const _sfc_main = create({
|
|
|
190
199
|
onMounted(() => {
|
|
191
200
|
state.active = props.initNo;
|
|
192
201
|
state.showPop = props.show;
|
|
193
|
-
state.maxNo = props.images.length;
|
|
202
|
+
state.maxNo = props.images.length + props.videos.length;
|
|
194
203
|
});
|
|
195
204
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
196
205
|
slideChangeEnd,
|
|
@@ -207,6 +216,7 @@ const _sfc_main = create({
|
|
|
207
216
|
const _hoisted_1 = ["src"];
|
|
208
217
|
const _hoisted_2 = { class: "nut-imagepreview-index" };
|
|
209
218
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
219
|
+
const _component_nut_video = resolveComponent("nut-video");
|
|
210
220
|
const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
|
|
211
221
|
const _component_nut_swiper = resolveComponent("nut-swiper");
|
|
212
222
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
@@ -214,6 +224,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
214
224
|
"pop-class": "custom-pop",
|
|
215
225
|
visible: _ctx.showPop,
|
|
216
226
|
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.showPop = $event),
|
|
227
|
+
isWrapTeleport: _ctx.isWrapTeleport,
|
|
217
228
|
onClick: _ctx.onClose,
|
|
218
229
|
style: { "width": "100%" }
|
|
219
230
|
}, {
|
|
@@ -236,6 +247,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
236
247
|
"pagination-color": _ctx.paginationColor
|
|
237
248
|
}, {
|
|
238
249
|
default: withCtx(() => [
|
|
250
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.videos, (item, index) => {
|
|
251
|
+
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
252
|
+
default: withCtx(() => [
|
|
253
|
+
createVNode(_component_nut_video, {
|
|
254
|
+
source: item.source,
|
|
255
|
+
options: item.options
|
|
256
|
+
}, null, 8, ["source", "options"])
|
|
257
|
+
]),
|
|
258
|
+
_: 2
|
|
259
|
+
}, 1024);
|
|
260
|
+
}), 128)),
|
|
239
261
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.images, (item, index) => {
|
|
240
262
|
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
241
263
|
default: withCtx(() => [
|
|
@@ -251,10 +273,57 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
251
273
|
_: 1
|
|
252
274
|
}, 8, ["auto-play", "onChange", "init-page", "pagination-visible", "pagination-color"])) : createCommentVNode("", true)
|
|
253
275
|
], 32),
|
|
254
|
-
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length), 1)
|
|
276
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length + _ctx.videos.length), 1)
|
|
255
277
|
]),
|
|
256
278
|
_: 1
|
|
257
|
-
}, 8, ["visible", "onClick"]);
|
|
279
|
+
}, 8, ["visible", "isWrapTeleport", "onClick"]);
|
|
280
|
+
}
|
|
281
|
+
var ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
282
|
+
class ImagePreviewOptions {
|
|
283
|
+
constructor() {
|
|
284
|
+
__publicField(this, "show", false);
|
|
285
|
+
__publicField(this, "images", []);
|
|
286
|
+
__publicField(this, "initNo", 1);
|
|
287
|
+
__publicField(this, "paginationVisible", false);
|
|
288
|
+
__publicField(this, "paginationColor", "");
|
|
289
|
+
__publicField(this, "teleport", "body");
|
|
290
|
+
__publicField(this, "onClose", () => {
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
class ImagePreviewFunction {
|
|
295
|
+
constructor(_options) {
|
|
296
|
+
__publicField(this, "options", new ImagePreviewOptions());
|
|
297
|
+
let options = Object.assign(this.options, _options);
|
|
298
|
+
let elWarp = document.body;
|
|
299
|
+
let teleport = options.teleport;
|
|
300
|
+
if (teleport != "body") {
|
|
301
|
+
if (typeof teleport == "string") {
|
|
302
|
+
elWarp = document.querySelector(teleport);
|
|
303
|
+
} else {
|
|
304
|
+
elWarp = options.teleport;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const root = document.createElement("view");
|
|
308
|
+
root.id = "imagepreview-" + new Date().getTime();
|
|
309
|
+
const Wrapper = {
|
|
310
|
+
setup() {
|
|
311
|
+
options.teleport = `#${root.id}`;
|
|
312
|
+
return () => {
|
|
313
|
+
return h(ImagePreview, options);
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
const instance = createVNode(Wrapper);
|
|
318
|
+
elWarp.appendChild(root);
|
|
319
|
+
render(instance, root);
|
|
320
|
+
}
|
|
258
321
|
}
|
|
259
|
-
|
|
260
|
-
|
|
322
|
+
const _ImagePreview = function(options) {
|
|
323
|
+
return new ImagePreviewFunction(options);
|
|
324
|
+
};
|
|
325
|
+
_ImagePreview.install = (app) => {
|
|
326
|
+
app.use(ImagePreview);
|
|
327
|
+
app.config.globalProperties.$imagepreview = _ImagePreview;
|
|
328
|
+
};
|
|
329
|
+
export { ImagePreview, ImagePreviewOptions, _ImagePreview as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -62,5 +62,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
62
62
|
}), 128))
|
|
63
63
|
], 2);
|
|
64
64
|
}
|
|
65
|
-
var
|
|
66
|
-
export {
|
|
65
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
66
|
+
export { index as default };
|
|
@@ -18,16 +18,13 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.19-beta.
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { reactive, computed, onMounted, toRefs, resolveComponent, openBlock,
|
|
25
|
+
import { reactive, computed, onMounted, onUnmounted, ref, onActivated, onDeactivated, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, toDisplayString, renderSlot, createCommentVNode } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import _sfc_main$1 from "./Icon.js";
|
|
28
|
-
import Taro from "@tarojs/taro";
|
|
29
27
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
|
-
import "./pxCheck.js";
|
|
31
28
|
const { componentName, create } = createComponent("infiniteloading");
|
|
32
29
|
const _sfc_main = create({
|
|
33
30
|
props: {
|
|
@@ -39,10 +36,6 @@ const _sfc_main = create({
|
|
|
39
36
|
type: Number,
|
|
40
37
|
default: 200
|
|
41
38
|
},
|
|
42
|
-
upperThreshold: {
|
|
43
|
-
type: Number,
|
|
44
|
-
default: 40
|
|
45
|
-
},
|
|
46
39
|
pullIcon: {
|
|
47
40
|
type: String,
|
|
48
41
|
default: "https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png"
|
|
@@ -81,16 +74,14 @@ const _sfc_main = create({
|
|
|
81
74
|
}
|
|
82
75
|
},
|
|
83
76
|
emits: ["scroll-change", "load-more", "refresh"],
|
|
84
|
-
components: {
|
|
85
|
-
"nut-icon": _sfc_main$1
|
|
86
|
-
},
|
|
87
77
|
setup(props, { emit, slots }) {
|
|
88
78
|
const state = reactive({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
79
|
+
scrollEl: window,
|
|
80
|
+
scroller: null,
|
|
81
|
+
refreshTop: null,
|
|
82
|
+
beforeScrollTop: 0,
|
|
93
83
|
isTouching: false,
|
|
84
|
+
isInfiniting: false,
|
|
94
85
|
refreshMaxH: 0,
|
|
95
86
|
y: 0,
|
|
96
87
|
x: 0,
|
|
@@ -109,43 +100,69 @@ const _sfc_main = create({
|
|
|
109
100
|
};
|
|
110
101
|
});
|
|
111
102
|
const getParentElement = (el) => {
|
|
112
|
-
return
|
|
103
|
+
return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;
|
|
113
104
|
};
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}).exec();
|
|
105
|
+
const requestAniFrame = () => {
|
|
106
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
107
|
+
window.setTimeout(callback, 1e3 / 60);
|
|
108
|
+
};
|
|
119
109
|
};
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
emit("load-more", infiniteDone);
|
|
126
|
-
}
|
|
110
|
+
const getWindowScrollTop = () => {
|
|
111
|
+
return window.pageYOffset !== void 0 ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
|
112
|
+
};
|
|
113
|
+
const calculateTopPosition = (el) => {
|
|
114
|
+
return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
|
|
127
115
|
};
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
116
|
+
const isScrollAtBottom = () => {
|
|
117
|
+
let offsetDistance = 0;
|
|
118
|
+
let resScrollTop = 0;
|
|
119
|
+
let direction = "down";
|
|
120
|
+
const windowScrollTop = getWindowScrollTop();
|
|
121
|
+
if (props.useWindow) {
|
|
122
|
+
if (state.scroller) {
|
|
123
|
+
offsetDistance = calculateTopPosition(state.scroller) + state.scroller.offsetHeight - windowScrollTop - window.innerHeight;
|
|
124
|
+
}
|
|
125
|
+
resScrollTop = windowScrollTop;
|
|
126
|
+
} else {
|
|
127
|
+
const { scrollHeight, clientHeight, scrollTop } = state.scrollEl;
|
|
128
|
+
offsetDistance = scrollHeight - clientHeight - scrollTop;
|
|
129
|
+
resScrollTop = scrollTop;
|
|
133
130
|
}
|
|
134
|
-
if (
|
|
135
|
-
|
|
131
|
+
if (state.beforeScrollTop > resScrollTop) {
|
|
132
|
+
direction = "up";
|
|
136
133
|
} else {
|
|
137
|
-
|
|
134
|
+
direction = "down";
|
|
138
135
|
}
|
|
139
|
-
state.
|
|
140
|
-
emit("scroll-change",
|
|
136
|
+
state.beforeScrollTop = resScrollTop;
|
|
137
|
+
emit("scroll-change", resScrollTop);
|
|
138
|
+
return offsetDistance <= props.threshold && direction == "down";
|
|
141
139
|
};
|
|
142
140
|
const infiniteDone = () => {
|
|
143
141
|
state.isInfiniting = false;
|
|
144
142
|
};
|
|
143
|
+
const handleScroll = () => {
|
|
144
|
+
requestAniFrame()(() => {
|
|
145
|
+
if (!isScrollAtBottom() || !props.hasMore || state.isInfiniting) {
|
|
146
|
+
return false;
|
|
147
|
+
} else {
|
|
148
|
+
state.isInfiniting = true;
|
|
149
|
+
emit("load-more", infiniteDone);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
const scrollListener = () => {
|
|
154
|
+
state.scrollEl.addEventListener("scroll", handleScroll, props.useCapture);
|
|
155
|
+
};
|
|
156
|
+
const refreshDone = () => {
|
|
157
|
+
state.distance = 0;
|
|
158
|
+
state.isTouching = false;
|
|
159
|
+
};
|
|
145
160
|
const touchStart = (event) => {
|
|
146
|
-
if (state.
|
|
161
|
+
if (state.beforeScrollTop == 0 && !state.isTouching && props.isOpenRefresh) {
|
|
147
162
|
state.y = event.touches[0].pageY;
|
|
148
163
|
state.isTouching = true;
|
|
164
|
+
const childHeight = state.refreshTop.firstElementChild.offsetHeight;
|
|
165
|
+
state.refreshMaxH = Math.floor(childHeight * 1 + 10);
|
|
149
166
|
}
|
|
150
167
|
};
|
|
151
168
|
const touchMove = (event) => {
|
|
@@ -166,21 +183,28 @@ const _sfc_main = create({
|
|
|
166
183
|
emit("refresh", refreshDone);
|
|
167
184
|
}
|
|
168
185
|
};
|
|
169
|
-
const refreshDone = () => {
|
|
170
|
-
state.distance = 0;
|
|
171
|
-
state.isTouching = false;
|
|
172
|
-
};
|
|
173
186
|
onMounted(() => {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
187
|
+
const parentElement = getParentElement(state.scroller);
|
|
188
|
+
state.scrollEl = props.useWindow ? window : parentElement;
|
|
189
|
+
scrollListener();
|
|
190
|
+
});
|
|
191
|
+
onUnmounted(() => {
|
|
192
|
+
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
193
|
+
});
|
|
194
|
+
const isKeepAlive = ref(false);
|
|
195
|
+
onActivated(() => {
|
|
196
|
+
if (isKeepAlive.value) {
|
|
197
|
+
isKeepAlive.value = false;
|
|
198
|
+
scrollListener();
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
onDeactivated(() => {
|
|
202
|
+
isKeepAlive.value = true;
|
|
203
|
+
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
178
204
|
});
|
|
179
205
|
return __spreadProps(__spreadValues({
|
|
180
206
|
classes
|
|
181
207
|
}, toRefs(state)), {
|
|
182
|
-
lower,
|
|
183
|
-
scroll,
|
|
184
208
|
touchStart,
|
|
185
209
|
touchMove,
|
|
186
210
|
touchEnd,
|
|
@@ -188,10 +212,7 @@ const _sfc_main = create({
|
|
|
188
212
|
});
|
|
189
213
|
}
|
|
190
214
|
});
|
|
191
|
-
const _hoisted_1 = {
|
|
192
|
-
class: "top-box",
|
|
193
|
-
id: "refreshTop"
|
|
194
|
-
};
|
|
215
|
+
const _hoisted_1 = { class: "top-box" };
|
|
195
216
|
const _hoisted_2 = { class: "top-text" };
|
|
196
217
|
const _hoisted_3 = { class: "nut-infinite-container" };
|
|
197
218
|
const _hoisted_4 = { class: "nut-infinite-bottom" };
|
|
@@ -206,46 +227,39 @@ const _hoisted_7 = {
|
|
|
206
227
|
};
|
|
207
228
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
208
229
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
209
|
-
|
|
210
|
-
return openBlock(), createBlock(_component_scroll_view, {
|
|
230
|
+
return openBlock(), createElementBlock("view", {
|
|
211
231
|
class: normalizeClass(_ctx.classes),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
createElementVNode("view",
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
class: "top-img",
|
|
229
|
-
name: _ctx.pullIcon
|
|
230
|
-
}, null, 8, ["name"]),
|
|
231
|
-
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.pullTxt), 1)
|
|
232
|
-
])
|
|
233
|
-
], 4),
|
|
234
|
-
createElementVNode("view", _hoisted_3, [
|
|
235
|
-
renderSlot(_ctx.$slots, "default")
|
|
236
|
-
]),
|
|
237
|
-
createElementVNode("view", _hoisted_4, [
|
|
238
|
-
_ctx.isInfiniting ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
239
|
-
createVNode(_component_nut_icon, {
|
|
240
|
-
class: "bottom-img",
|
|
241
|
-
name: _ctx.loadIcon
|
|
242
|
-
}, null, 8, ["name"]),
|
|
243
|
-
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.loadTxt), 1)
|
|
244
|
-
])) : !_ctx.hasMore ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt), 1)) : createCommentVNode("", true)
|
|
232
|
+
ref: "scroller",
|
|
233
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
|
|
234
|
+
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.touchMove && _ctx.touchMove(...args)),
|
|
235
|
+
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
236
|
+
}, [
|
|
237
|
+
createElementVNode("view", {
|
|
238
|
+
class: "nut-infinite-top",
|
|
239
|
+
ref: "refreshTop",
|
|
240
|
+
style: normalizeStyle(_ctx.getStyle)
|
|
241
|
+
}, [
|
|
242
|
+
createElementVNode("view", _hoisted_1, [
|
|
243
|
+
createVNode(_component_nut_icon, {
|
|
244
|
+
class: "top-img",
|
|
245
|
+
name: _ctx.pullIcon
|
|
246
|
+
}, null, 8, ["name"]),
|
|
247
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.pullTxt), 1)
|
|
245
248
|
])
|
|
249
|
+
], 4),
|
|
250
|
+
createElementVNode("view", _hoisted_3, [
|
|
251
|
+
renderSlot(_ctx.$slots, "default")
|
|
246
252
|
]),
|
|
247
|
-
|
|
248
|
-
|
|
253
|
+
createElementVNode("view", _hoisted_4, [
|
|
254
|
+
_ctx.isInfiniting ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
255
|
+
createVNode(_component_nut_icon, {
|
|
256
|
+
class: "bottom-img",
|
|
257
|
+
name: _ctx.loadIcon
|
|
258
|
+
}, null, 8, ["name"]),
|
|
259
|
+
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.loadTxt), 1)
|
|
260
|
+
])) : !_ctx.hasMore ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt), 1)) : createCommentVNode("", true)
|
|
261
|
+
])
|
|
262
|
+
], 34);
|
|
249
263
|
}
|
|
250
|
-
var
|
|
251
|
-
export {
|
|
264
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
265
|
+
export { index as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -7,14 +7,14 @@ import { ref, reactive, computed, watch, onMounted, resolveComponent, openBlock,
|
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
function trimExtraChar(value, char, regExp) {
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
10
|
+
const index2 = value.indexOf(char);
|
|
11
|
+
if (index2 === -1) {
|
|
12
12
|
return value;
|
|
13
13
|
}
|
|
14
|
-
if (char === "-" &&
|
|
15
|
-
return value.slice(0,
|
|
14
|
+
if (char === "-" && index2 !== 0) {
|
|
15
|
+
return value.slice(0, index2);
|
|
16
16
|
}
|
|
17
|
-
return value.slice(0,
|
|
17
|
+
return value.slice(0, index2 + 1) + value.slice(index2).replace(regExp, "");
|
|
18
18
|
}
|
|
19
19
|
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
20
20
|
if (allowDot) {
|
|
@@ -413,5 +413,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
413
413
|
])
|
|
414
414
|
], 2);
|
|
415
415
|
}
|
|
416
|
-
var
|
|
417
|
-
export {
|
|
416
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
417
|
+
export { index as default };
|