ninemoon-ui 0.1.2 → 0.1.4
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/loadding/loadding.d.ts +1 -1
- package/dist/components/popover/poparrow.d.ts +2 -10
- package/dist/components/popover/popover.vue.d.ts +1 -6
- package/dist/components/scrollBar/scrollBar.vue.d.ts +2 -0
- package/dist/directives/index.d.ts +10 -0
- package/dist/{components/scrollloading → directives}/scrolllead.d.ts +1 -1
- package/dist/directives/watchwindow.d.ts +1 -0
- package/dist/index.css +24 -966
- package/dist/index.d.ts +24 -23
- package/dist/index.es.js +39 -32
- package/dist/index.umd.js +453 -1393
- package/dist/js/date/datepicker.js +4 -4
- package/dist/js/date/datepickerRange.js +4 -4
- package/dist/js/image/image.js +1 -101
- package/dist/js/index/index.js +334 -41
- package/dist/js/input/input.js +3 -3
- package/dist/js/numberInput/numberinput.js +3 -3
- package/dist/js/popover/popover.js +11 -108
- package/dist/js/scrollBar/scrollBar.js +8 -5
- package/dist/js/select/select.js +7 -63
- package/dist/js/tabs/tabs.js +3 -1
- package/dist/tabs.css +3 -49
- package/package.json +1 -2
|
@@ -1,101 +1,5 @@
|
|
|
1
|
-
import { defineComponent, h, normalizeClass, normalizeStyle, ref, computed, nextTick, openBlock, createElementBlock, withModifiers, renderSlot, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, unref, vShow } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
const DEFAULT_DEBOUNCE_WAIT$1 = 100;
|
|
4
|
-
const createBgClickDirective = (options) => {
|
|
5
|
-
const config = {
|
|
6
|
-
debounceWait: DEFAULT_DEBOUNCE_WAIT$1,
|
|
7
|
-
moveModel: false,
|
|
8
|
-
onCheckOut: () => {
|
|
9
|
-
},
|
|
10
|
-
...options
|
|
11
|
-
};
|
|
12
|
-
const bindEvents = (el, binding) => {
|
|
13
|
-
if (el._checkout_handlers_)
|
|
14
|
-
return;
|
|
15
|
-
const clickDom = debounce((e) => {
|
|
16
|
-
e.preventDefault();
|
|
17
|
-
config.onCheckOut(e, el);
|
|
18
|
-
}, config.debounceWait);
|
|
19
|
-
el._checkout_handlers_ = {
|
|
20
|
-
click: clickDom
|
|
21
|
-
};
|
|
22
|
-
if (config.moveModel) {
|
|
23
|
-
document.addEventListener("mousemove", clickDom);
|
|
24
|
-
} else {
|
|
25
|
-
document.addEventListener("click", clickDom);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const unbindEvents = (el) => {
|
|
29
|
-
if (el._checkout_handlers_) {
|
|
30
|
-
if (config.moveModel) {
|
|
31
|
-
document.removeEventListener("mousemove", el._checkout_handlers_.click);
|
|
32
|
-
} else {
|
|
33
|
-
document.removeEventListener("click", el._checkout_handlers_.click);
|
|
34
|
-
}
|
|
35
|
-
delete el._checkout_handlers_;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
return {
|
|
39
|
-
mounted(el, binding) {
|
|
40
|
-
bindEvents(el);
|
|
41
|
-
},
|
|
42
|
-
beforeUnmount(el) {
|
|
43
|
-
unbindEvents(el);
|
|
44
|
-
},
|
|
45
|
-
// 添加 updated 钩子处理配置变化
|
|
46
|
-
updated(el, binding) {
|
|
47
|
-
if (binding.value !== binding.oldValue) {
|
|
48
|
-
unbindEvents(el);
|
|
49
|
-
bindEvents(el);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
const DEFAULT_DEBOUNCE_WAIT = 100;
|
|
55
|
-
const createScrollDirective = (options) => {
|
|
56
|
-
const config = {
|
|
57
|
-
debounceWait: DEFAULT_DEBOUNCE_WAIT,
|
|
58
|
-
onMove: () => {
|
|
59
|
-
},
|
|
60
|
-
...options
|
|
61
|
-
};
|
|
62
|
-
const bindEvents = (el, binding) => {
|
|
63
|
-
if (el._watchwindow_handlers_) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const moveDom = debounce((e) => {
|
|
67
|
-
e.preventDefault();
|
|
68
|
-
config.onMove();
|
|
69
|
-
}, config.debounceWait);
|
|
70
|
-
el._watchwindow_handlers_ = {
|
|
71
|
-
move: moveDom
|
|
72
|
-
};
|
|
73
|
-
window.addEventListener("resize", el._watchwindow_handlers_.move);
|
|
74
|
-
window.addEventListener("scroll", el._watchwindow_handlers_.move);
|
|
75
|
-
};
|
|
76
|
-
const unbindEvents = (el) => {
|
|
77
|
-
if (el._watchwindow_handlers_) {
|
|
78
|
-
window.removeEventListener("resize", el._watchwindow_handlers_.move);
|
|
79
|
-
window.removeEventListener("scroll", el._watchwindow_handlers_.move);
|
|
80
|
-
delete el._watchwindow_handlers_;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
return {
|
|
84
|
-
mounted(el, binding) {
|
|
85
|
-
bindEvents(el);
|
|
86
|
-
},
|
|
87
|
-
beforeUnmount(el) {
|
|
88
|
-
unbindEvents(el);
|
|
89
|
-
},
|
|
90
|
-
// 添加 updated 钩子处理配置变化
|
|
91
|
-
updated(el, binding) {
|
|
92
|
-
if (binding.value !== binding.oldValue) {
|
|
93
|
-
unbindEvents(el);
|
|
94
|
-
bindEvents(el);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
};
|
|
1
|
+
import { defineComponent, h, normalizeClass, normalizeStyle, ref, computed, nextTick, getCurrentInstance, openBlock, createElementBlock, withModifiers, renderSlot, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, unref, createCommentVNode, vShow } from "vue";
|
|
2
|
+
import { u as usePotion, h as createScrollDirective, i as createBgClickDirective, c as createEscapeDirective } from "../index/index.js";
|
|
99
3
|
const PLACEMENT_GROUPS = {
|
|
100
4
|
top: ["topleft", "topmiddle", "topright"],
|
|
101
5
|
bottom: ["bottomleft", "bottommiddle", "bottomright"],
|
|
@@ -122,7 +26,6 @@ const arrowComponent = defineComponent({
|
|
|
122
26
|
arrowLeft: { type: Number, required: true },
|
|
123
27
|
arrowTop: { type: Number, required: true },
|
|
124
28
|
placement: { type: String, required: true },
|
|
125
|
-
arrowshow: { type: Boolean, required: true },
|
|
126
29
|
exChange: { type: Boolean, required: true },
|
|
127
30
|
beforebgcolor: { type: String }
|
|
128
31
|
},
|
|
@@ -156,8 +59,6 @@ const arrowComponent = defineComponent({
|
|
|
156
59
|
}
|
|
157
60
|
return classes;
|
|
158
61
|
};
|
|
159
|
-
if (!props.arrowshow)
|
|
160
|
-
return;
|
|
161
62
|
return () => h("span", {
|
|
162
63
|
class: normalizeClass(getArrowClasses()),
|
|
163
64
|
style: normalizeStyle(getArrowStyles())
|
|
@@ -175,8 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
175
76
|
beforeHidden: {},
|
|
176
77
|
modelValue: { type: Boolean },
|
|
177
78
|
beforebgcolor: {},
|
|
178
|
-
arrowshow: { type: Boolean, default: true }
|
|
179
|
-
isselectMode: { type: Boolean, default: false }
|
|
79
|
+
arrowshow: { type: Boolean, default: true }
|
|
180
80
|
},
|
|
181
81
|
emits: ["update:modelValue"],
|
|
182
82
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -236,12 +136,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
236
136
|
arrowLeft.value = position.arrowLeft;
|
|
237
137
|
exChange.value = position.exChange;
|
|
238
138
|
};
|
|
139
|
+
const { proxy } = getCurrentInstance();
|
|
239
140
|
const vScroll = createScrollDirective({
|
|
240
141
|
onMove: () => {
|
|
241
142
|
if (shouldShow.value == false)
|
|
242
143
|
return;
|
|
243
144
|
setPosition();
|
|
244
|
-
}
|
|
145
|
+
},
|
|
146
|
+
// @ts-ignore
|
|
147
|
+
scrollContainerId: proxy.gloablScrollBar ? proxy.gloablScrollBar : void 0
|
|
245
148
|
});
|
|
246
149
|
const vClickoutside = createBgClickDirective({
|
|
247
150
|
onCheckOut: (event, el) => {
|
|
@@ -318,14 +221,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
318
221
|
style: normalizeStyle({ width: widthNum.value, top: `${Top.value}px`, left: `${Left.value}px` })
|
|
319
222
|
}, [
|
|
320
223
|
renderSlot(_ctx.$slots, "default"),
|
|
321
|
-
|
|
224
|
+
_ctx.arrowshow ? (openBlock(), createBlock(unref(arrowComponent), {
|
|
225
|
+
key: 0,
|
|
322
226
|
arrowLeft: arrowLeft.value,
|
|
323
227
|
arrowTop: arrowTop.value,
|
|
324
228
|
exChange: exChange.value,
|
|
325
229
|
beforebgcolor: _ctx.beforebgcolor,
|
|
326
|
-
placement: _ctx.placement
|
|
327
|
-
|
|
328
|
-
}, null, 8, ["arrowLeft", "arrowTop", "exChange", "beforebgcolor", "placement", "arrowshow"])
|
|
230
|
+
placement: _ctx.placement
|
|
231
|
+
}, null, 8, ["arrowLeft", "arrowTop", "exChange", "beforebgcolor", "placement"])) : createCommentVNode("", true)
|
|
329
232
|
], 6)), [
|
|
330
233
|
[vShow, shouldShow.value],
|
|
331
234
|
[unref(vClickoutside)],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, onMounted, onUnmounted, renderSlot, createBlock, createCommentVNode } from "vue";
|
|
2
|
-
import { o as on,
|
|
2
|
+
import { o as on, j as off, k as useResizeObserver } from "../index/index.js";
|
|
3
3
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "movebar",
|
|
5
5
|
props: {
|
|
@@ -130,12 +130,14 @@ const _hoisted_1 = {
|
|
|
130
130
|
key: 0,
|
|
131
131
|
class: "group/scroll relative h-full overflow-hidden"
|
|
132
132
|
};
|
|
133
|
+
const _hoisted_2 = ["id"];
|
|
133
134
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
134
135
|
__name: "scrollBar",
|
|
135
136
|
props: {
|
|
136
137
|
native: { type: Boolean, default: false },
|
|
137
138
|
height: {},
|
|
138
|
-
maxHeight: {}
|
|
139
|
+
maxHeight: {},
|
|
140
|
+
id: {}
|
|
139
141
|
},
|
|
140
142
|
setup(__props, { expose: __expose }) {
|
|
141
143
|
const props = __props;
|
|
@@ -216,10 +218,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
216
218
|
ref_key: "wrap",
|
|
217
219
|
ref: wrap,
|
|
218
220
|
onScrollPassive: handleScroll,
|
|
219
|
-
class: "overscroll-contain overflow-auto h-full scrollbar-none
|
|
221
|
+
class: "overscroll-contain overflow-auto h-full scrollbar-none",
|
|
220
222
|
style: normalizeStyle(warpStyle.value),
|
|
221
223
|
onTouchstart: _cache[0] || (_cache[0] = ($event) => isTouching.value = true),
|
|
222
|
-
onTouchend: _cache[1] || (_cache[1] = ($event) => isTouching.value = false)
|
|
224
|
+
onTouchend: _cache[1] || (_cache[1] = ($event) => isTouching.value = false),
|
|
225
|
+
id: _ctx.id
|
|
223
226
|
}, [
|
|
224
227
|
createElementVNode("div", {
|
|
225
228
|
ref_key: "contentBox",
|
|
@@ -227,7 +230,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
227
230
|
}, [
|
|
228
231
|
renderSlot(_ctx.$slots, "default")
|
|
229
232
|
], 512)
|
|
230
|
-
],
|
|
233
|
+
], 44, _hoisted_2),
|
|
231
234
|
hasHor.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
232
235
|
key: 0,
|
|
233
236
|
move: moveX.value,
|
package/dist/js/select/select.js
CHANGED
|
@@ -1,64 +1,6 @@
|
|
|
1
1
|
import { defineComponent, defineAsyncComponent, computed, inject, ref, watch, provide, toRef, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createVNode, withDirectives, createElementBlock, renderSlot } from "vue";
|
|
2
2
|
import { A as ArrowIcon } from "../arrow/arrow.js";
|
|
3
|
-
import "../index/index.js";
|
|
4
|
-
const directionMap = {
|
|
5
|
-
ArrowUp: "up",
|
|
6
|
-
Up: "up",
|
|
7
|
-
// IE/Edge 兼容
|
|
8
|
-
ArrowDown: "down",
|
|
9
|
-
Down: "down",
|
|
10
|
-
// IE/Edge 兼容
|
|
11
|
-
ArrowLeft: "left",
|
|
12
|
-
Left: "left",
|
|
13
|
-
// IE/Edge 兼容
|
|
14
|
-
ArrowRight: "right",
|
|
15
|
-
Right: "right"
|
|
16
|
-
// IE/Edge 兼容
|
|
17
|
-
};
|
|
18
|
-
const createArrowKeysDirective = (options) => {
|
|
19
|
-
const config = {
|
|
20
|
-
// 默认配置
|
|
21
|
-
up: () => {
|
|
22
|
-
},
|
|
23
|
-
down: () => {
|
|
24
|
-
},
|
|
25
|
-
left: () => {
|
|
26
|
-
},
|
|
27
|
-
right: () => {
|
|
28
|
-
},
|
|
29
|
-
...options
|
|
30
|
-
};
|
|
31
|
-
const bindEvents = (el, binding) => {
|
|
32
|
-
const handler = (e) => {
|
|
33
|
-
var _a;
|
|
34
|
-
const direction = directionMap[e.key];
|
|
35
|
-
if (direction && config[direction]) {
|
|
36
|
-
e.preventDefault();
|
|
37
|
-
(_a = config[direction]) == null ? void 0 : _a.call(config, e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
el._arrowKeysHandler = handler;
|
|
41
|
-
document.addEventListener("keydown", handler);
|
|
42
|
-
};
|
|
43
|
-
const unbindEvents = (el) => {
|
|
44
|
-
if (el._arrowKeysHandler) {
|
|
45
|
-
document.removeEventListener("keydown", el._arrowKeysHandler);
|
|
46
|
-
}
|
|
47
|
-
delete el._arrowKeysHandler;
|
|
48
|
-
};
|
|
49
|
-
return {
|
|
50
|
-
mounted(el, binding) {
|
|
51
|
-
bindEvents(el);
|
|
52
|
-
},
|
|
53
|
-
updated(el, binding) {
|
|
54
|
-
unbindEvents(el);
|
|
55
|
-
bindEvents(el);
|
|
56
|
-
},
|
|
57
|
-
unmounted(el) {
|
|
58
|
-
unbindEvents(el);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
};
|
|
3
|
+
import { a as createArrowKeysDirective } from "../index/index.js";
|
|
62
4
|
const _hoisted_1 = ["value", "disabled", "readonly", "placeholder"];
|
|
63
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
64
6
|
__name: "select",
|
|
@@ -72,12 +14,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
72
14
|
emits: ["update:modelValue", "change"],
|
|
73
15
|
setup(__props, { emit: __emit }) {
|
|
74
16
|
const Pop = defineAsyncComponent(() => import("../popover/popover.js"));
|
|
75
|
-
const LibScrollBar = defineAsyncComponent(
|
|
17
|
+
const LibScrollBar = defineAsyncComponent(
|
|
18
|
+
() => import("../scrollBar/scrollBar.js")
|
|
19
|
+
);
|
|
76
20
|
const props = __props;
|
|
77
21
|
const heightClass = computed(() => ({
|
|
78
|
-
"h-
|
|
79
|
-
"h-
|
|
80
|
-
"h-
|
|
22
|
+
"h-10": props.size === "large",
|
|
23
|
+
"h-9": props.size === "default",
|
|
24
|
+
"h-8": props.size === "small"
|
|
81
25
|
}));
|
|
82
26
|
const ParentGetChangeHandle = inject("changHandle", (_params) => null);
|
|
83
27
|
const inputbox = ref();
|
package/dist/js/tabs/tabs.js
CHANGED
|
@@ -14,7 +14,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:active"],
|
|
16
16
|
setup(__props, { emit: __emit }) {
|
|
17
|
-
const LibScrollBar = defineAsyncComponent(
|
|
17
|
+
const LibScrollBar = defineAsyncComponent(
|
|
18
|
+
() => import("../scrollBar/scrollBar.js")
|
|
19
|
+
);
|
|
18
20
|
const props = __props;
|
|
19
21
|
const showBaseline = computed(() => props.type === "line");
|
|
20
22
|
const emit = __emit;
|
package/dist/tabs.css
CHANGED
|
@@ -1,54 +1,9 @@
|
|
|
1
|
-
.\!container {
|
|
2
|
-
width: 100% !important
|
|
3
|
-
}
|
|
4
|
-
.container {
|
|
5
|
-
width: 100%
|
|
6
|
-
}
|
|
7
|
-
@media (min-width: 640px) {
|
|
8
|
-
.\!container {
|
|
9
|
-
max-width: 640px !important
|
|
10
|
-
}
|
|
11
|
-
.container {
|
|
12
|
-
max-width: 640px
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
@media (min-width: 768px) {
|
|
16
|
-
.\!container {
|
|
17
|
-
max-width: 768px !important
|
|
18
|
-
}
|
|
19
|
-
.container {
|
|
20
|
-
max-width: 768px
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
@media (min-width: 1024px) {
|
|
24
|
-
.\!container {
|
|
25
|
-
max-width: 1024px !important
|
|
26
|
-
}
|
|
27
|
-
.container {
|
|
28
|
-
max-width: 1024px
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
@media (min-width: 1280px) {
|
|
32
|
-
.\!container {
|
|
33
|
-
max-width: 1280px !important
|
|
34
|
-
}
|
|
35
|
-
.container {
|
|
36
|
-
max-width: 1280px
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
@media (min-width: 1536px) {
|
|
40
|
-
.\!container {
|
|
41
|
-
max-width: 1536px !important
|
|
42
|
-
}
|
|
43
|
-
.container {
|
|
44
|
-
max-width: 1536px
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
@layer {
|
|
48
1
|
.ETab {
|
|
49
2
|
display: flex;
|
|
50
3
|
width: 100%;
|
|
51
|
-
|
|
4
|
+
min-width: -moz-max-content;
|
|
5
|
+
min-width: max-content;
|
|
6
|
+
flex-wrap: nowrap;
|
|
52
7
|
--tw-text-opacity: 1;
|
|
53
8
|
color: rgb(102 102 102 / var(--tw-text-opacity, 1))
|
|
54
9
|
}
|
|
@@ -120,5 +75,4 @@
|
|
|
120
75
|
.ETab_Card .ETab_Line_Btn_Btw {
|
|
121
76
|
--tw-bg-opacity: 1;
|
|
122
77
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1))
|
|
123
|
-
}
|
|
124
78
|
}
|
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.1.4",
|
|
5
5
|
"author": "zhuboy",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vue3",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"vue": "^3.3.4"
|
|
17
17
|
},
|
|
18
18
|
"main": "dist/index.es.js",
|
|
19
|
-
"module": "dist/index.umd.js",
|
|
20
19
|
"devDependencies": {
|
|
21
20
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
22
21
|
"autoprefixer": "^10.4.14",
|