@nutui/nutui 3.1.16 → 3.1.18-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +1 -1
- package/dist/nutui.d.ts +3 -1
- package/dist/nutui.es.js +1860 -773
- package/dist/nutui.umd.js +1871 -778
- package/dist/packages/_es/ActionSheet.js +8 -3
- package/dist/packages/_es/Address.js +60 -7
- package/dist/packages/_es/Audio.js +289 -0
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/BackTop.js +3 -3
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +13 -4
- package/dist/packages/_es/Calendar.js +428 -209
- package/dist/packages/_es/Card.js +1 -2
- package/dist/packages/_es/Cascader.js +2 -2
- package/dist/packages/_es/Cell.js +2 -2
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +2 -2
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +1 -1
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +1 -1
- package/dist/packages/_es/CollapseItem.js +4 -2
- package/dist/packages/_es/CountDown.js +1 -1
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +1 -2
- package/dist/packages/_es/Dialog.js +1 -1
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Elevator.js +10 -5
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +1 -1
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +2 -2
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +8 -5
- package/dist/packages/_es/Indicator.js +1 -1
- package/dist/packages/_es/InfiniteLoading.js +1 -1
- package/dist/packages/_es/Input.js +7 -2
- package/dist/packages/_es/InputNumber.js +1 -1
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/Menu.js +1 -1
- package/dist/packages/_es/MenuItem.js +1 -1
- package/dist/packages/_es/Navbar.js +18 -59
- package/dist/packages/_es/NoticeBar.js +38 -23
- package/dist/packages/_es/Notify.js +2 -2
- package/dist/packages/_es/NumberKeyboard.js +1 -2
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +2 -1
- package/dist/packages/_es/Popover.js +4 -1
- package/dist/packages/_es/Popup.js +1 -1
- package/dist/packages/_es/Price.js +1 -1
- package/dist/packages/_es/Progress.js +24 -11
- package/dist/packages/_es/Radio.js +2 -2
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +2 -2
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +12 -4
- package/dist/packages/_es/SideNavBar.js +1 -1
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +8 -6
- package/dist/packages/_es/Sku.js +1 -1
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +143 -0
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +2 -2
- package/dist/packages/_es/Swiper.js +2 -2
- package/dist/packages/_es/SwiperItem.js +3 -8
- package/dist/packages/_es/Switch.js +2 -2
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +1 -1
- package/dist/packages/_es/TabbarItem.js +7 -3
- package/dist/packages/_es/Table.js +2 -2
- package/dist/packages/_es/Tabs.js +1 -1
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +1 -1
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +7 -2
- package/dist/packages/_es/Toast.js +15 -8
- package/dist/packages/_es/Uploader.js +1 -1
- package/dist/packages/_es/Video.js +1 -55
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +5 -7
- package/dist/packages/_es/index2.js +7 -58
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/index4.js +64 -0
- 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 +1 -1
- package/dist/packages/_es/util.js +1 -1
- package/dist/packages/actionsheet/index.scss +7 -6
- package/dist/packages/address/index.scss +8 -0
- package/dist/packages/audio/index.scss +66 -0
- package/dist/packages/audiooperate/index.scss +13 -0
- package/dist/packages/button/index.scss +5 -5
- package/dist/packages/calendar/index.scss +47 -41
- package/dist/packages/calendaritem/index.scss +57 -42
- package/dist/packages/cell/index.scss +3 -3
- package/dist/packages/cellgroup/index.scss +1 -1
- package/dist/packages/elevator/index.scss +3 -0
- package/dist/packages/infiniteloading/index.scss +1 -1
- package/dist/packages/input/index.scss +4 -2
- package/dist/packages/navbar/index.scss +2 -0
- package/dist/packages/noticebar/index.scss +11 -5
- package/dist/packages/notify/index.scss +1 -0
- package/dist/packages/progress/index.scss +21 -17
- package/dist/packages/range/index.scss +8 -8
- package/dist/packages/row/index.scss +3 -0
- package/dist/packages/sticky/index.scss +5 -0
- package/dist/packages/swiper/index.scss +4 -4
- package/dist/packages/switch/index.scss +8 -8
- package/dist/packages/tabbar/index.scss +7 -4
- package/dist/packages/tabbaritem/index.scss +4 -3
- package/dist/packages/tabs/index.scss +1 -0
- package/dist/packages/toast/index.scss +8 -7
- package/dist/style.css +1 -1
- package/dist/styles/font/config.json +6 -1
- package/dist/styles/font/demo_index.html +118 -3
- package/dist/styles/font/iconfont.css +23 -3
- package/dist/styles/font/iconfont.js +25 -24
- package/dist/styles/font/iconfont.json +35 -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 +46 -43
- package/dist/styles/variables.scss +123 -42
- package/package.json +12 -13
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { ref, reactive, computed, watch, onMounted, onUnmounted, h, unref } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useRect } from "./index3.js";
|
|
9
|
+
const { componentName, create } = createComponent("sticky");
|
|
10
|
+
const _sfc_main = create({
|
|
11
|
+
props: {
|
|
12
|
+
position: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "top"
|
|
15
|
+
},
|
|
16
|
+
top: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
default: 0
|
|
19
|
+
},
|
|
20
|
+
bottom: {
|
|
21
|
+
type: [Number, String],
|
|
22
|
+
default: 0
|
|
23
|
+
},
|
|
24
|
+
container: {
|
|
25
|
+
type: Object
|
|
26
|
+
},
|
|
27
|
+
zIndex: {
|
|
28
|
+
type: [Number, String],
|
|
29
|
+
default: 2e3
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ["change", "scroll"],
|
|
33
|
+
setup(props, { emit, slots }) {
|
|
34
|
+
const root = ref();
|
|
35
|
+
const state = reactive({
|
|
36
|
+
width: 0,
|
|
37
|
+
height: 0,
|
|
38
|
+
fixed: false,
|
|
39
|
+
transform: 0
|
|
40
|
+
});
|
|
41
|
+
const rootStyle = computed(() => {
|
|
42
|
+
const { fixed, width, height } = state;
|
|
43
|
+
if (fixed) {
|
|
44
|
+
return {
|
|
45
|
+
width: `${width}px`,
|
|
46
|
+
height: `${height}px`
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const stickyStyle = computed(() => {
|
|
51
|
+
if (!state.fixed)
|
|
52
|
+
return;
|
|
53
|
+
const style = {
|
|
54
|
+
width: `${state.width}px`,
|
|
55
|
+
height: `${state.height}px`,
|
|
56
|
+
[props.position]: `${offset.value}px`,
|
|
57
|
+
zIndex: +props.zIndex
|
|
58
|
+
};
|
|
59
|
+
if (state.transform)
|
|
60
|
+
style.transform = `translate3d(0, ${state.transform}px, 0)`;
|
|
61
|
+
return style;
|
|
62
|
+
});
|
|
63
|
+
const offset = computed(() => {
|
|
64
|
+
return props.position === "top" ? props.top : props.bottom;
|
|
65
|
+
});
|
|
66
|
+
const isHidden = (elementRef) => {
|
|
67
|
+
const el = unref(elementRef);
|
|
68
|
+
if (!el)
|
|
69
|
+
return false;
|
|
70
|
+
const style = window.getComputedStyle(el);
|
|
71
|
+
const hidden = style.display === "none";
|
|
72
|
+
const parentHidden = el.offsetParent === null && style.position !== "fixed";
|
|
73
|
+
return hidden || parentHidden;
|
|
74
|
+
};
|
|
75
|
+
const isExistRoot = () => {
|
|
76
|
+
if (!root.value || isHidden(root))
|
|
77
|
+
return false;
|
|
78
|
+
return true;
|
|
79
|
+
};
|
|
80
|
+
const getScrollTop = (el) => {
|
|
81
|
+
return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
|
|
82
|
+
};
|
|
83
|
+
const renderFixed = () => {
|
|
84
|
+
var _a;
|
|
85
|
+
return h("view", {
|
|
86
|
+
style: stickyStyle.value,
|
|
87
|
+
class: state.fixed ? `${componentName} nut-sticky--fixed` : componentName
|
|
88
|
+
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
89
|
+
};
|
|
90
|
+
const onScroll = () => {
|
|
91
|
+
if (!isExistRoot())
|
|
92
|
+
return;
|
|
93
|
+
const { container, position } = props;
|
|
94
|
+
const scrollTop = getScrollTop(window);
|
|
95
|
+
const rootRect = useRect(root);
|
|
96
|
+
if (rootRect.width || rootRect.height) {
|
|
97
|
+
state.width = rootRect.width;
|
|
98
|
+
state.height = rootRect.height;
|
|
99
|
+
}
|
|
100
|
+
if (position === "top") {
|
|
101
|
+
if (container) {
|
|
102
|
+
const containerRect = useRect(container);
|
|
103
|
+
const diff = containerRect.bottom - +offset.value - state.height;
|
|
104
|
+
state.fixed = +offset.value > rootRect.top && containerRect.bottom > 0;
|
|
105
|
+
state.transform = diff < 0 ? diff : 0;
|
|
106
|
+
} else {
|
|
107
|
+
state.fixed = offset.value > rootRect.top;
|
|
108
|
+
}
|
|
109
|
+
} else if (position === "bottom") {
|
|
110
|
+
const clientHeight = document.documentElement.clientHeight;
|
|
111
|
+
if (container) {
|
|
112
|
+
const containerRect = useRect(container);
|
|
113
|
+
const diff = clientHeight - containerRect.top - +offset.value - state.height;
|
|
114
|
+
state.fixed = clientHeight - +offset.value < rootRect.bottom && clientHeight > containerRect.top;
|
|
115
|
+
state.transform = diff < 0 ? -diff : 0;
|
|
116
|
+
} else {
|
|
117
|
+
state.fixed = clientHeight - +offset.value < rootRect.bottom;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
emit("scroll", {
|
|
121
|
+
top: scrollTop,
|
|
122
|
+
fixed: state.fixed
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
watch(() => state.fixed, (val) => {
|
|
126
|
+
emit("change", val);
|
|
127
|
+
});
|
|
128
|
+
onMounted(() => {
|
|
129
|
+
window.addEventListener("scroll", onScroll);
|
|
130
|
+
onScroll();
|
|
131
|
+
});
|
|
132
|
+
onUnmounted(() => {
|
|
133
|
+
window.removeEventListener("scroll", onScroll);
|
|
134
|
+
});
|
|
135
|
+
return () => {
|
|
136
|
+
return h("view", {
|
|
137
|
+
style: rootStyle.value,
|
|
138
|
+
ref: root
|
|
139
|
+
}, [renderFixed()]);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
export { _sfc_main as default };
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -18,11 +18,11 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { u as useTouch } from "./
|
|
25
|
+
import { u as useTouch } from "./index4.js";
|
|
26
26
|
import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
27
27
|
import { c as createComponent } from "./component.js";
|
|
28
28
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { reactive, ref, computed, provide, onMounted, nextTick, onActivated, onDeactivated, onBeforeUnmount, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { u as useExpose } from "./
|
|
8
|
+
import { u as useExpose } from "./index2.js";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
10
|
const DISTANCE = 5;
|
|
11
11
|
function useTouch() {
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { inject, getCurrentInstance, reactive, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useExpose } from "./index2.js";
|
|
8
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
-
function useExpose(apis) {
|
|
10
|
-
const instance = getCurrentInstance();
|
|
11
|
-
if (instance) {
|
|
12
|
-
Object.assign(instance.proxy, apis);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
10
|
const { create, componentName } = createComponent("swiper-item");
|
|
16
11
|
const _sfc_main = create({
|
|
17
12
|
props: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -58,7 +58,7 @@ const _sfc_main = create({
|
|
|
58
58
|
default: ""
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
emits: ["change", "update:modelValue"],
|
|
61
|
+
emits: ["change", "update:modelValue", "update:loading"],
|
|
62
62
|
setup(props, { emit }) {
|
|
63
63
|
const isActive = computed(() => props.modelValue === props.activeValue);
|
|
64
64
|
const classes = computed(() => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { c as createComponent } from "./component.js";
|
|
7
|
-
import { useRouter } from "
|
|
7
|
+
import { u as useRouter } from "./index.js";
|
|
8
8
|
import { inject, reactive, getCurrentInstance, computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
10
|
const { create } = createComponent("tabbar-item");
|
|
@@ -79,7 +79,11 @@ const _sfc_main = create({
|
|
|
79
79
|
}
|
|
80
80
|
if (parent.children[value].to) {
|
|
81
81
|
let to = parent.children[value].to;
|
|
82
|
-
|
|
82
|
+
if (to && router) {
|
|
83
|
+
router.push(to);
|
|
84
|
+
} else {
|
|
85
|
+
location.replace(to);
|
|
86
|
+
}
|
|
83
87
|
}
|
|
84
88
|
});
|
|
85
89
|
});
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -30,7 +30,7 @@ var RenderColumn = {
|
|
|
30
30
|
return () => h(`view`, {}, props.slots());
|
|
31
31
|
},
|
|
32
32
|
props: {
|
|
33
|
-
slots:
|
|
33
|
+
slots: Function
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
const component = (componentName2) => {
|
|
@@ -19,7 +19,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19
19
|
return value;
|
|
20
20
|
};
|
|
21
21
|
/*!
|
|
22
|
-
* @nutui/nutui v3.1.
|
|
22
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
23
23
|
* (c) 2021 @jdf2e.
|
|
24
24
|
* Released under the MIT License.
|
|
25
25
|
*/
|
package/dist/packages/_es/Tag.js
CHANGED
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -30,6 +30,10 @@ const _sfc_main = create({
|
|
|
30
30
|
default: () => {
|
|
31
31
|
return [];
|
|
32
32
|
}
|
|
33
|
+
},
|
|
34
|
+
isWrapTeleport: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
emits: ["update:visible", "select"],
|
|
@@ -72,6 +76,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
72
76
|
position: "bottom",
|
|
73
77
|
closeable: "",
|
|
74
78
|
round: "",
|
|
79
|
+
isWrapTeleport: _ctx.isWrapTeleport,
|
|
75
80
|
visible: _ctx.visible,
|
|
76
81
|
style: normalizeStyle(_ctx.popStyle),
|
|
77
82
|
onClickOverlay: _ctx.close,
|
|
@@ -95,7 +100,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
95
100
|
], 2)
|
|
96
101
|
]),
|
|
97
102
|
_: 3
|
|
98
|
-
}, 8, ["visible", "style", "onClickOverlay", "onClickCloseIcon"]);
|
|
103
|
+
}, 8, ["isWrapTeleport", "visible", "style", "onClickOverlay", "onClickCloseIcon"]);
|
|
99
104
|
}
|
|
100
105
|
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
101
106
|
export { index as default };
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -53,6 +53,10 @@ const _sfc_main = create({
|
|
|
53
53
|
type: [String, Number],
|
|
54
54
|
default: "base"
|
|
55
55
|
},
|
|
56
|
+
iconSize: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "20"
|
|
59
|
+
},
|
|
56
60
|
icon: String,
|
|
57
61
|
textAlignCenter: {
|
|
58
62
|
type: Boolean,
|
|
@@ -64,7 +68,7 @@ const _sfc_main = create({
|
|
|
64
68
|
},
|
|
65
69
|
bgColor: {
|
|
66
70
|
type: String,
|
|
67
|
-
default: "
|
|
71
|
+
default: ""
|
|
68
72
|
},
|
|
69
73
|
onClose: Function,
|
|
70
74
|
unmount: Function,
|
|
@@ -74,7 +78,7 @@ const _sfc_main = create({
|
|
|
74
78
|
},
|
|
75
79
|
coverColor: {
|
|
76
80
|
type: String,
|
|
77
|
-
default: "
|
|
81
|
+
default: ""
|
|
78
82
|
},
|
|
79
83
|
title: {
|
|
80
84
|
type: String,
|
|
@@ -85,7 +89,8 @@ const _sfc_main = create({
|
|
|
85
89
|
default: false
|
|
86
90
|
}
|
|
87
91
|
},
|
|
88
|
-
|
|
92
|
+
emits: ["close"],
|
|
93
|
+
setup(props, { emit }) {
|
|
89
94
|
let timer;
|
|
90
95
|
const state = reactive({
|
|
91
96
|
mounted: false
|
|
@@ -113,6 +118,7 @@ const _sfc_main = create({
|
|
|
113
118
|
const clickCover = () => {
|
|
114
119
|
if (props.closeOnClickOverlay) {
|
|
115
120
|
hide();
|
|
121
|
+
emit("close");
|
|
116
122
|
}
|
|
117
123
|
};
|
|
118
124
|
if (props.duration) {
|
|
@@ -189,10 +195,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
189
195
|
}, [
|
|
190
196
|
_ctx.hasIcon ? (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
191
197
|
createVNode(_component_nut_icon, {
|
|
192
|
-
size:
|
|
198
|
+
size: _ctx.iconSize,
|
|
193
199
|
color: "#ffffff",
|
|
194
200
|
name: _ctx.icon
|
|
195
|
-
}, null, 8, ["name"])
|
|
201
|
+
}, null, 8, ["size", "name"])
|
|
196
202
|
])) : createCommentVNode("", true),
|
|
197
203
|
_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
198
204
|
createElementVNode("view", {
|
|
@@ -218,14 +224,15 @@ const defaultOptions = {
|
|
|
218
224
|
customClass: "",
|
|
219
225
|
bottom: "30px",
|
|
220
226
|
size: "base",
|
|
227
|
+
iconSize: "20",
|
|
221
228
|
icon: null,
|
|
222
229
|
textAlignCenter: true,
|
|
223
230
|
loadingRotate: true,
|
|
224
|
-
bgColor: "
|
|
231
|
+
bgColor: "",
|
|
225
232
|
onClose: null,
|
|
226
233
|
unmount: null,
|
|
227
234
|
cover: false,
|
|
228
|
-
coverColor: "
|
|
235
|
+
coverColor: "",
|
|
229
236
|
closeOnClickOverlay: false
|
|
230
237
|
};
|
|
231
238
|
let idsMap = [];
|
|
@@ -19,7 +19,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19
19
|
return value;
|
|
20
20
|
};
|
|
21
21
|
/*!
|
|
22
|
-
* @nutui/nutui v3.1.
|
|
22
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
23
23
|
* (c) 2021 @jdf2e.
|
|
24
24
|
* Released under the MIT License.
|
|
25
25
|
*/
|
|
@@ -18,38 +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.
|
|
21
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
25
|
import { reactive, ref, computed, watch, nextTick, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, createCommentVNode, withDirectives, vShow, normalizeClass, toDisplayString, normalizeStyle, withModifiers } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
27
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
|
-
const throttle = (func, wait, type) => {
|
|
29
|
-
if (type === 1) {
|
|
30
|
-
var previous = 0;
|
|
31
|
-
} else if (type === 2) {
|
|
32
|
-
var timeout;
|
|
33
|
-
}
|
|
34
|
-
return function() {
|
|
35
|
-
let context = this;
|
|
36
|
-
let args = arguments;
|
|
37
|
-
if (type === 1) {
|
|
38
|
-
let now = Date.now();
|
|
39
|
-
if (now - previous > wait) {
|
|
40
|
-
func.apply(context, args);
|
|
41
|
-
previous = now;
|
|
42
|
-
}
|
|
43
|
-
} else if (type === 2) {
|
|
44
|
-
if (!timeout) {
|
|
45
|
-
timeout = setTimeout(() => {
|
|
46
|
-
timeout = null;
|
|
47
|
-
func.apply(context, args);
|
|
48
|
-
}, wait);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
28
|
const { create } = createComponent("video");
|
|
54
29
|
const _sfc_main = create({
|
|
55
30
|
props: {
|
|
@@ -156,7 +131,6 @@ const _sfc_main = create({
|
|
|
156
131
|
emit("pause", state.videoElm);
|
|
157
132
|
});
|
|
158
133
|
state.videoElm.addEventListener("ended", playEnded);
|
|
159
|
-
state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 100, 1));
|
|
160
134
|
}
|
|
161
135
|
};
|
|
162
136
|
const customerInit = () => {
|
|
@@ -180,7 +154,6 @@ const _sfc_main = create({
|
|
|
180
154
|
state.videoElm.addEventListener("progress", () => {
|
|
181
155
|
getLoadTime();
|
|
182
156
|
});
|
|
183
|
-
state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 100, 1));
|
|
184
157
|
state.videoElm.addEventListener("ended", playEnded);
|
|
185
158
|
emit("play", state.videoElm);
|
|
186
159
|
} catch (e) {
|
|
@@ -192,37 +165,10 @@ const _sfc_main = create({
|
|
|
192
165
|
}
|
|
193
166
|
}
|
|
194
167
|
};
|
|
195
|
-
const timeFormat = (t) => {
|
|
196
|
-
var h = Math.floor(t / 3600);
|
|
197
|
-
if (h < 10) {
|
|
198
|
-
h = "0" + h;
|
|
199
|
-
}
|
|
200
|
-
var m = Math.floor(t % 3600 / 60);
|
|
201
|
-
if (m < 10) {
|
|
202
|
-
m = "0" + m;
|
|
203
|
-
}
|
|
204
|
-
var s = Math.round(t % 3600 % 60);
|
|
205
|
-
if (s < 10) {
|
|
206
|
-
s = "0" + s;
|
|
207
|
-
}
|
|
208
|
-
var str = "";
|
|
209
|
-
if (h != 0) {
|
|
210
|
-
str = h + ":" + m + ":" + s;
|
|
211
|
-
} else {
|
|
212
|
-
str = m + ":" + s;
|
|
213
|
-
}
|
|
214
|
-
return str;
|
|
215
|
-
};
|
|
216
168
|
const getLoadTime = () => {
|
|
217
169
|
if (state.videoSet.loaded)
|
|
218
170
|
state.videoSet.loaded = state.videoElm.buffered.end(0) / state.videoElm.duration * 100;
|
|
219
171
|
};
|
|
220
|
-
const getPlayTime = () => {
|
|
221
|
-
const percent = state.videoElm.currentTime / state.videoElm.duration;
|
|
222
|
-
state.videoSet.progress.current = Math.round(state.videoSet.progress.width * percent);
|
|
223
|
-
state.videoSet.totalTime = timeFormat(state.videoElm.duration);
|
|
224
|
-
state.videoSet.displayTime = timeFormat(state.videoElm.currentTime);
|
|
225
|
-
};
|
|
226
172
|
const playEnded = () => {
|
|
227
173
|
state.state.playing = false;
|
|
228
174
|
state.state.isEnd = true;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { getCurrentInstance } from "vue";
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
Object.assign(instance.proxy, apis);
|
|
11
|
-
}
|
|
7
|
+
function useRouter() {
|
|
8
|
+
const proxy = getCurrentInstance().proxy;
|
|
9
|
+
return proxy.$router || null;
|
|
12
10
|
}
|
|
13
|
-
export {
|
|
11
|
+
export { useRouter as u };
|
|
@@ -1,64 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
6
|
+
import { getCurrentInstance } from "vue";
|
|
7
|
+
function useExpose(apis) {
|
|
8
|
+
const instance = getCurrentInstance();
|
|
9
|
+
if (instance) {
|
|
10
|
+
Object.assign(instance.proxy, apis);
|
|
11
11
|
}
|
|
12
|
-
if (y > x && y > MIN_DISTANCE) {
|
|
13
|
-
return "vertical";
|
|
14
|
-
}
|
|
15
|
-
return "";
|
|
16
|
-
}
|
|
17
|
-
function useTouch() {
|
|
18
|
-
const startX = ref(0);
|
|
19
|
-
const startY = ref(0);
|
|
20
|
-
const deltaX = ref(0);
|
|
21
|
-
const deltaY = ref(0);
|
|
22
|
-
const offsetX = ref(0);
|
|
23
|
-
const offsetY = ref(0);
|
|
24
|
-
const direction = ref("");
|
|
25
|
-
const isVertical = () => direction.value === "vertical";
|
|
26
|
-
const isHorizontal = () => direction.value === "horizontal";
|
|
27
|
-
const reset = () => {
|
|
28
|
-
deltaX.value = 0;
|
|
29
|
-
deltaY.value = 0;
|
|
30
|
-
offsetX.value = 0;
|
|
31
|
-
offsetY.value = 0;
|
|
32
|
-
direction.value = "";
|
|
33
|
-
};
|
|
34
|
-
const start = (event) => {
|
|
35
|
-
reset();
|
|
36
|
-
startX.value = event.touches[0].clientX;
|
|
37
|
-
startY.value = event.touches[0].clientY;
|
|
38
|
-
};
|
|
39
|
-
const move = (event) => {
|
|
40
|
-
const touch = event.touches[0];
|
|
41
|
-
deltaX.value = touch.clientX - startX.value;
|
|
42
|
-
deltaY.value = touch.clientY - startY.value;
|
|
43
|
-
offsetX.value = Math.abs(deltaX.value);
|
|
44
|
-
offsetY.value = Math.abs(deltaY.value);
|
|
45
|
-
if (!direction.value) {
|
|
46
|
-
direction.value = getDirection(offsetX.value, offsetY.value);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
return {
|
|
50
|
-
move,
|
|
51
|
-
start,
|
|
52
|
-
reset,
|
|
53
|
-
startX,
|
|
54
|
-
startY,
|
|
55
|
-
deltaX,
|
|
56
|
-
deltaY,
|
|
57
|
-
offsetX,
|
|
58
|
-
offsetY,
|
|
59
|
-
direction,
|
|
60
|
-
isVertical,
|
|
61
|
-
isHorizontal
|
|
62
|
-
};
|
|
63
12
|
}
|
|
64
|
-
export {
|
|
13
|
+
export { useExpose as u };
|