ninemoon-ui 0.0.26 → 0.1.0
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/assets/dialog-a1b585e9.css +9 -0
- package/dist/assets/index-6d2c28a9.css +1210 -0
- package/dist/{tabs.css → assets/tabs-d2c8965f.css} +13 -13
- 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 +40 -31
- package/dist/components/carousel/carousel.vue.d.ts +47 -8
- package/dist/components/carousel/carouselitem.vue.d.ts +4 -2
- package/dist/components/carousel/clickbutton.vue.d.ts +29 -0
- package/dist/components/check/checkbox.vue.d.ts +39 -22
- package/dist/components/check/checkgroup.vue.d.ts +45 -21
- package/dist/components/date/datepicker.vue.d.ts +48 -18
- package/dist/components/date/datepickerRange.vue.d.ts +35 -12
- package/dist/components/dialog/dialog.vue.d.ts +56 -67
- package/dist/components/form/form.vue.d.ts +38 -44
- package/dist/components/form/formlabel.vue.d.ts +40 -35
- 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/image/image.vue.d.ts +39 -29
- package/dist/components/input/input.vue.d.ts +59 -50
- package/dist/components/loadding/loadcomponent.vue.d.ts +24 -4
- package/dist/components/loadding/loadding.d.ts +13 -19
- package/dist/components/menu/menu.vue.d.ts +35 -12
- package/dist/components/message/message.d.ts +69 -14
- package/dist/components/message/messagecomponent.vue.d.ts +8 -15
- package/dist/components/numberInput/numberinput.vue.d.ts +51 -59
- package/dist/components/pagination/pagination.vue.d.ts +59 -27
- package/dist/components/popover/poparrow.d.ts +55 -0
- package/dist/components/popover/popover.vue.d.ts +63 -66
- package/dist/components/radio/radiobox.vue.d.ts +39 -22
- package/dist/components/radio/radiogroup.vue.d.ts +45 -21
- package/dist/components/scrollBar/movebar.vue.d.ts +33 -36
- package/dist/components/scrollBar/scrollBar.vue.d.ts +41 -40
- package/dist/components/scrollloading/scrolllead.d.ts +18 -11
- package/dist/components/select/select.vue.d.ts +55 -37
- package/dist/components/select/selectoption.vue.d.ts +39 -18
- package/dist/components/switch/switch.vue.d.ts +45 -45
- package/dist/components/table/table.vue.d.ts +61 -54
- package/dist/components/table/tableItem.vue.d.ts +49 -56
- package/dist/components/tabs/tabs.vue.d.ts +45 -19
- package/dist/components/tabs/tabsPane.vue.d.ts +25 -12
- package/dist/components/upload/upload.vue.d.ts +53 -53
- 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.d.ts +1524 -2210
- package/dist/js/arrow-ebe47bd0.js +17 -0
- package/dist/js/{badge/badge.js → badge-496028b6.js} +9 -16
- package/dist/js/calendar-5c242731.js +87 -0
- package/dist/js/carousel-10621aeb.js +155 -0
- package/dist/js/{carousel/carouselitem.js → carouselitem-89116745.js} +1 -7
- package/dist/js/checkbox-530025c4.js +50 -0
- package/dist/js/checkgroup-e4e6adbc.js +58 -0
- package/dist/js/dateArrowplus-8181993f.js +25 -0
- package/dist/js/datepicker-ef8b7019.js +362 -0
- package/dist/js/datepickerRange-4c400f88.js +500 -0
- package/dist/js/delete-e898f83c.js +19 -0
- package/dist/js/dialog-0127ca01.js +122 -0
- package/dist/js/form-6ae96387.js +79 -0
- package/dist/js/formlabel-9339bd1c.js +136 -0
- package/dist/js/image-76711716.js +300 -0
- package/dist/js/index-283810a0.js +6261 -0
- package/dist/js/index-b4e420ce.js +958 -0
- package/dist/js/index-e12c8d65.js +36 -0
- package/dist/js/input-11fe67a5.js +107 -0
- package/dist/js/menu-fb9b4a4f.js +86 -0
- package/dist/js/numberinput-00fa4429.js +119 -0
- package/dist/js/pagination-3bcaa109.js +203 -0
- package/dist/js/popover-45f75f86.js +345 -0
- package/dist/js/radiobox-8f11e726.js +49 -0
- package/dist/js/radiogroup-727923c7.js +33 -0
- package/dist/js/scrollBar-07906042.js +252 -0
- package/dist/js/select-b5bbb138.js +203 -0
- package/dist/js/selectoption-00c8f06d.js +57 -0
- package/dist/js/shapeFlag-8cf4bcf1.js +17 -0
- package/dist/js/switch-06ae74cc.js +50 -0
- package/dist/js/table-9bb52630.js +270 -0
- package/dist/js/{table/tableItem.js → tableItem-7d8bf2db.js} +1 -1
- package/dist/js/{tabs/tabs.js → tabs-9d7be734.js} +59 -60
- package/dist/js/{upload/upload.js → upload-16dbef22.js} +10 -26
- package/dist/types/shapeFlag.d.ts +13 -0
- package/dist/{components/utils → utils}/tool.d.ts +12 -5
- 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/components/tree/tree.vue.d.ts +0 -47
- package/dist/datepickerRange.css +0 -79
- package/dist/image.css +0 -8
- package/dist/index.css +0 -917
- package/dist/index.es.js +0 -37
- package/dist/index.umd.js +0 -6080
- package/dist/js/carousel/carousel.js +0 -175
- package/dist/js/check/checkbox.js +0 -16
- package/dist/js/check/checkgroup.js +0 -68
- package/dist/js/date/datepicker.js +0 -373
- package/dist/js/date/datepickerRange.js +0 -597
- package/dist/js/dialog/dialog.js +0 -140
- package/dist/js/form/form.js +0 -87
- package/dist/js/form/formlabel.js +0 -167
- package/dist/js/getcalendar/getcalendar.js +0 -48
- package/dist/js/image/image.js +0 -259
- package/dist/js/index/index.js +0 -873
- package/dist/js/input/input.js +0 -91
- package/dist/js/menu/menu.js +0 -58
- package/dist/js/numberInput/numberinput.js +0 -130
- package/dist/js/pagination/pagination.js +0 -245
- package/dist/js/popover/popover.js +0 -241
- package/dist/js/radio/radiobox.js +0 -16
- package/dist/js/radio/radiogroup.js +0 -68
- package/dist/js/scrollBar/scrollBar.js +0 -208
- package/dist/js/select/select.js +0 -117
- package/dist/js/select/selectoption.js +0 -16
- package/dist/js/switch/switch.js +0 -49
- package/dist/js/table/table.js +0 -215
- package/dist/js/tree/tree.js +0 -72
- package/dist/js/tree/treeleaf.js +0 -118
- package/dist/radiogroup.css +0 -44
- package/dist/scrollBar.css +0 -37
- package/dist/select.css +0 -20
- /package/dist/js/{tabs/tabsPane.js → tabsPane-f024a6bf.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { openBlock, createElementBlock, createElementVNode } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./index-b4e420ce.js";
|
|
3
|
+
const _sfc_main = {};
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
viewBox: "0 0 1024 1024",
|
|
6
|
+
version: "1.1",
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8
|
+
};
|
|
9
|
+
function _sfc_render(_ctx, _cache) {
|
|
10
|
+
return openBlock(), createElementBlock("svg", _hoisted_1, _cache[0] || (_cache[0] = [
|
|
11
|
+
createElementVNode("path", { d: "M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384 341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z" }, null, -1)
|
|
12
|
+
]));
|
|
13
|
+
}
|
|
14
|
+
const ArrowIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
15
|
+
export {
|
|
16
|
+
ArrowIcon as A
|
|
17
|
+
};
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
const _hoisted_1 = { class: "
|
|
1
|
+
import { defineComponent, readonly, computed, openBlock, createElementBlock, renderSlot, withDirectives, createElementVNode, normalizeClass, unref, toDisplayString, vShow } from "vue";
|
|
2
|
+
const _hoisted_1 = { class: "relative" };
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "badge",
|
|
5
5
|
props: {
|
|
6
6
|
value: {},
|
|
7
7
|
max: { default: 9 },
|
|
8
|
-
placement: { default: "rightTop" }
|
|
8
|
+
placement: { default: "rightTop" },
|
|
9
|
+
customClass: {}
|
|
9
10
|
},
|
|
10
11
|
setup(__props) {
|
|
11
12
|
const props = __props;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ClassArr.value.push("EBage_right");
|
|
17
|
-
break;
|
|
18
|
-
case "rightTop":
|
|
19
|
-
default:
|
|
20
|
-
ClassArr.value.push("EBage_default");
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
13
|
+
const classSet = readonly({
|
|
14
|
+
rightTop: "-top-1/2",
|
|
15
|
+
right: "top-0"
|
|
16
|
+
});
|
|
23
17
|
const showMark = computed(() => Number(props.value) > 0);
|
|
24
18
|
const mark = computed(() => {
|
|
25
19
|
if (Number(props.max) < Number(props.value)) {
|
|
@@ -32,7 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
26
|
return openBlock(), createElementBlock("span", _hoisted_1, [
|
|
33
27
|
renderSlot(_ctx.$slots, "default"),
|
|
34
28
|
withDirectives(createElementVNode("sup", {
|
|
35
|
-
class: normalizeClass(["
|
|
29
|
+
class: normalizeClass(["absolute inline-block -right-3 -translate-y-1/2 translate-x-full transform rounded-lg bg-red-500 px-1.5 py-px text-xs text-white", [unref(classSet)[_ctx.placement], _ctx.customClass]])
|
|
36
30
|
}, toDisplayString(mark.value), 3), [
|
|
37
31
|
[vShow, showMark.value]
|
|
38
32
|
])
|
|
@@ -40,7 +34,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
34
|
};
|
|
41
35
|
}
|
|
42
36
|
});
|
|
43
|
-
const badge_vue_vue_type_style_index_0_lang = "";
|
|
44
37
|
export {
|
|
45
38
|
_sfc_main as default
|
|
46
39
|
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { openBlock, createElementBlock, createElementVNode } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./index-b4e420ce.js";
|
|
3
|
+
const getMonthDays = (year, month, flag) => {
|
|
4
|
+
let stratDate = new Date(year, month - 1, 1).getTime(), endData = new Date(year, month, 1).getTime();
|
|
5
|
+
let days = (endData - stratDate) / (1e3 * 60 * 60 * 24);
|
|
6
|
+
let list = [];
|
|
7
|
+
for (let i = 1; i <= days; i++) {
|
|
8
|
+
const d = i;
|
|
9
|
+
const week = (/* @__PURE__ */ new Date(month + "/" + i + "/" + year)).getDay() == 0 ? "日" : (/* @__PURE__ */ new Date(month + "/" + i + "/" + year)).getDay() == 1 ? "一" : (/* @__PURE__ */ new Date(month + "/" + i + "/" + year)).getDay() == 2 ? "二" : (/* @__PURE__ */ new Date(month + "/" + i + "/" + year)).getDay() == 3 ? "三" : (/* @__PURE__ */ new Date(month + "/" + i + "/" + year)).getDay() == 4 ? "四" : (/* @__PURE__ */ new Date(month + "/" + i + "/" + year)).getDay() == 5 ? "五" : (/* @__PURE__ */ new Date(month + "/" + i + "/" + year)).getDay() == 6 ? "六" : "";
|
|
10
|
+
let obj = {
|
|
11
|
+
week,
|
|
12
|
+
d,
|
|
13
|
+
m: month,
|
|
14
|
+
y: year,
|
|
15
|
+
isChoosed1Day: false,
|
|
16
|
+
isChoosed2Day: false
|
|
17
|
+
};
|
|
18
|
+
if (flag === 1) {
|
|
19
|
+
Object.assign(obj, {
|
|
20
|
+
pred: true
|
|
21
|
+
});
|
|
22
|
+
} else if (flag === 2) {
|
|
23
|
+
Object.assign(obj, {
|
|
24
|
+
nextd: true
|
|
25
|
+
});
|
|
26
|
+
} else {
|
|
27
|
+
Object.assign(obj, {
|
|
28
|
+
newd: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
list.push(obj);
|
|
32
|
+
}
|
|
33
|
+
return list;
|
|
34
|
+
};
|
|
35
|
+
const addZero = (data) => {
|
|
36
|
+
let t = Number(data);
|
|
37
|
+
if (isNaN(t)) {
|
|
38
|
+
throw new Error("日期格式不正确");
|
|
39
|
+
} else {
|
|
40
|
+
if (t < 10) {
|
|
41
|
+
return `0${t}`;
|
|
42
|
+
} else {
|
|
43
|
+
return `${t}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const _sfc_main$1 = {};
|
|
48
|
+
const _hoisted_1$1 = {
|
|
49
|
+
viewBox: "0 0 1024 1024",
|
|
50
|
+
version: "1.1",
|
|
51
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
52
|
+
};
|
|
53
|
+
function _sfc_render$1(_ctx, _cache) {
|
|
54
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [
|
|
55
|
+
createElementVNode("path", {
|
|
56
|
+
d: "M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384 341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z",
|
|
57
|
+
fill: "#666666"
|
|
58
|
+
}, null, -1)
|
|
59
|
+
]));
|
|
60
|
+
}
|
|
61
|
+
const Arrow = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
62
|
+
const _sfc_main = {};
|
|
63
|
+
const _hoisted_1 = {
|
|
64
|
+
style: { "width": "1em", "height": "1em", "vertical-align": "middle", "fill": "currentColor", "overflow": "hidden" },
|
|
65
|
+
viewBox: "0 0 1024 1024",
|
|
66
|
+
version: "1.1",
|
|
67
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
68
|
+
};
|
|
69
|
+
function _sfc_render(_ctx, _cache) {
|
|
70
|
+
return openBlock(), createElementBlock("svg", _hoisted_1, _cache[0] || (_cache[0] = [
|
|
71
|
+
createElementVNode("path", {
|
|
72
|
+
d: "M853.333333 149.333333h-138.666666V106.666667c0-17.066667-14.933333-32-32-32s-32 14.933333-32 32v42.666666h-277.333334V106.666667c0-17.066667-14.933333-32-32-32s-32 14.933333-32 32v42.666666H170.666667c-40.533333 0-74.666667 34.133333-74.666667 74.666667v618.666667C96 883.2 130.133333 917.333333 170.666667 917.333333h682.666666c40.533333 0 74.666667-34.133333 74.666667-74.666666v-618.666667C928 183.466667 893.866667 149.333333 853.333333 149.333333zM170.666667 213.333333h138.666666v64c0 17.066667 14.933333 32 32 32s32-14.933333 32-32v-64h277.333334v64c0 17.066667 14.933333 32 32 32s32-14.933333 32-32v-64H853.333333c6.4 0 10.666667 4.266667 10.666667 10.666667v194.133333c-4.266667-2.133333-6.4-2.133333-10.666667-2.133333H170.666667c-4.266667 0-6.4 0-10.666667 2.133333v-194.133333c0-6.4 4.266667-10.666667 10.666667-10.666667z m682.666666 640H170.666667c-6.4 0-10.666667-4.266667-10.666667-10.666666V477.866667c4.266667 2.133333 6.4 2.133333 10.666667 2.133333h682.666666c4.266667 0 6.4 0 10.666667-2.133333v364.8c0 6.4-4.266667 10.666667-10.666667 10.666666z",
|
|
73
|
+
fill: "#666666"
|
|
74
|
+
}, null, -1),
|
|
75
|
+
createElementVNode("path", {
|
|
76
|
+
d: "M384 608h-85.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h85.333333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM725.333333 608h-192c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h192c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z",
|
|
77
|
+
fill: "#666666"
|
|
78
|
+
}, null, -1)
|
|
79
|
+
]));
|
|
80
|
+
}
|
|
81
|
+
const Calendar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
82
|
+
export {
|
|
83
|
+
Arrow as A,
|
|
84
|
+
Calendar as C,
|
|
85
|
+
addZero as a,
|
|
86
|
+
getMonthDays as g
|
|
87
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { defineComponent, readonly, openBlock, createElementBlock, normalizeClass, unref, createVNode, useSlots, ref, onMounted, computed, watch, onUnmounted, normalizeStyle, h } from "vue";
|
|
2
|
+
import { A as ArrowIcon } from "./arrow-ebe47bd0.js";
|
|
3
|
+
import { S as ShapeFlags } from "./shapeFlag-8cf4bcf1.js";
|
|
4
|
+
import "./index-b4e420ce.js";
|
|
5
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "clickbutton",
|
|
7
|
+
props: {
|
|
8
|
+
position: { default: "left" }
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const classSet = readonly({
|
|
13
|
+
left: "left-1 rotate-180",
|
|
14
|
+
right: "right-1"
|
|
15
|
+
});
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return openBlock(), createElementBlock("button", {
|
|
18
|
+
type: "button",
|
|
19
|
+
class: normalizeClass(["z-20 text-center group-hover:visible flex invisible items-center justify-center absolute top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-slate-300 appearance-none transform outline-none", unref(classSet)[props.position]])
|
|
20
|
+
}, [
|
|
21
|
+
createVNode(ArrowIcon, { class: "w-3 h-3 fill-white inline-block" })
|
|
22
|
+
], 2);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
27
|
+
__name: "carousel",
|
|
28
|
+
props: {
|
|
29
|
+
height: {},
|
|
30
|
+
holdstop: { type: Boolean, default: true },
|
|
31
|
+
startindex: { default: 0 }
|
|
32
|
+
},
|
|
33
|
+
setup(__props) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const slots = useSlots();
|
|
36
|
+
const body = ref();
|
|
37
|
+
const translatexNum = ref(0);
|
|
38
|
+
onMounted(() => {
|
|
39
|
+
translatexNum.value = body.value.offsetWidth;
|
|
40
|
+
});
|
|
41
|
+
const activeIndex = ref(props.startindex);
|
|
42
|
+
const validSlots = computed(() => {
|
|
43
|
+
return slots.default().reduce((pre, cur) => {
|
|
44
|
+
if (cur.shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
|
|
45
|
+
pre = pre.concat(cur.children);
|
|
46
|
+
} else if (cur.shapeFlag & ShapeFlags.SLOTS_CHILDREN) {
|
|
47
|
+
pre.push(cur);
|
|
48
|
+
}
|
|
49
|
+
return pre;
|
|
50
|
+
}, []);
|
|
51
|
+
});
|
|
52
|
+
const totalLen = computed(() => {
|
|
53
|
+
return validSlots.value.length;
|
|
54
|
+
});
|
|
55
|
+
const calculateCarouselTransform = (currentIndex, activeIndex2, totalItems, itemWidth) => {
|
|
56
|
+
if (totalItems <= 2) {
|
|
57
|
+
return Math.abs((currentIndex - activeIndex2) * itemWidth);
|
|
58
|
+
}
|
|
59
|
+
const circularIndexDiff = (currentIndex - activeIndex2 + totalItems) % totalItems;
|
|
60
|
+
const effectiveIndex = circularIndexDiff > totalItems / 2 ? circularIndexDiff - totalItems : circularIndexDiff;
|
|
61
|
+
return effectiveIndex * itemWidth;
|
|
62
|
+
};
|
|
63
|
+
const bodyHandle = (MySlot, currentIndex) => {
|
|
64
|
+
return h(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
key: currentIndex,
|
|
68
|
+
class: normalizeClass([
|
|
69
|
+
"inline-block transition-all duration-700 w-full h-full absolute top-0 left-0 overflow-hidden",
|
|
70
|
+
[activeIndex.value === currentIndex ? "" : "opacity-0"]
|
|
71
|
+
]),
|
|
72
|
+
style: {
|
|
73
|
+
transform: `translateX(${calculateCarouselTransform(
|
|
74
|
+
currentIndex,
|
|
75
|
+
activeIndex.value,
|
|
76
|
+
totalLen.value,
|
|
77
|
+
translatexNum.value
|
|
78
|
+
)}px)`
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
MySlot
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
const renderCarouselItem = () => {
|
|
85
|
+
return validSlots.value.map((MySlot, _) => {
|
|
86
|
+
return bodyHandle(MySlot, _);
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
const preHandle = () => {
|
|
90
|
+
activeIndex.value = (totalLen.value + activeIndex.value - 1) % totalLen.value;
|
|
91
|
+
animationFrame.value && cancelAnimationFrame(animationFrame.value);
|
|
92
|
+
};
|
|
93
|
+
const nextHandle = () => {
|
|
94
|
+
activeIndex.value = (activeIndex.value + 1) % totalLen.value;
|
|
95
|
+
animationFrame.value && cancelAnimationFrame(animationFrame.value);
|
|
96
|
+
};
|
|
97
|
+
const flagTime = ref(null);
|
|
98
|
+
const animationFrame = ref(null);
|
|
99
|
+
const startAutoplay = () => {
|
|
100
|
+
if (totalLen.value === 1 || totalLen.value === 0) {
|
|
101
|
+
animationFrame.value && cancelAnimationFrame(animationFrame.value);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
let newtime = (/* @__PURE__ */ new Date()).getTime();
|
|
105
|
+
if (flagTime.value == null)
|
|
106
|
+
flagTime.value = newtime;
|
|
107
|
+
if (newtime - flagTime.value >= 2e3) {
|
|
108
|
+
activeIndex.value = (activeIndex.value + 1) % totalLen.value;
|
|
109
|
+
flagTime.value = newtime;
|
|
110
|
+
}
|
|
111
|
+
animationFrame.value = requestAnimationFrame(startAutoplay);
|
|
112
|
+
};
|
|
113
|
+
const stopAutoAddHandle = () => {
|
|
114
|
+
flagTime.value = null;
|
|
115
|
+
animationFrame.value && cancelAnimationFrame(animationFrame.value);
|
|
116
|
+
};
|
|
117
|
+
const mouseLeaveHandle = () => {
|
|
118
|
+
stopAutoAddHandle();
|
|
119
|
+
startAutoplay();
|
|
120
|
+
};
|
|
121
|
+
onMounted(() => {
|
|
122
|
+
startAutoplay();
|
|
123
|
+
});
|
|
124
|
+
watch(totalLen, (newVal, oldVal) => {
|
|
125
|
+
if (newVal !== oldVal) {
|
|
126
|
+
activeIndex.value = Math.min(activeIndex.value, newVal - 1);
|
|
127
|
+
stopAutoAddHandle();
|
|
128
|
+
startAutoplay();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
onUnmounted(() => {
|
|
132
|
+
stopAutoAddHandle();
|
|
133
|
+
});
|
|
134
|
+
return (_ctx, _cache) => {
|
|
135
|
+
return openBlock(), createElementBlock("div", {
|
|
136
|
+
onMouseleave: mouseLeaveHandle,
|
|
137
|
+
onMouseenter: stopAutoAddHandle,
|
|
138
|
+
class: "relative w-full group text-center overflow-x-hidden",
|
|
139
|
+
ref_key: "body",
|
|
140
|
+
ref: body,
|
|
141
|
+
style: normalizeStyle({ height: `${props.height || 200}px` })
|
|
142
|
+
}, [
|
|
143
|
+
createVNode(_sfc_main$1, { onClick: preHandle }),
|
|
144
|
+
createVNode(_sfc_main$1, {
|
|
145
|
+
onClick: nextHandle,
|
|
146
|
+
position: "right"
|
|
147
|
+
}),
|
|
148
|
+
createVNode(renderCarouselItem)
|
|
149
|
+
], 36);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
export {
|
|
154
|
+
_sfc_main as default
|
|
155
|
+
};
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { renderSlot } from "vue";
|
|
2
|
-
|
|
3
|
-
const target = sfc.__vccOpts || sfc;
|
|
4
|
-
for (const [key, val] of props) {
|
|
5
|
-
target[key] = val;
|
|
6
|
-
}
|
|
7
|
-
return target;
|
|
8
|
-
};
|
|
2
|
+
import { _ as _export_sfc } from "./index-b4e420ce.js";
|
|
9
3
|
const _sfc_main = {};
|
|
10
4
|
function _sfc_render(_ctx, _cache) {
|
|
11
5
|
return renderSlot(_ctx.$slots, "default");
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent, inject, computed, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, toDisplayString } from "vue";
|
|
2
|
+
const _hoisted_1 = ["value", "disabled"];
|
|
3
|
+
const _hoisted_2 = { class: "pl-2 peer-disabled:text-word9" };
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "checkbox",
|
|
6
|
+
props: {
|
|
7
|
+
label: {},
|
|
8
|
+
value: {},
|
|
9
|
+
modelValue: { type: Boolean },
|
|
10
|
+
disabled: { type: Boolean, default: false },
|
|
11
|
+
button: { type: Boolean }
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const addItem = inject("_addItem_", (_) => {
|
|
17
|
+
});
|
|
18
|
+
const deleteItem = inject("_deleteItem_", (_) => {
|
|
19
|
+
});
|
|
20
|
+
const checkedValues = inject("_checkedValues_", /* @__PURE__ */ new Set());
|
|
21
|
+
const isChecked = computed(() => checkedValues.has(props.value));
|
|
22
|
+
const checkedState = computed({
|
|
23
|
+
get: () => props.modelValue || isChecked.value,
|
|
24
|
+
set: (val) => {
|
|
25
|
+
emit("update:modelValue", val);
|
|
26
|
+
val ? addItem(props.value) : deleteItem(props.value);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const emit = __emit;
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return openBlock(), createElementBlock("label", {
|
|
32
|
+
class: normalizeClass(["select-none inline-flex items-center", { "cursor-not-allowed": _ctx.disabled }])
|
|
33
|
+
}, [
|
|
34
|
+
withDirectives(createElementVNode("input", {
|
|
35
|
+
type: "checkbox",
|
|
36
|
+
value: _ctx.value,
|
|
37
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checkedState.value = $event),
|
|
38
|
+
disabled: _ctx.disabled,
|
|
39
|
+
class: "peer disabled:cursor-not-allowed form-tick appearance-none h-4 w-4 border border-gray-300 rounded checked:border-transparent checked:bg-blue-600 focus:outline-none"
|
|
40
|
+
}, null, 8, _hoisted_1), [
|
|
41
|
+
[vModelCheckbox, checkedState.value]
|
|
42
|
+
]),
|
|
43
|
+
createElementVNode("span", _hoisted_2, toDisplayString(_ctx.label), 1)
|
|
44
|
+
], 2);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
_sfc_main as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent, inject, reactive, watch, provide, openBlock, createElementBlock, renderSlot } from "vue";
|
|
2
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
+
__name: "checkgroup",
|
|
4
|
+
props: {
|
|
5
|
+
modelValue: {},
|
|
6
|
+
showinput: { type: Boolean, default: false },
|
|
7
|
+
disabled: { type: Boolean }
|
|
8
|
+
},
|
|
9
|
+
emits: ["update:modelValue", "change"],
|
|
10
|
+
setup(__props, { emit: __emit }) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const emit = __emit;
|
|
13
|
+
const ParentGetChangeHandle = inject("changHandle", () => null);
|
|
14
|
+
const checkedSet = reactive(/* @__PURE__ */ new Set());
|
|
15
|
+
const syncSetToModel = () => {
|
|
16
|
+
const newValues = Array.from(checkedSet);
|
|
17
|
+
emit("update:modelValue", newValues);
|
|
18
|
+
emit("change", newValues);
|
|
19
|
+
ParentGetChangeHandle(newValues);
|
|
20
|
+
};
|
|
21
|
+
const addItem = (value) => {
|
|
22
|
+
if (!checkedSet.has(value)) {
|
|
23
|
+
checkedSet.add(value);
|
|
24
|
+
syncSetToModel();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const deleteItem = (value) => {
|
|
28
|
+
if (checkedSet.has(value)) {
|
|
29
|
+
checkedSet.delete(value);
|
|
30
|
+
syncSetToModel();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
watch(
|
|
34
|
+
() => props.modelValue,
|
|
35
|
+
(newValues) => {
|
|
36
|
+
const newSet = new Set(newValues);
|
|
37
|
+
checkedSet.forEach((value) => {
|
|
38
|
+
if (!newSet.has(value)) {
|
|
39
|
+
checkedSet.delete(value);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
newValues.forEach((value) => checkedSet.add(value));
|
|
43
|
+
},
|
|
44
|
+
{ immediate: true }
|
|
45
|
+
);
|
|
46
|
+
provide("_addItem_", addItem);
|
|
47
|
+
provide("_deleteItem_", deleteItem);
|
|
48
|
+
provide("_checkedValues_", checkedSet);
|
|
49
|
+
return (_ctx, _cache) => {
|
|
50
|
+
return openBlock(), createElementBlock("div", null, [
|
|
51
|
+
renderSlot(_ctx.$slots, "default")
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
_sfc_main as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { openBlock, createElementBlock, createElementVNode } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./index-b4e420ce.js";
|
|
3
|
+
const _sfc_main = {};
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
viewBox: "0 0 1024 1024",
|
|
6
|
+
version: "1.1",
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
"p-id": "669"
|
|
9
|
+
};
|
|
10
|
+
function _sfc_render(_ctx, _cache) {
|
|
11
|
+
return openBlock(), createElementBlock("svg", _hoisted_1, _cache[0] || (_cache[0] = [
|
|
12
|
+
createElementVNode("path", {
|
|
13
|
+
d: "M842.666667 864c-8.533333 0-14.933333-2.133333-21.333334-8.533333l-341.333333-309.333334c-6.4-6.4-10.666667-14.933333-10.666667-23.466666 0-8.533333 4.266667-17.066667 10.666667-23.466667l341.333333-309.333333c12.8-12.8 34.133333-10.666667 44.8 2.133333 12.8 12.8 10.666667 34.133333-2.133333 44.8L548.266667 522.666667l315.733333 285.866666c12.8 10.666667 14.933333 32 2.133333 44.8-6.4 6.4-14.933333 10.666667-23.466666 10.666667z",
|
|
14
|
+
fill: "#666666"
|
|
15
|
+
}, null, -1),
|
|
16
|
+
createElementVNode("path", {
|
|
17
|
+
d: "M512 864c-8.533333 0-14.933333-2.133333-21.333333-8.533333L149.333333 546.133333c-6.4-6.4-10.666667-14.933333-10.666666-23.466666 0-8.533333 4.266667-17.066667 10.666666-23.466667L490.666667 189.866667c12.8-12.8 34.133333-10.666667 44.8 2.133333 12.8 12.8 10.666667 34.133333-2.133334 44.8L217.6 522.666667 533.333333 808.533333c12.8 12.8 14.933333 32 2.133334 44.8-6.4 6.4-14.933333 10.666667-23.466667 10.666667z",
|
|
18
|
+
fill: "#666666"
|
|
19
|
+
}, null, -1)
|
|
20
|
+
]));
|
|
21
|
+
}
|
|
22
|
+
const ArrowPlug = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
23
|
+
export {
|
|
24
|
+
ArrowPlug as A
|
|
25
|
+
};
|