@nutui/nutui 4.0.11 → 4.0.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.
Files changed (158) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +2 -2
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +111 -78
  5. package/dist/packages/_es/Address.js +375 -250
  6. package/dist/packages/_es/AddressList.js +354 -269
  7. package/dist/packages/_es/Animate.js +58 -41
  8. package/dist/packages/_es/Audio.js +197 -128
  9. package/dist/packages/_es/AudioOperate.js +71 -60
  10. package/dist/packages/_es/Avatar.js +89 -66
  11. package/dist/packages/_es/AvatarGroup.js +31 -23
  12. package/dist/packages/_es/Backtop.js +99 -59
  13. package/dist/packages/_es/Badge.js +47 -36
  14. package/dist/packages/_es/Barrage.js +147 -68
  15. package/dist/packages/_es/Button.js +66 -47
  16. package/dist/packages/_es/Calendar.js +157 -135
  17. package/dist/packages/_es/CalendarItem.js +6 -6
  18. package/dist/packages/_es/Card.js +56 -42
  19. package/dist/packages/_es/Cascader.js +474 -315
  20. package/dist/packages/_es/Category.js +39 -29
  21. package/dist/packages/_es/CategoryPane.js +83 -57
  22. package/dist/packages/_es/Cell.js +71 -56
  23. package/dist/packages/_es/CellGroup.js +27 -19
  24. package/dist/packages/_es/Checkbox.js +156 -109
  25. package/dist/packages/_es/CheckboxGroup.js +59 -38
  26. package/dist/packages/_es/CircleProgress.js +96 -67
  27. package/dist/packages/_es/Col.js +31 -23
  28. package/dist/packages/_es/Collapse.js +58 -33
  29. package/dist/packages/_es/CollapseItem.js +108 -78
  30. package/dist/packages/_es/Comment.js +279 -207
  31. package/dist/packages/_es/ConfigProvider.js +55 -37
  32. package/dist/packages/_es/Countdown.js +212 -100
  33. package/dist/packages/_es/Countup.js +445 -232
  34. package/dist/packages/_es/DatePicker.js +265 -162
  35. package/dist/packages/_es/Dialog.js +213 -161
  36. package/dist/packages/_es/Divider.js +57 -42
  37. package/dist/packages/_es/Drag.js +153 -70
  38. package/dist/packages/_es/Ecard.js +104 -64
  39. package/dist/packages/_es/Elevator.js +219 -143
  40. package/dist/packages/_es/Ellipsis.js +178 -95
  41. package/dist/packages/_es/Empty.js +39 -23
  42. package/dist/packages/_es/FixedNav.js +116 -93
  43. package/dist/packages/_es/Form.js +178 -107
  44. package/dist/packages/_es/FormItem.js +61 -48
  45. package/dist/packages/_es/Grid.js +6 -5
  46. package/dist/packages/_es/GridItem.js +84 -58
  47. package/dist/packages/_es/Image.js +130 -90
  48. package/dist/packages/_es/ImagePreview.js +412 -256
  49. package/dist/packages/_es/Indicator.js +34 -30
  50. package/dist/packages/_es/InfiniteLoading.js +136 -83
  51. package/dist/packages/_es/Input.js +264 -160
  52. package/dist/packages/_es/InputNumber.js +117 -81
  53. package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
  54. package/dist/packages/_es/Invoice.js +130 -104
  55. package/dist/packages/_es/Layout.js +4 -3
  56. package/dist/packages/_es/List.js +215 -117
  57. package/dist/packages/_es/Menu.js +150 -95
  58. package/dist/packages/_es/MenuItem.js +154 -109
  59. package/dist/packages/_es/Navbar.js +119 -103
  60. package/dist/packages/_es/Noticebar.js +312 -197
  61. package/dist/packages/_es/Notify.js +166 -110
  62. package/dist/packages/_es/NumberKeyboard.js +202 -127
  63. package/dist/packages/_es/Overlay.js +80 -52
  64. package/dist/packages/_es/Pagination.js +100 -70
  65. package/dist/packages/_es/Picker.js +437 -275
  66. package/dist/packages/_es/Popover.js +225 -122
  67. package/dist/packages/_es/Popup.js +4 -4
  68. package/dist/packages/_es/Price.js +82 -44
  69. package/dist/packages/_es/Progress.js +79 -63
  70. package/dist/packages/_es/PullRefresh.js +173 -95
  71. package/dist/packages/_es/Radio.js +4 -4
  72. package/dist/packages/_es/RadioGroup.js +3 -3
  73. package/dist/packages/_es/Range.js +347 -204
  74. package/dist/packages/_es/Rate.js +141 -92
  75. package/dist/packages/_es/Row.js +27 -21
  76. package/dist/packages/_es/Searchbar.js +174 -123
  77. package/dist/packages/_es/ShortPassword.js +93 -69
  78. package/dist/packages/_es/SideNavbar.js +80 -49
  79. package/dist/packages/_es/SideNavbarItem.js +32 -22
  80. package/dist/packages/_es/Signature.js +146 -83
  81. package/dist/packages/_es/Skeleton.js +130 -110
  82. package/dist/packages/_es/Sku.js +343 -250
  83. package/dist/packages/_es/Step.js +86 -59
  84. package/dist/packages/_es/Steps.js +31 -26
  85. package/dist/packages/_es/Sticky.js +4 -4
  86. package/dist/packages/_es/SubSideNavbar.js +74 -52
  87. package/dist/packages/_es/Swipe.js +155 -83
  88. package/dist/packages/_es/Swiper.js +311 -174
  89. package/dist/packages/_es/SwiperItem.js +44 -28
  90. package/dist/packages/_es/Switch.js +68 -55
  91. package/dist/packages/_es/TabPane.js +41 -30
  92. package/dist/packages/_es/Tabbar.js +52 -41
  93. package/dist/packages/_es/TabbarItem.js +82 -61
  94. package/dist/packages/_es/Table.js +165 -109
  95. package/dist/packages/_es/Tabs.js +388 -240
  96. package/dist/packages/_es/Tag.js +61 -44
  97. package/dist/packages/_es/Textarea.js +124 -80
  98. package/dist/packages/_es/TimeDetail.js +76 -49
  99. package/dist/packages/_es/TimePannel.js +48 -34
  100. package/dist/packages/_es/TimeSelect.js +68 -47
  101. package/dist/packages/_es/Toast.js +218 -144
  102. package/dist/packages/_es/Tour.js +192 -138
  103. package/dist/packages/_es/TrendArrow.js +77 -57
  104. package/dist/packages/_es/Uploader.js +359 -234
  105. package/dist/packages/_es/Video.js +316 -191
  106. package/dist/packages/_es/Watermark.js +117 -84
  107. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
  108. package/dist/packages/_es/common-b9a5e726.js +145 -0
  109. package/dist/packages/_es/component-81a4c1d0.js +145 -0
  110. package/dist/packages/_es/index-29892cda.js +33 -0
  111. package/dist/packages/_es/index-43c34ac6.js +30 -0
  112. package/dist/packages/_es/index-54d03fc1.js +8 -0
  113. package/dist/packages/_es/index-79c5dc33.js +10 -0
  114. package/dist/packages/_es/index-7a7385e4.js +67 -0
  115. package/dist/packages/_es/index-87422be8.js +942 -0
  116. package/dist/packages/_es/index-da0a7662.js +259 -0
  117. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
  120. package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
  121. package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
  122. package/dist/packages/_es/raf-729dad54.js +25 -0
  123. package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
  124. package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
  125. package/dist/packages/locale/lang/en-US.js +39 -36
  126. package/dist/packages/locale/lang/id-ID.js +39 -36
  127. package/dist/packages/locale/lang/index.js +44 -22
  128. package/dist/packages/locale/lang/zh-CN.js +38 -35
  129. package/dist/packages/locale/lang/zh-TW.js +38 -35
  130. package/dist/resolver/index.js +26 -1
  131. package/dist/resolver/index.mjs +17 -14
  132. package/dist/smartips/web-types.json +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/styles/themes/default.scss +48 -48
  135. package/dist/styles/themes/jdb.scss +48 -48
  136. package/dist/styles/themes/jddkh.scss +48 -48
  137. package/dist/styles/themes/jdt.scss +48 -48
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +3 -4
  140. package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
  141. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
  142. package/dist/packages/_es/common-d218746f.js +0 -116
  143. package/dist/packages/_es/component-234624bc.js +0 -89
  144. package/dist/packages/_es/index-14dfadc4.js +0 -561
  145. package/dist/packages/_es/index-192a3ef6.js +0 -29
  146. package/dist/packages/_es/index-360c5092.js +0 -210
  147. package/dist/packages/_es/index-496e6e05.js +0 -24
  148. package/dist/packages/_es/index-50eed3d9.js +0 -7
  149. package/dist/packages/_es/index-53ec2d4d.js +0 -34
  150. package/dist/packages/_es/index-fadb0974.js +0 -8
  151. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
  152. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
  153. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
  154. package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
  155. package/dist/packages/_es/pxCheck-38173291.js +0 -4
  156. package/dist/packages/_es/raf-a74f1a06.js +0 -16
  157. package/dist/packages/_es/renderIcon-47498b32.js +0 -5
  158. package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
@@ -1,13 +1,15 @@
1
- import { resolveComponent as C, openBlock as c, createElementBlock as f, createElementVNode as m, renderSlot as i, toDisplayString as h, createCommentVNode as D, createVNode as $, createTextVNode as L, ref as E, h as N, createBlock as y, resolveDynamicComponent as _, withCtx as a, reactive as O, computed as j, watch as R, onMounted as V, normalizeClass as F, Fragment as q, renderList as z, createSlots as G } from "vue";
2
- import { c as P, n as H } from "./component-234624bc.js";
3
- import { Del as J, Edit as K } from "@nutui/icons-vue";
4
- import { _ as S } from "./_plugin-vue_export-helper-dad06003.js";
5
- import I from "./Button.js";
6
- import A from "./Swipe.js";
1
+ import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, toDisplayString, createCommentVNode, createVNode, createTextVNode, ref, h, createBlock, resolveDynamicComponent, withCtx, reactive, computed, watch, onMounted, normalizeClass, Fragment, renderList, createSlots } from "vue";
2
+ import { c as createComponent, n as floatData } from "./component-81a4c1d0.js";
3
+ import { Del, Edit } from "@nutui/icons-vue";
4
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
+ import Button from "./Button.js";
6
+ import Swipe from "./Swipe.js";
7
7
  import "../locale/lang";
8
- import "./index-53ec2d4d.js";
9
- const { create: Q } = P("address-list-item"), { translate: U } = P("address-list"), W = Q({
10
- components: { Del: J, Edit: K },
8
+ import "./index-7a7385e4.js";
9
+ const { create: create$2 } = createComponent("address-list-item");
10
+ const { translate: translate$1 } = createComponent("address-list");
11
+ const _sfc_main$2 = create$2({
12
+ components: { Del, Edit },
11
13
  props: {
12
14
  item: {
13
15
  type: Object,
@@ -15,61 +17,77 @@ const { create: Q } = P("address-list-item"), { translate: U } = P("address-list
15
17
  }
16
18
  },
17
19
  emits: ["delIcon", "editIcon", "clickItem"],
18
- setup(o, { emit: t }) {
20
+ setup(props, { emit }) {
21
+ const delClick = (event) => {
22
+ emit("delIcon", event, props.item);
23
+ event.stopPropagation();
24
+ };
25
+ const editClick = (event) => {
26
+ emit("editIcon", event, props.item);
27
+ event.stopPropagation();
28
+ };
29
+ const contentsClick = (event) => {
30
+ emit("clickItem", event, props.item);
31
+ event.stopPropagation();
32
+ };
19
33
  return {
20
- delClick: (l) => {
21
- t("delIcon", l, o.item), l.stopPropagation();
22
- },
23
- editClick: (l) => {
24
- t("editIcon", l, o.item), l.stopPropagation();
25
- },
26
- contentsClick: (l) => {
27
- t("clickItem", l, o.item), l.stopPropagation();
28
- },
29
- translate: U
34
+ delClick,
35
+ editClick,
36
+ contentsClick,
37
+ translate: translate$1
30
38
  };
31
39
  }
32
- }), X = { class: "nut-address-list-item__info" }, Y = { class: "nut-address-list-item__info-contact" }, Z = { class: "nut-address-list-item__info-contact-name" }, x = { class: "nut-address-list-item__info-contact-tel" }, oo = {
40
+ });
41
+ const _hoisted_1$1 = { class: "nut-address-list-item__info" };
42
+ const _hoisted_2$1 = { class: "nut-address-list-item__info-contact" };
43
+ const _hoisted_3 = { class: "nut-address-list-item__info-contact-name" };
44
+ const _hoisted_4 = { class: "nut-address-list-item__info-contact-tel" };
45
+ const _hoisted_5 = {
33
46
  key: 0,
34
47
  class: "nut-address-list-item__info-contact-default"
35
- }, to = { class: "nut-address-list-item__info-handle" }, eo = { class: "nut-address-list-item__addr" };
36
- function no(o, t, g, r, k, l) {
37
- const p = C("Del"), u = C("Edit");
38
- return c(), f("div", {
48
+ };
49
+ const _hoisted_6 = { class: "nut-address-list-item__info-handle" };
50
+ const _hoisted_7 = { class: "nut-address-list-item__addr" };
51
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
52
+ const _component_Del = resolveComponent("Del");
53
+ const _component_Edit = resolveComponent("Edit");
54
+ return openBlock(), createElementBlock("div", {
39
55
  class: "nut-address-list-item",
40
- onClick: t[0] || (t[0] = (...s) => o.contentsClick && o.contentsClick(...s))
56
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.contentsClick && _ctx.contentsClick(...args))
41
57
  }, [
42
- m("div", X, [
43
- m("div", Y, [
44
- i(o.$slots, "content-top", {}, () => [
45
- m("div", Z, h(o.item.addressName), 1),
46
- m("div", x, h(o.item.phone), 1),
47
- o.item.defaultAddress ? (c(), f("div", oo, h(o.translate("default")), 1)) : D("", !0)
58
+ createElementVNode("div", _hoisted_1$1, [
59
+ createElementVNode("div", _hoisted_2$1, [
60
+ renderSlot(_ctx.$slots, "content-top", {}, () => [
61
+ createElementVNode("div", _hoisted_3, toDisplayString(_ctx.item.addressName), 1),
62
+ createElementVNode("div", _hoisted_4, toDisplayString(_ctx.item.phone), 1),
63
+ _ctx.item.defaultAddress ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(_ctx.translate("default")), 1)) : createCommentVNode("", true)
48
64
  ])
49
65
  ]),
50
- m("div", to, [
51
- i(o.$slots, "content-icon", {}, () => [
52
- $(p, {
66
+ createElementVNode("div", _hoisted_6, [
67
+ renderSlot(_ctx.$slots, "content-icon", {}, () => [
68
+ createVNode(_component_Del, {
53
69
  name: "del",
54
70
  class: "nut-address-list-item__info-handle-del",
55
- onClick: o.delClick
71
+ onClick: _ctx.delClick
56
72
  }, null, 8, ["onClick"]),
57
- $(u, {
73
+ createVNode(_component_Edit, {
58
74
  name: "edit",
59
75
  class: "nut-address-list-item__info-handle-edit",
60
- onClick: o.editClick
76
+ onClick: _ctx.editClick
61
77
  }, null, 8, ["onClick"])
62
78
  ])
63
79
  ])
64
80
  ]),
65
- m("div", eo, [
66
- i(o.$slots, "content-addr", {}, () => [
67
- L(h(o.item.fullAddress), 1)
81
+ createElementVNode("div", _hoisted_7, [
82
+ renderSlot(_ctx.$slots, "content-addr", {}, () => [
83
+ createTextVNode(toDisplayString(_ctx.item.fullAddress), 1)
68
84
  ])
69
85
  ])
70
86
  ]);
71
87
  }
72
- const M = /* @__PURE__ */ S(W, [["render", no]]), { create: so } = P("address-list-general"), lo = so({
88
+ const ItemContents = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
89
+ const { create: create$1 } = createComponent("address-list-general");
90
+ const _sfc_main$1 = create$1({
73
91
  props: {
74
92
  item: {
75
93
  type: Object,
@@ -77,172 +95,210 @@ const M = /* @__PURE__ */ S(W, [["render", no]]), { create: so } = P("address-li
77
95
  },
78
96
  longPress: {
79
97
  type: Boolean,
80
- default: !1
98
+ default: false
81
99
  },
82
100
  swipeEdition: {
83
101
  type: Boolean,
84
- default: !1
102
+ default: false
85
103
  }
86
104
  },
87
105
  emits: ["delIcon", "editIcon", "clickItem", "longDown", "longCopy", "longSet", "longDel", "swipeDel"],
88
106
  components: {
89
- ItemContents: M,
90
- [I.name]: I,
91
- [A.name]: A
107
+ ItemContents,
108
+ [Button.name]: Button,
109
+ [Swipe.name]: Swipe
92
110
  },
93
- setup(o, { emit: t }) {
94
- const g = () => N(M, {
95
- item: o.item,
96
- onDelIcon(e) {
97
- p(e);
98
- },
99
- onEditIcon(e) {
100
- u(e);
101
- },
102
- onClickItem(e) {
103
- s(e);
111
+ setup(props, { emit }) {
112
+ const renderCompontent = () => {
113
+ return h(ItemContents, {
114
+ item: props.item,
115
+ onDelIcon(event) {
116
+ delClick(event);
117
+ },
118
+ onEditIcon(event) {
119
+ editClick(event);
120
+ },
121
+ onClickItem(event) {
122
+ clickItem(event);
123
+ }
124
+ });
125
+ };
126
+ let loop = null;
127
+ const moveRef = ref(false);
128
+ const showMaskRef = ref(false);
129
+ const delClick = (event) => {
130
+ emit("delIcon", event, props.item);
131
+ event.stopPropagation();
132
+ };
133
+ const editClick = (event) => {
134
+ emit("editIcon", event, props.item);
135
+ event.stopPropagation();
136
+ };
137
+ const clickItem = (event) => {
138
+ if (moveRef.value)
139
+ return;
140
+ emit("clickItem", event, props.item);
141
+ event.stopPropagation();
142
+ };
143
+ const delLongClick = (event) => {
144
+ emit("longDel", event, props.item);
145
+ event.stopPropagation();
146
+ };
147
+ const holdingFunc = (event) => {
148
+ loop = 0;
149
+ showMaskRef.value = true;
150
+ emit("longDown", event, props.item);
151
+ };
152
+ const holddownstart = (event) => {
153
+ loop = setTimeout(() => {
154
+ holdingFunc(event);
155
+ }, 300);
156
+ };
157
+ const holddownmove = () => {
158
+ clearTimeout(loop);
159
+ };
160
+ const holddownend = () => {
161
+ clearTimeout(loop);
162
+ };
163
+ const hideMaskClick = () => {
164
+ showMaskRef.value = false;
165
+ };
166
+ const copyCLick = (event) => {
167
+ emit("longCopy", event, props.item);
168
+ event.stopPropagation();
169
+ };
170
+ const setDefault = (event) => {
171
+ emit("longSet", event, props.item);
172
+ event.stopPropagation();
173
+ };
174
+ const maskClick = (event) => {
175
+ if (loop != 0) {
176
+ showMaskRef.value = false;
104
177
  }
105
- });
106
- let r = null;
107
- const k = E(!1), l = E(!1), p = (e) => {
108
- t("delIcon", e, o.item), e.stopPropagation();
109
- }, u = (e) => {
110
- t("editIcon", e, o.item), e.stopPropagation();
111
- }, s = (e) => {
112
- k.value || (t("clickItem", e, o.item), e.stopPropagation());
113
- }, w = (e) => {
114
- t("longDel", e, o.item), e.stopPropagation();
115
- }, v = (e) => {
116
- r = 0, l.value = !0, t("longDown", e, o.item);
178
+ event.stopPropagation();
179
+ event.preventDefault();
180
+ };
181
+ const swipeDelClick = (event) => {
182
+ emit("swipeDel", event, props.item);
183
+ event.stopPropagation();
184
+ };
185
+ const swipestart = () => {
186
+ moveRef.value = false;
187
+ };
188
+ const swipemove = () => {
189
+ moveRef.value = true;
117
190
  };
118
191
  return {
119
- renderCompontent: g,
120
- showMaskRef: l,
121
- clickItem: s,
122
- editClick: u,
123
- delClick: p,
124
- delLongClick: w,
125
- holddownstart: (e) => {
126
- r = setTimeout(() => {
127
- v(e);
128
- }, 300);
129
- },
130
- holddownmove: () => {
131
- clearTimeout(r);
132
- },
133
- holddownend: () => {
134
- clearTimeout(r);
135
- },
136
- copyCLick: (e) => {
137
- t("longCopy", e, o.item), e.stopPropagation();
138
- },
139
- hideMaskClick: () => {
140
- l.value = !1;
141
- },
142
- setDefault: (e) => {
143
- t("longSet", e, o.item), e.stopPropagation();
144
- },
145
- maskClick: (e) => {
146
- r != 0 && (l.value = !1), e.stopPropagation(), e.preventDefault();
147
- },
148
- swipeDelClick: (e) => {
149
- t("swipeDel", e, o.item), e.stopPropagation();
150
- },
151
- swipestart: () => {
152
- k.value = !1;
153
- },
154
- swipemove: () => {
155
- k.value = !0;
156
- }
192
+ renderCompontent,
193
+ showMaskRef,
194
+ clickItem,
195
+ editClick,
196
+ delClick,
197
+ delLongClick,
198
+ holddownstart,
199
+ holddownmove,
200
+ holddownend,
201
+ copyCLick,
202
+ hideMaskClick,
203
+ setDefault,
204
+ maskClick,
205
+ swipeDelClick,
206
+ swipestart,
207
+ swipemove
157
208
  };
158
209
  }
159
- }), io = {
210
+ });
211
+ const _hoisted_1 = {
160
212
  key: 0,
161
213
  class: "nut-address-list-general"
162
- }, ao = { class: "nut-address-list-swipe" };
163
- function co(o, t, g, r, k, l) {
164
- const p = C("nut-button"), u = C("nut-swipe");
165
- return o.swipeEdition ? (c(), y(u, { key: 1 }, {
166
- right: a(() => [
167
- i(o.$slots, "swipe-right-btn", {}, () => [
168
- $(p, {
169
- shape: "square",
170
- style: { height: "100%" },
171
- type: "danger",
172
- onClick: o.swipeDelClick
173
- }, {
174
- default: a(() => [
175
- L("删除")
176
- ]),
177
- _: 1
178
- }, 8, ["onClick"])
179
- ])
180
- ]),
181
- default: a(() => [
182
- m("div", ao, [
183
- (c(), y(_(o.renderCompontent()), {
184
- onTouchmove: o.swipemove,
185
- onTouchstart: o.swipestart
186
- }, {
187
- "content-top": a(() => [
188
- i(o.$slots, "content-info")
189
- ]),
190
- "content-icon": a(() => [
191
- i(o.$slots, "content-icons")
192
- ]),
193
- "content-addr": a(() => [
194
- i(o.$slots, "content-addrs")
195
- ]),
196
- _: 3
197
- }, 40, ["onTouchmove", "onTouchstart"]))
198
- ])
199
- ]),
200
- _: 3
201
- })) : (c(), f("div", io, [
202
- (c(), y(_(o.renderCompontent()), {
203
- onTouchstart: o.holddownstart,
204
- onTouchend: o.holddownend,
205
- onTouchmove: o.holddownmove
214
+ };
215
+ const _hoisted_2 = { class: "nut-address-list-swipe" };
216
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
217
+ const _component_nut_button = resolveComponent("nut-button");
218
+ const _component_nut_swipe = resolveComponent("nut-swipe");
219
+ return !_ctx.swipeEdition ? (openBlock(), createElementBlock("div", _hoisted_1, [
220
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderCompontent()), {
221
+ onTouchstart: _ctx.holddownstart,
222
+ onTouchend: _ctx.holddownend,
223
+ onTouchmove: _ctx.holddownmove
206
224
  }, {
207
- "content-top": a(() => [
208
- i(o.$slots, "content-info")
225
+ "content-top": withCtx(() => [
226
+ renderSlot(_ctx.$slots, "content-info")
209
227
  ]),
210
- "content-icon": a(() => [
211
- i(o.$slots, "content-icons")
228
+ "content-icon": withCtx(() => [
229
+ renderSlot(_ctx.$slots, "content-icons")
212
230
  ]),
213
- "content-addr": a(() => [
214
- i(o.$slots, "content-addrs")
231
+ "content-addr": withCtx(() => [
232
+ renderSlot(_ctx.$slots, "content-addrs")
215
233
  ]),
216
234
  _: 3
217
235
  }, 40, ["onTouchstart", "onTouchend", "onTouchmove"])),
218
- o.longPress && o.showMaskRef ? (c(), f("div", {
236
+ _ctx.longPress && _ctx.showMaskRef ? (openBlock(), createElementBlock("div", {
219
237
  key: 0,
220
238
  class: "nut-address-list-general__mask",
221
- onClick: t[3] || (t[3] = (...s) => o.maskClick && o.maskClick(...s))
239
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.maskClick && _ctx.maskClick(...args))
222
240
  }, [
223
- i(o.$slots, "longpress-all", {}, () => [
224
- m("div", {
241
+ renderSlot(_ctx.$slots, "longpress-all", {}, () => [
242
+ createElementVNode("div", {
225
243
  class: "nut-address-list-general__mask-copy",
226
- onClick: t[0] || (t[0] = (...s) => o.copyCLick && o.copyCLick(...s))
244
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.copyCLick && _ctx.copyCLick(...args))
227
245
  }, " 复制地址 "),
228
- m("div", {
246
+ createElementVNode("div", {
229
247
  class: "nut-address-list-general__mask-set",
230
- onClick: t[1] || (t[1] = (...s) => o.setDefault && o.setDefault(...s))
248
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.setDefault && _ctx.setDefault(...args))
231
249
  }, " 设置默认 "),
232
- m("div", {
250
+ createElementVNode("div", {
233
251
  class: "nut-address-list-general__mask-del",
234
- onClick: t[2] || (t[2] = (...s) => o.delLongClick && o.delLongClick(...s))
252
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.delLongClick && _ctx.delLongClick(...args))
235
253
  }, " 删除地址 ")
236
254
  ])
237
- ])) : D("", !0),
238
- o.showMaskRef ? (c(), f("div", {
255
+ ])) : createCommentVNode("", true),
256
+ _ctx.showMaskRef ? (openBlock(), createElementBlock("div", {
239
257
  key: 1,
240
258
  class: "nut-address-list__mask-bottom",
241
- onClick: t[4] || (t[4] = (...s) => o.hideMaskClick && o.hideMaskClick(...s))
242
- })) : D("", !0)
243
- ]));
259
+ onClick: _cache[4] || (_cache[4] = (...args) => _ctx.hideMaskClick && _ctx.hideMaskClick(...args))
260
+ })) : createCommentVNode("", true)
261
+ ])) : (openBlock(), createBlock(_component_nut_swipe, { key: 1 }, {
262
+ right: withCtx(() => [
263
+ renderSlot(_ctx.$slots, "swipe-right-btn", {}, () => [
264
+ createVNode(_component_nut_button, {
265
+ shape: "square",
266
+ style: { "height": "100%" },
267
+ type: "danger",
268
+ onClick: _ctx.swipeDelClick
269
+ }, {
270
+ default: withCtx(() => [
271
+ createTextVNode("删除")
272
+ ]),
273
+ _: 1
274
+ }, 8, ["onClick"])
275
+ ])
276
+ ]),
277
+ default: withCtx(() => [
278
+ createElementVNode("div", _hoisted_2, [
279
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderCompontent()), {
280
+ onTouchmove: _ctx.swipemove,
281
+ onTouchstart: _ctx.swipestart
282
+ }, {
283
+ "content-top": withCtx(() => [
284
+ renderSlot(_ctx.$slots, "content-info")
285
+ ]),
286
+ "content-icon": withCtx(() => [
287
+ renderSlot(_ctx.$slots, "content-icons")
288
+ ]),
289
+ "content-addr": withCtx(() => [
290
+ renderSlot(_ctx.$slots, "content-addrs")
291
+ ]),
292
+ _: 3
293
+ }, 40, ["onTouchmove", "onTouchstart"]))
294
+ ])
295
+ ]),
296
+ _: 3
297
+ }));
244
298
  }
245
- const ro = /* @__PURE__ */ S(lo, [["render", co]]), { componentName: po, create: uo, translate: mo } = P("address-list"), ko = uo({
299
+ const GeneralShell = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
300
+ const { componentName, create, translate } = createComponent("address-list");
301
+ const _sfc_main = create({
246
302
  props: {
247
303
  data: {
248
304
  type: Array,
@@ -250,15 +306,15 @@ const ro = /* @__PURE__ */ S(lo, [["render", co]]), { componentName: po, create:
250
306
  },
251
307
  longPress: {
252
308
  type: Boolean,
253
- default: !1
309
+ default: false
254
310
  },
255
311
  swipeEdition: {
256
312
  type: Boolean,
257
- default: !1
313
+ default: false
258
314
  },
259
315
  showBottomButton: {
260
316
  type: Boolean,
261
- default: !0
317
+ default: true
262
318
  },
263
319
  dataOptions: {
264
320
  type: Object,
@@ -266,123 +322,152 @@ const ro = /* @__PURE__ */ S(lo, [["render", co]]), { componentName: po, create:
266
322
  }
267
323
  },
268
324
  components: {
269
- GeneralShell: ro,
270
- [I.name]: I
325
+ GeneralShell,
326
+ [Button.name]: Button
271
327
  },
272
328
  emits: ["delIcon", "editIcon", "clickItem", "longCopy", "longSet", "longDel", "swipeDel", "add"],
273
- setup(o, { emit: t }) {
274
- const g = E([]), r = O({
329
+ setup(props, { emit }) {
330
+ const dataArray = ref([]);
331
+ const dataInfo = reactive({
275
332
  id: 2,
276
333
  addressName: "姓名",
277
334
  phone: "123****4567",
278
- defaultAddress: !1,
335
+ defaultAddress: false,
279
336
  fullAddress: "北京市通州区测试测试测试测试测试测试测试测试测试"
280
- }), k = j(() => ({
281
- [po]: !0
282
- })), l = () => {
283
- Object.keys(o.dataOptions).length > 0 && (g.value = o.data.map((n) => H(r, n, o.dataOptions)));
337
+ });
338
+ const classes = computed(() => {
339
+ const prefixCls = componentName;
340
+ return {
341
+ [prefixCls]: true
342
+ };
343
+ });
344
+ const trowelData = () => {
345
+ if (Object.keys(props.dataOptions).length > 0) {
346
+ dataArray.value = props.data.map((item) => {
347
+ return floatData(dataInfo, item, props.dataOptions);
348
+ });
349
+ }
284
350
  };
285
- R(
286
- () => o.data,
287
- () => l(),
288
- { deep: !0 }
351
+ watch(
352
+ () => props.data,
353
+ () => trowelData(),
354
+ { deep: true }
289
355
  );
290
- const p = (n, d) => {
291
- t("delIcon", n, d), n.stopPropagation();
292
- }, u = (n, d) => {
293
- t("editIcon", n, d), n.stopPropagation();
294
- }, s = (n, d) => {
295
- t("clickItem", n, d), n.stopPropagation();
296
- }, w = (n, d) => {
297
- t("longCopy", n, d), n.stopPropagation();
298
- }, v = (n, d) => {
299
- t("longSet", n, d), n.stopPropagation();
300
- }, B = (n, d) => {
301
- t("longDel", n, d), n.stopPropagation();
302
- }, b = (n, d) => {
303
- t("swipeDel", n, d), n.stopPropagation();
304
- }, T = (n) => {
305
- t("add", n), n.stopPropagation();
356
+ const clickDelIcon = (event, item) => {
357
+ emit("delIcon", event, item);
358
+ event.stopPropagation();
359
+ };
360
+ const clickEditIcon = (event, item) => {
361
+ emit("editIcon", event, item);
362
+ event.stopPropagation();
363
+ };
364
+ const clickContentItem = (event, item) => {
365
+ emit("clickItem", event, item);
366
+ event.stopPropagation();
306
367
  };
307
- return V(() => {
308
- l();
309
- }), {
310
- classes: k,
311
- clickDelIcon: p,
312
- clickEditIcon: u,
313
- clickContentItem: s,
314
- clickLongCopy: w,
315
- clickLongSet: v,
316
- clickLongDel: B,
317
- clickSwipeDel: b,
318
- addAddress: T,
319
- dataArray: g,
320
- translate: mo
368
+ const clickLongCopy = (event, item) => {
369
+ emit("longCopy", event, item);
370
+ event.stopPropagation();
371
+ };
372
+ const clickLongSet = (event, item) => {
373
+ emit("longSet", event, item);
374
+ event.stopPropagation();
375
+ };
376
+ const clickLongDel = (event, item) => {
377
+ emit("longDel", event, item);
378
+ event.stopPropagation();
379
+ };
380
+ const clickSwipeDel = (event, item) => {
381
+ emit("swipeDel", event, item);
382
+ event.stopPropagation();
383
+ };
384
+ const addAddress = (event) => {
385
+ emit("add", event);
386
+ event.stopPropagation();
387
+ };
388
+ onMounted(() => {
389
+ trowelData();
390
+ });
391
+ return {
392
+ classes,
393
+ clickDelIcon,
394
+ clickEditIcon,
395
+ clickContentItem,
396
+ clickLongCopy,
397
+ clickLongSet,
398
+ clickLongDel,
399
+ clickSwipeDel,
400
+ addAddress,
401
+ dataArray,
402
+ translate
321
403
  };
322
404
  }
323
405
  });
324
- function go(o, t, g, r, k, l) {
325
- const p = C("general-shell"), u = C("nut-button");
326
- return c(), f("div", {
327
- class: F(o.classes)
406
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
407
+ const _component_general_shell = resolveComponent("general-shell");
408
+ const _component_nut_button = resolveComponent("nut-button");
409
+ return openBlock(), createElementBlock("div", {
410
+ class: normalizeClass(_ctx.classes)
328
411
  }, [
329
- (c(!0), f(q, null, z(o.dataArray, (s, w) => (c(), y(p, {
330
- key: w,
331
- item: s,
332
- longPress: o.longPress,
333
- swipeEdition: o.swipeEdition,
334
- onDelIcon: o.clickDelIcon,
335
- onEditIcon: o.clickEditIcon,
336
- onClickItem: o.clickContentItem,
337
- onSwipeDel: o.clickSwipeDel,
338
- onLongCopy: o.clickLongCopy,
339
- onLongSet: o.clickLongSet,
340
- onLongDel: o.clickLongDel
341
- }, G({
342
- "content-info": a(() => [
343
- i(o.$slots, "item-infos", { item: s })
344
- ]),
345
- "content-icons": a(() => [
346
- i(o.$slots, "item-icon", { item: s })
347
- ]),
348
- "content-addrs": a(() => [
349
- i(o.$slots, "item-addr", { item: s })
350
- ]),
351
- _: 2
352
- }, [
353
- o.longPress ? {
354
- name: "longpress-all",
355
- fn: a(() => [
356
- i(o.$slots, "longpress-btns", { item: s })
412
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataArray, (item, index2) => {
413
+ return openBlock(), createBlock(_component_general_shell, {
414
+ key: index2,
415
+ item,
416
+ longPress: _ctx.longPress,
417
+ swipeEdition: _ctx.swipeEdition,
418
+ onDelIcon: _ctx.clickDelIcon,
419
+ onEditIcon: _ctx.clickEditIcon,
420
+ onClickItem: _ctx.clickContentItem,
421
+ onSwipeDel: _ctx.clickSwipeDel,
422
+ onLongCopy: _ctx.clickLongCopy,
423
+ onLongSet: _ctx.clickLongSet,
424
+ onLongDel: _ctx.clickLongDel
425
+ }, createSlots({
426
+ "content-info": withCtx(() => [
427
+ renderSlot(_ctx.$slots, "item-infos", { item })
428
+ ]),
429
+ "content-icons": withCtx(() => [
430
+ renderSlot(_ctx.$slots, "item-icon", { item })
357
431
  ]),
358
- key: "0"
359
- } : void 0,
360
- o.swipeEdition ? {
361
- name: "swipe-right-btn",
362
- fn: a(() => [
363
- i(o.$slots, "swipe-right", { item: s })
432
+ "content-addrs": withCtx(() => [
433
+ renderSlot(_ctx.$slots, "item-addr", { item })
364
434
  ]),
365
- key: "1"
366
- } : void 0
367
- ]), 1032, ["item", "longPress", "swipeEdition", "onDelIcon", "onEditIcon", "onClickItem", "onSwipeDel", "onLongCopy", "onLongSet", "onLongDel"]))), 128)),
368
- o.showBottomButton ? (c(), f("div", {
435
+ _: 2
436
+ }, [
437
+ _ctx.longPress ? {
438
+ name: "longpress-all",
439
+ fn: withCtx(() => [
440
+ renderSlot(_ctx.$slots, "longpress-btns", { item })
441
+ ]),
442
+ key: "0"
443
+ } : void 0,
444
+ _ctx.swipeEdition ? {
445
+ name: "swipe-right-btn",
446
+ fn: withCtx(() => [
447
+ renderSlot(_ctx.$slots, "swipe-right", { item })
448
+ ]),
449
+ key: "1"
450
+ } : void 0
451
+ ]), 1032, ["item", "longPress", "swipeEdition", "onDelIcon", "onEditIcon", "onClickItem", "onSwipeDel", "onLongCopy", "onLongSet", "onLongDel"]);
452
+ }), 128)),
453
+ _ctx.showBottomButton ? (openBlock(), createElementBlock("div", {
369
454
  key: 0,
370
455
  class: "nut-address-list__bottom",
371
- onClick: t[0] || (t[0] = (...s) => o.addAddress && o.addAddress(...s))
456
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.addAddress && _ctx.addAddress(...args))
372
457
  }, [
373
- $(u, {
458
+ createVNode(_component_nut_button, {
374
459
  block: "",
375
460
  type: "danger"
376
461
  }, {
377
- default: a(() => [
378
- L(h(o.translate("addAddress")), 1)
462
+ default: withCtx(() => [
463
+ createTextVNode(toDisplayString(_ctx.translate("addAddress")), 1)
379
464
  ]),
380
465
  _: 1
381
466
  })
382
- ])) : D("", !0)
467
+ ])) : createCommentVNode("", true)
383
468
  ], 2);
384
469
  }
385
- const Bo = /* @__PURE__ */ S(ko, [["render", go]]);
470
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
386
471
  export {
387
- Bo as default
472
+ index as default
388
473
  };