@nutui/nutui 3.1.10 → 3.1.12-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 (109) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/nutui.d.ts +5 -1
  3. package/dist/nutui.es.js +4041 -3518
  4. package/dist/nutui.umd.js +4084 -3627
  5. package/dist/packages/_es/ActionSheet.js +13 -12
  6. package/dist/packages/_es/Address.js +63 -49
  7. package/dist/packages/_es/Avatar.js +4 -5
  8. package/dist/packages/_es/BackTop.js +72 -109
  9. package/dist/packages/_es/Badge.js +4 -5
  10. package/dist/packages/_es/Barrage.js +63 -57
  11. package/dist/packages/_es/Button.js +5 -6
  12. package/dist/packages/_es/Calendar.js +27 -18
  13. package/dist/packages/_es/Card.js +104 -0
  14. package/dist/packages/_es/Cell.js +5 -13
  15. package/dist/packages/_es/CellGroup.js +4 -5
  16. package/dist/packages/_es/Checkbox.js +3 -3
  17. package/dist/packages/_es/CheckboxGroup.js +9 -4
  18. package/dist/packages/_es/CircleProgress.js +142 -46
  19. package/dist/packages/_es/Col.js +4 -5
  20. package/dist/packages/_es/Collapse.js +35 -10
  21. package/dist/packages/_es/CollapseItem.js +80 -35
  22. package/dist/packages/_es/CountDown.js +7 -5
  23. package/dist/packages/_es/CountUp.js +34 -31
  24. package/dist/packages/_es/DatePicker.js +451 -219
  25. package/dist/packages/_es/Dialog.js +13 -87
  26. package/dist/packages/_es/Divider.js +5 -6
  27. package/dist/packages/_es/Drag.js +76 -50
  28. package/dist/packages/_es/Elevator.js +81 -52
  29. package/dist/packages/_es/FixedNav.js +8 -9
  30. package/dist/packages/_es/Form.js +137 -0
  31. package/dist/packages/_es/FormItem.js +109 -0
  32. package/dist/packages/_es/Icon.js +6 -40
  33. package/dist/packages/_es/ImagePreview.js +23 -21
  34. package/dist/packages/_es/InfiniteLoading.js +95 -109
  35. package/dist/packages/_es/Input.js +22 -21
  36. package/dist/packages/_es/InputNumber.js +24 -18
  37. package/dist/packages/_es/Layout.js +2 -2
  38. package/dist/packages/_es/Menu.js +89 -171
  39. package/dist/packages/_es/MenuItem.js +155 -18
  40. package/dist/packages/_es/Navbar.js +7 -7
  41. package/dist/packages/_es/NoticeBar.js +39 -26
  42. package/dist/packages/_es/Notify.js +30 -166
  43. package/dist/packages/_es/NumberKeyboard.js +10 -6
  44. package/dist/packages/_es/OverLay.js +22 -29
  45. package/dist/packages/_es/Pagination.js +8 -9
  46. package/dist/packages/_es/Picker.js +61 -447
  47. package/dist/packages/_es/Popover.js +146 -25
  48. package/dist/packages/_es/Popup.js +18 -39
  49. package/dist/packages/_es/Price.js +18 -7
  50. package/dist/packages/_es/Progress.js +23 -12
  51. package/dist/packages/_es/Radio.js +20 -7
  52. package/dist/packages/_es/RadioGroup.js +7 -3
  53. package/dist/packages/_es/Range.js +38 -59
  54. package/dist/packages/_es/Rate.js +16 -20
  55. package/dist/packages/_es/Row.js +4 -5
  56. package/dist/packages/_es/SearchBar.js +7 -5
  57. package/dist/packages/_es/ShortPassword.js +89 -59
  58. package/dist/packages/_es/Signature.js +70 -71
  59. package/dist/packages/_es/Sku.js +508 -0
  60. package/dist/packages/_es/Step.js +10 -8
  61. package/dist/packages/_es/Steps.js +2 -2
  62. package/dist/packages/_es/Swipe.js +42 -27
  63. package/dist/packages/_es/Swiper.js +17 -418
  64. package/dist/packages/_es/SwiperItem.js +14 -39
  65. package/dist/packages/_es/Switch.js +4 -5
  66. package/dist/packages/_es/TabPane.js +4 -5
  67. package/dist/packages/_es/Tabbar.js +4 -5
  68. package/dist/packages/_es/TabbarItem.js +8 -9
  69. package/dist/packages/_es/Tabs.js +23 -17
  70. package/dist/packages/_es/Tag.js +5 -6
  71. package/dist/packages/_es/TextArea.js +16 -12
  72. package/dist/packages/_es/TimeDetail.js +7 -5
  73. package/dist/packages/_es/TimePannel.js +7 -5
  74. package/dist/packages/_es/TimeSelect.js +12 -7
  75. package/dist/packages/_es/Toast.js +41 -163
  76. package/dist/packages/_es/Uploader.js +210 -164
  77. package/dist/packages/_es/commonProps.js +30 -0
  78. package/dist/packages/_es/component.js +1 -1
  79. package/dist/packages/_es/index.js +1 -1
  80. package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +44 -0
  81. package/dist/packages/_es/index2.js +44 -8
  82. package/dist/packages/_es/index3.js +419 -0
  83. package/dist/packages/_es/pxCheck.js +1 -1
  84. package/dist/packages/_es/raf.js +1 -1
  85. package/dist/packages/_es/use-lock-scroll.js +23 -0
  86. package/dist/packages/_es/util.js +47 -0
  87. package/dist/packages/button/index.scss +9 -0
  88. package/dist/packages/card/index.scss +97 -0
  89. package/dist/packages/checkbox/index.scss +1 -1
  90. package/dist/packages/form/index.scss +2 -0
  91. package/dist/packages/formitem/index.scss +60 -0
  92. package/dist/packages/menu/index.scss +32 -60
  93. package/dist/packages/menuitem/index.scss +36 -99
  94. package/dist/packages/numberkeyboard/index.scss +1 -1
  95. package/dist/packages/progress/index.scss +2 -0
  96. package/dist/packages/radio/index.scss +32 -4
  97. package/dist/packages/radiogroup/index.scss +20 -0
  98. package/dist/packages/sku/index.scss +147 -0
  99. package/dist/packages/switch/index.scss +1 -1
  100. package/dist/packages/uploader/index.scss +95 -8
  101. package/dist/style.css +1 -1
  102. package/dist/style.es.js +1 -2
  103. package/dist/styles/mixins/index.scss +0 -4
  104. package/dist/styles/themes/default.scss +34 -30
  105. package/dist/styles/variables.scss +45 -3
  106. package/package.json +3 -2
  107. package/dist/packages/_es/Video.js +0 -405
  108. package/dist/packages/_es/plugin-vue_export-helper.js +0 -12
  109. package/dist/packages/_es/style.css +0 -160
@@ -0,0 +1,508 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
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 } from "./component.js";
8
+ import { T as TypeOfFun } from "./util.js";
9
+ const { componentName: componentName$4, create: create$4 } = createComponent("sku-header");
10
+ var _sfc_main$4 = create$4({
11
+ props: {
12
+ goods: {
13
+ type: Object,
14
+ default: {}
15
+ }
16
+ },
17
+ emits: [],
18
+ setup(props, { emit, slots }) {
19
+ const getSlots = (name) => slots[name];
20
+ return {
21
+ getSlots
22
+ };
23
+ }
24
+ });
25
+ const _hoisted_1$4 = { class: "nut-sku-header" };
26
+ const _hoisted_2$4 = ["src"];
27
+ const _hoisted_3$3 = { class: "nut-sku-header-right" };
28
+ const _hoisted_4$3 = {
29
+ key: 3,
30
+ class: "nut-sku-header-right-extra"
31
+ };
32
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
33
+ const _component_nut_price = resolveComponent("nut-price");
34
+ return openBlock(), createElementBlock("view", _hoisted_1$4, [
35
+ createElementVNode("img", {
36
+ src: _ctx.goods.imagePath
37
+ }, null, 8, _hoisted_2$4),
38
+ createElementVNode("view", _hoisted_3$3, [
39
+ _ctx.getSlots("sku-header-price") ? renderSlot(_ctx.$slots, "sku-header-price", { key: 0 }) : (openBlock(), createBlock(_component_nut_price, {
40
+ key: 1,
41
+ price: _ctx.goods.price,
42
+ needSymbol: true,
43
+ thousands: false
44
+ }, null, 8, ["price"])),
45
+ _ctx.getSlots("sku-header-extra") ? renderSlot(_ctx.$slots, "sku-header-extra", { key: 2 }) : createCommentVNode("", true),
46
+ _ctx.goods.skuId && !_ctx.getSlots("sku-header-extra") ? (openBlock(), createElementBlock("view", _hoisted_4$3, "\u5546\u54C1\u7F16\u53F7\uFF1A" + toDisplayString(_ctx.goods.skuId), 1)) : createCommentVNode("", true)
47
+ ])
48
+ ]);
49
+ }
50
+ _sfc_main$4.render = _sfc_render$4;
51
+ const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
52
+ var _sfc_main$3 = create$3({
53
+ props: {
54
+ sku: {
55
+ type: Array,
56
+ default: () => []
57
+ }
58
+ },
59
+ emits: ["selectSku"],
60
+ setup(props, { emit }) {
61
+ const skuInfo = ref([]);
62
+ watch(() => props.sku, (value) => {
63
+ skuInfo.value = [].slice.call(value);
64
+ }, { deep: true });
65
+ onMounted(() => {
66
+ if (props.sku.length > 0) {
67
+ skuInfo.value = [].slice.call(props.sku);
68
+ }
69
+ });
70
+ const changeSaleChild = (attrItem, index, parentItem, parentIndex) => {
71
+ if (attrItem.checkFlag || attrItem.disable) {
72
+ return;
73
+ }
74
+ emit("selectSku", {
75
+ sku: attrItem,
76
+ skuIndex: index,
77
+ parentSku: parentItem,
78
+ parentIndex
79
+ });
80
+ };
81
+ return {
82
+ skuInfo,
83
+ changeSaleChild
84
+ };
85
+ }
86
+ });
87
+ const _hoisted_1$3 = { class: "nut-sku-select" };
88
+ const _hoisted_2$3 = { class: "nut-sku-select-item-title" };
89
+ const _hoisted_3$2 = { class: "nut-sku-select-item-skus" };
90
+ const _hoisted_4$2 = ["onClick"];
91
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
92
+ return openBlock(), createElementBlock("view", _hoisted_1$3, [
93
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item, index) => {
94
+ return openBlock(), createElementBlock("view", {
95
+ class: "nut-sku-select-item",
96
+ key: item.id
97
+ }, [
98
+ createElementVNode("view", _hoisted_2$3, toDisplayString(item.name), 1),
99
+ createElementVNode("view", _hoisted_3$2, [
100
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (itemAttr, itemAttrIndex) => {
101
+ return openBlock(), createElementBlock("view", {
102
+ class: normalizeClass(["nut-sku-select-item-skus-sku", [{ active: !itemAttr.disable && itemAttr.active }, { disable: itemAttr.disable }]]),
103
+ onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item, index),
104
+ key: itemAttr.name
105
+ }, toDisplayString(itemAttr.name), 11, _hoisted_4$2);
106
+ }), 128))
107
+ ])
108
+ ]);
109
+ }), 128))
110
+ ]);
111
+ }
112
+ _sfc_main$3.render = _sfc_render$3;
113
+ const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
114
+ var _sfc_main$2 = create$2({
115
+ props: {
116
+ stepperMax: {
117
+ type: [Number, String],
118
+ default: 99999
119
+ },
120
+ stepperMin: {
121
+ type: [Number, String],
122
+ default: 1
123
+ },
124
+ stepperExtraText: {
125
+ type: [Function, Boolean],
126
+ default: false
127
+ },
128
+ stepperTitle: {
129
+ type: String,
130
+ default: "\u8D2D\u4E70\u6570\u91CF"
131
+ }
132
+ },
133
+ emits: ["click", "changeSku", "changeStepper", "clickBtnOptions", "overLimit", "reduce", "add"],
134
+ setup(props, { emit }) {
135
+ const goodsCount = ref(props.stepperMin);
136
+ onMounted(() => {
137
+ goodsCount.value = props.stepperMin;
138
+ });
139
+ const getExtraText = () => {
140
+ const { stepperExtraText } = props;
141
+ if (stepperExtraText && TypeOfFun(stepperExtraText) == "function") {
142
+ return stepperExtraText();
143
+ } else {
144
+ return "";
145
+ }
146
+ };
147
+ const add = (value) => {
148
+ emit("add", value);
149
+ };
150
+ const reduce = (value) => {
151
+ emit("reduce", value);
152
+ };
153
+ const overlimit = (e, action) => {
154
+ emit("overLimit", {
155
+ action,
156
+ value: parseInt(goodsCount.value + "")
157
+ });
158
+ };
159
+ const changeStepper = (value) => {
160
+ goodsCount.value = value;
161
+ emit("changeStepper", value);
162
+ };
163
+ return {
164
+ goodsCount,
165
+ add,
166
+ reduce,
167
+ overlimit,
168
+ getExtraText,
169
+ changeStepper
170
+ };
171
+ }
172
+ });
173
+ const _hoisted_1$2 = { class: "nut-sku-stepper" };
174
+ const _hoisted_2$2 = { class: "nut-sku-stepper-title" };
175
+ const _hoisted_3$1 = ["innerHTML"];
176
+ const _hoisted_4$1 = { class: "nut-sku-stepper-count" };
177
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
178
+ const _component_nut_inputnumber = resolveComponent("nut-inputnumber");
179
+ return openBlock(), createElementBlock("view", _hoisted_1$2, [
180
+ createElementVNode("view", _hoisted_2$2, toDisplayString(_ctx.stepperTitle), 1),
181
+ createElementVNode("view", {
182
+ class: "nut-sku-stepper-limit",
183
+ innerHTML: _ctx.getExtraText()
184
+ }, null, 8, _hoisted_3$1),
185
+ createElementVNode("view", _hoisted_4$1, [
186
+ createVNode(_component_nut_inputnumber, {
187
+ modelValue: _ctx.goodsCount,
188
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.goodsCount = $event),
189
+ min: _ctx.stepperMin,
190
+ max: _ctx.stepperMax,
191
+ onAdd: _ctx.add,
192
+ onReduce: _ctx.reduce,
193
+ onOverlimit: _ctx.overlimit,
194
+ onChange: _ctx.changeStepper
195
+ }, null, 8, ["modelValue", "min", "max", "onAdd", "onReduce", "onOverlimit", "onChange"])
196
+ ])
197
+ ]);
198
+ }
199
+ _sfc_main$2.render = _sfc_render$2;
200
+ const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
201
+ var _sfc_main$1 = create$1({
202
+ props: {
203
+ btnOptions: {
204
+ type: Array,
205
+ default: () => ["confirm"]
206
+ },
207
+ btnExtraText: {
208
+ type: String,
209
+ default: ""
210
+ },
211
+ buyText: {
212
+ type: String,
213
+ default: "\u7ACB\u5373\u8D2D\u4E70"
214
+ },
215
+ addCartText: {
216
+ type: String,
217
+ default: "\u52A0\u5165\u8D2D\u7269\u8F66"
218
+ },
219
+ confirmText: {
220
+ type: String,
221
+ default: "\u786E\u5B9A"
222
+ }
223
+ },
224
+ emits: ["click", "changeSku", "changeBuyCount", "clickBtnOperate"],
225
+ setup(props, { emit, slots }) {
226
+ const getBtnDesc = (type) => {
227
+ let mapD = {
228
+ confirm: props.confirmText,
229
+ cart: props.addCartText,
230
+ buy: props.buyText
231
+ };
232
+ return mapD[type];
233
+ };
234
+ onMounted(() => {
235
+ console.log(slots);
236
+ });
237
+ const getSlots = (name) => slots[name];
238
+ const clickBtnOperate = (btn) => {
239
+ emit("clickBtnOperate", btn);
240
+ };
241
+ return {
242
+ getBtnDesc,
243
+ clickBtnOperate,
244
+ getSlots
245
+ };
246
+ }
247
+ });
248
+ const _hoisted_1$1 = {
249
+ key: 0,
250
+ class: "nut-sku-operate"
251
+ };
252
+ const _hoisted_2$1 = ["innerHTML"];
253
+ const _hoisted_3 = {
254
+ key: 1,
255
+ class: "nut-sku-operate-btn"
256
+ };
257
+ const _hoisted_4 = ["onClick"];
258
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
259
+ return _ctx.btnOptions.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_1$1, [
260
+ _ctx.btnExtraText ? (openBlock(), createElementBlock("view", {
261
+ key: 0,
262
+ class: "nut-sku-operate-desc",
263
+ innerHTML: _ctx.btnExtraText
264
+ }, null, 8, _hoisted_2$1)) : createCommentVNode("", true),
265
+ renderSlot(_ctx.$slots, "operate-btn"),
266
+ !_ctx.getSlots("operate-btn") ? (openBlock(), createElementBlock("view", _hoisted_3, [
267
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.btnOptions, (btn, i) => {
268
+ return openBlock(), createElementBlock("view", {
269
+ class: normalizeClass([`nut-sku-operate-btn-${btn}`, "nut-sku-operate-btn-item"]),
270
+ key: i,
271
+ onClick: ($event) => _ctx.clickBtnOperate(btn)
272
+ }, toDisplayString(_ctx.getBtnDesc(btn)), 11, _hoisted_4);
273
+ }), 128))
274
+ ])) : createCommentVNode("", true)
275
+ ])) : createCommentVNode("", true);
276
+ }
277
+ _sfc_main$1.render = _sfc_render$1;
278
+ const { componentName, create } = createComponent("sku");
279
+ var _sfc_main = create({
280
+ props: {
281
+ visible: {
282
+ type: Boolean,
283
+ default: false
284
+ },
285
+ sku: {
286
+ type: Array,
287
+ default: []
288
+ },
289
+ goods: {
290
+ type: Object,
291
+ default: {}
292
+ },
293
+ showSaleLimit: {
294
+ type: Boolean,
295
+ default: false
296
+ },
297
+ stepperMax: {
298
+ type: [Number, String],
299
+ default: 99999
300
+ },
301
+ stepperMin: {
302
+ type: [Number, String],
303
+ default: 1
304
+ },
305
+ purchased: {
306
+ type: [Number, String],
307
+ default: 0
308
+ },
309
+ showSaleLowest: {
310
+ type: Boolean,
311
+ default: false
312
+ },
313
+ btnOptions: {
314
+ type: Array,
315
+ default: () => ["confirm"]
316
+ },
317
+ stepperTitle: {
318
+ type: String,
319
+ default: "\u8D2D\u4E70\u6570\u91CF"
320
+ },
321
+ saleLowestText: {
322
+ type: [Function, Boolean],
323
+ default: false
324
+ },
325
+ saleLimitText: {
326
+ type: [Function, Boolean],
327
+ default: false
328
+ },
329
+ purchasedText: {
330
+ type: [Function, Boolean],
331
+ default: false
332
+ },
333
+ buyText: {
334
+ type: String,
335
+ default: "\u7ACB\u5373\u8D2D\u4E70"
336
+ },
337
+ addCartText: {
338
+ type: String,
339
+ default: "\u52A0\u5165\u8D2D\u7269\u8F66"
340
+ },
341
+ confirmText: {
342
+ type: String,
343
+ default: "\u786E\u5B9A"
344
+ }
345
+ },
346
+ emits: [
347
+ "update:visible",
348
+ "selectSku",
349
+ "changeStepper",
350
+ "clickBtnOperate",
351
+ "clickCloseIcon",
352
+ "clickOverlay",
353
+ "close",
354
+ "reduce",
355
+ "add",
356
+ "overLimit"
357
+ ],
358
+ components: {
359
+ SkuHeader: _sfc_main$4,
360
+ SkuSelect: _sfc_main$3,
361
+ SkuStepper: _sfc_main$2,
362
+ SkuOperate: _sfc_main$1
363
+ },
364
+ setup(props, { emit, slots }) {
365
+ const showPopup = ref(props.visible);
366
+ const goodsCount = ref(props.stepperMin);
367
+ watch(() => props.visible, (value) => {
368
+ showPopup.value = value;
369
+ });
370
+ watch(() => showPopup.value, (value) => {
371
+ if (value == false) {
372
+ close();
373
+ }
374
+ });
375
+ const getSlots = (name) => slots[name];
376
+ const selectSku = (skus) => {
377
+ emit("selectSku", skus);
378
+ };
379
+ const changeStepper = (value) => {
380
+ goodsCount.value = value;
381
+ emit("changeStepper", value);
382
+ };
383
+ const add = (value) => {
384
+ emit("add", value);
385
+ };
386
+ const reduce = (value) => {
387
+ emit("reduce", value);
388
+ };
389
+ const stepperOverLimit = (count) => {
390
+ emit("overLimit", count);
391
+ };
392
+ const clickBtnOperate = (btn) => {
393
+ emit("clickBtnOperate", {
394
+ type: btn,
395
+ value: goodsCount.value
396
+ });
397
+ };
398
+ const closePopup = (type) => {
399
+ if (type == "icon") {
400
+ emit("click-close-icon");
401
+ }
402
+ if (type == "overlay") {
403
+ emit("click-overlay");
404
+ }
405
+ if (type == "close") {
406
+ emit("close");
407
+ }
408
+ showPopup.value = false;
409
+ };
410
+ const close = () => {
411
+ emit("update:visible", false);
412
+ };
413
+ return {
414
+ showPopup,
415
+ closePopup,
416
+ selectSku,
417
+ changeStepper,
418
+ stepperOverLimit,
419
+ clickBtnOperate,
420
+ add,
421
+ reduce,
422
+ getSlots
423
+ };
424
+ }
425
+ });
426
+ const _hoisted_1 = { class: "nut-sku" };
427
+ const _hoisted_2 = { class: "nut-sku-content" };
428
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
429
+ const _component_sku_header = resolveComponent("sku-header");
430
+ const _component_SkuSelect = resolveComponent("SkuSelect");
431
+ const _component_sku_stepper = resolveComponent("sku-stepper");
432
+ const _component_sku_operate = resolveComponent("sku-operate");
433
+ const _component_nut_popup = resolveComponent("nut-popup");
434
+ return openBlock(), createBlock(_component_nut_popup, {
435
+ position: "bottom",
436
+ closeable: "",
437
+ round: "",
438
+ visible: _ctx.showPopup,
439
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
440
+ onClickCloseIcon: _cache[1] || (_cache[1] = ($event) => _ctx.closePopup("icon")),
441
+ onClickOverlay: _cache[2] || (_cache[2] = ($event) => _ctx.closePopup("overlay")),
442
+ onClose: _cache[3] || (_cache[3] = ($event) => _ctx.closePopup("close")),
443
+ style: { "height": "75%" }
444
+ }, {
445
+ default: withCtx(() => [
446
+ createElementVNode("view", _hoisted_1, [
447
+ renderSlot(_ctx.$slots, "sku-header"),
448
+ !_ctx.getSlots("sku-header") ? (openBlock(), createBlock(_component_sku_header, {
449
+ key: 0,
450
+ goods: _ctx.goods
451
+ }, createSlots({ _: 2 }, [
452
+ _ctx.getSlots("sku-header-price") ? {
453
+ name: "sku-header-price",
454
+ fn: withCtx(() => [
455
+ renderSlot(_ctx.$slots, "sku-header-price")
456
+ ])
457
+ } : void 0,
458
+ _ctx.getSlots("sku-header-extra") ? {
459
+ name: "sku-header-extra",
460
+ fn: withCtx(() => [
461
+ renderSlot(_ctx.$slots, "sku-header-extra")
462
+ ])
463
+ } : void 0
464
+ ]), 1032, ["goods"])) : createCommentVNode("", true),
465
+ createElementVNode("view", _hoisted_2, [
466
+ renderSlot(_ctx.$slots, "sku-select-top"),
467
+ renderSlot(_ctx.$slots, "sku-select"),
468
+ !_ctx.getSlots("sku-select") ? (openBlock(), createBlock(_component_SkuSelect, {
469
+ key: 0,
470
+ sku: _ctx.sku,
471
+ onSelectSku: _ctx.selectSku
472
+ }, null, 8, ["sku", "onSelectSku"])) : createCommentVNode("", true),
473
+ renderSlot(_ctx.$slots, "sku-stepper"),
474
+ !_ctx.getSlots("sku-stepper") ? (openBlock(), createBlock(_component_sku_stepper, {
475
+ key: 1,
476
+ goods: _ctx.goods,
477
+ stepperTitle: _ctx.stepperTitle,
478
+ stepperMax: _ctx.stepperMax,
479
+ stepperMin: _ctx.stepperMin,
480
+ purchased: _ctx.purchased,
481
+ showSaleLimit: _ctx.showSaleLimit,
482
+ showSaleLowest: _ctx.showSaleLowest,
483
+ saleLowestText: _ctx.saleLowestText,
484
+ saleLimitText: _ctx.saleLimitText,
485
+ purchasedText: _ctx.purchasedText,
486
+ onAdd: _ctx.add,
487
+ onReduce: _ctx.reduce,
488
+ onChangeStepper: _ctx.changeStepper,
489
+ onStepperOverLimit: _ctx.stepperOverLimit
490
+ }, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "purchased", "showSaleLimit", "showSaleLowest", "saleLowestText", "saleLimitText", "purchasedText", "onAdd", "onReduce", "onChangeStepper", "onStepperOverLimit"])) : createCommentVNode("", true),
491
+ renderSlot(_ctx.$slots, "sku-stepper-bottom")
492
+ ]),
493
+ renderSlot(_ctx.$slots, "sku-operate"),
494
+ !_ctx.getSlots("sku-operate") ? (openBlock(), createBlock(_component_sku_operate, {
495
+ key: 1,
496
+ btnOptions: _ctx.btnOptions,
497
+ buyText: _ctx.buyText,
498
+ addCartText: _ctx.addCartText,
499
+ confirmText: _ctx.confirmText,
500
+ onClickBtnOperate: _ctx.clickBtnOperate
501
+ }, null, 8, ["btnOptions", "buyText", "addCartText", "confirmText", "onClickBtnOperate"])) : createCommentVNode("", true)
502
+ ])
503
+ ]),
504
+ _: 3
505
+ }, 8, ["visible"]);
506
+ }
507
+ _sfc_main.render = _sfc_render;
508
+ export { _sfc_main as default };
@@ -17,16 +17,18 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __require = typeof require !== "undefined" ? require : (x) => {
21
+ throw new Error('Dynamic require of "' + x + '" is not supported');
22
+ };
20
23
  /*!
21
- * @nutui/nutui v3.1.10 Fri Nov 05 2021 19:52:49 GMT+0800 (中国标准时间)
24
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
22
25
  * (c) 2021 @jdf2e.
23
26
  * Released under the MIT License.
24
27
  */
25
28
  import { getCurrentInstance, inject, reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, Fragment, toDisplayString, createCommentVNode } from "vue";
26
29
  import { c as createComponent } from "./component.js";
27
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
30
  const { create, componentName } = createComponent("step");
29
- const _sfc_main = create({
31
+ var _sfc_main = create({
30
32
  props: {
31
33
  title: {
32
34
  type: String,
@@ -56,9 +58,9 @@ const _sfc_main = create({
56
58
  const state = reactive({
57
59
  dot: parent.props.progressDot
58
60
  });
59
- const index2 = computed(() => parent.state.children.indexOf(proxy) + 1);
61
+ const index = computed(() => parent.state.children.indexOf(proxy) + 1);
60
62
  const getCurrentStatus = () => {
61
- const activeIndex = index2.value;
63
+ const activeIndex = index.value;
62
64
  if (activeIndex < +parent.props.current)
63
65
  return "finish";
64
66
  return activeIndex === +parent.props.current ? "process" : "wait";
@@ -74,7 +76,7 @@ const _sfc_main = create({
74
76
  };
75
77
  });
76
78
  return __spreadProps(__spreadValues({}, toRefs(state)), {
77
- index: index2,
79
+ index,
78
80
  classes
79
81
  });
80
82
  }
@@ -117,5 +119,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
117
119
  ])
118
120
  ], 2);
119
121
  }
120
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
121
- export { index as default };
122
+ _sfc_main.render = _sfc_render;
123
+ export { _sfc_main as default };
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.10 Fri Nov 05 2021 19:52:49 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { reactive, computed, provide, h } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  const { create, componentName } = createComponent("steps");
9
- const _sfc_main = create({
9
+ var _sfc_main = create({
10
10
  props: {
11
11
  direction: {
12
12
  type: String,
@@ -17,17 +17,21 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __require = typeof require !== "undefined" ? require : (x) => {
21
+ throw new Error('Dynamic require of "' + x + '" is not supported');
22
+ };
20
23
  /*!
21
- * @nutui/nutui v3.1.10 Fri Nov 05 2021 19:52:49 GMT+0800 (中国标准时间)
24
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
22
25
  * (c) 2021 @jdf2e.
23
26
  * Released under the MIT License.
24
27
  */
28
+ import Taro from "@tarojs/taro";
25
29
  import { u as useTouch } from "./index.js";
26
- import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
30
+ import { computed, ref, onMounted, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
27
31
  import { c as createComponent } from "./component.js";
28
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
32
+ import { u as useTaroRect } from "./index2.js";
29
33
  const { componentName, create } = createComponent("swipe");
30
- const _sfc_main = create({
34
+ var _sfc_main = create({
31
35
  props: {
32
36
  name: {
33
37
  type: String,
@@ -48,21 +52,29 @@ const _sfc_main = create({
48
52
  },
49
53
  emits: ["open", "close"],
50
54
  setup(props, { emit }) {
55
+ const refRandomId = Math.random().toString(36).slice(-8);
51
56
  const classes = computed(() => {
52
57
  const prefixCls = componentName;
53
58
  return {
54
59
  [prefixCls]: true
55
60
  };
56
61
  });
57
- const getRefWidth = (ref2) => {
58
- var _a;
59
- return ((_a = ref2.value) == null ? void 0 : _a.clientWidth) || 0;
62
+ const getRefWidth = async (ref2) => {
63
+ let rect = await useTaroRect(ref2, Taro);
64
+ return rect.width || 0;
60
65
  };
61
- const leftRef = ref(), leftRefWidth = computed(() => {
62
- return getRefWidth(leftRef);
63
- });
64
- const rightRef = ref(), rightRefWidth = computed(() => {
65
- return getRefWidth(rightRef);
66
+ const leftRef = ref();
67
+ const leftRefWidth = ref(0);
68
+ const rightRef = ref();
69
+ const rightRefWidth = ref(0);
70
+ const initWidth = async () => {
71
+ leftRefWidth.value = await getRefWidth(leftRef);
72
+ rightRefWidth.value = await getRefWidth(rightRef);
73
+ };
74
+ onMounted(() => {
75
+ setTimeout(() => {
76
+ initWidth();
77
+ }, 100);
66
78
  });
67
79
  let opened = false;
68
80
  let position = "";
@@ -122,7 +134,7 @@ const _sfc_main = create({
122
134
  return;
123
135
  touch.start(event);
124
136
  },
125
- onTouchMove(event) {
137
+ async onTouchMove(event) {
126
138
  if (props.disabled)
127
139
  return;
128
140
  touch.move(event);
@@ -168,20 +180,15 @@ const _sfc_main = create({
168
180
  }, touchMethods), {
169
181
  leftRef,
170
182
  rightRef,
183
+ refRandomId,
171
184
  open,
172
185
  close
173
186
  });
174
187
  }
175
188
  });
176
- const _hoisted_1 = {
177
- class: "nut-swipe__left",
178
- ref: "leftRef"
179
- };
189
+ const _hoisted_1 = ["id"];
180
190
  const _hoisted_2 = { class: "nut-swipe__content" };
181
- const _hoisted_3 = {
182
- class: "nut-swipe__right",
183
- ref: "rightRef"
184
- };
191
+ const _hoisted_3 = ["id"];
185
192
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
186
193
  return openBlock(), createElementBlock("view", {
187
194
  class: normalizeClass(_ctx.classes),
@@ -191,16 +198,24 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
191
198
  onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
192
199
  onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
193
200
  }, [
194
- createElementVNode("view", _hoisted_1, [
201
+ createElementVNode("view", {
202
+ class: "nut-swipe__left",
203
+ ref: "leftRef",
204
+ id: "leftRef-" + _ctx.refRandomId
205
+ }, [
195
206
  renderSlot(_ctx.$slots, "left")
196
- ], 512),
207
+ ], 8, _hoisted_1),
197
208
  createElementVNode("view", _hoisted_2, [
198
209
  renderSlot(_ctx.$slots, "default")
199
210
  ]),
200
- createElementVNode("view", _hoisted_3, [
211
+ createElementVNode("view", {
212
+ class: "nut-swipe__right",
213
+ ref: "rightRef",
214
+ id: "rightRef-" + _ctx.refRandomId
215
+ }, [
201
216
  renderSlot(_ctx.$slots, "right")
202
- ], 512)
217
+ ], 8, _hoisted_3)
203
218
  ], 38);
204
219
  }
205
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
206
- export { index as default };
220
+ _sfc_main.render = _sfc_render;
221
+ export { _sfc_main as default };