@nutui/nutui 3.1.12-beta.1 → 3.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/nutui.d.ts +1 -1
- package/dist/nutui.es.js +3219 -2562
- package/dist/nutui.umd.js +3292 -2565
- package/dist/packages/_es/ActionSheet.js +12 -13
- package/dist/packages/_es/Address.js +49 -63
- package/dist/packages/_es/Avatar.js +5 -4
- package/dist/packages/_es/BackTop.js +109 -72
- package/dist/packages/_es/Badge.js +5 -4
- package/dist/packages/_es/Barrage.js +57 -63
- package/dist/packages/_es/Button.js +6 -5
- package/dist/packages/_es/Calendar.js +18 -27
- package/dist/packages/_es/Card.js +8 -7
- package/dist/packages/_es/Cell.js +13 -5
- package/dist/packages/_es/CellGroup.js +14 -7
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +4 -9
- package/dist/packages/_es/CircleProgress.js +46 -142
- package/dist/packages/_es/Col.js +5 -4
- package/dist/packages/_es/Collapse.js +10 -35
- package/dist/packages/_es/CollapseItem.js +35 -80
- package/dist/packages/_es/CountDown.js +5 -7
- package/dist/packages/_es/CountUp.js +31 -34
- package/dist/packages/_es/DatePicker.js +219 -451
- package/dist/packages/_es/Dialog.js +98 -46
- package/dist/packages/_es/Divider.js +6 -5
- package/dist/packages/_es/Drag.js +50 -76
- package/dist/packages/_es/Elevator.js +52 -81
- package/dist/packages/_es/FixedNav.js +9 -8
- package/dist/packages/_es/Form.js +6 -5
- package/dist/packages/_es/FormItem.js +5 -4
- package/dist/packages/_es/Icon.js +40 -6
- package/dist/packages/_es/ImagePreview.js +158 -44
- package/dist/packages/_es/InfiniteLoading.js +109 -95
- package/dist/packages/_es/Input.js +21 -22
- package/dist/packages/_es/InputNumber.js +18 -24
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +14 -16
- package/dist/packages/_es/MenuItem.js +11 -9
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +26 -39
- package/dist/packages/_es/Notify.js +166 -30
- package/dist/packages/_es/NumberKeyboard.js +7 -9
- package/dist/packages/_es/OverLay.js +29 -22
- package/dist/packages/_es/Pagination.js +9 -8
- package/dist/packages/_es/Picker.js +447 -61
- package/dist/packages/_es/Popover.js +34 -161
- package/dist/packages/_es/Popup.js +77 -17
- package/dist/packages/_es/Price.js +7 -18
- package/dist/packages/_es/Progress.js +12 -23
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +31 -38
- package/dist/packages/_es/Rate.js +35 -17
- package/dist/packages/_es/Row.js +5 -4
- package/dist/packages/_es/SearchBar.js +5 -7
- package/dist/packages/_es/ShortPassword.js +59 -89
- package/dist/packages/_es/Signature.js +71 -70
- package/dist/packages/_es/Sku.js +43 -53
- package/dist/packages/_es/Step.js +8 -10
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +28 -43
- package/dist/packages/_es/Swiper.js +418 -17
- package/dist/packages/_es/SwiperItem.js +39 -14
- package/dist/packages/_es/Switch.js +32 -11
- package/dist/packages/_es/TabPane.js +5 -4
- package/dist/packages/_es/Tabbar.js +5 -4
- package/dist/packages/_es/TabbarItem.js +9 -8
- package/dist/packages/_es/Tabs.js +16 -22
- package/dist/packages/_es/Tag.js +6 -5
- package/dist/packages/_es/TextArea.js +12 -16
- package/dist/packages/_es/TimeDetail.js +5 -7
- package/dist/packages/_es/TimePannel.js +5 -7
- package/dist/packages/_es/TimeSelect.js +7 -12
- package/dist/packages/_es/Toast.js +178 -46
- package/dist/packages/_es/Uploader.js +149 -109
- package/dist/packages/_es/Video.js +405 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +7 -58
- package/dist/packages/_es/index2.js +58 -43
- package/dist/packages/_es/index3.js +28 -411
- package/dist/packages/_es/plugin-vue_export-helper.js +13 -0
- 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/cellgroup/index.scss +9 -0
- package/dist/packages/dialog/index.scss +17 -0
- package/dist/packages/drag/index.scss +4 -0
- package/dist/packages/fixednav/index.scss +6 -1
- package/dist/packages/formitem/index.scss +3 -0
- package/dist/packages/icon/index.scss +2 -1
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/popover/index.scss +2 -2
- package/dist/packages/rate/index.scss +1 -0
- package/dist/packages/textarea/index.scss +1 -0
- package/dist/packages/timedetail/index.scss +1 -2
- package/dist/packages/timeselect/index.scss +3 -0
- package/dist/packages/toast/index.scss +6 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -1
- package/dist/styles/font/config.json +2 -1
- package/dist/styles/font/demo_index.html +26 -3
- package/dist/styles/font/iconfont.css +7 -3
- package/dist/styles/font/iconfont.js +31 -32
- package/dist/styles/font/iconfont.json +7 -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 +38 -38
- package/dist/styles/variables.scss +5 -1
- package/package.json +1 -1
- package/dist/packages/_es/commonProps.js +0 -30
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +0 -44
- package/dist/packages/_es/use-lock-scroll.js +0 -23
|
@@ -17,19 +17,16 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
-
};
|
|
23
20
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
25
22
|
* (c) 2021 @jdf2e.
|
|
26
23
|
* Released under the MIT License.
|
|
27
24
|
*/
|
|
28
|
-
import { ref, reactive, computed,
|
|
25
|
+
import { ref, reactive, computed, toRefs, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, toDisplayString, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
|
|
29
26
|
import { c as createComponent } from "./component.js";
|
|
30
|
-
import
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
31
28
|
const { componentName, create } = createComponent("elevator");
|
|
32
|
-
|
|
29
|
+
const _sfc_main = create({
|
|
33
30
|
props: {
|
|
34
31
|
height: {
|
|
35
32
|
type: [Number, String],
|
|
@@ -49,7 +46,7 @@ var _sfc_main = create({
|
|
|
49
46
|
emits: ["click-item", "click-index"],
|
|
50
47
|
setup(props, context) {
|
|
51
48
|
const spaceHeight = 23;
|
|
52
|
-
const listview = ref();
|
|
49
|
+
const listview = ref(null);
|
|
53
50
|
const state = reactive({
|
|
54
51
|
anchorIndex: 0,
|
|
55
52
|
listHeight: [],
|
|
@@ -59,10 +56,7 @@ var _sfc_main = create({
|
|
|
59
56
|
y2: 0
|
|
60
57
|
},
|
|
61
58
|
scrollStart: false,
|
|
62
|
-
currentIndex: 0
|
|
63
|
-
query: Taro.createSelectorQuery(),
|
|
64
|
-
scrollTop: 0,
|
|
65
|
-
storageListHeight: []
|
|
59
|
+
currentIndex: 0
|
|
66
60
|
});
|
|
67
61
|
const classes = computed(() => {
|
|
68
62
|
const prefixCls = componentName;
|
|
@@ -81,11 +75,9 @@ var _sfc_main = create({
|
|
|
81
75
|
y2: 0
|
|
82
76
|
};
|
|
83
77
|
};
|
|
84
|
-
const getData = (el) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
return el.dataset.index;
|
|
78
|
+
const getData = (el, name) => {
|
|
79
|
+
const prefix = "data-";
|
|
80
|
+
return el.getAttribute(prefix + name);
|
|
89
81
|
};
|
|
90
82
|
const setListGroup = (el) => {
|
|
91
83
|
nextTick(() => {
|
|
@@ -97,38 +89,35 @@ var _sfc_main = create({
|
|
|
97
89
|
const calculateHeight = () => {
|
|
98
90
|
let height = 0;
|
|
99
91
|
state.listHeight.push(height);
|
|
100
|
-
state.storageListHeight.push(height);
|
|
101
92
|
for (let i = 0; i < state.listGroup.length; i++) {
|
|
102
|
-
state.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
state.listHeight.push(height);
|
|
106
|
-
state.storageListHeight.push(height);
|
|
107
|
-
});
|
|
93
|
+
let item = state.listGroup[i];
|
|
94
|
+
height += item.clientHeight;
|
|
95
|
+
state.listHeight.push(height);
|
|
108
96
|
}
|
|
109
97
|
};
|
|
110
|
-
const scrollTo = (
|
|
111
|
-
if (!
|
|
98
|
+
const scrollTo = (index2) => {
|
|
99
|
+
if (!index2 && index2 !== 0) {
|
|
112
100
|
return;
|
|
113
101
|
}
|
|
114
102
|
if (!state.listHeight.length) {
|
|
115
|
-
|
|
103
|
+
calculateHeight();
|
|
116
104
|
}
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
state.currentIndex =
|
|
122
|
-
|
|
105
|
+
if (index2 < 0)
|
|
106
|
+
index2 = 0;
|
|
107
|
+
if (index2 > state.listHeight.length - 2)
|
|
108
|
+
index2 = state.listHeight.length - 2;
|
|
109
|
+
state.currentIndex = index2;
|
|
110
|
+
listview.value.scrollTo(0, state.listHeight[index2]);
|
|
123
111
|
};
|
|
124
112
|
const touchStart = (e) => {
|
|
125
113
|
state.scrollStart = true;
|
|
126
|
-
let
|
|
114
|
+
let index2 = getData(e.target, "index");
|
|
127
115
|
let firstTouch = e.touches[0];
|
|
128
116
|
state.touchState.y1 = firstTouch.pageY;
|
|
129
|
-
state.anchorIndex = +
|
|
130
|
-
state.currentIndex = +
|
|
131
|
-
|
|
117
|
+
state.anchorIndex = +index2;
|
|
118
|
+
state.currentIndex = +index2;
|
|
119
|
+
console.log(state.currentIndex);
|
|
120
|
+
scrollTo(+index2);
|
|
132
121
|
};
|
|
133
122
|
const touchMove = (e) => {
|
|
134
123
|
let firstTouch = e.touches[0];
|
|
@@ -146,18 +135,6 @@ var _sfc_main = create({
|
|
|
146
135
|
const handleClickIndex = (key) => {
|
|
147
136
|
context.emit("click-index", key);
|
|
148
137
|
};
|
|
149
|
-
onMounted(() => {
|
|
150
|
-
Taro.nextTick(() => {
|
|
151
|
-
calculateHeight();
|
|
152
|
-
});
|
|
153
|
-
if (Taro.getEnv() === "WEB") {
|
|
154
|
-
calculateHeight();
|
|
155
|
-
} else {
|
|
156
|
-
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
157
|
-
calculateHeight();
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
138
|
return __spreadProps(__spreadValues({
|
|
162
139
|
classes
|
|
163
140
|
}, toRefs(state)), {
|
|
@@ -176,39 +153,33 @@ const _hoisted_2 = ["onClick", "innerHTML"];
|
|
|
176
153
|
const _hoisted_3 = { class: "nut-elevator__bars__inner" };
|
|
177
154
|
const _hoisted_4 = ["data-index", "onClick"];
|
|
178
155
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
179
|
-
const _component_scroll_view = resolveComponent("scroll-view");
|
|
180
156
|
return openBlock(), createElementBlock("view", {
|
|
181
157
|
class: normalizeClass(_ctx.classes)
|
|
182
158
|
}, [
|
|
183
|
-
|
|
184
|
-
class: "nut-elevator__list
|
|
185
|
-
"scroll-top": _ctx.scrollTop,
|
|
186
|
-
"scroll-y": true,
|
|
159
|
+
createElementVNode("view", {
|
|
160
|
+
class: "nut-elevator__list",
|
|
187
161
|
ref: "listview",
|
|
188
162
|
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
_: 1
|
|
210
|
-
}, 8, ["scroll-top", "style"]),
|
|
211
|
-
_ctx.indexList.length > 0 ? withDirectives((openBlock(), createElementBlock("view", {
|
|
163
|
+
}, [
|
|
164
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item) => {
|
|
165
|
+
return openBlock(), createElementBlock("view", {
|
|
166
|
+
class: "nut-elevator__list__item",
|
|
167
|
+
key: item[_ctx.acceptKey],
|
|
168
|
+
ref: _ctx.setListGroup
|
|
169
|
+
}, [
|
|
170
|
+
createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
|
|
171
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
|
|
172
|
+
return openBlock(), createElementBlock("view", {
|
|
173
|
+
class: "nut-elevator__list__item__name",
|
|
174
|
+
key: subitem["id"],
|
|
175
|
+
onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem),
|
|
176
|
+
innerHTML: subitem.name
|
|
177
|
+
}, null, 8, _hoisted_2);
|
|
178
|
+
}), 128))
|
|
179
|
+
], 512);
|
|
180
|
+
}), 128))
|
|
181
|
+
], 4),
|
|
182
|
+
_ctx.indexList.length ? withDirectives((openBlock(), createElementBlock("view", {
|
|
212
183
|
key: 0,
|
|
213
184
|
class: "nut-elevator__code--current"
|
|
214
185
|
}, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 513)), [
|
|
@@ -221,10 +192,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
221
192
|
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
222
193
|
}, [
|
|
223
194
|
createElementVNode("view", _hoisted_3, [
|
|
224
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item,
|
|
195
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index2) => {
|
|
225
196
|
return openBlock(), createElementBlock("view", {
|
|
226
197
|
class: "nut-elevator__bars__inner__item",
|
|
227
|
-
"data-index":
|
|
198
|
+
"data-index": index2,
|
|
228
199
|
key: item[_ctx.acceptKey],
|
|
229
200
|
onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
|
|
230
201
|
}, toDisplayString(item[_ctx.acceptKey]), 9, _hoisted_4);
|
|
@@ -233,5 +204,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
233
204
|
], 32)
|
|
234
205
|
], 2);
|
|
235
206
|
}
|
|
236
|
-
_sfc_main
|
|
237
|
-
export {
|
|
207
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
208
|
+
export { index as default };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, renderSlot, createElementVNode, Fragment, renderList, toDisplayString, createVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import
|
|
8
|
+
import overlay from "./OverLay.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
const { componentName, create } = createComponent("fixednav");
|
|
10
|
-
|
|
11
|
+
const _sfc_main = create({
|
|
11
12
|
components: {
|
|
12
|
-
[
|
|
13
|
+
[overlay.name]: overlay
|
|
13
14
|
},
|
|
14
15
|
props: {
|
|
15
16
|
visible: {
|
|
@@ -93,11 +94,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
93
94
|
}, null, 8, ["visible"])) : createCommentVNode("", true),
|
|
94
95
|
renderSlot(_ctx.$slots, "list", {}, () => [
|
|
95
96
|
createElementVNode("view", _hoisted_1, [
|
|
96
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item,
|
|
97
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item, index2) => {
|
|
97
98
|
return openBlock(), createElementBlock("view", {
|
|
98
99
|
class: "nut-fixednav__list-item",
|
|
99
100
|
onClick: ($event) => _ctx.selected(item, $event),
|
|
100
|
-
key: item.id ||
|
|
101
|
+
key: item.id || index2
|
|
101
102
|
}, [
|
|
102
103
|
createElementVNode("img", {
|
|
103
104
|
src: item.icon
|
|
@@ -122,5 +123,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
122
123
|
])
|
|
123
124
|
], 6);
|
|
124
125
|
}
|
|
125
|
-
_sfc_main
|
|
126
|
-
export {
|
|
126
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
127
|
+
export { index as default };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 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
7
|
import { i as isPromise } from "./util.js";
|
|
8
8
|
import { computed, reactive, provide, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, renderSlot } from "vue";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
const component = {
|
|
10
11
|
props: {
|
|
11
12
|
modelValue: {
|
|
@@ -31,7 +32,7 @@ const component = {
|
|
|
31
32
|
}, { immediate: true });
|
|
32
33
|
const findFormItem = (vnodes) => {
|
|
33
34
|
let task = [];
|
|
34
|
-
vnodes.forEach((vnode,
|
|
35
|
+
vnodes.forEach((vnode, index2) => {
|
|
35
36
|
var _a, _b;
|
|
36
37
|
let type = vnode.type;
|
|
37
38
|
type = type.name || type;
|
|
@@ -118,7 +119,7 @@ const component = {
|
|
|
118
119
|
}
|
|
119
120
|
};
|
|
120
121
|
const { create } = createComponent("form");
|
|
121
|
-
|
|
122
|
+
const _sfc_main = create(component);
|
|
122
123
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
123
124
|
const _component_nut_cell_group = resolveComponent("nut-cell-group");
|
|
124
125
|
return openBlock(), createElementBlock("form", {
|
|
@@ -133,5 +134,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
133
134
|
})
|
|
134
135
|
], 32);
|
|
135
136
|
}
|
|
136
|
-
_sfc_main
|
|
137
|
-
export {
|
|
137
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
138
|
+
export { index as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { p as pxCheck } from "./pxCheck.js";
|
|
7
7
|
import { inject, computed, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from "vue";
|
|
8
8
|
import { c as createComponent } from "./component.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
const { componentName, create } = createComponent("form-item");
|
|
10
|
-
|
|
11
|
+
const _sfc_main = create({
|
|
11
12
|
inheritAttrs: false,
|
|
12
13
|
props: {
|
|
13
14
|
prop: {
|
|
@@ -105,5 +106,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
105
106
|
_: 3
|
|
106
107
|
}, 8, ["class"]);
|
|
107
108
|
}
|
|
108
|
-
_sfc_main
|
|
109
|
-
export {
|
|
109
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
110
|
+
export { index as default };
|
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import "
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { h } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { p as pxCheck } from "./pxCheck.js";
|
|
9
|
+
const { componentName, create } = createComponent("icon");
|
|
10
|
+
const _sfc_main = create({
|
|
11
|
+
props: {
|
|
12
|
+
name: { type: String, default: "" },
|
|
13
|
+
size: { type: [String, Number], default: "" },
|
|
14
|
+
classPrefix: { type: String, default: "nut-icon" },
|
|
15
|
+
fontClassName: { type: String, default: "nutui-iconfont" },
|
|
16
|
+
color: { type: String, default: "" },
|
|
17
|
+
tag: { type: String, default: "i" }
|
|
18
|
+
},
|
|
19
|
+
emits: ["click"],
|
|
20
|
+
setup(props, { emit, slots }) {
|
|
21
|
+
const handleClick = (event) => {
|
|
22
|
+
emit("click", event);
|
|
23
|
+
};
|
|
24
|
+
const isImage = () => {
|
|
25
|
+
return props.name ? props.name.indexOf("/") !== -1 : false;
|
|
26
|
+
};
|
|
27
|
+
return () => {
|
|
28
|
+
var _a;
|
|
29
|
+
const _isImage = isImage();
|
|
30
|
+
return h(_isImage ? "img" : props.tag, {
|
|
31
|
+
class: _isImage ? `${componentName}__img` : `${props.fontClassName} ${componentName} ${props.classPrefix}-${props.name}`,
|
|
32
|
+
style: {
|
|
33
|
+
color: props.color,
|
|
34
|
+
fontSize: pxCheck(props.size),
|
|
35
|
+
width: pxCheck(props.size),
|
|
36
|
+
height: pxCheck(props.size)
|
|
37
|
+
},
|
|
38
|
+
onClick: handleClick,
|
|
39
|
+
src: _isImage ? props.name : ""
|
|
40
|
+
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export { _sfc_main as default };
|
|
@@ -17,23 +17,28 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var
|
|
21
|
-
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
22
23
|
};
|
|
23
24
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
25
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
25
26
|
* (c) 2021 @jdf2e.
|
|
26
27
|
* Released under the MIT License.
|
|
27
28
|
*/
|
|
28
|
-
import { toRefs, reactive, watch, resolveComponent, openBlock,
|
|
29
|
+
import { toRefs, reactive, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withModifiers, createElementBlock, Fragment, renderList, createVNode, createCommentVNode, toDisplayString, render, h } from "vue";
|
|
29
30
|
import { c as createComponent } from "./component.js";
|
|
30
|
-
import
|
|
31
|
-
import "./
|
|
31
|
+
import Popup from "./Popup.js";
|
|
32
|
+
import Video from "./Video.js";
|
|
33
|
+
import Swiper from "./Swiper.js";
|
|
34
|
+
import SwiperItem from "./SwiperItem.js";
|
|
35
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
32
36
|
import "./OverLay.js";
|
|
33
|
-
import "./
|
|
37
|
+
import "./Icon.js";
|
|
34
38
|
import "./pxCheck.js";
|
|
39
|
+
import "./index.js";
|
|
35
40
|
const { componentName, create } = createComponent("imagepreview");
|
|
36
|
-
|
|
41
|
+
const _sfc_main = create({
|
|
37
42
|
props: {
|
|
38
43
|
show: {
|
|
39
44
|
type: Boolean,
|
|
@@ -42,21 +47,59 @@ var _sfc_main = create({
|
|
|
42
47
|
images: {
|
|
43
48
|
type: Array,
|
|
44
49
|
default: () => []
|
|
50
|
+
},
|
|
51
|
+
videos: {
|
|
52
|
+
type: Array,
|
|
53
|
+
default: () => []
|
|
54
|
+
},
|
|
55
|
+
contentClose: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
59
|
+
initNo: {
|
|
60
|
+
type: Number,
|
|
61
|
+
default: 1
|
|
62
|
+
},
|
|
63
|
+
paginationVisible: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
},
|
|
67
|
+
paginationColor: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "#fff"
|
|
45
70
|
}
|
|
46
71
|
},
|
|
72
|
+
emits: ["close"],
|
|
47
73
|
components: {
|
|
48
|
-
[
|
|
74
|
+
[Popup.name]: Popup,
|
|
75
|
+
[Video.name]: Video,
|
|
76
|
+
[Swiper.name]: Swiper,
|
|
77
|
+
[SwiperItem.name]: SwiperItem
|
|
49
78
|
},
|
|
50
79
|
setup(props, { emit }) {
|
|
51
|
-
|
|
80
|
+
toRefs(props);
|
|
52
81
|
const state = reactive({
|
|
53
|
-
showPop:
|
|
54
|
-
active: 1
|
|
82
|
+
showPop: false,
|
|
83
|
+
active: 1,
|
|
84
|
+
maxNo: 1,
|
|
85
|
+
source: {
|
|
86
|
+
src: "https://storage.jd.com/about/big-final.mp4?Expires=3730193075&AccessKey=3LoYX1dQWa6ZXzQl&Signature=ViMFjz%2BOkBxS%2FY1rjtUVqbopbJI%3D",
|
|
87
|
+
type: "video/mp4"
|
|
88
|
+
},
|
|
89
|
+
options: {
|
|
90
|
+
muted: true,
|
|
91
|
+
controls: true
|
|
92
|
+
}
|
|
55
93
|
});
|
|
56
94
|
const slideChangeEnd = function(page) {
|
|
57
|
-
state.active = page
|
|
95
|
+
state.active = page + 1;
|
|
96
|
+
};
|
|
97
|
+
const closeOnImg = () => {
|
|
98
|
+
if (props.contentClose) {
|
|
99
|
+
onClose();
|
|
100
|
+
}
|
|
58
101
|
};
|
|
59
|
-
const
|
|
102
|
+
const onClose = () => {
|
|
60
103
|
state.showPop = false;
|
|
61
104
|
state.active = 1;
|
|
62
105
|
emit("close");
|
|
@@ -64,55 +107,126 @@ var _sfc_main = create({
|
|
|
64
107
|
watch(() => props.show, (val) => {
|
|
65
108
|
state.showPop = val;
|
|
66
109
|
});
|
|
110
|
+
onMounted(() => {
|
|
111
|
+
state.active = props.initNo;
|
|
112
|
+
state.showPop = props.show;
|
|
113
|
+
state.maxNo = props.images.length + props.videos.length;
|
|
114
|
+
});
|
|
67
115
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
68
116
|
slideChangeEnd,
|
|
69
|
-
|
|
117
|
+
onClose,
|
|
118
|
+
closeOnImg
|
|
70
119
|
});
|
|
71
120
|
}
|
|
72
121
|
});
|
|
73
|
-
const _hoisted_1 =
|
|
74
|
-
const _hoisted_2 =
|
|
75
|
-
const _hoisted_3 = { class: "nut-imagepreview-index" };
|
|
122
|
+
const _hoisted_1 = ["src"];
|
|
123
|
+
const _hoisted_2 = { class: "nut-imagepreview-index" };
|
|
76
124
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
77
|
-
const
|
|
78
|
-
const
|
|
125
|
+
const _component_nut_video = resolveComponent("nut-video");
|
|
126
|
+
const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
|
|
127
|
+
const _component_nut_swiper = resolveComponent("nut-swiper");
|
|
79
128
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
80
|
-
return openBlock(),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
129
|
+
return openBlock(), createBlock(_component_nut_popup, {
|
|
130
|
+
"pop-class": "custom-pop",
|
|
131
|
+
visible: _ctx.showPop,
|
|
132
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPop = $event),
|
|
133
|
+
onClick: _ctx.onClose
|
|
134
|
+
}, {
|
|
135
|
+
default: withCtx(() => [
|
|
136
|
+
createElementVNode("view", {
|
|
137
|
+
class: "nut-imagepreview",
|
|
138
|
+
onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.closeOnImg && _ctx.closeOnImg(...args), ["stop"]))
|
|
139
|
+
}, [
|
|
140
|
+
_ctx.showPop ? (openBlock(), createBlock(_component_nut_swiper, {
|
|
89
141
|
key: 0,
|
|
90
|
-
|
|
91
|
-
interval: 3e3,
|
|
142
|
+
"auto-play": 3e3,
|
|
92
143
|
class: "nut-imagepreview-swiper",
|
|
93
|
-
|
|
94
|
-
|
|
144
|
+
loop: true,
|
|
145
|
+
"is-preventDefault": false,
|
|
146
|
+
direction: "horizontal",
|
|
147
|
+
onChange: _ctx.slideChangeEnd,
|
|
148
|
+
"init-page": _ctx.initNo > _ctx.maxNo ? _ctx.maxNo - 1 : _ctx.initNo - 1,
|
|
149
|
+
"pagination-visible": _ctx.paginationVisible,
|
|
150
|
+
"pagination-color": _ctx.paginationColor
|
|
95
151
|
}, {
|
|
96
152
|
default: withCtx(() => [
|
|
153
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.videos, (item, index) => {
|
|
154
|
+
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
155
|
+
default: withCtx(() => [
|
|
156
|
+
createVNode(_component_nut_video, {
|
|
157
|
+
source: item.source,
|
|
158
|
+
options: item.options
|
|
159
|
+
}, null, 8, ["source", "options"])
|
|
160
|
+
]),
|
|
161
|
+
_: 2
|
|
162
|
+
}, 1024);
|
|
163
|
+
}), 128)),
|
|
97
164
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.images, (item, index) => {
|
|
98
|
-
return openBlock(), createBlock(
|
|
165
|
+
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
99
166
|
default: withCtx(() => [
|
|
100
167
|
createElementVNode("img", {
|
|
101
|
-
src: item.
|
|
168
|
+
src: item.src,
|
|
102
169
|
class: "nut-imagepreview-img"
|
|
103
|
-
}, null, 8,
|
|
170
|
+
}, null, 8, _hoisted_1)
|
|
104
171
|
]),
|
|
105
172
|
_: 2
|
|
106
173
|
}, 1024);
|
|
107
174
|
}), 128))
|
|
108
175
|
]),
|
|
109
176
|
_: 1
|
|
110
|
-
}, 8, ["onChange"])) : createCommentVNode("", true),
|
|
111
|
-
createElementVNode("view",
|
|
112
|
-
])
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
]);
|
|
177
|
+
}, 8, ["onChange", "init-page", "pagination-visible", "pagination-color"])) : createCommentVNode("", true),
|
|
178
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length + _ctx.videos.length), 1)
|
|
179
|
+
])
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
}, 8, ["visible", "onClick"]);
|
|
183
|
+
}
|
|
184
|
+
var ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
185
|
+
class ImagePreviewOptions {
|
|
186
|
+
constructor() {
|
|
187
|
+
__publicField(this, "show", false);
|
|
188
|
+
__publicField(this, "images", []);
|
|
189
|
+
__publicField(this, "initNo", 1);
|
|
190
|
+
__publicField(this, "paginationVisible", false);
|
|
191
|
+
__publicField(this, "paginationColor", "");
|
|
192
|
+
__publicField(this, "teleport", "body");
|
|
193
|
+
__publicField(this, "onClose", () => {
|
|
194
|
+
});
|
|
195
|
+
}
|
|
116
196
|
}
|
|
117
|
-
|
|
118
|
-
|
|
197
|
+
class ImagePreviewFunction {
|
|
198
|
+
constructor(_options) {
|
|
199
|
+
__publicField(this, "options", new ImagePreviewOptions());
|
|
200
|
+
let options = Object.assign(this.options, _options);
|
|
201
|
+
let elWarp = document.body;
|
|
202
|
+
let teleport = options.teleport;
|
|
203
|
+
if (teleport != "body") {
|
|
204
|
+
if (typeof teleport == "string") {
|
|
205
|
+
elWarp = document.querySelector(teleport);
|
|
206
|
+
} else {
|
|
207
|
+
elWarp = options.teleport;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const root = document.createElement("view");
|
|
211
|
+
root.id = "imagepreview-" + new Date().getTime();
|
|
212
|
+
const Wrapper = {
|
|
213
|
+
setup() {
|
|
214
|
+
options.teleport = `#${root.id}`;
|
|
215
|
+
return () => {
|
|
216
|
+
return h(ImagePreview, options);
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const instance = createVNode(Wrapper);
|
|
221
|
+
elWarp.appendChild(root);
|
|
222
|
+
render(instance, root);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const _ImagePreview = function(options) {
|
|
226
|
+
return new ImagePreviewFunction(options);
|
|
227
|
+
};
|
|
228
|
+
_ImagePreview.install = (app) => {
|
|
229
|
+
app.use(ImagePreview);
|
|
230
|
+
app.config.globalProperties.$imagepreview = _ImagePreview;
|
|
231
|
+
};
|
|
232
|
+
export { ImagePreview, ImagePreviewOptions, _ImagePreview as default };
|