ninemoon-ui 0.0.27 → 0.1.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.
- package/dist/components/alert/alert.d.ts +3 -11
- package/dist/components/alert/alertcomponent.vue.d.ts +22 -11
- package/dist/components/badge/badge.vue.d.ts +2 -0
- package/dist/components/carousel/carousel.vue.d.ts +29 -3
- package/dist/components/{tree/tree.vue.d.ts → carousel/clickbutton.vue.d.ts} +6 -19
- package/dist/components/check/checkbox.vue.d.ts +24 -16
- package/dist/components/check/checkgroup.vue.d.ts +15 -3
- package/dist/components/date/datepicker.vue.d.ts +28 -6
- package/dist/components/date/datepickerRange.vue.d.ts +15 -4
- package/dist/components/form/form.vue.d.ts +7 -20
- package/dist/components/form/formlabel.vue.d.ts +3 -3
- package/dist/components/form/type.d.ts +11 -0
- package/dist/components/icon/add.vue.d.ts +2 -0
- package/dist/components/icon/alertTip.vue.d.ts +2 -0
- package/dist/components/icon/arrow.vue.d.ts +2 -0
- package/dist/components/icon/calendar.vue.d.ts +2 -0
- package/dist/components/icon/close.vue.d.ts +2 -0
- package/dist/components/icon/dateArrow.vue.d.ts +2 -0
- package/dist/components/icon/dateArrowplus.vue.d.ts +2 -0
- package/dist/components/icon/delete.vue.d.ts +2 -0
- package/dist/components/icon/ellipsis.vue.d.ts +2 -0
- package/dist/components/icon/errTip.vue.d.ts +2 -0
- package/dist/components/icon/eye.vue.d.ts +2 -0
- package/dist/components/icon/infoTip.vue.d.ts +2 -0
- package/dist/components/icon/minus.vue.d.ts +2 -0
- package/dist/components/icon/successTip.vue.d.ts +2 -0
- package/dist/components/icon/turnleft.vue.d.ts +2 -0
- package/dist/components/icon/turnright.vue.d.ts +2 -0
- package/dist/components/icon/warnTip.vue.d.ts +2 -0
- package/dist/components/input/input.vue.d.ts +13 -8
- package/dist/components/loadding/loadcomponent.vue.d.ts +24 -4
- package/dist/components/loadding/loadding.d.ts +12 -19
- package/dist/components/menu/menu.vue.d.ts +13 -3
- package/dist/components/message/message.d.ts +68 -14
- package/dist/components/message/messagecomponent.vue.d.ts +5 -13
- package/dist/components/numberInput/numberinput.vue.d.ts +3 -3
- package/dist/components/pagination/pagination.vue.d.ts +24 -0
- package/dist/components/popover/poparrow.d.ts +55 -0
- package/dist/components/popover/popover.vue.d.ts +10 -4
- package/dist/components/radio/radiobox.vue.d.ts +24 -16
- package/dist/components/radio/radiogroup.vue.d.ts +15 -3
- package/dist/components/scrollBar/movebar.vue.d.ts +2 -2
- package/dist/components/scrollBar/scrollBar.vue.d.ts +12 -16
- package/dist/components/scrollloading/scrolllead.d.ts +18 -11
- package/dist/components/select/select.vue.d.ts +15 -1
- package/dist/components/select/selectoption.vue.d.ts +18 -6
- package/dist/components/switch/switch.vue.d.ts +14 -14
- package/dist/components/table/table.vue.d.ts +20 -9
- package/dist/components/table/tableItem.vue.d.ts +10 -4
- package/dist/components/tabs/tabs.vue.d.ts +14 -1
- package/dist/dialog.css +9 -0
- package/dist/directives/arrowKeys.d.ts +10 -0
- package/dist/directives/drag.d.ts +20 -0
- package/dist/directives/escape.d.ts +7 -0
- package/dist/directives/outsideclick.d.ts +14 -0
- package/dist/directives/watchwindow.d.ts +13 -0
- package/dist/directives/wheel.d.ts +12 -0
- package/dist/directives/whitespaceclick.d.ts +12 -0
- package/dist/index.css +1186 -873
- package/dist/index.d.ts +831 -401
- package/dist/index.es.js +22 -23
- package/dist/index.umd.js +4019 -3764
- package/dist/js/arrow/arrow.js +17 -0
- package/dist/js/badge/badge.js +9 -16
- package/dist/js/calendar/calendar.js +87 -0
- package/dist/js/carousel/carousel.js +101 -117
- package/dist/js/carousel/carouselitem.js +1 -7
- package/dist/js/check/checkbox.js +38 -4
- package/dist/js/check/checkgroup.js +40 -51
- package/dist/js/date/datepicker.js +146 -150
- package/dist/js/date/datepickerRange.js +265 -354
- package/dist/js/dateArrowplus/dateArrowplus.js +25 -0
- package/dist/js/delete/delete.js +19 -0
- package/dist/js/dialog/dialog.js +41 -57
- package/dist/js/form/form.js +30 -38
- package/dist/js/form/formlabel.js +99 -130
- package/dist/js/image/image.js +199 -149
- package/dist/js/index/index.js +605 -507
- package/dist/js/input/input.js +60 -43
- package/dist/js/menu/menu.js +47 -20
- package/dist/js/numberInput/numberinput.js +52 -60
- package/dist/js/pagination/pagination.js +125 -156
- package/dist/js/popover/popover.js +238 -134
- package/dist/js/radio/radiobox.js +37 -4
- package/dist/js/radio/radiogroup.js +15 -51
- package/dist/js/scrollBar/scrollBar.js +100 -56
- package/dist/js/select/select.js +155 -70
- package/dist/js/select/selectoption.js +45 -4
- package/dist/js/shapeFlag/shapeFlag.js +17 -0
- package/dist/js/switch/switch.js +14 -14
- package/dist/js/table/table.js +165 -111
- package/dist/js/table/tableItem.js +1 -1
- package/dist/js/tabs/tabs.js +57 -59
- package/dist/js/upload/upload.js +8 -23
- package/dist/tabs.css +3 -3
- package/dist/types/shapeFlag.d.ts +13 -0
- package/dist/{components/utils → utils}/tool.d.ts +11 -4
- package/package.json +1 -1
- package/dist/badge.css +0 -27
- package/dist/carousel.css +0 -13
- package/dist/checkgroup.css +0 -41
- package/dist/datepickerRange.css +0 -79
- package/dist/image.css +0 -8
- package/dist/js/getcalendar/getcalendar.js +0 -48
- package/dist/js/tree/tree.js +0 -72
- package/dist/js/tree/treeleaf.js +0 -116
- package/dist/radiogroup.css +0 -44
- package/dist/scrollBar.css +0 -37
- package/dist/select.css +0 -20
package/dist/js/input/input.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { defineComponent, computed, inject, openBlock, createElementBlock, renderSlot, withDirectives, createElementVNode, vModelDynamic, vShow } from "vue";
|
|
2
|
-
|
|
1
|
+
import { defineComponent, computed, inject, openBlock, createElementBlock, renderSlot, withDirectives, createElementVNode, normalizeClass, vModelDynamic, createVNode, vShow } from "vue";
|
|
2
|
+
import { d as delIcon } from "../delete/delete.js";
|
|
3
|
+
import "../index/index.js";
|
|
4
|
+
const _hoisted_1 = { class: "relative flex h-full w-full items-center overflow-hidden rounded border border-solid" };
|
|
3
5
|
const _hoisted_2 = ["placeholder", "type"];
|
|
4
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
7
|
__name: "input",
|
|
@@ -8,76 +10,91 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8
10
|
modelModifiers: {},
|
|
9
11
|
type: { default: "text" },
|
|
10
12
|
placeHolder: {},
|
|
11
|
-
clearable: { type: Boolean, default: false }
|
|
13
|
+
clearable: { type: Boolean, default: false },
|
|
14
|
+
size: { default: "default" }
|
|
12
15
|
},
|
|
13
16
|
emits: ["update:modelValue", "blur", "input", "change"],
|
|
14
17
|
setup(__props, { emit: __emit }) {
|
|
15
|
-
const
|
|
18
|
+
const props = __props;
|
|
19
|
+
const heightClass = computed(() => ({
|
|
20
|
+
"h-8": props.size === "large",
|
|
21
|
+
"h-7": props.size === "default",
|
|
22
|
+
"h-6": props.size === "small"
|
|
23
|
+
}));
|
|
16
24
|
const inputValue = computed({
|
|
17
25
|
get() {
|
|
18
|
-
return
|
|
26
|
+
return props.modelValue;
|
|
19
27
|
},
|
|
20
28
|
set(value) {
|
|
21
|
-
var _a;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
var _a, _b;
|
|
30
|
+
let processedValue = value;
|
|
31
|
+
if ((_a = props.modelModifiers) == null ? void 0 : _a.trim) {
|
|
32
|
+
if (typeof processedValue === "string") {
|
|
33
|
+
processedValue = processedValue.trim();
|
|
34
|
+
}
|
|
26
35
|
}
|
|
36
|
+
if ((_b = props.modelModifiers) == null ? void 0 : _b.number) {
|
|
37
|
+
processedValue = processedValue ? Number(processedValue) : null;
|
|
38
|
+
}
|
|
39
|
+
emit("update:modelValue", processedValue);
|
|
27
40
|
}
|
|
28
41
|
});
|
|
29
|
-
const
|
|
42
|
+
const emit = __emit;
|
|
30
43
|
const ParentGetInputHandle = inject("inputHandle", () => null);
|
|
31
44
|
const ParentGetBlurHandle = inject("blurHandle", () => null);
|
|
32
45
|
const clearHandle = () => {
|
|
33
|
-
|
|
46
|
+
emit("update:modelValue", null);
|
|
47
|
+
emit("change", null);
|
|
34
48
|
};
|
|
35
49
|
const showcloseico = computed(() => {
|
|
36
|
-
return
|
|
50
|
+
return props.clearable && props.modelValue !== null && props.modelValue !== "";
|
|
37
51
|
});
|
|
38
|
-
const
|
|
39
|
-
var _a;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
const processValue = (rawValue, methodStr) => {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
let value = ((_a = props.modelModifiers) == null ? void 0 : _a.trim) ? rawValue.trim() : rawValue;
|
|
55
|
+
if ((_b = props.modelModifiers) == null ? void 0 : _b.number) {
|
|
56
|
+
return value ? Number(value) : null;
|
|
57
|
+
}
|
|
58
|
+
if (methodStr === "blur") {
|
|
59
|
+
ParentGetBlurHandle(value || null);
|
|
46
60
|
} else {
|
|
47
|
-
|
|
48
|
-
ParentGetBlurHandle(target.value);
|
|
49
|
-
} else {
|
|
50
|
-
ParentGetInputHandle(target.value);
|
|
51
|
-
}
|
|
61
|
+
ParentGetInputHandle(value || null);
|
|
52
62
|
}
|
|
63
|
+
return value || null;
|
|
64
|
+
};
|
|
65
|
+
const handleBlur = (event) => {
|
|
66
|
+
const target = event.target;
|
|
67
|
+
emit("blur", processValue(target.value, "blur"));
|
|
68
|
+
};
|
|
69
|
+
const handleInput = (event) => {
|
|
70
|
+
const target = event.target;
|
|
71
|
+
emit("input", processValue(target.value, "input"));
|
|
72
|
+
};
|
|
73
|
+
const handleChange = (event) => {
|
|
74
|
+
const target = event.target;
|
|
75
|
+
emit("change", processValue(target.value, "change"));
|
|
53
76
|
};
|
|
54
77
|
return (_ctx, _cache) => {
|
|
55
78
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
56
79
|
renderSlot(_ctx.$slots, "prepend"),
|
|
57
80
|
withDirectives(createElementVNode("input", {
|
|
58
|
-
class: "
|
|
81
|
+
class: normalizeClass(["w-full px-2 outline-none appearance-none", heightClass.value]),
|
|
59
82
|
placeholder: _ctx.placeHolder,
|
|
60
83
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
61
84
|
type: _ctx.type,
|
|
62
|
-
onBlur:
|
|
63
|
-
onInput:
|
|
64
|
-
onChange:
|
|
65
|
-
}, null,
|
|
85
|
+
onBlur: handleBlur,
|
|
86
|
+
onInput: handleInput,
|
|
87
|
+
onChange: handleChange
|
|
88
|
+
}, null, 42, _hoisted_2), [
|
|
66
89
|
[vModelDynamic, inputValue.value]
|
|
67
90
|
]),
|
|
68
|
-
withDirectives((
|
|
91
|
+
withDirectives(createElementVNode("button", {
|
|
92
|
+
type: "button",
|
|
69
93
|
onClick: clearHandle,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
width: "1em",
|
|
75
|
-
height: "1em",
|
|
76
|
-
fill: "currentColor",
|
|
77
|
-
"aria-hidden": "true"
|
|
78
|
-
}, _cache[1] || (_cache[1] = [
|
|
79
|
-
createElementVNode("path", { d: "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" }, null, -1)
|
|
80
|
-
]), 512)), [
|
|
94
|
+
class: "mr-2 flex-grow-0"
|
|
95
|
+
}, [
|
|
96
|
+
createVNode(delIcon, { class: "w-3 h-3" })
|
|
97
|
+
], 512), [
|
|
81
98
|
[vShow, showcloseico.value]
|
|
82
99
|
]),
|
|
83
100
|
renderSlot(_ctx.$slots, "append")
|
package/dist/js/menu/menu.js
CHANGED
|
@@ -1,36 +1,63 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, computed, ref, openBlock, createElementBlock, createElementVNode, Fragment, renderList, withDirectives, vModelRadio, normalizeClass, toDisplayString, normalizeStyle } from "vue";
|
|
2
2
|
const _hoisted_1 = ["value"];
|
|
3
|
-
const _hoisted_2 = { class: "
|
|
3
|
+
const _hoisted_2 = { class: "w-full border-t-2 border-gray-200 border-solid mt-2 relative" };
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "menu",
|
|
6
6
|
props: {
|
|
7
|
-
menulist: {}
|
|
7
|
+
menulist: {},
|
|
8
|
+
activeIndex: { default: 1 }
|
|
8
9
|
},
|
|
9
|
-
emits: ["updatemenu"],
|
|
10
|
+
emits: ["updatemenu", "update:activeIndex"],
|
|
10
11
|
setup(__props, { emit: __emit }) {
|
|
11
|
-
const
|
|
12
|
-
const
|
|
12
|
+
const props = __props;
|
|
13
|
+
const bigIndex = computed({
|
|
14
|
+
set(val) {
|
|
15
|
+
emit("update:activeIndex", val);
|
|
16
|
+
emit("updatemenu", val);
|
|
17
|
+
},
|
|
18
|
+
get() {
|
|
19
|
+
updateIndicatorPosition();
|
|
20
|
+
if (props.menulist.length === 0)
|
|
21
|
+
return 0;
|
|
22
|
+
if (props.menulist.length <= props.activeIndex)
|
|
23
|
+
return props.menulist.length - 1;
|
|
24
|
+
return props.activeIndex;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
13
27
|
const emit = __emit;
|
|
14
|
-
const
|
|
15
|
-
|
|
28
|
+
const menuListRef = ref();
|
|
29
|
+
const indicatorPosition = ref(0);
|
|
30
|
+
const indicatorStyle = computed(() => ({
|
|
31
|
+
transform: `translateX(${indicatorPosition.value}px)`,
|
|
32
|
+
width: `${currentItemWidth.value}px`
|
|
33
|
+
}));
|
|
34
|
+
const currentItemWidth = computed(() => {
|
|
16
35
|
var _a;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
emit("updatemenu", n);
|
|
36
|
+
if (!menuListRef.value)
|
|
37
|
+
return 0;
|
|
38
|
+
return ((_a = menuListRef.value.children[props.activeIndex]) == null ? void 0 : _a.clientWidth) || 0;
|
|
22
39
|
});
|
|
40
|
+
const updateIndicatorPosition = () => {
|
|
41
|
+
if (!menuListRef.value)
|
|
42
|
+
return;
|
|
43
|
+
const currentItem = menuListRef.value.children[props.activeIndex];
|
|
44
|
+
if (currentItem) {
|
|
45
|
+
const containerRect = menuListRef.value.getBoundingClientRect();
|
|
46
|
+
const itemRect = currentItem.getBoundingClientRect();
|
|
47
|
+
indicatorPosition.value = itemRect.left - containerRect.left;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
23
50
|
return (_ctx, _cache) => {
|
|
24
51
|
return openBlock(), createElementBlock("div", null, [
|
|
25
52
|
createElementVNode("div", {
|
|
26
|
-
class: "
|
|
27
|
-
ref_key: "
|
|
28
|
-
ref:
|
|
53
|
+
class: "w-full flex text-word6 space-x-4",
|
|
54
|
+
ref_key: "menuListRef",
|
|
55
|
+
ref: menuListRef
|
|
29
56
|
}, [
|
|
30
57
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menulist, (item, i) => {
|
|
31
58
|
return openBlock(), createElementBlock("label", { key: item }, [
|
|
32
59
|
withDirectives(createElementVNode("input", {
|
|
33
|
-
class: "
|
|
60
|
+
class: "hidden",
|
|
34
61
|
name: "classone",
|
|
35
62
|
type: "radio",
|
|
36
63
|
value: i,
|
|
@@ -39,15 +66,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
66
|
[vModelRadio, bigIndex.value]
|
|
40
67
|
]),
|
|
41
68
|
createElementVNode("span", {
|
|
42
|
-
class: normalizeClass(["hover:
|
|
69
|
+
class: normalizeClass(["hover:text-blue-brand text-sm cursor-pointer inline-block text-center px-2", { "text-blue-brand": bigIndex.value == i }])
|
|
43
70
|
}, toDisplayString(item), 3)
|
|
44
71
|
]);
|
|
45
72
|
}), 128))
|
|
46
73
|
], 512),
|
|
47
74
|
createElementVNode("div", _hoisted_2, [
|
|
48
75
|
createElementVNode("div", {
|
|
49
|
-
class: "
|
|
50
|
-
style: normalizeStyle(
|
|
76
|
+
class: "absolute w-14 border-t-2 border-solid border-blue-brand bottom-0 transition",
|
|
77
|
+
style: normalizeStyle(indicatorStyle.value)
|
|
51
78
|
}, null, 4)
|
|
52
79
|
])
|
|
53
80
|
]);
|
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { openBlock, createElementBlock, createElementVNode, defineComponent, computed, normalizeClass, createVNode, withDirectives, vModelText } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "../index/index.js";
|
|
3
|
+
const _sfc_main$2 = {};
|
|
4
|
+
const _hoisted_1$2 = {
|
|
5
|
+
viewBox: "0 0 1024 1024",
|
|
6
|
+
version: "1.1",
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8
|
+
};
|
|
9
|
+
function _sfc_render$1(_ctx, _cache) {
|
|
10
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [
|
|
11
|
+
createElementVNode("path", { d: "M853.333333 544H170.666667c-17.066667 0-32-14.933333-32-32s14.933333-32 32-32h682.666666c17.066667 0 32 14.933333 32 32s-14.933333 32-32 32z" }, null, -1)
|
|
12
|
+
]));
|
|
13
|
+
}
|
|
14
|
+
const minusIcon = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
|
|
15
|
+
const _sfc_main$1 = {};
|
|
16
|
+
const _hoisted_1$1 = {
|
|
17
|
+
viewBox: "0 0 1024 1024",
|
|
18
|
+
version: "1.1",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
20
|
+
};
|
|
21
|
+
function _sfc_render(_ctx, _cache) {
|
|
22
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [
|
|
23
|
+
createElementVNode("path", { d: "M853.333333 480H544V170.666667c0-17.066667-14.933333-32-32-32s-32 14.933333-32 32v309.333333H170.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h309.333333V853.333333c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V544H853.333333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z" }, null, -1)
|
|
24
|
+
]));
|
|
25
|
+
}
|
|
26
|
+
const addIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
|
|
27
|
+
const _hoisted_1 = { class: "inline-flex w-full rounded-sm border border-solid" };
|
|
3
28
|
const _hoisted_2 = ["disabled"];
|
|
4
29
|
const _hoisted_3 = ["disabled"];
|
|
5
30
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
31
|
__name: "numberinput",
|
|
7
32
|
props: {
|
|
8
33
|
modelValue: {},
|
|
9
|
-
size: { default: "
|
|
34
|
+
size: { default: "default" },
|
|
10
35
|
min: {},
|
|
11
36
|
max: {},
|
|
12
37
|
strict: { type: Boolean, default: false },
|
|
@@ -16,6 +41,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
41
|
emits: ["update:modelValue", "NumChange"],
|
|
17
42
|
setup(__props, { emit: __emit }) {
|
|
18
43
|
const props = __props;
|
|
44
|
+
const sizeClass = computed(() => ({
|
|
45
|
+
"h-8 w-8": props.size === "large",
|
|
46
|
+
"h-7 w-7": props.size === "default",
|
|
47
|
+
"h-6 w-6": props.size === "small"
|
|
48
|
+
}));
|
|
49
|
+
const bounds = computed(() => ({
|
|
50
|
+
min: props.min ?? -Infinity,
|
|
51
|
+
max: props.max ?? Infinity
|
|
52
|
+
}));
|
|
53
|
+
const isMinReached = computed(() => props.modelValue <= bounds.value.min);
|
|
54
|
+
const isMaxReached = computed(() => props.modelValue >= bounds.value.max);
|
|
19
55
|
function updateModelValueAndEmit(value) {
|
|
20
56
|
const formattedValue = value.toFixed(lastLen.value);
|
|
21
57
|
emitAct("update:modelValue", Number(formattedValue));
|
|
@@ -23,8 +59,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
59
|
}
|
|
24
60
|
const emitAct = __emit;
|
|
25
61
|
const lastLen = computed(() => {
|
|
26
|
-
|
|
27
|
-
return (
|
|
62
|
+
const stepString = props.step.toString();
|
|
63
|
+
return stepString.includes(".") ? stepString.split(".")[1].length : 0;
|
|
28
64
|
});
|
|
29
65
|
const addHandle = () => {
|
|
30
66
|
let result = props.modelValue + props.step;
|
|
@@ -49,51 +85,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
85
|
}
|
|
50
86
|
}
|
|
51
87
|
});
|
|
52
|
-
const reduceDisable = computed(() => {
|
|
53
|
-
if (props.min !== void 0) {
|
|
54
|
-
if (Number(props.modelValue) <= props.min) {
|
|
55
|
-
return true;
|
|
56
|
-
} else {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
} else {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
const addDisable = computed(() => {
|
|
64
|
-
if (props.max !== void 0) {
|
|
65
|
-
if (Number(props.modelValue) >= props.max) {
|
|
66
|
-
return true;
|
|
67
|
-
} else {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
88
|
return (_ctx, _cache) => {
|
|
75
89
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
76
90
|
createElementVNode("button", {
|
|
77
91
|
type: "button",
|
|
78
|
-
disabled:
|
|
92
|
+
disabled: isMinReached.value,
|
|
79
93
|
onClick: reduceHandle,
|
|
80
|
-
class: normalizeClass(["
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}])
|
|
85
|
-
}, _cache[1] || (_cache[1] = [
|
|
86
|
-
createElementVNode("svg", {
|
|
87
|
-
class: "tdd-h-4 tdd-w-4 tdd-fill-word6 tdd-inline-block",
|
|
88
|
-
viewBox: "0 0 1024 1024",
|
|
89
|
-
version: "1.1",
|
|
90
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
91
|
-
}, [
|
|
92
|
-
createElementVNode("path", { d: "M853.333333 544H170.666667c-17.066667 0-32-14.933333-32-32s14.933333-32 32-32h682.666666c17.066667 0 32 14.933333 32 32s-14.933333 32-32 32z" })
|
|
93
|
-
], -1)
|
|
94
|
-
]), 10, _hoisted_2),
|
|
94
|
+
class: normalizeClass(["disabled:cursor-not-allowed flex-none bg-gray-200 text-xs", sizeClass.value])
|
|
95
|
+
}, [
|
|
96
|
+
createVNode(minusIcon, { class: "h-4 w-4 fill-word6 inline-block" })
|
|
97
|
+
], 10, _hoisted_2),
|
|
95
98
|
withDirectives(createElementVNode("input", {
|
|
96
|
-
class: "
|
|
99
|
+
class: "w-full px-1 text-center outline-none text-word3",
|
|
97
100
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
98
101
|
type: "text"
|
|
99
102
|
}, null, 512), [
|
|
@@ -101,23 +104,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
101
104
|
]),
|
|
102
105
|
createElementVNode("button", {
|
|
103
106
|
type: "button",
|
|
104
|
-
disabled:
|
|
107
|
+
disabled: isMaxReached.value,
|
|
105
108
|
onClick: addHandle,
|
|
106
|
-
class: normalizeClass(["
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}])
|
|
111
|
-
}, _cache[2] || (_cache[2] = [
|
|
112
|
-
createElementVNode("svg", {
|
|
113
|
-
class: "tdd-h-4 tdd-w-4 tdd-fill-word6 tdd-inline-block",
|
|
114
|
-
viewBox: "0 0 1024 1024",
|
|
115
|
-
version: "1.1",
|
|
116
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
117
|
-
}, [
|
|
118
|
-
createElementVNode("path", { d: "M853.333333 480H544V170.666667c0-17.066667-14.933333-32-32-32s-32 14.933333-32 32v309.333333H170.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h309.333333V853.333333c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V544H853.333333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z" })
|
|
119
|
-
], -1)
|
|
120
|
-
]), 10, _hoisted_3)
|
|
109
|
+
class: normalizeClass(["disabled:cursor-not-allowed flex-none bg-gray-200 text-xs", sizeClass.value])
|
|
110
|
+
}, [
|
|
111
|
+
createVNode(addIcon, { class: "h-4 w-4 fill-word6 inline-block" })
|
|
112
|
+
], 10, _hoisted_3)
|
|
121
113
|
]);
|
|
122
114
|
};
|
|
123
115
|
}
|