ninemoon-ui 0.1.3 → 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/directives/index.d.ts +10 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.es.js +39 -32
- package/dist/index.umd.js +295 -257
- package/dist/js/date/datepicker.js +1 -1
- package/dist/js/date/datepickerRange.js +1 -1
- package/dist/js/image/image.js +1 -101
- package/dist/js/index/index.js +329 -38
- package/dist/js/popover/popover.js +1 -99
- package/dist/js/scrollBar/scrollBar.js +1 -1
- package/dist/js/select/select.js +1 -59
- package/package.json +1 -1
- /package/dist/{components/scrollloading → directives}/scrolllead.d.ts +0 -0
package/dist/index.umd.js
CHANGED
|
@@ -762,6 +762,64 @@ var __publicField = (obj, key, value) => {
|
|
|
762
762
|
}
|
|
763
763
|
delete el.__loading_instance__;
|
|
764
764
|
}
|
|
765
|
+
const directionMap = {
|
|
766
|
+
ArrowUp: "up",
|
|
767
|
+
Up: "up",
|
|
768
|
+
// IE/Edge 兼容
|
|
769
|
+
ArrowDown: "down",
|
|
770
|
+
Down: "down",
|
|
771
|
+
// IE/Edge 兼容
|
|
772
|
+
ArrowLeft: "left",
|
|
773
|
+
Left: "left",
|
|
774
|
+
// IE/Edge 兼容
|
|
775
|
+
ArrowRight: "right",
|
|
776
|
+
Right: "right"
|
|
777
|
+
// IE/Edge 兼容
|
|
778
|
+
};
|
|
779
|
+
const createArrowKeysDirective = (options) => {
|
|
780
|
+
const config = {
|
|
781
|
+
// 默认配置
|
|
782
|
+
up: () => {
|
|
783
|
+
},
|
|
784
|
+
down: () => {
|
|
785
|
+
},
|
|
786
|
+
left: () => {
|
|
787
|
+
},
|
|
788
|
+
right: () => {
|
|
789
|
+
},
|
|
790
|
+
...options
|
|
791
|
+
};
|
|
792
|
+
const bindEvents = (el, binding) => {
|
|
793
|
+
const handler = (e) => {
|
|
794
|
+
var _a;
|
|
795
|
+
const direction = directionMap[e.key];
|
|
796
|
+
if (direction && config[direction]) {
|
|
797
|
+
e.preventDefault();
|
|
798
|
+
(_a = config[direction]) == null ? void 0 : _a.call(config, e);
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
el._arrowKeysHandler = handler;
|
|
802
|
+
document.addEventListener("keydown", handler);
|
|
803
|
+
};
|
|
804
|
+
const unbindEvents = (el) => {
|
|
805
|
+
if (el._arrowKeysHandler) {
|
|
806
|
+
document.removeEventListener("keydown", el._arrowKeysHandler);
|
|
807
|
+
}
|
|
808
|
+
delete el._arrowKeysHandler;
|
|
809
|
+
};
|
|
810
|
+
return {
|
|
811
|
+
mounted(el, binding) {
|
|
812
|
+
bindEvents(el);
|
|
813
|
+
},
|
|
814
|
+
updated(el, binding) {
|
|
815
|
+
unbindEvents(el);
|
|
816
|
+
bindEvents(el);
|
|
817
|
+
},
|
|
818
|
+
unmounted(el) {
|
|
819
|
+
unbindEvents(el);
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
};
|
|
765
823
|
function debounce(func, wait) {
|
|
766
824
|
let timeout;
|
|
767
825
|
return function() {
|
|
@@ -970,11 +1028,131 @@ var __publicField = (obj, key, value) => {
|
|
|
970
1028
|
};
|
|
971
1029
|
return { observe, unobserve };
|
|
972
1030
|
};
|
|
1031
|
+
const DEFAULT_THROTTLE_WAIT = 60;
|
|
1032
|
+
const createDraggableDirective = (options) => {
|
|
1033
|
+
const config = {
|
|
1034
|
+
throttleWait: DEFAULT_THROTTLE_WAIT,
|
|
1035
|
+
resetOnEnd: false,
|
|
1036
|
+
onDrag: () => {
|
|
1037
|
+
},
|
|
1038
|
+
// default implementation
|
|
1039
|
+
...options
|
|
1040
|
+
};
|
|
1041
|
+
const bindEvents = (el, binding) => {
|
|
1042
|
+
if (el.__draggable_handlers__)
|
|
1043
|
+
return;
|
|
1044
|
+
let startX = 0;
|
|
1045
|
+
let startY = 0;
|
|
1046
|
+
let initialX = 0;
|
|
1047
|
+
let initialY = 0;
|
|
1048
|
+
const handleMove = throttle((e) => {
|
|
1049
|
+
e.preventDefault();
|
|
1050
|
+
const deltaX = e.pageX - startX;
|
|
1051
|
+
const deltaY = e.pageY - startY;
|
|
1052
|
+
config.onDrag({
|
|
1053
|
+
x: deltaX + initialX,
|
|
1054
|
+
y: deltaY + initialY
|
|
1055
|
+
});
|
|
1056
|
+
}, config.throttleWait);
|
|
1057
|
+
const handleDown = (e) => {
|
|
1058
|
+
var _a;
|
|
1059
|
+
e.preventDefault();
|
|
1060
|
+
const rect = el.getBoundingClientRect();
|
|
1061
|
+
initialX = rect.left + window.scrollX;
|
|
1062
|
+
initialY = rect.top + window.scrollY;
|
|
1063
|
+
startX = e.pageX;
|
|
1064
|
+
startY = e.pageY;
|
|
1065
|
+
(_a = config.onDragStart) == null ? void 0 : _a.call(config, { x: initialX, y: initialY });
|
|
1066
|
+
window.addEventListener("mousemove", handleMove);
|
|
1067
|
+
window.addEventListener("mouseup", handleUp);
|
|
1068
|
+
};
|
|
1069
|
+
const handleUp = () => {
|
|
1070
|
+
var _a;
|
|
1071
|
+
window.removeEventListener("mousemove", handleMove);
|
|
1072
|
+
window.removeEventListener("mouseup", handleUp);
|
|
1073
|
+
if (config.resetOnEnd) {
|
|
1074
|
+
config.onDrag({ x: initialX, y: initialY });
|
|
1075
|
+
}
|
|
1076
|
+
(_a = config.onDragEnd) == null ? void 0 : _a.call(config, { x: initialX, y: initialY });
|
|
1077
|
+
};
|
|
1078
|
+
el.__draggable_handlers__ = {
|
|
1079
|
+
move: handleMove,
|
|
1080
|
+
up: handleUp
|
|
1081
|
+
};
|
|
1082
|
+
el.addEventListener("mousedown", handleDown);
|
|
1083
|
+
};
|
|
1084
|
+
const unbindEvents = (el) => {
|
|
1085
|
+
if (el.__draggable_handlers__) {
|
|
1086
|
+
window.removeEventListener("mousemove", el.__draggable_handlers__.move);
|
|
1087
|
+
window.removeEventListener("mouseup", el.__draggable_handlers__.up);
|
|
1088
|
+
delete el.__draggable_handlers__;
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1091
|
+
return {
|
|
1092
|
+
mounted(el, binding) {
|
|
1093
|
+
bindEvents(el);
|
|
1094
|
+
},
|
|
1095
|
+
beforeUnmount(el) {
|
|
1096
|
+
unbindEvents(el);
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
};
|
|
973
1100
|
const DEFAULT_DEBOUNCE_WAIT$2 = 100;
|
|
1101
|
+
const createBgClickDirective = (options) => {
|
|
1102
|
+
const config = {
|
|
1103
|
+
debounceWait: DEFAULT_DEBOUNCE_WAIT$2,
|
|
1104
|
+
moveModel: false,
|
|
1105
|
+
onCheckOut: () => {
|
|
1106
|
+
},
|
|
1107
|
+
...options
|
|
1108
|
+
};
|
|
1109
|
+
const bindEvents = (el, binding) => {
|
|
1110
|
+
if (el._checkout_handlers_)
|
|
1111
|
+
return;
|
|
1112
|
+
const clickDom = debounce((e) => {
|
|
1113
|
+
e.preventDefault();
|
|
1114
|
+
config.onCheckOut(e, el);
|
|
1115
|
+
}, config.debounceWait);
|
|
1116
|
+
el._checkout_handlers_ = {
|
|
1117
|
+
click: clickDom
|
|
1118
|
+
};
|
|
1119
|
+
if (config.moveModel) {
|
|
1120
|
+
document.addEventListener("mousemove", clickDom);
|
|
1121
|
+
} else {
|
|
1122
|
+
document.addEventListener("click", clickDom);
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1125
|
+
const unbindEvents = (el) => {
|
|
1126
|
+
if (el._checkout_handlers_) {
|
|
1127
|
+
if (config.moveModel) {
|
|
1128
|
+
document.removeEventListener("mousemove", el._checkout_handlers_.click);
|
|
1129
|
+
} else {
|
|
1130
|
+
document.removeEventListener("click", el._checkout_handlers_.click);
|
|
1131
|
+
}
|
|
1132
|
+
delete el._checkout_handlers_;
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
return {
|
|
1136
|
+
mounted(el, binding) {
|
|
1137
|
+
bindEvents(el);
|
|
1138
|
+
},
|
|
1139
|
+
beforeUnmount(el) {
|
|
1140
|
+
unbindEvents(el);
|
|
1141
|
+
},
|
|
1142
|
+
// 添加 updated 钩子处理配置变化
|
|
1143
|
+
updated(el, binding) {
|
|
1144
|
+
if (binding.value !== binding.oldValue) {
|
|
1145
|
+
unbindEvents(el);
|
|
1146
|
+
bindEvents(el);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
};
|
|
1151
|
+
const DEFAULT_DEBOUNCE_WAIT$1 = 100;
|
|
974
1152
|
const DEFAULT_HOLD = 0;
|
|
975
1153
|
const createLoadingDirective = (options) => {
|
|
976
1154
|
const config = {
|
|
977
|
-
throttleTime: DEFAULT_DEBOUNCE_WAIT$
|
|
1155
|
+
throttleTime: DEFAULT_DEBOUNCE_WAIT$1,
|
|
978
1156
|
threshold: DEFAULT_HOLD,
|
|
979
1157
|
edge: "bottom",
|
|
980
1158
|
onWheel: () => {
|
|
@@ -1038,6 +1216,115 @@ var __publicField = (obj, key, value) => {
|
|
|
1038
1216
|
}
|
|
1039
1217
|
};
|
|
1040
1218
|
};
|
|
1219
|
+
const DEFAULT_DEBOUNCE_WAIT = 50;
|
|
1220
|
+
const createScrollDirective = (options) => {
|
|
1221
|
+
const config = {
|
|
1222
|
+
debounceWait: DEFAULT_DEBOUNCE_WAIT,
|
|
1223
|
+
onMove: () => {
|
|
1224
|
+
},
|
|
1225
|
+
...options
|
|
1226
|
+
};
|
|
1227
|
+
const bindEvents = (el, binding) => {
|
|
1228
|
+
if (el._watchwindow_handlers_) {
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
const moveDom = debounce((e) => {
|
|
1232
|
+
e.preventDefault();
|
|
1233
|
+
config.onMove();
|
|
1234
|
+
}, config.debounceWait);
|
|
1235
|
+
el._watchwindow_handlers_ = {
|
|
1236
|
+
move: moveDom
|
|
1237
|
+
};
|
|
1238
|
+
window.addEventListener("resize", el._watchwindow_handlers_.move);
|
|
1239
|
+
const scrollContainer = typeof config.scrollContainerId === "string" ? document.querySelector(config.scrollContainerId) || window : window;
|
|
1240
|
+
scrollContainer.addEventListener("scroll", el._watchwindow_handlers_.move);
|
|
1241
|
+
};
|
|
1242
|
+
const unbindEvents = (el) => {
|
|
1243
|
+
if (el._watchwindow_handlers_) {
|
|
1244
|
+
window.removeEventListener("resize", el._watchwindow_handlers_.move);
|
|
1245
|
+
const scrollContainer = typeof config.scrollContainerId === "string" ? document.querySelector(config.scrollContainerId) || window : window;
|
|
1246
|
+
scrollContainer.removeEventListener("scroll", el._watchwindow_handlers_.move);
|
|
1247
|
+
delete el._watchwindow_handlers_;
|
|
1248
|
+
}
|
|
1249
|
+
};
|
|
1250
|
+
return {
|
|
1251
|
+
mounted(el, binding) {
|
|
1252
|
+
bindEvents(el);
|
|
1253
|
+
},
|
|
1254
|
+
beforeUnmount(el) {
|
|
1255
|
+
unbindEvents(el);
|
|
1256
|
+
},
|
|
1257
|
+
// 添加 updated 钩子处理配置变化
|
|
1258
|
+
updated(el, binding) {
|
|
1259
|
+
if (binding.value !== binding.oldValue) {
|
|
1260
|
+
unbindEvents(el);
|
|
1261
|
+
bindEvents(el);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
};
|
|
1265
|
+
};
|
|
1266
|
+
const createWheelDirective = (options) => {
|
|
1267
|
+
const config = {
|
|
1268
|
+
onWheel: () => {
|
|
1269
|
+
},
|
|
1270
|
+
...options
|
|
1271
|
+
};
|
|
1272
|
+
const bindEvents = (el, binding) => {
|
|
1273
|
+
const wheelHandler = (e) => {
|
|
1274
|
+
e.preventDefault();
|
|
1275
|
+
config.onWheel(e);
|
|
1276
|
+
};
|
|
1277
|
+
el._wheel_handlers_ = {
|
|
1278
|
+
wheel: wheelHandler
|
|
1279
|
+
};
|
|
1280
|
+
el.addEventListener("wheel", wheelHandler);
|
|
1281
|
+
};
|
|
1282
|
+
const unbindEvents = (el) => {
|
|
1283
|
+
if (el._wheel_handlers_) {
|
|
1284
|
+
el.removeEventListener("wheel", el._wheel_handlers_.wheel);
|
|
1285
|
+
delete el._wheel_handlers_;
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
return {
|
|
1289
|
+
mounted(el, binding) {
|
|
1290
|
+
bindEvents(el);
|
|
1291
|
+
},
|
|
1292
|
+
beforeUnmount(el) {
|
|
1293
|
+
unbindEvents(el);
|
|
1294
|
+
}
|
|
1295
|
+
};
|
|
1296
|
+
};
|
|
1297
|
+
const createBgClickeDirective = (options) => {
|
|
1298
|
+
const config = {
|
|
1299
|
+
onBgPicture: () => {
|
|
1300
|
+
},
|
|
1301
|
+
...options
|
|
1302
|
+
};
|
|
1303
|
+
const bindEvents = (el, binding) => {
|
|
1304
|
+
const bgPictureHandler = (e) => {
|
|
1305
|
+
e.preventDefault();
|
|
1306
|
+
config.onBgPicture(e);
|
|
1307
|
+
};
|
|
1308
|
+
el._bgPicture_handlers_ = {
|
|
1309
|
+
bgPicture: bgPictureHandler
|
|
1310
|
+
};
|
|
1311
|
+
el.addEventListener("click", bgPictureHandler);
|
|
1312
|
+
};
|
|
1313
|
+
const unbindEvents = (el) => {
|
|
1314
|
+
if (el._bgPicture_handlers_) {
|
|
1315
|
+
el.removeEventListener("click", el._bgPicture_handlers_.bgPicture);
|
|
1316
|
+
delete el._bgPicture_handlers_;
|
|
1317
|
+
}
|
|
1318
|
+
};
|
|
1319
|
+
return {
|
|
1320
|
+
mounted(el, binding) {
|
|
1321
|
+
bindEvents(el);
|
|
1322
|
+
},
|
|
1323
|
+
beforeUnmount(el) {
|
|
1324
|
+
unbindEvents(el);
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
};
|
|
1041
1328
|
const tailwind = "";
|
|
1042
1329
|
const LibDialog = vue.defineAsyncComponent(() => Promise.resolve().then(() => dialog));
|
|
1043
1330
|
const LibForm = vue.defineAsyncComponent(() => Promise.resolve().then(() => form));
|
|
@@ -1563,64 +1850,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1563
1850
|
]));
|
|
1564
1851
|
}
|
|
1565
1852
|
const ArrowIcon = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$a]]);
|
|
1566
|
-
const directionMap = {
|
|
1567
|
-
ArrowUp: "up",
|
|
1568
|
-
Up: "up",
|
|
1569
|
-
// IE/Edge 兼容
|
|
1570
|
-
ArrowDown: "down",
|
|
1571
|
-
Down: "down",
|
|
1572
|
-
// IE/Edge 兼容
|
|
1573
|
-
ArrowLeft: "left",
|
|
1574
|
-
Left: "left",
|
|
1575
|
-
// IE/Edge 兼容
|
|
1576
|
-
ArrowRight: "right",
|
|
1577
|
-
Right: "right"
|
|
1578
|
-
// IE/Edge 兼容
|
|
1579
|
-
};
|
|
1580
|
-
const createArrowKeysDirective = (options) => {
|
|
1581
|
-
const config = {
|
|
1582
|
-
// 默认配置
|
|
1583
|
-
up: () => {
|
|
1584
|
-
},
|
|
1585
|
-
down: () => {
|
|
1586
|
-
},
|
|
1587
|
-
left: () => {
|
|
1588
|
-
},
|
|
1589
|
-
right: () => {
|
|
1590
|
-
},
|
|
1591
|
-
...options
|
|
1592
|
-
};
|
|
1593
|
-
const bindEvents = (el, binding) => {
|
|
1594
|
-
const handler = (e) => {
|
|
1595
|
-
var _a;
|
|
1596
|
-
const direction = directionMap[e.key];
|
|
1597
|
-
if (direction && config[direction]) {
|
|
1598
|
-
e.preventDefault();
|
|
1599
|
-
(_a = config[direction]) == null ? void 0 : _a.call(config, e);
|
|
1600
|
-
}
|
|
1601
|
-
};
|
|
1602
|
-
el._arrowKeysHandler = handler;
|
|
1603
|
-
document.addEventListener("keydown", handler);
|
|
1604
|
-
};
|
|
1605
|
-
const unbindEvents = (el) => {
|
|
1606
|
-
if (el._arrowKeysHandler) {
|
|
1607
|
-
document.removeEventListener("keydown", el._arrowKeysHandler);
|
|
1608
|
-
}
|
|
1609
|
-
delete el._arrowKeysHandler;
|
|
1610
|
-
};
|
|
1611
|
-
return {
|
|
1612
|
-
mounted(el, binding) {
|
|
1613
|
-
bindEvents(el);
|
|
1614
|
-
},
|
|
1615
|
-
updated(el, binding) {
|
|
1616
|
-
unbindEvents(el);
|
|
1617
|
-
bindEvents(el);
|
|
1618
|
-
},
|
|
1619
|
-
unmounted(el) {
|
|
1620
|
-
unbindEvents(el);
|
|
1621
|
-
}
|
|
1622
|
-
};
|
|
1623
|
-
};
|
|
1624
1853
|
const _hoisted_1$o = ["value", "disabled", "readonly", "placeholder"];
|
|
1625
1854
|
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
1626
1855
|
__name: "select",
|
|
@@ -2178,106 +2407,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2178
2407
|
]));
|
|
2179
2408
|
}
|
|
2180
2409
|
const turnRightIcon = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$7]]);
|
|
2181
|
-
const DEFAULT_THROTTLE_WAIT = 60;
|
|
2182
|
-
const createDraggableDirective = (options) => {
|
|
2183
|
-
const config = {
|
|
2184
|
-
throttleWait: DEFAULT_THROTTLE_WAIT,
|
|
2185
|
-
resetOnEnd: false,
|
|
2186
|
-
onDrag: () => {
|
|
2187
|
-
},
|
|
2188
|
-
// default implementation
|
|
2189
|
-
...options
|
|
2190
|
-
};
|
|
2191
|
-
const bindEvents = (el, binding) => {
|
|
2192
|
-
if (el.__draggable_handlers__)
|
|
2193
|
-
return;
|
|
2194
|
-
let startX = 0;
|
|
2195
|
-
let startY = 0;
|
|
2196
|
-
let initialX = 0;
|
|
2197
|
-
let initialY = 0;
|
|
2198
|
-
const handleMove = throttle((e) => {
|
|
2199
|
-
e.preventDefault();
|
|
2200
|
-
const deltaX = e.pageX - startX;
|
|
2201
|
-
const deltaY = e.pageY - startY;
|
|
2202
|
-
config.onDrag({
|
|
2203
|
-
x: deltaX + initialX,
|
|
2204
|
-
y: deltaY + initialY
|
|
2205
|
-
});
|
|
2206
|
-
}, config.throttleWait);
|
|
2207
|
-
const handleDown = (e) => {
|
|
2208
|
-
var _a;
|
|
2209
|
-
e.preventDefault();
|
|
2210
|
-
const rect = el.getBoundingClientRect();
|
|
2211
|
-
initialX = rect.left + window.scrollX;
|
|
2212
|
-
initialY = rect.top + window.scrollY;
|
|
2213
|
-
startX = e.pageX;
|
|
2214
|
-
startY = e.pageY;
|
|
2215
|
-
(_a = config.onDragStart) == null ? void 0 : _a.call(config, { x: initialX, y: initialY });
|
|
2216
|
-
window.addEventListener("mousemove", handleMove);
|
|
2217
|
-
window.addEventListener("mouseup", handleUp);
|
|
2218
|
-
};
|
|
2219
|
-
const handleUp = () => {
|
|
2220
|
-
var _a;
|
|
2221
|
-
window.removeEventListener("mousemove", handleMove);
|
|
2222
|
-
window.removeEventListener("mouseup", handleUp);
|
|
2223
|
-
if (config.resetOnEnd) {
|
|
2224
|
-
config.onDrag({ x: initialX, y: initialY });
|
|
2225
|
-
}
|
|
2226
|
-
(_a = config.onDragEnd) == null ? void 0 : _a.call(config, { x: initialX, y: initialY });
|
|
2227
|
-
};
|
|
2228
|
-
el.__draggable_handlers__ = {
|
|
2229
|
-
move: handleMove,
|
|
2230
|
-
up: handleUp
|
|
2231
|
-
};
|
|
2232
|
-
el.addEventListener("mousedown", handleDown);
|
|
2233
|
-
};
|
|
2234
|
-
const unbindEvents = (el) => {
|
|
2235
|
-
if (el.__draggable_handlers__) {
|
|
2236
|
-
window.removeEventListener("mousemove", el.__draggable_handlers__.move);
|
|
2237
|
-
window.removeEventListener("mouseup", el.__draggable_handlers__.up);
|
|
2238
|
-
delete el.__draggable_handlers__;
|
|
2239
|
-
}
|
|
2240
|
-
};
|
|
2241
|
-
return {
|
|
2242
|
-
mounted(el, binding) {
|
|
2243
|
-
bindEvents(el);
|
|
2244
|
-
},
|
|
2245
|
-
beforeUnmount(el) {
|
|
2246
|
-
unbindEvents(el);
|
|
2247
|
-
}
|
|
2248
|
-
};
|
|
2249
|
-
};
|
|
2250
|
-
const createWheelDirective = (options) => {
|
|
2251
|
-
const config = {
|
|
2252
|
-
onWheel: () => {
|
|
2253
|
-
},
|
|
2254
|
-
...options
|
|
2255
|
-
};
|
|
2256
|
-
const bindEvents = (el, binding) => {
|
|
2257
|
-
const wheelHandler = (e) => {
|
|
2258
|
-
e.preventDefault();
|
|
2259
|
-
config.onWheel(e);
|
|
2260
|
-
};
|
|
2261
|
-
el._wheel_handlers_ = {
|
|
2262
|
-
wheel: wheelHandler
|
|
2263
|
-
};
|
|
2264
|
-
el.addEventListener("wheel", wheelHandler);
|
|
2265
|
-
};
|
|
2266
|
-
const unbindEvents = (el) => {
|
|
2267
|
-
if (el._wheel_handlers_) {
|
|
2268
|
-
el.removeEventListener("wheel", el._wheel_handlers_.wheel);
|
|
2269
|
-
delete el._wheel_handlers_;
|
|
2270
|
-
}
|
|
2271
|
-
};
|
|
2272
|
-
return {
|
|
2273
|
-
mounted(el, binding) {
|
|
2274
|
-
bindEvents(el);
|
|
2275
|
-
},
|
|
2276
|
-
beforeUnmount(el) {
|
|
2277
|
-
unbindEvents(el);
|
|
2278
|
-
}
|
|
2279
|
-
};
|
|
2280
|
-
};
|
|
2281
2410
|
const _hoisted_1$i = { class: "relative inline-block h-full w-full" };
|
|
2282
2411
|
const _hoisted_2$b = ["src"];
|
|
2283
2412
|
const _hoisted_3$7 = { key: 0 };
|
|
@@ -3710,104 +3839,6 @@ var __publicField = (obj, key, value) => {
|
|
|
3710
3839
|
__proto__: null,
|
|
3711
3840
|
default: _sfc_main$h
|
|
3712
3841
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3713
|
-
const DEFAULT_DEBOUNCE_WAIT$1 = 100;
|
|
3714
|
-
const createBgClickDirective = (options) => {
|
|
3715
|
-
const config = {
|
|
3716
|
-
debounceWait: DEFAULT_DEBOUNCE_WAIT$1,
|
|
3717
|
-
moveModel: false,
|
|
3718
|
-
onCheckOut: () => {
|
|
3719
|
-
},
|
|
3720
|
-
...options
|
|
3721
|
-
};
|
|
3722
|
-
const bindEvents = (el, binding) => {
|
|
3723
|
-
if (el._checkout_handlers_)
|
|
3724
|
-
return;
|
|
3725
|
-
const clickDom = debounce((e) => {
|
|
3726
|
-
e.preventDefault();
|
|
3727
|
-
config.onCheckOut(e, el);
|
|
3728
|
-
}, config.debounceWait);
|
|
3729
|
-
el._checkout_handlers_ = {
|
|
3730
|
-
click: clickDom
|
|
3731
|
-
};
|
|
3732
|
-
if (config.moveModel) {
|
|
3733
|
-
document.addEventListener("mousemove", clickDom);
|
|
3734
|
-
} else {
|
|
3735
|
-
document.addEventListener("click", clickDom);
|
|
3736
|
-
}
|
|
3737
|
-
};
|
|
3738
|
-
const unbindEvents = (el) => {
|
|
3739
|
-
if (el._checkout_handlers_) {
|
|
3740
|
-
if (config.moveModel) {
|
|
3741
|
-
document.removeEventListener("mousemove", el._checkout_handlers_.click);
|
|
3742
|
-
} else {
|
|
3743
|
-
document.removeEventListener("click", el._checkout_handlers_.click);
|
|
3744
|
-
}
|
|
3745
|
-
delete el._checkout_handlers_;
|
|
3746
|
-
}
|
|
3747
|
-
};
|
|
3748
|
-
return {
|
|
3749
|
-
mounted(el, binding) {
|
|
3750
|
-
bindEvents(el);
|
|
3751
|
-
},
|
|
3752
|
-
beforeUnmount(el) {
|
|
3753
|
-
unbindEvents(el);
|
|
3754
|
-
},
|
|
3755
|
-
// 添加 updated 钩子处理配置变化
|
|
3756
|
-
updated(el, binding) {
|
|
3757
|
-
if (binding.value !== binding.oldValue) {
|
|
3758
|
-
unbindEvents(el);
|
|
3759
|
-
bindEvents(el);
|
|
3760
|
-
}
|
|
3761
|
-
}
|
|
3762
|
-
};
|
|
3763
|
-
};
|
|
3764
|
-
const DEFAULT_DEBOUNCE_WAIT = 50;
|
|
3765
|
-
const createScrollDirective = (options) => {
|
|
3766
|
-
const config = {
|
|
3767
|
-
debounceWait: DEFAULT_DEBOUNCE_WAIT,
|
|
3768
|
-
onMove: () => {
|
|
3769
|
-
},
|
|
3770
|
-
...options
|
|
3771
|
-
};
|
|
3772
|
-
const bindEvents = (el, binding) => {
|
|
3773
|
-
if (el._watchwindow_handlers_) {
|
|
3774
|
-
return;
|
|
3775
|
-
}
|
|
3776
|
-
const moveDom = debounce((e) => {
|
|
3777
|
-
e.preventDefault();
|
|
3778
|
-
config.onMove();
|
|
3779
|
-
}, config.debounceWait);
|
|
3780
|
-
el._watchwindow_handlers_ = {
|
|
3781
|
-
move: moveDom
|
|
3782
|
-
};
|
|
3783
|
-
window.addEventListener("resize", el._watchwindow_handlers_.move);
|
|
3784
|
-
const scrollContainer = typeof config.scrollContainerId === "string" ? document.querySelector(config.scrollContainerId) || window : window;
|
|
3785
|
-
scrollContainer.addEventListener("scroll", el._watchwindow_handlers_.move);
|
|
3786
|
-
};
|
|
3787
|
-
const unbindEvents = (el) => {
|
|
3788
|
-
if (el._watchwindow_handlers_) {
|
|
3789
|
-
window.removeEventListener("resize", el._watchwindow_handlers_.move);
|
|
3790
|
-
const scrollContainer = typeof config.scrollContainerId === "string" ? document.querySelector(config.scrollContainerId) || window : window;
|
|
3791
|
-
scrollContainer.removeEventListener("scroll", el._watchwindow_handlers_.move);
|
|
3792
|
-
delete el._watchwindow_handlers_;
|
|
3793
|
-
}
|
|
3794
|
-
};
|
|
3795
|
-
return {
|
|
3796
|
-
mounted(el, binding) {
|
|
3797
|
-
bindEvents(el);
|
|
3798
|
-
},
|
|
3799
|
-
beforeUnmount(el) {
|
|
3800
|
-
unbindEvents(el);
|
|
3801
|
-
},
|
|
3802
|
-
// 添加 updated 钩子处理配置变化
|
|
3803
|
-
updated(el, binding) {
|
|
3804
|
-
if (binding.value !== binding.oldValue) {
|
|
3805
|
-
unbindEvents(el);
|
|
3806
|
-
bindEvents(el);
|
|
3807
|
-
}
|
|
3808
|
-
}
|
|
3809
|
-
};
|
|
3810
|
-
};
|
|
3811
3842
|
const PLACEMENT_GROUPS = {
|
|
3812
3843
|
top: ["topleft", "topmiddle", "topright"],
|
|
3813
3844
|
bottom: ["bottomleft", "bottommiddle", "bottomright"],
|
|
@@ -5149,7 +5180,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5149
5180
|
exports2.LibTabs = LibTabs;
|
|
5150
5181
|
exports2.LibTabsPane = LibTabsPane;
|
|
5151
5182
|
exports2.LibUpload = LibUpload;
|
|
5183
|
+
exports2.createArrowKeysDirective = createArrowKeysDirective;
|
|
5184
|
+
exports2.createBgClickDirective = createBgClickDirective;
|
|
5185
|
+
exports2.createBgClickeDirective = createBgClickeDirective;
|
|
5186
|
+
exports2.createDraggableDirective = createDraggableDirective;
|
|
5187
|
+
exports2.createEscapeDirective = createEscapeDirective;
|
|
5152
5188
|
exports2.createLoadingDirective = createLoadingDirective;
|
|
5189
|
+
exports2.createScrollDirective = createScrollDirective;
|
|
5190
|
+
exports2.createWheelDirective = createWheelDirective;
|
|
5153
5191
|
exports2.default = index;
|
|
5154
5192
|
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
5155
5193
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, defineAsyncComponent, computed, ref, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, normalizeClass, withKeys, createElementBlock, createCommentVNode, toDisplayString, withDirectives, vShow, TransitionGroup, Fragment, renderList, nextTick } from "vue";
|
|
2
|
-
import { g as getNewArray,
|
|
2
|
+
import { g as getNewArray, e as checkinputDate, f as formatDate } from "../index/index.js";
|
|
3
3
|
import { g as getMonthDays, C as Calendar, A as Arrow, a as addZero } from "../calendar/calendar.js";
|
|
4
4
|
import { A as ArrowPlug } from "../dateArrowplus/dateArrowplus.js";
|
|
5
5
|
const _hoisted_1 = { class: "flex items-center justify-between p-3" };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, defineAsyncComponent, computed, ref, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, normalizeClass, toDisplayString, createTextVNode, createElementBlock, Fragment, renderList, nextTick } from "vue";
|
|
2
|
-
import { f as formatDate, g as getNewArray,
|
|
2
|
+
import { f as formatDate, g as getNewArray, e as checkinputDate } from "../index/index.js";
|
|
3
3
|
import { g as getMonthDays, C as Calendar, A as Arrow, a as addZero } from "../calendar/calendar.js";
|
|
4
4
|
import { A as ArrowPlug } from "../dateArrowplus/dateArrowplus.js";
|
|
5
5
|
const _hoisted_1 = { class: "flex justify-between items-center p-3" };
|