@nutui/nutui 3.1.12-beta.1 → 3.1.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.
- package/CHANGELOG.md +27 -0
- package/dist/nutui.d.ts +1 -1
- package/dist/nutui.es.js +3219 -2562
- package/dist/nutui.umd.js +3292 -2565
- package/dist/packages/_es/ActionSheet.js +12 -13
- package/dist/packages/_es/Address.js +49 -63
- package/dist/packages/_es/Avatar.js +5 -4
- package/dist/packages/_es/BackTop.js +109 -72
- package/dist/packages/_es/Badge.js +5 -4
- package/dist/packages/_es/Barrage.js +57 -63
- package/dist/packages/_es/Button.js +6 -5
- package/dist/packages/_es/Calendar.js +18 -27
- package/dist/packages/_es/Card.js +8 -7
- package/dist/packages/_es/Cell.js +13 -5
- package/dist/packages/_es/CellGroup.js +14 -7
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +4 -9
- package/dist/packages/_es/CircleProgress.js +46 -142
- package/dist/packages/_es/Col.js +5 -4
- package/dist/packages/_es/Collapse.js +10 -35
- package/dist/packages/_es/CollapseItem.js +35 -80
- package/dist/packages/_es/CountDown.js +5 -7
- package/dist/packages/_es/CountUp.js +31 -34
- package/dist/packages/_es/DatePicker.js +219 -451
- package/dist/packages/_es/Dialog.js +98 -46
- package/dist/packages/_es/Divider.js +6 -5
- package/dist/packages/_es/Drag.js +50 -76
- package/dist/packages/_es/Elevator.js +52 -81
- package/dist/packages/_es/FixedNav.js +9 -8
- package/dist/packages/_es/Form.js +6 -5
- package/dist/packages/_es/FormItem.js +5 -4
- package/dist/packages/_es/Icon.js +40 -6
- package/dist/packages/_es/ImagePreview.js +158 -44
- package/dist/packages/_es/InfiniteLoading.js +109 -95
- package/dist/packages/_es/Input.js +21 -22
- package/dist/packages/_es/InputNumber.js +18 -24
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +14 -16
- package/dist/packages/_es/MenuItem.js +11 -9
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +26 -39
- package/dist/packages/_es/Notify.js +166 -30
- package/dist/packages/_es/NumberKeyboard.js +7 -9
- package/dist/packages/_es/OverLay.js +29 -22
- package/dist/packages/_es/Pagination.js +9 -8
- package/dist/packages/_es/Picker.js +447 -61
- package/dist/packages/_es/Popover.js +34 -161
- package/dist/packages/_es/Popup.js +77 -17
- package/dist/packages/_es/Price.js +7 -18
- package/dist/packages/_es/Progress.js +12 -23
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +31 -38
- package/dist/packages/_es/Rate.js +35 -17
- package/dist/packages/_es/Row.js +5 -4
- package/dist/packages/_es/SearchBar.js +5 -7
- package/dist/packages/_es/ShortPassword.js +59 -89
- package/dist/packages/_es/Signature.js +71 -70
- package/dist/packages/_es/Sku.js +43 -53
- package/dist/packages/_es/Step.js +8 -10
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +28 -43
- package/dist/packages/_es/Swiper.js +418 -17
- package/dist/packages/_es/SwiperItem.js +39 -14
- package/dist/packages/_es/Switch.js +32 -11
- package/dist/packages/_es/TabPane.js +5 -4
- package/dist/packages/_es/Tabbar.js +5 -4
- package/dist/packages/_es/TabbarItem.js +9 -8
- package/dist/packages/_es/Tabs.js +16 -22
- package/dist/packages/_es/Tag.js +6 -5
- package/dist/packages/_es/TextArea.js +12 -16
- package/dist/packages/_es/TimeDetail.js +5 -7
- package/dist/packages/_es/TimePannel.js +5 -7
- package/dist/packages/_es/TimeSelect.js +7 -12
- package/dist/packages/_es/Toast.js +178 -46
- package/dist/packages/_es/Uploader.js +149 -109
- package/dist/packages/_es/Video.js +405 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +7 -58
- package/dist/packages/_es/index2.js +58 -43
- package/dist/packages/_es/index3.js +28 -411
- package/dist/packages/_es/plugin-vue_export-helper.js +13 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/util.js +1 -1
- package/dist/packages/cellgroup/index.scss +9 -0
- package/dist/packages/dialog/index.scss +17 -0
- package/dist/packages/drag/index.scss +4 -0
- package/dist/packages/fixednav/index.scss +6 -1
- package/dist/packages/formitem/index.scss +3 -0
- package/dist/packages/icon/index.scss +2 -1
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/popover/index.scss +2 -2
- package/dist/packages/rate/index.scss +1 -0
- package/dist/packages/textarea/index.scss +1 -0
- package/dist/packages/timedetail/index.scss +1 -2
- package/dist/packages/timeselect/index.scss +3 -0
- package/dist/packages/toast/index.scss +6 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -1
- package/dist/styles/font/config.json +2 -1
- package/dist/styles/font/demo_index.html +26 -3
- package/dist/styles/font/iconfont.css +7 -3
- package/dist/styles/font/iconfont.js +31 -32
- package/dist/styles/font/iconfont.json +7 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +38 -38
- package/dist/styles/variables.scss +5 -1
- package/package.json +1 -1
- package/dist/packages/_es/commonProps.js +0 -30
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +0 -44
- package/dist/packages/_es/use-lock-scroll.js +0 -23
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import { computed, reactive, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, createTextVNode } from "vue";
|
|
6
|
+
import { ref, computed, reactive, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createVNode, withCtx, createTextVNode } from "vue";
|
|
8
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
const { componentName, create } = createComponent("signature");
|
|
10
|
-
|
|
10
|
+
const _sfc_main = create({
|
|
11
11
|
props: {
|
|
12
12
|
customClass: {
|
|
13
13
|
type: String,
|
|
@@ -33,6 +33,8 @@ var _sfc_main = create({
|
|
|
33
33
|
components: {},
|
|
34
34
|
emits: ["confirm", "clear"],
|
|
35
35
|
setup(props, { emit }) {
|
|
36
|
+
const canvas = ref(null);
|
|
37
|
+
const wrap = ref(null);
|
|
36
38
|
const classes = computed(() => {
|
|
37
39
|
const prefixCls = componentName;
|
|
38
40
|
return {
|
|
@@ -41,126 +43,125 @@ var _sfc_main = create({
|
|
|
41
43
|
};
|
|
42
44
|
});
|
|
43
45
|
const state = reactive({
|
|
44
|
-
canvas: null,
|
|
45
46
|
canvasHeight: 0,
|
|
46
47
|
canvasWidth: 0,
|
|
47
|
-
ctx: null
|
|
48
|
+
ctx: null,
|
|
49
|
+
isSupportTouch: "ontouchstart" in window,
|
|
50
|
+
events: "ontouchstart" in window ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"]
|
|
48
51
|
});
|
|
52
|
+
const isCanvasSupported = () => {
|
|
53
|
+
let elem = document.createElement("canvas");
|
|
54
|
+
return !!(elem.getContext && elem.getContext("2d"));
|
|
55
|
+
};
|
|
56
|
+
const addEvent = () => {
|
|
57
|
+
canvas.value.addEventListener(state.events[0], startEventHandler, false);
|
|
58
|
+
};
|
|
49
59
|
const startEventHandler = (event) => {
|
|
50
60
|
event.preventDefault();
|
|
51
61
|
state.ctx.beginPath();
|
|
52
62
|
state.ctx.lineWidth = props.lineWidth;
|
|
53
63
|
state.ctx.strokeStyle = props.strokeStyle;
|
|
64
|
+
canvas.value.addEventListener(state.events[1], moveEventHandler, false);
|
|
65
|
+
canvas.value.addEventListener(state.events[2], endEventHandler, false);
|
|
66
|
+
canvas.value.addEventListener(state.events[3], leaveEventHandler, false);
|
|
54
67
|
};
|
|
55
68
|
const moveEventHandler = (event) => {
|
|
56
69
|
event.preventDefault();
|
|
57
|
-
let evt = event.
|
|
58
|
-
let
|
|
59
|
-
let
|
|
70
|
+
let evt = state.isSupportTouch ? event.touches[0] : event;
|
|
71
|
+
let coverPos = canvas.value.getBoundingClientRect();
|
|
72
|
+
let mouseX = evt.clientX - coverPos.left;
|
|
73
|
+
let mouseY = evt.clientY - coverPos.top;
|
|
60
74
|
state.ctx.lineTo(mouseX, mouseY);
|
|
61
75
|
state.ctx.stroke();
|
|
62
76
|
};
|
|
63
77
|
const endEventHandler = (event) => {
|
|
64
78
|
event.preventDefault();
|
|
79
|
+
canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
|
|
80
|
+
canvas.value.removeEventListener(state.events[2], endEventHandler, false);
|
|
65
81
|
};
|
|
66
82
|
const leaveEventHandler = (event) => {
|
|
67
83
|
event.preventDefault();
|
|
84
|
+
canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
|
|
85
|
+
canvas.value.removeEventListener(state.events[2], endEventHandler, false);
|
|
68
86
|
};
|
|
69
87
|
const clear = () => {
|
|
88
|
+
canvas.value.addEventListener(state.events[2], endEventHandler, false);
|
|
70
89
|
state.ctx.clearRect(0, 0, state.canvasWidth, state.canvasHeight);
|
|
71
90
|
state.ctx.closePath();
|
|
72
91
|
emit("clear");
|
|
73
92
|
};
|
|
74
93
|
const confirm = () => {
|
|
75
|
-
onSave();
|
|
94
|
+
onSave(canvas.value);
|
|
76
95
|
};
|
|
77
|
-
const onSave = () => {
|
|
78
|
-
|
|
79
|
-
|
|
96
|
+
const onSave = (canvas2) => {
|
|
97
|
+
let dataurl;
|
|
98
|
+
switch (props.type) {
|
|
99
|
+
case "png":
|
|
100
|
+
dataurl = canvas2.toDataURL("image/png");
|
|
101
|
+
break;
|
|
102
|
+
case "jpg":
|
|
103
|
+
dataurl = canvas2.toDataURL("image/jpeg", 0.8);
|
|
104
|
+
break;
|
|
80
105
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
size: true
|
|
84
|
-
}).exec(async (res) => {
|
|
85
|
-
Taro.canvasToTempFilePath({
|
|
86
|
-
canvas: res[0].node,
|
|
87
|
-
fileType: props.type
|
|
88
|
-
}).then((res2) => {
|
|
89
|
-
emit("confirm", res2.tempFilePath);
|
|
90
|
-
}).catch((e) => {
|
|
91
|
-
emit("confirm", e);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
106
|
+
clear();
|
|
107
|
+
emit("confirm", canvas2, dataurl);
|
|
94
108
|
};
|
|
95
109
|
onMounted(() => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const ctx = canvas.getContext("2d");
|
|
103
|
-
state.canvas = canvas;
|
|
104
|
-
state.ctx = ctx;
|
|
105
|
-
state.canvasWidth = res.width;
|
|
106
|
-
state.canvasHeight = res.height;
|
|
107
|
-
}).exec();
|
|
108
|
-
}, 500);
|
|
110
|
+
if (isCanvasSupported()) {
|
|
111
|
+
state.ctx = canvas.value.getContext("2d");
|
|
112
|
+
state.canvasWidth = wrap.value.offsetWidth;
|
|
113
|
+
state.canvasHeight = wrap.value.offsetHeight;
|
|
114
|
+
addEvent();
|
|
115
|
+
}
|
|
109
116
|
});
|
|
110
|
-
return {
|
|
111
|
-
confirm,
|
|
112
|
-
clear,
|
|
113
|
-
classes,
|
|
114
|
-
startEventHandler,
|
|
115
|
-
moveEventHandler,
|
|
116
|
-
endEventHandler,
|
|
117
|
-
leaveEventHandler
|
|
118
|
-
};
|
|
117
|
+
return { canvas, wrap, isCanvasSupported, confirm, clear, classes };
|
|
119
118
|
}
|
|
120
119
|
});
|
|
121
|
-
const _hoisted_1 = {
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
const _hoisted_1 = {
|
|
121
|
+
class: "nut-signature-inner",
|
|
122
|
+
ref: "wrap"
|
|
123
|
+
};
|
|
124
|
+
const _hoisted_2 = ["height", "width"];
|
|
125
|
+
const _hoisted_3 = {
|
|
126
|
+
key: 1,
|
|
127
|
+
class: "nut-signature-unsopport"
|
|
128
|
+
};
|
|
129
|
+
const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u91CD\u7B7E");
|
|
130
|
+
const _hoisted_5 = /* @__PURE__ */ createTextVNode("\u786E\u8BA4");
|
|
124
131
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
125
132
|
const _component_nut_button = resolveComponent("nut-button");
|
|
126
133
|
return openBlock(), createElementBlock("div", {
|
|
127
134
|
class: normalizeClass(_ctx.classes)
|
|
128
135
|
}, [
|
|
129
136
|
createElementVNode("div", _hoisted_1, [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.startEventHandler && _ctx.startEventHandler(...args)),
|
|
138
|
-
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.moveEventHandler && _ctx.moveEventHandler(...args)),
|
|
139
|
-
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.endEventHandler && _ctx.endEventHandler(...args)),
|
|
140
|
-
onTouchleave: _cache[3] || (_cache[3] = (...args) => _ctx.leaveEventHandler && _ctx.leaveEventHandler(...args))
|
|
141
|
-
}, null, 32)
|
|
142
|
-
]),
|
|
137
|
+
_ctx.isCanvasSupported ? (openBlock(), createElementBlock("canvas", {
|
|
138
|
+
key: 0,
|
|
139
|
+
ref: "canvas",
|
|
140
|
+
height: _ctx.canvasHeight,
|
|
141
|
+
width: _ctx.canvasWidth
|
|
142
|
+
}, null, 8, _hoisted_2)) : (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(_ctx.unSupportTpl), 1))
|
|
143
|
+
], 512),
|
|
143
144
|
createVNode(_component_nut_button, {
|
|
144
145
|
class: "nut-signature-btn",
|
|
145
146
|
type: "default",
|
|
146
|
-
onClick: _cache[
|
|
147
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.clear())
|
|
147
148
|
}, {
|
|
148
149
|
default: withCtx(() => [
|
|
149
|
-
|
|
150
|
+
_hoisted_4
|
|
150
151
|
]),
|
|
151
152
|
_: 1
|
|
152
153
|
}),
|
|
153
154
|
createVNode(_component_nut_button, {
|
|
154
155
|
class: "nut-signature-btn",
|
|
155
156
|
type: "primary",
|
|
156
|
-
onClick: _cache[
|
|
157
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirm())
|
|
157
158
|
}, {
|
|
158
159
|
default: withCtx(() => [
|
|
159
|
-
|
|
160
|
+
_hoisted_5
|
|
160
161
|
]),
|
|
161
162
|
_: 1
|
|
162
163
|
})
|
|
163
164
|
], 2);
|
|
164
165
|
}
|
|
165
|
-
_sfc_main
|
|
166
|
-
export {
|
|
166
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
167
|
+
export { index as default };
|
package/dist/packages/_es/Sku.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, createCommentVNode, toDisplayString, ref, watch, onMounted, Fragment, renderList, normalizeClass, createVNode, withCtx, createSlots } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
8
9
|
import { T as TypeOfFun } from "./util.js";
|
|
9
10
|
const { componentName: componentName$4, create: create$4 } = createComponent("sku-header");
|
|
10
|
-
|
|
11
|
+
const _sfc_main$4 = create$4({
|
|
11
12
|
props: {
|
|
12
13
|
goods: {
|
|
13
14
|
type: Object,
|
|
@@ -47,9 +48,9 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
47
48
|
])
|
|
48
49
|
]);
|
|
49
50
|
}
|
|
50
|
-
_sfc_main$4
|
|
51
|
+
var SkuHeader = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
|
|
51
52
|
const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
|
|
52
|
-
|
|
53
|
+
const _sfc_main$3 = create$3({
|
|
53
54
|
props: {
|
|
54
55
|
sku: {
|
|
55
56
|
type: Array,
|
|
@@ -67,13 +68,13 @@ var _sfc_main$3 = create$3({
|
|
|
67
68
|
skuInfo.value = [].slice.call(props.sku);
|
|
68
69
|
}
|
|
69
70
|
});
|
|
70
|
-
const changeSaleChild = (attrItem,
|
|
71
|
+
const changeSaleChild = (attrItem, index2, parentItem, parentIndex) => {
|
|
71
72
|
if (attrItem.checkFlag || attrItem.disable) {
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
75
|
emit("selectSku", {
|
|
75
76
|
sku: attrItem,
|
|
76
|
-
skuIndex:
|
|
77
|
+
skuIndex: index2,
|
|
77
78
|
parentSku: parentItem,
|
|
78
79
|
parentIndex
|
|
79
80
|
});
|
|
@@ -90,7 +91,7 @@ const _hoisted_3$2 = { class: "nut-sku-select-item-skus" };
|
|
|
90
91
|
const _hoisted_4$2 = ["onClick"];
|
|
91
92
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
92
93
|
return openBlock(), createElementBlock("view", _hoisted_1$3, [
|
|
93
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item,
|
|
94
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item, index2) => {
|
|
94
95
|
return openBlock(), createElementBlock("view", {
|
|
95
96
|
class: "nut-sku-select-item",
|
|
96
97
|
key: item.id
|
|
@@ -100,7 +101,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
100
101
|
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (itemAttr, itemAttrIndex) => {
|
|
101
102
|
return openBlock(), createElementBlock("view", {
|
|
102
103
|
class: normalizeClass(["nut-sku-select-item-skus-sku", [{ active: !itemAttr.disable && itemAttr.active }, { disable: itemAttr.disable }]]),
|
|
103
|
-
onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item,
|
|
104
|
+
onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item, index2),
|
|
104
105
|
key: itemAttr.name
|
|
105
106
|
}, toDisplayString(itemAttr.name), 11, _hoisted_4$2);
|
|
106
107
|
}), 128))
|
|
@@ -109,9 +110,9 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
109
110
|
}), 128))
|
|
110
111
|
]);
|
|
111
112
|
}
|
|
112
|
-
_sfc_main$3
|
|
113
|
+
var SkuSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
113
114
|
const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
|
|
114
|
-
|
|
115
|
+
const _sfc_main$2 = create$2({
|
|
115
116
|
props: {
|
|
116
117
|
stepperMax: {
|
|
117
118
|
type: [Number, String],
|
|
@@ -196,9 +197,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
196
197
|
])
|
|
197
198
|
]);
|
|
198
199
|
}
|
|
199
|
-
_sfc_main$2
|
|
200
|
+
var SkuStepper = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
|
|
200
201
|
const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
|
|
201
|
-
|
|
202
|
+
const _sfc_main$1 = create$1({
|
|
202
203
|
props: {
|
|
203
204
|
btnOptions: {
|
|
204
205
|
type: Array,
|
|
@@ -274,9 +275,9 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
274
275
|
])) : createCommentVNode("", true)
|
|
275
276
|
])) : createCommentVNode("", true);
|
|
276
277
|
}
|
|
277
|
-
_sfc_main$1
|
|
278
|
+
var SkuOperate = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
278
279
|
const { componentName, create } = createComponent("sku");
|
|
279
|
-
|
|
280
|
+
const _sfc_main = create({
|
|
280
281
|
props: {
|
|
281
282
|
visible: {
|
|
282
283
|
type: Boolean,
|
|
@@ -290,10 +291,6 @@ var _sfc_main = create({
|
|
|
290
291
|
type: Object,
|
|
291
292
|
default: {}
|
|
292
293
|
},
|
|
293
|
-
showSaleLimit: {
|
|
294
|
-
type: Boolean,
|
|
295
|
-
default: false
|
|
296
|
-
},
|
|
297
294
|
stepperMax: {
|
|
298
295
|
type: [Number, String],
|
|
299
296
|
default: 99999
|
|
@@ -302,14 +299,6 @@ var _sfc_main = create({
|
|
|
302
299
|
type: [Number, String],
|
|
303
300
|
default: 1
|
|
304
301
|
},
|
|
305
|
-
purchased: {
|
|
306
|
-
type: [Number, String],
|
|
307
|
-
default: 0
|
|
308
|
-
},
|
|
309
|
-
showSaleLowest: {
|
|
310
|
-
type: Boolean,
|
|
311
|
-
default: false
|
|
312
|
-
},
|
|
313
302
|
btnOptions: {
|
|
314
303
|
type: Array,
|
|
315
304
|
default: () => ["confirm"]
|
|
@@ -318,17 +307,13 @@ var _sfc_main = create({
|
|
|
318
307
|
type: String,
|
|
319
308
|
default: "\u8D2D\u4E70\u6570\u91CF"
|
|
320
309
|
},
|
|
321
|
-
|
|
322
|
-
type: [Function, Boolean],
|
|
323
|
-
default: false
|
|
324
|
-
},
|
|
325
|
-
saleLimitText: {
|
|
310
|
+
stepperExtraText: {
|
|
326
311
|
type: [Function, Boolean],
|
|
327
312
|
default: false
|
|
328
313
|
},
|
|
329
|
-
|
|
330
|
-
type:
|
|
331
|
-
default:
|
|
314
|
+
btnExtraText: {
|
|
315
|
+
type: String,
|
|
316
|
+
default: ""
|
|
332
317
|
},
|
|
333
318
|
buyText: {
|
|
334
319
|
type: String,
|
|
@@ -353,13 +338,14 @@ var _sfc_main = create({
|
|
|
353
338
|
"close",
|
|
354
339
|
"reduce",
|
|
355
340
|
"add",
|
|
356
|
-
"overLimit"
|
|
341
|
+
"overLimit",
|
|
342
|
+
"clickOverlay"
|
|
357
343
|
],
|
|
358
344
|
components: {
|
|
359
|
-
SkuHeader
|
|
360
|
-
SkuSelect
|
|
361
|
-
SkuStepper
|
|
362
|
-
SkuOperate
|
|
345
|
+
SkuHeader,
|
|
346
|
+
SkuSelect,
|
|
347
|
+
SkuStepper,
|
|
348
|
+
SkuOperate
|
|
363
349
|
},
|
|
364
350
|
setup(props, { emit, slots }) {
|
|
365
351
|
const showPopup = ref(props.visible);
|
|
@@ -372,6 +358,9 @@ var _sfc_main = create({
|
|
|
372
358
|
close();
|
|
373
359
|
}
|
|
374
360
|
});
|
|
361
|
+
onMounted(() => {
|
|
362
|
+
console.log("\u66F4\u65B0\u53C2\u6570");
|
|
363
|
+
});
|
|
375
364
|
const getSlots = (name) => slots[name];
|
|
376
365
|
const selectSku = (skus) => {
|
|
377
366
|
emit("selectSku", skus);
|
|
@@ -477,32 +466,33 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
477
466
|
stepperTitle: _ctx.stepperTitle,
|
|
478
467
|
stepperMax: _ctx.stepperMax,
|
|
479
468
|
stepperMin: _ctx.stepperMin,
|
|
480
|
-
|
|
481
|
-
showSaleLimit: _ctx.showSaleLimit,
|
|
482
|
-
showSaleLowest: _ctx.showSaleLowest,
|
|
483
|
-
saleLowestText: _ctx.saleLowestText,
|
|
484
|
-
saleLimitText: _ctx.saleLimitText,
|
|
485
|
-
purchasedText: _ctx.purchasedText,
|
|
469
|
+
stepperExtraText: _ctx.stepperExtraText,
|
|
486
470
|
onAdd: _ctx.add,
|
|
487
471
|
onReduce: _ctx.reduce,
|
|
488
472
|
onChangeStepper: _ctx.changeStepper,
|
|
489
|
-
|
|
490
|
-
}, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "
|
|
473
|
+
onOverLimit: _ctx.stepperOverLimit
|
|
474
|
+
}, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])) : createCommentVNode("", true),
|
|
491
475
|
renderSlot(_ctx.$slots, "sku-stepper-bottom")
|
|
492
476
|
]),
|
|
493
|
-
|
|
494
|
-
!_ctx.getSlots("sku-operate") ? (openBlock(), createBlock(_component_sku_operate, {
|
|
495
|
-
key: 1,
|
|
477
|
+
createVNode(_component_sku_operate, {
|
|
496
478
|
btnOptions: _ctx.btnOptions,
|
|
479
|
+
btnExtraText: _ctx.btnExtraText,
|
|
497
480
|
buyText: _ctx.buyText,
|
|
498
481
|
addCartText: _ctx.addCartText,
|
|
499
482
|
confirmText: _ctx.confirmText,
|
|
500
483
|
onClickBtnOperate: _ctx.clickBtnOperate
|
|
501
|
-
},
|
|
484
|
+
}, createSlots({ _: 2 }, [
|
|
485
|
+
_ctx.getSlots("sku-operate") ? {
|
|
486
|
+
name: "operate-btn",
|
|
487
|
+
fn: withCtx(() => [
|
|
488
|
+
renderSlot(_ctx.$slots, "sku-operate")
|
|
489
|
+
])
|
|
490
|
+
} : void 0
|
|
491
|
+
]), 1032, ["btnOptions", "btnExtraText", "buyText", "addCartText", "confirmText", "onClickBtnOperate"])
|
|
502
492
|
])
|
|
503
493
|
]),
|
|
504
494
|
_: 3
|
|
505
495
|
}, 8, ["visible"]);
|
|
506
496
|
}
|
|
507
|
-
_sfc_main
|
|
508
|
-
export {
|
|
497
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
498
|
+
export { index as default };
|
|
@@ -17,18 +17,16 @@ 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
|
-
};
|
|
23
20
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
25
22
|
* (c) 2021 @jdf2e.
|
|
26
23
|
* Released under the MIT License.
|
|
27
24
|
*/
|
|
28
25
|
import { getCurrentInstance, inject, reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, Fragment, toDisplayString, createCommentVNode } from "vue";
|
|
29
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
28
|
const { create, componentName } = createComponent("step");
|
|
31
|
-
|
|
29
|
+
const _sfc_main = create({
|
|
32
30
|
props: {
|
|
33
31
|
title: {
|
|
34
32
|
type: String,
|
|
@@ -58,9 +56,9 @@ var _sfc_main = create({
|
|
|
58
56
|
const state = reactive({
|
|
59
57
|
dot: parent.props.progressDot
|
|
60
58
|
});
|
|
61
|
-
const
|
|
59
|
+
const index2 = computed(() => parent.state.children.indexOf(proxy) + 1);
|
|
62
60
|
const getCurrentStatus = () => {
|
|
63
|
-
const activeIndex =
|
|
61
|
+
const activeIndex = index2.value;
|
|
64
62
|
if (activeIndex < +parent.props.current)
|
|
65
63
|
return "finish";
|
|
66
64
|
return activeIndex === +parent.props.current ? "process" : "wait";
|
|
@@ -76,7 +74,7 @@ var _sfc_main = create({
|
|
|
76
74
|
};
|
|
77
75
|
});
|
|
78
76
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
79
|
-
index,
|
|
77
|
+
index: index2,
|
|
80
78
|
classes
|
|
81
79
|
});
|
|
82
80
|
}
|
|
@@ -119,5 +117,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
119
117
|
])
|
|
120
118
|
], 2);
|
|
121
119
|
}
|
|
122
|
-
_sfc_main
|
|
123
|
-
export {
|
|
120
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
121
|
+
export { index as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 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
|
-
|
|
9
|
+
const _sfc_main = create({
|
|
10
10
|
props: {
|
|
11
11
|
direction: {
|
|
12
12
|
type: String,
|
|
@@ -17,21 +17,17 @@ 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
|
-
};
|
|
23
20
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.12 Sat Nov 27 2021 11:30:43 GMT+0800 (中国标准时间)
|
|
25
22
|
* (c) 2021 @jdf2e.
|
|
26
23
|
* Released under the MIT License.
|
|
27
24
|
*/
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
import { computed, ref, onMounted, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
25
|
+
import { u as useTouch } from "./index2.js";
|
|
26
|
+
import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
31
27
|
import { c as createComponent } from "./component.js";
|
|
32
|
-
import {
|
|
28
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
33
29
|
const { componentName, create } = createComponent("swipe");
|
|
34
|
-
|
|
30
|
+
const _sfc_main = create({
|
|
35
31
|
props: {
|
|
36
32
|
name: {
|
|
37
33
|
type: String,
|
|
@@ -52,29 +48,21 @@ var _sfc_main = create({
|
|
|
52
48
|
},
|
|
53
49
|
emits: ["open", "close"],
|
|
54
50
|
setup(props, { emit }) {
|
|
55
|
-
const refRandomId = Math.random().toString(36).slice(-8);
|
|
56
51
|
const classes = computed(() => {
|
|
57
52
|
const prefixCls = componentName;
|
|
58
53
|
return {
|
|
59
54
|
[prefixCls]: true
|
|
60
55
|
};
|
|
61
56
|
});
|
|
62
|
-
const getRefWidth =
|
|
63
|
-
|
|
64
|
-
return
|
|
65
|
-
};
|
|
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);
|
|
57
|
+
const getRefWidth = (ref2) => {
|
|
58
|
+
var _a;
|
|
59
|
+
return ((_a = ref2.value) == null ? void 0 : _a.clientWidth) || 0;
|
|
73
60
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
const leftRef = ref(), leftRefWidth = computed(() => {
|
|
62
|
+
return getRefWidth(leftRef);
|
|
63
|
+
});
|
|
64
|
+
const rightRef = ref(), rightRefWidth = computed(() => {
|
|
65
|
+
return getRefWidth(rightRef);
|
|
78
66
|
});
|
|
79
67
|
let opened = false;
|
|
80
68
|
let position = "";
|
|
@@ -134,7 +122,7 @@ var _sfc_main = create({
|
|
|
134
122
|
return;
|
|
135
123
|
touch.start(event);
|
|
136
124
|
},
|
|
137
|
-
|
|
125
|
+
onTouchMove(event) {
|
|
138
126
|
if (props.disabled)
|
|
139
127
|
return;
|
|
140
128
|
touch.move(event);
|
|
@@ -180,15 +168,20 @@ var _sfc_main = create({
|
|
|
180
168
|
}, touchMethods), {
|
|
181
169
|
leftRef,
|
|
182
170
|
rightRef,
|
|
183
|
-
refRandomId,
|
|
184
171
|
open,
|
|
185
172
|
close
|
|
186
173
|
});
|
|
187
174
|
}
|
|
188
175
|
});
|
|
189
|
-
const _hoisted_1 =
|
|
176
|
+
const _hoisted_1 = {
|
|
177
|
+
class: "nut-swipe__left",
|
|
178
|
+
ref: "leftRef"
|
|
179
|
+
};
|
|
190
180
|
const _hoisted_2 = { class: "nut-swipe__content" };
|
|
191
|
-
const _hoisted_3 =
|
|
181
|
+
const _hoisted_3 = {
|
|
182
|
+
class: "nut-swipe__right",
|
|
183
|
+
ref: "rightRef"
|
|
184
|
+
};
|
|
192
185
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
193
186
|
return openBlock(), createElementBlock("view", {
|
|
194
187
|
class: normalizeClass(_ctx.classes),
|
|
@@ -198,24 +191,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
198
191
|
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
|
|
199
192
|
onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
200
193
|
}, [
|
|
201
|
-
createElementVNode("view",
|
|
202
|
-
class: "nut-swipe__left",
|
|
203
|
-
ref: "leftRef",
|
|
204
|
-
id: "leftRef-" + _ctx.refRandomId
|
|
205
|
-
}, [
|
|
194
|
+
createElementVNode("view", _hoisted_1, [
|
|
206
195
|
renderSlot(_ctx.$slots, "left")
|
|
207
|
-
],
|
|
196
|
+
], 512),
|
|
208
197
|
createElementVNode("view", _hoisted_2, [
|
|
209
198
|
renderSlot(_ctx.$slots, "default")
|
|
210
199
|
]),
|
|
211
|
-
createElementVNode("view",
|
|
212
|
-
class: "nut-swipe__right",
|
|
213
|
-
ref: "rightRef",
|
|
214
|
-
id: "rightRef-" + _ctx.refRandomId
|
|
215
|
-
}, [
|
|
200
|
+
createElementVNode("view", _hoisted_3, [
|
|
216
201
|
renderSlot(_ctx.$slots, "right")
|
|
217
|
-
],
|
|
202
|
+
], 512)
|
|
218
203
|
], 38);
|
|
219
204
|
}
|
|
220
|
-
_sfc_main
|
|
221
|
-
export {
|
|
205
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
206
|
+
export { index as default };
|