@nutui/nutui 3.1.22-beta.3 → 3.1.23-beta.0

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 (207) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +3 -4
  3. package/dist/nutui.es.js +20426 -4050
  4. package/dist/nutui.umd.js +20529 -4049
  5. package/dist/packages/_es/ActionSheet.js +149 -36
  6. package/dist/packages/_es/Address.js +535 -129
  7. package/dist/packages/_es/AddressList.js +615 -113
  8. package/dist/packages/_es/Animate.js +64 -0
  9. package/dist/packages/_es/Audio.js +257 -72
  10. package/dist/packages/_es/AudioOperate.js +100 -32
  11. package/dist/packages/_es/Avatar.js +162 -54
  12. package/dist/packages/_es/AvatarGroup.js +73 -14
  13. package/dist/packages/_es/BackTop.js +156 -43
  14. package/dist/packages/_es/Badge.js +86 -14
  15. package/dist/packages/_es/Barrage.js +120 -41
  16. package/dist/packages/_es/Button.js +128 -23
  17. package/dist/packages/_es/Calendar.js +246 -24
  18. package/dist/packages/_es/CalendarItem.js +2 -1
  19. package/dist/packages/_es/Card.js +107 -10
  20. package/dist/packages/_es/Cascader.js +496 -179
  21. package/dist/packages/_es/Category.js +58 -15
  22. package/dist/packages/_es/CategoryPane.js +111 -11
  23. package/dist/packages/_es/Cell.js +108 -21
  24. package/dist/packages/_es/CellGroup.js +44 -9
  25. package/dist/packages/_es/Checkbox.js +134 -29
  26. package/dist/packages/_es/CheckboxGroup.js +79 -29
  27. package/dist/packages/_es/CircleProgress.js +150 -28
  28. package/dist/packages/_es/Col.js +56 -14
  29. package/dist/packages/_es/Collapse.js +110 -24
  30. package/dist/packages/_es/CollapseItem.js +252 -80
  31. package/dist/packages/_es/Comment.js +434 -64
  32. package/dist/packages/_es/ConfigProvider.js +25 -0
  33. package/dist/packages/_es/CountDown.js +238 -75
  34. package/dist/packages/_es/CountUp.js +539 -159
  35. package/dist/packages/_es/DatePicker.js +315 -117
  36. package/dist/packages/_es/Dialog.js +289 -79
  37. package/dist/packages/_es/Divider.js +65 -32
  38. package/dist/packages/_es/Drag.js +197 -56
  39. package/dist/packages/_es/Ecard.js +159 -24
  40. package/dist/packages/_es/Elevator.js +255 -77
  41. package/dist/packages/_es/Ellipsis.js +206 -0
  42. package/dist/packages/_es/Empty.js +71 -12
  43. package/dist/packages/_es/FixedNav.js +122 -15
  44. package/dist/packages/_es/Form.js +151 -64
  45. package/dist/packages/_es/FormItem.js +114 -15
  46. package/dist/packages/_es/Grid.js +6 -5
  47. package/dist/packages/_es/GridItem.js +144 -33
  48. package/dist/packages/_es/Icon.js +40 -15
  49. package/dist/packages/_es/Image.js +142 -0
  50. package/dist/packages/_es/ImagePreview.js +547 -84
  51. package/dist/packages/_es/Indicator.js +62 -15
  52. package/dist/packages/_es/InfiniteLoading.js +249 -76
  53. package/dist/packages/_es/Input.js +433 -51
  54. package/dist/packages/_es/InputNumber.js +160 -41
  55. package/dist/packages/_es/Layout.js +5 -4
  56. package/dist/packages/_es/List.js +106 -37
  57. package/dist/packages/_es/Menu.js +168 -29
  58. package/dist/packages/_es/MenuItem.js +173 -34
  59. package/dist/packages/_es/Navbar.js +192 -30
  60. package/dist/packages/_es/NoticeBar.js +380 -93
  61. package/dist/packages/_es/Notify.js +227 -91
  62. package/dist/packages/_es/NumberKeyboard.js +272 -41
  63. package/dist/packages/_es/OldPicker.js +457 -149
  64. package/dist/packages/_es/OverLay.js +98 -40
  65. package/dist/packages/_es/Pagination.js +157 -39
  66. package/dist/packages/_es/Picker.js +460 -148
  67. package/dist/packages/_es/Popover.js +957 -337
  68. package/dist/packages/_es/Popup.js +299 -74
  69. package/dist/packages/_es/Price.js +118 -16
  70. package/dist/packages/_es/Progress.js +146 -14
  71. package/dist/packages/_es/PullRefresh.js +339 -100
  72. package/dist/packages/_es/Radio.js +90 -22
  73. package/dist/packages/_es/RadioGroup.js +37 -8
  74. package/dist/packages/_es/Range.js +408 -102
  75. package/dist/packages/_es/Rate.js +193 -16
  76. package/dist/packages/_es/Row.js +64 -22
  77. package/dist/packages/_es/SearchBar.js +238 -56
  78. package/dist/packages/_es/ShortPassword.js +225 -35
  79. package/dist/packages/_es/SideNavBar.js +81 -43
  80. package/dist/packages/_es/SideNavBarItem.js +46 -11
  81. package/dist/packages/_es/Signature.js +160 -60
  82. package/dist/packages/_es/Skeleton.js +136 -20
  83. package/dist/packages/_es/Sku.js +491 -103
  84. package/dist/packages/_es/Step.js +115 -39
  85. package/dist/packages/_es/Steps.js +53 -18
  86. package/dist/packages/_es/Sticky.js +138 -53
  87. package/dist/packages/_es/SubSideNavBar.js +82 -36
  88. package/dist/packages/_es/Swipe.js +178 -60
  89. package/dist/packages/_es/Swiper.js +433 -121
  90. package/dist/packages/_es/SwiperItem.js +53 -22
  91. package/dist/packages/_es/Switch.js +116 -21
  92. package/dist/packages/_es/TabPane.js +39 -12
  93. package/dist/packages/_es/Tabbar.js +72 -17
  94. package/dist/packages/_es/TabbarItem.js +151 -29
  95. package/dist/packages/_es/Table.js +178 -37
  96. package/dist/packages/_es/Tabs.js +202 -59
  97. package/dist/packages/_es/Tag.js +97 -20
  98. package/dist/packages/_es/TextArea.js +160 -42
  99. package/dist/packages/_es/TimeDetail.js +79 -37
  100. package/dist/packages/_es/TimePannel.js +48 -33
  101. package/dist/packages/_es/TimeSelect.js +112 -15
  102. package/dist/packages/_es/Toast.js +310 -90
  103. package/dist/packages/_es/Uploader.js +455 -120
  104. package/dist/packages/_es/Video.js +332 -93
  105. package/dist/packages/_es/common.js +128 -38
  106. package/dist/packages/_es/component.js +76 -35
  107. package/dist/packages/_es/index.js +6 -5
  108. package/dist/packages/_es/index2.js +30 -9
  109. package/dist/packages/_es/index3.js +8 -6
  110. package/dist/packages/_es/index4.js +64 -13
  111. package/dist/packages/_es/index5.js +783 -130
  112. package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
  113. package/dist/packages/_es/pxCheck.js +5 -3
  114. package/dist/packages/_es/raf.js +15 -8
  115. package/dist/packages/animate/index.scss +299 -0
  116. package/dist/packages/cell/index.scss +7 -1
  117. package/dist/packages/checkbox/index.scss +10 -0
  118. package/dist/packages/configprovider/index.scss +2 -0
  119. package/dist/packages/ellipsis/index.scss +12 -0
  120. package/dist/packages/formitem/index.scss +12 -0
  121. package/dist/packages/griditem/index.scss +11 -0
  122. package/dist/packages/image/index.scss +39 -0
  123. package/dist/packages/imagepreview/index.scss +26 -2
  124. package/dist/packages/input/index.scss +13 -0
  125. package/dist/packages/inputnumber/index.scss +21 -0
  126. package/dist/packages/locale/lang/baseLang.js +3 -3
  127. package/dist/packages/locale/lang/en-US.js +105 -5
  128. package/dist/packages/locale/lang/id-ID.js +105 -5
  129. package/dist/packages/locale/lang/index.js +38 -16
  130. package/dist/packages/locale/lang/zh-CN.js +105 -5
  131. package/dist/packages/locale/lang/zh-TW.js +105 -5
  132. package/dist/packages/menu/index.scss +45 -36
  133. package/dist/packages/menuitem/index.scss +4 -0
  134. package/dist/packages/navbar/index.scss +9 -0
  135. package/dist/packages/pagination/index.scss +19 -0
  136. package/dist/packages/radio/index.scss +18 -0
  137. package/dist/packages/range/index.scss +19 -0
  138. package/dist/packages/rate/index.scss +1 -1
  139. package/dist/packages/searchbar/index.scss +21 -0
  140. package/dist/packages/switch/index.scss +1 -0
  141. package/dist/packages/tabbar/index.scss +5 -0
  142. package/dist/packages/tabbaritem/index.scss +7 -0
  143. package/dist/packages/tabpane/index.scss +5 -0
  144. package/dist/packages/tabs/index.scss +22 -0
  145. package/dist/packages/textarea/index.scss +8 -0
  146. package/dist/smartips/attributes.json +140 -4
  147. package/dist/smartips/tags.json +55 -6
  148. package/dist/smartips/web-types.json +6963 -0
  149. package/dist/style.css +1 -1
  150. package/dist/style.es.js +1 -1
  151. package/dist/styles/font/config.json +3 -1
  152. package/dist/styles/font/demo_index.html +49 -3
  153. package/dist/styles/font/iconfont.css +11 -3
  154. package/dist/styles/font/iconfont.js +15 -15
  155. package/dist/styles/font/iconfont.json +14 -0
  156. package/dist/styles/font/iconfont.ttf +0 -0
  157. package/dist/styles/font/iconfont.woff +0 -0
  158. package/dist/styles/font/iconfont.woff2 +0 -0
  159. package/dist/styles/themes/default.scss +54 -50
  160. package/dist/styles/themes/jdb.scss +54 -50
  161. package/dist/styles/themes/jdt.scss +54 -50
  162. package/dist/styles/variables-jdb.scss +12 -0
  163. package/dist/styles/variables-jdt.scss +12 -0
  164. package/dist/styles/variables.scss +12 -0
  165. package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
  166. package/dist/types/__VUE/address/index.vue.d.ts +7 -7
  167. package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
  168. package/dist/types/__VUE/animate/type.d.ts +6 -0
  169. package/dist/types/__VUE/avatar/index.vue.d.ts +3 -3
  170. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  171. package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
  172. package/dist/types/__VUE/cascader/index.vue.d.ts +2 -2
  173. package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
  174. package/dist/types/__VUE/collapse/index.vue.d.ts +3 -1
  175. package/dist/types/__VUE/configprovider/common.d.ts +20 -0
  176. package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
  177. package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
  178. package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
  179. package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
  180. package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
  181. package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
  182. package/dist/types/__VUE/image/index.vue.d.ts +105 -0
  183. package/dist/types/__VUE/image/type.d.ts +6 -0
  184. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
  185. package/dist/types/__VUE/imagepreview/index.vue.d.ts +56 -24
  186. package/dist/types/__VUE/menu/index.vue.d.ts +31 -4
  187. package/dist/types/__VUE/menuitem/index.vue.d.ts +12 -3
  188. package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
  189. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
  190. package/dist/types/__VUE/oldpicker/index.vue.d.ts +4 -4
  191. package/dist/types/__VUE/picker/index.vue.d.ts +4 -4
  192. package/dist/types/__VUE/popover/index.vue.d.ts +8 -8
  193. package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
  194. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  195. package/dist/types/__VUE/rate/common.d.ts +149 -0
  196. package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
  197. package/dist/types/__VUE/row/index.vue.d.ts +2 -2
  198. package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
  199. package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
  200. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  201. package/dist/types/__VUE/swiper/index.vue.d.ts +2 -2
  202. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  203. package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -2
  204. package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
  205. package/dist/types/index.d.ts +1 -1
  206. package/dist/types/nutui.d.ts +5 -1
  207. package/package.json +5 -4
@@ -1,118 +1,620 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.0 Mon Jun 27 2022 17:55:50 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { resolveComponent as e, openBlock as t, createElementBlock as n, createElementVNode as o, renderSlot as l, toDisplayString as i, createCommentVNode as s, createVNode as c, createTextVNode as a, ref as d, withCtx as r, createBlock as p, reactive as m, watch as k, onMounted as C, Fragment as h, renderList as u } from "vue";
7
- import { c as I, f as g } from "./component.js";
8
- import { _ as D } from "./plugin-vue_export-helper.js";
6
+ import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, toDisplayString, createCommentVNode, createVNode, createTextVNode, ref, withCtx, createBlock, reactive, watch, onMounted, Fragment, renderList } from "vue";
7
+ import { c as createComponent, f as floatData } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const { componentName: f, create: w } = I("item-contents"), { translate: v } = I("addresslist"), _ = w({ props: { name: { type: String, default: "" }, item: { type: Object, default: {} } }, components: {}, emits: ["delIconClick", "editIconClick", "itemClick"], setup: (e2, { emit: t2 }) => ({ delClick: (n2) => {
11
- t2("delIconClick", n2, e2.item), n2.stopPropagation();
12
- }, editClick: (n2) => {
13
- t2("editIconClick", n2, e2.item), n2.stopPropagation();
14
- }, contentsClick: (n2) => {
15
- t2("itemClick", n2, e2.item), n2.stopPropagation();
16
- }, translate: v }) }), S = { class: "nut-item-contents__info" }, y = { class: "nut-item-contents__info-contact" }, P = { class: "nut-item-contents__info-contact-name" }, E = { class: "nut-item-contents__info-contact-tel" }, H = { key: 0, class: "nut-item-contents__info-contact-default" }, A = { class: "nut-item-contents__info-handle" }, $ = { class: "nut-item-contents__addr" };
17
- var b = D(_, [["render", function(d2, r2, p2, m2, k2, C2) {
18
- const h2 = e("nut-icon");
19
- return t(), n("div", { class: "nut-item-contents__contain", onClick: r2[0] || (r2[0] = (...e2) => d2.contentsClick && d2.contentsClick(...e2)) }, [o("div", S, [o("div", y, [l(d2.$slots, "contentTop", {}, () => [o("div", P, i(d2.item.addressName), 1), o("div", E, i(d2.item.phone), 1), d2.item.defaultAddress ? (t(), n("div", H, i(d2.translate("default")), 1)) : s("", true)])]), o("div", A, [l(d2.$slots, "contentIcon", {}, () => [c(h2, { name: "del", class: "nut-item-contents__info-handle-del", onClick: d2.delClick }, null, 8, ["onClick"]), c(h2, { name: "edit", class: "nut-item-contents__info-handle-edit", onClick: d2.editClick }, null, 8, ["onClick"])])])]), o("div", $, [l(d2.$slots, "contentAddr", {}, () => [a(i(d2.item.fullAddress), 1)])])]);
20
- }]]);
21
- const { componentName: T, create: L } = I("long-press-shell"), M = L({ props: { item: { type: Object, default: {} } }, emits: ["holdingDown", "handleDel", "handelMask", "handleCopy", "handleSet", "handleDelIcon", "handleEditIcon", "handleItemContent"], components: { ItemContents: b }, setup(e2, { emit: t2, slots: n2 }) {
22
- let o2 = null;
23
- const l2 = d(false);
24
- return { holddownstart: (n3) => {
25
- o2 = setTimeout(() => {
26
- ((n4) => {
27
- o2 = 0, l2.value = true, t2("holdingDown", n4, e2.item);
28
- })(n3);
29
- }, 300);
30
- }, holddownmove: (e3) => {
31
- clearTimeout(o2);
32
- }, holddownend: (e3) => {
33
- clearTimeout(o2);
34
- }, showMaskRef: l2, delClick: (n3) => {
35
- o2 != 0 && (t2("handleDel", n3, e2.item), n3.stopPropagation());
36
- }, copyCLick: (n3) => {
37
- o2 != 0 && (t2("handleCopy", n3, e2.item), n3.stopPropagation());
38
- }, hideMaskClick: (e3) => {
39
- l2.value = false;
40
- }, setDefault: (n3) => {
41
- o2 != 0 && (t2("handleSet", n3, e2.item), n3.stopPropagation());
42
- }, maskClick: (e3) => {
43
- o2 != 0 && (l2.value = false), e3.stopPropagation(), e3.preventDefault();
44
- }, delShellClick: (n3, o3) => {
45
- t2("handleDelIcon", n3, e2.item), n3.stopPropagation();
46
- }, editShellClick: (n3, o3) => {
47
- t2("handleEditIcon", n3, e2.item), n3.stopPropagation();
48
- }, itemShellClick: (n3, o3) => {
49
- t2("handleItemContent", n3, e2.item), n3.stopPropagation();
50
- } };
51
- } }), O = { class: "nut-long-press-shell" }, j = [o("div", { class: "mask-contain" }, [a(" \u590D\u5236"), o("br"), a("\u5730\u5740 ")], -1)], B = [o("div", { class: "mask-contain" }, [a(" \u8BBE\u7F6E"), o("br"), a("\u9ED8\u8BA4 ")], -1)], N = [o("div", { class: "mask-contain" }, [a(" \u5220\u9664"), o("br"), a("\u5730\u5740 ")], -1)];
52
- var R = D(M, [["render", function(i2, a2, d2, p2, m2, k2) {
53
- const C2 = e("item-contents");
54
- return t(), n("div", O, [o("div", { class: "nut-long-press-shell__contain", onTouchstart: a2[4] || (a2[4] = (...e2) => i2.holddownstart && i2.holddownstart(...e2)), onTouchend: a2[5] || (a2[5] = (...e2) => i2.holddownend && i2.holddownend(...e2)), onTouchmove: a2[6] || (a2[6] = (...e2) => i2.holddownmove && i2.holddownmove(...e2)) }, [c(C2, { item: i2.item, onDelIconClick: i2.delShellClick, onEditIconClick: i2.editShellClick, onItemClick: i2.itemShellClick }, { contentTop: r(() => [l(i2.$slots, "contentInfo")]), contentIcon: r(() => [l(i2.$slots, "contentIcons")]), contentAddr: r(() => [l(i2.$slots, "contentAddrs")]), _: 3 }, 8, ["item", "onDelIconClick", "onEditIconClick", "onItemClick"]), i2.showMaskRef ? (t(), n("div", { key: 0, class: "nut-long-press-shell__contain-mask", onClick: a2[3] || (a2[3] = (...e2) => i2.maskClick && i2.maskClick(...e2)) }, [l(i2.$slots, "longpressAll", {}, () => [o("div", { class: "nut-long-press-shell__contain-mask-copy", onClick: a2[0] || (a2[0] = (...e2) => i2.copyCLick && i2.copyCLick(...e2)) }, j), o("div", { class: "nut-long-press-shell__contain-mask-set", onClick: a2[1] || (a2[1] = (...e2) => i2.setDefault && i2.setDefault(...e2)) }, B), o("div", { class: "nut-long-press-shell__contain-mask-del", onClick: a2[2] || (a2[2] = (...e2) => i2.delClick && i2.delClick(...e2)) }, N)])])) : s("", true)], 32), i2.showMaskRef ? (t(), n("div", { key: 0, class: "nut-addresslist__mask-bottom", onClick: a2[7] || (a2[7] = (...e2) => i2.hideMaskClick && i2.hideMaskClick(...e2)) })) : s("", true)]);
55
- }]]);
56
- const { componentName: x, create: q } = I("swipe-shell"), G = q({ props: { item: { type: Object, default: {} } }, emits: ["handleDelIcon", "handleEditIcon", "handleItemContent", "handelSwipeDel"], components: { ItemContents: b }, setup(e2, { emit: t2, slots: n2 }) {
57
- const o2 = d(false);
58
- return { delShellClick: (n3, o3) => {
59
- t2("handleDelIcon", n3, e2.item), n3.stopPropagation();
60
- }, editShellClick: (n3, o3) => {
61
- t2("handleEditIcon", n3, e2.item), n3.stopPropagation();
62
- }, itemShellClick: (n3, l2) => {
63
- o2.value || (t2("handleItemContent", n3, e2.item), n3.stopPropagation());
64
- }, swipeDelClick: (n3, o3) => {
65
- t2("handelSwipeDel", n3, e2.item), n3.stopPropagation();
66
- }, swipestart: () => {
67
- o2.value = false;
68
- }, swipemove: () => {
69
- o2.value = true;
70
- } };
71
- } }), z = { class: "nut-swipe-shell" }, F = a("\u5220\u9664");
72
- var J = D(G, [["render", function(n2, i2, s2, a2, d2, m2) {
73
- const k2 = e("item-contents"), C2 = e("nut-button"), h2 = e("nut-swipe");
74
- return t(), p(h2, null, { right: r(() => [l(n2.$slots, "swiperightbtn", {}, () => [c(C2, { shape: "square", style: { height: "100%" }, type: "danger", onClick: n2.swipeDelClick }, { default: r(() => [F]), _: 1 }, 8, ["onClick"])])]), default: r(() => [o("div", z, [c(k2, { item: n2.item, onDelIconClick: n2.delShellClick, onEditIconClick: n2.editShellClick, onItemClick: n2.itemShellClick, onTouchmove: n2.swipemove, onTouchstart: n2.swipestart }, { contentTop: r(() => [l(n2.$slots, "contentInfo")]), contentIcon: r(() => [l(n2.$slots, "contentIcons")]), contentAddr: r(() => [l(n2.$slots, "contentAddrs")]), _: 3 }, 8, ["item", "onDelIconClick", "onEditIconClick", "onItemClick", "onTouchmove", "onTouchstart"])])]), _: 3 });
75
- }]]);
76
- const { componentName: K, create: Q } = I("general-shell"), U = Q({ props: { item: { type: Object, default: {} } }, emits: ["handleDelIcon", "handleEditIcon", "handleItemContent", "handelSwipeDel"], components: { ItemContents: b }, setup: (e2, { emit: t2, slots: n2 }) => ({ delShellClick: (n3, o2) => {
77
- t2("handleDelIcon", n3, e2.item), n3.stopPropagation();
78
- }, editShellClick: (n3, o2) => {
79
- t2("handleEditIcon", n3, e2.item), n3.stopPropagation();
80
- }, itemShellClick: (n3, o2) => {
81
- t2("handleItemContent", n3, e2.item), n3.stopPropagation();
82
- }, swipeDelClick: (n3, o2) => {
83
- t2("handelSwipeDel", n3, e2.item), n3.stopPropagation();
84
- } }) }), V = { class: "nut-general-shell" };
85
- var W = D(U, [["render", function(o2, i2, s2, a2, d2, p2) {
86
- const m2 = e("item-contents");
87
- return t(), n("div", V, [c(m2, { item: o2.item, onDelIconClick: o2.delShellClick, onEditIconClick: o2.editShellClick, onItemClick: o2.itemShellClick }, { contentTop: r(() => [l(o2.$slots, "contentInfo")]), contentIcon: r(() => [l(o2.$slots, "contentIcons")]), contentAddr: r(() => [l(o2.$slots, "contentAddrs")]), _: 3 }, 8, ["item", "onDelIconClick", "onEditIconClick", "onItemClick"])]);
88
- }]]);
89
- const { componentName: X, create: Y, translate: Z } = I("addresslist"), ee = Y({ props: { data: { type: Array, default: [] }, longPressEdition: { type: Boolean, default: false }, swipeEdition: { type: Boolean, default: false }, showBottomButton: { type: Boolean, default: true }, dataMapOptions: { type: Object, default: {} } }, components: { LongPressShell: R, SwipeShell: J, GeneralShell: W }, emits: ["handelDelIcon", "handelEditIcon", "handelItem", "longPressCopyClick", "longPressSetClick", "longPressDelClick", "swipeDelClick", "addAddressClick"], setup(e2, { emit: t2 }) {
90
- const n2 = d([]), o2 = m({ id: 2, addressName: "\u59D3\u540D", phone: "123****4567", defaultAddress: false, fullAddress: "\u5317\u4EAC\u5E02\u901A\u5DDE\u533A\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5" }), l2 = () => {
91
- Object.keys(e2.dataMapOptions).length > 0 && e2.data.length > 0 && (n2.value = e2.data.map((t3, n3) => g(o2, t3, e2.dataMapOptions)));
92
- };
93
- k(() => e2.data, () => l2(), { deep: true });
94
- return C(() => {
95
- l2();
96
- }), { clickDelIcon: (e3, n3) => {
97
- t2("handelDelIcon", e3, n3), e3.stopPropagation();
98
- }, clickEditIcon: (e3, n3) => {
99
- t2("handelEditIcon", e3, n3), e3.stopPropagation();
100
- }, clickContentItem: (e3, n3) => {
101
- t2("handelItem", e3, n3), e3.stopPropagation();
102
- }, clickLongCopy: (e3, n3) => {
103
- t2("longPressCopyClick", e3, n3), e3.stopPropagation();
104
- }, clickLongSet: (e3, n3) => {
105
- t2("longPressSetClick", e3, n3), e3.stopPropagation();
106
- }, clickLongDel: (e3, n3) => {
107
- t2("longPressDelClick", e3, n3), e3.stopPropagation();
108
- }, clickSwipeDel: (e3, n3) => {
109
- t2("swipeDelClick", e3, n3), e3.stopPropagation();
110
- }, addAddress: (e3) => {
111
- t2("addAddressClick", e3), e3.stopPropagation();
112
- }, dataArray: n2, translate: Z };
113
- } }), te = { class: "nut-addresslist" };
114
- var ne = D(ee, [["render", function(o2, d2, m2, k2, C2, I2) {
115
- const g2 = e("general-shell"), D2 = e("long-press-shell"), f2 = e("swipe-shell"), w2 = e("nut-button");
116
- return t(), n("div", te, [o2.longPressEdition || o2.swipeEdition ? s("", true) : (t(true), n(h, { key: 0 }, u(o2.dataArray, (e2, n2) => (t(), p(g2, { key: "general" + n2, item: e2, onHandleDelIcon: o2.clickDelIcon, onHandleEditIcon: o2.clickEditIcon, onHandleItemContent: o2.clickContentItem, onHandelSwipeDel: o2.clickSwipeDel }, null, 8, ["item", "onHandleDelIcon", "onHandleEditIcon", "onHandleItemContent", "onHandelSwipeDel"]))), 128)), o2.longPressEdition && !o2.swipeEdition ? (t(true), n(h, { key: 1 }, u(o2.dataArray, (e2, n2) => (t(), p(D2, { key: "longpress" + n2, item: e2, onHandleDelIcon: o2.clickDelIcon, onHandleEditIcon: o2.clickEditIcon, onHandleItemContent: o2.clickContentItem, onHandleCopy: o2.clickLongCopy, onHandleSet: o2.clickLongSet, onHandleDel: o2.clickLongDel }, { contentInfo: r(() => [l(o2.$slots, "iteminfos")]), contentIcons: r(() => [l(o2.$slots, "itemicon")]), contentAddrs: r(() => [l(o2.$slots, "itemaddr")]), longpressAll: r(() => [l(o2.$slots, "longpressbtns")]), _: 2 }, 1032, ["item", "onHandleDelIcon", "onHandleEditIcon", "onHandleItemContent", "onHandleCopy", "onHandleSet", "onHandleDel"]))), 128)) : s("", true), !o2.longPressEdition && o2.swipeEdition ? (t(true), n(h, { key: 2 }, u(o2.dataArray, (e2, n2) => (t(), p(f2, { key: "swipe" + n2, item: e2, onHandleDelIcon: o2.clickDelIcon, onHandleEditIcon: o2.clickEditIcon, onHandleItemContent: o2.clickContentItem, onHandelSwipeDel: o2.clickSwipeDel }, { contentInfo: r(() => [l(o2.$slots, "iteminfos")]), contentIcons: r(() => [l(o2.$slots, "itemicon")]), contentAddrs: r(() => [l(o2.$slots, "itemaddr")]), swiperightbtn: r(() => [l(o2.$slots, "swiperight")]), _: 2 }, 1032, ["item", "onHandleDelIcon", "onHandleEditIcon", "onHandleItemContent", "onHandelSwipeDel"]))), 128)) : s("", true), o2.showBottomButton ? (t(), n("div", { key: 3, class: "nut-addresslist__bottom", onClick: d2[0] || (d2[0] = (...e2) => o2.addAddress && o2.addAddress(...e2)) }, [c(w2, { block: "", type: "danger" }, { default: r(() => [a(i(o2.translate("addAddress")), 1)]), _: 1 })])) : s("", true)]);
117
- }]]);
118
- export { ne as default };
10
+ var ItemContents_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => "/* @import './index.scss'; */")();
11
+ const { componentName: componentName$4, create: create$4 } = createComponent("item-contents");
12
+ const { translate: translate$1 } = createComponent("addresslist");
13
+ const _sfc_main$4 = create$4({
14
+ props: {
15
+ name: {
16
+ type: String,
17
+ default: ""
18
+ },
19
+ item: {
20
+ type: Object,
21
+ default: {}
22
+ }
23
+ },
24
+ components: {},
25
+ emits: ["delIconClick", "editIconClick", "itemClick"],
26
+ setup(props, { emit }) {
27
+ const delClick = (event) => {
28
+ emit("delIconClick", event, props.item);
29
+ console.log(123);
30
+ event.stopPropagation();
31
+ };
32
+ const editClick = (event) => {
33
+ emit("editIconClick", event, props.item);
34
+ event.stopPropagation();
35
+ };
36
+ const contentsClick = (event) => {
37
+ emit("itemClick", event, props.item);
38
+ event.stopPropagation();
39
+ };
40
+ return {
41
+ delClick,
42
+ editClick,
43
+ contentsClick,
44
+ translate: translate$1
45
+ };
46
+ }
47
+ });
48
+ const _hoisted_1$4 = { class: "nut-item-contents__info" };
49
+ const _hoisted_2$2 = { class: "nut-item-contents__info-contact" };
50
+ const _hoisted_3$1 = { class: "nut-item-contents__info-contact-name" };
51
+ const _hoisted_4$1 = { class: "nut-item-contents__info-contact-tel" };
52
+ const _hoisted_5$1 = {
53
+ key: 0,
54
+ class: "nut-item-contents__info-contact-default"
55
+ };
56
+ const _hoisted_6$1 = { class: "nut-item-contents__info-handle" };
57
+ const _hoisted_7$1 = { class: "nut-item-contents__addr" };
58
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
59
+ const _component_nut_icon = resolveComponent("nut-icon");
60
+ return openBlock(), createElementBlock("div", {
61
+ class: "nut-item-contents__contain",
62
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.contentsClick && _ctx.contentsClick(...args))
63
+ }, [
64
+ createElementVNode("div", _hoisted_1$4, [
65
+ createElementVNode("div", _hoisted_2$2, [
66
+ renderSlot(_ctx.$slots, "contentTop", {}, () => [
67
+ createElementVNode("div", _hoisted_3$1, toDisplayString(_ctx.item.addressName), 1),
68
+ createElementVNode("div", _hoisted_4$1, toDisplayString(_ctx.item.phone), 1),
69
+ _ctx.item.defaultAddress ? (openBlock(), createElementBlock("div", _hoisted_5$1, toDisplayString(_ctx.translate("default")), 1)) : createCommentVNode("", true)
70
+ ])
71
+ ]),
72
+ createElementVNode("div", _hoisted_6$1, [
73
+ renderSlot(_ctx.$slots, "contentIcon", {}, () => [
74
+ createVNode(_component_nut_icon, {
75
+ name: "del",
76
+ class: "nut-item-contents__info-handle-del",
77
+ onClick: _ctx.delClick
78
+ }, null, 8, ["onClick"]),
79
+ createVNode(_component_nut_icon, {
80
+ name: "edit",
81
+ class: "nut-item-contents__info-handle-edit",
82
+ onClick: _ctx.editClick
83
+ }, null, 8, ["onClick"])
84
+ ])
85
+ ])
86
+ ]),
87
+ createElementVNode("div", _hoisted_7$1, [
88
+ renderSlot(_ctx.$slots, "contentAddr", {}, () => [
89
+ createTextVNode(toDisplayString(_ctx.item.fullAddress), 1)
90
+ ])
91
+ ])
92
+ ]);
93
+ }
94
+ var ItemContents = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
95
+ const { componentName: componentName$3, create: create$3 } = createComponent("long-press-shell");
96
+ const _sfc_main$3 = create$3({
97
+ props: {
98
+ item: {
99
+ type: Object,
100
+ default: {}
101
+ }
102
+ },
103
+ emits: [
104
+ "holdingDown",
105
+ "handleDel",
106
+ "handelMask",
107
+ "handleCopy",
108
+ "handleSet",
109
+ "handleDelIcon",
110
+ "handleEditIcon",
111
+ "handleItemContent"
112
+ ],
113
+ components: {
114
+ ItemContents
115
+ },
116
+ setup(props, { emit, slots }) {
117
+ let loop = null;
118
+ const showMaskRef = ref(false);
119
+ const holdingFunc = (event) => {
120
+ loop = 0;
121
+ showMaskRef.value = true;
122
+ emit("holdingDown", event, props.item);
123
+ };
124
+ const holddownstart = (event) => {
125
+ loop = setTimeout(() => {
126
+ holdingFunc(event);
127
+ }, 300);
128
+ };
129
+ const holddownmove = (event) => {
130
+ clearTimeout(loop);
131
+ };
132
+ const holddownend = (event) => {
133
+ clearTimeout(loop);
134
+ };
135
+ const hideMaskClick = (event) => {
136
+ showMaskRef.value = false;
137
+ };
138
+ const copyCLick = (event) => {
139
+ if (loop == 0)
140
+ return;
141
+ emit("handleCopy", event, props.item);
142
+ event.stopPropagation();
143
+ };
144
+ const setDefault = (event) => {
145
+ if (loop == 0)
146
+ return;
147
+ emit("handleSet", event, props.item);
148
+ event.stopPropagation();
149
+ };
150
+ const delClick = (event) => {
151
+ if (loop == 0)
152
+ return;
153
+ emit("handleDel", event, props.item);
154
+ event.stopPropagation();
155
+ };
156
+ const maskClick = (event) => {
157
+ if (loop != 0) {
158
+ showMaskRef.value = false;
159
+ }
160
+ event.stopPropagation();
161
+ event.preventDefault();
162
+ };
163
+ const delShellClick = (event, item) => {
164
+ emit("handleDelIcon", event, props.item);
165
+ event.stopPropagation();
166
+ };
167
+ const editShellClick = (event, item) => {
168
+ emit("handleEditIcon", event, props.item);
169
+ event.stopPropagation();
170
+ };
171
+ const itemShellClick = (event, item) => {
172
+ emit("handleItemContent", event, props.item);
173
+ event.stopPropagation();
174
+ };
175
+ return {
176
+ holddownstart,
177
+ holddownmove,
178
+ holddownend,
179
+ showMaskRef,
180
+ delClick,
181
+ copyCLick,
182
+ hideMaskClick,
183
+ setDefault,
184
+ maskClick,
185
+ delShellClick,
186
+ editShellClick,
187
+ itemShellClick
188
+ };
189
+ }
190
+ });
191
+ const _hoisted_1$3 = { class: "nut-long-press-shell" };
192
+ const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "mask-contain" }, [
193
+ /* @__PURE__ */ createTextVNode(" \u590D\u5236"),
194
+ /* @__PURE__ */ createElementVNode("br"),
195
+ /* @__PURE__ */ createTextVNode("\u5730\u5740 ")
196
+ ], -1);
197
+ const _hoisted_3 = [
198
+ _hoisted_2$1
199
+ ];
200
+ const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "mask-contain" }, [
201
+ /* @__PURE__ */ createTextVNode(" \u8BBE\u7F6E"),
202
+ /* @__PURE__ */ createElementVNode("br"),
203
+ /* @__PURE__ */ createTextVNode("\u9ED8\u8BA4 ")
204
+ ], -1);
205
+ const _hoisted_5 = [
206
+ _hoisted_4
207
+ ];
208
+ const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { class: "mask-contain" }, [
209
+ /* @__PURE__ */ createTextVNode(" \u5220\u9664"),
210
+ /* @__PURE__ */ createElementVNode("br"),
211
+ /* @__PURE__ */ createTextVNode("\u5730\u5740 ")
212
+ ], -1);
213
+ const _hoisted_7 = [
214
+ _hoisted_6
215
+ ];
216
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
217
+ const _component_item_contents = resolveComponent("item-contents");
218
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
219
+ createElementVNode("div", {
220
+ class: "nut-long-press-shell__contain",
221
+ onTouchstart: _cache[4] || (_cache[4] = (...args) => _ctx.holddownstart && _ctx.holddownstart(...args)),
222
+ onTouchend: _cache[5] || (_cache[5] = (...args) => _ctx.holddownend && _ctx.holddownend(...args)),
223
+ onTouchmove: _cache[6] || (_cache[6] = (...args) => _ctx.holddownmove && _ctx.holddownmove(...args))
224
+ }, [
225
+ createVNode(_component_item_contents, {
226
+ item: _ctx.item,
227
+ onDelIconClick: _ctx.delShellClick,
228
+ onEditIconClick: _ctx.editShellClick,
229
+ onItemClick: _ctx.itemShellClick
230
+ }, {
231
+ contentTop: withCtx(() => [
232
+ renderSlot(_ctx.$slots, "contentInfo")
233
+ ]),
234
+ contentIcon: withCtx(() => [
235
+ renderSlot(_ctx.$slots, "contentIcons")
236
+ ]),
237
+ contentAddr: withCtx(() => [
238
+ renderSlot(_ctx.$slots, "contentAddrs")
239
+ ]),
240
+ _: 3
241
+ }, 8, ["item", "onDelIconClick", "onEditIconClick", "onItemClick"]),
242
+ _ctx.showMaskRef ? (openBlock(), createElementBlock("div", {
243
+ key: 0,
244
+ class: "nut-long-press-shell__contain-mask",
245
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.maskClick && _ctx.maskClick(...args))
246
+ }, [
247
+ renderSlot(_ctx.$slots, "longpressAll", {}, () => [
248
+ createElementVNode("div", {
249
+ class: "nut-long-press-shell__contain-mask-copy",
250
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.copyCLick && _ctx.copyCLick(...args))
251
+ }, _hoisted_3),
252
+ createElementVNode("div", {
253
+ class: "nut-long-press-shell__contain-mask-set",
254
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.setDefault && _ctx.setDefault(...args))
255
+ }, _hoisted_5),
256
+ createElementVNode("div", {
257
+ class: "nut-long-press-shell__contain-mask-del",
258
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.delClick && _ctx.delClick(...args))
259
+ }, _hoisted_7)
260
+ ])
261
+ ])) : createCommentVNode("", true)
262
+ ], 32),
263
+ _ctx.showMaskRef ? (openBlock(), createElementBlock("div", {
264
+ key: 0,
265
+ class: "nut-addresslist__mask-bottom",
266
+ onClick: _cache[7] || (_cache[7] = (...args) => _ctx.hideMaskClick && _ctx.hideMaskClick(...args))
267
+ })) : createCommentVNode("", true)
268
+ ]);
269
+ }
270
+ var LongPressShell = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
271
+ const { componentName: componentName$2, create: create$2 } = createComponent("swipe-shell");
272
+ const _sfc_main$2 = create$2({
273
+ props: {
274
+ item: {
275
+ type: Object,
276
+ default: {}
277
+ }
278
+ },
279
+ emits: ["handleDelIcon", "handleEditIcon", "handleItemContent", "handelSwipeDel"],
280
+ components: {
281
+ ItemContents
282
+ },
283
+ setup(props, { emit, slots }) {
284
+ const moveRef = ref(false);
285
+ const delShellClick = (event, item) => {
286
+ emit("handleDelIcon", event, props.item);
287
+ event.stopPropagation();
288
+ };
289
+ const editShellClick = (event, item) => {
290
+ emit("handleEditIcon", event, props.item);
291
+ event.stopPropagation();
292
+ };
293
+ const itemShellClick = (event, item) => {
294
+ if (moveRef.value)
295
+ return;
296
+ emit("handleItemContent", event, props.item);
297
+ event.stopPropagation();
298
+ };
299
+ const swipeDelClick = (event, item) => {
300
+ emit("handelSwipeDel", event, props.item);
301
+ event.stopPropagation();
302
+ };
303
+ const swipestart = () => {
304
+ moveRef.value = false;
305
+ };
306
+ const swipemove = () => {
307
+ moveRef.value = true;
308
+ };
309
+ return {
310
+ delShellClick,
311
+ editShellClick,
312
+ itemShellClick,
313
+ swipeDelClick,
314
+ swipestart,
315
+ swipemove
316
+ };
317
+ }
318
+ });
319
+ const _hoisted_1$2 = { class: "nut-swipe-shell" };
320
+ const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u5220\u9664");
321
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
322
+ const _component_item_contents = resolveComponent("item-contents");
323
+ const _component_nut_button = resolveComponent("nut-button");
324
+ const _component_nut_swipe = resolveComponent("nut-swipe");
325
+ return openBlock(), createBlock(_component_nut_swipe, null, {
326
+ right: withCtx(() => [
327
+ renderSlot(_ctx.$slots, "swiperightbtn", {}, () => [
328
+ createVNode(_component_nut_button, {
329
+ shape: "square",
330
+ style: { "height": "100%" },
331
+ type: "danger",
332
+ onClick: _ctx.swipeDelClick
333
+ }, {
334
+ default: withCtx(() => [
335
+ _hoisted_2
336
+ ]),
337
+ _: 1
338
+ }, 8, ["onClick"])
339
+ ])
340
+ ]),
341
+ default: withCtx(() => [
342
+ createElementVNode("div", _hoisted_1$2, [
343
+ createVNode(_component_item_contents, {
344
+ item: _ctx.item,
345
+ onDelIconClick: _ctx.delShellClick,
346
+ onEditIconClick: _ctx.editShellClick,
347
+ onItemClick: _ctx.itemShellClick,
348
+ onTouchmove: _ctx.swipemove,
349
+ onTouchstart: _ctx.swipestart
350
+ }, {
351
+ contentTop: withCtx(() => [
352
+ renderSlot(_ctx.$slots, "contentInfo")
353
+ ]),
354
+ contentIcon: withCtx(() => [
355
+ renderSlot(_ctx.$slots, "contentIcons")
356
+ ]),
357
+ contentAddr: withCtx(() => [
358
+ renderSlot(_ctx.$slots, "contentAddrs")
359
+ ]),
360
+ _: 3
361
+ }, 8, ["item", "onDelIconClick", "onEditIconClick", "onItemClick", "onTouchmove", "onTouchstart"])
362
+ ])
363
+ ]),
364
+ _: 3
365
+ });
366
+ }
367
+ var SwipeShell = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
368
+ const { componentName: componentName$1, create: create$1 } = createComponent("general-shell");
369
+ const _sfc_main$1 = create$1({
370
+ props: {
371
+ item: {
372
+ type: Object,
373
+ default: {}
374
+ }
375
+ },
376
+ emits: ["handleDelIcon", "handleEditIcon", "handleItemContent", "handelSwipeDel"],
377
+ components: {
378
+ ItemContents
379
+ },
380
+ setup(props, { emit, slots }) {
381
+ const delShellClick = (event, item) => {
382
+ emit("handleDelIcon", event, props.item);
383
+ event.stopPropagation();
384
+ };
385
+ const editShellClick = (event, item) => {
386
+ emit("handleEditIcon", event, props.item);
387
+ event.stopPropagation();
388
+ };
389
+ const itemShellClick = (event, item) => {
390
+ emit("handleItemContent", event, props.item);
391
+ event.stopPropagation();
392
+ };
393
+ const swipeDelClick = (event, item) => {
394
+ emit("handelSwipeDel", event, props.item);
395
+ event.stopPropagation();
396
+ };
397
+ return {
398
+ delShellClick,
399
+ editShellClick,
400
+ itemShellClick,
401
+ swipeDelClick
402
+ };
403
+ }
404
+ });
405
+ const _hoisted_1$1 = { class: "nut-general-shell" };
406
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
407
+ const _component_item_contents = resolveComponent("item-contents");
408
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
409
+ createVNode(_component_item_contents, {
410
+ item: _ctx.item,
411
+ onDelIconClick: _ctx.delShellClick,
412
+ onEditIconClick: _ctx.editShellClick,
413
+ onItemClick: _ctx.itemShellClick
414
+ }, {
415
+ contentTop: withCtx(() => [
416
+ renderSlot(_ctx.$slots, "contentInfo")
417
+ ]),
418
+ contentIcon: withCtx(() => [
419
+ renderSlot(_ctx.$slots, "contentIcons")
420
+ ]),
421
+ contentAddr: withCtx(() => [
422
+ renderSlot(_ctx.$slots, "contentAddrs")
423
+ ]),
424
+ _: 3
425
+ }, 8, ["item", "onDelIconClick", "onEditIconClick", "onItemClick"])
426
+ ]);
427
+ }
428
+ var GeneralShell = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
429
+ const { componentName, create, translate } = createComponent("addresslist");
430
+ const _sfc_main = create({
431
+ props: {
432
+ data: {
433
+ type: Array,
434
+ default: []
435
+ },
436
+ longPressEdition: {
437
+ type: Boolean,
438
+ default: false
439
+ },
440
+ swipeEdition: {
441
+ type: Boolean,
442
+ default: false
443
+ },
444
+ showBottomButton: {
445
+ type: Boolean,
446
+ default: true
447
+ },
448
+ dataMapOptions: {
449
+ type: Object,
450
+ default: {}
451
+ }
452
+ },
453
+ components: {
454
+ LongPressShell,
455
+ SwipeShell,
456
+ GeneralShell
457
+ },
458
+ emits: [
459
+ "handelDelIcon",
460
+ "handelEditIcon",
461
+ "handelItem",
462
+ "longPressCopyClick",
463
+ "longPressSetClick",
464
+ "longPressDelClick",
465
+ "swipeDelClick",
466
+ "addAddressClick"
467
+ ],
468
+ setup(props, { emit }) {
469
+ const dataArray = ref([]);
470
+ const dataInfo = reactive({
471
+ id: 2,
472
+ addressName: "\u59D3\u540D",
473
+ phone: "123****4567",
474
+ defaultAddress: false,
475
+ fullAddress: "\u5317\u4EAC\u5E02\u901A\u5DDE\u533A\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5"
476
+ });
477
+ const trowelData = () => {
478
+ console.log("props.data", props.data);
479
+ if (Object.keys(props.dataMapOptions).length > 0 && props.data.length > 0) {
480
+ dataArray.value = props.data.map((item, index2) => {
481
+ return floatData(dataInfo, item, props.dataMapOptions);
482
+ });
483
+ }
484
+ };
485
+ watch(() => props.data, () => trowelData(), { deep: true });
486
+ const clickDelIcon = (event, item) => {
487
+ emit("handelDelIcon", event, item);
488
+ event.stopPropagation();
489
+ };
490
+ const clickEditIcon = (event, item) => {
491
+ emit("handelEditIcon", event, item);
492
+ event.stopPropagation();
493
+ };
494
+ const clickContentItem = (event, item) => {
495
+ emit("handelItem", event, item);
496
+ event.stopPropagation();
497
+ };
498
+ const clickLongCopy = (event, item) => {
499
+ emit("longPressCopyClick", event, item);
500
+ event.stopPropagation();
501
+ };
502
+ const clickLongSet = (event, item) => {
503
+ emit("longPressSetClick", event, item);
504
+ event.stopPropagation();
505
+ };
506
+ const clickLongDel = (event, item) => {
507
+ emit("longPressDelClick", event, item);
508
+ event.stopPropagation();
509
+ };
510
+ const clickSwipeDel = (event, item) => {
511
+ emit("swipeDelClick", event, item);
512
+ event.stopPropagation();
513
+ };
514
+ const addAddress = (event) => {
515
+ emit("addAddressClick", event);
516
+ event.stopPropagation();
517
+ };
518
+ onMounted(() => {
519
+ trowelData();
520
+ });
521
+ return {
522
+ clickDelIcon,
523
+ clickEditIcon,
524
+ clickContentItem,
525
+ clickLongCopy,
526
+ clickLongSet,
527
+ clickLongDel,
528
+ clickSwipeDel,
529
+ addAddress,
530
+ dataArray,
531
+ translate
532
+ };
533
+ }
534
+ });
535
+ const _hoisted_1 = { class: "nut-addresslist" };
536
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
537
+ const _component_general_shell = resolveComponent("general-shell");
538
+ const _component_long_press_shell = resolveComponent("long-press-shell");
539
+ const _component_swipe_shell = resolveComponent("swipe-shell");
540
+ const _component_nut_button = resolveComponent("nut-button");
541
+ return openBlock(), createElementBlock("div", _hoisted_1, [
542
+ !_ctx.longPressEdition && !_ctx.swipeEdition ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.dataArray, (item, index2) => {
543
+ return openBlock(), createBlock(_component_general_shell, {
544
+ key: "general" + index2,
545
+ item,
546
+ onHandleDelIcon: _ctx.clickDelIcon,
547
+ onHandleEditIcon: _ctx.clickEditIcon,
548
+ onHandleItemContent: _ctx.clickContentItem,
549
+ onHandelSwipeDel: _ctx.clickSwipeDel
550
+ }, null, 8, ["item", "onHandleDelIcon", "onHandleEditIcon", "onHandleItemContent", "onHandelSwipeDel"]);
551
+ }), 128)) : createCommentVNode("", true),
552
+ _ctx.longPressEdition && !_ctx.swipeEdition ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.dataArray, (item, index2) => {
553
+ return openBlock(), createBlock(_component_long_press_shell, {
554
+ key: "longpress" + index2,
555
+ item,
556
+ onHandleDelIcon: _ctx.clickDelIcon,
557
+ onHandleEditIcon: _ctx.clickEditIcon,
558
+ onHandleItemContent: _ctx.clickContentItem,
559
+ onHandleCopy: _ctx.clickLongCopy,
560
+ onHandleSet: _ctx.clickLongSet,
561
+ onHandleDel: _ctx.clickLongDel
562
+ }, {
563
+ contentInfo: withCtx(() => [
564
+ renderSlot(_ctx.$slots, "iteminfos")
565
+ ]),
566
+ contentIcons: withCtx(() => [
567
+ renderSlot(_ctx.$slots, "itemicon")
568
+ ]),
569
+ contentAddrs: withCtx(() => [
570
+ renderSlot(_ctx.$slots, "itemaddr")
571
+ ]),
572
+ longpressAll: withCtx(() => [
573
+ renderSlot(_ctx.$slots, "longpressbtns")
574
+ ]),
575
+ _: 2
576
+ }, 1032, ["item", "onHandleDelIcon", "onHandleEditIcon", "onHandleItemContent", "onHandleCopy", "onHandleSet", "onHandleDel"]);
577
+ }), 128)) : createCommentVNode("", true),
578
+ !_ctx.longPressEdition && _ctx.swipeEdition ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.dataArray, (item, index2) => {
579
+ return openBlock(), createBlock(_component_swipe_shell, {
580
+ key: "swipe" + index2,
581
+ item,
582
+ onHandleDelIcon: _ctx.clickDelIcon,
583
+ onHandleEditIcon: _ctx.clickEditIcon,
584
+ onHandleItemContent: _ctx.clickContentItem,
585
+ onHandelSwipeDel: _ctx.clickSwipeDel
586
+ }, {
587
+ contentInfo: withCtx(() => [
588
+ renderSlot(_ctx.$slots, "iteminfos")
589
+ ]),
590
+ contentIcons: withCtx(() => [
591
+ renderSlot(_ctx.$slots, "itemicon")
592
+ ]),
593
+ contentAddrs: withCtx(() => [
594
+ renderSlot(_ctx.$slots, "itemaddr")
595
+ ]),
596
+ swiperightbtn: withCtx(() => [
597
+ renderSlot(_ctx.$slots, "swiperight")
598
+ ]),
599
+ _: 2
600
+ }, 1032, ["item", "onHandleDelIcon", "onHandleEditIcon", "onHandleItemContent", "onHandelSwipeDel"]);
601
+ }), 128)) : createCommentVNode("", true),
602
+ _ctx.showBottomButton ? (openBlock(), createElementBlock("div", {
603
+ key: 3,
604
+ class: "nut-addresslist__bottom",
605
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.addAddress && _ctx.addAddress(...args))
606
+ }, [
607
+ createVNode(_component_nut_button, {
608
+ block: "",
609
+ type: "danger"
610
+ }, {
611
+ default: withCtx(() => [
612
+ createTextVNode(toDisplayString(_ctx.translate("addAddress")), 1)
613
+ ]),
614
+ _: 1
615
+ })
616
+ ])) : createCommentVNode("", true)
617
+ ]);
618
+ }
619
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
620
+ export { index as default };