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,55 @@
|
|
|
1
|
+
import { AClusterMarkerProps, ClusterPoint } from './types';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
AMap: any;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
type __VLS_Props = AClusterMarkerProps;
|
|
8
|
+
declare function updatePoints(newPoints: ClusterPoint[]): void;
|
|
9
|
+
declare function clearClusters(): void;
|
|
10
|
+
declare function destroy(): void;
|
|
11
|
+
type __VLS_PublicProps = {
|
|
12
|
+
modelValue?: ClusterPoint[];
|
|
13
|
+
} & __VLS_Props;
|
|
14
|
+
declare function __VLS_template(): {
|
|
15
|
+
attrs: Partial<{}>;
|
|
16
|
+
slots: {
|
|
17
|
+
default?(_: {}): any;
|
|
18
|
+
};
|
|
19
|
+
refs: {};
|
|
20
|
+
rootEl: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
24
|
+
updatePoints: typeof updatePoints;
|
|
25
|
+
clearClusters: typeof clearClusters;
|
|
26
|
+
destroy: typeof destroy;
|
|
27
|
+
getClusterInstance: () => any;
|
|
28
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
29
|
+
"update:modelValue": (value: ClusterPoint[]) => any;
|
|
30
|
+
} & {
|
|
31
|
+
click: (cluster: any) => any;
|
|
32
|
+
mouseout: (cluster: any) => any;
|
|
33
|
+
mouseover: (cluster: any) => any;
|
|
34
|
+
ready: (cluster: any) => any;
|
|
35
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
"onUpdate:modelValue"?: ((value: ClusterPoint[]) => any) | undefined;
|
|
37
|
+
onClick?: ((cluster: any) => any) | undefined;
|
|
38
|
+
onMouseout?: ((cluster: any) => any) | undefined;
|
|
39
|
+
onMouseover?: ((cluster: any) => any) | undefined;
|
|
40
|
+
onReady?: ((cluster: any) => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
gridSize: number;
|
|
43
|
+
visible: boolean;
|
|
44
|
+
zoomOnClick: boolean;
|
|
45
|
+
minClusterSize: number;
|
|
46
|
+
averageCenter: boolean;
|
|
47
|
+
enable: boolean;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
52
|
+
new (): {
|
|
53
|
+
$slots: S;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,202 @@
|
|
|
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, useModel, watch, onUnmounted, renderSlot, mergeModels } from "vue";
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
22
|
+
name: "JkyAClusterMarker",
|
|
23
|
+
inheritAttrs: false
|
|
24
|
+
}), {
|
|
25
|
+
__name: "AClusterMarker",
|
|
26
|
+
props: /* @__PURE__ */ mergeModels({
|
|
27
|
+
map: {},
|
|
28
|
+
points: {},
|
|
29
|
+
gridSize: { default: 60 },
|
|
30
|
+
styles: {},
|
|
31
|
+
visible: { type: Boolean, default: true },
|
|
32
|
+
zoomOnClick: { type: Boolean, default: true },
|
|
33
|
+
minClusterSize: { default: 2 },
|
|
34
|
+
maxZoom: {},
|
|
35
|
+
averageCenter: { type: Boolean, default: false },
|
|
36
|
+
renderClusterMarker: {},
|
|
37
|
+
renderMarker: {},
|
|
38
|
+
enable: { type: Boolean, default: true }
|
|
39
|
+
}, {
|
|
40
|
+
"modelValue": { default: () => [] },
|
|
41
|
+
"modelModifiers": {}
|
|
42
|
+
}),
|
|
43
|
+
emits: /* @__PURE__ */ mergeModels(["click", "mouseover", "mouseout", "ready"], ["update:modelValue"]),
|
|
44
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
45
|
+
const props = __props;
|
|
46
|
+
const emit = __emit;
|
|
47
|
+
const modelValue = useModel(__props, "modelValue");
|
|
48
|
+
let clusterInstance = null;
|
|
49
|
+
let mapInstance = null;
|
|
50
|
+
function initCluster(map) {
|
|
51
|
+
if (!map || !window.AMap)
|
|
52
|
+
return;
|
|
53
|
+
mapInstance = map;
|
|
54
|
+
if (!window.AMap.MarkerCluster) {
|
|
55
|
+
console.warn("AMap.MarkerCluster 插件未加载,请先加载插件");
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (clusterInstance) {
|
|
59
|
+
clusterInstance.setMap(null);
|
|
60
|
+
clusterInstance = null;
|
|
61
|
+
}
|
|
62
|
+
const points = preparePoints();
|
|
63
|
+
const clusterOptions = {
|
|
64
|
+
gridSize: props.gridSize,
|
|
65
|
+
zoomOnClick: props.zoomOnClick,
|
|
66
|
+
minClusterSize: props.minClusterSize,
|
|
67
|
+
averageCenter: props.averageCenter
|
|
68
|
+
};
|
|
69
|
+
if (props.styles && props.styles.length > 0) {
|
|
70
|
+
clusterOptions.styles = props.styles.map((style) => ({
|
|
71
|
+
url: style.url,
|
|
72
|
+
size: style.size ? new window.AMap.Size(style.size[0], style.size[1]) : void 0,
|
|
73
|
+
offset: style.offset ? new window.AMap.Pixel(style.offset[0], style.offset[1]) : void 0,
|
|
74
|
+
textColor: style.textColor,
|
|
75
|
+
textSize: style.textSize
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
if (props.renderClusterMarker) {
|
|
79
|
+
clusterOptions.renderClusterMarker = props.renderClusterMarker;
|
|
80
|
+
}
|
|
81
|
+
if (props.renderMarker) {
|
|
82
|
+
clusterOptions.renderMarker = props.renderMarker;
|
|
83
|
+
}
|
|
84
|
+
clusterInstance = new window.AMap.MarkerCluster(map, points, clusterOptions);
|
|
85
|
+
clusterInstance.on("click", (cluster) => {
|
|
86
|
+
emit("click", cluster);
|
|
87
|
+
});
|
|
88
|
+
clusterInstance.on("mouseover", (cluster) => {
|
|
89
|
+
emit("mouseover", cluster);
|
|
90
|
+
});
|
|
91
|
+
clusterInstance.on("mouseout", (cluster) => {
|
|
92
|
+
emit("mouseout", cluster);
|
|
93
|
+
});
|
|
94
|
+
emit("ready", clusterInstance);
|
|
95
|
+
}
|
|
96
|
+
function preparePoints() {
|
|
97
|
+
const points = props.points || modelValue.value || [];
|
|
98
|
+
return points.map((point) => __spreadValues({
|
|
99
|
+
lnglat: point.lnglat,
|
|
100
|
+
title: point.title,
|
|
101
|
+
content: point.content
|
|
102
|
+
}, point.data));
|
|
103
|
+
}
|
|
104
|
+
function updatePoints(newPoints) {
|
|
105
|
+
if (!clusterInstance)
|
|
106
|
+
return;
|
|
107
|
+
clusterInstance.setMap(null);
|
|
108
|
+
const points = newPoints.map((point) => __spreadValues({
|
|
109
|
+
lnglat: point.lnglat,
|
|
110
|
+
title: point.title,
|
|
111
|
+
content: point.content
|
|
112
|
+
}, point.data));
|
|
113
|
+
clusterInstance.addMarkers(points);
|
|
114
|
+
}
|
|
115
|
+
function clearClusters() {
|
|
116
|
+
if (clusterInstance) {
|
|
117
|
+
clusterInstance.setMap(null);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function destroy() {
|
|
121
|
+
if (clusterInstance) {
|
|
122
|
+
clusterInstance.setMap(null);
|
|
123
|
+
clusterInstance = null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
__expose({
|
|
127
|
+
updatePoints,
|
|
128
|
+
clearClusters,
|
|
129
|
+
destroy,
|
|
130
|
+
getClusterInstance: () => clusterInstance
|
|
131
|
+
});
|
|
132
|
+
watch(
|
|
133
|
+
() => props.map,
|
|
134
|
+
(newMap) => {
|
|
135
|
+
if (newMap && props.enable) {
|
|
136
|
+
initCluster(newMap);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{ immediate: true }
|
|
140
|
+
);
|
|
141
|
+
watch(
|
|
142
|
+
() => props.points,
|
|
143
|
+
(newPoints) => {
|
|
144
|
+
if (clusterInstance && newPoints) {
|
|
145
|
+
updatePoints(newPoints);
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{ deep: true }
|
|
149
|
+
);
|
|
150
|
+
watch(
|
|
151
|
+
() => modelValue.value,
|
|
152
|
+
(newValue) => {
|
|
153
|
+
if (clusterInstance && newValue) {
|
|
154
|
+
updatePoints(newValue);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{ deep: true }
|
|
158
|
+
);
|
|
159
|
+
watch(
|
|
160
|
+
() => props.gridSize,
|
|
161
|
+
() => {
|
|
162
|
+
if (mapInstance && props.enable) {
|
|
163
|
+
initCluster(mapInstance);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
watch(
|
|
168
|
+
() => props.styles,
|
|
169
|
+
() => {
|
|
170
|
+
if (mapInstance && props.enable) {
|
|
171
|
+
initCluster(mapInstance);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{ deep: true }
|
|
175
|
+
);
|
|
176
|
+
watch(
|
|
177
|
+
() => props.renderClusterMarker,
|
|
178
|
+
() => {
|
|
179
|
+
if (mapInstance && props.enable) {
|
|
180
|
+
initCluster(mapInstance);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
watch(
|
|
185
|
+
() => props.renderMarker,
|
|
186
|
+
() => {
|
|
187
|
+
if (mapInstance && props.enable) {
|
|
188
|
+
initCluster(mapInstance);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
onUnmounted(() => {
|
|
193
|
+
destroy();
|
|
194
|
+
});
|
|
195
|
+
return (_ctx, _cache) => {
|
|
196
|
+
return renderSlot(_ctx.$slots, "default");
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}));
|
|
200
|
+
export {
|
|
201
|
+
_sfc_main as default
|
|
202
|
+
};
|
|
@@ -16,20 +16,20 @@ declare const __VLS_component: import('vue').DefineComponent<AMapProps, {
|
|
|
16
16
|
removeMarker: (marker: any) => void;
|
|
17
17
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
18
|
click: (data: any) => any;
|
|
19
|
+
ready: (map: any) => any;
|
|
19
20
|
moveend: (center: {
|
|
20
21
|
lng: number;
|
|
21
22
|
lat: number;
|
|
22
23
|
}) => any;
|
|
23
24
|
zoomend: (zoom: number) => any;
|
|
24
|
-
ready: (map: any) => any;
|
|
25
25
|
}, string, import('vue').PublicProps, Readonly<AMapProps> & Readonly<{
|
|
26
26
|
onClick?: ((data: any) => any) | undefined;
|
|
27
|
+
onReady?: ((map: any) => any) | undefined;
|
|
27
28
|
onMoveend?: ((center: {
|
|
28
29
|
lng: number;
|
|
29
30
|
lat: number;
|
|
30
31
|
}) => any) | undefined;
|
|
31
32
|
onZoomend?: ((zoom: number) => any) | undefined;
|
|
32
|
-
onReady?: ((map: any) => any) | undefined;
|
|
33
33
|
}>, {
|
|
34
34
|
width: string;
|
|
35
35
|
height: string;
|
package/dist/es/amap/AMap.vue.js
CHANGED
|
@@ -78,7 +78,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
78
78
|
const isMapLoaded = ref(false);
|
|
79
79
|
const controls = ref({});
|
|
80
80
|
const getMapUrl = computed(() => {
|
|
81
|
-
const plugins = [
|
|
81
|
+
const plugins = [
|
|
82
|
+
"AMap.MarkerCluster"
|
|
83
|
+
];
|
|
82
84
|
if (props.showScale)
|
|
83
85
|
plugins.push("AMap.Scale");
|
|
84
86
|
if (props.showHawkEye)
|
|
@@ -108,7 +108,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
108
108
|
token: __props.token,
|
|
109
109
|
zoom: __props.zoom,
|
|
110
110
|
center: __props.center,
|
|
111
|
-
|
|
111
|
+
class: "w-full h-80",
|
|
112
112
|
onClick: handleMapClick
|
|
113
113
|
}, {
|
|
114
114
|
default: withCtx(() => {
|
|
@@ -25,8 +25,8 @@ declare const __VLS_component: import('vue').DefineComponent<AMapMarkerProps, {
|
|
|
25
25
|
onMouseout?: ((marker: any, data: MarkerData) => any) | undefined;
|
|
26
26
|
onMouseover?: ((marker: any, data: MarkerData) => any) | undefined;
|
|
27
27
|
}>, {
|
|
28
|
-
draggable: boolean;
|
|
29
28
|
visible: boolean;
|
|
29
|
+
draggable: boolean;
|
|
30
30
|
updateMode: "incremental" | "full";
|
|
31
31
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
32
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
package/dist/es/amap/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils';
|
|
2
|
+
import { default as AClusterMarker } from './AClusterMarker';
|
|
2
3
|
import { default as AMap } from './AMap.vue';
|
|
3
4
|
import { default as AMapPicker } from './AMapPicker/AMapPicker.vue';
|
|
4
5
|
import { default as AMarker } from './AMarker.vue';
|
|
5
6
|
import { default as ATrackPlayback } from './ATrackPlayback.vue';
|
|
7
|
+
export type * from './AClusterMarker/types';
|
|
8
|
+
export type * from './types';
|
|
6
9
|
export declare const JkyAMap: InstallWithSFC<typeof AMap>;
|
|
7
10
|
export declare const JkyAMapPicker: InstallWithSFC<typeof AMapPicker>;
|
|
11
|
+
export declare const JkyAClusterMarker: InstallWithSFC<typeof AClusterMarker>;
|
|
8
12
|
export declare const JkyAMarker: InstallWithSFC<typeof AMarker>;
|
|
9
13
|
export declare const JkyATrackPlayback: InstallWithSFC<typeof ATrackPlayback>;
|
|
10
14
|
export default JkyAMap;
|
|
11
|
-
export { AMapPicker, AMarker, ATrackPlayback };
|
|
15
|
+
export { AClusterMarker, AMapPicker, AMarker, ATrackPlayback };
|
package/dist/es/amap/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JkyAClusterMarker as JkyAClusterMarker$1 } from "./AClusterMarker/index.js";
|
|
1
2
|
import _sfc_main from "./AMap.vue.js";
|
|
2
3
|
/* empty css */
|
|
3
4
|
import _sfc_main$1 from "./AMapPicker/AMapPicker.vue.js";
|
|
@@ -8,12 +9,15 @@ import _sfc_main$3 from "./ATrackPlayback.vue.js";
|
|
|
8
9
|
import { installWithSFC } from "../utils/with-install.js";
|
|
9
10
|
const JkyAMap = installWithSFC(_sfc_main);
|
|
10
11
|
const JkyAMapPicker = installWithSFC(_sfc_main$1);
|
|
12
|
+
const JkyAClusterMarker = installWithSFC(JkyAClusterMarker$1);
|
|
11
13
|
const JkyAMarker = installWithSFC(_sfc_main$2);
|
|
12
14
|
const JkyATrackPlayback = installWithSFC(_sfc_main$3);
|
|
13
15
|
export {
|
|
16
|
+
JkyAClusterMarker$1 as AClusterMarker,
|
|
14
17
|
_sfc_main$1 as AMapPicker,
|
|
15
18
|
_sfc_main$2 as AMarker,
|
|
16
19
|
_sfc_main$3 as ATrackPlayback,
|
|
20
|
+
JkyAClusterMarker,
|
|
17
21
|
JkyAMap,
|
|
18
22
|
JkyAMapPicker,
|
|
19
23
|
JkyAMarker,
|
package/dist/es/amap/style.css
CHANGED
package/dist/es/amap/style3.css
CHANGED
|
@@ -11,7 +11,6 @@ declare const _default: import('vue').DefineComponent<CodeMirrorEditorProps, {
|
|
|
11
11
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
12
12
|
onChange?: ((value: string) => any) | undefined;
|
|
13
13
|
}>, {
|
|
14
|
-
height: string;
|
|
15
14
|
modelValue: string;
|
|
16
15
|
disabled: boolean;
|
|
17
16
|
readonly: boolean;
|
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock,
|
|
20
|
+
import { defineComponent, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock, createElementVNode } from "vue";
|
|
21
21
|
import { css } from "@codemirror/lang-css";
|
|
22
22
|
import { html } from "@codemirror/lang-html";
|
|
23
23
|
import { javascript } from "@codemirror/lang-javascript";
|
|
@@ -28,13 +28,14 @@ import { EditorState } from "@codemirror/state";
|
|
|
28
28
|
import { oneDark } from "@codemirror/theme-one-dark";
|
|
29
29
|
import { EditorView, lineNumbers } from "@codemirror/view";
|
|
30
30
|
import { basicSetup } from "codemirror";
|
|
31
|
+
const _hoisted_1 = { class: "j-code-mirror-editor min-h-0 min-w-full" };
|
|
31
32
|
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
32
33
|
name: "JkyCodeMirrorEditor"
|
|
33
34
|
}), {
|
|
34
35
|
__name: "CodeMirrorEditor",
|
|
35
36
|
props: {
|
|
36
37
|
modelValue: { default: "" },
|
|
37
|
-
height: {
|
|
38
|
+
height: {},
|
|
38
39
|
disabled: { type: Boolean, default: false },
|
|
39
40
|
readonly: { type: Boolean, default: false },
|
|
40
41
|
language: { default: "javascript" },
|
|
@@ -169,16 +170,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
169
170
|
}
|
|
170
171
|
});
|
|
171
172
|
return (_ctx, _cache) => {
|
|
172
|
-
return openBlock(), createElementBlock("div",
|
|
173
|
-
class: "j-code-mirror-editor",
|
|
174
|
-
style: normalizeStyle({ height: __props.height })
|
|
175
|
-
}, [
|
|
173
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
176
174
|
createElementVNode("div", {
|
|
177
175
|
ref_key: "editorRef",
|
|
178
176
|
ref: editorRef,
|
|
179
177
|
class: "code-mirror-container"
|
|
180
178
|
}, null, 512)
|
|
181
|
-
]
|
|
179
|
+
]);
|
|
182
180
|
};
|
|
183
181
|
}
|
|
184
182
|
}));
|
|
@@ -4,41 +4,3 @@
|
|
|
4
4
|
--j-code-mirror-border-radius: 4px;
|
|
5
5
|
--j-code-mirror-height: 400px;
|
|
6
6
|
}
|
|
7
|
-
.j-code-mirror-editor {
|
|
8
|
-
width: 100%;
|
|
9
|
-
height: var(--j-code-mirror-height);
|
|
10
|
-
/* border: 1px solid var(--j-code-mirror-border-color); */
|
|
11
|
-
border-radius: var(--j-code-mirror-border-radius);
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
}
|
|
14
|
-
.code-mirror-container {
|
|
15
|
-
height: 100%;
|
|
16
|
-
width: 100%;
|
|
17
|
-
overflow: auto;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* CodeMirror 基础样式覆盖 */
|
|
21
|
-
.code-mirror-container .cm-editor {
|
|
22
|
-
height: 100%;
|
|
23
|
-
}
|
|
24
|
-
.code-mirror-container .cm-scroller {
|
|
25
|
-
overflow: auto;
|
|
26
|
-
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
line-height: 1.5;
|
|
29
|
-
}
|
|
30
|
-
.code-mirror-container .cm-gutters {
|
|
31
|
-
background-color: #2c2d2d;
|
|
32
|
-
border-color: #4c4d4f;
|
|
33
|
-
color: #909399;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* 暗黑模式支持 */
|
|
37
|
-
html.dark .j-code-mirror-editor {
|
|
38
|
-
/* border-color: #4c4d4f; */
|
|
39
|
-
}
|
|
40
|
-
html.dark .code-mirror-container .cm-gutters {
|
|
41
|
-
/* background-color: #2c2d2d;
|
|
42
|
-
border-color: #4c4d4f;
|
|
43
|
-
color: #909399; */
|
|
44
|
-
}
|
package/dist/es/components.d.ts
CHANGED
package/dist/es/components.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { JkyAddInput } from "./add-input/index.js";
|
|
2
2
|
import { JkyAMap, JkyAMapPicker } from "./amap/index.js";
|
|
3
|
-
import { JkyAMarker, JkyATrackPlayback } from "./amap/index.js";
|
|
3
|
+
import { JkyAClusterMarker, JkyAMarker, JkyATrackPlayback } from "./amap/index.js";
|
|
4
4
|
import { JkyButton } from "./button/index.js";
|
|
5
5
|
import { JkyButtonNav } from "./button-nav/index.js";
|
|
6
6
|
import { JkyCodeMirrorEditor } from "./code-mirror-editor/index.js";
|
|
7
|
+
import { JkyDraggable } from "./draggable/index.js";
|
|
7
8
|
import { JkyForm, JkyFormItem, JkyAMapPickerItem } from "./form/index.js";
|
|
8
9
|
import { JkyMenu } from "./menu/index.js";
|
|
9
10
|
import { JkyModal } from "./modal/index.js";
|
|
@@ -33,9 +34,11 @@ const components = [
|
|
|
33
34
|
JkyTabs,
|
|
34
35
|
JkyModal,
|
|
35
36
|
JkyAMap,
|
|
36
|
-
JkyAMapPicker
|
|
37
|
+
JkyAMapPicker,
|
|
38
|
+
JkyDraggable
|
|
37
39
|
];
|
|
38
40
|
export {
|
|
41
|
+
JkyAClusterMarker,
|
|
39
42
|
JkyAMap,
|
|
40
43
|
JkyAMapPicker,
|
|
41
44
|
JkyAMapPickerItem,
|
|
@@ -46,6 +49,7 @@ export {
|
|
|
46
49
|
JkyButton,
|
|
47
50
|
JkyButtonNav,
|
|
48
51
|
JkyCodeMirrorEditor,
|
|
52
|
+
JkyDraggable,
|
|
49
53
|
JkyForm,
|
|
50
54
|
JkyFormItem,
|
|
51
55
|
JkyMenu,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { DraggableProps, DraggableSlots } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<DraggableSlots> & DraggableSlots;
|
|
5
|
+
refs: {
|
|
6
|
+
dragRef: HTMLDivElement;
|
|
7
|
+
};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<DraggableProps, {
|
|
12
|
+
/** 手动保存位置 */
|
|
13
|
+
savePosition: () => void;
|
|
14
|
+
/** 重置位置到初始值 */
|
|
15
|
+
resetPosition: () => void;
|
|
16
|
+
/** 获取当前位置 */
|
|
17
|
+
getPosition: () => {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
/** 是否正在拖拽 */
|
|
22
|
+
isDragging: () => boolean;
|
|
23
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
24
|
+
change: (position: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}) => any;
|
|
28
|
+
click: (event: MouseEvent) => any;
|
|
29
|
+
start: (position: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
}) => any;
|
|
33
|
+
end: (position: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}) => any;
|
|
37
|
+
move: (position: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}) => any;
|
|
41
|
+
}, string, import('vue').PublicProps, Readonly<DraggableProps> & Readonly<{
|
|
42
|
+
onChange?: ((position: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}) => any) | undefined;
|
|
46
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
47
|
+
onStart?: ((position: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}) => any) | undefined;
|
|
51
|
+
onEnd?: ((position: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
}) => any) | undefined;
|
|
55
|
+
onMove?: ((position: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
}) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
initialValue: {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
};
|
|
65
|
+
storageKey: string;
|
|
66
|
+
persistPosition: boolean;
|
|
67
|
+
boundToViewport: boolean;
|
|
68
|
+
viewportMargin: number;
|
|
69
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
70
|
+
dragRef: HTMLDivElement;
|
|
71
|
+
}, HTMLDivElement>;
|
|
72
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
73
|
+
export default _default;
|
|
74
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
75
|
+
new (): {
|
|
76
|
+
$slots: S;
|
|
77
|
+
};
|
|
78
|
+
};
|