ninemoon-ui 0.1.8 → 0.1.9
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/date/datepicker.vue.d.ts +3 -3
- package/dist/components/date/datepickerRange.vue.d.ts +2 -2
- package/dist/components/form/form.vue.d.ts +5 -0
- package/dist/components/form/formlabel.vue.d.ts +10 -0
- package/dist/components/input/input.vue.d.ts +10 -3
- package/dist/components/numberInput/numberinput.vue.d.ts +3 -3
- package/dist/components/select/select.vue.d.ts +3 -3
- package/dist/components/table/table.vue.d.ts +8 -1
- package/dist/components/table/tableItem.vue.d.ts +2 -0
- package/dist/directives/index.d.ts +1 -2
- package/dist/directives/looplead.d.ts +19 -0
- package/dist/directives/scrolllead.d.ts +3 -11
- package/dist/directives/watchwindow.d.ts +1 -1
- package/dist/hooks/teleportcontainer.d.ts +5 -0
- package/dist/index.d.ts +128 -30
- package/dist/index.es.js +26 -27
- package/dist/js/badge/badge.js +3 -3
- package/dist/js/carousel/carousel.js +1 -1
- package/dist/js/check/checkbox.js +4 -4
- package/dist/js/date/datepicker.js +4 -3
- package/dist/js/date/datepickerRange.js +22 -17
- package/dist/js/dialog/dialog.js +36 -37
- package/dist/js/form/form.js +3 -1
- package/dist/js/form/formlabel.js +39 -8
- package/dist/js/image/image.js +2 -2
- package/dist/js/index/index.js +130 -113
- package/dist/js/input/input.js +26 -6
- package/dist/js/numberInput/numberinput.js +2 -1
- package/dist/js/pagination/pagination.js +2 -1
- package/dist/js/popover/popover.js +10 -16
- package/dist/js/radio/radiobox.js +4 -4
- package/dist/js/select/select.js +4 -3
- package/dist/js/table/table.js +243 -188
- package/dist/js/table/tableItem.js +2 -1
- package/package.json +2 -1
- package/dist/directives/whitespaceclick.d.ts +0 -12
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, createVNode, TransitionGroup, withCtx, Fragment, renderList, normalizeClass, resolveDynamicComponent, createTextVNode, toDisplayString, createCommentVNode, createApp, isVNode, watch, computed, Transition, withDirectives, withModifiers,
|
|
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";
|
|
8
8
|
const _export_sfc = (sfc, props) => {
|
|
9
9
|
const target = sfc.__vccOpts || sfc;
|
|
10
10
|
for (const [key, val] of props) {
|
|
@@ -82,6 +82,17 @@ function _sfc_render$1(_ctx, _cache) {
|
|
|
82
82
|
]));
|
|
83
83
|
}
|
|
84
84
|
const infoTip = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1]]);
|
|
85
|
+
let cachedContainer;
|
|
86
|
+
const selector = `popper-container`;
|
|
87
|
+
const usePopperContainer = () => {
|
|
88
|
+
if (!cachedContainer && !document.querySelector(`#${selector}`)) {
|
|
89
|
+
const container = document.createElement("div");
|
|
90
|
+
container.id = selector;
|
|
91
|
+
cachedContainer = container;
|
|
92
|
+
document.body.appendChild(container);
|
|
93
|
+
}
|
|
94
|
+
return { container: cachedContainer };
|
|
95
|
+
};
|
|
85
96
|
const _hoisted_1$3 = { class: "pointer-events-none fixed right-0 left-0 bottom-0 top-4 z-2000 space-y-5" };
|
|
86
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" };
|
|
87
98
|
const _hoisted_3$1 = { class: "flex-1" };
|
|
@@ -146,7 +157,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
146
157
|
dealConfig
|
|
147
158
|
});
|
|
148
159
|
return (_ctx, _cache) => {
|
|
149
|
-
return openBlock(), createBlock(Teleport, {
|
|
160
|
+
return openBlock(), createBlock(Teleport, {
|
|
161
|
+
to: `#${unref(selector)}`
|
|
162
|
+
}, [
|
|
150
163
|
createElementVNode("div", _hoisted_1$3, [
|
|
151
164
|
createVNode(TransitionGroup, { name: "message" }, {
|
|
152
165
|
default: withCtx(() => [
|
|
@@ -190,7 +203,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
190
203
|
_: 1
|
|
191
204
|
})
|
|
192
205
|
])
|
|
193
|
-
]);
|
|
206
|
+
], 8, ["to"]);
|
|
194
207
|
};
|
|
195
208
|
}
|
|
196
209
|
});
|
|
@@ -277,6 +290,11 @@ const createEscapeDirective = (options) => {
|
|
|
277
290
|
...options
|
|
278
291
|
};
|
|
279
292
|
const bindEvents = (el, binding) => {
|
|
293
|
+
if (el.__Escape_Handler__) {
|
|
294
|
+
const index2 = handlerStack.indexOf(el.__Escape_Handler__);
|
|
295
|
+
if (index2 !== -1)
|
|
296
|
+
handlerStack.splice(index2, 1);
|
|
297
|
+
}
|
|
280
298
|
const thisHandler = (e) => {
|
|
281
299
|
e.preventDefault();
|
|
282
300
|
config.onEscape(e);
|
|
@@ -302,20 +320,17 @@ const createEscapeDirective = (options) => {
|
|
|
302
320
|
};
|
|
303
321
|
return {
|
|
304
322
|
mounted(el, binding) {
|
|
305
|
-
|
|
323
|
+
if (binding.value)
|
|
324
|
+
bindEvents(el);
|
|
306
325
|
},
|
|
307
326
|
updated(el, binding) {
|
|
308
|
-
if (
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
327
|
+
if (binding.value !== binding.oldValue) {
|
|
328
|
+
if (binding.value) {
|
|
329
|
+
bindEvents(el);
|
|
330
|
+
} else {
|
|
331
|
+
unbindEvents(el);
|
|
332
|
+
}
|
|
312
333
|
}
|
|
313
|
-
const newHandler = (e) => {
|
|
314
|
-
e.preventDefault();
|
|
315
|
-
config.onEscape(e);
|
|
316
|
-
};
|
|
317
|
-
handlerStack.push(newHandler);
|
|
318
|
-
el.__Escape_Handler__ = newHandler;
|
|
319
334
|
},
|
|
320
335
|
beforeUnmount(el) {
|
|
321
336
|
unbindEvents(el);
|
|
@@ -403,7 +418,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
403
418
|
])
|
|
404
419
|
])
|
|
405
420
|
], 2)), [
|
|
406
|
-
[unref(vEsc)]
|
|
421
|
+
[unref(vEsc), visible.value]
|
|
407
422
|
]) : createCommentVNode("", true)
|
|
408
423
|
]),
|
|
409
424
|
_: 1
|
|
@@ -624,11 +639,17 @@ const createArrowKeysDirective = (options) => {
|
|
|
624
639
|
};
|
|
625
640
|
return {
|
|
626
641
|
mounted(el, binding) {
|
|
627
|
-
|
|
642
|
+
if (binding.value)
|
|
643
|
+
bindEvents(el);
|
|
628
644
|
},
|
|
629
645
|
updated(el, binding) {
|
|
630
|
-
|
|
631
|
-
|
|
646
|
+
if (binding.value !== binding.oldValue) {
|
|
647
|
+
if (binding.value) {
|
|
648
|
+
bindEvents(el);
|
|
649
|
+
} else {
|
|
650
|
+
unbindEvents(el);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
632
653
|
},
|
|
633
654
|
unmounted(el) {
|
|
634
655
|
unbindEvents(el);
|
|
@@ -905,14 +926,24 @@ const createDraggableDirective = (options) => {
|
|
|
905
926
|
};
|
|
906
927
|
return {
|
|
907
928
|
mounted(el, binding) {
|
|
908
|
-
|
|
929
|
+
if (binding.value)
|
|
930
|
+
bindEvents(el);
|
|
931
|
+
},
|
|
932
|
+
updated(el, binding) {
|
|
933
|
+
if (binding.value !== binding.oldValue) {
|
|
934
|
+
if (binding.value) {
|
|
935
|
+
bindEvents(el);
|
|
936
|
+
} else {
|
|
937
|
+
unbindEvents(el);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
909
940
|
},
|
|
910
941
|
beforeUnmount(el) {
|
|
911
942
|
unbindEvents(el);
|
|
912
943
|
}
|
|
913
944
|
};
|
|
914
945
|
};
|
|
915
|
-
const DEFAULT_DEBOUNCE_WAIT$2 =
|
|
946
|
+
const DEFAULT_DEBOUNCE_WAIT$2 = 50;
|
|
916
947
|
const createBgClickDirective = (options) => {
|
|
917
948
|
const config = {
|
|
918
949
|
debounceWait: DEFAULT_DEBOUNCE_WAIT$2,
|
|
@@ -932,24 +963,25 @@ const createBgClickDirective = (options) => {
|
|
|
932
963
|
click: clickDom
|
|
933
964
|
};
|
|
934
965
|
if (config.moveModel) {
|
|
935
|
-
|
|
966
|
+
window.addEventListener("mousemove", clickDom, true);
|
|
936
967
|
} else {
|
|
937
|
-
|
|
968
|
+
window.addEventListener("click", clickDom, true);
|
|
938
969
|
}
|
|
939
970
|
};
|
|
940
971
|
const unbindEvents = (el) => {
|
|
941
972
|
if (el._checkout_handlers_) {
|
|
942
973
|
if (config.moveModel) {
|
|
943
|
-
|
|
974
|
+
window.removeEventListener("mousemove", el._checkout_handlers_.click, true);
|
|
944
975
|
} else {
|
|
945
|
-
|
|
976
|
+
window.removeEventListener("click", el._checkout_handlers_.click, true);
|
|
946
977
|
}
|
|
947
978
|
delete el._checkout_handlers_;
|
|
948
979
|
}
|
|
949
980
|
};
|
|
950
981
|
return {
|
|
951
982
|
mounted(el, binding) {
|
|
952
|
-
|
|
983
|
+
if (binding.value)
|
|
984
|
+
bindEvents(el);
|
|
953
985
|
},
|
|
954
986
|
beforeUnmount(el) {
|
|
955
987
|
unbindEvents(el);
|
|
@@ -957,73 +989,73 @@ const createBgClickDirective = (options) => {
|
|
|
957
989
|
// 添加 updated 钩子处理配置变化
|
|
958
990
|
updated(el, binding) {
|
|
959
991
|
if (binding.value !== binding.oldValue) {
|
|
960
|
-
|
|
961
|
-
|
|
992
|
+
if (binding.value) {
|
|
993
|
+
bindEvents(el);
|
|
994
|
+
} else {
|
|
995
|
+
unbindEvents(el);
|
|
996
|
+
}
|
|
962
997
|
}
|
|
963
998
|
}
|
|
964
999
|
};
|
|
965
1000
|
};
|
|
966
1001
|
const DEFAULT_DEBOUNCE_WAIT$1 = 100;
|
|
967
|
-
const DEFAULT_HOLD =
|
|
1002
|
+
const DEFAULT_HOLD = 300;
|
|
968
1003
|
const createLoadingDirective = (options) => {
|
|
969
1004
|
const config = {
|
|
970
|
-
|
|
1005
|
+
debounceTime: DEFAULT_DEBOUNCE_WAIT$1,
|
|
971
1006
|
threshold: DEFAULT_HOLD,
|
|
972
1007
|
edge: "bottom",
|
|
973
1008
|
onWheel: () => {
|
|
974
1009
|
},
|
|
975
1010
|
...options
|
|
976
1011
|
};
|
|
977
|
-
const
|
|
978
|
-
const
|
|
1012
|
+
const checkEdges = (el, edge) => {
|
|
1013
|
+
const rect = el.getBoundingClientRect();
|
|
1014
|
+
const windowHeight = window.innerHeight;
|
|
1015
|
+
console.log(rect.bottom, rect.top, windowHeight);
|
|
979
1016
|
const threshold = config.threshold;
|
|
980
|
-
const epsilon = 0.1;
|
|
981
|
-
if (scrollHeight <= clientHeight) {
|
|
982
|
-
return edge === "top" ? scrollTop === 0 : true;
|
|
983
|
-
}
|
|
984
|
-
const maxScroll = scrollHeight - clientHeight;
|
|
985
1017
|
switch (edge) {
|
|
986
1018
|
case "top":
|
|
987
|
-
return
|
|
1019
|
+
return rect.top >= -threshold && rect.top <= threshold;
|
|
988
1020
|
case "bottom": {
|
|
989
|
-
const
|
|
990
|
-
return
|
|
1021
|
+
const bottomDistance = windowHeight - rect.bottom;
|
|
1022
|
+
return bottomDistance >= 0 && bottomDistance <= threshold;
|
|
991
1023
|
}
|
|
992
1024
|
default:
|
|
993
1025
|
return false;
|
|
994
1026
|
}
|
|
995
1027
|
};
|
|
996
1028
|
const bindEvents = (el, binding) => {
|
|
997
|
-
const isScrollable = el.scrollHeight > el.clientHeight;
|
|
998
|
-
if (!isScrollable)
|
|
999
|
-
return;
|
|
1000
1029
|
if (el._scroll_handlers_)
|
|
1001
1030
|
return;
|
|
1002
|
-
const wheelDom =
|
|
1003
|
-
if (
|
|
1031
|
+
const wheelDom = debounce(() => {
|
|
1032
|
+
if (checkEdges(el, config.edge)) {
|
|
1004
1033
|
config.onWheel();
|
|
1005
1034
|
}
|
|
1006
|
-
}, config.
|
|
1035
|
+
}, config.debounceTime);
|
|
1007
1036
|
el._scroll_handlers_ = {
|
|
1008
1037
|
wheel: wheelDom
|
|
1009
1038
|
};
|
|
1010
|
-
|
|
1039
|
+
window.addEventListener("wheel", el._scroll_handlers_.wheel);
|
|
1011
1040
|
};
|
|
1012
1041
|
const unbindEvents = (el) => {
|
|
1013
1042
|
if (el._scroll_handlers_) {
|
|
1014
|
-
|
|
1043
|
+
window.removeEventListener("wheel", el._scroll_handlers_.wheel);
|
|
1015
1044
|
delete el._scroll_handlers_;
|
|
1016
1045
|
}
|
|
1017
1046
|
};
|
|
1018
1047
|
return {
|
|
1019
1048
|
mounted(el, binding) {
|
|
1020
|
-
|
|
1049
|
+
if (binding.value)
|
|
1050
|
+
bindEvents(el);
|
|
1021
1051
|
},
|
|
1022
1052
|
updated(el, binding) {
|
|
1023
|
-
if (binding.value
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1053
|
+
if (binding.value !== binding.oldValue) {
|
|
1054
|
+
if (binding.value) {
|
|
1055
|
+
bindEvents(el);
|
|
1056
|
+
} else {
|
|
1057
|
+
unbindEvents(el);
|
|
1058
|
+
}
|
|
1027
1059
|
}
|
|
1028
1060
|
},
|
|
1029
1061
|
beforeUnmount(el) {
|
|
@@ -1031,7 +1063,7 @@ const createLoadingDirective = (options) => {
|
|
|
1031
1063
|
}
|
|
1032
1064
|
};
|
|
1033
1065
|
};
|
|
1034
|
-
const DEFAULT_DEBOUNCE_WAIT =
|
|
1066
|
+
const DEFAULT_DEBOUNCE_WAIT = 20;
|
|
1035
1067
|
const createScrollDirective = (options) => {
|
|
1036
1068
|
const config = {
|
|
1037
1069
|
debounceWait: DEFAULT_DEBOUNCE_WAIT,
|
|
@@ -1064,7 +1096,9 @@ const createScrollDirective = (options) => {
|
|
|
1064
1096
|
};
|
|
1065
1097
|
return {
|
|
1066
1098
|
mounted(el, binding) {
|
|
1067
|
-
|
|
1099
|
+
if (binding.value) {
|
|
1100
|
+
bindEvents(el);
|
|
1101
|
+
}
|
|
1068
1102
|
},
|
|
1069
1103
|
beforeUnmount(el) {
|
|
1070
1104
|
unbindEvents(el);
|
|
@@ -1072,8 +1106,11 @@ const createScrollDirective = (options) => {
|
|
|
1072
1106
|
// 添加 updated 钩子处理配置变化
|
|
1073
1107
|
updated(el, binding) {
|
|
1074
1108
|
if (binding.value !== binding.oldValue) {
|
|
1075
|
-
|
|
1076
|
-
|
|
1109
|
+
if (binding.value) {
|
|
1110
|
+
bindEvents(el);
|
|
1111
|
+
} else {
|
|
1112
|
+
unbindEvents(el);
|
|
1113
|
+
}
|
|
1077
1114
|
}
|
|
1078
1115
|
}
|
|
1079
1116
|
};
|
|
@@ -1102,38 +1139,17 @@ const createWheelDirective = (options) => {
|
|
|
1102
1139
|
};
|
|
1103
1140
|
return {
|
|
1104
1141
|
mounted(el, binding) {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
beforeUnmount(el) {
|
|
1108
|
-
unbindEvents(el);
|
|
1109
|
-
}
|
|
1110
|
-
};
|
|
1111
|
-
};
|
|
1112
|
-
const createBgClickeDirective = (options) => {
|
|
1113
|
-
const config = {
|
|
1114
|
-
onBgPicture: () => {
|
|
1142
|
+
if (binding.value)
|
|
1143
|
+
bindEvents(el);
|
|
1115
1144
|
},
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
bgPicture: bgPictureHandler
|
|
1125
|
-
};
|
|
1126
|
-
el.addEventListener("click", bgPictureHandler);
|
|
1127
|
-
};
|
|
1128
|
-
const unbindEvents = (el) => {
|
|
1129
|
-
if (el._bgPicture_handlers_) {
|
|
1130
|
-
el.removeEventListener("click", el._bgPicture_handlers_.bgPicture);
|
|
1131
|
-
delete el._bgPicture_handlers_;
|
|
1132
|
-
}
|
|
1133
|
-
};
|
|
1134
|
-
return {
|
|
1135
|
-
mounted(el, binding) {
|
|
1136
|
-
bindEvents(el);
|
|
1145
|
+
updated(el, binding) {
|
|
1146
|
+
if (binding.value !== binding.oldValue) {
|
|
1147
|
+
if (binding.value) {
|
|
1148
|
+
bindEvents(el);
|
|
1149
|
+
} else {
|
|
1150
|
+
unbindEvents(el);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1137
1153
|
},
|
|
1138
1154
|
beforeUnmount(el) {
|
|
1139
1155
|
unbindEvents(el);
|
|
@@ -1168,6 +1184,7 @@ const LibScrollBar = defineAsyncComponent(() => import("../scrollBar/scrollBar.j
|
|
|
1168
1184
|
const LibCarousel = defineAsyncComponent(() => import("../carousel/carousel.js"));
|
|
1169
1185
|
const LibCarouselItem = defineAsyncComponent(() => import("../carousel/carouselitem.js"));
|
|
1170
1186
|
const LibSwitch = defineAsyncComponent(() => import("../switch/switch.js"));
|
|
1187
|
+
usePopperContainer();
|
|
1171
1188
|
const index = {
|
|
1172
1189
|
install(app) {
|
|
1173
1190
|
app.component("LibDialog", LibDialog);
|
|
@@ -1200,27 +1217,27 @@ const index = {
|
|
|
1200
1217
|
}
|
|
1201
1218
|
};
|
|
1202
1219
|
export {
|
|
1203
|
-
|
|
1204
|
-
|
|
1220
|
+
LibPagination as A,
|
|
1221
|
+
LibBadge as B,
|
|
1205
1222
|
CloseIcon as C,
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1223
|
+
LibPopover as D,
|
|
1224
|
+
LibNumberInput as E,
|
|
1225
|
+
LibRadioBox as F,
|
|
1226
|
+
LibRadioGroup as G,
|
|
1227
|
+
LibCheckGroup as H,
|
|
1228
|
+
LibCheckBox as I,
|
|
1229
|
+
LibUpload as J,
|
|
1230
|
+
LibTabs as K,
|
|
1214
1231
|
LibDialog as L,
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1232
|
+
LibTabsPane as M,
|
|
1233
|
+
LibScrollBar as N,
|
|
1234
|
+
MessageClass as O,
|
|
1235
|
+
AlertFunction as P,
|
|
1236
|
+
LibLoad as Q,
|
|
1237
|
+
LibCarousel as R,
|
|
1238
|
+
LibCarouselItem as S,
|
|
1239
|
+
LibSwitch as T,
|
|
1240
|
+
createLoadingDirective as U,
|
|
1224
1241
|
_export_sfc as _,
|
|
1225
1242
|
createArrowKeysDirective as a,
|
|
1226
1243
|
createDraggableDirective as b,
|
|
@@ -1240,12 +1257,12 @@ export {
|
|
|
1240
1257
|
LibInput as p,
|
|
1241
1258
|
LibSelect as q,
|
|
1242
1259
|
LibSelectOption as r,
|
|
1243
|
-
|
|
1244
|
-
|
|
1260
|
+
selector as s,
|
|
1261
|
+
LibTable as t,
|
|
1245
1262
|
usePotion as u,
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1263
|
+
LibTableItem as v,
|
|
1264
|
+
LibImage as w,
|
|
1265
|
+
LibDatePicker as x,
|
|
1266
|
+
LibDatePickerRange as y,
|
|
1267
|
+
LibMenu as z
|
|
1251
1268
|
};
|
package/dist/js/input/input.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, computed, inject, openBlock, createElementBlock, renderSlot, withDirectives,
|
|
1
|
+
import { defineComponent, computed, inject, openBlock, createElementBlock, renderSlot, withDirectives, normalizeClass, vModelDynamic, vModelText, createElementVNode, createVNode, vShow } from "vue";
|
|
2
2
|
import { d as delIcon } from "../delete/delete.js";
|
|
3
3
|
import "../index/index.js";
|
|
4
4
|
const _hoisted_1 = { class: "relative flex h-full w-full items-center overflow-hidden rounded border border-solid" };
|
|
5
|
-
const _hoisted_2 = ["placeholder", "type"];
|
|
5
|
+
const _hoisted_2 = ["placeholder", "type", "autocomplete"];
|
|
6
|
+
const _hoisted_3 = ["placeholder", "rows", "autocomplete"];
|
|
6
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
8
|
__name: "input",
|
|
8
9
|
props: {
|
|
@@ -11,15 +12,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
12
|
type: { default: "text" },
|
|
12
13
|
placeHolder: {},
|
|
13
14
|
clearable: { type: Boolean, default: false },
|
|
14
|
-
|
|
15
|
+
rows: {},
|
|
16
|
+
size: { default: "default" },
|
|
17
|
+
autocomplete: { default: "off" }
|
|
15
18
|
},
|
|
16
19
|
emits: ["update:modelValue", "blur", "input", "change"],
|
|
17
20
|
setup(__props, { emit: __emit }) {
|
|
18
21
|
const props = __props;
|
|
22
|
+
const isTextarea = computed(() => props.type === "textarea");
|
|
19
23
|
const heightClass = computed(() => ({
|
|
20
24
|
"h-10": props.size === "large",
|
|
21
25
|
"h-9": props.size === "default",
|
|
22
|
-
"h-8": props.size === "small"
|
|
26
|
+
"h-8": props.size === "small",
|
|
27
|
+
"h-7": props.size === "mini"
|
|
23
28
|
}));
|
|
24
29
|
const inputValue = computed({
|
|
25
30
|
get() {
|
|
@@ -77,16 +82,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
82
|
return (_ctx, _cache) => {
|
|
78
83
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
79
84
|
renderSlot(_ctx.$slots, "prepend"),
|
|
80
|
-
withDirectives(
|
|
85
|
+
!isTextarea.value ? withDirectives((openBlock(), createElementBlock("input", {
|
|
86
|
+
key: 0,
|
|
81
87
|
class: normalizeClass(["w-full px-2 outline-none appearance-none", heightClass.value]),
|
|
82
88
|
placeholder: _ctx.placeHolder,
|
|
83
89
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
84
90
|
type: _ctx.type,
|
|
91
|
+
autocomplete: _ctx.autocomplete,
|
|
85
92
|
onBlur: handleBlur,
|
|
86
93
|
onInput: handleInput,
|
|
87
94
|
onChange: handleChange
|
|
88
|
-
}, null, 42, _hoisted_2), [
|
|
95
|
+
}, null, 42, _hoisted_2)), [
|
|
89
96
|
[vModelDynamic, inputValue.value]
|
|
97
|
+
]) : withDirectives((openBlock(), createElementBlock("textarea", {
|
|
98
|
+
key: 1,
|
|
99
|
+
class: normalizeClass(["w-full h-full px-2 outline-none appearance-none", heightClass.value]),
|
|
100
|
+
placeholder: _ctx.placeHolder,
|
|
101
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
|
|
102
|
+
autosize: "",
|
|
103
|
+
rows: _ctx.rows,
|
|
104
|
+
autocomplete: _ctx.autocomplete,
|
|
105
|
+
onBlur: handleBlur,
|
|
106
|
+
onInput: handleInput,
|
|
107
|
+
onChange: handleChange
|
|
108
|
+
}, null, 42, _hoisted_3)), [
|
|
109
|
+
[vModelText, inputValue.value]
|
|
90
110
|
]),
|
|
91
111
|
withDirectives(createElementVNode("button", {
|
|
92
112
|
type: "button",
|
|
@@ -44,7 +44,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
const sizeClass = computed(() => ({
|
|
45
45
|
"h-10 w-10": props.size === "large",
|
|
46
46
|
"h-9 w-9": props.size === "default",
|
|
47
|
-
"h-8 w-8": props.size === "small"
|
|
47
|
+
"h-8 w-8": props.size === "small",
|
|
48
|
+
"h-7 w-7": props.size === "mini"
|
|
48
49
|
}));
|
|
49
50
|
const bounds = computed(() => ({
|
|
50
51
|
min: props.min ?? -Infinity,
|
|
@@ -129,7 +129,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
129
129
|
showSizeSelector.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
130
130
|
createVNode(unref(LibSelect), {
|
|
131
131
|
modelValue: size.value,
|
|
132
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => size.value = $event)
|
|
132
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => size.value = $event),
|
|
133
|
+
size: "mini"
|
|
133
134
|
}, {
|
|
134
135
|
default: withCtx(() => [
|
|
135
136
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.sizeArr, (i) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, h, normalizeClass, normalizeStyle, ref, computed, nextTick, getCurrentInstance, openBlock, createElementBlock, withModifiers, renderSlot, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives,
|
|
2
|
-
import { u as usePotion, h as createScrollDirective, i as createBgClickDirective, c as createEscapeDirective } from "../index/index.js";
|
|
1
|
+
import { defineComponent, h, normalizeClass, normalizeStyle, ref, computed, nextTick, getCurrentInstance, openBlock, createElementBlock, withModifiers, renderSlot, createBlock, Teleport, unref, createVNode, Transition, withCtx, withDirectives, createCommentVNode, vShow } from "vue";
|
|
2
|
+
import { u as usePotion, h as createScrollDirective, i as createBgClickDirective, c as createEscapeDirective, s as selector } from "../index/index.js";
|
|
3
3
|
const PLACEMENT_GROUPS = {
|
|
4
4
|
top: ["topleft", "topmiddle", "topright"],
|
|
5
5
|
bottom: ["bottomleft", "bottommiddle", "bottomright"],
|
|
@@ -139,17 +139,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
139
139
|
const { proxy } = getCurrentInstance();
|
|
140
140
|
const vScroll = createScrollDirective({
|
|
141
141
|
onMove: () => {
|
|
142
|
-
if (shouldShow.value == false)
|
|
143
|
-
return;
|
|
144
142
|
setPosition();
|
|
145
143
|
},
|
|
146
|
-
|
|
147
|
-
scrollContainerId: proxy.gloablScrollBar ? proxy.gloablScrollBar : void 0
|
|
144
|
+
scrollContainerId: (proxy == null ? void 0 : proxy.gloablScrollBar) ? proxy == null ? void 0 : proxy.gloablScrollBar : void 0
|
|
148
145
|
});
|
|
149
146
|
const vClickoutside = createBgClickDirective({
|
|
150
147
|
onCheckOut: (event, el) => {
|
|
151
|
-
if (shouldShow.value == false)
|
|
152
|
-
return;
|
|
153
148
|
if (el.contains(event.target)) {
|
|
154
149
|
return;
|
|
155
150
|
} else if (base.value.contains(event.target)) {
|
|
@@ -162,9 +157,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
162
157
|
});
|
|
163
158
|
const vEsc = createEscapeDirective({
|
|
164
159
|
onEscape: () => {
|
|
165
|
-
if (shouldShow.value == false)
|
|
166
|
-
return;
|
|
167
|
-
console.log("work");
|
|
168
160
|
hideHandle();
|
|
169
161
|
}
|
|
170
162
|
});
|
|
@@ -211,7 +203,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
211
203
|
onMouseenter: withModifiers(hovershowHandle, ["prevent"])
|
|
212
204
|
}, [
|
|
213
205
|
renderSlot(_ctx.$slots, "reference"),
|
|
214
|
-
(openBlock(), createBlock(Teleport, {
|
|
206
|
+
(openBlock(), createBlock(Teleport, {
|
|
207
|
+
to: `#${unref(selector)}`
|
|
208
|
+
}, [
|
|
215
209
|
createVNode(Transition, { name: "opecity" }, {
|
|
216
210
|
default: withCtx(() => [
|
|
217
211
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
@@ -231,14 +225,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
231
225
|
}, null, 8, ["arrowLeft", "arrowTop", "exChange", "beforebgcolor", "placement"])) : createCommentVNode("", true)
|
|
232
226
|
], 6)), [
|
|
233
227
|
[vShow, shouldShow.value],
|
|
234
|
-
[unref(vClickoutside)],
|
|
235
|
-
[unref(vEsc)],
|
|
236
|
-
[unref(vScroll)]
|
|
228
|
+
[unref(vClickoutside), shouldShow.value],
|
|
229
|
+
[unref(vEsc), shouldShow.value],
|
|
230
|
+
[unref(vScroll), shouldShow.value]
|
|
237
231
|
])
|
|
238
232
|
]),
|
|
239
233
|
_: 3
|
|
240
234
|
})
|
|
241
|
-
]))
|
|
235
|
+
], 8, ["to"]))
|
|
242
236
|
], 544);
|
|
243
237
|
};
|
|
244
238
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, computed, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelRadio, toDisplayString } from "vue";
|
|
2
2
|
const _hoisted_1 = ["value", "disabled"];
|
|
3
|
-
const _hoisted_2 = { class: "
|
|
3
|
+
const _hoisted_2 = { class: "peer-disabled:text-word9 px-2 py-1 bg-white text-word6 peer-checked:bg-[#1890ff] peer-checked:text-white" };
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "radiobox",
|
|
6
6
|
props: {
|
|
@@ -28,18 +28,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
const emit = __emit;
|
|
29
29
|
return (_ctx, _cache) => {
|
|
30
30
|
return openBlock(), createElementBlock("label", {
|
|
31
|
-
class: normalizeClass(["select-none inline-flex items-center", { "cursor-not-allowed": _ctx.disabled }])
|
|
31
|
+
class: normalizeClass(["select-none text-sm inline-flex items-center cursor-pointer first:rounded-l-md last:rounded-r-md border-t border-b border-l last:border-r overflow-hidden", { "cursor-not-allowed": _ctx.disabled }])
|
|
32
32
|
}, [
|
|
33
33
|
withDirectives(createElementVNode("input", {
|
|
34
34
|
type: "radio",
|
|
35
35
|
value: _ctx.value,
|
|
36
36
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checkedState.value = $event),
|
|
37
37
|
disabled: _ctx.disabled,
|
|
38
|
-
class: "peer disabled:cursor-not-allowed form-tick appearance-none h-4 w-4 rounded-full border border-gray-300 checked:border-transparent checked:bg-blue-600 focus:outline-none"
|
|
38
|
+
class: "peer hidden disabled:cursor-not-allowed form-tick appearance-none h-4 w-4 rounded-full border border-gray-300 checked:border-transparent checked:bg-blue-600 focus:outline-none"
|
|
39
39
|
}, null, 8, _hoisted_1), [
|
|
40
40
|
[vModelRadio, checkedState.value]
|
|
41
41
|
]),
|
|
42
|
-
createElementVNode("
|
|
42
|
+
createElementVNode("div", _hoisted_2, toDisplayString(_ctx.label), 1)
|
|
43
43
|
], 2);
|
|
44
44
|
};
|
|
45
45
|
}
|
package/dist/js/select/select.js
CHANGED
|
@@ -21,7 +21,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
const heightClass = computed(() => ({
|
|
22
22
|
"h-10": props.size === "large",
|
|
23
23
|
"h-9": props.size === "default",
|
|
24
|
-
"h-8": props.size === "small"
|
|
24
|
+
"h-8": props.size === "small",
|
|
25
|
+
"h-7": props.size === "mini"
|
|
25
26
|
}));
|
|
26
27
|
const ParentGetChangeHandle = inject("changHandle", (_params) => null);
|
|
27
28
|
const inputbox = ref();
|
|
@@ -113,7 +114,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
114
|
type: "text",
|
|
114
115
|
disabled: _ctx.disabled,
|
|
115
116
|
readonly: !_ctx.filter,
|
|
116
|
-
class: normalizeClass(["w-full cursor-pointer appearance-none
|
|
117
|
+
class: normalizeClass(["w-full cursor-pointer appearance-none pl-2 text-sm outline-none disabled:cursor-default text-word3", heightClass.value]),
|
|
117
118
|
placeholder: _ctx.placeHolder
|
|
118
119
|
}, null, 10, _hoisted_1),
|
|
119
120
|
createVNode(ArrowIcon, {
|
|
@@ -134,7 +135,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
134
135
|
_: 3
|
|
135
136
|
}, 512)
|
|
136
137
|
])), [
|
|
137
|
-
[unref(vArrowKeys)]
|
|
138
|
+
[unref(vArrowKeys), showOption.value]
|
|
138
139
|
])
|
|
139
140
|
]),
|
|
140
141
|
_: 3
|