@nutui/nutui 4.3.2 → 4.3.3
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 +20 -0
- package/dist/nutui.es.js +2 -4
- package/dist/nutui.js +6502 -6815
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/addresslist/AddressList.js +2 -2
- package/dist/packages/backtop/Backtop.js +79 -89
- package/dist/packages/calendar/Calendar.js +814 -3
- package/dist/packages/calendar/index.scss +0 -1
- package/dist/packages/calendarcard/CalendarCard.js +1 -1
- package/dist/packages/card/Card.js +2 -2
- package/dist/packages/circleprogress/CircleProgress.js +90 -97
- package/dist/packages/comment/Comment.js +2 -2
- package/dist/packages/ecard/Ecard.js +2 -2
- package/dist/packages/input/Input.js +7 -7
- package/dist/packages/inputnumber/InputNumber.js +83 -102
- package/dist/packages/invoice/Invoice.js +87 -138
- package/dist/packages/navbar/Navbar.js +103 -115
- package/dist/packages/progress/Progress.js +96 -115
- package/dist/packages/rate/Rate.js +98 -140
- package/dist/packages/sku/Sku.js +2 -2
- package/dist/packages/swipe/Swipe.js +96 -110
- package/dist/packages/swipegroup/SwipeGroup.js +41 -23
- package/dist/packages/tag/Tag.js +57 -66
- package/dist/packages/uploader/Uploader.js +4 -4
- package/dist/smartips/web-types.json +2 -2
- package/dist/styles/base-jdb.css +1 -1
- package/dist/styles/base-jddkh.css +1 -1
- package/dist/styles/base-jdt.css +1 -1
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/themes/jdb.scss +0 -1
- package/dist/styles/themes/jddkh.scss +0 -1
- package/dist/styles/themes/jdt.scss +0 -1
- package/dist/styles/variables-jdb.scss +0 -1
- package/dist/styles/variables-jddkh.scss +0 -1
- package/dist/styles/variables-jdt.scss +0 -1
- package/dist/styles/variables.scss +0 -1
- package/dist/types/__VUE/backtop/backtop.vue.d.ts +87 -0
- package/dist/types/__VUE/backtop/index.d.ts +5 -0
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +2 -12
- package/dist/types/__VUE/circleprogress/circle-progress.vue.d.ts +88 -0
- package/dist/types/__VUE/circleprogress/index.d.ts +6 -0
- package/dist/types/__VUE/inputnumber/index.d.ts +5 -0
- package/dist/types/__VUE/inputnumber/input-number.vue.d.ts +112 -0
- package/dist/types/__VUE/invoice/index.d.ts +6 -0
- package/dist/types/__VUE/invoice/invoice.vue.d.ts +59 -0
- package/dist/types/__VUE/invoice/types.d.ts +12 -0
- package/dist/types/__VUE/navbar/index.d.ts +5 -0
- package/dist/types/__VUE/navbar/navbar.vue.d.ts +125 -0
- package/dist/types/__VUE/progress/index.d.ts +6 -0
- package/dist/types/__VUE/progress/progress.vue.d.ts +91 -0
- package/dist/types/__VUE/rate/index.d.ts +5 -0
- package/dist/types/__VUE/rate/rate.vue.d.ts +208 -0
- package/dist/types/__VUE/swipe/index.d.ts +6 -0
- package/dist/types/__VUE/swipe/swipe.vue.d.ts +79 -0
- package/dist/types/__VUE/swipe/types.d.ts +1 -0
- package/dist/types/__VUE/swipegroup/index.d.ts +5 -0
- package/dist/types/__VUE/swipegroup/swipe-group.vue.d.ts +47 -0
- package/dist/types/__VUE/tag/index.d.ts +6 -0
- package/dist/types/__VUE/tag/tag.vue.d.ts +90 -0
- package/dist/types/__VUE/tag/types.d.ts +1 -1
- package/dist/types/index.d.ts +22 -13
- package/package.json +1 -1
- package/dist/packages/calendaritem/CalendarItem.js +0 -819
- package/dist/packages/calendaritem/index.css +0 -0
- package/dist/packages/calendaritem/index.mjs +0 -2
- package/dist/packages/calendaritem/index.scss +0 -0
- package/dist/packages/calendaritem/style/css.mjs +0 -2
- package/dist/packages/calendaritem/style/index.mjs +0 -2
- package/dist/types/__VUE/backtop/index.vue.d.ts +0 -98
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +0 -95
- package/dist/types/__VUE/inputnumber/index.vue.d.ts +0 -117
- package/dist/types/__VUE/invoice/index.vue.d.ts +0 -53
- package/dist/types/__VUE/navbar/index.vue.d.ts +0 -129
- package/dist/types/__VUE/progress/index.vue.d.ts +0 -120
- package/dist/types/__VUE/rate/index.vue.d.ts +0 -240
- package/dist/types/__VUE/swipe/index.vue.d.ts +0 -70
- package/dist/types/__VUE/swipegroup/index.vue.d.ts +0 -26
- package/dist/types/__VUE/tag/index.vue.d.ts +0 -94
|
@@ -1,55 +1,44 @@
|
|
|
1
|
-
|
|
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 { defineComponent, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createVNode, unref } from "vue";
|
|
2
21
|
import { Checked } from "@nutui/icons-vue";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
22
|
+
import { w as withInstall } from "../with-install-p59gYYU_.js";
|
|
23
|
+
const _hoisted_1 = { class: "nut-progress" };
|
|
24
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
25
|
+
name: "NutProgress"
|
|
26
|
+
}), {
|
|
27
|
+
__name: "progress",
|
|
8
28
|
props: {
|
|
9
|
-
percentage: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
type: String,
|
|
20
|
-
default: "text"
|
|
21
|
-
},
|
|
22
|
-
strokeWidth: {
|
|
23
|
-
type: [Number, String],
|
|
24
|
-
default: ""
|
|
25
|
-
},
|
|
26
|
-
textInside: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false
|
|
29
|
-
},
|
|
30
|
-
showText: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: true
|
|
33
|
-
},
|
|
34
|
-
strokeColor: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: ""
|
|
37
|
-
},
|
|
38
|
-
textColor: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: ""
|
|
41
|
-
},
|
|
42
|
-
textBackground: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: ""
|
|
45
|
-
},
|
|
46
|
-
isShowPercentage: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: true
|
|
49
|
-
}
|
|
29
|
+
percentage: { default: 0 },
|
|
30
|
+
size: { default: "base" },
|
|
31
|
+
status: { default: "text" },
|
|
32
|
+
strokeWidth: {},
|
|
33
|
+
textInside: { type: Boolean, default: false },
|
|
34
|
+
showText: { type: Boolean, default: true },
|
|
35
|
+
strokeColor: {},
|
|
36
|
+
textColor: {},
|
|
37
|
+
textBackground: {},
|
|
38
|
+
isShowPercentage: { type: Boolean, default: true }
|
|
50
39
|
},
|
|
51
|
-
setup(
|
|
52
|
-
const
|
|
40
|
+
setup(__props) {
|
|
41
|
+
const props = __props;
|
|
53
42
|
const height = computed(() => {
|
|
54
43
|
if (props.strokeWidth) {
|
|
55
44
|
return props.strokeWidth + "px";
|
|
@@ -70,73 +59,65 @@ const _sfc_main = create({
|
|
|
70
59
|
color: props.textColor || ""
|
|
71
60
|
};
|
|
72
61
|
});
|
|
73
|
-
return {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
64
|
+
createElementVNode("div", {
|
|
65
|
+
class: normalizeClass(["nut-progress-outer", [_ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "", _ctx.size ? "nut-progress-" + _ctx.size : ""]]),
|
|
66
|
+
style: normalizeStyle({ height: height.value })
|
|
67
|
+
}, [
|
|
68
|
+
createElementVNode("div", {
|
|
69
|
+
class: normalizeClass(["nut-progress-inner", _ctx.status === "active" ? "nut-active" : ""]),
|
|
70
|
+
style: normalizeStyle(bgStyle.value)
|
|
71
|
+
}, null, 6),
|
|
72
|
+
_ctx.showText && _ctx.textInside && !_ctx.$slots.default ? (openBlock(), createElementBlock("div", {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "nut-progress-text nut-progress-insidetext",
|
|
75
|
+
style: normalizeStyle({
|
|
76
|
+
lineHeight: height.value,
|
|
77
|
+
left: `${percentage.value}%`,
|
|
78
|
+
transform: `translate(-${+percentage.value}%,-50%)`,
|
|
79
|
+
background: _ctx.textBackground || _ctx.strokeColor
|
|
80
|
+
})
|
|
81
|
+
}, [
|
|
82
|
+
createElementVNode("span", {
|
|
83
|
+
style: normalizeStyle(textStyle.value)
|
|
84
|
+
}, toDisplayString(percentage.value) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)
|
|
85
|
+
], 4)) : createCommentVNode("", true),
|
|
86
|
+
_ctx.showText && _ctx.textInside && _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
|
|
87
|
+
key: 1,
|
|
88
|
+
class: "nut-progress-slot",
|
|
89
|
+
style: normalizeStyle({
|
|
90
|
+
position: `absolute`,
|
|
91
|
+
top: `50%`,
|
|
92
|
+
left: `${percentage.value}%`,
|
|
93
|
+
transform: `translate(-${+percentage.value}%,-50%)`
|
|
94
|
+
})
|
|
95
|
+
}, [
|
|
96
|
+
renderSlot(_ctx.$slots, "default")
|
|
97
|
+
], 4)) : createCommentVNode("", true)
|
|
98
|
+
], 6),
|
|
99
|
+
_ctx.showText && !_ctx.textInside ? (openBlock(), createElementBlock("div", {
|
|
100
|
+
key: 0,
|
|
101
|
+
class: "nut-progress-text",
|
|
102
|
+
style: normalizeStyle({ lineHeight: height.value })
|
|
103
|
+
}, [
|
|
104
|
+
_ctx.status === "text" || _ctx.status === "active" ? (openBlock(), createElementBlock("span", {
|
|
105
|
+
key: 0,
|
|
106
|
+
style: normalizeStyle(textStyle.value)
|
|
107
|
+
}, toDisplayString(percentage.value) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)) : _ctx.status === "icon" ? renderSlot(_ctx.$slots, "icon-name", { key: 1 }, () => [
|
|
108
|
+
createVNode(unref(Checked), {
|
|
109
|
+
width: "15px",
|
|
110
|
+
height: "15px",
|
|
111
|
+
color: "#439422"
|
|
112
|
+
})
|
|
113
|
+
]) : createCommentVNode("", true)
|
|
114
|
+
], 4)) : createCommentVNode("", true)
|
|
115
|
+
]);
|
|
79
116
|
};
|
|
80
117
|
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
84
|
-
const _component_Checked = resolveComponent("Checked");
|
|
85
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
86
|
-
createElementVNode("div", {
|
|
87
|
-
class: normalizeClass(["nut-progress-outer", [_ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "", _ctx.size ? "nut-progress-" + _ctx.size : ""]]),
|
|
88
|
-
style: normalizeStyle({ height: _ctx.height })
|
|
89
|
-
}, [
|
|
90
|
-
createElementVNode("div", {
|
|
91
|
-
class: normalizeClass(["nut-progress-inner", _ctx.status === "active" ? "nut-active" : ""]),
|
|
92
|
-
style: normalizeStyle(_ctx.bgStyle)
|
|
93
|
-
}, null, 6),
|
|
94
|
-
_ctx.showText && _ctx.textInside && !_ctx.slotDefault ? (openBlock(), createElementBlock("div", {
|
|
95
|
-
key: 0,
|
|
96
|
-
class: "nut-progress-text nut-progress-insidetext",
|
|
97
|
-
style: normalizeStyle({
|
|
98
|
-
lineHeight: _ctx.height,
|
|
99
|
-
left: `${_ctx.percentage}%`,
|
|
100
|
-
transform: `translate(-${+_ctx.percentage}%,-50%)`,
|
|
101
|
-
background: _ctx.textBackground || _ctx.strokeColor
|
|
102
|
-
})
|
|
103
|
-
}, [
|
|
104
|
-
createElementVNode("span", {
|
|
105
|
-
style: normalizeStyle(_ctx.textStyle)
|
|
106
|
-
}, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)
|
|
107
|
-
], 4)) : createCommentVNode("", true),
|
|
108
|
-
_ctx.showText && _ctx.textInside && _ctx.slotDefault ? (openBlock(), createElementBlock("div", {
|
|
109
|
-
key: 1,
|
|
110
|
-
class: "nut-progress-slot",
|
|
111
|
-
style: normalizeStyle({
|
|
112
|
-
position: `absolute`,
|
|
113
|
-
top: `50%`,
|
|
114
|
-
left: `${_ctx.percentage}%`,
|
|
115
|
-
transform: `translate(-${+_ctx.percentage}%,-50%)`
|
|
116
|
-
})
|
|
117
|
-
}, [
|
|
118
|
-
renderSlot(_ctx.$slots, "default")
|
|
119
|
-
], 4)) : createCommentVNode("", true)
|
|
120
|
-
], 6),
|
|
121
|
-
_ctx.showText && !_ctx.textInside ? (openBlock(), createElementBlock("div", {
|
|
122
|
-
key: 0,
|
|
123
|
-
class: "nut-progress-text",
|
|
124
|
-
style: normalizeStyle({ lineHeight: _ctx.height })
|
|
125
|
-
}, [
|
|
126
|
-
_ctx.status === "text" || _ctx.status === "active" ? (openBlock(), createElementBlock("span", {
|
|
127
|
-
key: 0,
|
|
128
|
-
style: normalizeStyle(_ctx.textStyle)
|
|
129
|
-
}, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)) : _ctx.status === "icon" ? renderSlot(_ctx.$slots, "icon-name", { key: 1 }, () => [
|
|
130
|
-
createVNode(_component_Checked, {
|
|
131
|
-
width: "15px",
|
|
132
|
-
height: "15px",
|
|
133
|
-
color: "#439422"
|
|
134
|
-
})
|
|
135
|
-
]) : createCommentVNode("", true)
|
|
136
|
-
], 4)) : createCommentVNode("", true)
|
|
137
|
-
]);
|
|
138
|
-
}
|
|
139
|
-
const NutProgress = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
118
|
+
}));
|
|
119
|
+
withInstall(_sfc_main);
|
|
140
120
|
export {
|
|
141
|
-
|
|
121
|
+
_sfc_main as Progress,
|
|
122
|
+
_sfc_main as default
|
|
142
123
|
};
|
|
@@ -17,67 +17,45 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { toRef, ref, openBlock, createElementBlock, Fragment, renderList, normalizeStyle, createElementVNode, createBlock, resolveDynamicComponent, normalizeClass, createCommentVNode } from "vue";
|
|
20
|
+
import { defineComponent, toRef, ref, openBlock, createElementBlock, Fragment, renderList, unref, normalizeStyle, createElementVNode, createBlock, resolveDynamicComponent, normalizeClass, createCommentVNode } from "vue";
|
|
21
21
|
import { StarFillN } from "@nutui/icons-vue";
|
|
22
|
-
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
23
22
|
import { r as renderIcon } from "../renderIcon--EgZu5_5.js";
|
|
24
23
|
import { p as pxCheck } from "../pxCheck-OnXlN1NC.js";
|
|
25
24
|
import { u as useTouch } from "../index-084nl_oE.js";
|
|
26
25
|
import { u as useFormDisabled } from "../common-FZL3qC99.js";
|
|
27
|
-
import {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
26
|
+
import { w as withInstall } from "../with-install-p59gYYU_.js";
|
|
27
|
+
const _hoisted_1 = ["id"];
|
|
28
|
+
const _hoisted_2 = { class: "nut-rate-item__icon--full" };
|
|
29
|
+
const _hoisted_3 = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "nut-rate-item__icon--half"
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_4 = {
|
|
34
|
+
key: 1,
|
|
35
|
+
class: "nut-rate-item__icon--half"
|
|
36
|
+
};
|
|
37
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
38
|
+
name: "NutRate"
|
|
39
|
+
}), {
|
|
40
|
+
__name: "rate",
|
|
30
41
|
props: {
|
|
31
|
-
count: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return StarFillN;
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
size: {
|
|
46
|
-
type: [String, Number],
|
|
47
|
-
default: void 0
|
|
48
|
-
},
|
|
49
|
-
activeColor: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: ""
|
|
52
|
-
},
|
|
53
|
-
voidColor: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: ""
|
|
56
|
-
},
|
|
57
|
-
readonly: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: false
|
|
60
|
-
},
|
|
61
|
-
disabled: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: false
|
|
64
|
-
},
|
|
65
|
-
allowHalf: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: false
|
|
68
|
-
},
|
|
69
|
-
touchable: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
default: true
|
|
72
|
-
},
|
|
73
|
-
spacing: {
|
|
74
|
-
type: [String, Number],
|
|
75
|
-
default: void 0
|
|
76
|
-
}
|
|
42
|
+
count: { default: 5 },
|
|
43
|
+
modelValue: { default: 0 },
|
|
44
|
+
customIcon: { default: () => StarFillN },
|
|
45
|
+
size: {},
|
|
46
|
+
activeColor: { default: "" },
|
|
47
|
+
voidColor: { default: "" },
|
|
48
|
+
readonly: { type: Boolean, default: false },
|
|
49
|
+
disabled: { type: Boolean, default: false },
|
|
50
|
+
allowHalf: { type: Boolean, default: false },
|
|
51
|
+
touchable: { type: Boolean, default: true },
|
|
52
|
+
spacing: {}
|
|
77
53
|
},
|
|
78
|
-
components: { StarFillN },
|
|
79
54
|
emits: ["update:modelValue", "change"],
|
|
80
|
-
setup(
|
|
55
|
+
setup(__props, { emit: __emit }) {
|
|
56
|
+
const props = __props;
|
|
57
|
+
const emit = __emit;
|
|
58
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
81
59
|
const disabled = useFormDisabled(toRef(props, "disabled"));
|
|
82
60
|
const rateRefs = ref([]);
|
|
83
61
|
const updateVal = (value) => {
|
|
@@ -114,97 +92,77 @@ const _sfc_main = create({
|
|
|
114
92
|
return v;
|
|
115
93
|
};
|
|
116
94
|
const touch = useTouch();
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
updateVal(getScoreByPosition(touch.moveX.value, rateRefs, props.allowHalf));
|
|
131
|
-
}
|
|
95
|
+
const onTouchStart = (event) => {
|
|
96
|
+
if (!props.touchable || props.readonly)
|
|
97
|
+
return;
|
|
98
|
+
touch.start(event);
|
|
99
|
+
};
|
|
100
|
+
const onTouchMove = (event) => {
|
|
101
|
+
if (!props.touchable)
|
|
102
|
+
return;
|
|
103
|
+
touch.move(event);
|
|
104
|
+
if (touch.isHorizontal()) {
|
|
105
|
+
if (rateRefs.value) {
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
updateVal(getScoreByPosition(touch.moveX.value, rateRefs, props.allowHalf));
|
|
132
108
|
}
|
|
133
109
|
}
|
|
134
110
|
};
|
|
135
|
-
|
|
136
|
-
return __spreadProps(__spreadValues({}, touchMethods), {
|
|
137
|
-
onClick,
|
|
138
|
-
pxCheck,
|
|
139
|
-
rateRefs,
|
|
140
|
-
refRandomId,
|
|
141
|
-
renderIcon,
|
|
142
|
-
slots,
|
|
143
|
-
disabled
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
const _hoisted_1 = ["id"];
|
|
148
|
-
const _hoisted_2 = { class: "nut-rate-item__icon--full" };
|
|
149
|
-
const _hoisted_3 = {
|
|
150
|
-
key: 0,
|
|
151
|
-
class: "nut-rate-item__icon--half"
|
|
152
|
-
};
|
|
153
|
-
const _hoisted_4 = {
|
|
154
|
-
key: 1,
|
|
155
|
-
class: "nut-rate-item__icon--half"
|
|
156
|
-
};
|
|
157
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
158
|
-
return openBlock(), createElementBlock("view", {
|
|
159
|
-
class: "nut-rate",
|
|
160
|
-
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
161
|
-
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args))
|
|
162
|
-
}, [
|
|
163
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(Number(_ctx.count), (n) => {
|
|
111
|
+
return (_ctx, _cache) => {
|
|
164
112
|
return openBlock(), createElementBlock("view", {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
ref: "rateRefs",
|
|
169
|
-
class: "nut-rate-item",
|
|
170
|
-
style: normalizeStyle(n < Number(_ctx.count) ? { marginRight: _ctx.pxCheck(_ctx.spacing) } : {})
|
|
113
|
+
class: "nut-rate",
|
|
114
|
+
onTouchstart: onTouchStart,
|
|
115
|
+
onTouchmove: onTouchMove
|
|
171
116
|
}, [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
117
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(Number(_ctx.count), (n) => {
|
|
118
|
+
return openBlock(), createElementBlock("view", {
|
|
119
|
+
id: "rateRefs-" + unref(refRandomId) + n,
|
|
120
|
+
key: n,
|
|
121
|
+
ref_for: true,
|
|
122
|
+
ref_key: "rateRefs",
|
|
123
|
+
ref: rateRefs,
|
|
124
|
+
class: "nut-rate-item",
|
|
125
|
+
style: normalizeStyle(n < Number(_ctx.count) ? { marginRight: unref(pxCheck)(_ctx.spacing) } : {})
|
|
126
|
+
}, [
|
|
127
|
+
createElementVNode("view", _hoisted_2, [
|
|
128
|
+
(openBlock(), createBlock(resolveDynamicComponent(
|
|
129
|
+
unref(renderIcon)(_ctx.customIcon, {
|
|
130
|
+
width: _ctx.size,
|
|
131
|
+
height: _ctx.size,
|
|
132
|
+
size: _ctx.size,
|
|
133
|
+
color: n <= Number(_ctx.modelValue) ? _ctx.activeColor : _ctx.voidColor
|
|
134
|
+
})
|
|
135
|
+
), {
|
|
136
|
+
class: normalizeClass(["nut-rate-item__icon", { "nut-rate-item__icon--disabled": unref(disabled) || n > Number(_ctx.modelValue) }]),
|
|
137
|
+
onClick: ($event) => onClick(1, n)
|
|
138
|
+
}, null, 8, ["class", "onClick"]))
|
|
139
|
+
]),
|
|
140
|
+
_ctx.allowHalf && Number(_ctx.modelValue) + 1 > n ? (openBlock(), createElementBlock("view", _hoisted_3, [
|
|
141
|
+
(openBlock(), createBlock(resolveDynamicComponent(
|
|
142
|
+
unref(renderIcon)(_ctx.customIcon, {
|
|
143
|
+
width: _ctx.size,
|
|
144
|
+
height: _ctx.size,
|
|
145
|
+
size: _ctx.size,
|
|
146
|
+
color: n <= Number(_ctx.modelValue) + 1 ? _ctx.activeColor : _ctx.voidColor
|
|
147
|
+
})
|
|
148
|
+
), {
|
|
149
|
+
class: "nut-rate-item__icon",
|
|
150
|
+
onClick: ($event) => onClick(2, n)
|
|
151
|
+
}, null, 8, ["onClick"]))
|
|
152
|
+
])) : _ctx.allowHalf && Number(_ctx.modelValue) + 1 < n ? (openBlock(), createElementBlock("view", _hoisted_4, [
|
|
153
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(renderIcon)(_ctx.customIcon, { width: _ctx.size, height: _ctx.size, size: _ctx.size, color: _ctx.voidColor })), {
|
|
154
|
+
class: "nut-rate-item__icon nut-rate-item__icon--disabled",
|
|
155
|
+
onClick: ($event) => onClick(2, n)
|
|
156
|
+
}, null, 8, ["onClick"]))
|
|
157
|
+
])) : createCommentVNode("", true)
|
|
158
|
+
], 12, _hoisted_1);
|
|
159
|
+
}), 128))
|
|
160
|
+
], 32);
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}));
|
|
164
|
+
withInstall(_sfc_main);
|
|
208
165
|
export {
|
|
209
|
-
|
|
166
|
+
_sfc_main as Rate,
|
|
167
|
+
_sfc_main as default
|
|
210
168
|
};
|
package/dist/packages/sku/Sku.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Price as _sfc_main$5 } from "../price/Price.js";
|
|
|
3
3
|
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
4
4
|
import { u as useLocale } from "../index-s3RgMhc7.js";
|
|
5
5
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
|
|
6
|
-
import
|
|
6
|
+
import { InputNumber as _sfc_main$6 } from "../inputnumber/InputNumber.js";
|
|
7
7
|
import { N as NutPopup } from "../index-BqB5dTeo.js";
|
|
8
8
|
const { create: create$4 } = createComponent("sku-header");
|
|
9
9
|
const cN$1 = "NutSkuHeader";
|
|
@@ -144,7 +144,7 @@ const _sfc_main$2 = create$2({
|
|
|
144
144
|
},
|
|
145
145
|
emits: ["click", "changeSku", "changeStepper", "clickBtnOptions", "overLimit", "reduce", "add"],
|
|
146
146
|
components: {
|
|
147
|
-
NutInputNumber
|
|
147
|
+
NutInputNumber: _sfc_main$6
|
|
148
148
|
},
|
|
149
149
|
setup(props, { emit }) {
|
|
150
150
|
const goodsCount = ref(props.stepperMin);
|