@nutui/nutui 4.0.10-beta.1 → 4.0.10

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