ninemoon-ui 0.1.14 → 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 +274 -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/upload/upload.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, openBlock, createElementBlock, Fragment, createElementVNode, renderSlot, renderList, toDisplayString, createVNode, createCommentVNode } from "vue";
|
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, renderSlot, normalizeClass, createStaticVNode, renderList, toDisplayString, createVNode, createCommentVNode } from "vue";
|
|
2
2
|
import { C as CloseIcon } from "../index/index.js";
|
|
3
3
|
const _hoisted_1 = ["accept", "multiple"];
|
|
4
4
|
const _hoisted_2 = {
|
|
@@ -14,7 +14,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
accept: { default: "" },
|
|
15
15
|
fileList: {},
|
|
16
16
|
showFileList: { type: Boolean, default: true },
|
|
17
|
-
multiple: { type: Boolean, default: false }
|
|
17
|
+
multiple: { type: Boolean, default: false },
|
|
18
|
+
draggable: { type: Boolean, default: false }
|
|
18
19
|
},
|
|
19
20
|
emits: ["getNewFile", "delOldFile"],
|
|
20
21
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -22,6 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
23
|
const emit = __emit;
|
|
23
24
|
const FILEINPUT = ref();
|
|
24
25
|
const fileList = ref(props.fileList || []);
|
|
26
|
+
const isDragOver = ref(false);
|
|
25
27
|
const fileGet = () => {
|
|
26
28
|
FILEINPUT.value.click();
|
|
27
29
|
};
|
|
@@ -44,30 +46,73 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
46
|
DeleteFileHandle(i);
|
|
45
47
|
});
|
|
46
48
|
};
|
|
49
|
+
const handleDragOver = (event) => {
|
|
50
|
+
isDragOver.value = true;
|
|
51
|
+
};
|
|
52
|
+
const handleDragEnter = (event) => {
|
|
53
|
+
isDragOver.value = true;
|
|
54
|
+
};
|
|
55
|
+
const handleDragLeave = (event) => {
|
|
56
|
+
isDragOver.value = false;
|
|
57
|
+
};
|
|
58
|
+
const handleDrop = (event) => {
|
|
59
|
+
isDragOver.value = false;
|
|
60
|
+
if (event.dataTransfer && event.dataTransfer.files.length > 0) {
|
|
61
|
+
const files = event.dataTransfer.files;
|
|
62
|
+
if (props.multiple) {
|
|
63
|
+
for (const file of files) {
|
|
64
|
+
fileList.value.push(file);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
fileList.value = [files[0]];
|
|
68
|
+
}
|
|
69
|
+
emit("getNewFile", files, fileList.value);
|
|
70
|
+
event.dataTransfer.clearData();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
47
73
|
__expose({
|
|
48
74
|
clearFiles
|
|
49
75
|
});
|
|
50
76
|
return (_ctx, _cache) => {
|
|
51
77
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
52
|
-
createElementVNode("
|
|
78
|
+
createElementVNode("div", null, [
|
|
53
79
|
createElementVNode("input", {
|
|
54
80
|
ref_key: "FILEINPUT",
|
|
55
81
|
ref: FILEINPUT,
|
|
56
82
|
onChange: _cache[0] || (_cache[0] = ($event) => FileHandle()),
|
|
57
|
-
accept:
|
|
58
|
-
multiple:
|
|
83
|
+
accept: __props.accept,
|
|
84
|
+
multiple: __props.multiple,
|
|
59
85
|
type: "file",
|
|
60
86
|
class: "hidden"
|
|
61
87
|
}, null, 40, _hoisted_1),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
88
|
+
__props.draggable ? (openBlock(), createElementBlock("div", {
|
|
89
|
+
key: 0,
|
|
90
|
+
onDragover: withModifiers(handleDragOver, ["prevent"]),
|
|
91
|
+
onDragenter: withModifiers(handleDragEnter, ["prevent"]),
|
|
92
|
+
onDragleave: withModifiers(handleDragLeave, ["prevent"]),
|
|
93
|
+
onDrop: withModifiers(handleDrop, ["prevent"]),
|
|
94
|
+
onClick: fileGet
|
|
66
95
|
}, [
|
|
67
|
-
renderSlot(_ctx.$slots, "default")
|
|
68
|
-
|
|
96
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
97
|
+
createElementVNode("div", {
|
|
98
|
+
class: normalizeClass(["border-2 border-dashed border-gray-300 rounded-lg p-8 text-center transition-all duration-300 bg-gray-50 cursor-pointer hover:border-gray-500", { "border-blue-500 bg-blue-50": isDragOver.value }])
|
|
99
|
+
}, [..._cache[1] || (_cache[1] = [
|
|
100
|
+
createStaticVNode('<div class="flex flex-col items-center justify-center"><svg class="w-12 h-12 text-gray-400 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path></svg><p class="text-lg font-medium text-gray-700 mb-2">拖拽文件到此处或点击选择文件</p><p class="text-sm text-gray-500">支持多种文件格式</p></div>', 1)
|
|
101
|
+
])], 2)
|
|
102
|
+
])
|
|
103
|
+
], 32)) : (openBlock(), createElementBlock("div", {
|
|
104
|
+
key: 1,
|
|
105
|
+
onClick: fileGet
|
|
106
|
+
}, [
|
|
107
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
108
|
+
_cache[2] || (_cache[2] = createElementVNode("button", {
|
|
109
|
+
type: "button",
|
|
110
|
+
class: "appearance-none border border-gray-300 rounded-md px-4 py-2 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200 cursor-pointer"
|
|
111
|
+
}, " 点击上传 ", -1))
|
|
112
|
+
])
|
|
113
|
+
]))
|
|
69
114
|
]),
|
|
70
|
-
|
|
115
|
+
__props.showFileList ? (openBlock(), createElementBlock("ul", _hoisted_2, [
|
|
71
116
|
(openBlock(true), createElementBlock(Fragment, null, renderList(fileList.value, (i, d) => {
|
|
72
117
|
return openBlock(), createElementBlock("li", {
|
|
73
118
|
key: d,
|
package/dist/utils/tool.d.ts
CHANGED
|
@@ -50,5 +50,10 @@ export declare const useResizeObserver: (callback: () => void) => {
|
|
|
50
50
|
observe: (el: HTMLElement) => void;
|
|
51
51
|
unobserve: (el: HTMLElement) => void;
|
|
52
52
|
};
|
|
53
|
+
export declare const zIndexManager: {
|
|
54
|
+
getNextZIndex(): number;
|
|
55
|
+
getCurrentZIndex(): number;
|
|
56
|
+
setZIndex(zIndex: number): void;
|
|
57
|
+
};
|
|
53
58
|
declare const _default: {};
|
|
54
59
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ninemoon-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"author": "zhuboy",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vue3",
|
|
@@ -33,5 +33,8 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"type": "module",
|
|
36
|
-
"types": "dist/index.d.ts"
|
|
36
|
+
"types": "dist/index.d.ts",
|
|
37
|
+
"volta": {
|
|
38
|
+
"node": "18.12.1"
|
|
39
|
+
}
|
|
37
40
|
}
|