jky-component-lib 0.0.140 → 0.0.142
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/es/amap/AClusterMarker/AClusterMarker.vue.d.ts +55 -0
- package/dist/es/amap/AClusterMarker/AClusterMarker.vue.js +202 -0
- package/dist/es/amap/AClusterMarker/AClusterMarker.vue2.js +4 -0
- package/dist/es/amap/AClusterMarker/index.d.ts +4 -0
- package/dist/es/amap/AClusterMarker/index.js +7 -0
- package/dist/es/amap/AMap.vue.d.ts +2 -2
- package/dist/es/amap/AMap.vue.js +3 -1
- package/dist/es/amap/AMapPicker/AMapPicker.vue.js +1 -1
- package/dist/es/amap/AMarker.vue.d.ts +1 -1
- package/dist/es/amap/index.d.ts +5 -1
- package/dist/es/amap/index.js +4 -0
- package/dist/es/amap/style.css +6 -2
- package/dist/es/amap/style3.css +2 -6
- package/dist/es/code-mirror-editor/CodeMirrorEditor.vue.d.ts +0 -1
- package/dist/es/code-mirror-editor/CodeMirrorEditor.vue.js +5 -7
- package/dist/es/code-mirror-editor/style.css +0 -38
- package/dist/es/components.d.ts +1 -0
- package/dist/es/components.js +6 -2
- package/dist/es/draggable/Draggable.vue.d.ts +78 -0
- package/dist/es/draggable/Draggable.vue.js +130 -0
- package/dist/es/draggable/Draggable.vue3.js +5 -0
- package/dist/es/draggable/index.d.ts +4 -0
- package/dist/es/draggable/index.js +8 -0
- package/dist/es/draggable/style.css +16 -0
- package/dist/es/form/items/SelectTableItem.vue.d.ts +6 -0
- package/dist/es/index.js +6 -1
- package/dist/es/package.json.js +1 -1
- package/dist/es/page-table/ActionColumn.vue.js +4 -3
- package/dist/es/page-table/PageTable.vue.js +6 -1
- package/dist/es/style.css +195 -0
- package/dist/es/styles.css +1 -1
- package/dist/lib/amap/AClusterMarker/AClusterMarker.vue.d.ts +55 -0
- package/dist/lib/amap/AClusterMarker/AClusterMarker.vue.js +202 -0
- package/dist/lib/amap/AClusterMarker/AClusterMarker.vue2.js +4 -0
- package/dist/lib/amap/AClusterMarker/index.d.ts +4 -0
- package/dist/lib/amap/AClusterMarker/index.js +7 -0
- package/dist/lib/amap/AMap.vue.d.ts +2 -2
- package/dist/lib/amap/AMap.vue.js +3 -1
- package/dist/lib/amap/AMapPicker/AMapPicker.vue.js +1 -1
- package/dist/lib/amap/AMarker.vue.d.ts +1 -1
- package/dist/lib/amap/index.d.ts +5 -1
- package/dist/lib/amap/index.js +4 -0
- package/dist/lib/amap/style.css +6 -2
- package/dist/lib/amap/style3.css +2 -6
- package/dist/lib/code-mirror-editor/CodeMirrorEditor.vue.d.ts +0 -1
- package/dist/lib/code-mirror-editor/CodeMirrorEditor.vue.js +4 -6
- package/dist/lib/code-mirror-editor/style.css +0 -38
- package/dist/lib/components.d.ts +1 -0
- package/dist/lib/components.js +59 -55
- package/dist/lib/draggable/Draggable.vue.d.ts +78 -0
- package/dist/lib/draggable/Draggable.vue.js +130 -0
- package/dist/lib/draggable/Draggable.vue3.js +5 -0
- package/dist/lib/draggable/index.d.ts +4 -0
- package/dist/lib/draggable/index.js +8 -0
- package/dist/lib/draggable/style.css +16 -0
- package/dist/lib/form/items/SelectTableItem.vue.d.ts +6 -0
- package/dist/lib/index.js +42 -37
- package/dist/lib/package.json.js +1 -1
- package/dist/lib/page-table/ActionColumn.vue.js +4 -3
- package/dist/lib/page-table/PageTable.vue.js +6 -1
- package/dist/lib/style.css +195 -0
- package/dist/lib/styles.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, ref, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, renderSlot } from "vue";
|
|
21
|
+
import { useDraggable } from "@vueuse/core";
|
|
22
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
23
|
+
name: "JkyDraggable"
|
|
24
|
+
}), {
|
|
25
|
+
__name: "Draggable",
|
|
26
|
+
props: {
|
|
27
|
+
disabled: { type: Boolean, default: false },
|
|
28
|
+
initialValue: { default: () => ({ x: 100, y: 100 }) },
|
|
29
|
+
storageKey: { default: "jky-draggable-position" },
|
|
30
|
+
persistPosition: { type: Boolean, default: true },
|
|
31
|
+
boundToViewport: { type: Boolean, default: true },
|
|
32
|
+
viewportMargin: { default: 0 }
|
|
33
|
+
},
|
|
34
|
+
emits: ["start", "move", "end", "change", "click"],
|
|
35
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
36
|
+
const props = __props;
|
|
37
|
+
const emit = __emit;
|
|
38
|
+
const dragRef = ref(null);
|
|
39
|
+
const startPosition = ref(null);
|
|
40
|
+
function getInitialPosition() {
|
|
41
|
+
if (!props.persistPosition) {
|
|
42
|
+
return props.initialValue || { x: 100, y: 100 };
|
|
43
|
+
}
|
|
44
|
+
const saved = localStorage.getItem(props.storageKey);
|
|
45
|
+
if (saved) {
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(saved);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return props.initialValue || { x: 100, y: 100 };
|
|
52
|
+
}
|
|
53
|
+
function savePosition(x2, y2) {
|
|
54
|
+
if (!props.persistPosition)
|
|
55
|
+
return;
|
|
56
|
+
localStorage.setItem(props.storageKey, JSON.stringify({ x: x2, y: y2 }));
|
|
57
|
+
}
|
|
58
|
+
const { x, y, style, isDragging } = useDraggable(dragRef, {
|
|
59
|
+
initialValue: getInitialPosition(),
|
|
60
|
+
disabled: props.disabled,
|
|
61
|
+
preventDefault: true,
|
|
62
|
+
// stopPropagation: true,
|
|
63
|
+
onStart: () => {
|
|
64
|
+
startPosition.value = { x: x.value, y: y.value };
|
|
65
|
+
emit("start", { x: x.value, y: y.value });
|
|
66
|
+
},
|
|
67
|
+
onMove: () => {
|
|
68
|
+
emit("move", { x: x.value, y: y.value });
|
|
69
|
+
},
|
|
70
|
+
onEnd: (position) => {
|
|
71
|
+
savePosition(x.value, y.value);
|
|
72
|
+
emit("end", { x: x.value, y: y.value });
|
|
73
|
+
if (startPosition.value) {
|
|
74
|
+
const dx = Math.abs(position.x - startPosition.value.x);
|
|
75
|
+
const dy = Math.abs(position.y - startPosition.value.y);
|
|
76
|
+
if (dx < 3 && dy < 3) {
|
|
77
|
+
emit("click", new MouseEvent("click"));
|
|
78
|
+
}
|
|
79
|
+
startPosition.value = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
watch([x, y], ([newX, newY]) => {
|
|
84
|
+
emit("change", { x: newX, y: newY });
|
|
85
|
+
if (isDragging.value) {
|
|
86
|
+
savePosition(newX, newY);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
watch([x, y], ([newX, newY]) => {
|
|
90
|
+
if (!props.boundToViewport || !dragRef.value)
|
|
91
|
+
return;
|
|
92
|
+
const maxX = window.innerWidth - dragRef.value.offsetWidth - props.viewportMargin;
|
|
93
|
+
const maxY = window.innerHeight - dragRef.value.offsetHeight - props.viewportMargin;
|
|
94
|
+
const clampedX = Math.max(props.viewportMargin, Math.min(newX, maxX));
|
|
95
|
+
const clampedY = Math.max(props.viewportMargin, Math.min(newY, maxY));
|
|
96
|
+
if (clampedX !== newX || clampedY !== newY) {
|
|
97
|
+
x.value = clampedX;
|
|
98
|
+
y.value = clampedY;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
__expose({
|
|
102
|
+
/** 手动保存位置 */
|
|
103
|
+
savePosition: () => savePosition(x.value, y.value),
|
|
104
|
+
/** 重置位置到初始值 */
|
|
105
|
+
resetPosition: () => {
|
|
106
|
+
const initial = props.initialValue || { x: 100, y: 100 };
|
|
107
|
+
x.value = initial.x;
|
|
108
|
+
y.value = initial.y;
|
|
109
|
+
savePosition(initial.x, initial.y);
|
|
110
|
+
},
|
|
111
|
+
/** 获取当前位置 */
|
|
112
|
+
getPosition: () => ({ x: x.value, y: y.value }),
|
|
113
|
+
/** 是否正在拖拽 */
|
|
114
|
+
isDragging: () => isDragging.value
|
|
115
|
+
});
|
|
116
|
+
return (_ctx, _cache) => {
|
|
117
|
+
return openBlock(), createElementBlock("div", {
|
|
118
|
+
ref_key: "dragRef",
|
|
119
|
+
ref: dragRef,
|
|
120
|
+
class: normalizeClass(["jky-draggable fixed z-9999 cursor-move select-none", { "jky-draggable--dragging": unref(isDragging) }]),
|
|
121
|
+
style: normalizeStyle(unref(style))
|
|
122
|
+
}, [
|
|
123
|
+
renderSlot(_ctx.$slots, "default")
|
|
124
|
+
], 6);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}));
|
|
128
|
+
export {
|
|
129
|
+
_sfc_main as default
|
|
130
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/* 禁止使用 @apply,所有 TailwindCSS 工具类直接写在 class 中 */
|
|
3
|
+
/* 样式文件仅用于定义组件特定的自定义纯 CSS 样式 */
|
|
4
|
+
/* 禁止使用 @apply,所有 TailwindCSS 工具类直接写在 class 中 */
|
|
5
|
+
/* 样式文件仅用于定义组件特定的自定义纯 CSS 样式 */
|
|
6
|
+
:root {
|
|
7
|
+
--jky-draggable-z-index: 9999;
|
|
8
|
+
}
|
|
9
|
+
.jky-draggable {
|
|
10
|
+
user-select: none;
|
|
11
|
+
-webkit-user-select: none;
|
|
12
|
+
touch-action: none;
|
|
13
|
+
}
|
|
14
|
+
.jky-draggable--dragging {
|
|
15
|
+
cursor: grabbing;
|
|
16
|
+
}
|
|
@@ -18,6 +18,9 @@ declare function __VLS_template(): {
|
|
|
18
18
|
readonly pageSize?: number | undefined;
|
|
19
19
|
readonly total?: number | undefined;
|
|
20
20
|
readonly withCard?: boolean | undefined;
|
|
21
|
+
readonly config?: {
|
|
22
|
+
withCard?: boolean;
|
|
23
|
+
} | undefined;
|
|
21
24
|
readonly title?: string | undefined;
|
|
22
25
|
readonly filterItems?: import('../../page-table').FilterItemConfig[] | undefined;
|
|
23
26
|
readonly form?: Record<string, any> | undefined;
|
|
@@ -3014,6 +3017,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
3014
3017
|
readonly pageSize?: number | undefined;
|
|
3015
3018
|
readonly total?: number | undefined;
|
|
3016
3019
|
readonly withCard?: boolean | undefined;
|
|
3020
|
+
readonly config?: {
|
|
3021
|
+
withCard?: boolean;
|
|
3022
|
+
} | undefined;
|
|
3017
3023
|
readonly title?: string | undefined;
|
|
3018
3024
|
readonly filterItems?: import('../../page-table').FilterItemConfig[] | undefined;
|
|
3019
3025
|
readonly form?: Record<string, any> | undefined;
|
package/dist/es/index.js
CHANGED
|
@@ -2,18 +2,20 @@ import { components } from "./components.js";
|
|
|
2
2
|
import { createInstaller } from "./utils/installer.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { JkyComponentLibResolver } from "./resolver.js";
|
|
5
|
+
import { JkyAClusterMarker } from "./amap/AClusterMarker/index.js";
|
|
5
6
|
import { default as default2 } from "./amap/AMapPicker/AMapPicker.vue.js";
|
|
6
7
|
import { default as default3 } from "./amap/AMarker.vue.js";
|
|
7
8
|
/* empty css */
|
|
8
9
|
import { default as default4 } from "./amap/ATrackPlayback.vue.js";
|
|
9
10
|
/* empty css */
|
|
10
|
-
import { JkyAMap, JkyAMapPicker, JkyAMarker, JkyATrackPlayback } from "./amap/index.js";
|
|
11
|
+
import { JkyAClusterMarker as JkyAClusterMarker2, JkyAMap, JkyAMapPicker, JkyAMarker, JkyATrackPlayback } from "./amap/index.js";
|
|
11
12
|
import { JkyAMapPickerItem, JkyForm, JkyFormItem } from "./form/index.js";
|
|
12
13
|
import { JkyActionColumn, JkyPageTable, JkyPageTableColumn } from "./page-table/index.js";
|
|
13
14
|
import { JkyAddInput } from "./add-input/index.js";
|
|
14
15
|
import { JkyButton } from "./button/index.js";
|
|
15
16
|
import { JkyButtonNav } from "./button-nav/index.js";
|
|
16
17
|
import { JkyCodeMirrorEditor } from "./code-mirror-editor/index.js";
|
|
18
|
+
import { JkyDraggable } from "./draggable/index.js";
|
|
17
19
|
import { JkyMenu } from "./menu/index.js";
|
|
18
20
|
import { JkyModal } from "./modal/index.js";
|
|
19
21
|
import { JkyPageHeader } from "./page-header/index.js";
|
|
@@ -28,9 +30,11 @@ const installer = createInstaller(components);
|
|
|
28
30
|
const install = installer.install;
|
|
29
31
|
const version = installer.version;
|
|
30
32
|
export {
|
|
33
|
+
JkyAClusterMarker as AClusterMarker,
|
|
31
34
|
default2 as AMapPicker,
|
|
32
35
|
default3 as AMarker,
|
|
33
36
|
default4 as ATrackPlayback,
|
|
37
|
+
JkyAClusterMarker2 as JkyAClusterMarker,
|
|
34
38
|
JkyAMap,
|
|
35
39
|
JkyAMapPicker,
|
|
36
40
|
JkyAMapPickerItem,
|
|
@@ -42,6 +46,7 @@ export {
|
|
|
42
46
|
JkyButtonNav,
|
|
43
47
|
JkyCodeMirrorEditor,
|
|
44
48
|
JkyComponentLibResolver,
|
|
49
|
+
JkyDraggable,
|
|
45
50
|
JkyForm,
|
|
46
51
|
JkyFormItem,
|
|
47
52
|
JkyMenu,
|
package/dist/es/package.json.js
CHANGED
|
@@ -39,7 +39,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
39
39
|
fixed: "right",
|
|
40
40
|
buttonLimit: 3,
|
|
41
41
|
moreButtonText: "更多",
|
|
42
|
-
buttons: []
|
|
42
|
+
buttons: [],
|
|
43
|
+
trigger: "hover"
|
|
43
44
|
}, props.config));
|
|
44
45
|
function isButtonVisible(button) {
|
|
45
46
|
if (button.hidden === void 0)
|
|
@@ -98,7 +99,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
98
99
|
}), 128)),
|
|
99
100
|
collapsedButtons.value.length > 0 ? (openBlock(), createBlock(unref(ElDropdown), {
|
|
100
101
|
key: 0,
|
|
101
|
-
trigger:
|
|
102
|
+
trigger: mergedConfig.value.trigger
|
|
102
103
|
}, {
|
|
103
104
|
dropdown: withCtx(() => [
|
|
104
105
|
createVNode(unref(ElDropdownMenu), null, {
|
|
@@ -133,7 +134,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
133
134
|
})
|
|
134
135
|
]),
|
|
135
136
|
_: 1
|
|
136
|
-
})) : createCommentVNode("", true)
|
|
137
|
+
}, 8, ["trigger"])) : createCommentVNode("", true)
|
|
137
138
|
]);
|
|
138
139
|
};
|
|
139
140
|
}
|
|
@@ -53,6 +53,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
53
53
|
__name: "PageTable",
|
|
54
54
|
props: /* @__PURE__ */ mergeModels({
|
|
55
55
|
withCard: { type: Boolean, default: true },
|
|
56
|
+
config: {},
|
|
56
57
|
title: { default: "" },
|
|
57
58
|
filterItems: { default: () => [] },
|
|
58
59
|
form: {},
|
|
@@ -156,6 +157,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
const sortValue = ref("desc");
|
|
160
|
+
const withCard = computed(() => {
|
|
161
|
+
var _a, _b, _c;
|
|
162
|
+
return (_c = (_b = props.withCard) != null ? _b : (_a = props.config) == null ? void 0 : _a.withCard) != null ? _c : true;
|
|
163
|
+
});
|
|
159
164
|
const defaultRightButtons = computed(() => {
|
|
160
165
|
const sortButton = {
|
|
161
166
|
label: "排序",
|
|
@@ -413,7 +418,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
413
418
|
]),
|
|
414
419
|
_: 1
|
|
415
420
|
})) : createCommentVNode("", true),
|
|
416
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
421
|
+
(openBlock(), createBlock(resolveDynamicComponent(withCard.value ? unref(ElCard) : "div"), { class: "flex-1 min-h-0 jky-page-table__table-card" }, {
|
|
417
422
|
default: withCtx(() => {
|
|
418
423
|
var _a2, _b2, _c2, _d, _e, _f, _g;
|
|
419
424
|
return [
|