@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,111 +1,499 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a2, b2) => {
9
- for (var prop in b2 || (b2 = {}))
10
- if (__hasOwnProp.call(b2, prop))
11
- __defNormalProp(a2, prop, b2[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b2)) {
14
- if (__propIsEnum.call(b2, prop))
15
- __defNormalProp(a2, prop, b2[prop]);
16
- }
17
- return a2;
18
- };
19
- var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
20
1
  /*!
21
- * @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 (中国标准时间)
22
3
  * (c) 2022 @jdf2e.
23
4
  * Released under the MIT License.
24
5
  */
25
- 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";
26
- import { c as x, T as S } from "./component.js";
27
- import { _ as y } from "./plugin-vue_export-helper.js";
28
- 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";
29
10
  import "../locale/lang";
30
11
  import "./OverLay.js";
31
12
  import "./Icon.js";
32
13
  import "./pxCheck.js";
33
- 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" };
34
- var E = y(O, [["render", function(l2, u2, i2, c2, d2, k2) {
35
- const m2 = e("nut-price");
36
- 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)])]);
37
- }]]);
38
- const { componentName: L, create: $ } = x("sku-select"), I = $({ props: { sku: { type: Array, default: () => [] } }, emits: ["selectSku"], setup(e2, { emit: t2 }) {
39
- const s2 = l([]);
40
- u(() => e2.sku, (e3) => {
41
- s2.value = [].slice.call(e3);
42
- }, { deep: true }), i(() => {
43
- e2.sku.length > 0 && (s2.value = [].slice.call(e2.sku));
44
- });
45
- return { skuInfo: s2, changeSaleChild: (e3, s3, r2, n2) => {
46
- e3.checkFlag || e3.disable || t2("selectSku", { sku: e3, skuIndex: s3, parentSku: r2, parentIndex: n2 });
47
- } };
48
- } }), N = { class: "nut-sku-select" }, P = { class: "nut-sku-select-item-title" }, j = { class: "nut-sku-select-item-skus" }, A = ["onClick"];
49
- var H = y(I, [["render", function(e2, n2, a2, o2, l2, u2) {
50
- 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))]);
51
- }]]);
52
- 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 }) {
53
- const s2 = l(e2.stepperMin);
54
- i(() => {
55
- s2.value = e2.stepperMin;
56
- });
57
- return { goodsCount: s2, add: (e3) => {
58
- t2("add", e3);
59
- }, reduce: (e3) => {
60
- t2("reduce", e3);
61
- }, overlimit: (e3, r2) => {
62
- t2("overLimit", { action: r2, value: parseInt(s2.value + "") });
63
- }, getExtraText: () => {
64
- const { stepperExtraText: t3 } = e2;
65
- return t3 && S(t3) == "function" ? t3() : "";
66
- }, changeStepper: (e3) => {
67
- s2.value = e3, t2("changeStepper", e3);
68
- } };
69
- } }), V = { class: "nut-sku-stepper" }, W = { class: "nut-sku-stepper-title" }, D = ["innerHTML"], U = { class: "nut-sku-stepper-count" };
70
- var q = y(F, [["render", function(n2, a2, o2, l2, u2, i2) {
71
- const c2 = e("nut-inputnumber");
72
- 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"])])]);
73
- }]]);
74
- 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) => {
75
- t2("clickBtnOperate", e3);
76
- }, getSlots: (e3) => s2[e3] }) }), K = { key: 0, class: "nut-sku-operate" }, Q = ["innerHTML"], X = { key: 1, class: "nut-sku-operate-btn" }, Y = ["onClick"];
77
- var Z = y(J, [["render", function(e2, r2, a2, l2, u2, i2) {
78
- 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);
79
- }]]);
80
- const { componentName: ee, create: te, translate: se } = x("sku"), re = te({ props: __spreadProps(__spreadValues({}, 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 }) {
81
- const r2 = l(e2.visible), n2 = l(e2.stepperMin);
82
- u(() => e2.visible, (e3) => {
83
- r2.value = e3;
84
- }), u(() => r2.value, (e3) => {
85
- e3 == 0 && a2();
86
- }), i(() => {
87
- });
88
- const a2 = () => {
89
- t2("update:visible", false);
90
- };
91
- return { showPopup: r2, closePopup: (e3) => {
92
- e3 == "icon" && t2("click-close-icon"), e3 == "overlay" && t2("click-overlay"), e3 == "close" && t2("close"), r2.value = false;
93
- }, selectSku: (e3) => {
94
- t2("selectSku", e3);
95
- }, changeStepper: (e3) => {
96
- n2.value = e3, t2("changeStepper", e3);
97
- }, stepperOverLimit: (e3) => {
98
- t2("overLimit", e3);
99
- }, clickBtnOperate: (e3) => {
100
- t2("clickBtnOperate", { type: e3, value: n2.value });
101
- }, add: (e3) => {
102
- t2("add", e3);
103
- }, reduce: (e3) => {
104
- t2("reduce", e3);
105
- }, getSlots: (e3) => s2[e3], translate: se };
106
- } }), ne = { class: "nut-sku" }, ae = { class: "nut-sku-content" };
107
- var oe = y(re, [["render", function(s2, p2, l2, u2, i2, c2) {
108
- const d2 = e("sku-header"), k2 = e("SkuSelect"), x2 = e("sku-stepper"), S2 = e("sku-operate"), y2 = e("nut-popup");
109
- 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"]);
110
- }]]);
111
- 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 };