ninemoon-ui 0.0.9 → 0.0.11
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/popover/popover.vue.d.ts +15 -0
- package/dist/components/select/select.vue.d.ts +2 -2
- package/dist/components/utils/tool.d.ts +2 -2
- package/dist/index.css +75 -0
- package/dist/index.d.ts +27 -2
- package/dist/index.umd.js +296 -136
- package/dist/js/carousel/carousel.js +2 -2
- package/dist/js/check/checkgroup.js +4 -4
- package/dist/js/form/form.js +2 -2
- package/dist/js/index/index.js +102 -75
- package/dist/js/popover/popover.js +84 -28
- package/dist/js/radio/radiogroup.js +4 -4
- package/dist/js/select/select.js +6 -3
- package/dist/js/table/table.js +4 -2
- package/dist/js/tabs/tabs.js +20 -23
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useSlots, ref, computed, onMounted, watch, onUnmounted, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode, h } from "vue";
|
|
1
|
+
import { defineComponent, useSlots, ref, computed, onMounted, watch, onUnmounted, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode, h, normalizeClass } from "vue";
|
|
2
2
|
const _hoisted_1 = /* @__PURE__ */ createElementVNode("svg", {
|
|
3
3
|
class: "tdd-w-4 tdd-h-4 tdd-fill-white tdd-inline-block",
|
|
4
4
|
viewBox: "0 0 1024 1024",
|
|
@@ -61,7 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
return h(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
|
-
class: "carouselBody
|
|
64
|
+
class: normalizeClass(["carouselBody", [activeIndex.value === d ? "tdd-z-10" : "-tdd-z-10"]]),
|
|
65
65
|
style: {
|
|
66
66
|
transform: `translateX(${transformNum}px)`
|
|
67
67
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, inject, useSlots, openBlock, createBlock, h, withDirectives, vModelCheckbox } from "vue";
|
|
1
|
+
import { defineComponent, inject, useSlots, openBlock, createBlock, h, normalizeClass, withDirectives, vModelCheckbox } from "vue";
|
|
2
2
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
3
|
__name: "checkgroup",
|
|
4
4
|
props: {
|
|
@@ -15,7 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
return h(
|
|
16
16
|
"label",
|
|
17
17
|
{
|
|
18
|
-
class: "checkGroup
|
|
18
|
+
class: normalizeClass(["checkGroup", [MySlot.props.class, props.modelValue.includes(MySlot.props.label) ? "tdd-bg-wordblue" : ""]])
|
|
19
19
|
},
|
|
20
20
|
[
|
|
21
21
|
withDirectives(
|
|
@@ -26,14 +26,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
ParentGetChangeHandle(value);
|
|
27
27
|
emit("update:modelValue", value);
|
|
28
28
|
},
|
|
29
|
-
class: "hiddeninput form-tick"
|
|
29
|
+
class: normalizeClass(["hiddeninput form-tick", [props.showinput ? "" : "tdd-hidden"]])
|
|
30
30
|
}),
|
|
31
31
|
[[vModelCheckbox, props.modelValue]]
|
|
32
32
|
),
|
|
33
33
|
h(
|
|
34
34
|
"span",
|
|
35
35
|
{
|
|
36
|
-
class: "tdd-text-sm
|
|
36
|
+
class: normalizeClass(["tdd-text-sm", [props.modelValue.includes(MySlot.props.label) ? "tdd-text-white" : "tdd-text-word6"]])
|
|
37
37
|
},
|
|
38
38
|
((_a = MySlot.children) == null ? void 0 : _a.default()) || MySlot.props.label
|
|
39
39
|
)
|
package/dist/js/form/form.js
CHANGED
|
@@ -24,14 +24,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
};
|
|
25
25
|
const validate = async (callBack) => {
|
|
26
26
|
let passflag = true;
|
|
27
|
-
|
|
27
|
+
checkList.value.forEach(async (rule) => {
|
|
28
28
|
await rule.fc((msg) => {
|
|
29
29
|
if (msg !== null && msg !== void 0) {
|
|
30
30
|
passflag = false;
|
|
31
31
|
console.warn(msg);
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
}
|
|
34
|
+
});
|
|
35
35
|
if (passflag === true) {
|
|
36
36
|
callBack(passflag);
|
|
37
37
|
}
|
package/dist/js/index/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, onUnmounted, openBlock, createBlock, Teleport, createElementVNode, createVNode, TransitionGroup, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createCommentVNode,
|
|
1
|
+
import { defineComponent, ref, watch, onUnmounted, openBlock, createBlock, Teleport, createElementVNode, createVNode, TransitionGroup, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createCommentVNode, resolveDynamicComponent, h, createApp, reactive, toDisplayString, nextTick, defineAsyncComponent } from "vue";
|
|
2
2
|
const _hoisted_1$2 = { class: "tdd-pointer-events-none tdd-fixed tdd-right-0 tdd-left-0 tdd-bottom-0 tdd-top-4 tdd-z-2000 tdd-space-y-5" };
|
|
3
3
|
const _hoisted_2$2 = { class: "tdd-pointer-events-auto tdd-inline-flex tdd-items-center tdd-space-x-3 tdd-bg-white tdd-p-3 tdd-text-sm tdd-text-word3 tdd-drop-shadow" };
|
|
4
4
|
const _hoisted_3$1 = {
|
|
@@ -6,13 +6,9 @@ const _hoisted_3$1 = {
|
|
|
6
6
|
class: "tdd-h-4 tdd-w-4 tdd-fill-white",
|
|
7
7
|
viewBox: "0 0 1024 1024",
|
|
8
8
|
version: "1.1",
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
-
"p-id": "2124"
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11
10
|
};
|
|
12
|
-
const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("path", {
|
|
13
|
-
d: "M883.2 247.466667c-17.066667-17.066667-44.8-17.066667-59.733333 0L409.6 665.6l-209.066667-204.8c-17.066667-17.066667-44.8-17.066667-59.733333 0-17.066667 17.066667-17.066667 44.8 0 59.733333l238.933333 234.666667c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8l443.733333-448c17.066667-17.066667 17.066667-42.666667 0-59.733333z",
|
|
14
|
-
"p-id": "2125"
|
|
15
|
-
}, null, -1);
|
|
11
|
+
const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("path", { d: "M883.2 247.466667c-17.066667-17.066667-44.8-17.066667-59.733333 0L409.6 665.6l-209.066667-204.8c-17.066667-17.066667-44.8-17.066667-59.733333 0-17.066667 17.066667-17.066667 44.8 0 59.733333l238.933333 234.666667c8.533333 8.533333 19.2 12.8 29.866667 12.8 10.666667 0 21.333333-4.266667 29.866667-12.8l443.733333-448c17.066667-17.066667 17.066667-42.666667 0-59.733333z" }, null, -1);
|
|
16
12
|
const _hoisted_5$1 = [
|
|
17
13
|
_hoisted_4$1
|
|
18
14
|
];
|
|
@@ -21,13 +17,9 @@ const _hoisted_6$1 = {
|
|
|
21
17
|
class: "tdd-h-4 tdd-w-4 tdd-fill-white",
|
|
22
18
|
viewBox: "0 0 1024 1024",
|
|
23
19
|
version: "1.1",
|
|
24
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
25
|
-
"p-id": "762"
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
26
21
|
};
|
|
27
|
-
const _hoisted_7$1 = /* @__PURE__ */ createElementVNode("path", {
|
|
28
|
-
d: "M556.8 512L832 236.8c12.8-12.8 12.8-32 0-44.8-12.8-12.8-32-12.8-44.8 0L512 467.2l-275.2-277.333333c-12.8-12.8-32-12.8-44.8 0-12.8 12.8-12.8 32 0 44.8l275.2 277.333333-277.333333 275.2c-12.8 12.8-12.8 32 0 44.8 6.4 6.4 14.933333 8.533333 23.466666 8.533333s17.066667-2.133333 23.466667-8.533333L512 556.8 787.2 832c6.4 6.4 14.933333 8.533333 23.466667 8.533333s17.066667-2.133333 23.466666-8.533333c12.8-12.8 12.8-32 0-44.8L556.8 512z",
|
|
29
|
-
"p-id": "763"
|
|
30
|
-
}, null, -1);
|
|
22
|
+
const _hoisted_7$1 = /* @__PURE__ */ createElementVNode("path", { d: "M556.8 512L832 236.8c12.8-12.8 12.8-32 0-44.8-12.8-12.8-32-12.8-44.8 0L512 467.2l-275.2-277.333333c-12.8-12.8-32-12.8-44.8 0-12.8 12.8-12.8 32 0 44.8l275.2 277.333333-277.333333 275.2c-12.8 12.8-12.8 32 0 44.8 6.4 6.4 14.933333 8.533333 23.466666 8.533333s17.066667-2.133333 23.466667-8.533333L512 556.8 787.2 832c6.4 6.4 14.933333 8.533333 23.466667 8.533333s17.066667-2.133333 23.466666-8.533333c12.8-12.8 12.8-32 0-44.8L556.8 512z" }, null, -1);
|
|
31
23
|
const _hoisted_8$1 = [
|
|
32
24
|
_hoisted_7$1
|
|
33
25
|
];
|
|
@@ -36,17 +28,10 @@ const _hoisted_9 = {
|
|
|
36
28
|
class: "tdd-h-4 tdd-w-4 tdd-fill-white",
|
|
37
29
|
viewBox: "0 0 1024 1024",
|
|
38
30
|
version: "1.1",
|
|
39
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
40
|
-
"p-id": "1618"
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
41
32
|
};
|
|
42
|
-
const _hoisted_10 = /* @__PURE__ */ createElementVNode("path", {
|
|
43
|
-
|
|
44
|
-
"p-id": "1620"
|
|
45
|
-
}, null, -1);
|
|
46
|
-
const _hoisted_11 = /* @__PURE__ */ createElementVNode("path", {
|
|
47
|
-
d: "M512 437.333333c-17.066667 0-32 14.933333-32 32v234.666667c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V469.333333c0-17.066667-14.933333-32-32-32z",
|
|
48
|
-
"p-id": "1621"
|
|
49
|
-
}, null, -1);
|
|
33
|
+
const _hoisted_10 = /* @__PURE__ */ createElementVNode("path", { d: "M512 320m-42.666667 0a42.666667 42.666667 0 1 0 85.333334 0 42.666667 42.666667 0 1 0-85.333334 0Z" }, null, -1);
|
|
34
|
+
const _hoisted_11 = /* @__PURE__ */ createElementVNode("path", { d: "M512 437.333333c-17.066667 0-32 14.933333-32 32v234.666667c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V469.333333c0-17.066667-14.933333-32-32-32z" }, null, -1);
|
|
50
35
|
const _hoisted_12 = [
|
|
51
36
|
_hoisted_10,
|
|
52
37
|
_hoisted_11
|
|
@@ -56,19 +41,14 @@ const _hoisted_13 = {
|
|
|
56
41
|
class: "tdd-h-4 tdd-w-4 tdd-fill-white",
|
|
57
42
|
viewBox: "0 0 1024 1024",
|
|
58
43
|
version: "1.1",
|
|
59
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
60
|
-
"p-id": "1487"
|
|
44
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
61
45
|
};
|
|
62
|
-
const _hoisted_14 = /* @__PURE__ */ createElementVNode("path", {
|
|
63
|
-
d: "M800 625.066667V448c0-117.333333-70.4-217.6-170.666667-262.4-4.266667-61.866667-55.466667-110.933333-117.333333-110.933333s-113.066667 49.066667-117.333333 110.933333c-100.266667 44.8-170.666667 145.066667-170.666667 262.4v177.066667c-57.6 46.933333-85.333333 110.933333-85.333333 185.6 0 17.066667 14.933333 32 32 32h206.933333c14.933333 61.866667 70.4 106.666667 134.4 106.666666s119.466667-44.8 134.4-106.666666H853.333333c17.066667 0 32-14.933333 32-32 0-76.8-27.733333-138.666667-85.333333-185.6zM512 138.666667c19.2 0 36.266667 10.666667 44.8 25.6-14.933333-2.133333-29.866667-4.266667-44.8-4.266667-14.933333 0-29.866667 2.133333-44.8 4.266667 8.533333-14.933333 25.6-25.6 44.8-25.6z m0 746.666666c-29.866667 0-55.466667-17.066667-66.133333-42.666666h134.4c-12.8 25.6-38.4 42.666667-68.266667 42.666666z m-307.2-106.666666c6.4-46.933333 29.866667-83.2 70.4-113.066667 8.533333-6.4 12.8-14.933333 12.8-25.6v-192c0-123.733333 100.266667-224 224-224S736 324.266667 736 448v192c0 10.666667 4.266667 19.2 12.8 25.6 40.533333 29.866667 64 66.133333 70.4 113.066667H204.8z",
|
|
64
|
-
"p-id": "1488"
|
|
65
|
-
}, null, -1);
|
|
46
|
+
const _hoisted_14 = /* @__PURE__ */ createElementVNode("path", { d: "M800 625.066667V448c0-117.333333-70.4-217.6-170.666667-262.4-4.266667-61.866667-55.466667-110.933333-117.333333-110.933333s-113.066667 49.066667-117.333333 110.933333c-100.266667 44.8-170.666667 145.066667-170.666667 262.4v177.066667c-57.6 46.933333-85.333333 110.933333-85.333333 185.6 0 17.066667 14.933333 32 32 32h206.933333c14.933333 61.866667 70.4 106.666667 134.4 106.666666s119.466667-44.8 134.4-106.666666H853.333333c17.066667 0 32-14.933333 32-32 0-76.8-27.733333-138.666667-85.333333-185.6zM512 138.666667c19.2 0 36.266667 10.666667 44.8 25.6-14.933333-2.133333-29.866667-4.266667-44.8-4.266667-14.933333 0-29.866667 2.133333-44.8 4.266667 8.533333-14.933333 25.6-25.6 44.8-25.6z m0 746.666666c-29.866667 0-55.466667-17.066667-66.133333-42.666666h134.4c-12.8 25.6-38.4 42.666667-68.266667 42.666666z m-307.2-106.666666c6.4-46.933333 29.866667-83.2 70.4-113.066667 8.533333-6.4 12.8-14.933333 12.8-25.6v-192c0-123.733333 100.266667-224 224-224S736 324.266667 736 448v192c0 10.666667 4.266667 19.2 12.8 25.6 40.533333 29.866667 64 66.133333 70.4 113.066667H204.8z" }, null, -1);
|
|
66
47
|
const _hoisted_15 = [
|
|
67
48
|
_hoisted_14
|
|
68
49
|
];
|
|
69
|
-
const _hoisted_16 =
|
|
70
|
-
const _hoisted_17 =
|
|
71
|
-
const _hoisted_18 = /* @__PURE__ */ createElementVNode("svg", {
|
|
50
|
+
const _hoisted_16 = ["onClick"];
|
|
51
|
+
const _hoisted_17 = /* @__PURE__ */ createElementVNode("svg", {
|
|
72
52
|
class: "tdd-h-5 tdd-w-5 tdd-fill-gray-600",
|
|
73
53
|
xmlns: "http://www.w3.org/2000/svg",
|
|
74
54
|
width: "24",
|
|
@@ -85,8 +65,8 @@ const _hoisted_18 = /* @__PURE__ */ createElementVNode("svg", {
|
|
|
85
65
|
})
|
|
86
66
|
])
|
|
87
67
|
], -1);
|
|
88
|
-
const
|
|
89
|
-
|
|
68
|
+
const _hoisted_18 = [
|
|
69
|
+
_hoisted_17
|
|
90
70
|
];
|
|
91
71
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
92
72
|
__name: "messagecomponent",
|
|
@@ -174,6 +154,25 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
174
154
|
},
|
|
175
155
|
{ deep: true }
|
|
176
156
|
);
|
|
157
|
+
const contentRender = (props) => {
|
|
158
|
+
if (Array.isArray(props.c.vnode)) {
|
|
159
|
+
return props.c.vnode.map((v) => {
|
|
160
|
+
return createBlock(
|
|
161
|
+
resolveDynamicComponent(v)
|
|
162
|
+
);
|
|
163
|
+
});
|
|
164
|
+
} else if (props.c.vnode) {
|
|
165
|
+
return createBlock(
|
|
166
|
+
resolveDynamicComponent(props.c.vnode)
|
|
167
|
+
);
|
|
168
|
+
} else {
|
|
169
|
+
return h(
|
|
170
|
+
"div",
|
|
171
|
+
{},
|
|
172
|
+
props.c.text
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
177
176
|
onUnmounted(() => {
|
|
178
177
|
messageList.value.length = 0;
|
|
179
178
|
});
|
|
@@ -208,16 +207,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
208
207
|
i.type === "warning" ? (openBlock(), createElementBlock("svg", _hoisted_9, _hoisted_12)) : createCommentVNode("", true),
|
|
209
208
|
i.type === "info" ? (openBlock(), createElementBlock("svg", _hoisted_13, _hoisted_15)) : createCommentVNode("", true)
|
|
210
209
|
], 2),
|
|
211
|
-
|
|
212
|
-
i.vnode instanceof Array ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(i.vnode, (j) => {
|
|
213
|
-
return openBlock(), createBlock(resolveDynamicComponent(j));
|
|
214
|
-
}), 256)) : (openBlock(), createBlock(resolveDynamicComponent(i.vnode), { key: 2 })),
|
|
210
|
+
createVNode(contentRender, { c: i }, null, 8, ["c"]),
|
|
215
211
|
i.showClose ? (openBlock(), createElementBlock("button", {
|
|
216
|
-
key:
|
|
212
|
+
key: 0,
|
|
217
213
|
type: "button",
|
|
218
214
|
class: "tdd-appearance-none",
|
|
219
215
|
onClick: ($event) => hidden(d)
|
|
220
|
-
},
|
|
216
|
+
}, _hoisted_18, 8, _hoisted_16)) : createCommentVNode("", true)
|
|
221
217
|
])
|
|
222
218
|
]);
|
|
223
219
|
}), 128))
|
|
@@ -552,49 +548,80 @@ const throttle = (fn, delay) => {
|
|
|
552
548
|
};
|
|
553
549
|
};
|
|
554
550
|
const usePotion = (baseDom, aimDom, set) => {
|
|
555
|
-
let
|
|
556
|
-
let
|
|
557
|
-
let
|
|
558
|
-
let
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
551
|
+
let left = 0;
|
|
552
|
+
let top = 0;
|
|
553
|
+
let arrowleft = 0;
|
|
554
|
+
let arrowtop = 0;
|
|
555
|
+
if (!baseDom || !aimDom) {
|
|
556
|
+
return {
|
|
557
|
+
Top: top,
|
|
558
|
+
Left: left,
|
|
559
|
+
arrowLeft: arrowleft,
|
|
560
|
+
arrowTop: arrowtop
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
const { left: baseLeft, right, bottom, top: baseTop, width: baseWidth } = baseDom.getBoundingClientRect();
|
|
564
|
+
const { height: aimHeight, width: aimWidth } = aimDom.getBoundingClientRect();
|
|
562
565
|
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
563
566
|
const scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
567
|
+
switch (set == null ? void 0 : set.position) {
|
|
568
|
+
case "bottomleft":
|
|
569
|
+
case "bottommiddle":
|
|
570
|
+
case "bottomright":
|
|
571
|
+
top = scrollTop + bottom;
|
|
572
|
+
arrowtop = -5;
|
|
573
|
+
break;
|
|
574
|
+
case "topleft":
|
|
575
|
+
case "topmiddle":
|
|
576
|
+
case "topright":
|
|
577
|
+
top = scrollTop + baseTop - aimHeight;
|
|
578
|
+
arrowtop = aimHeight - 5;
|
|
579
|
+
break;
|
|
580
|
+
case "centerleft":
|
|
581
|
+
case "centerright":
|
|
582
|
+
top = scrollTop + baseTop + (bottom - baseTop - aimHeight) / 2;
|
|
583
|
+
arrowtop = aimHeight / 2 - 5;
|
|
584
|
+
break;
|
|
570
585
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
586
|
+
switch (set == null ? void 0 : set.position) {
|
|
587
|
+
case "topleft":
|
|
588
|
+
case "bottomleft":
|
|
589
|
+
left = scrollLeft + baseLeft;
|
|
590
|
+
arrowleft = (right - baseLeft) / 2;
|
|
591
|
+
break;
|
|
592
|
+
case "topmiddle":
|
|
593
|
+
case "bottommiddle":
|
|
594
|
+
left = scrollLeft + baseLeft + (right - baseLeft - aimWidth) / 2;
|
|
595
|
+
arrowleft = aimWidth / 2 - 5;
|
|
596
|
+
break;
|
|
597
|
+
case "topright":
|
|
598
|
+
case "bottomright":
|
|
599
|
+
left = scrollLeft + right - aimWidth;
|
|
600
|
+
arrowleft = aimWidth - baseWidth + baseWidth / 2 - 5;
|
|
601
|
+
break;
|
|
602
|
+
case "centerleft":
|
|
603
|
+
left = scrollLeft + baseLeft - aimWidth;
|
|
604
|
+
arrowleft = aimWidth - 5;
|
|
605
|
+
break;
|
|
606
|
+
case "centerright":
|
|
607
|
+
left = scrollLeft + right;
|
|
608
|
+
arrowleft = -5;
|
|
609
|
+
break;
|
|
581
610
|
}
|
|
582
|
-
if (
|
|
583
|
-
|
|
611
|
+
if (top + aimHeight > window.innerHeight) {
|
|
612
|
+
top = scrollTop + window.innerHeight - aimHeight - 10;
|
|
584
613
|
}
|
|
585
|
-
if (
|
|
586
|
-
|
|
614
|
+
if (top < 0) {
|
|
615
|
+
top = 10;
|
|
587
616
|
}
|
|
588
|
-
if (
|
|
589
|
-
|
|
617
|
+
if (left + aimWidth > window.innerWidth) {
|
|
618
|
+
left = scrollLeft + right - aimWidth;
|
|
590
619
|
}
|
|
591
|
-
Width = width;
|
|
592
|
-
Height = height;
|
|
593
620
|
return {
|
|
594
|
-
Top,
|
|
595
|
-
Left,
|
|
596
|
-
|
|
597
|
-
|
|
621
|
+
Top: top,
|
|
622
|
+
Left: left,
|
|
623
|
+
arrowLeft: arrowleft,
|
|
624
|
+
arrowTop: arrowtop
|
|
598
625
|
};
|
|
599
626
|
};
|
|
600
627
|
function getNewArray(array, subGroupLength) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed,
|
|
1
|
+
import { defineComponent, ref, computed, nextTick, onUnmounted, openBlock, createElementBlock, withModifiers, renderSlot, createBlock, Teleport, Transition, withCtx, withDirectives, normalizeClass, normalizeStyle, createVNode, createCommentVNode, vShow, h } from "vue";
|
|
2
2
|
import { u as usePotion, t as throttle } from "../index/index.js";
|
|
3
3
|
const _hoisted_1 = ["onMouseenter"];
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -9,7 +9,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9
9
|
placement: { default: "topleft" },
|
|
10
10
|
insertClass: {},
|
|
11
11
|
beforeHidden: {},
|
|
12
|
-
modelValue: { type: Boolean }
|
|
12
|
+
modelValue: { type: Boolean },
|
|
13
|
+
beforebgcolor: {},
|
|
14
|
+
vIF: { type: Boolean, default: true }
|
|
13
15
|
},
|
|
14
16
|
emits: ["update:modelValue"],
|
|
15
17
|
setup(__props, { expose: __expose, emit: emitAct }) {
|
|
@@ -17,7 +19,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
19
|
const base = ref();
|
|
18
20
|
const pop = ref();
|
|
19
21
|
const showPop = ref(false);
|
|
20
|
-
const
|
|
22
|
+
const trueFlag = computed(() => {
|
|
23
|
+
if (showPop.value || props.trigger === "native" && props.modelValue) {
|
|
24
|
+
nextTick(() => {
|
|
25
|
+
setPosition();
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
window.removeEventListener("resize", setPosition);
|
|
29
|
+
window.removeEventListener("scroll", setPosition, true);
|
|
30
|
+
}
|
|
21
31
|
if (props.trigger === "native") {
|
|
22
32
|
return props.modelValue;
|
|
23
33
|
} else {
|
|
@@ -30,22 +40,41 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
40
|
case "topleft":
|
|
31
41
|
case "topmiddle":
|
|
32
42
|
case "topright":
|
|
33
|
-
margin = "-mt-3";
|
|
43
|
+
margin = "-tdd-mt-3";
|
|
34
44
|
break;
|
|
35
45
|
case "bottomleft":
|
|
36
46
|
case "bottommiddle":
|
|
37
47
|
case "bottomright":
|
|
38
|
-
margin = "mt-3";
|
|
48
|
+
margin = "tdd-mt-3";
|
|
39
49
|
break;
|
|
40
50
|
case "centerleft":
|
|
41
|
-
margin = "-ml-3";
|
|
51
|
+
margin = "-tdd-ml-3";
|
|
42
52
|
break;
|
|
43
53
|
case "centerright":
|
|
44
|
-
margin = "ml-3";
|
|
54
|
+
margin = "tdd-ml-3";
|
|
45
55
|
break;
|
|
46
56
|
}
|
|
47
57
|
return margin;
|
|
48
58
|
});
|
|
59
|
+
const arrowHandle = () => {
|
|
60
|
+
return h(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
class: normalizeClass([
|
|
64
|
+
"tdd-absolute tdd-z-1000 tdd-w-2.5 tdd-h-2.5 before:tdd-bg-white before:tdd-box-border before:tdd-rotate-45 before:tdd-content-[''] before:tdd-w-2.5 before:tdd-h-2.5 before:tdd-absolute",
|
|
65
|
+
["topleft", "topmiddle", "topright"].includes(props.placement) ? "before:tdd-border-t-transparent before:tdd-border-l-transparent" : "",
|
|
66
|
+
["bottomleft", "bottommiddle", "bottomright"].includes(props.placement) ? "before:tdd-border-b-transparent before:tdd-border-r-transparent" : "",
|
|
67
|
+
"centerright" == props.placement ? "before:tdd-border-r-transparent before:tdd-border-t-transparent" : "",
|
|
68
|
+
"centerleft" == props.placement ? "before:tdd-border-l-transparent before:tdd-border-b-transparent" : "",
|
|
69
|
+
props.beforebgcolor
|
|
70
|
+
]),
|
|
71
|
+
style: {
|
|
72
|
+
left: `${arrowLeft.value}px`,
|
|
73
|
+
top: `${arrowTop.value}px`
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
};
|
|
49
78
|
const showHandle = () => {
|
|
50
79
|
showPop.value = true;
|
|
51
80
|
};
|
|
@@ -56,37 +85,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
56
85
|
};
|
|
57
86
|
const Left = ref(0);
|
|
58
87
|
const Top = ref(0);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
nextTick(() => {
|
|
62
|
-
setPosition();
|
|
63
|
-
if (props.trigger === "hover")
|
|
64
|
-
return;
|
|
65
|
-
window.addEventListener("resize", setPosition);
|
|
66
|
-
window.addEventListener("scroll", setPosition, true);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
});
|
|
88
|
+
const arrowLeft = ref(0);
|
|
89
|
+
const arrowTop = ref(0);
|
|
70
90
|
const setPosition = () => {
|
|
71
|
-
|
|
91
|
+
if (!pop.value) {
|
|
92
|
+
window.removeEventListener("resize", setPosition);
|
|
93
|
+
window.removeEventListener("scroll", setPosition, true);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const { top, bottom } = base.value.getBoundingClientRect();
|
|
72
97
|
if (top < 0 || bottom > window.innerHeight) {
|
|
73
98
|
if (props.trigger === "native") {
|
|
74
99
|
emitAct("update:modelValue", false);
|
|
75
100
|
} else {
|
|
76
101
|
showPop.value = false;
|
|
77
102
|
}
|
|
78
|
-
window.removeEventListener("resize", setPosition);
|
|
79
|
-
window.removeEventListener("scroll", setPosition, true);
|
|
80
103
|
return;
|
|
81
104
|
}
|
|
105
|
+
window.addEventListener("resize", setPosition);
|
|
106
|
+
window.addEventListener("scroll", setPosition, true);
|
|
82
107
|
const position = usePotion(base.value, pop.value, {
|
|
83
108
|
position: props.placement
|
|
84
109
|
});
|
|
85
110
|
Top.value = position.Top;
|
|
86
111
|
Left.value = position.Left;
|
|
112
|
+
arrowTop.value = position.arrowTop;
|
|
113
|
+
arrowLeft.value = position.arrowLeft;
|
|
87
114
|
};
|
|
88
115
|
const vClickoutside = {
|
|
89
116
|
mounted(el, binding) {
|
|
117
|
+
if (!(el instanceof HTMLElement)) {
|
|
118
|
+
console.error("el must be an instance of HTMLElement");
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
90
121
|
function documentHandler(e) {
|
|
91
122
|
if ((el == null ? void 0 : el.contains) && (el == null ? void 0 : el.contains(e.target))) {
|
|
92
123
|
return false;
|
|
@@ -105,6 +136,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
105
136
|
}
|
|
106
137
|
},
|
|
107
138
|
beforeUnmount(el) {
|
|
139
|
+
if (!(el instanceof HTMLElement)) {
|
|
140
|
+
console.error("el must be an instance of HTMLElement");
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
108
143
|
document.removeEventListener("click", el._vueClickOutside_);
|
|
109
144
|
switch (props.trigger) {
|
|
110
145
|
case "hover":
|
|
@@ -125,8 +160,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
125
160
|
if (disablecancelflag === true) {
|
|
126
161
|
return;
|
|
127
162
|
} else {
|
|
128
|
-
window.removeEventListener("resize", setPosition);
|
|
129
|
-
window.removeEventListener("scroll", setPosition, true);
|
|
130
163
|
if (props.trigger === "native") {
|
|
131
164
|
emitAct("update:modelValue", false);
|
|
132
165
|
} else {
|
|
@@ -168,24 +201,47 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
168
201
|
renderSlot(_ctx.$slots, "reference"),
|
|
169
202
|
(openBlock(), createBlock(Teleport, {
|
|
170
203
|
to: "body",
|
|
171
|
-
disabled: !
|
|
204
|
+
disabled: !trueFlag.value
|
|
172
205
|
}, [
|
|
173
|
-
|
|
206
|
+
_ctx.vIF ? (openBlock(), createBlock(Transition, {
|
|
207
|
+
key: 0,
|
|
208
|
+
name: "opecity"
|
|
209
|
+
}, {
|
|
174
210
|
default: withCtx(() => [
|
|
175
|
-
|
|
211
|
+
trueFlag.value ? withDirectives((openBlock(), createElementBlock("div", {
|
|
176
212
|
key: 0,
|
|
177
213
|
ref_key: "pop",
|
|
178
214
|
ref: pop,
|
|
179
215
|
class: normalizeClass(["tdd-absolute tdd-z-1000 tdd-rounded tdd-bg-white tdd-p-4 tdd-drop-shadow", [marginClass.value, _ctx.insertClass]]),
|
|
180
216
|
style: normalizeStyle({ width: widthNum.value, top: `${Top.value}px`, left: `${Left.value}px` })
|
|
181
217
|
}, [
|
|
182
|
-
renderSlot(_ctx.$slots, "default")
|
|
218
|
+
renderSlot(_ctx.$slots, "default"),
|
|
219
|
+
createVNode(arrowHandle)
|
|
183
220
|
], 6)), [
|
|
184
221
|
[vClickoutside, closeCenter]
|
|
185
222
|
]) : createCommentVNode("", true)
|
|
186
223
|
]),
|
|
187
224
|
_: 3
|
|
188
|
-
})
|
|
225
|
+
})) : (openBlock(), createBlock(Transition, {
|
|
226
|
+
key: 1,
|
|
227
|
+
name: "opecity"
|
|
228
|
+
}, {
|
|
229
|
+
default: withCtx(() => [
|
|
230
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
|
231
|
+
ref_key: "pop",
|
|
232
|
+
ref: pop,
|
|
233
|
+
class: normalizeClass(["tdd-absolute tdd-z-1000 tdd-rounded tdd-bg-white tdd-p-4 tdd-drop-shadow", [marginClass.value, _ctx.insertClass]]),
|
|
234
|
+
style: normalizeStyle({ width: widthNum.value, top: `${Top.value}px`, left: `${Left.value}px` })
|
|
235
|
+
}, [
|
|
236
|
+
renderSlot(_ctx.$slots, "default"),
|
|
237
|
+
createVNode(arrowHandle)
|
|
238
|
+
], 6)), [
|
|
239
|
+
[vShow, trueFlag.value],
|
|
240
|
+
[vClickoutside, closeCenter]
|
|
241
|
+
])
|
|
242
|
+
]),
|
|
243
|
+
_: 3
|
|
244
|
+
}))
|
|
189
245
|
], 8, ["disabled"]))
|
|
190
246
|
], 40, _hoisted_1);
|
|
191
247
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, inject, useSlots, openBlock, createBlock, h, withDirectives, vModelRadio } from "vue";
|
|
1
|
+
import { defineComponent, inject, useSlots, openBlock, createBlock, h, normalizeClass, withDirectives, vModelRadio } from "vue";
|
|
2
2
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
3
|
__name: "radiogroup",
|
|
4
4
|
props: {
|
|
@@ -15,7 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
return h(
|
|
16
16
|
"label",
|
|
17
17
|
{
|
|
18
|
-
class: "radioGroup
|
|
18
|
+
class: normalizeClass(["radioGroup", [(_a = MySlot.props) == null ? void 0 : _a.class, props.modelValue == MySlot.props.label ? "tdd-bg-wordblue" : ""]])
|
|
19
19
|
},
|
|
20
20
|
[
|
|
21
21
|
withDirectives(
|
|
@@ -26,14 +26,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
ParentGetChangeHandle(value);
|
|
27
27
|
emit("update:modelValue", value);
|
|
28
28
|
},
|
|
29
|
-
class: "hiddeninput form-tick"
|
|
29
|
+
class: normalizeClass(["hiddeninput form-tick", [props.showinput ? "" : "tdd-hidden"]])
|
|
30
30
|
}),
|
|
31
31
|
[[vModelRadio, props.modelValue]]
|
|
32
32
|
),
|
|
33
33
|
h(
|
|
34
34
|
"span",
|
|
35
35
|
{
|
|
36
|
-
class: "tdd-text-sm
|
|
36
|
+
class: normalizeClass(["tdd-text-sm", [props.modelValue == MySlot.props.label ? "tdd-text-white" : "tdd-text-word6"]])
|
|
37
37
|
},
|
|
38
38
|
((_b = MySlot.children) == null ? void 0 : _b.default()) || MySlot.props.label
|
|
39
39
|
)
|
package/dist/js/select/select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, defineAsyncComponent, inject, useSlots, ref, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, h } from "vue";
|
|
1
|
+
import { defineComponent, defineAsyncComponent, inject, useSlots, ref, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, h, normalizeClass } from "vue";
|
|
2
2
|
const _hoisted_1 = ["value", "disabled", "readonly", "placeholder"];
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "select",
|
|
@@ -29,6 +29,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
const isThis = optionList.value.filter((v) => v.value === props.modelValue);
|
|
30
30
|
if (isThis.length > 0) {
|
|
31
31
|
return isThis[0].label;
|
|
32
|
+
} else if (props.modelValue) {
|
|
33
|
+
return;
|
|
32
34
|
} else {
|
|
33
35
|
emit("update:modelValue", null);
|
|
34
36
|
ParentGetChangeHandle && ParentGetChangeHandle(null);
|
|
@@ -45,7 +47,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
45
47
|
return h(
|
|
46
48
|
"div",
|
|
47
49
|
{
|
|
48
|
-
class:
|
|
50
|
+
class: normalizeClass(["label", [props.modelValue === it.props.value ? "labelselect" : ""]]),
|
|
49
51
|
key: it.props.key,
|
|
50
52
|
onClick: () => {
|
|
51
53
|
emit("update:modelValue", it.props.value);
|
|
@@ -63,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
63
65
|
{
|
|
64
66
|
class: "selectOption"
|
|
65
67
|
},
|
|
66
|
-
slots.default().map((i,
|
|
68
|
+
slots.default().map((i, _j) => {
|
|
67
69
|
if (typeof i.children == "string")
|
|
68
70
|
return null;
|
|
69
71
|
if (Array.isArray(i.children)) {
|
|
@@ -78,6 +80,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78
80
|
};
|
|
79
81
|
return (_ctx, _cache) => {
|
|
80
82
|
return openBlock(), createBlock(unref(Pop), {
|
|
83
|
+
vIF: false,
|
|
81
84
|
trigger: "native",
|
|
82
85
|
modelValue: showOption.value,
|
|
83
86
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showOption.value = $event),
|
package/dist/js/table/table.js
CHANGED
|
@@ -41,7 +41,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
const renderHead = () => {
|
|
42
42
|
return h(
|
|
43
43
|
"thead",
|
|
44
|
-
{
|
|
44
|
+
{
|
|
45
|
+
class: normalizeClass(["tdd-text-word6", [props.headclass]])
|
|
46
|
+
},
|
|
45
47
|
slots.default().map((it) => {
|
|
46
48
|
if (typeof it.children == "string")
|
|
47
49
|
return null;
|
|
@@ -155,7 +157,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
155
157
|
return h(
|
|
156
158
|
"td",
|
|
157
159
|
{
|
|
158
|
-
class:
|
|
160
|
+
class: normalizeClass(["tdd-text-center tdd-py-2", [props.cellclass]])
|
|
159
161
|
},
|
|
160
162
|
((_a = it.props) == null ? void 0 : _a.type) && it.props.type === "selection" ? h(
|
|
161
163
|
"label",
|