@nutui/nutui 4.0.12-beta.1 → 4.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +1 -1
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +111 -78
  5. package/dist/packages/_es/Address.js +375 -250
  6. package/dist/packages/_es/AddressList.js +354 -269
  7. package/dist/packages/_es/Animate.js +58 -41
  8. package/dist/packages/_es/Audio.js +197 -128
  9. package/dist/packages/_es/AudioOperate.js +71 -60
  10. package/dist/packages/_es/Avatar.js +89 -66
  11. package/dist/packages/_es/AvatarGroup.js +31 -23
  12. package/dist/packages/_es/Backtop.js +99 -59
  13. package/dist/packages/_es/Badge.js +47 -36
  14. package/dist/packages/_es/Barrage.js +147 -68
  15. package/dist/packages/_es/Button.js +66 -47
  16. package/dist/packages/_es/Calendar.js +157 -135
  17. package/dist/packages/_es/CalendarItem.js +6 -6
  18. package/dist/packages/_es/Card.js +56 -42
  19. package/dist/packages/_es/Cascader.js +474 -315
  20. package/dist/packages/_es/Category.js +39 -29
  21. package/dist/packages/_es/CategoryPane.js +83 -57
  22. package/dist/packages/_es/Cell.js +71 -56
  23. package/dist/packages/_es/CellGroup.js +27 -19
  24. package/dist/packages/_es/Checkbox.js +156 -109
  25. package/dist/packages/_es/CheckboxGroup.js +59 -38
  26. package/dist/packages/_es/CircleProgress.js +96 -67
  27. package/dist/packages/_es/Col.js +31 -23
  28. package/dist/packages/_es/Collapse.js +58 -33
  29. package/dist/packages/_es/CollapseItem.js +108 -78
  30. package/dist/packages/_es/Comment.js +279 -207
  31. package/dist/packages/_es/ConfigProvider.js +55 -37
  32. package/dist/packages/_es/Countdown.js +212 -100
  33. package/dist/packages/_es/Countup.js +445 -232
  34. package/dist/packages/_es/DatePicker.js +265 -162
  35. package/dist/packages/_es/Dialog.js +213 -161
  36. package/dist/packages/_es/Divider.js +57 -42
  37. package/dist/packages/_es/Drag.js +153 -70
  38. package/dist/packages/_es/Ecard.js +104 -64
  39. package/dist/packages/_es/Elevator.js +219 -143
  40. package/dist/packages/_es/Ellipsis.js +178 -95
  41. package/dist/packages/_es/Empty.js +39 -23
  42. package/dist/packages/_es/FixedNav.js +116 -93
  43. package/dist/packages/_es/Form.js +178 -107
  44. package/dist/packages/_es/FormItem.js +61 -48
  45. package/dist/packages/_es/Grid.js +6 -5
  46. package/dist/packages/_es/GridItem.js +84 -58
  47. package/dist/packages/_es/Image.js +130 -90
  48. package/dist/packages/_es/ImagePreview.js +412 -256
  49. package/dist/packages/_es/Indicator.js +34 -30
  50. package/dist/packages/_es/InfiniteLoading.js +136 -83
  51. package/dist/packages/_es/Input.js +264 -160
  52. package/dist/packages/_es/InputNumber.js +117 -81
  53. package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
  54. package/dist/packages/_es/Invoice.js +130 -104
  55. package/dist/packages/_es/Layout.js +4 -3
  56. package/dist/packages/_es/List.js +215 -117
  57. package/dist/packages/_es/Menu.js +150 -95
  58. package/dist/packages/_es/MenuItem.js +154 -109
  59. package/dist/packages/_es/Navbar.js +119 -103
  60. package/dist/packages/_es/Noticebar.js +312 -197
  61. package/dist/packages/_es/Notify.js +166 -110
  62. package/dist/packages/_es/NumberKeyboard.js +202 -127
  63. package/dist/packages/_es/Overlay.js +80 -52
  64. package/dist/packages/_es/Pagination.js +100 -70
  65. package/dist/packages/_es/Picker.js +437 -275
  66. package/dist/packages/_es/Popover.js +225 -122
  67. package/dist/packages/_es/Popup.js +4 -4
  68. package/dist/packages/_es/Price.js +82 -44
  69. package/dist/packages/_es/Progress.js +79 -63
  70. package/dist/packages/_es/PullRefresh.js +173 -95
  71. package/dist/packages/_es/Radio.js +4 -4
  72. package/dist/packages/_es/RadioGroup.js +3 -3
  73. package/dist/packages/_es/Range.js +347 -204
  74. package/dist/packages/_es/Rate.js +141 -92
  75. package/dist/packages/_es/Row.js +27 -21
  76. package/dist/packages/_es/Searchbar.js +174 -123
  77. package/dist/packages/_es/ShortPassword.js +93 -69
  78. package/dist/packages/_es/SideNavbar.js +80 -49
  79. package/dist/packages/_es/SideNavbarItem.js +32 -22
  80. package/dist/packages/_es/Signature.js +146 -83
  81. package/dist/packages/_es/Skeleton.js +130 -110
  82. package/dist/packages/_es/Sku.js +343 -250
  83. package/dist/packages/_es/Step.js +86 -59
  84. package/dist/packages/_es/Steps.js +31 -26
  85. package/dist/packages/_es/Sticky.js +4 -4
  86. package/dist/packages/_es/SubSideNavbar.js +74 -52
  87. package/dist/packages/_es/Swipe.js +155 -83
  88. package/dist/packages/_es/Swiper.js +311 -174
  89. package/dist/packages/_es/SwiperItem.js +44 -28
  90. package/dist/packages/_es/Switch.js +68 -55
  91. package/dist/packages/_es/TabPane.js +41 -30
  92. package/dist/packages/_es/Tabbar.js +52 -41
  93. package/dist/packages/_es/TabbarItem.js +82 -61
  94. package/dist/packages/_es/Table.js +165 -109
  95. package/dist/packages/_es/Tabs.js +388 -240
  96. package/dist/packages/_es/Tag.js +61 -44
  97. package/dist/packages/_es/Textarea.js +124 -80
  98. package/dist/packages/_es/TimeDetail.js +76 -49
  99. package/dist/packages/_es/TimePannel.js +48 -34
  100. package/dist/packages/_es/TimeSelect.js +68 -47
  101. package/dist/packages/_es/Toast.js +218 -144
  102. package/dist/packages/_es/Tour.js +192 -138
  103. package/dist/packages/_es/TrendArrow.js +77 -57
  104. package/dist/packages/_es/Uploader.js +359 -234
  105. package/dist/packages/_es/Video.js +316 -191
  106. package/dist/packages/_es/Watermark.js +117 -84
  107. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
  108. package/dist/packages/_es/common-b9a5e726.js +145 -0
  109. package/dist/packages/_es/component-81a4c1d0.js +145 -0
  110. package/dist/packages/_es/index-29892cda.js +33 -0
  111. package/dist/packages/_es/index-43c34ac6.js +30 -0
  112. package/dist/packages/_es/index-54d03fc1.js +8 -0
  113. package/dist/packages/_es/index-79c5dc33.js +10 -0
  114. package/dist/packages/_es/index-7a7385e4.js +67 -0
  115. package/dist/packages/_es/index-87422be8.js +942 -0
  116. package/dist/packages/_es/index-da0a7662.js +259 -0
  117. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
  120. package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
  121. package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
  122. package/dist/packages/_es/raf-729dad54.js +25 -0
  123. package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
  124. package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
  125. package/dist/packages/locale/lang/en-US.js +39 -36
  126. package/dist/packages/locale/lang/id-ID.js +39 -36
  127. package/dist/packages/locale/lang/index.js +44 -22
  128. package/dist/packages/locale/lang/zh-CN.js +38 -35
  129. package/dist/packages/locale/lang/zh-TW.js +38 -35
  130. package/dist/resolver/index.js +26 -1
  131. package/dist/resolver/index.mjs +17 -14
  132. package/dist/smartips/web-types.json +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/styles/themes/default.scss +50 -50
  135. package/dist/styles/themes/jdb.scss +50 -50
  136. package/dist/styles/themes/jddkh.scss +50 -50
  137. package/dist/styles/themes/jdt.scss +50 -50
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +2 -2
  140. package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
  141. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
  142. package/dist/packages/_es/common-d218746f.js +0 -116
  143. package/dist/packages/_es/component-234624bc.js +0 -89
  144. package/dist/packages/_es/index-14dfadc4.js +0 -561
  145. package/dist/packages/_es/index-192a3ef6.js +0 -29
  146. package/dist/packages/_es/index-360c5092.js +0 -210
  147. package/dist/packages/_es/index-496e6e05.js +0 -24
  148. package/dist/packages/_es/index-50eed3d9.js +0 -7
  149. package/dist/packages/_es/index-53ec2d4d.js +0 -34
  150. package/dist/packages/_es/index-fadb0974.js +0 -8
  151. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
  152. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
  153. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
  154. package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
  155. package/dist/packages/_es/pxCheck-38173291.js +0 -4
  156. package/dist/packages/_es/raf-a74f1a06.js +0 -16
  157. package/dist/packages/_es/renderIcon-47498b32.js +0 -5
  158. package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
@@ -1,26 +1,34 @@
1
- var H = Object.defineProperty, j = Object.defineProperties;
2
- var U = Object.getOwnPropertyDescriptors;
3
- var E = Object.getOwnPropertySymbols;
4
- var z = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
5
- var M = (e, t, s) => t in e ? H(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, P = (e, t) => {
6
- for (var s in t || (t = {}))
7
- z.call(t, s) && M(e, s, t[s]);
8
- if (E)
9
- for (var s of E(t))
10
- q.call(t, s) && M(e, s, t[s]);
11
- return e;
12
- }, _ = (e, t) => j(e, U(t));
13
- import { resolveComponent as f, openBlock as a, createElementBlock as i, createElementVNode as k, renderSlot as c, createBlock as S, createCommentVNode as m, toDisplayString as h, ref as C, watch as O, onMounted as N, Fragment as w, renderList as B, normalizeClass as A, createVNode as F, withCtx as T, createSlots as D } from "vue";
14
- import L from "./Price.js";
15
- import { c as v, T as G } from "./component-234624bc.js";
16
- import { _ as y } from "./_plugin-vue_export-helper-dad06003.js";
17
- import I from "./InputNumber.js";
18
- import { p as J, P as V } from "./index-360c5092.js";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, createCommentVNode, toDisplayString, ref, watch, onMounted, Fragment, renderList, normalizeClass, createVNode, withCtx, createSlots } from "vue";
21
+ import Price from "./Price.js";
22
+ import { c as createComponent, T as TypeOfFun } from "./component-81a4c1d0.js";
23
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
24
+ import InputNumber from "./InputNumber.js";
25
+ import { p as popupProps, P as Popup } from "./index-da0a7662.js";
19
26
  import "../locale/lang";
20
- import "./pxCheck-38173291.js";
27
+ import "./pxCheck-c6b9f6b7.js";
21
28
  import "@nutui/icons-vue";
22
29
  import "./Overlay.js";
23
- const { componentName: ze, create: K, translate: Q } = v("sku-header"), W = K({
30
+ const { componentName: componentName$4, create: create$4, translate: translate$1 } = createComponent("sku-header");
31
+ const _sfc_main$4 = create$4({
24
32
  props: {
25
33
  goods: {
26
34
  type: Object,
@@ -29,38 +37,45 @@ const { componentName: ze, create: K, translate: Q } = v("sku-header"), W = K({
29
37
  },
30
38
  emits: [],
31
39
  components: {
32
- [L.name]: L
40
+ [Price.name]: Price
33
41
  },
34
- setup(e, { emit: t, slots: s }) {
42
+ setup(props, { emit, slots }) {
43
+ const getSlots = (name) => slots[name];
35
44
  return {
36
- getSlots: (p) => s[p],
37
- translate: Q
45
+ getSlots,
46
+ translate: translate$1
38
47
  };
39
48
  }
40
- }), X = { class: "nut-sku-header" }, Y = ["src"], Z = { class: "nut-sku-header-right" }, ee = {
49
+ });
50
+ const _hoisted_1$4 = { class: "nut-sku-header" };
51
+ const _hoisted_2$4 = ["src"];
52
+ const _hoisted_3$3 = { class: "nut-sku-header-right" };
53
+ const _hoisted_4$3 = {
41
54
  key: 3,
42
55
  class: "nut-sku-header-right-extra"
43
56
  };
44
- function te(e, t, s, u, p, d) {
45
- const n = f("nut-price");
46
- return a(), i("view", X, [
47
- k("img", {
57
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
58
+ const _component_nut_price = resolveComponent("nut-price");
59
+ return openBlock(), createElementBlock("view", _hoisted_1$4, [
60
+ createElementVNode("img", {
48
61
  class: "nut-sku-header-img",
49
- src: e.goods.imagePath
50
- }, null, 8, Y),
51
- k("view", Z, [
52
- e.getSlots("sku-header-price") ? c(e.$slots, "sku-header-price", { key: 0 }) : (a(), S(n, {
62
+ src: _ctx.goods.imagePath
63
+ }, null, 8, _hoisted_2$4),
64
+ createElementVNode("view", _hoisted_3$3, [
65
+ _ctx.getSlots("sku-header-price") ? renderSlot(_ctx.$slots, "sku-header-price", { key: 0 }) : (openBlock(), createBlock(_component_nut_price, {
53
66
  key: 1,
54
- price: e.goods.price,
55
- needSymbol: !0,
56
- thousands: !1
67
+ price: _ctx.goods.price,
68
+ needSymbol: true,
69
+ thousands: false
57
70
  }, null, 8, ["price"])),
58
- e.getSlots("sku-header-extra") ? c(e.$slots, "sku-header-extra", { key: 2 }) : m("", !0),
59
- e.goods.skuId && !e.getSlots("sku-header-extra") ? (a(), i("view", ee, h(e.translate("skuId")) + " : " + h(e.goods.skuId), 1)) : m("", !0)
71
+ _ctx.getSlots("sku-header-extra") ? renderSlot(_ctx.$slots, "sku-header-extra", { key: 2 }) : createCommentVNode("", true),
72
+ _ctx.goods.skuId && !_ctx.getSlots("sku-header-extra") ? (openBlock(), createElementBlock("view", _hoisted_4$3, toDisplayString(_ctx.translate("skuId")) + " : " + toDisplayString(_ctx.goods.skuId), 1)) : createCommentVNode("", true)
60
73
  ])
61
74
  ]);
62
75
  }
63
- const se = /* @__PURE__ */ y(W, [["render", te]]), { componentName: qe, create: ne } = v("sku-select"), oe = ne({
76
+ const SkuHeader = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
77
+ const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
78
+ const _sfc_main$3 = create$3({
64
79
  props: {
65
80
  sku: {
66
81
  type: Array,
@@ -68,47 +83,65 @@ const se = /* @__PURE__ */ y(W, [["render", te]]), { componentName: qe, create:
68
83
  }
69
84
  },
70
85
  emits: ["selectSku"],
71
- setup(e, { emit: t }) {
72
- const s = C([]);
73
- return O(
74
- () => e.sku,
75
- (p) => {
76
- s.value = [].slice.call(p);
86
+ setup(props, { emit }) {
87
+ const skuInfo = ref([]);
88
+ watch(
89
+ () => props.sku,
90
+ (value) => {
91
+ skuInfo.value = [].slice.call(value);
77
92
  },
78
- { deep: !0 }
79
- ), N(() => {
80
- e.sku.length > 0 && (s.value = [].slice.call(e.sku));
81
- }), {
82
- skuInfo: s,
83
- changeSaleChild: (p, d, n, l) => {
84
- p.checkFlag || p.disable || t("selectSku", {
85
- sku: p,
86
- skuIndex: d,
87
- parentSku: n,
88
- parentIndex: l
89
- });
93
+ { deep: true }
94
+ );
95
+ onMounted(() => {
96
+ if (props.sku.length > 0) {
97
+ skuInfo.value = [].slice.call(props.sku);
90
98
  }
99
+ });
100
+ const changeSaleChild = (attrItem, index2, parentItem, parentIndex) => {
101
+ if (attrItem.checkFlag || attrItem.disable) {
102
+ return;
103
+ }
104
+ emit("selectSku", {
105
+ sku: attrItem,
106
+ skuIndex: index2,
107
+ parentSku: parentItem,
108
+ parentIndex
109
+ });
110
+ };
111
+ return {
112
+ skuInfo,
113
+ changeSaleChild
91
114
  };
92
115
  }
93
- }), re = { class: "nut-sku-select" }, ae = { class: "nut-sku-select-item-title" }, pe = { class: "nut-sku-select-item-skus" }, ue = ["onClick"];
94
- function le(e, t, s, u, p, d) {
95
- return a(), i("view", re, [
96
- (a(!0), i(w, null, B(e.skuInfo, (n, l) => (a(), i("view", {
97
- class: "nut-sku-select-item",
98
- key: n.id
99
- }, [
100
- k("view", ae, h(n.name), 1),
101
- k("view", pe, [
102
- (a(!0), i(w, null, B(n.list, (o, g) => (a(), i("view", {
103
- class: A(["nut-sku-select-item-skus-sku", [{ active: !o.disable && o.active }, { disable: o.disable }]]),
104
- onClick: (b) => e.changeSaleChild(o, g, n, l),
105
- key: o.name
106
- }, h(o.name), 11, ue))), 128))
107
- ])
108
- ]))), 128))
116
+ });
117
+ const _hoisted_1$3 = { class: "nut-sku-select" };
118
+ const _hoisted_2$3 = { class: "nut-sku-select-item-title" };
119
+ const _hoisted_3$2 = { class: "nut-sku-select-item-skus" };
120
+ const _hoisted_4$2 = ["onClick"];
121
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
122
+ return openBlock(), createElementBlock("view", _hoisted_1$3, [
123
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item, index2) => {
124
+ return openBlock(), createElementBlock("view", {
125
+ class: "nut-sku-select-item",
126
+ key: item.id
127
+ }, [
128
+ createElementVNode("view", _hoisted_2$3, toDisplayString(item.name), 1),
129
+ createElementVNode("view", _hoisted_3$2, [
130
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (itemAttr, itemAttrIndex) => {
131
+ return openBlock(), createElementBlock("view", {
132
+ class: normalizeClass(["nut-sku-select-item-skus-sku", [{ active: !itemAttr.disable && itemAttr.active }, { disable: itemAttr.disable }]]),
133
+ onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item, index2),
134
+ key: itemAttr.name
135
+ }, toDisplayString(itemAttr.name), 11, _hoisted_4$2);
136
+ }), 128))
137
+ ])
138
+ ]);
139
+ }), 128))
109
140
  ]);
110
141
  }
111
- const ie = /* @__PURE__ */ y(oe, [["render", le]]), { componentName: Ge, create: ce } = v("sku-stepper"), de = ce({
142
+ const SkuSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
143
+ const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
144
+ const _sfc_main$2 = create$2({
112
145
  props: {
113
146
  // 购买数量最大值
114
147
  stepperMax: {
@@ -122,7 +155,7 @@ const ie = /* @__PURE__ */ y(oe, [["render", le]]), { componentName: Ge, create:
122
155
  // stepper 前文案提示
123
156
  stepperExtraText: {
124
157
  type: [Function, Boolean],
125
- default: !1
158
+ default: false
126
159
  },
127
160
  // 数量选择左侧文案
128
161
  stepperTitle: {
@@ -132,59 +165,76 @@ const ie = /* @__PURE__ */ y(oe, [["render", le]]), { componentName: Ge, create:
132
165
  },
133
166
  emits: ["click", "changeSku", "changeStepper", "clickBtnOptions", "overLimit", "reduce", "add"],
134
167
  components: {
135
- [I.name]: I
168
+ [InputNumber.name]: InputNumber
136
169
  },
137
- setup(e, { emit: t }) {
138
- const s = C(e.stepperMin);
139
- return N(() => {
140
- s.value = e.stepperMin;
141
- }), {
142
- goodsCount: s,
143
- add: (o) => {
144
- t("add", o);
145
- },
146
- reduce: (o) => {
147
- t("reduce", o);
148
- },
149
- overlimit: (o, g) => {
150
- t("overLimit", {
151
- action: g,
152
- value: parseInt(s.value + "")
153
- });
154
- },
155
- getExtraText: () => {
156
- const { stepperExtraText: o } = e;
157
- return o && G(o) == "function" ? o() : "";
158
- },
159
- changeStepper: (o) => {
160
- s.value = o, t("changeStepper", o);
170
+ setup(props, { emit }) {
171
+ const goodsCount = ref(props.stepperMin);
172
+ onMounted(() => {
173
+ goodsCount.value = props.stepperMin;
174
+ });
175
+ const getExtraText = () => {
176
+ const { stepperExtraText } = props;
177
+ if (stepperExtraText && TypeOfFun(stepperExtraText) == "function") {
178
+ return stepperExtraText();
179
+ } else {
180
+ return "";
161
181
  }
162
182
  };
183
+ const add = (value) => {
184
+ emit("add", value);
185
+ };
186
+ const reduce = (value) => {
187
+ emit("reduce", value);
188
+ };
189
+ const overlimit = (e, action) => {
190
+ emit("overLimit", {
191
+ action,
192
+ value: parseInt(goodsCount.value + "")
193
+ });
194
+ };
195
+ const changeStepper = (value) => {
196
+ goodsCount.value = value;
197
+ emit("changeStepper", value);
198
+ };
199
+ return {
200
+ goodsCount,
201
+ add,
202
+ reduce,
203
+ overlimit,
204
+ getExtraText,
205
+ changeStepper
206
+ };
163
207
  }
164
- }), ke = { class: "nut-sku-stepper" }, me = { class: "nut-sku-stepper-title" }, ge = ["innerHTML"], fe = { class: "nut-sku-stepper-count" };
165
- function he(e, t, s, u, p, d) {
166
- const n = f("nut-input-number");
167
- return a(), i("view", ke, [
168
- k("view", me, h(e.stepperTitle), 1),
169
- k("view", {
208
+ });
209
+ const _hoisted_1$2 = { class: "nut-sku-stepper" };
210
+ const _hoisted_2$2 = { class: "nut-sku-stepper-title" };
211
+ const _hoisted_3$1 = ["innerHTML"];
212
+ const _hoisted_4$1 = { class: "nut-sku-stepper-count" };
213
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
214
+ const _component_nut_input_number = resolveComponent("nut-input-number");
215
+ return openBlock(), createElementBlock("view", _hoisted_1$2, [
216
+ createElementVNode("view", _hoisted_2$2, toDisplayString(_ctx.stepperTitle), 1),
217
+ createElementVNode("view", {
170
218
  class: "nut-sku-stepper-limit",
171
- innerHTML: e.getExtraText()
172
- }, null, 8, ge),
173
- k("view", fe, [
174
- F(n, {
175
- modelValue: e.goodsCount,
176
- "onUpdate:modelValue": t[0] || (t[0] = (l) => e.goodsCount = l),
177
- min: e.stepperMin,
178
- max: e.stepperMax,
179
- onAdd: e.add,
180
- onReduce: e.reduce,
181
- onOverlimit: e.overlimit,
182
- onChange: e.changeStepper
219
+ innerHTML: _ctx.getExtraText()
220
+ }, null, 8, _hoisted_3$1),
221
+ createElementVNode("view", _hoisted_4$1, [
222
+ createVNode(_component_nut_input_number, {
223
+ modelValue: _ctx.goodsCount,
224
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.goodsCount = $event),
225
+ min: _ctx.stepperMin,
226
+ max: _ctx.stepperMax,
227
+ onAdd: _ctx.add,
228
+ onReduce: _ctx.reduce,
229
+ onOverlimit: _ctx.overlimit,
230
+ onChange: _ctx.changeStepper
183
231
  }, null, 8, ["modelValue", "min", "max", "onAdd", "onReduce", "onOverlimit", "onChange"])
184
232
  ])
185
233
  ]);
186
234
  }
187
- const $e = /* @__PURE__ */ y(de, [["render", he]]), { componentName: Je, create: Se } = v("sku-operate"), ve = Se({
235
+ const SkuStepper = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
236
+ const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
237
+ const _sfc_main$1 = create$1({
188
238
  props: {
189
239
  // 底部按钮配置 confirm cart buy
190
240
  btnOptions: {
@@ -211,44 +261,58 @@ const $e = /* @__PURE__ */ y(de, [["render", he]]), { componentName: Je, create:
211
261
  }
212
262
  },
213
263
  emits: ["click", "changeSku", "changeBuyCount", "clickBtnOperate"],
214
- setup(e, { emit: t, slots: s }) {
264
+ setup(props, { emit, slots }) {
265
+ const getBtnDesc = (type) => {
266
+ let mapD = {
267
+ confirm: props.confirmText,
268
+ cart: props.addCartText,
269
+ buy: props.buyText
270
+ };
271
+ return mapD[type];
272
+ };
273
+ const getSlots = (name) => slots[name];
274
+ const clickBtnOperate = (btn) => {
275
+ emit("clickBtnOperate", btn);
276
+ };
215
277
  return {
216
- getBtnDesc: (n) => ({
217
- confirm: e.confirmText,
218
- cart: e.addCartText,
219
- buy: e.buyText
220
- })[n],
221
- clickBtnOperate: (n) => {
222
- t("clickBtnOperate", n);
223
- },
224
- getSlots: (n) => s[n]
278
+ getBtnDesc,
279
+ clickBtnOperate,
280
+ getSlots
225
281
  };
226
282
  }
227
- }), ye = {
283
+ });
284
+ const _hoisted_1$1 = {
228
285
  key: 0,
229
286
  class: "nut-sku-operate"
230
- }, be = {
287
+ };
288
+ const _hoisted_2$1 = {
231
289
  key: 0,
232
290
  class: "nut-sku-operate-desc"
233
- }, Te = {
291
+ };
292
+ const _hoisted_3 = {
234
293
  key: 1,
235
294
  class: "nut-sku-operate-btn"
236
- }, Ce = ["onClick"];
237
- function Oe(e, t, s, u, p, d) {
238
- return e.btnOptions.length > 0 ? (a(), i("view", ye, [
239
- e.btnExtraText ? (a(), i("view", be, h(e.btnExtraText), 1)) : m("", !0),
240
- c(e.$slots, "operate-btn"),
241
- e.getSlots("operate-btn") ? m("", !0) : (a(), i("view", Te, [
242
- (a(!0), i(w, null, B(e.btnOptions, (n, l) => (a(), i("view", {
243
- class: A([`nut-sku-operate-btn-${n}`, "nut-sku-operate-btn-item"]),
244
- key: l,
245
- onClick: (o) => e.clickBtnOperate(n)
246
- }, h(e.getBtnDesc(n)), 11, Ce))), 128))
247
- ]))
248
- ])) : m("", !0);
295
+ };
296
+ const _hoisted_4 = ["onClick"];
297
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
298
+ return _ctx.btnOptions.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_1$1, [
299
+ _ctx.btnExtraText ? (openBlock(), createElementBlock("view", _hoisted_2$1, toDisplayString(_ctx.btnExtraText), 1)) : createCommentVNode("", true),
300
+ renderSlot(_ctx.$slots, "operate-btn"),
301
+ !_ctx.getSlots("operate-btn") ? (openBlock(), createElementBlock("view", _hoisted_3, [
302
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.btnOptions, (btn, i) => {
303
+ return openBlock(), createElementBlock("view", {
304
+ class: normalizeClass([`nut-sku-operate-btn-${btn}`, "nut-sku-operate-btn-item"]),
305
+ key: i,
306
+ onClick: ($event) => _ctx.clickBtnOperate(btn)
307
+ }, toDisplayString(_ctx.getBtnDesc(btn)), 11, _hoisted_4);
308
+ }), 128))
309
+ ])) : createCommentVNode("", true)
310
+ ])) : createCommentVNode("", true);
249
311
  }
250
- const we = /* @__PURE__ */ y(ve, [["render", Oe]]), { componentName: Ke, create: Be, translate: Ne } = v("sku"), Ee = Be({
251
- props: _(P({}, J), {
312
+ const SkuOperate = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
313
+ const { componentName, create, translate } = createComponent("sku");
314
+ const _sfc_main = create({
315
+ props: __spreadProps(__spreadValues({}, popupProps), {
252
316
  sku: {
253
317
  type: Array,
254
318
  default: []
@@ -280,7 +344,7 @@ const we = /* @__PURE__ */ y(ve, [["render", Oe]]), { componentName: Ke, create:
280
344
  // stepper 前面文案
281
345
  stepperExtraText: {
282
346
  type: [Function, Boolean],
283
- default: !1
347
+ default: false
284
348
  },
285
349
  btnExtraText: {
286
350
  type: String,
@@ -315,132 +379,161 @@ const we = /* @__PURE__ */ y(ve, [["render", Oe]]), { componentName: Ke, create:
315
379
  "over-limit"
316
380
  ],
317
381
  components: {
318
- SkuHeader: se,
319
- SkuSelect: ie,
320
- SkuStepper: $e,
321
- SkuOperate: we,
322
- [V.name]: V
382
+ SkuHeader,
383
+ SkuSelect,
384
+ SkuStepper,
385
+ SkuOperate,
386
+ [Popup.name]: Popup
323
387
  },
324
- setup(e, { emit: t, slots: s }) {
325
- const u = C(e.visible), p = C(e.stepperMin);
326
- O(
327
- () => e.visible,
328
- (r) => {
329
- u.value = r;
388
+ setup(props, { emit, slots }) {
389
+ const showPopup = ref(props.visible);
390
+ const goodsCount = ref(props.stepperMin);
391
+ watch(
392
+ () => props.visible,
393
+ (value) => {
394
+ showPopup.value = value;
330
395
  }
331
- ), O(
332
- () => u.value,
333
- (r) => {
334
- r == !1 && R();
396
+ );
397
+ watch(
398
+ () => showPopup.value,
399
+ (value) => {
400
+ if (value == false) {
401
+ close();
402
+ }
335
403
  }
336
- ), N(() => {
404
+ );
405
+ onMounted(() => {
337
406
  });
338
- const d = (r) => s[r], n = (r) => {
339
- t("select-sku", r);
340
- }, l = (r) => {
341
- p.value = r, t("change-stepper", r);
342
- }, o = (r) => {
343
- t("add", r);
344
- }, g = (r) => {
345
- t("reduce", r);
346
- }, b = (r) => {
347
- t("over-limit", r);
348
- }, $ = (r) => {
349
- t("click-btn-operate", {
350
- type: r,
351
- value: p.value
407
+ const getSlots = (name) => slots[name];
408
+ const selectSku = (skus) => {
409
+ emit("select-sku", skus);
410
+ };
411
+ const changeStepper = (value) => {
412
+ goodsCount.value = value;
413
+ emit("change-stepper", value);
414
+ };
415
+ const add = (value) => {
416
+ emit("add", value);
417
+ };
418
+ const reduce = (value) => {
419
+ emit("reduce", value);
420
+ };
421
+ const stepperOverLimit = (count) => {
422
+ emit("over-limit", count);
423
+ };
424
+ const clickBtnOperate = (btn) => {
425
+ emit("click-btn-operate", {
426
+ type: btn,
427
+ value: goodsCount.value
352
428
  });
353
- }, x = (r) => {
354
- r == "icon" && t("click-close-icon"), r == "overlay" && t("click-overlay"), r == "close" && t("close"), u.value = !1;
355
- }, R = () => {
356
- t("update:visible", !1);
429
+ };
430
+ const closePopup = (type) => {
431
+ if (type == "icon") {
432
+ emit("click-close-icon");
433
+ }
434
+ if (type == "overlay") {
435
+ emit("click-overlay");
436
+ }
437
+ if (type == "close") {
438
+ emit("close");
439
+ }
440
+ showPopup.value = false;
441
+ };
442
+ const close = () => {
443
+ emit("update:visible", false);
357
444
  };
358
445
  return {
359
- showPopup: u,
360
- closePopup: x,
361
- selectSku: n,
362
- changeStepper: l,
363
- stepperOverLimit: b,
364
- clickBtnOperate: $,
365
- add: o,
366
- reduce: g,
367
- getSlots: d,
368
- translate: Ne
446
+ showPopup,
447
+ closePopup,
448
+ selectSku,
449
+ changeStepper,
450
+ stepperOverLimit,
451
+ clickBtnOperate,
452
+ add,
453
+ reduce,
454
+ getSlots,
455
+ translate
369
456
  };
370
457
  }
371
- }), Me = { class: "nut-sku" }, Pe = { class: "nut-sku-content" };
372
- function _e(e, t, s, u, p, d) {
373
- const n = f("sku-header"), l = f("SkuSelect"), o = f("sku-stepper"), g = f("sku-operate"), b = f("nut-popup");
374
- return a(), S(b, {
458
+ });
459
+ const _hoisted_1 = { class: "nut-sku" };
460
+ const _hoisted_2 = { class: "nut-sku-content" };
461
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
462
+ const _component_sku_header = resolveComponent("sku-header");
463
+ const _component_SkuSelect = resolveComponent("SkuSelect");
464
+ const _component_sku_stepper = resolveComponent("sku-stepper");
465
+ const _component_sku_operate = resolveComponent("sku-operate");
466
+ const _component_nut_popup = resolveComponent("nut-popup");
467
+ return openBlock(), createBlock(_component_nut_popup, {
375
468
  position: "bottom",
376
469
  closeable: "",
377
470
  round: "",
378
- visible: e.showPopup,
379
- "onUpdate:visible": t[0] || (t[0] = ($) => e.showPopup = $),
380
- onClickCloseIcon: t[1] || (t[1] = ($) => e.closePopup("icon")),
381
- onClickOverlay: t[2] || (t[2] = ($) => e.closePopup("overlay")),
382
- onClose: t[3] || (t[3] = ($) => e.closePopup("close")),
383
- style: { height: "75%" },
384
- teleportDisable: e.teleportDisable,
385
- teleport: e.teleport
471
+ visible: _ctx.showPopup,
472
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
473
+ onClickCloseIcon: _cache[1] || (_cache[1] = ($event) => _ctx.closePopup("icon")),
474
+ onClickOverlay: _cache[2] || (_cache[2] = ($event) => _ctx.closePopup("overlay")),
475
+ onClose: _cache[3] || (_cache[3] = ($event) => _ctx.closePopup("close")),
476
+ style: { "height": "75%" },
477
+ teleportDisable: _ctx.teleportDisable,
478
+ teleport: _ctx.teleport
386
479
  }, {
387
- default: T(() => [
388
- k("view", Me, [
389
- c(e.$slots, "sku-header"),
390
- e.getSlots("sku-header") ? m("", !0) : (a(), S(n, {
480
+ default: withCtx(() => [
481
+ createElementVNode("view", _hoisted_1, [
482
+ renderSlot(_ctx.$slots, "sku-header"),
483
+ !_ctx.getSlots("sku-header") ? (openBlock(), createBlock(_component_sku_header, {
391
484
  key: 0,
392
- goods: e.goods
393
- }, D({ _: 2 }, [
394
- e.getSlots("sku-header-price") ? {
485
+ goods: _ctx.goods
486
+ }, createSlots({ _: 2 }, [
487
+ _ctx.getSlots("sku-header-price") ? {
395
488
  name: "sku-header-price",
396
- fn: T(() => [
397
- c(e.$slots, "sku-header-price")
489
+ fn: withCtx(() => [
490
+ renderSlot(_ctx.$slots, "sku-header-price")
398
491
  ]),
399
492
  key: "0"
400
493
  } : void 0,
401
- e.getSlots("sku-header-extra") ? {
494
+ _ctx.getSlots("sku-header-extra") ? {
402
495
  name: "sku-header-extra",
403
- fn: T(() => [
404
- c(e.$slots, "sku-header-extra")
496
+ fn: withCtx(() => [
497
+ renderSlot(_ctx.$slots, "sku-header-extra")
405
498
  ]),
406
499
  key: "1"
407
500
  } : void 0
408
- ]), 1032, ["goods"])),
409
- k("view", Pe, [
410
- c(e.$slots, "sku-select-top"),
411
- c(e.$slots, "sku-select"),
412
- e.getSlots("sku-select") ? m("", !0) : (a(), S(l, {
501
+ ]), 1032, ["goods"])) : createCommentVNode("", true),
502
+ createElementVNode("view", _hoisted_2, [
503
+ renderSlot(_ctx.$slots, "sku-select-top"),
504
+ renderSlot(_ctx.$slots, "sku-select"),
505
+ !_ctx.getSlots("sku-select") ? (openBlock(), createBlock(_component_SkuSelect, {
413
506
  key: 0,
414
- sku: e.sku,
415
- onSelectSku: e.selectSku
416
- }, null, 8, ["sku", "onSelectSku"])),
417
- c(e.$slots, "sku-stepper"),
418
- e.getSlots("sku-stepper") ? m("", !0) : (a(), S(o, {
507
+ sku: _ctx.sku,
508
+ onSelectSku: _ctx.selectSku
509
+ }, null, 8, ["sku", "onSelectSku"])) : createCommentVNode("", true),
510
+ renderSlot(_ctx.$slots, "sku-stepper"),
511
+ !_ctx.getSlots("sku-stepper") ? (openBlock(), createBlock(_component_sku_stepper, {
419
512
  key: 1,
420
- goods: e.goods,
421
- stepperTitle: e.stepperTitle || e.translate("buyNumber"),
422
- stepperMax: e.stepperMax,
423
- stepperMin: e.stepperMin,
424
- stepperExtraText: e.stepperExtraText,
425
- onAdd: e.add,
426
- onReduce: e.reduce,
427
- onChangeStepper: e.changeStepper,
428
- onOverLimit: e.stepperOverLimit
429
- }, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])),
430
- c(e.$slots, "sku-stepper-bottom")
513
+ goods: _ctx.goods,
514
+ stepperTitle: _ctx.stepperTitle || _ctx.translate("buyNumber"),
515
+ stepperMax: _ctx.stepperMax,
516
+ stepperMin: _ctx.stepperMin,
517
+ stepperExtraText: _ctx.stepperExtraText,
518
+ onAdd: _ctx.add,
519
+ onReduce: _ctx.reduce,
520
+ onChangeStepper: _ctx.changeStepper,
521
+ onOverLimit: _ctx.stepperOverLimit
522
+ }, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])) : createCommentVNode("", true),
523
+ renderSlot(_ctx.$slots, "sku-stepper-bottom")
431
524
  ]),
432
- F(g, {
433
- btnOptions: e.btnOptions,
434
- btnExtraText: e.btnExtraText,
435
- buyText: e.buyText || e.translate("buyNow"),
436
- addCartText: e.addCartText || e.translate("addToCart"),
437
- confirmText: e.confirmText || e.translate("confirm"),
438
- onClickBtnOperate: e.clickBtnOperate
439
- }, D({ _: 2 }, [
440
- e.getSlots("sku-operate") ? {
525
+ createVNode(_component_sku_operate, {
526
+ btnOptions: _ctx.btnOptions,
527
+ btnExtraText: _ctx.btnExtraText,
528
+ buyText: _ctx.buyText || _ctx.translate("buyNow"),
529
+ addCartText: _ctx.addCartText || _ctx.translate("addToCart"),
530
+ confirmText: _ctx.confirmText || _ctx.translate("confirm"),
531
+ onClickBtnOperate: _ctx.clickBtnOperate
532
+ }, createSlots({ _: 2 }, [
533
+ _ctx.getSlots("sku-operate") ? {
441
534
  name: "operate-btn",
442
- fn: T(() => [
443
- c(e.$slots, "sku-operate")
535
+ fn: withCtx(() => [
536
+ renderSlot(_ctx.$slots, "sku-operate")
444
537
  ]),
445
538
  key: "0"
446
539
  } : void 0
@@ -450,7 +543,7 @@ function _e(e, t, s, u, p, d) {
450
543
  _: 3
451
544
  }, 8, ["visible", "teleportDisable", "teleport"]);
452
545
  }
453
- const Qe = /* @__PURE__ */ y(Ee, [["render", _e]]);
546
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
454
547
  export {
455
- Qe as default
548
+ index as default
456
549
  };