@nutui/nutui 3.1.22-beta.5 → 3.1.23-beta.1

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 (168) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +3 -4
  3. package/dist/nutui.es.js +20412 -4214
  4. package/dist/nutui.umd.js +20518 -4216
  5. package/dist/packages/_es/ActionSheet.js +149 -17
  6. package/dist/packages/_es/Address.js +535 -110
  7. package/dist/packages/_es/AddressList.js +615 -113
  8. package/dist/packages/_es/Animate.js +59 -17
  9. package/dist/packages/_es/Audio.js +257 -53
  10. package/dist/packages/_es/AudioOperate.js +100 -13
  11. package/dist/packages/_es/Avatar.js +162 -38
  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 -30
  18. package/dist/packages/_es/CalendarItem.js +1 -1
  19. package/dist/packages/_es/Card.js +107 -10
  20. package/dist/packages/_es/Cascader.js +496 -147
  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 +109 -32
  30. package/dist/packages/_es/CollapseItem.js +253 -59
  31. package/dist/packages/_es/Comment.js +434 -64
  32. package/dist/packages/_es/ConfigProvider.js +20 -8
  33. package/dist/packages/_es/CountDown.js +238 -56
  34. package/dist/packages/_es/CountUp.js +539 -140
  35. package/dist/packages/_es/DatePicker.js +315 -98
  36. package/dist/packages/_es/Dialog.js +289 -60
  37. package/dist/packages/_es/Divider.js +65 -13
  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 -58
  41. package/dist/packages/_es/Ellipsis.js +200 -58
  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 +137 -26
  50. package/dist/packages/_es/ImagePreview.js +547 -76
  51. package/dist/packages/_es/Indicator.js +62 -15
  52. package/dist/packages/_es/InfiniteLoading.js +249 -57
  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 -18
  57. package/dist/packages/_es/Menu.js +168 -44
  58. package/dist/packages/_es/MenuItem.js +173 -37
  59. package/dist/packages/_es/Navbar.js +192 -30
  60. package/dist/packages/_es/NoticeBar.js +380 -74
  61. package/dist/packages/_es/Notify.js +227 -72
  62. package/dist/packages/_es/NumberKeyboard.js +272 -41
  63. package/dist/packages/_es/OldPicker.js +457 -130
  64. package/dist/packages/_es/OverLay.js +98 -24
  65. package/dist/packages/_es/Pagination.js +157 -39
  66. package/dist/packages/_es/Picker.js +454 -129
  67. package/dist/packages/_es/Popover.js +957 -318
  68. package/dist/packages/_es/Popup.js +299 -55
  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 -84
  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 -83
  75. package/dist/packages/_es/Rate.js +192 -36
  76. package/dist/packages/_es/Row.js +64 -22
  77. package/dist/packages/_es/SearchBar.js +238 -37
  78. package/dist/packages/_es/ShortPassword.js +225 -35
  79. package/dist/packages/_es/SideNavBar.js +81 -24
  80. package/dist/packages/_es/SideNavBarItem.js +46 -11
  81. package/dist/packages/_es/Signature.js +160 -41
  82. package/dist/packages/_es/Skeleton.js +136 -20
  83. package/dist/packages/_es/Sku.js +491 -84
  84. package/dist/packages/_es/Step.js +115 -20
  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 -17
  88. package/dist/packages/_es/Swipe.js +178 -41
  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 -18
  96. package/dist/packages/_es/Tabs.js +202 -43
  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 -18
  100. package/dist/packages/_es/TimePannel.js +48 -14
  101. package/dist/packages/_es/TimeSelect.js +112 -15
  102. package/dist/packages/_es/Toast.js +310 -71
  103. package/dist/packages/_es/Uploader.js +455 -104
  104. package/dist/packages/_es/Video.js +332 -74
  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 +780 -164
  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/imagepreview/index.scss +6 -1
  116. package/dist/packages/locale/lang/baseLang.js +3 -3
  117. package/dist/packages/locale/lang/en-US.js +105 -5
  118. package/dist/packages/locale/lang/id-ID.js +105 -5
  119. package/dist/packages/locale/lang/index.js +38 -16
  120. package/dist/packages/locale/lang/zh-CN.js +105 -5
  121. package/dist/packages/locale/lang/zh-TW.js +105 -5
  122. package/dist/packages/picker/index.scss +13 -0
  123. package/dist/smartips/attributes.json +8 -0
  124. package/dist/smartips/tags.json +3 -1
  125. package/dist/smartips/web-types.json +19 -1
  126. package/dist/style.css +1 -1
  127. package/dist/style.es.js +1 -1
  128. package/dist/styles/themes/default.scss +49 -49
  129. package/dist/styles/themes/jdb.scss +49 -49
  130. package/dist/styles/themes/jdt.scss +49 -49
  131. package/dist/styles/variables-jdb.scss +4 -1
  132. package/dist/styles/variables-jdt.scss +4 -1
  133. package/dist/styles/variables.scss +1 -1
  134. package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
  135. package/dist/types/__VUE/address/index.vue.d.ts +4 -4
  136. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  137. package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
  138. package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
  139. package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
  140. package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
  141. package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
  142. package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
  143. package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
  144. package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
  146. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
  147. package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
  148. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
  149. package/dist/types/__VUE/input/index.vue.d.ts +2 -2
  150. package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
  151. package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
  152. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
  153. package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
  154. package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
  155. package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
  156. package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
  157. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  158. package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
  159. package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
  160. package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
  161. package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
  162. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  163. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  164. package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
  165. package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
  166. package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
  167. package/dist/types/index.d.ts +1 -1
  168. package/package.json +1 -2
@@ -1,92 +1,499 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 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 s, createElementVNode as r, renderSlot as n, createBlock as a, createCommentVNode as o, toDisplayString as p, ref as l, watch as u, onMounted as i, Fragment as c, renderList as d, normalizeClass as k, createVNode as m, withCtx as g, createSlots as v } from "vue";
7
- import { c as x, T as S } from "./component.js";
8
- import { _ as y } from "./plugin-vue_export-helper.js";
9
- import { popupProps as b } from "./Popup.js";
6
+ import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, createCommentVNode, toDisplayString, ref, watch, onMounted, Fragment, renderList, normalizeClass, createVNode, withCtx, createSlots } from "vue";
7
+ import { c as createComponent, T as TypeOfFun } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
+ import { popupProps } from "./Popup.js";
10
10
  import "../locale/lang";
11
11
  import "./OverLay.js";
12
12
  import "./Icon.js";
13
13
  import "./pxCheck.js";
14
- const { componentName: h, create: f, translate: T } = x("sku-header"), O = f({ props: { goods: { type: Object, default: {} } }, emits: [], setup: (e2, { emit: t2, slots: s2 }) => ({ getSlots: (e3) => s2[e3], translate: T }) }), C = { class: "nut-sku-header" }, w = ["src"], M = { class: "nut-sku-header-right" }, B = { key: 3, class: "nut-sku-header-right-extra" };
15
- var E = y(O, [["render", function(l2, u2, i2, c2, d2, k2) {
16
- const m2 = e("nut-price");
17
- return t(), s("view", C, [r("img", { src: l2.goods.imagePath }, null, 8, w), r("view", M, [l2.getSlots("sku-header-price") ? n(l2.$slots, "sku-header-price", { key: 0 }) : (t(), a(m2, { key: 1, price: l2.goods.price, needSymbol: true, thousands: false }, null, 8, ["price"])), l2.getSlots("sku-header-extra") ? n(l2.$slots, "sku-header-extra", { key: 2 }) : o("", true), l2.goods.skuId && !l2.getSlots("sku-header-extra") ? (t(), s("view", B, p(l2.translate("skuId")) + "\xA0:\xA0" + p(l2.goods.skuId), 1)) : o("", true)])]);
18
- }]]);
19
- const { componentName: L, create: $ } = x("sku-select"), I = $({ props: { sku: { type: Array, default: () => [] } }, emits: ["selectSku"], setup(e2, { emit: t2 }) {
20
- const s2 = l([]);
21
- u(() => e2.sku, (e3) => {
22
- s2.value = [].slice.call(e3);
23
- }, { deep: true }), i(() => {
24
- e2.sku.length > 0 && (s2.value = [].slice.call(e2.sku));
25
- });
26
- return { skuInfo: s2, changeSaleChild: (e3, s3, r2, n2) => {
27
- e3.checkFlag || e3.disable || t2("selectSku", { sku: e3, skuIndex: s3, parentSku: r2, parentIndex: n2 });
28
- } };
29
- } }), N = { class: "nut-sku-select" }, P = { class: "nut-sku-select-item-title" }, j = { class: "nut-sku-select-item-skus" }, A = ["onClick"];
30
- var H = y(I, [["render", function(e2, n2, a2, o2, l2, u2) {
31
- return t(), s("view", N, [(t(true), s(c, null, d(e2.skuInfo, (n3, a3) => (t(), s("view", { class: "nut-sku-select-item", key: n3.id }, [r("view", P, p(n3.name), 1), r("view", j, [(t(true), s(c, null, d(n3.list, (r2, o3) => (t(), s("view", { class: k(["nut-sku-select-item-skus-sku", [{ active: !r2.disable && r2.active }, { disable: r2.disable }]]), onClick: (t2) => e2.changeSaleChild(r2, o3, n3, a3), key: r2.name }, p(r2.name), 11, A))), 128))])]))), 128))]);
32
- }]]);
33
- const { componentName: _, create: R } = x("sku-stepper"), F = R({ props: { stepperMax: { type: [Number, String], default: 99999 }, stepperMin: { type: [Number, String], default: 1 }, stepperExtraText: { type: [Function, Boolean], default: false }, stepperTitle: { type: String, default: "\u8D2D\u4E70\u6570\u91CF" } }, emits: ["click", "changeSku", "changeStepper", "clickBtnOptions", "overLimit", "reduce", "add"], setup(e2, { emit: t2 }) {
34
- const s2 = l(e2.stepperMin);
35
- i(() => {
36
- s2.value = e2.stepperMin;
37
- });
38
- return { goodsCount: s2, add: (e3) => {
39
- t2("add", e3);
40
- }, reduce: (e3) => {
41
- t2("reduce", e3);
42
- }, overlimit: (e3, r2) => {
43
- t2("overLimit", { action: r2, value: parseInt(s2.value + "") });
44
- }, getExtraText: () => {
45
- const { stepperExtraText: t3 } = e2;
46
- return t3 && S(t3) == "function" ? t3() : "";
47
- }, changeStepper: (e3) => {
48
- s2.value = e3, t2("changeStepper", e3);
49
- } };
50
- } }), V = { class: "nut-sku-stepper" }, W = { class: "nut-sku-stepper-title" }, D = ["innerHTML"], U = { class: "nut-sku-stepper-count" };
51
- var q = y(F, [["render", function(n2, a2, o2, l2, u2, i2) {
52
- const c2 = e("nut-inputnumber");
53
- return t(), s("view", V, [r("view", W, p(n2.stepperTitle), 1), r("view", { class: "nut-sku-stepper-limit", innerHTML: n2.getExtraText() }, null, 8, D), r("view", U, [m(c2, { modelValue: n2.goodsCount, "onUpdate:modelValue": a2[0] || (a2[0] = (e2) => n2.goodsCount = e2), min: n2.stepperMin, max: n2.stepperMax, onAdd: n2.add, onReduce: n2.reduce, onOverlimit: n2.overlimit, onChange: n2.changeStepper }, null, 8, ["modelValue", "min", "max", "onAdd", "onReduce", "onOverlimit", "onChange"])])]);
54
- }]]);
55
- const { componentName: z, create: G } = x("sku-operate"), J = G({ props: { btnOptions: { type: Array, default: () => ["confirm"] }, btnExtraText: { type: String, default: "" }, buyText: { type: String, default: "\u7ACB\u5373\u8D2D\u4E70" }, addCartText: { type: String, default: "\u52A0\u5165\u8D2D\u7269\u8F66" }, confirmText: { type: String, default: "\u786E\u5B9A" } }, emits: ["click", "changeSku", "changeBuyCount", "clickBtnOperate"], setup: (e2, { emit: t2, slots: s2 }) => ({ getBtnDesc: (t3) => ({ confirm: e2.confirmText, cart: e2.addCartText, buy: e2.buyText })[t3], clickBtnOperate: (e3) => {
56
- t2("clickBtnOperate", e3);
57
- }, getSlots: (e3) => s2[e3] }) }), K = { key: 0, class: "nut-sku-operate" }, Q = ["innerHTML"], X = { key: 1, class: "nut-sku-operate-btn" }, Y = ["onClick"];
58
- var Z = y(J, [["render", function(e2, r2, a2, l2, u2, i2) {
59
- return e2.btnOptions.length > 0 ? (t(), s("view", K, [e2.btnExtraText ? (t(), s("view", { key: 0, class: "nut-sku-operate-desc", innerHTML: e2.btnExtraText }, null, 8, Q)) : o("", true), n(e2.$slots, "operate-btn"), e2.getSlots("operate-btn") ? o("", true) : (t(), s("view", X, [(t(true), s(c, null, d(e2.btnOptions, (r3, n2) => (t(), s("view", { class: k([`nut-sku-operate-btn-${r3}`, "nut-sku-operate-btn-item"]), key: n2, onClick: (t2) => e2.clickBtnOperate(r3) }, p(e2.getBtnDesc(r3)), 11, Y))), 128))]))])) : o("", true);
60
- }]]);
61
- const { componentName: ee, create: te, translate: se } = x("sku"), re = te({ props: { ...b, sku: { type: Array, default: [] }, goods: { type: Object, default: {} }, stepperMax: { type: [Number, String], default: 99999 }, stepperMin: { type: [Number, String], default: 1 }, btnOptions: { type: Array, default: () => ["confirm"] }, stepperTitle: { type: String, default: "" }, stepperExtraText: { type: [Function, Boolean], default: false }, btnExtraText: { type: String, default: "" }, buyText: { type: String, default: "" }, addCartText: { type: String, default: "" }, confirmText: { type: String, default: "" } }, emits: ["update:visible", "selectSku", "changeStepper", "clickBtnOperate", "clickCloseIcon", "clickOverlay", "close", "reduce", "add", "overLimit", "clickOverlay"], components: { SkuHeader: E, SkuSelect: H, SkuStepper: q, SkuOperate: Z }, setup(e2, { emit: t2, slots: s2 }) {
62
- const r2 = l(e2.visible), n2 = l(e2.stepperMin);
63
- u(() => e2.visible, (e3) => {
64
- r2.value = e3;
65
- }), u(() => r2.value, (e3) => {
66
- e3 == 0 && a2();
67
- }), i(() => {
68
- });
69
- const a2 = () => {
70
- t2("update:visible", false);
71
- };
72
- return { showPopup: r2, closePopup: (e3) => {
73
- e3 == "icon" && t2("click-close-icon"), e3 == "overlay" && t2("click-overlay"), e3 == "close" && t2("close"), r2.value = false;
74
- }, selectSku: (e3) => {
75
- t2("selectSku", e3);
76
- }, changeStepper: (e3) => {
77
- n2.value = e3, t2("changeStepper", e3);
78
- }, stepperOverLimit: (e3) => {
79
- t2("overLimit", e3);
80
- }, clickBtnOperate: (e3) => {
81
- t2("clickBtnOperate", { type: e3, value: n2.value });
82
- }, add: (e3) => {
83
- t2("add", e3);
84
- }, reduce: (e3) => {
85
- t2("reduce", e3);
86
- }, getSlots: (e3) => s2[e3], translate: se };
87
- } }), ne = { class: "nut-sku" }, ae = { class: "nut-sku-content" };
88
- var oe = y(re, [["render", function(s2, p2, l2, u2, i2, c2) {
89
- const d2 = e("sku-header"), k2 = e("SkuSelect"), x2 = e("sku-stepper"), S2 = e("sku-operate"), y2 = e("nut-popup");
90
- return t(), a(y2, { position: "bottom", closeable: "", round: "", visible: s2.showPopup, "onUpdate:visible": p2[0] || (p2[0] = (e2) => s2.showPopup = e2), onClickCloseIcon: p2[1] || (p2[1] = (e2) => s2.closePopup("icon")), onClickOverlay: p2[2] || (p2[2] = (e2) => s2.closePopup("overlay")), onClose: p2[3] || (p2[3] = (e2) => s2.closePopup("close")), style: { height: "75%" }, isWrapTeleport: s2.isWrapTeleport, teleport: s2.teleport }, { default: g(() => [r("view", ne, [n(s2.$slots, "sku-header"), s2.getSlots("sku-header") ? o("", true) : (t(), a(d2, { key: 0, goods: s2.goods }, v({ _: 2 }, [s2.getSlots("sku-header-price") ? { name: "sku-header-price", fn: g(() => [n(s2.$slots, "sku-header-price")]) } : void 0, s2.getSlots("sku-header-extra") ? { name: "sku-header-extra", fn: g(() => [n(s2.$slots, "sku-header-extra")]) } : void 0]), 1032, ["goods"])), r("view", ae, [n(s2.$slots, "sku-select-top"), n(s2.$slots, "sku-select"), s2.getSlots("sku-select") ? o("", true) : (t(), a(k2, { key: 0, sku: s2.sku, onSelectSku: s2.selectSku }, null, 8, ["sku", "onSelectSku"])), n(s2.$slots, "sku-stepper"), s2.getSlots("sku-stepper") ? o("", true) : (t(), a(x2, { key: 1, goods: s2.goods, stepperTitle: s2.stepperTitle || s2.translate("buyNumber"), stepperMax: s2.stepperMax, stepperMin: s2.stepperMin, stepperExtraText: s2.stepperExtraText, onAdd: s2.add, onReduce: s2.reduce, onChangeStepper: s2.changeStepper, onOverLimit: s2.stepperOverLimit }, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])), n(s2.$slots, "sku-stepper-bottom")]), m(S2, { btnOptions: s2.btnOptions, btnExtraText: s2.btnExtraText, buyText: s2.buyText || s2.translate("buyNow"), addCartText: s2.addCartText || s2.translate("addToCart"), confirmText: s2.confirmText || s2.translate("confirm"), onClickBtnOperate: s2.clickBtnOperate }, v({ _: 2 }, [s2.getSlots("sku-operate") ? { name: "operate-btn", fn: g(() => [n(s2.$slots, "sku-operate")]) } : void 0]), 1032, ["btnOptions", "btnExtraText", "buyText", "addCartText", "confirmText", "onClickBtnOperate"])])]), _: 3 }, 8, ["visible", "isWrapTeleport", "teleport"]);
91
- }]]);
92
- export { oe as default };
14
+ const { componentName: componentName$4, create: create$4, translate: translate$1 } = createComponent("sku-header");
15
+ const _sfc_main$4 = create$4({
16
+ props: {
17
+ goods: {
18
+ type: Object,
19
+ default: {}
20
+ }
21
+ },
22
+ emits: [],
23
+ setup(props, { emit, slots }) {
24
+ const getSlots = (name) => slots[name];
25
+ return {
26
+ getSlots,
27
+ translate: translate$1
28
+ };
29
+ }
30
+ });
31
+ const _hoisted_1$4 = { class: "nut-sku-header" };
32
+ const _hoisted_2$4 = ["src"];
33
+ const _hoisted_3$3 = { class: "nut-sku-header-right" };
34
+ const _hoisted_4$3 = {
35
+ key: 3,
36
+ class: "nut-sku-header-right-extra"
37
+ };
38
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
39
+ const _component_nut_price = resolveComponent("nut-price");
40
+ return openBlock(), createElementBlock("view", _hoisted_1$4, [
41
+ createElementVNode("img", {
42
+ src: _ctx.goods.imagePath
43
+ }, null, 8, _hoisted_2$4),
44
+ createElementVNode("view", _hoisted_3$3, [
45
+ _ctx.getSlots("sku-header-price") ? renderSlot(_ctx.$slots, "sku-header-price", { key: 0 }) : (openBlock(), createBlock(_component_nut_price, {
46
+ key: 1,
47
+ price: _ctx.goods.price,
48
+ needSymbol: true,
49
+ thousands: false
50
+ }, null, 8, ["price"])),
51
+ _ctx.getSlots("sku-header-extra") ? renderSlot(_ctx.$slots, "sku-header-extra", { key: 2 }) : createCommentVNode("", true),
52
+ _ctx.goods.skuId && !_ctx.getSlots("sku-header-extra") ? (openBlock(), createElementBlock("view", _hoisted_4$3, toDisplayString(_ctx.translate("skuId")) + "\xA0:\xA0" + toDisplayString(_ctx.goods.skuId), 1)) : createCommentVNode("", true)
53
+ ])
54
+ ]);
55
+ }
56
+ var SkuHeader = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
57
+ const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
58
+ const _sfc_main$3 = create$3({
59
+ props: {
60
+ sku: {
61
+ type: Array,
62
+ default: () => []
63
+ }
64
+ },
65
+ emits: ["selectSku"],
66
+ setup(props, { emit }) {
67
+ const skuInfo = ref([]);
68
+ watch(() => props.sku, (value) => {
69
+ skuInfo.value = [].slice.call(value);
70
+ }, { deep: true });
71
+ onMounted(() => {
72
+ if (props.sku.length > 0) {
73
+ skuInfo.value = [].slice.call(props.sku);
74
+ }
75
+ });
76
+ const changeSaleChild = (attrItem, index2, parentItem, parentIndex) => {
77
+ if (attrItem.checkFlag || attrItem.disable) {
78
+ return;
79
+ }
80
+ emit("selectSku", {
81
+ sku: attrItem,
82
+ skuIndex: index2,
83
+ parentSku: parentItem,
84
+ parentIndex
85
+ });
86
+ };
87
+ return {
88
+ skuInfo,
89
+ changeSaleChild
90
+ };
91
+ }
92
+ });
93
+ const _hoisted_1$3 = { class: "nut-sku-select" };
94
+ const _hoisted_2$3 = { class: "nut-sku-select-item-title" };
95
+ const _hoisted_3$2 = { class: "nut-sku-select-item-skus" };
96
+ const _hoisted_4$2 = ["onClick"];
97
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
98
+ return openBlock(), createElementBlock("view", _hoisted_1$3, [
99
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item, index2) => {
100
+ return openBlock(), createElementBlock("view", {
101
+ class: "nut-sku-select-item",
102
+ key: item.id
103
+ }, [
104
+ createElementVNode("view", _hoisted_2$3, toDisplayString(item.name), 1),
105
+ createElementVNode("view", _hoisted_3$2, [
106
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (itemAttr, itemAttrIndex) => {
107
+ return openBlock(), createElementBlock("view", {
108
+ class: normalizeClass(["nut-sku-select-item-skus-sku", [{ active: !itemAttr.disable && itemAttr.active }, { disable: itemAttr.disable }]]),
109
+ onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item, index2),
110
+ key: itemAttr.name
111
+ }, toDisplayString(itemAttr.name), 11, _hoisted_4$2);
112
+ }), 128))
113
+ ])
114
+ ]);
115
+ }), 128))
116
+ ]);
117
+ }
118
+ var SkuSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
119
+ const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
120
+ const _sfc_main$2 = create$2({
121
+ props: {
122
+ stepperMax: {
123
+ type: [Number, String],
124
+ default: 99999
125
+ },
126
+ stepperMin: {
127
+ type: [Number, String],
128
+ default: 1
129
+ },
130
+ stepperExtraText: {
131
+ type: [Function, Boolean],
132
+ default: false
133
+ },
134
+ stepperTitle: {
135
+ type: String,
136
+ default: "\u8D2D\u4E70\u6570\u91CF"
137
+ }
138
+ },
139
+ emits: ["click", "changeSku", "changeStepper", "clickBtnOptions", "overLimit", "reduce", "add"],
140
+ setup(props, { emit }) {
141
+ const goodsCount = ref(props.stepperMin);
142
+ onMounted(() => {
143
+ goodsCount.value = props.stepperMin;
144
+ });
145
+ const getExtraText = () => {
146
+ const { stepperExtraText } = props;
147
+ if (stepperExtraText && TypeOfFun(stepperExtraText) == "function") {
148
+ return stepperExtraText();
149
+ } else {
150
+ return "";
151
+ }
152
+ };
153
+ const add = (value) => {
154
+ emit("add", value);
155
+ };
156
+ const reduce = (value) => {
157
+ emit("reduce", value);
158
+ };
159
+ const overlimit = (e, action) => {
160
+ emit("overLimit", {
161
+ action,
162
+ value: parseInt(goodsCount.value + "")
163
+ });
164
+ };
165
+ const changeStepper = (value) => {
166
+ goodsCount.value = value;
167
+ emit("changeStepper", value);
168
+ };
169
+ return {
170
+ goodsCount,
171
+ add,
172
+ reduce,
173
+ overlimit,
174
+ getExtraText,
175
+ changeStepper
176
+ };
177
+ }
178
+ });
179
+ const _hoisted_1$2 = { class: "nut-sku-stepper" };
180
+ const _hoisted_2$2 = { class: "nut-sku-stepper-title" };
181
+ const _hoisted_3$1 = ["innerHTML"];
182
+ const _hoisted_4$1 = { class: "nut-sku-stepper-count" };
183
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
184
+ const _component_nut_inputnumber = resolveComponent("nut-inputnumber");
185
+ return openBlock(), createElementBlock("view", _hoisted_1$2, [
186
+ createElementVNode("view", _hoisted_2$2, toDisplayString(_ctx.stepperTitle), 1),
187
+ createElementVNode("view", {
188
+ class: "nut-sku-stepper-limit",
189
+ innerHTML: _ctx.getExtraText()
190
+ }, null, 8, _hoisted_3$1),
191
+ createElementVNode("view", _hoisted_4$1, [
192
+ createVNode(_component_nut_inputnumber, {
193
+ modelValue: _ctx.goodsCount,
194
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.goodsCount = $event),
195
+ min: _ctx.stepperMin,
196
+ max: _ctx.stepperMax,
197
+ onAdd: _ctx.add,
198
+ onReduce: _ctx.reduce,
199
+ onOverlimit: _ctx.overlimit,
200
+ onChange: _ctx.changeStepper
201
+ }, null, 8, ["modelValue", "min", "max", "onAdd", "onReduce", "onOverlimit", "onChange"])
202
+ ])
203
+ ]);
204
+ }
205
+ var SkuStepper = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
206
+ const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
207
+ const _sfc_main$1 = create$1({
208
+ props: {
209
+ btnOptions: {
210
+ type: Array,
211
+ default: () => ["confirm"]
212
+ },
213
+ btnExtraText: {
214
+ type: String,
215
+ default: ""
216
+ },
217
+ buyText: {
218
+ type: String,
219
+ default: "\u7ACB\u5373\u8D2D\u4E70"
220
+ },
221
+ addCartText: {
222
+ type: String,
223
+ default: "\u52A0\u5165\u8D2D\u7269\u8F66"
224
+ },
225
+ confirmText: {
226
+ type: String,
227
+ default: "\u786E\u5B9A"
228
+ }
229
+ },
230
+ emits: ["click", "changeSku", "changeBuyCount", "clickBtnOperate"],
231
+ setup(props, { emit, slots }) {
232
+ const getBtnDesc = (type) => {
233
+ let mapD = {
234
+ confirm: props.confirmText,
235
+ cart: props.addCartText,
236
+ buy: props.buyText
237
+ };
238
+ return mapD[type];
239
+ };
240
+ const getSlots = (name) => slots[name];
241
+ const clickBtnOperate = (btn) => {
242
+ emit("clickBtnOperate", btn);
243
+ };
244
+ return {
245
+ getBtnDesc,
246
+ clickBtnOperate,
247
+ getSlots
248
+ };
249
+ }
250
+ });
251
+ const _hoisted_1$1 = {
252
+ key: 0,
253
+ class: "nut-sku-operate"
254
+ };
255
+ const _hoisted_2$1 = ["innerHTML"];
256
+ const _hoisted_3 = {
257
+ key: 1,
258
+ class: "nut-sku-operate-btn"
259
+ };
260
+ const _hoisted_4 = ["onClick"];
261
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
262
+ return _ctx.btnOptions.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_1$1, [
263
+ _ctx.btnExtraText ? (openBlock(), createElementBlock("view", {
264
+ key: 0,
265
+ class: "nut-sku-operate-desc",
266
+ innerHTML: _ctx.btnExtraText
267
+ }, null, 8, _hoisted_2$1)) : createCommentVNode("", true),
268
+ renderSlot(_ctx.$slots, "operate-btn"),
269
+ !_ctx.getSlots("operate-btn") ? (openBlock(), createElementBlock("view", _hoisted_3, [
270
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.btnOptions, (btn, i) => {
271
+ return openBlock(), createElementBlock("view", {
272
+ class: normalizeClass([`nut-sku-operate-btn-${btn}`, "nut-sku-operate-btn-item"]),
273
+ key: i,
274
+ onClick: ($event) => _ctx.clickBtnOperate(btn)
275
+ }, toDisplayString(_ctx.getBtnDesc(btn)), 11, _hoisted_4);
276
+ }), 128))
277
+ ])) : createCommentVNode("", true)
278
+ ])) : createCommentVNode("", true);
279
+ }
280
+ var SkuOperate = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
281
+ const { componentName, create, translate } = createComponent("sku");
282
+ const _sfc_main = create({
283
+ props: {
284
+ ...popupProps,
285
+ sku: {
286
+ type: Array,
287
+ default: []
288
+ },
289
+ goods: {
290
+ type: Object,
291
+ default: {}
292
+ },
293
+ stepperMax: {
294
+ type: [Number, String],
295
+ default: 99999
296
+ },
297
+ stepperMin: {
298
+ type: [Number, String],
299
+ default: 1
300
+ },
301
+ btnOptions: {
302
+ type: Array,
303
+ default: () => ["confirm"]
304
+ },
305
+ stepperTitle: {
306
+ type: String,
307
+ default: ""
308
+ },
309
+ stepperExtraText: {
310
+ type: [Function, Boolean],
311
+ default: false
312
+ },
313
+ btnExtraText: {
314
+ type: String,
315
+ default: ""
316
+ },
317
+ buyText: {
318
+ type: String,
319
+ default: ""
320
+ },
321
+ addCartText: {
322
+ type: String,
323
+ default: ""
324
+ },
325
+ confirmText: {
326
+ type: String,
327
+ default: ""
328
+ }
329
+ },
330
+ emits: [
331
+ "update:visible",
332
+ "selectSku",
333
+ "changeStepper",
334
+ "clickBtnOperate",
335
+ "clickCloseIcon",
336
+ "clickOverlay",
337
+ "close",
338
+ "reduce",
339
+ "add",
340
+ "overLimit",
341
+ "clickOverlay"
342
+ ],
343
+ components: {
344
+ SkuHeader,
345
+ SkuSelect,
346
+ SkuStepper,
347
+ SkuOperate
348
+ },
349
+ setup(props, { emit, slots }) {
350
+ const showPopup = ref(props.visible);
351
+ const goodsCount = ref(props.stepperMin);
352
+ watch(() => props.visible, (value) => {
353
+ showPopup.value = value;
354
+ });
355
+ watch(() => showPopup.value, (value) => {
356
+ if (value == false) {
357
+ close();
358
+ }
359
+ });
360
+ onMounted(() => {
361
+ });
362
+ const getSlots = (name) => slots[name];
363
+ const selectSku = (skus) => {
364
+ emit("selectSku", skus);
365
+ };
366
+ const changeStepper = (value) => {
367
+ goodsCount.value = value;
368
+ emit("changeStepper", value);
369
+ };
370
+ const add = (value) => {
371
+ emit("add", value);
372
+ };
373
+ const reduce = (value) => {
374
+ emit("reduce", value);
375
+ };
376
+ const stepperOverLimit = (count) => {
377
+ emit("overLimit", count);
378
+ };
379
+ const clickBtnOperate = (btn) => {
380
+ emit("clickBtnOperate", {
381
+ type: btn,
382
+ value: goodsCount.value
383
+ });
384
+ };
385
+ const closePopup = (type) => {
386
+ if (type == "icon") {
387
+ emit("click-close-icon");
388
+ }
389
+ if (type == "overlay") {
390
+ emit("click-overlay");
391
+ }
392
+ if (type == "close") {
393
+ emit("close");
394
+ }
395
+ showPopup.value = false;
396
+ };
397
+ const close = () => {
398
+ emit("update:visible", false);
399
+ };
400
+ return {
401
+ showPopup,
402
+ closePopup,
403
+ selectSku,
404
+ changeStepper,
405
+ stepperOverLimit,
406
+ clickBtnOperate,
407
+ add,
408
+ reduce,
409
+ getSlots,
410
+ translate
411
+ };
412
+ }
413
+ });
414
+ const _hoisted_1 = { class: "nut-sku" };
415
+ const _hoisted_2 = { class: "nut-sku-content" };
416
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
417
+ const _component_sku_header = resolveComponent("sku-header");
418
+ const _component_SkuSelect = resolveComponent("SkuSelect");
419
+ const _component_sku_stepper = resolveComponent("sku-stepper");
420
+ const _component_sku_operate = resolveComponent("sku-operate");
421
+ const _component_nut_popup = resolveComponent("nut-popup");
422
+ return openBlock(), createBlock(_component_nut_popup, {
423
+ position: "bottom",
424
+ closeable: "",
425
+ round: "",
426
+ visible: _ctx.showPopup,
427
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
428
+ onClickCloseIcon: _cache[1] || (_cache[1] = ($event) => _ctx.closePopup("icon")),
429
+ onClickOverlay: _cache[2] || (_cache[2] = ($event) => _ctx.closePopup("overlay")),
430
+ onClose: _cache[3] || (_cache[3] = ($event) => _ctx.closePopup("close")),
431
+ style: { "height": "75%" },
432
+ isWrapTeleport: _ctx.isWrapTeleport,
433
+ teleport: _ctx.teleport
434
+ }, {
435
+ default: withCtx(() => [
436
+ createElementVNode("view", _hoisted_1, [
437
+ renderSlot(_ctx.$slots, "sku-header"),
438
+ !_ctx.getSlots("sku-header") ? (openBlock(), createBlock(_component_sku_header, {
439
+ key: 0,
440
+ goods: _ctx.goods
441
+ }, createSlots({ _: 2 }, [
442
+ _ctx.getSlots("sku-header-price") ? {
443
+ name: "sku-header-price",
444
+ fn: withCtx(() => [
445
+ renderSlot(_ctx.$slots, "sku-header-price")
446
+ ])
447
+ } : void 0,
448
+ _ctx.getSlots("sku-header-extra") ? {
449
+ name: "sku-header-extra",
450
+ fn: withCtx(() => [
451
+ renderSlot(_ctx.$slots, "sku-header-extra")
452
+ ])
453
+ } : void 0
454
+ ]), 1032, ["goods"])) : createCommentVNode("", true),
455
+ createElementVNode("view", _hoisted_2, [
456
+ renderSlot(_ctx.$slots, "sku-select-top"),
457
+ renderSlot(_ctx.$slots, "sku-select"),
458
+ !_ctx.getSlots("sku-select") ? (openBlock(), createBlock(_component_SkuSelect, {
459
+ key: 0,
460
+ sku: _ctx.sku,
461
+ onSelectSku: _ctx.selectSku
462
+ }, null, 8, ["sku", "onSelectSku"])) : createCommentVNode("", true),
463
+ renderSlot(_ctx.$slots, "sku-stepper"),
464
+ !_ctx.getSlots("sku-stepper") ? (openBlock(), createBlock(_component_sku_stepper, {
465
+ key: 1,
466
+ goods: _ctx.goods,
467
+ stepperTitle: _ctx.stepperTitle || _ctx.translate("buyNumber"),
468
+ stepperMax: _ctx.stepperMax,
469
+ stepperMin: _ctx.stepperMin,
470
+ stepperExtraText: _ctx.stepperExtraText,
471
+ onAdd: _ctx.add,
472
+ onReduce: _ctx.reduce,
473
+ onChangeStepper: _ctx.changeStepper,
474
+ onOverLimit: _ctx.stepperOverLimit
475
+ }, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])) : createCommentVNode("", true),
476
+ renderSlot(_ctx.$slots, "sku-stepper-bottom")
477
+ ]),
478
+ createVNode(_component_sku_operate, {
479
+ btnOptions: _ctx.btnOptions,
480
+ btnExtraText: _ctx.btnExtraText,
481
+ buyText: _ctx.buyText || _ctx.translate("buyNow"),
482
+ addCartText: _ctx.addCartText || _ctx.translate("addToCart"),
483
+ confirmText: _ctx.confirmText || _ctx.translate("confirm"),
484
+ onClickBtnOperate: _ctx.clickBtnOperate
485
+ }, createSlots({ _: 2 }, [
486
+ _ctx.getSlots("sku-operate") ? {
487
+ name: "operate-btn",
488
+ fn: withCtx(() => [
489
+ renderSlot(_ctx.$slots, "sku-operate")
490
+ ])
491
+ } : void 0
492
+ ]), 1032, ["btnOptions", "btnExtraText", "buyText", "addCartText", "confirmText", "onClickBtnOperate"])
493
+ ])
494
+ ]),
495
+ _: 3
496
+ }, 8, ["visible", "isWrapTeleport", "teleport"]);
497
+ }
498
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
499
+ export { index as default };