@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
|
@@ -402,7 +402,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
402
402
|
change([day]);
|
|
403
403
|
} else if (len === 1) {
|
|
404
404
|
const t = compareDay(innerValue.value[0], day);
|
|
405
|
-
if (t ===
|
|
405
|
+
if (t === null || t === void 0) {
|
|
406
406
|
change([]);
|
|
407
407
|
} else if (t < 0) {
|
|
408
408
|
change([innerValue.value[0], day]);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
2
2
|
import { resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, createVNode, createCommentVNode, withCtx, createTextVNode } from "vue";
|
|
3
3
|
import { Price as _sfc_main$1 } from "../price/Price.js";
|
|
4
|
-
import
|
|
4
|
+
import { Tag as _sfc_main$2 } from "../tag/Tag.js";
|
|
5
5
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
|
|
6
6
|
const { create } = createComponent("card");
|
|
7
7
|
const _sfc_main = create({
|
|
8
8
|
components: {
|
|
9
9
|
NutPrice: _sfc_main$1,
|
|
10
|
-
NutTag
|
|
10
|
+
NutTag: _sfc_main$2
|
|
11
11
|
},
|
|
12
12
|
props: {
|
|
13
13
|
imgUrl: {
|
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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, normalizeStyle, createElementVNode, unref, Fragment, renderList, renderSlot, toDisplayString } from "vue";
|
|
3
21
|
import { k as isObject } from "../util-4Jkyw4BJ.js";
|
|
4
|
-
import {
|
|
5
|
-
const {
|
|
6
|
-
const
|
|
22
|
+
import { w as withInstall } from "../with-install-p59gYYU_.js";
|
|
23
|
+
const _hoisted_1 = { viewBox: "0 0 100 100" };
|
|
24
|
+
const _hoisted_2 = ["id"];
|
|
25
|
+
const _hoisted_3 = ["offset", "stop-color"];
|
|
26
|
+
const _hoisted_4 = ["d", "stroke-width"];
|
|
27
|
+
const _hoisted_5 = ["d", "stroke", "stroke-linecap", "stroke-width"];
|
|
28
|
+
const _hoisted_6 = { class: "nut-circle-progress__text" };
|
|
29
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
30
|
+
name: "NutCircleProgress"
|
|
31
|
+
}), {
|
|
32
|
+
__name: "circle-progress",
|
|
7
33
|
props: {
|
|
8
|
-
progress: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
radius: {
|
|
17
|
-
type: [Number, String],
|
|
18
|
-
default: 50
|
|
19
|
-
},
|
|
20
|
-
strokeLinecap: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: "round"
|
|
23
|
-
},
|
|
24
|
-
color: {
|
|
25
|
-
type: [String, Object],
|
|
26
|
-
default: ""
|
|
27
|
-
},
|
|
28
|
-
pathColor: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: ""
|
|
31
|
-
},
|
|
32
|
-
clockwise: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: true
|
|
35
|
-
}
|
|
34
|
+
progress: { default: 0 },
|
|
35
|
+
strokeWidth: { default: 5 },
|
|
36
|
+
radius: { default: 50 },
|
|
37
|
+
strokeLinecap: { default: "round" },
|
|
38
|
+
color: { default: "#fa2c19" },
|
|
39
|
+
pathColor: { default: "#d9d9d9" },
|
|
40
|
+
clockwise: { type: Boolean, default: true }
|
|
36
41
|
},
|
|
37
|
-
setup(
|
|
42
|
+
setup(__props) {
|
|
43
|
+
const props = __props;
|
|
38
44
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
39
45
|
const path = computed(() => {
|
|
40
46
|
const isWise = props.clockwise ? 1 : 0;
|
|
@@ -74,70 +80,57 @@ const _sfc_main = create({
|
|
|
74
80
|
});
|
|
75
81
|
return stopArr;
|
|
76
82
|
});
|
|
77
|
-
return {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
return (_ctx, _cache) => {
|
|
84
|
+
return openBlock(), createElementBlock("div", {
|
|
85
|
+
class: "nut-circle-progress",
|
|
86
|
+
style: normalizeStyle({ height: Number(_ctx.radius) * 2 + "px", width: Number(_ctx.radius) * 2 + "px" })
|
|
87
|
+
}, [
|
|
88
|
+
(openBlock(), createElementBlock("svg", _hoisted_1, [
|
|
89
|
+
createElementVNode("defs", null, [
|
|
90
|
+
createElementVNode("linearGradient", {
|
|
91
|
+
id: unref(refRandomId),
|
|
92
|
+
x1: "100%",
|
|
93
|
+
y1: "0%",
|
|
94
|
+
x2: "0%",
|
|
95
|
+
y2: "0%"
|
|
96
|
+
}, [
|
|
97
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(stop.value, (item, index) => {
|
|
98
|
+
return openBlock(), createElementBlock("stop", {
|
|
99
|
+
key: index,
|
|
100
|
+
offset: item.key,
|
|
101
|
+
"stop-color": item.value
|
|
102
|
+
}, null, 8, _hoisted_3);
|
|
103
|
+
}), 128))
|
|
104
|
+
], 8, _hoisted_2)
|
|
105
|
+
]),
|
|
106
|
+
createElementVNode("path", {
|
|
107
|
+
class: "nut-circle-progress__path",
|
|
108
|
+
style: normalizeStyle(pathStyle.value),
|
|
109
|
+
d: path.value,
|
|
110
|
+
fill: "none",
|
|
111
|
+
"stroke-width": _ctx.strokeWidth
|
|
112
|
+
}, " > ", 12, _hoisted_4),
|
|
113
|
+
createElementVNode("path", {
|
|
114
|
+
class: "nut-circle-progress__hover",
|
|
115
|
+
style: normalizeStyle(hoverStyle.value),
|
|
116
|
+
d: path.value,
|
|
117
|
+
fill: "none",
|
|
118
|
+
stroke: hoverColor.value,
|
|
119
|
+
"stroke-linecap": _ctx.strokeLinecap,
|
|
120
|
+
"stroke-width": _ctx.strokeWidth
|
|
121
|
+
}, null, 12, _hoisted_5)
|
|
122
|
+
])),
|
|
123
|
+
createElementVNode("div", _hoisted_6, [
|
|
124
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
125
|
+
createElementVNode("div", null, toDisplayString(_ctx.progress) + "%", 1)
|
|
126
|
+
])
|
|
127
|
+
])
|
|
128
|
+
], 4);
|
|
84
129
|
};
|
|
85
130
|
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const _hoisted_2 = ["id"];
|
|
89
|
-
const _hoisted_3 = ["offset", "stop-color"];
|
|
90
|
-
const _hoisted_4 = ["d", "stroke-width"];
|
|
91
|
-
const _hoisted_5 = ["d", "stroke", "stroke-linecap", "stroke-width"];
|
|
92
|
-
const _hoisted_6 = { class: "nut-circle-progress__text" };
|
|
93
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
94
|
-
return openBlock(), createElementBlock("div", {
|
|
95
|
-
class: "nut-circle-progress",
|
|
96
|
-
style: normalizeStyle({ height: Number(_ctx.radius) * 2 + "px", width: Number(_ctx.radius) * 2 + "px" })
|
|
97
|
-
}, [
|
|
98
|
-
(openBlock(), createElementBlock("svg", _hoisted_1, [
|
|
99
|
-
createElementVNode("defs", null, [
|
|
100
|
-
createElementVNode("linearGradient", {
|
|
101
|
-
id: _ctx.refRandomId,
|
|
102
|
-
x1: "100%",
|
|
103
|
-
y1: "0%",
|
|
104
|
-
x2: "0%",
|
|
105
|
-
y2: "0%"
|
|
106
|
-
}, [
|
|
107
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.stop, (item, index2) => {
|
|
108
|
-
return openBlock(), createElementBlock("stop", {
|
|
109
|
-
key: index2,
|
|
110
|
-
offset: item.key,
|
|
111
|
-
"stop-color": item.value
|
|
112
|
-
}, null, 8, _hoisted_3);
|
|
113
|
-
}), 128))
|
|
114
|
-
], 8, _hoisted_2)
|
|
115
|
-
]),
|
|
116
|
-
createElementVNode("path", {
|
|
117
|
-
class: "nut-circle-progress__path",
|
|
118
|
-
style: normalizeStyle(_ctx.pathStyle),
|
|
119
|
-
d: _ctx.path,
|
|
120
|
-
fill: "none",
|
|
121
|
-
"stroke-width": _ctx.strokeWidth
|
|
122
|
-
}, " > ", 12, _hoisted_4),
|
|
123
|
-
createElementVNode("path", {
|
|
124
|
-
class: "nut-circle-progress__hover",
|
|
125
|
-
style: normalizeStyle(_ctx.hoverStyle),
|
|
126
|
-
d: _ctx.path,
|
|
127
|
-
fill: "none",
|
|
128
|
-
stroke: _ctx.hoverColor,
|
|
129
|
-
"stroke-linecap": _ctx.strokeLinecap,
|
|
130
|
-
"stroke-width": _ctx.strokeWidth
|
|
131
|
-
}, null, 12, _hoisted_5)
|
|
132
|
-
])),
|
|
133
|
-
createElementVNode("div", _hoisted_6, [
|
|
134
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
135
|
-
createElementVNode("div", null, toDisplayString(_ctx.progress) + "%", 1)
|
|
136
|
-
])
|
|
137
|
-
])
|
|
138
|
-
], 4);
|
|
139
|
-
}
|
|
140
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
131
|
+
}));
|
|
132
|
+
withInstall(_sfc_main);
|
|
141
133
|
export {
|
|
142
|
-
|
|
134
|
+
_sfc_main as CircleProgress,
|
|
135
|
+
_sfc_main as default
|
|
143
136
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, normalizeClass, toDisplayString, renderSlot, createVNode, ref, watch, onMounted, Fragment, renderList, createBlock, computed, withCtx, normalizeStyle, createTextVNode } from "vue";
|
|
2
2
|
import { Right, Fabulous, Comment, MoreX } from "@nutui/icons-vue";
|
|
3
3
|
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
4
|
-
import
|
|
4
|
+
import { Rate as _sfc_main$4 } from "../rate/Rate.js";
|
|
5
5
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
|
|
6
6
|
import { u as useLocale } from "../index-s3RgMhc7.js";
|
|
7
7
|
const { create: create$3 } = createComponent("comment-header");
|
|
8
8
|
const _sfc_main$3 = create$3({
|
|
9
9
|
components: {
|
|
10
|
-
NutRate
|
|
10
|
+
NutRate: _sfc_main$4
|
|
11
11
|
},
|
|
12
12
|
props: {
|
|
13
13
|
type: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, withDirectives, vModelText, createTextVNode, createVNode } from "vue";
|
|
2
2
|
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
3
|
-
import
|
|
3
|
+
import { InputNumber as _sfc_main$1 } from "../inputnumber/InputNumber.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
6
|
const { create } = createComponent("ecard");
|
|
7
7
|
const cN = "NutEcard";
|
|
8
8
|
const _sfc_main = create({
|
|
9
9
|
components: {
|
|
10
|
-
NutInputNumber
|
|
10
|
+
NutInputNumber: _sfc_main$1
|
|
11
11
|
},
|
|
12
12
|
props: {
|
|
13
13
|
chooseText: {
|
|
@@ -20,14 +20,14 @@ import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
|
20
20
|
import { u as useFormDisabled } from "../common-FZL3qC99.js";
|
|
21
21
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
|
|
22
22
|
function trimExtraChar(value, char, regExp) {
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
23
|
+
const index = value.indexOf(char);
|
|
24
|
+
if (index === -1) {
|
|
25
25
|
return value;
|
|
26
26
|
}
|
|
27
|
-
if (char === "-" &&
|
|
28
|
-
return value.slice(0,
|
|
27
|
+
if (char === "-" && index !== 0) {
|
|
28
|
+
return value.slice(0, index);
|
|
29
29
|
}
|
|
30
|
-
return value.slice(0,
|
|
30
|
+
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
31
31
|
}
|
|
32
32
|
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
33
33
|
if (allowDot) {
|
|
@@ -375,7 +375,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
375
375
|
])
|
|
376
376
|
], 2);
|
|
377
377
|
}
|
|
378
|
-
const
|
|
378
|
+
const NutInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
379
379
|
export {
|
|
380
|
-
|
|
380
|
+
NutInput as default
|
|
381
381
|
};
|
|
@@ -1,55 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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, toRef, computed, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, unref, normalizeStyle } from "vue";
|
|
3
21
|
import { p as pxCheck } from "../pxCheck-OnXlN1NC.js";
|
|
4
22
|
import { Minus, Plus } from "@nutui/icons-vue";
|
|
5
23
|
import { u as useFormDisabled } from "../common-FZL3qC99.js";
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
const _sfc_main =
|
|
9
|
-
|
|
24
|
+
import { w as withInstall } from "../with-install-p59gYYU_.js";
|
|
25
|
+
const _hoisted_1 = ["min", "max", "disabled", "readonly", "value"];
|
|
26
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
27
|
+
name: "NutInputNumber"
|
|
28
|
+
}), {
|
|
29
|
+
__name: "input-number",
|
|
10
30
|
props: {
|
|
11
|
-
modelValue: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
type: [Number, String],
|
|
21
|
-
default: ""
|
|
22
|
-
},
|
|
23
|
-
min: {
|
|
24
|
-
type: [Number, String],
|
|
25
|
-
default: 1
|
|
26
|
-
},
|
|
27
|
-
max: {
|
|
28
|
-
type: [Number, String],
|
|
29
|
-
default: 9999
|
|
30
|
-
},
|
|
31
|
-
step: {
|
|
32
|
-
type: [Number, String],
|
|
33
|
-
default: 1
|
|
34
|
-
},
|
|
35
|
-
decimalPlaces: {
|
|
36
|
-
type: [Number, String],
|
|
37
|
-
default: 0
|
|
38
|
-
},
|
|
39
|
-
disabled: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false
|
|
42
|
-
},
|
|
43
|
-
readonly: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: false
|
|
46
|
-
}
|
|
31
|
+
modelValue: { default: 0 },
|
|
32
|
+
inputWidth: { default: "" },
|
|
33
|
+
buttonSize: { default: "" },
|
|
34
|
+
min: { default: 1 },
|
|
35
|
+
max: { default: 9999 },
|
|
36
|
+
step: { default: 1 },
|
|
37
|
+
decimalPlaces: { default: 0 },
|
|
38
|
+
disabled: { type: Boolean, default: false },
|
|
39
|
+
readonly: { type: Boolean, default: false }
|
|
47
40
|
},
|
|
48
41
|
emits: ["update:modelValue", "change", "blur", "focus", "reduce", "add", "overlimit"],
|
|
49
|
-
setup(
|
|
42
|
+
setup(__props, { emit: __emit }) {
|
|
43
|
+
const props = __props;
|
|
44
|
+
const emit = __emit;
|
|
50
45
|
const disabled = useFormDisabled(toRef(props, "disabled"));
|
|
51
46
|
const classes = computed(() => {
|
|
52
|
-
const prefixCls =
|
|
47
|
+
const prefixCls = "nut-input-number";
|
|
53
48
|
return {
|
|
54
49
|
[prefixCls]: true,
|
|
55
50
|
[`${prefixCls}--disabled`]: disabled.value
|
|
@@ -112,7 +107,7 @@ const _sfc_main = create({
|
|
|
112
107
|
if (props.readonly)
|
|
113
108
|
return;
|
|
114
109
|
const input = event.target;
|
|
115
|
-
let value = input.
|
|
110
|
+
let value = Number(input.value);
|
|
116
111
|
if (value < Number(props.min)) {
|
|
117
112
|
value = Number(props.min);
|
|
118
113
|
} else if (value > Number(props.max)) {
|
|
@@ -142,64 +137,50 @@ const _sfc_main = create({
|
|
|
142
137
|
}
|
|
143
138
|
}
|
|
144
139
|
);
|
|
145
|
-
return {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
140
|
+
return (_ctx, _cache) => {
|
|
141
|
+
return openBlock(), createElementBlock("view", {
|
|
142
|
+
class: normalizeClass(classes.value)
|
|
143
|
+
}, [
|
|
144
|
+
createElementVNode("view", {
|
|
145
|
+
class: normalizeClass(["nut-input-number__icon nut-input-number__left", { "nut-input-number__icon--disabled": !reduceAllow() }]),
|
|
146
|
+
onClick: reduce
|
|
147
|
+
}, [
|
|
148
|
+
renderSlot(_ctx.$slots, "left-icon", {}, () => [
|
|
149
|
+
createVNode(unref(Minus), {
|
|
150
|
+
width: unref(pxCheck)(_ctx.buttonSize),
|
|
151
|
+
height: unref(pxCheck)(_ctx.buttonSize)
|
|
152
|
+
}, null, 8, ["width", "height"])
|
|
153
|
+
])
|
|
154
|
+
], 2),
|
|
155
|
+
createElementVNode("input", {
|
|
156
|
+
type: "number",
|
|
157
|
+
min: _ctx.min,
|
|
158
|
+
max: _ctx.max,
|
|
159
|
+
style: normalizeStyle({ width: unref(pxCheck)(_ctx.inputWidth), height: unref(pxCheck)(_ctx.buttonSize) }),
|
|
160
|
+
disabled: unref(disabled),
|
|
161
|
+
readonly: _ctx.readonly,
|
|
162
|
+
value: _ctx.modelValue,
|
|
163
|
+
onInput: change,
|
|
164
|
+
onBlur: blur,
|
|
165
|
+
onFocus: focus
|
|
166
|
+
}, null, 44, _hoisted_1),
|
|
167
|
+
createElementVNode("view", {
|
|
168
|
+
class: normalizeClass(["nut-input-number__icon nut-input-number__right", { "nut-input-number__icon--disabled": !addAllow() }]),
|
|
169
|
+
onClick: add
|
|
170
|
+
}, [
|
|
171
|
+
renderSlot(_ctx.$slots, "right-icon", {}, () => [
|
|
172
|
+
createVNode(unref(Plus), {
|
|
173
|
+
width: unref(pxCheck)(_ctx.buttonSize),
|
|
174
|
+
height: unref(pxCheck)(_ctx.buttonSize)
|
|
175
|
+
}, null, 8, ["width", "height"])
|
|
176
|
+
])
|
|
177
|
+
], 2)
|
|
178
|
+
], 2);
|
|
156
179
|
};
|
|
157
180
|
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
161
|
-
const _component_Minus = resolveComponent("Minus");
|
|
162
|
-
const _component_Plus = resolveComponent("Plus");
|
|
163
|
-
return openBlock(), createElementBlock("view", {
|
|
164
|
-
class: normalizeClass(_ctx.classes)
|
|
165
|
-
}, [
|
|
166
|
-
createElementVNode("view", {
|
|
167
|
-
class: normalizeClass(["nut-input-number__icon nut-input-number__left", { "nut-input-number__icon--disabled": !_ctx.reduceAllow() }]),
|
|
168
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.reduce && _ctx.reduce(...args))
|
|
169
|
-
}, [
|
|
170
|
-
renderSlot(_ctx.$slots, "left-icon", {}, () => [
|
|
171
|
-
createVNode(_component_Minus, {
|
|
172
|
-
width: _ctx.pxCheck(_ctx.buttonSize),
|
|
173
|
-
height: _ctx.pxCheck(_ctx.buttonSize)
|
|
174
|
-
}, null, 8, ["width", "height"])
|
|
175
|
-
])
|
|
176
|
-
], 2),
|
|
177
|
-
createElementVNode("input", {
|
|
178
|
-
type: "number",
|
|
179
|
-
min: _ctx.min,
|
|
180
|
-
max: _ctx.max,
|
|
181
|
-
style: normalizeStyle({ width: _ctx.pxCheck(_ctx.inputWidth), height: _ctx.pxCheck(_ctx.buttonSize) }),
|
|
182
|
-
disabled: _ctx.disabled,
|
|
183
|
-
readonly: _ctx.readonly,
|
|
184
|
-
value: _ctx.modelValue,
|
|
185
|
-
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
186
|
-
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.blur && _ctx.blur(...args)),
|
|
187
|
-
onFocus: _cache[3] || (_cache[3] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
188
|
-
}, null, 44, _hoisted_1),
|
|
189
|
-
createElementVNode("view", {
|
|
190
|
-
class: normalizeClass(["nut-input-number__icon nut-input-number__right", { "nut-input-number__icon--disabled": !_ctx.addAllow() }]),
|
|
191
|
-
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.add && _ctx.add(...args))
|
|
192
|
-
}, [
|
|
193
|
-
renderSlot(_ctx.$slots, "right-icon", {}, () => [
|
|
194
|
-
createVNode(_component_Plus, {
|
|
195
|
-
width: _ctx.pxCheck(_ctx.buttonSize),
|
|
196
|
-
height: _ctx.pxCheck(_ctx.buttonSize)
|
|
197
|
-
}, null, 8, ["width", "height"])
|
|
198
|
-
])
|
|
199
|
-
], 2)
|
|
200
|
-
], 2);
|
|
201
|
-
}
|
|
202
|
-
const NutInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
181
|
+
}));
|
|
182
|
+
withInstall(_sfc_main);
|
|
203
183
|
export {
|
|
204
|
-
|
|
184
|
+
_sfc_main as InputNumber,
|
|
185
|
+
_sfc_main as default
|
|
205
186
|
};
|