@nutui/nutui 4.0.10-beta.1 → 4.0.11
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 +23 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6316 -7237
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +148 -45
- package/dist/styles/themes/jdb.scss +148 -45
- package/dist/styles/themes/jddkh.scss +148 -45
- package/dist/styles/themes/jdt.scss +148 -45
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
import { inject, getCurrentInstance, onUnmounted, computed, ref, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, Fragment, createTextVNode, toDisplayString } from "vue";
|
|
2
|
-
import { u as
|
|
3
|
-
import { c as
|
|
4
|
-
import { p as
|
|
5
|
-
import { G as
|
|
6
|
-
import { _ as
|
|
1
|
+
import { inject as k, getCurrentInstance as y, onUnmounted as x, computed as a, ref as h, openBlock as u, createElementBlock as d, normalizeClass as m, normalizeStyle as S, createElementVNode as p, renderSlot as f, Fragment as v, createTextVNode as b, toDisplayString as N } from "vue";
|
|
2
|
+
import { u as _ } from "./index-50eed3d9.js";
|
|
3
|
+
import { c as B } from "./component-234624bc.js";
|
|
4
|
+
import { p as $ } from "./pxCheck-38173291.js";
|
|
5
|
+
import { G as j } from "./common-d218746f.js";
|
|
6
|
+
import { _ as q } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "../locale/lang";
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onUnmounted(() => remove(instance));
|
|
15
|
-
const index2 = computed(() => internalChildren.indexOf(instance));
|
|
8
|
+
function w(e) {
|
|
9
|
+
const n = k(e, null);
|
|
10
|
+
if (n) {
|
|
11
|
+
const o = y(), { add: s, remove: t, internalChildren: i } = n;
|
|
12
|
+
s(o), x(() => t(o));
|
|
13
|
+
const l = a(() => i.indexOf(o));
|
|
16
14
|
return {
|
|
17
|
-
parent,
|
|
18
|
-
index:
|
|
15
|
+
parent: n,
|
|
16
|
+
index: l
|
|
19
17
|
};
|
|
20
18
|
}
|
|
21
19
|
return {
|
|
22
20
|
parent: null,
|
|
23
|
-
index:
|
|
21
|
+
index: h(-1)
|
|
24
22
|
};
|
|
25
23
|
}
|
|
26
|
-
const { create, componentName } =
|
|
27
|
-
const _sfc_main = create({
|
|
24
|
+
const { create: E, componentName: C } = B("grid-item"), I = E({
|
|
28
25
|
props: {
|
|
29
26
|
text: {
|
|
30
27
|
type: String
|
|
@@ -39,86 +36,63 @@ const _sfc_main = create({
|
|
|
39
36
|
},
|
|
40
37
|
replace: {
|
|
41
38
|
type: Boolean,
|
|
42
|
-
default:
|
|
39
|
+
default: !1
|
|
43
40
|
}
|
|
44
41
|
},
|
|
45
42
|
emits: ["click"],
|
|
46
|
-
setup(
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
43
|
+
setup(e, { emit: n }) {
|
|
44
|
+
const o = w(j);
|
|
45
|
+
if (!o.parent)
|
|
49
46
|
return {};
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
[prefixCls]: true
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
const rootStyle = computed(() => {
|
|
59
|
-
const style = {
|
|
60
|
-
flexBasis: `${100 / +parent.columnNum}%`
|
|
47
|
+
const s = o.index, t = o.parent.props, i = a(() => ({
|
|
48
|
+
[C]: !0
|
|
49
|
+
})), l = a(() => {
|
|
50
|
+
const r = {
|
|
51
|
+
flexBasis: `${100 / +t.columnNum}%`
|
|
61
52
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
style.paddingRight = pxCheck(parent.gutter);
|
|
66
|
-
if (index2.value >= parent.columnNum) {
|
|
67
|
-
style.marginTop = pxCheck(parent.gutter);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return style;
|
|
71
|
-
});
|
|
72
|
-
const contentClass = computed(() => {
|
|
73
|
-
const prefixCls = `${componentName}__content`;
|
|
53
|
+
return t.square ? r.paddingTop = `${100 / +t.columnNum}%` : t.gutter && (r.paddingRight = $(t.gutter), s.value >= t.columnNum && (r.marginTop = $(t.gutter))), r;
|
|
54
|
+
}), g = a(() => {
|
|
55
|
+
const r = `${C}__content`;
|
|
74
56
|
return {
|
|
75
|
-
[`${
|
|
76
|
-
[`${
|
|
77
|
-
[`${
|
|
78
|
-
[`${
|
|
79
|
-
[`${
|
|
80
|
-
[`${
|
|
81
|
-
[`${
|
|
82
|
-
[`${
|
|
57
|
+
[`${r}`]: !0,
|
|
58
|
+
[`${r}--border`]: t.border,
|
|
59
|
+
[`${r}--surround`]: t.border && t.gutter,
|
|
60
|
+
[`${r}--center`]: t.center,
|
|
61
|
+
[`${r}--square`]: t.square,
|
|
62
|
+
[`${r}--reverse`]: t.reverse,
|
|
63
|
+
[`${r}--${t.direction}`]: !!t.direction,
|
|
64
|
+
[`${r}--clickable`]: t.clickable || e.to || e.url
|
|
83
65
|
};
|
|
84
|
-
});
|
|
85
|
-
const router = useRouter();
|
|
86
|
-
const handleClick = (event) => {
|
|
87
|
-
emit("click", event);
|
|
88
|
-
if (props.to && router) {
|
|
89
|
-
router[props.replace ? "replace" : "push"](props.to);
|
|
90
|
-
} else if (props.url) {
|
|
91
|
-
props.replace ? location.replace(props.url) : location.href = props.url;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
66
|
+
}), c = _();
|
|
94
67
|
return {
|
|
95
|
-
rootClass,
|
|
96
|
-
rootStyle,
|
|
97
|
-
contentClass,
|
|
98
|
-
handleClick
|
|
68
|
+
rootClass: i,
|
|
69
|
+
rootStyle: l,
|
|
70
|
+
contentClass: g,
|
|
71
|
+
handleClick: (r) => {
|
|
72
|
+
n("click", r), e.to && c ? c[e.replace ? "replace" : "push"](e.to) : e.url && (e.replace ? location.replace(e.url) : location.href = e.url);
|
|
73
|
+
}
|
|
99
74
|
};
|
|
100
75
|
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
76
|
+
}), R = { class: "nut-grid-item__text" };
|
|
77
|
+
function T(e, n, o, s, t, i) {
|
|
78
|
+
return u(), d("view", {
|
|
79
|
+
class: m(e.rootClass),
|
|
80
|
+
style: S(e.rootStyle),
|
|
81
|
+
onClick: n[0] || (n[0] = (...l) => e.handleClick && e.handleClick(...l))
|
|
108
82
|
}, [
|
|
109
|
-
|
|
110
|
-
class:
|
|
83
|
+
p("view", {
|
|
84
|
+
class: m(e.contentClass)
|
|
111
85
|
}, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
], 64)) :
|
|
86
|
+
f(e.$slots, "default"),
|
|
87
|
+
p("view", R, [
|
|
88
|
+
e.text ? (u(), d(v, { key: 0 }, [
|
|
89
|
+
b(N(e.text), 1)
|
|
90
|
+
], 64)) : f(e.$slots, "text", { key: 1 })
|
|
117
91
|
])
|
|
118
92
|
], 2)
|
|
119
93
|
], 6);
|
|
120
94
|
}
|
|
121
|
-
const
|
|
95
|
+
const U = /* @__PURE__ */ q(I, [["render", T]]);
|
|
122
96
|
export {
|
|
123
|
-
|
|
97
|
+
U as default
|
|
124
98
|
};
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { reactive, useSlots, computed, ref, onMounted, onBeforeUnmount, watch, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, createCommentVNode, renderSlot } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
|
|
23
|
-
import { Image, ImageError } from "@nutui/icons-vue";
|
|
24
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var R = Object.defineProperty, j = Object.defineProperties;
|
|
2
|
+
var M = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var y = Object.getOwnPropertySymbols;
|
|
4
|
+
var O = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var v = (e, o, r) => o in e ? R(e, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[o] = r, p = (e, o) => {
|
|
6
|
+
for (var r in o || (o = {}))
|
|
7
|
+
O.call(o, r) && v(e, r, o[r]);
|
|
8
|
+
if (y)
|
|
9
|
+
for (var r of y(o))
|
|
10
|
+
V.call(o, r) && v(e, r, o[r]);
|
|
11
|
+
return e;
|
|
12
|
+
}, E = (e, o) => j(e, M(o));
|
|
13
|
+
import { reactive as F, useSlots as k, computed as m, ref as g, onMounted as P, onBeforeUnmount as U, watch as q, toRefs as A, resolveComponent as w, openBlock as i, createElementBlock as c, normalizeClass as D, normalizeStyle as b, createElementVNode as G, createBlock as C, createCommentVNode as a, renderSlot as S } from "vue";
|
|
14
|
+
import { c as H } from "./component-234624bc.js";
|
|
15
|
+
import { p as f } from "./pxCheck-38173291.js";
|
|
16
|
+
import { Image as J, ImageError as K } from "@nutui/icons-vue";
|
|
17
|
+
import { _ as Q } from "./_plugin-vue_export-helper-dad06003.js";
|
|
25
18
|
import "../locale/lang";
|
|
26
|
-
const { componentName, create } =
|
|
27
|
-
const _sfc_main = create({
|
|
19
|
+
const { componentName: T, create: W } = H("image"), X = W({
|
|
28
20
|
props: {
|
|
29
21
|
src: String,
|
|
30
22
|
fit: {
|
|
@@ -49,153 +41,122 @@ const _sfc_main = create({
|
|
|
49
41
|
},
|
|
50
42
|
round: {
|
|
51
43
|
type: Boolean,
|
|
52
|
-
default:
|
|
44
|
+
default: !1
|
|
53
45
|
},
|
|
54
46
|
radius: [String, Number],
|
|
55
47
|
showError: {
|
|
56
48
|
type: Boolean,
|
|
57
|
-
default:
|
|
49
|
+
default: !0
|
|
58
50
|
},
|
|
59
51
|
showLoading: {
|
|
60
52
|
type: Boolean,
|
|
61
|
-
default:
|
|
53
|
+
default: !0
|
|
62
54
|
},
|
|
63
55
|
lazyLoad: {
|
|
64
56
|
type: Boolean,
|
|
65
|
-
default:
|
|
57
|
+
default: !1
|
|
66
58
|
}
|
|
67
59
|
},
|
|
68
60
|
components: {
|
|
69
|
-
Image,
|
|
70
|
-
ImageError
|
|
61
|
+
Image: J,
|
|
62
|
+
ImageError: K
|
|
71
63
|
},
|
|
72
64
|
emits: ["click", "load", "error"],
|
|
73
|
-
setup(
|
|
74
|
-
const
|
|
75
|
-
loading:
|
|
76
|
-
isError:
|
|
77
|
-
slotLoding:
|
|
78
|
-
slotError:
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
const prefixCls = componentName;
|
|
65
|
+
setup(e, { emit: o }) {
|
|
66
|
+
const r = F({
|
|
67
|
+
loading: !0,
|
|
68
|
+
isError: !1,
|
|
69
|
+
slotLoding: k().loading,
|
|
70
|
+
slotError: k().error
|
|
71
|
+
}), h = m(() => {
|
|
72
|
+
const t = T;
|
|
82
73
|
return {
|
|
83
|
-
[
|
|
84
|
-
[`${
|
|
74
|
+
[t]: !0,
|
|
75
|
+
[`${t}-round`]: e.round
|
|
85
76
|
};
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
const show = ref(false);
|
|
89
|
-
const imgRef = ref(null);
|
|
90
|
-
const initObserver = () => {
|
|
91
|
-
const options = {
|
|
77
|
+
}), n = g(null), d = g(!1), l = g(null), u = () => {
|
|
78
|
+
const t = {
|
|
92
79
|
threshold: [0],
|
|
93
80
|
rootMargin: "0px"
|
|
94
81
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
show.value = true;
|
|
99
|
-
observer.value.disconnect();
|
|
100
|
-
}
|
|
82
|
+
n.value = new IntersectionObserver((z) => {
|
|
83
|
+
z.forEach((N) => {
|
|
84
|
+
N.isIntersecting && (d.value = !0, n.value.disconnect());
|
|
101
85
|
});
|
|
102
|
-
},
|
|
103
|
-
imgRef.value && observer.value.observe(imgRef.value);
|
|
86
|
+
}, t), l.value && n.value.observe(l.value);
|
|
104
87
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
observer.value && observer.value.disconnect();
|
|
110
|
-
});
|
|
111
|
-
const stylebox = computed(() => {
|
|
112
|
-
let style = {};
|
|
113
|
-
if (props.width)
|
|
114
|
-
style.width = pxCheck(props.width);
|
|
115
|
-
if (props.height)
|
|
116
|
-
style.height = pxCheck(props.height);
|
|
117
|
-
if (props.radius !== void 0 && props.radius !== null) {
|
|
118
|
-
style.overflow = "hidden";
|
|
119
|
-
style.borderRadius = pxCheck(props.radius);
|
|
120
|
-
}
|
|
121
|
-
return style;
|
|
122
|
-
});
|
|
123
|
-
const styles = computed(() => {
|
|
124
|
-
let styless = {
|
|
125
|
-
objectFit: props.fit,
|
|
126
|
-
objectPosition: props.position
|
|
127
|
-
};
|
|
128
|
-
return styless;
|
|
88
|
+
P(() => {
|
|
89
|
+
e.lazyLoad && u();
|
|
90
|
+
}), U(() => {
|
|
91
|
+
n.value && n.value.disconnect();
|
|
129
92
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
(
|
|
133
|
-
|
|
93
|
+
const s = m(() => {
|
|
94
|
+
let t = {};
|
|
95
|
+
return e.width && (t.width = f(e.width)), e.height && (t.height = f(e.height)), e.radius !== void 0 && e.radius !== null && (t.overflow = "hidden", t.borderRadius = f(e.radius)), t;
|
|
96
|
+
}), B = m(() => ({
|
|
97
|
+
objectFit: e.fit,
|
|
98
|
+
objectPosition: e.position
|
|
99
|
+
}));
|
|
100
|
+
q(
|
|
101
|
+
() => e.src,
|
|
102
|
+
(t) => {
|
|
103
|
+
r.isError = !1, r.loading = !0;
|
|
134
104
|
}
|
|
135
105
|
);
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
106
|
+
const I = () => {
|
|
107
|
+
r.loading = !1, o("load");
|
|
108
|
+
}, L = () => {
|
|
109
|
+
r.isError = !0, r.loading = !1, o("error");
|
|
110
|
+
}, $ = (t) => {
|
|
111
|
+
o("click", t);
|
|
139
112
|
};
|
|
140
|
-
|
|
141
|
-
state.isError = true;
|
|
142
|
-
state.loading = false;
|
|
143
|
-
emit("error");
|
|
144
|
-
};
|
|
145
|
-
const imageClick = (event) => {
|
|
146
|
-
emit("click", event);
|
|
147
|
-
};
|
|
148
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), { imageClick, classes, styles, stylebox, error, load, show, imgRef });
|
|
113
|
+
return E(p({}, A(r)), { imageClick: $, classes: h, styles: B, stylebox: s, error: L, load: I, show: d, imgRef: l });
|
|
149
114
|
}
|
|
150
|
-
})
|
|
151
|
-
const _hoisted_1 = ["src", "date-src", "alt"];
|
|
152
|
-
const _hoisted_2 = {
|
|
115
|
+
}), Y = ["src", "date-src", "alt"], Z = {
|
|
153
116
|
key: 0,
|
|
154
117
|
class: "nut-img-loading"
|
|
155
|
-
}
|
|
156
|
-
const _hoisted_3 = {
|
|
118
|
+
}, x = {
|
|
157
119
|
key: 1,
|
|
158
120
|
class: "nut-img-error"
|
|
159
121
|
};
|
|
160
|
-
function
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.imageClick && _ctx.imageClick(...args))
|
|
122
|
+
function _(e, o, r, h, n, d) {
|
|
123
|
+
const l = w("Image"), u = w("ImageError");
|
|
124
|
+
return i(), c("div", {
|
|
125
|
+
class: D(e.classes),
|
|
126
|
+
style: b(e.stylebox),
|
|
127
|
+
onClick: o[2] || (o[2] = (...s) => e.imageClick && e.imageClick(...s))
|
|
167
128
|
}, [
|
|
168
|
-
|
|
129
|
+
G("img", {
|
|
169
130
|
ref: "imgRef",
|
|
170
131
|
class: "nut-img",
|
|
171
|
-
src:
|
|
172
|
-
"date-src":
|
|
173
|
-
alt:
|
|
174
|
-
onLoad:
|
|
175
|
-
onError:
|
|
176
|
-
style:
|
|
177
|
-
}, null, 44,
|
|
178
|
-
|
|
179
|
-
|
|
132
|
+
src: e.lazyLoad ? e.show ? e.src : void 0 : e.src,
|
|
133
|
+
"date-src": e.lazyLoad ? e.show ? void 0 : e.src : void 0,
|
|
134
|
+
alt: e.alt,
|
|
135
|
+
onLoad: o[0] || (o[0] = (...s) => e.load && e.load(...s)),
|
|
136
|
+
onError: o[1] || (o[1] = (...s) => e.error && e.error(...s)),
|
|
137
|
+
style: b(e.styles)
|
|
138
|
+
}, null, 44, Y),
|
|
139
|
+
e.loading ? (i(), c("div", Z, [
|
|
140
|
+
e.slotLoding ? a("", !0) : (i(), C(l, {
|
|
180
141
|
key: 0,
|
|
181
142
|
width: "16px",
|
|
182
143
|
height: "20px",
|
|
183
144
|
name: "image"
|
|
184
|
-
}))
|
|
185
|
-
|
|
186
|
-
])) :
|
|
187
|
-
|
|
188
|
-
|
|
145
|
+
})),
|
|
146
|
+
S(e.$slots, "loading")
|
|
147
|
+
])) : a("", !0),
|
|
148
|
+
e.isError && !e.loading ? (i(), c("div", x, [
|
|
149
|
+
e.slotError ? a("", !0) : (i(), C(u, {
|
|
189
150
|
key: 0,
|
|
190
151
|
width: "16px",
|
|
191
152
|
height: "20px",
|
|
192
153
|
name: "imageError"
|
|
193
|
-
}))
|
|
194
|
-
|
|
195
|
-
])) :
|
|
154
|
+
})),
|
|
155
|
+
S(e.$slots, "error")
|
|
156
|
+
])) : a("", !0)
|
|
196
157
|
], 6);
|
|
197
158
|
}
|
|
198
|
-
const
|
|
159
|
+
const ie = /* @__PURE__ */ Q(X, [["render", _]]);
|
|
199
160
|
export {
|
|
200
|
-
|
|
161
|
+
ie as default
|
|
201
162
|
};
|