ninemoon-ui 0.1.20 → 0.2.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/carousel/carousel.vue.d.ts +2 -0
- package/dist/components/date/datepicker.vue.d.ts +1 -1
- package/dist/components/date/datepickerRange.vue.d.ts +16 -0
- package/dist/components/form/formlabel.vue.d.ts +1 -3
- package/dist/components/pagination/pagination.vue.d.ts +8 -15
- package/dist/components/popover/popover.vue.d.ts +5 -0
- package/dist/components/switch/switch.vue.d.ts +10 -0
- package/dist/components/upload/upload.vue.d.ts +5 -0
- package/dist/index.d.ts +139 -61
- package/dist/index.es.js +21 -21
- package/dist/js/arrow/arrow.js +2 -2
- package/dist/js/badge/badge.js +1 -1
- package/dist/js/calendar/calendar.js +4 -4
- package/dist/js/carousel/carousel.js +59 -38
- package/dist/js/check/checkbox.js +4 -4
- package/dist/js/date/datepicker.js +20 -8
- package/dist/js/date/datepickerRange.js +104 -69
- package/dist/js/dateArrowplus/dateArrowplus.js +2 -2
- package/dist/js/delete/delete.js +2 -2
- package/dist/js/dialog/dialog.js +41 -29
- package/dist/js/form/formlabel.js +21 -89
- package/dist/js/image/image.js +17 -18
- package/dist/js/index/index.js +273 -253
- package/dist/js/input/input.js +8 -8
- package/dist/js/menu/menu.js +1 -1
- package/dist/js/numberInput/numberinput.js +8 -8
- package/dist/js/pagination/pagination.js +17 -14
- package/dist/js/popover/popover.js +3 -239
- package/dist/js/popover.vue_vue_type_script_setup_true_lang/popover.vue_vue_type_script_setup_true_lang.js +249 -0
- package/dist/js/radio/radiobox.js +4 -4
- package/dist/js/scrollBar/scrollBar.js +4 -4
- package/dist/js/select/select.js +5 -5
- package/dist/js/select/selectoption.js +3 -3
- package/dist/js/switch/switch.js +33 -7
- package/dist/js/table/table.js +107 -77
- package/dist/js/table/tableItem.js +2 -2
- package/dist/js/tabs/tabs.js +202 -21
- package/dist/js/upload/upload.js +57 -12
- package/dist/utils/tool.d.ts +5 -0
- package/package.json +5 -2
package/dist/js/index/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import { openBlock, createElementBlock, createElementVNode, defineComponent, ref, onUnmounted, createBlock, Teleport, unref, createVNode, TransitionGroup, withCtx, Fragment, renderList, normalizeClass, resolveDynamicComponent, createTextVNode, toDisplayString, createCommentVNode, createApp, isVNode, watch, computed, Transition, withDirectives, withModifiers, reactive, defineAsyncComponent } from "vue";
|
|
7
|
+
import { openBlock, createElementBlock, createElementVNode, defineComponent, ref, onUnmounted, createBlock, Teleport, unref, createVNode, TransitionGroup, withCtx, Fragment, renderList, normalizeClass, resolveDynamicComponent, createTextVNode, toDisplayString, createCommentVNode, createApp, isVNode, watch, computed, Transition, withDirectives, normalizeStyle, withModifiers, reactive, defineAsyncComponent } from "vue";
|
|
8
8
|
const _export_sfc = (sfc, props) => {
|
|
9
9
|
const target = sfc.__vccOpts || sfc;
|
|
10
10
|
for (const [key, val] of props) {
|
|
@@ -21,7 +21,7 @@ const _hoisted_1$8 = {
|
|
|
21
21
|
fill: "inherit"
|
|
22
22
|
};
|
|
23
23
|
function _sfc_render$5(_ctx, _cache) {
|
|
24
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$8, _cache[0] || (_cache[0] = [
|
|
24
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$8, [..._cache[0] || (_cache[0] = [
|
|
25
25
|
createElementVNode("g", null, [
|
|
26
26
|
createElementVNode("path", {
|
|
27
27
|
"fill-rule": "evenodd",
|
|
@@ -30,7 +30,7 @@ function _sfc_render$5(_ctx, _cache) {
|
|
|
30
30
|
fill: "inherit"
|
|
31
31
|
})
|
|
32
32
|
], -1)
|
|
33
|
-
]));
|
|
33
|
+
])]);
|
|
34
34
|
}
|
|
35
35
|
const CloseIcon = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$5]]);
|
|
36
36
|
const _sfc_main$7 = {};
|
|
@@ -40,9 +40,9 @@ const _hoisted_1$7 = {
|
|
|
40
40
|
xmlns: "http://www.w3.org/2000/svg"
|
|
41
41
|
};
|
|
42
42
|
function _sfc_render$4(_ctx, _cache) {
|
|
43
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$7, _cache[0] || (_cache[0] = [
|
|
43
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$7, [..._cache[0] || (_cache[0] = [
|
|
44
44
|
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)
|
|
45
|
-
]));
|
|
45
|
+
])]);
|
|
46
46
|
}
|
|
47
47
|
const successTip = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$4]]);
|
|
48
48
|
const _sfc_main$6 = {};
|
|
@@ -52,9 +52,9 @@ const _hoisted_1$6 = {
|
|
|
52
52
|
xmlns: "http://www.w3.org/2000/svg"
|
|
53
53
|
};
|
|
54
54
|
function _sfc_render$3(_ctx, _cache) {
|
|
55
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [
|
|
55
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$6, [..._cache[0] || (_cache[0] = [
|
|
56
56
|
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)
|
|
57
|
-
]));
|
|
57
|
+
])]);
|
|
58
58
|
}
|
|
59
59
|
const errTip = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$3]]);
|
|
60
60
|
const _sfc_main$5 = {};
|
|
@@ -64,10 +64,10 @@ const _hoisted_1$5 = {
|
|
|
64
64
|
xmlns: "http://www.w3.org/2000/svg"
|
|
65
65
|
};
|
|
66
66
|
function _sfc_render$2(_ctx, _cache) {
|
|
67
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$5, _cache[0] || (_cache[0] = [
|
|
67
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$5, [..._cache[0] || (_cache[0] = [
|
|
68
68
|
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),
|
|
69
69
|
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)
|
|
70
|
-
]));
|
|
70
|
+
])]);
|
|
71
71
|
}
|
|
72
72
|
const warnTip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$2]]);
|
|
73
73
|
const _sfc_main$4 = {};
|
|
@@ -77,9 +77,9 @@ const _hoisted_1$4 = {
|
|
|
77
77
|
xmlns: "http://www.w3.org/2000/svg"
|
|
78
78
|
};
|
|
79
79
|
function _sfc_render$1(_ctx, _cache) {
|
|
80
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$4, _cache[0] || (_cache[0] = [
|
|
80
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, [..._cache[0] || (_cache[0] = [
|
|
81
81
|
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)
|
|
82
|
-
]));
|
|
82
|
+
])]);
|
|
83
83
|
}
|
|
84
84
|
const infoTip = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1]]);
|
|
85
85
|
let cachedContainer;
|
|
@@ -93,7 +93,7 @@ const usePopperContainer = () => {
|
|
|
93
93
|
}
|
|
94
94
|
return { container: cachedContainer };
|
|
95
95
|
};
|
|
96
|
-
const _hoisted_1$3 = { class: "pointer-events-none fixed right-0 left-0 bottom-0 top-4 z-
|
|
96
|
+
const _hoisted_1$3 = { class: "pointer-events-none fixed right-0 left-0 bottom-0 top-4 z-[3000] space-y-5" };
|
|
97
97
|
const _hoisted_2$1 = { class: "pointer-events-auto inline-flex items-center space-x-3 bg-white p-3 text-sm text-word3 drop-shadow" };
|
|
98
98
|
const _hoisted_3$1 = { class: "flex-1" };
|
|
99
99
|
const _hoisted_4$1 = ["onClick"];
|
|
@@ -346,11 +346,233 @@ const _hoisted_1$2 = {
|
|
|
346
346
|
xmlns: "http://www.w3.org/2000/svg"
|
|
347
347
|
};
|
|
348
348
|
function _sfc_render(_ctx, _cache) {
|
|
349
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [
|
|
349
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$2, [..._cache[0] || (_cache[0] = [
|
|
350
350
|
createElementVNode("path", { d: "M512 74.666667c241.066667 0 437.333333 196.266667 437.333333 437.333333S753.066667 949.333333 512 949.333333 74.666667 753.066667 74.666667 512 270.933333 74.666667 512 74.666667z m0 341.333333c-17.066667 0-32 14.933333-32 32v300.8c2.133333 17.066667 14.933333 29.866667 32 29.866667s32-14.933333 32-32V445.866667c-2.133333-17.066667-14.933333-29.866667-32-29.866667z m0-160c-23.466667 0-42.666667 19.2-42.666667 42.666667s19.2 42.666667 42.666667 42.666666 42.666667-19.2 42.666667-42.666666-19.2-42.666667-42.666667-42.666667z" }, null, -1)
|
|
351
|
-
]));
|
|
351
|
+
])]);
|
|
352
352
|
}
|
|
353
353
|
const tipIcon = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render]]);
|
|
354
|
+
function debounce(func, wait) {
|
|
355
|
+
let timeout;
|
|
356
|
+
return function() {
|
|
357
|
+
const context = this;
|
|
358
|
+
const args = arguments;
|
|
359
|
+
clearTimeout(timeout);
|
|
360
|
+
timeout = setTimeout(function() {
|
|
361
|
+
func.apply(context, args);
|
|
362
|
+
}, wait);
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
function throttle(func, wait) {
|
|
366
|
+
let timeout;
|
|
367
|
+
return function() {
|
|
368
|
+
const context = this;
|
|
369
|
+
const args = arguments;
|
|
370
|
+
if (!timeout) {
|
|
371
|
+
timeout = setTimeout(function() {
|
|
372
|
+
timeout = null;
|
|
373
|
+
func.apply(context, args);
|
|
374
|
+
}, wait);
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
const usePotion = (baseDom, aimDom, set) => {
|
|
379
|
+
let left = 0;
|
|
380
|
+
let top = 0;
|
|
381
|
+
let arrowleft = 0;
|
|
382
|
+
let arrowtop = 0;
|
|
383
|
+
let exchange = false;
|
|
384
|
+
if (!baseDom || !aimDom) {
|
|
385
|
+
return {
|
|
386
|
+
Top: top,
|
|
387
|
+
Left: left,
|
|
388
|
+
arrowLeft: arrowleft,
|
|
389
|
+
arrowTop: arrowtop,
|
|
390
|
+
exChange: exchange
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
const { left: baseLeft, right, bottom, top: baseTop, width: baseWidth, height: baseHeight } = baseDom.getBoundingClientRect();
|
|
394
|
+
const { height: aimHeight, width: aimWidth, top: aimTop } = aimDom.getBoundingClientRect();
|
|
395
|
+
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
396
|
+
const scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
397
|
+
switch (set == null ? void 0 : set.position) {
|
|
398
|
+
case "bottomleft":
|
|
399
|
+
case "bottommiddle":
|
|
400
|
+
case "bottomright":
|
|
401
|
+
top = scrollTop + bottom;
|
|
402
|
+
break;
|
|
403
|
+
case "topleft":
|
|
404
|
+
case "topmiddle":
|
|
405
|
+
case "topright":
|
|
406
|
+
top = scrollTop + baseTop - aimHeight;
|
|
407
|
+
break;
|
|
408
|
+
case "centerleft":
|
|
409
|
+
case "centerright":
|
|
410
|
+
top = scrollTop + baseTop + (baseHeight - aimHeight) / 2;
|
|
411
|
+
arrowtop = aimHeight / 2 - 5;
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
switch (set == null ? void 0 : set.position) {
|
|
415
|
+
case "topleft":
|
|
416
|
+
case "bottomleft":
|
|
417
|
+
left = scrollLeft + baseLeft;
|
|
418
|
+
arrowleft = (right - baseLeft) / 2;
|
|
419
|
+
break;
|
|
420
|
+
case "topmiddle":
|
|
421
|
+
case "bottommiddle":
|
|
422
|
+
left = scrollLeft + baseLeft + (right - baseLeft - aimWidth) / 2;
|
|
423
|
+
arrowleft = aimWidth / 2 - 5;
|
|
424
|
+
break;
|
|
425
|
+
case "topright":
|
|
426
|
+
case "bottomright":
|
|
427
|
+
left = scrollLeft + right - aimWidth;
|
|
428
|
+
arrowleft = aimWidth - baseWidth + baseWidth / 2 - 5;
|
|
429
|
+
break;
|
|
430
|
+
case "centerleft":
|
|
431
|
+
left = scrollLeft + baseLeft - aimWidth;
|
|
432
|
+
arrowleft = aimWidth - 5;
|
|
433
|
+
break;
|
|
434
|
+
case "centerright":
|
|
435
|
+
left = scrollLeft + right;
|
|
436
|
+
arrowleft = -5;
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
if (aimHeight + 20 < window.innerHeight) {
|
|
440
|
+
if (top + aimHeight + 10 > scrollTop + window.innerHeight) {
|
|
441
|
+
switch (set == null ? void 0 : set.position) {
|
|
442
|
+
case "bottommiddle":
|
|
443
|
+
case "bottomleft":
|
|
444
|
+
case "bottomright":
|
|
445
|
+
exchange = true;
|
|
446
|
+
top = scrollTop + baseTop - aimHeight - 24;
|
|
447
|
+
break;
|
|
448
|
+
case "centerleft":
|
|
449
|
+
case "centerright":
|
|
450
|
+
top = scrollTop + window.innerHeight - aimHeight - 10;
|
|
451
|
+
arrowtop = baseTop - aimTop + baseHeight / 2 - 10;
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
if (top - scrollTop < 0) {
|
|
456
|
+
switch (set == null ? void 0 : set.position) {
|
|
457
|
+
case "topmiddle":
|
|
458
|
+
case "topleft":
|
|
459
|
+
case "topright":
|
|
460
|
+
exchange = true;
|
|
461
|
+
top = scrollTop + bottom + 24;
|
|
462
|
+
break;
|
|
463
|
+
case "centerleft":
|
|
464
|
+
case "centerright":
|
|
465
|
+
top = 10 + scrollTop;
|
|
466
|
+
arrowtop = baseTop + baseHeight / 2 - 10;
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return {
|
|
472
|
+
Top: top,
|
|
473
|
+
Left: left,
|
|
474
|
+
arrowLeft: arrowleft,
|
|
475
|
+
arrowTop: arrowtop,
|
|
476
|
+
exChange: exchange
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
function getNewArray(array, subGroupLength) {
|
|
480
|
+
let index2 = 0;
|
|
481
|
+
const newArray = [];
|
|
482
|
+
while (index2 < array.length) {
|
|
483
|
+
newArray.push(array.slice(index2, index2 += subGroupLength));
|
|
484
|
+
}
|
|
485
|
+
return newArray;
|
|
486
|
+
}
|
|
487
|
+
const formatDate = (date) => {
|
|
488
|
+
if (!date)
|
|
489
|
+
return "";
|
|
490
|
+
const d = date instanceof Date ? date : new Date(date);
|
|
491
|
+
if (isNaN(d.getTime()))
|
|
492
|
+
return "";
|
|
493
|
+
return [
|
|
494
|
+
d.getFullYear(),
|
|
495
|
+
pad(d.getMonth() + 1),
|
|
496
|
+
pad(d.getDate())
|
|
497
|
+
].join("-");
|
|
498
|
+
};
|
|
499
|
+
const pad = (n) => n.toString().padStart(2, "0");
|
|
500
|
+
const checkinputDate = (input, success, fail) => {
|
|
501
|
+
try {
|
|
502
|
+
input = input.trim();
|
|
503
|
+
if (!input) {
|
|
504
|
+
success(null);
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
const dateRegex = /^(\d{4})[-/\.](\d{1,2})[-/\.]?(\d{1,2})?$/;
|
|
508
|
+
if (!dateRegex.test(input)) {
|
|
509
|
+
throw new Error("日期格式错误");
|
|
510
|
+
}
|
|
511
|
+
const [, yearStr, monthStr, dayStr] = input.match(dateRegex);
|
|
512
|
+
const year = parseInt(yearStr, 10);
|
|
513
|
+
const month = parseInt(monthStr, 10);
|
|
514
|
+
const day = dayStr ? parseInt(dayStr, 10) : 1;
|
|
515
|
+
if (year < 1970 || year > 2100)
|
|
516
|
+
throw new Error("年份超出范围");
|
|
517
|
+
if (month < 1 || month > 12)
|
|
518
|
+
throw new Error("无效月份");
|
|
519
|
+
const lastDayOfMonth = new Date(year, month, 0).getDate();
|
|
520
|
+
const safeDay = Math.min(day, lastDayOfMonth);
|
|
521
|
+
if (safeDay !== day) {
|
|
522
|
+
fail();
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
const newDate = new Date(year, month - 1, safeDay);
|
|
526
|
+
if (newDate.getFullYear() !== year || newDate.getMonth() + 1 !== month || newDate.getDate() !== safeDay) {
|
|
527
|
+
fail();
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
const formatted = formatDate(newDate);
|
|
531
|
+
success(formatted);
|
|
532
|
+
} catch (error) {
|
|
533
|
+
fail();
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
const on = function() {
|
|
537
|
+
return function(element, event, handler) {
|
|
538
|
+
if (element && event && handler) {
|
|
539
|
+
element.addEventListener(event, handler, false);
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
}();
|
|
543
|
+
const off = function() {
|
|
544
|
+
return function(element, event, handler) {
|
|
545
|
+
if (element && event) {
|
|
546
|
+
element.removeEventListener(event, handler, false);
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
}();
|
|
550
|
+
const useResizeObserver = (callback) => {
|
|
551
|
+
let observer = null;
|
|
552
|
+
const observe = (el) => {
|
|
553
|
+
observer = new ResizeObserver(callback);
|
|
554
|
+
observer.observe(el);
|
|
555
|
+
};
|
|
556
|
+
const unobserve = (el) => {
|
|
557
|
+
observer == null ? void 0 : observer.unobserve(el);
|
|
558
|
+
observer == null ? void 0 : observer.disconnect();
|
|
559
|
+
};
|
|
560
|
+
return { observe, unobserve };
|
|
561
|
+
};
|
|
562
|
+
let globalZIndex = 1e3;
|
|
563
|
+
const zIndexManager = {
|
|
564
|
+
getNextZIndex() {
|
|
565
|
+
return ++globalZIndex;
|
|
566
|
+
},
|
|
567
|
+
getCurrentZIndex() {
|
|
568
|
+
return globalZIndex;
|
|
569
|
+
},
|
|
570
|
+
setZIndex(zIndex) {
|
|
571
|
+
if (zIndex > globalZIndex) {
|
|
572
|
+
globalZIndex = zIndex;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
};
|
|
354
576
|
const _hoisted_1$1 = { class: "z-20 w-96 rounded bg-white px-4 pt-8 pb-9 drop-shadow mt-[20vh] mx-auto" };
|
|
355
577
|
const _hoisted_2 = { class: "flex justify-center" };
|
|
356
578
|
const _hoisted_3 = { class: "h-6 w-6 text-yellow-400" };
|
|
@@ -372,6 +594,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
372
594
|
},
|
|
373
595
|
setup(__props, { expose: __expose }) {
|
|
374
596
|
const props = __props;
|
|
597
|
+
const currentZIndex = ref(zIndexManager.getNextZIndex());
|
|
375
598
|
const vEsc = createEscapeDirective({
|
|
376
599
|
onEscape: () => {
|
|
377
600
|
props.onClose();
|
|
@@ -381,6 +604,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
381
604
|
const stopwatch = watch(
|
|
382
605
|
() => props.showAlert,
|
|
383
606
|
(newVal) => {
|
|
607
|
+
if (newVal) {
|
|
608
|
+
currentZIndex.value = zIndexManager.getNextZIndex();
|
|
609
|
+
}
|
|
384
610
|
visible.value = newVal;
|
|
385
611
|
stopwatch();
|
|
386
612
|
}
|
|
@@ -396,29 +622,30 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
396
622
|
default: withCtx(() => [
|
|
397
623
|
visible.value ? withDirectives((openBlock(), createElementBlock("div", {
|
|
398
624
|
key: 0,
|
|
399
|
-
class: normalizeClass(["fixed top-0 right-0 left-0 bottom-0
|
|
400
|
-
|
|
625
|
+
class: normalizeClass(["fixed top-0 right-0 left-0 bottom-0", { "bg-black bg-opacity-30": bgshow.value }]),
|
|
626
|
+
style: normalizeStyle({ "z-index": currentZIndex.value }),
|
|
627
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => __props.onClose(), ["self"]))
|
|
401
628
|
}, [
|
|
402
629
|
createElementVNode("div", _hoisted_1$1, [
|
|
403
630
|
createElementVNode("div", _hoisted_2, [
|
|
404
631
|
createElementVNode("div", _hoisted_3, [
|
|
405
632
|
createVNode(tipIcon, { class: "w-full h-full" })
|
|
406
633
|
]),
|
|
407
|
-
createElementVNode("div", _hoisted_4, toDisplayString(
|
|
634
|
+
createElementVNode("div", _hoisted_4, toDisplayString(__props.title), 1)
|
|
408
635
|
]),
|
|
409
|
-
createElementVNode("div", _hoisted_5, toDisplayString(
|
|
636
|
+
createElementVNode("div", _hoisted_5, toDisplayString(__props.content), 1),
|
|
410
637
|
createElementVNode("div", _hoisted_6, [
|
|
411
638
|
createElementVNode("div", {
|
|
412
639
|
class: "h-8 px-4 rounded border text-word6 inline-block leading-8 cursor-pointer",
|
|
413
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
|
414
|
-
}, toDisplayString(
|
|
640
|
+
onClick: _cache[0] || (_cache[0] = ($event) => __props.onClose())
|
|
641
|
+
}, toDisplayString(__props.cancelword), 1),
|
|
415
642
|
createElementVNode("div", {
|
|
416
643
|
class: "h-8 px-4 rounded bg-blue-light text-white inline-block leading-8 cursor-pointer",
|
|
417
|
-
onClick: _cache[1] || (_cache[1] = ($event) =>
|
|
418
|
-
}, toDisplayString(
|
|
644
|
+
onClick: _cache[1] || (_cache[1] = ($event) => __props.onConfirm())
|
|
645
|
+
}, toDisplayString(__props.sureword), 1)
|
|
419
646
|
])
|
|
420
647
|
])
|
|
421
|
-
],
|
|
648
|
+
], 6)), [
|
|
422
649
|
[unref(vEsc), visible.value]
|
|
423
650
|
]) : createCommentVNode("", true)
|
|
424
651
|
]),
|
|
@@ -485,7 +712,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
485
712
|
setup(__props) {
|
|
486
713
|
return (_ctx, _cache) => {
|
|
487
714
|
return openBlock(), createElementBlock("div", {
|
|
488
|
-
class: normalizeClass(["top-0 right-0 left-0 bottom-0 z-50 flex h-full w-full flex-col items-center justify-center bg-white bg-opacity-90",
|
|
715
|
+
class: normalizeClass(["top-0 right-0 left-0 bottom-0 z-50 flex h-full w-full flex-col items-center justify-center bg-white bg-opacity-90", __props.fullScreen ? "fixed" : "absolute"])
|
|
489
716
|
}, [
|
|
490
717
|
_cache[0] || (_cache[0] = createElementVNode("div", { class: "relative flex justify-center w-10 h-10" }, [
|
|
491
718
|
createElementVNode("svg", {
|
|
@@ -503,7 +730,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
503
730
|
})
|
|
504
731
|
])
|
|
505
732
|
], -1)),
|
|
506
|
-
createElementVNode("div", _hoisted_1, toDisplayString(
|
|
733
|
+
createElementVNode("div", _hoisted_1, toDisplayString(__props.loadingText), 1)
|
|
507
734
|
], 2);
|
|
508
735
|
};
|
|
509
736
|
}
|
|
@@ -657,214 +884,6 @@ const createArrowKeysDirective = (options) => {
|
|
|
657
884
|
}
|
|
658
885
|
};
|
|
659
886
|
};
|
|
660
|
-
function debounce(func, wait) {
|
|
661
|
-
let timeout;
|
|
662
|
-
return function() {
|
|
663
|
-
const context = this;
|
|
664
|
-
const args = arguments;
|
|
665
|
-
clearTimeout(timeout);
|
|
666
|
-
timeout = setTimeout(function() {
|
|
667
|
-
func.apply(context, args);
|
|
668
|
-
}, wait);
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
function throttle(func, wait) {
|
|
672
|
-
let timeout;
|
|
673
|
-
return function() {
|
|
674
|
-
const context = this;
|
|
675
|
-
const args = arguments;
|
|
676
|
-
if (!timeout) {
|
|
677
|
-
timeout = setTimeout(function() {
|
|
678
|
-
timeout = null;
|
|
679
|
-
func.apply(context, args);
|
|
680
|
-
}, wait);
|
|
681
|
-
}
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
const usePotion = (baseDom, aimDom, set) => {
|
|
685
|
-
let left = 0;
|
|
686
|
-
let top = 0;
|
|
687
|
-
let arrowleft = 0;
|
|
688
|
-
let arrowtop = 0;
|
|
689
|
-
let exchange = false;
|
|
690
|
-
if (!baseDom || !aimDom) {
|
|
691
|
-
return {
|
|
692
|
-
Top: top,
|
|
693
|
-
Left: left,
|
|
694
|
-
arrowLeft: arrowleft,
|
|
695
|
-
arrowTop: arrowtop,
|
|
696
|
-
exChange: exchange
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
const { left: baseLeft, right, bottom, top: baseTop, width: baseWidth, height: baseHeight } = baseDom.getBoundingClientRect();
|
|
700
|
-
const { height: aimHeight, width: aimWidth, top: aimTop } = aimDom.getBoundingClientRect();
|
|
701
|
-
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
702
|
-
const scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
703
|
-
switch (set == null ? void 0 : set.position) {
|
|
704
|
-
case "bottomleft":
|
|
705
|
-
case "bottommiddle":
|
|
706
|
-
case "bottomright":
|
|
707
|
-
top = scrollTop + bottom;
|
|
708
|
-
break;
|
|
709
|
-
case "topleft":
|
|
710
|
-
case "topmiddle":
|
|
711
|
-
case "topright":
|
|
712
|
-
top = scrollTop + baseTop - aimHeight;
|
|
713
|
-
break;
|
|
714
|
-
case "centerleft":
|
|
715
|
-
case "centerright":
|
|
716
|
-
top = scrollTop + baseTop + (baseHeight - aimHeight) / 2;
|
|
717
|
-
arrowtop = aimHeight / 2 - 5;
|
|
718
|
-
break;
|
|
719
|
-
}
|
|
720
|
-
switch (set == null ? void 0 : set.position) {
|
|
721
|
-
case "topleft":
|
|
722
|
-
case "bottomleft":
|
|
723
|
-
left = scrollLeft + baseLeft;
|
|
724
|
-
arrowleft = (right - baseLeft) / 2;
|
|
725
|
-
break;
|
|
726
|
-
case "topmiddle":
|
|
727
|
-
case "bottommiddle":
|
|
728
|
-
left = scrollLeft + baseLeft + (right - baseLeft - aimWidth) / 2;
|
|
729
|
-
arrowleft = aimWidth / 2 - 5;
|
|
730
|
-
break;
|
|
731
|
-
case "topright":
|
|
732
|
-
case "bottomright":
|
|
733
|
-
left = scrollLeft + right - aimWidth;
|
|
734
|
-
arrowleft = aimWidth - baseWidth + baseWidth / 2 - 5;
|
|
735
|
-
break;
|
|
736
|
-
case "centerleft":
|
|
737
|
-
left = scrollLeft + baseLeft - aimWidth;
|
|
738
|
-
arrowleft = aimWidth - 5;
|
|
739
|
-
break;
|
|
740
|
-
case "centerright":
|
|
741
|
-
left = scrollLeft + right;
|
|
742
|
-
arrowleft = -5;
|
|
743
|
-
break;
|
|
744
|
-
}
|
|
745
|
-
if (aimHeight + 20 < window.innerHeight) {
|
|
746
|
-
if (top + aimHeight + 10 > scrollTop + window.innerHeight) {
|
|
747
|
-
switch (set == null ? void 0 : set.position) {
|
|
748
|
-
case "bottommiddle":
|
|
749
|
-
case "bottomleft":
|
|
750
|
-
case "bottomright":
|
|
751
|
-
exchange = true;
|
|
752
|
-
top = scrollTop + baseTop - aimHeight - 24;
|
|
753
|
-
break;
|
|
754
|
-
case "centerleft":
|
|
755
|
-
case "centerright":
|
|
756
|
-
top = scrollTop + window.innerHeight - aimHeight - 10;
|
|
757
|
-
arrowtop = baseTop - aimTop + baseHeight / 2 - 10;
|
|
758
|
-
break;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
if (top - scrollTop < 0) {
|
|
762
|
-
switch (set == null ? void 0 : set.position) {
|
|
763
|
-
case "topmiddle":
|
|
764
|
-
case "topleft":
|
|
765
|
-
case "topright":
|
|
766
|
-
exchange = true;
|
|
767
|
-
top = scrollTop + bottom + 24;
|
|
768
|
-
break;
|
|
769
|
-
case "centerleft":
|
|
770
|
-
case "centerright":
|
|
771
|
-
top = 10 + scrollTop;
|
|
772
|
-
arrowtop = baseTop + baseHeight / 2 - 10;
|
|
773
|
-
break;
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
return {
|
|
778
|
-
Top: top,
|
|
779
|
-
Left: left,
|
|
780
|
-
arrowLeft: arrowleft,
|
|
781
|
-
arrowTop: arrowtop,
|
|
782
|
-
exChange: exchange
|
|
783
|
-
};
|
|
784
|
-
};
|
|
785
|
-
function getNewArray(array, subGroupLength) {
|
|
786
|
-
let index2 = 0;
|
|
787
|
-
const newArray = [];
|
|
788
|
-
while (index2 < array.length) {
|
|
789
|
-
newArray.push(array.slice(index2, index2 += subGroupLength));
|
|
790
|
-
}
|
|
791
|
-
return newArray;
|
|
792
|
-
}
|
|
793
|
-
const formatDate = (date) => {
|
|
794
|
-
if (!date)
|
|
795
|
-
return "";
|
|
796
|
-
const d = date instanceof Date ? date : new Date(date);
|
|
797
|
-
if (isNaN(d.getTime()))
|
|
798
|
-
return "";
|
|
799
|
-
return [
|
|
800
|
-
d.getFullYear(),
|
|
801
|
-
pad(d.getMonth() + 1),
|
|
802
|
-
pad(d.getDate())
|
|
803
|
-
].join("-");
|
|
804
|
-
};
|
|
805
|
-
const pad = (n) => n.toString().padStart(2, "0");
|
|
806
|
-
const checkinputDate = (input, success, fail) => {
|
|
807
|
-
try {
|
|
808
|
-
input = input.trim();
|
|
809
|
-
if (!input) {
|
|
810
|
-
success(null);
|
|
811
|
-
return;
|
|
812
|
-
}
|
|
813
|
-
const dateRegex = /^(\d{4})[-/\.](\d{1,2})[-/\.]?(\d{1,2})?$/;
|
|
814
|
-
if (!dateRegex.test(input)) {
|
|
815
|
-
throw new Error("日期格式错误");
|
|
816
|
-
}
|
|
817
|
-
const [, yearStr, monthStr, dayStr] = input.match(dateRegex);
|
|
818
|
-
const year = parseInt(yearStr, 10);
|
|
819
|
-
const month = parseInt(monthStr, 10);
|
|
820
|
-
const day = dayStr ? parseInt(dayStr, 10) : 1;
|
|
821
|
-
if (year < 1970 || year > 2100)
|
|
822
|
-
throw new Error("年份超出范围");
|
|
823
|
-
if (month < 1 || month > 12)
|
|
824
|
-
throw new Error("无效月份");
|
|
825
|
-
const lastDayOfMonth = new Date(year, month, 0).getDate();
|
|
826
|
-
const safeDay = Math.min(day, lastDayOfMonth);
|
|
827
|
-
if (safeDay !== day) {
|
|
828
|
-
fail();
|
|
829
|
-
return;
|
|
830
|
-
}
|
|
831
|
-
const newDate = new Date(year, month - 1, safeDay);
|
|
832
|
-
if (newDate.getFullYear() !== year || newDate.getMonth() + 1 !== month || newDate.getDate() !== safeDay) {
|
|
833
|
-
fail();
|
|
834
|
-
return;
|
|
835
|
-
}
|
|
836
|
-
const formatted = formatDate(newDate);
|
|
837
|
-
success(formatted);
|
|
838
|
-
} catch (error) {
|
|
839
|
-
fail();
|
|
840
|
-
}
|
|
841
|
-
};
|
|
842
|
-
const on = function() {
|
|
843
|
-
return function(element, event, handler) {
|
|
844
|
-
if (element && event && handler) {
|
|
845
|
-
element.addEventListener(event, handler, false);
|
|
846
|
-
}
|
|
847
|
-
};
|
|
848
|
-
}();
|
|
849
|
-
const off = function() {
|
|
850
|
-
return function(element, event, handler) {
|
|
851
|
-
if (element && event) {
|
|
852
|
-
element.removeEventListener(event, handler, false);
|
|
853
|
-
}
|
|
854
|
-
};
|
|
855
|
-
}();
|
|
856
|
-
const useResizeObserver = (callback) => {
|
|
857
|
-
let observer = null;
|
|
858
|
-
const observe = (el) => {
|
|
859
|
-
observer = new ResizeObserver(callback);
|
|
860
|
-
observer.observe(el);
|
|
861
|
-
};
|
|
862
|
-
const unobserve = (el) => {
|
|
863
|
-
observer == null ? void 0 : observer.unobserve(el);
|
|
864
|
-
observer == null ? void 0 : observer.disconnect();
|
|
865
|
-
};
|
|
866
|
-
return { observe, unobserve };
|
|
867
|
-
};
|
|
868
887
|
const DEFAULT_THROTTLE_WAIT = 60;
|
|
869
888
|
const createDraggableDirective = (options) => {
|
|
870
889
|
const config = {
|
|
@@ -1218,27 +1237,28 @@ const index = {
|
|
|
1218
1237
|
}
|
|
1219
1238
|
};
|
|
1220
1239
|
export {
|
|
1221
|
-
|
|
1222
|
-
|
|
1240
|
+
LibMenu as A,
|
|
1241
|
+
LibPagination as B,
|
|
1223
1242
|
CloseIcon as C,
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1243
|
+
LibBadge as D,
|
|
1244
|
+
LibPopover as E,
|
|
1245
|
+
LibNumberInput as F,
|
|
1246
|
+
LibRadioBox as G,
|
|
1247
|
+
LibRadioGroup as H,
|
|
1248
|
+
LibCheckGroup as I,
|
|
1249
|
+
LibCheckBox as J,
|
|
1250
|
+
LibUpload as K,
|
|
1232
1251
|
LibDialog as L,
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1252
|
+
LibTabs as M,
|
|
1253
|
+
LibTabsPane as N,
|
|
1254
|
+
LibScrollBar as O,
|
|
1255
|
+
MessageClass as P,
|
|
1256
|
+
AlertFunction as Q,
|
|
1257
|
+
LibLoad as R,
|
|
1258
|
+
LibCarousel as S,
|
|
1259
|
+
LibCarouselItem as T,
|
|
1260
|
+
LibSwitch as U,
|
|
1261
|
+
createLoadingDirective as V,
|
|
1242
1262
|
_export_sfc as _,
|
|
1243
1263
|
createArrowKeysDirective as a,
|
|
1244
1264
|
createDraggableDirective as b,
|
|
@@ -1265,5 +1285,5 @@ export {
|
|
|
1265
1285
|
LibImage as w,
|
|
1266
1286
|
LibDatePicker as x,
|
|
1267
1287
|
LibDatePickerRange as y,
|
|
1268
|
-
|
|
1288
|
+
zIndexManager as z
|
|
1269
1289
|
};
|
package/dist/js/input/input.js
CHANGED
|
@@ -84,11 +84,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
84
|
renderSlot(_ctx.$slots, "prepend"),
|
|
85
85
|
!isTextarea.value ? withDirectives((openBlock(), createElementBlock("input", {
|
|
86
86
|
key: 0,
|
|
87
|
-
class: normalizeClass(["w-full px-2 outline-none appearance-none", heightClass.value]),
|
|
88
|
-
placeholder:
|
|
87
|
+
class: normalizeClass(["flex-1 w-full px-2 outline-none appearance-none", heightClass.value]),
|
|
88
|
+
placeholder: __props.placeHolder,
|
|
89
89
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
90
|
-
type:
|
|
91
|
-
autocomplete:
|
|
90
|
+
type: __props.type,
|
|
91
|
+
autocomplete: __props.autocomplete,
|
|
92
92
|
onBlur: handleBlur,
|
|
93
93
|
onInput: handleInput,
|
|
94
94
|
onChange: handleChange
|
|
@@ -96,12 +96,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
96
96
|
[vModelDynamic, inputValue.value]
|
|
97
97
|
]) : withDirectives((openBlock(), createElementBlock("textarea", {
|
|
98
98
|
key: 1,
|
|
99
|
-
class: normalizeClass(["w-full h-full px-2 outline-none appearance-none", heightClass.value]),
|
|
100
|
-
placeholder:
|
|
99
|
+
class: normalizeClass(["flex-1 w-full h-full px-2 outline-none appearance-none", heightClass.value]),
|
|
100
|
+
placeholder: __props.placeHolder,
|
|
101
101
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
|
|
102
102
|
autosize: "",
|
|
103
|
-
rows:
|
|
104
|
-
autocomplete:
|
|
103
|
+
rows: __props.rows,
|
|
104
|
+
autocomplete: __props.autocomplete,
|
|
105
105
|
onBlur: handleBlur,
|
|
106
106
|
onInput: handleInput,
|
|
107
107
|
onChange: handleChange
|