@nutui/nutui 4.3.6 → 4.3.8
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/dist/nutui.es.js +1 -1
- package/dist/nutui.js +4588 -4837
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/actionsheet/ActionSheet.js +1 -1
- package/dist/packages/address/Address.js +1 -1
- package/dist/packages/badge/Badge.js +60 -72
- package/dist/packages/calendar/Calendar.js +1 -1
- package/dist/packages/cascader/Cascader.js +1 -1
- package/dist/packages/countdown/Countdown.js +2 -2
- package/dist/packages/dialog/Dialog.js +3 -3
- package/dist/packages/fixednav/FixedNav.js +2 -2
- package/dist/packages/image/Image.js +79 -111
- package/dist/packages/imagepreview/ImagePreview.js +3 -3
- package/dist/packages/{index-uHBD4dfS.js → index-wLaOjIn1.js} +2 -2
- package/dist/packages/input/Input.js +111 -181
- package/dist/packages/invoice/Invoice.js +4 -4
- package/dist/packages/menuitem/MenuItem.js +2 -2
- package/dist/packages/notify/Notify.js +1 -1
- package/dist/packages/numberkeyboard/NumberKeyboard.js +7 -3
- package/dist/packages/overlay/Overlay.js +40 -54
- package/dist/packages/popover/Popover.js +1 -1
- package/dist/packages/popup/Popup.js +1 -1
- package/dist/packages/shortpassword/ShortPassword.js +1 -1
- package/dist/packages/sku/Sku.js +1 -1
- package/dist/packages/tabbaritem/TabbarItem.js +3 -3
- package/dist/packages/tabpane/TabPane.js +1 -1
- package/dist/packages/timeselect/TimeSelect.js +1 -1
- package/dist/packages/watermark/Watermark.js +69 -159
- package/dist/smartips/web-types.json +3 -3
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +5 -5
- package/dist/types/__VUE/badge/badge.vue.d.ts +93 -0
- package/dist/types/__VUE/badge/index.d.ts +5 -0
- package/dist/types/__VUE/calendar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/circleprogress/circle-progress.vue.d.ts +2 -2
- package/dist/types/__VUE/collapseitem/collapse-item.vue.d.ts +1 -1
- package/dist/types/__VUE/dialog/index.vue.d.ts +4 -4
- package/dist/types/__VUE/divider/divider.vue.d.ts +1 -1
- package/dist/types/__VUE/fixednav/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/image.vue.d.ts +111 -0
- package/dist/types/__VUE/image/index.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.d.ts +6 -0
- package/dist/types/__VUE/input/input.vue.d.ts +171 -0
- package/dist/types/__VUE/input/{type.d.ts → types.d.ts} +2 -2
- package/dist/types/__VUE/input/util.d.ts +1 -1
- package/dist/types/__VUE/list/index.vue.d.ts +1 -1
- package/dist/types/__VUE/menu/index.vue.d.ts +1 -1
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +4 -2
- package/dist/types/__VUE/overlay/index.d.ts +5 -0
- package/dist/types/__VUE/overlay/overlay.vue.d.ts +87 -0
- package/dist/types/__VUE/picker/index.vue.d.ts +1 -1
- package/dist/types/__VUE/popover/index.vue.d.ts +4 -4
- package/dist/types/__VUE/popup/index.vue.d.ts +3 -3
- package/dist/types/__VUE/row/row.vue.d.ts +1 -1
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
- package/dist/types/__VUE/sku/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swipe/swipe.vue.d.ts +1 -1
- package/dist/types/__VUE/tabs/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tour/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.d.ts +6 -0
- package/dist/types/__VUE/watermark/watermark.vue.d.ts +127 -0
- package/dist/types/index.d.ts +11 -6
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/types/__VUE/badge/index.vue.d.ts +0 -102
- package/dist/types/__VUE/image/index.vue.d.ts +0 -126
- package/dist/types/__VUE/input/index.vue.d.ts +0 -221
- package/dist/types/__VUE/overlay/index.vue.d.ts +0 -85
- package/dist/types/__VUE/watermark/index.vue.d.ts +0 -201
- /package/dist/types/__VUE/image/{type.d.ts → types.d.ts} +0 -0
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
21
21
|
import { useSlots, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, normalizeClass, normalizeStyle } from "vue";
|
|
22
|
-
import { N as NutPopup, p as popupProps } from "../index-
|
|
22
|
+
import { N as NutPopup, p as popupProps } from "../index-wLaOjIn1.js";
|
|
23
23
|
import { Loading } from "@nutui/icons-vue";
|
|
24
24
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
25
25
|
const { create } = createComponent("action-sheet");
|
|
@@ -20,7 +20,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
20
20
|
import { ref, reactive, computed, watch, toRefs, nextTick, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, renderSlot, withDirectives, createVNode, vShow, toDisplayString, createElementBlock, Fragment, renderList, normalizeClass, createCommentVNode, normalizeStyle, createTextVNode } from "vue";
|
|
21
21
|
import { Location, Location2, Check, Close, Left } from "@nutui/icons-vue";
|
|
22
22
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
23
|
-
import { N as NutPopup, p as popupProps } from "../index-
|
|
23
|
+
import { N as NutPopup, p as popupProps } from "../index-wLaOjIn1.js";
|
|
24
24
|
import NutElevator from "../elevator/Elevator.js";
|
|
25
25
|
import { u as useLocale } from "../index-CFigyH92.js";
|
|
26
26
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
@@ -1,48 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
default: false
|
|
17
|
-
},
|
|
18
|
-
bubble: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false
|
|
21
|
-
},
|
|
22
|
-
hidden: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
},
|
|
26
|
-
top: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: "0"
|
|
29
|
-
},
|
|
30
|
-
right: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: "0"
|
|
33
|
-
},
|
|
34
|
-
zIndex: {
|
|
35
|
-
type: Number,
|
|
36
|
-
default: 9
|
|
37
|
-
},
|
|
38
|
-
color: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: ""
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
41
16
|
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, computed, openBlock, createElementBlock, withDirectives, createElementVNode, normalizeStyle, renderSlot, vShow, normalizeClass, toDisplayString } from "vue";
|
|
21
|
+
import { w as withInstall } from "../with-install-Ch3FF0uS.js";
|
|
22
|
+
const _hoisted_1 = { class: "nut-badge" };
|
|
23
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
24
|
+
name: "NutBadge"
|
|
25
|
+
}), {
|
|
26
|
+
__name: "badge",
|
|
27
|
+
props: {
|
|
28
|
+
value: {},
|
|
29
|
+
max: { default: 1e4 },
|
|
30
|
+
dot: { type: Boolean, default: false },
|
|
31
|
+
bubble: { type: Boolean, default: false },
|
|
32
|
+
hidden: { type: Boolean, default: false },
|
|
33
|
+
top: { default: "0" },
|
|
34
|
+
right: { default: "0" },
|
|
35
|
+
zIndex: { default: 9 },
|
|
36
|
+
color: { default: "" }
|
|
42
37
|
},
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
45
|
-
const
|
|
38
|
+
setup(__props) {
|
|
39
|
+
const props = __props;
|
|
40
|
+
const style = computed(() => {
|
|
46
41
|
return {
|
|
47
42
|
top: `${props.top}px`,
|
|
48
43
|
right: `${props.right}px`,
|
|
@@ -60,36 +55,29 @@ const _sfc_main = create({
|
|
|
60
55
|
}
|
|
61
56
|
return value;
|
|
62
57
|
});
|
|
63
|
-
return {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
return (_ctx, _cache) => {
|
|
59
|
+
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
60
|
+
withDirectives(createElementVNode("view", {
|
|
61
|
+
class: "nut-badge__icon",
|
|
62
|
+
style: normalizeStyle(style.value)
|
|
63
|
+
}, [
|
|
64
|
+
renderSlot(_ctx.$slots, "icon")
|
|
65
|
+
], 4), [
|
|
66
|
+
[vShow, !_ctx.hidden && !_ctx.dot && _ctx.$slots.icon]
|
|
67
|
+
]),
|
|
68
|
+
renderSlot(_ctx.$slots, "default"),
|
|
69
|
+
withDirectives(createElementVNode("view", {
|
|
70
|
+
class: normalizeClass(["nut-badge__content nut-badge__content--sup", { "nut-badge__content--dot": _ctx.dot, "nut-badge__content--bubble": !_ctx.dot && _ctx.bubble }]),
|
|
71
|
+
style: normalizeStyle(style.value)
|
|
72
|
+
}, toDisplayString(content.value), 7), [
|
|
73
|
+
[vShow, !_ctx.hidden && (content.value || _ctx.dot)]
|
|
74
|
+
])
|
|
75
|
+
]);
|
|
67
76
|
};
|
|
68
77
|
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const _hoisted_2 = ["textContent"];
|
|
72
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
73
|
-
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
74
|
-
withDirectives(createElementVNode("view", {
|
|
75
|
-
class: "nut-badge__icon",
|
|
76
|
-
style: normalizeStyle(_ctx.stl)
|
|
77
|
-
}, [
|
|
78
|
-
renderSlot(_ctx.$slots, "icon")
|
|
79
|
-
], 4), [
|
|
80
|
-
[vShow, !_ctx.hidden && !_ctx.dot && _ctx.$slots.icon]
|
|
81
|
-
]),
|
|
82
|
-
renderSlot(_ctx.$slots, "default"),
|
|
83
|
-
withDirectives(createElementVNode("view", {
|
|
84
|
-
class: normalizeClass(["nut-badge__content nut-badge__content--sup", { "nut-badge__content--dot": _ctx.dot, "nut-badge__content--bubble": !_ctx.dot && _ctx.bubble }]),
|
|
85
|
-
style: normalizeStyle(_ctx.stl),
|
|
86
|
-
textContent: toDisplayString(_ctx.content)
|
|
87
|
-
}, null, 14, _hoisted_2), [
|
|
88
|
-
[vShow, !_ctx.hidden && (_ctx.content || _ctx.dot)]
|
|
89
|
-
])
|
|
90
|
-
]);
|
|
91
|
-
}
|
|
92
|
-
const NutBadge = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
78
|
+
}));
|
|
79
|
+
withInstall(_sfc_main);
|
|
93
80
|
export {
|
|
94
|
-
|
|
81
|
+
_sfc_main as Badge,
|
|
82
|
+
_sfc_main as default
|
|
95
83
|
};
|
|
@@ -23,7 +23,7 @@ import { U as Utils } from "../date-DHXcwF1m.js";
|
|
|
23
23
|
import { r as requestAniFrame } from "../raf-c01wDYCo.js";
|
|
24
24
|
import { u as useLocale } from "../index-CFigyH92.js";
|
|
25
25
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
26
|
-
import { N as NutPopup } from "../index-
|
|
26
|
+
import { N as NutPopup } from "../index-wLaOjIn1.js";
|
|
27
27
|
const { create: create$1 } = createComponent("calendar-item");
|
|
28
28
|
const cN = "NutCalendarItem";
|
|
29
29
|
const _sfc_main$1 = create$1({
|
|
@@ -55,7 +55,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
import { computed, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, createElementVNode, normalizeClass, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
58
|
-
import { N as NutPopup, p as popupProps } from "../index-
|
|
58
|
+
import { N as NutPopup, p as popupProps } from "../index-wLaOjIn1.js";
|
|
59
59
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
60
60
|
import { Loading, Checklist } from "@nutui/icons-vue";
|
|
61
61
|
import NutTabs from "../tabs/Tabs.js";
|
|
@@ -161,8 +161,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
161
161
|
const pause = () => {
|
|
162
162
|
cancelAnimationFrame(timer.value);
|
|
163
163
|
counting.value = false;
|
|
164
|
-
emit("
|
|
165
|
-
emit("
|
|
164
|
+
emit("paused", restTime.value);
|
|
165
|
+
emit("onPaused", restTime.value);
|
|
166
166
|
};
|
|
167
167
|
const reset = () => {
|
|
168
168
|
if (!props.autoStart) {
|
|
@@ -24,11 +24,11 @@ var __publicField = (obj, key, value) => {
|
|
|
24
24
|
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, nextTick, h } from "vue";
|
|
25
25
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
26
26
|
import { f as funInterceptor } from "../Interceptor-DlY2h6Y7.js";
|
|
27
|
-
import { N as NutPopup, p as popupProps } from "../index-
|
|
27
|
+
import { N as NutPopup, p as popupProps } from "../index-wLaOjIn1.js";
|
|
28
28
|
import { Button as _sfc_main$1 } from "../button/Button.js";
|
|
29
29
|
import { u as useLocale } from "../index-CFigyH92.js";
|
|
30
30
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
31
|
-
import
|
|
31
|
+
import { Overlay as _sfc_main$2 } from "../overlay/Overlay.js";
|
|
32
32
|
import { C as CreateComponent } from "../mountComponent-DBQ88Fjz.js";
|
|
33
33
|
const { create } = createComponent("dialog");
|
|
34
34
|
const cN = "NutDialog";
|
|
@@ -290,7 +290,7 @@ class DialogFunction {
|
|
|
290
290
|
const options = Object.assign(this.options, _options);
|
|
291
291
|
const { unmount } = CreateComponent(options, {
|
|
292
292
|
name: "dialog",
|
|
293
|
-
components: [NutPopup, _sfc_main$1,
|
|
293
|
+
components: [NutPopup, _sfc_main$1, _sfc_main$2],
|
|
294
294
|
wrapper: (elWrap, root) => {
|
|
295
295
|
return {
|
|
296
296
|
setup() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, renderSlot, createElementVNode, Fragment, renderList, toDisplayString, createVNode } from "vue";
|
|
2
2
|
import { Left } from "@nutui/icons-vue";
|
|
3
|
-
import
|
|
3
|
+
import { Overlay as _sfc_main$1 } from "../overlay/Overlay.js";
|
|
4
4
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
5
5
|
import { u as useLocale } from "../index-CFigyH92.js";
|
|
6
6
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
@@ -8,7 +8,7 @@ const { create } = createComponent("fixed-nav");
|
|
|
8
8
|
const cN = "NutFixedNav";
|
|
9
9
|
const _sfc_main = create({
|
|
10
10
|
components: {
|
|
11
|
-
NutOverlay,
|
|
11
|
+
NutOverlay: _sfc_main$1,
|
|
12
12
|
Left
|
|
13
13
|
},
|
|
14
14
|
props: {
|
|
@@ -17,67 +17,44 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import {
|
|
21
|
-
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
20
|
+
import { defineComponent, ref, computed, onMounted, onBeforeUnmount, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createVNode, unref, createCommentVNode } from "vue";
|
|
22
21
|
import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
|
|
23
22
|
import { Image, ImageError } from "@nutui/icons-vue";
|
|
24
|
-
import {
|
|
25
|
-
const
|
|
26
|
-
const
|
|
23
|
+
import { w as withInstall } from "../with-install-Ch3FF0uS.js";
|
|
24
|
+
const _hoisted_1 = ["src", "data-src", "alt"];
|
|
25
|
+
const _hoisted_2 = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "nut-img-loading"
|
|
28
|
+
};
|
|
29
|
+
const _hoisted_3 = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "nut-img-error"
|
|
32
|
+
};
|
|
33
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
34
|
+
name: "NutImage"
|
|
35
|
+
}), {
|
|
36
|
+
__name: "image",
|
|
27
37
|
props: {
|
|
28
|
-
src:
|
|
29
|
-
fit: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
default: ""
|
|
40
|
-
},
|
|
41
|
-
width: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: "center"
|
|
44
|
-
},
|
|
45
|
-
height: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: ""
|
|
48
|
-
},
|
|
49
|
-
round: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false
|
|
52
|
-
},
|
|
53
|
-
radius: [String, Number],
|
|
54
|
-
showError: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: true
|
|
57
|
-
},
|
|
58
|
-
showLoading: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: true
|
|
61
|
-
},
|
|
62
|
-
lazyLoad: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: false
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
components: {
|
|
68
|
-
Image,
|
|
69
|
-
ImageError
|
|
38
|
+
src: {},
|
|
39
|
+
fit: { default: "fill" },
|
|
40
|
+
position: { default: "center" },
|
|
41
|
+
alt: { default: "" },
|
|
42
|
+
width: { default: "" },
|
|
43
|
+
height: { default: "" },
|
|
44
|
+
round: { type: Boolean, default: false },
|
|
45
|
+
radius: {},
|
|
46
|
+
showError: { type: Boolean, default: true },
|
|
47
|
+
showLoading: { type: Boolean, default: true },
|
|
48
|
+
lazyLoad: { type: Boolean, default: false }
|
|
70
49
|
},
|
|
71
50
|
emits: ["click", "load", "error"],
|
|
72
|
-
setup(
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
slotError: useSlots().error
|
|
78
|
-
});
|
|
51
|
+
setup(__props, { emit: __emit }) {
|
|
52
|
+
const props = __props;
|
|
53
|
+
const emit = __emit;
|
|
54
|
+
const loading = ref(true);
|
|
55
|
+
const isError = ref(false);
|
|
79
56
|
const classes = computed(() => {
|
|
80
|
-
const prefixCls =
|
|
57
|
+
const prefixCls = "nut-image";
|
|
81
58
|
return {
|
|
82
59
|
[prefixCls]: true,
|
|
83
60
|
[`${prefixCls}-round`]: props.round
|
|
@@ -129,73 +106,64 @@ const _sfc_main = create({
|
|
|
129
106
|
watch(
|
|
130
107
|
() => props.src,
|
|
131
108
|
() => {
|
|
132
|
-
|
|
109
|
+
isError.value = false;
|
|
110
|
+
loading.value = true;
|
|
133
111
|
}
|
|
134
112
|
);
|
|
135
113
|
const load = () => {
|
|
136
|
-
|
|
137
|
-
|
|
114
|
+
isError.value = false;
|
|
115
|
+
loading.value = false;
|
|
138
116
|
emit("load");
|
|
139
117
|
};
|
|
140
118
|
const error = () => {
|
|
141
|
-
|
|
142
|
-
|
|
119
|
+
isError.value = true;
|
|
120
|
+
loading.value = false;
|
|
143
121
|
emit("error");
|
|
144
122
|
};
|
|
145
123
|
const imageClick = (event) => {
|
|
146
124
|
emit("click", event);
|
|
147
125
|
};
|
|
148
|
-
return
|
|
126
|
+
return (_ctx, _cache) => {
|
|
127
|
+
return openBlock(), createElementBlock("div", {
|
|
128
|
+
class: normalizeClass(classes.value),
|
|
129
|
+
style: normalizeStyle(stylebox.value),
|
|
130
|
+
onClick: imageClick
|
|
131
|
+
}, [
|
|
132
|
+
createElementVNode("img", {
|
|
133
|
+
ref_key: "imgRef",
|
|
134
|
+
ref: imgRef,
|
|
135
|
+
class: "nut-img",
|
|
136
|
+
src: _ctx.lazyLoad ? show.value ? _ctx.src : void 0 : _ctx.src,
|
|
137
|
+
"data-src": _ctx.lazyLoad ? show.value ? void 0 : _ctx.src : void 0,
|
|
138
|
+
alt: _ctx.alt,
|
|
139
|
+
style: normalizeStyle(styles.value),
|
|
140
|
+
onLoad: load,
|
|
141
|
+
onError: error
|
|
142
|
+
}, null, 44, _hoisted_1),
|
|
143
|
+
loading.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
144
|
+
renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
145
|
+
createVNode(unref(Image), {
|
|
146
|
+
width: "16px",
|
|
147
|
+
height: "20px",
|
|
148
|
+
name: "image"
|
|
149
|
+
})
|
|
150
|
+
])
|
|
151
|
+
])) : createCommentVNode("", true),
|
|
152
|
+
isError.value && !loading.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
153
|
+
renderSlot(_ctx.$slots, "error", {}, () => [
|
|
154
|
+
createVNode(unref(ImageError), {
|
|
155
|
+
width: "16px",
|
|
156
|
+
height: "20px",
|
|
157
|
+
name: "imageError"
|
|
158
|
+
})
|
|
159
|
+
])
|
|
160
|
+
])) : createCommentVNode("", true)
|
|
161
|
+
], 6);
|
|
162
|
+
};
|
|
149
163
|
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
const _hoisted_2 = {
|
|
153
|
-
key: 0,
|
|
154
|
-
class: "nut-img-loading"
|
|
155
|
-
};
|
|
156
|
-
const _hoisted_3 = {
|
|
157
|
-
key: 1,
|
|
158
|
-
class: "nut-img-error"
|
|
159
|
-
};
|
|
160
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
161
|
-
const _component_Image = resolveComponent("Image");
|
|
162
|
-
const _component_ImageError = resolveComponent("ImageError");
|
|
163
|
-
return openBlock(), createElementBlock("div", {
|
|
164
|
-
class: normalizeClass(_ctx.classes),
|
|
165
|
-
style: normalizeStyle(_ctx.stylebox),
|
|
166
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.imageClick && _ctx.imageClick(...args))
|
|
167
|
-
}, [
|
|
168
|
-
createElementVNode("img", {
|
|
169
|
-
ref: "imgRef",
|
|
170
|
-
class: "nut-img",
|
|
171
|
-
src: _ctx.lazyLoad ? _ctx.show ? _ctx.src : void 0 : _ctx.src,
|
|
172
|
-
"date-src": _ctx.lazyLoad ? _ctx.show ? void 0 : _ctx.src : void 0,
|
|
173
|
-
alt: _ctx.alt,
|
|
174
|
-
style: normalizeStyle(_ctx.styles),
|
|
175
|
-
onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.load && _ctx.load(...args)),
|
|
176
|
-
onError: _cache[1] || (_cache[1] = (...args) => _ctx.error && _ctx.error(...args))
|
|
177
|
-
}, null, 44, _hoisted_1),
|
|
178
|
-
_ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
179
|
-
!_ctx.slotLoding ? (openBlock(), createBlock(_component_Image, {
|
|
180
|
-
key: 0,
|
|
181
|
-
width: "16px",
|
|
182
|
-
height: "20px",
|
|
183
|
-
name: "image"
|
|
184
|
-
})) : createCommentVNode("", true),
|
|
185
|
-
renderSlot(_ctx.$slots, "loading")
|
|
186
|
-
])) : createCommentVNode("", true),
|
|
187
|
-
_ctx.isError && !_ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
188
|
-
!_ctx.slotError ? (openBlock(), createBlock(_component_ImageError, {
|
|
189
|
-
key: 0,
|
|
190
|
-
width: "16px",
|
|
191
|
-
height: "20px",
|
|
192
|
-
name: "imageError"
|
|
193
|
-
})) : createCommentVNode("", true),
|
|
194
|
-
renderSlot(_ctx.$slots, "error")
|
|
195
|
-
])) : createCommentVNode("", true)
|
|
196
|
-
], 6);
|
|
197
|
-
}
|
|
198
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
164
|
+
}));
|
|
165
|
+
withInstall(_sfc_main);
|
|
199
166
|
export {
|
|
200
|
-
|
|
167
|
+
_sfc_main as Image,
|
|
168
|
+
_sfc_main as default
|
|
201
169
|
};
|
|
@@ -31,11 +31,11 @@ import NutVideo from "../video/Video.js";
|
|
|
31
31
|
import NutSwiperItem from "../swiperitem/SwiperItem.js";
|
|
32
32
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
33
33
|
import { CircleClose } from "@nutui/icons-vue";
|
|
34
|
-
import { N as NutPopup } from "../index-
|
|
34
|
+
import { N as NutPopup } from "../index-wLaOjIn1.js";
|
|
35
35
|
import NutSwiper from "../swiper/Swiper.js";
|
|
36
36
|
import { f as funInterceptor } from "../Interceptor-DlY2h6Y7.js";
|
|
37
37
|
import { C as CreateComponent } from "../mountComponent-DBQ88Fjz.js";
|
|
38
|
-
import
|
|
38
|
+
import { Overlay as _sfc_main$2 } from "../overlay/Overlay.js";
|
|
39
39
|
const baseProps = {
|
|
40
40
|
show: { type: Boolean, default: false },
|
|
41
41
|
initNo: { type: Number, default: 0 },
|
|
@@ -503,7 +503,7 @@ class ImagePreviewFunction {
|
|
|
503
503
|
const options = Object.assign(this.options, _options);
|
|
504
504
|
const { unmount } = CreateComponent(options, {
|
|
505
505
|
name: "image-preview",
|
|
506
|
-
components: [NutPopup, NutVideo, NutSwiper, NutSwiperItem,
|
|
506
|
+
components: [NutPopup, NutVideo, NutSwiper, NutSwiperItem, _sfc_main$2],
|
|
507
507
|
wrapper: () => {
|
|
508
508
|
return {
|
|
509
509
|
setup() {
|
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { reactive, computed, watch, watchEffect, toRefs, resolveComponent, openBlock, createBlock, Teleport, mergeProps, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, vShow } from "vue";
|
|
21
21
|
import { Close } from "@nutui/icons-vue";
|
|
22
|
-
import
|
|
22
|
+
import { Overlay as _sfc_main$1 } from "./overlay/Overlay.js";
|
|
23
23
|
import { c as createComponent } from "./component-DQf3CENX.js";
|
|
24
24
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
25
25
|
const popupProps = {
|
|
@@ -105,7 +105,7 @@ const initIndex = 2e3;
|
|
|
105
105
|
let _zIndex = initIndex;
|
|
106
106
|
const _sfc_main = create({
|
|
107
107
|
components: {
|
|
108
|
-
NutOverlay,
|
|
108
|
+
NutOverlay: _sfc_main$1,
|
|
109
109
|
Close
|
|
110
110
|
},
|
|
111
111
|
props: popupProps,
|