jky-component-lib 0.0.97 → 0.0.99

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.
Files changed (57) hide show
  1. package/dist/es/add-input/style.css +1 -1
  2. package/dist/es/amap/ATrackPlayback.vue.d.ts +69 -0
  3. package/dist/es/amap/ATrackPlayback.vue.js +237 -0
  4. package/dist/es/amap/ATrackPlayback.vue3.js +5 -0
  5. package/dist/es/amap/index.d.ts +3 -1
  6. package/dist/es/amap/index.js +5 -0
  7. package/dist/es/amap/style.css +2 -6
  8. package/dist/es/amap/style2.css +5 -12
  9. package/dist/es/amap/style3.css +14 -0
  10. package/dist/es/components.js +4 -1
  11. package/dist/es/form/Form.vue.d.ts +3 -3
  12. package/dist/es/form/Form.vue.js +88 -155
  13. package/dist/es/form/FormItem.vue.js +3 -1
  14. package/dist/es/form/SelectTable.vue.js +14 -5
  15. package/dist/es/form/style.css +1 -21
  16. package/dist/es/index.js +7 -2
  17. package/dist/es/package.json.js +1 -1
  18. package/dist/es/page-layout/PageLayout.vue.js +1 -1
  19. package/dist/es/page-table/ActionColumn.vue.d.ts +11 -0
  20. package/dist/es/page-table/ActionColumn.vue.js +137 -0
  21. package/dist/es/page-table/ActionColumn.vue3.js +5 -0
  22. package/dist/es/page-table/PageTable.vue.d.ts +35 -26
  23. package/dist/es/page-table/PageTable.vue.js +84 -33
  24. package/dist/es/page-table/index.d.ts +3 -1
  25. package/dist/es/page-table/index.js +4 -0
  26. package/dist/es/page-table/style.css +9 -0
  27. package/dist/es/style.css +90 -2
  28. package/dist/es/styles.css +1 -1
  29. package/dist/lib/add-input/style.css +1 -1
  30. package/dist/lib/amap/ATrackPlayback.vue.d.ts +69 -0
  31. package/dist/lib/amap/ATrackPlayback.vue.js +237 -0
  32. package/dist/lib/amap/ATrackPlayback.vue3.js +5 -0
  33. package/dist/lib/amap/index.d.ts +3 -1
  34. package/dist/lib/amap/index.js +5 -0
  35. package/dist/lib/amap/style.css +2 -6
  36. package/dist/lib/amap/style2.css +5 -12
  37. package/dist/lib/amap/style3.css +14 -0
  38. package/dist/lib/components.js +32 -30
  39. package/dist/lib/form/Form.vue.d.ts +3 -3
  40. package/dist/lib/form/Form.vue.js +86 -153
  41. package/dist/lib/form/FormItem.vue.js +3 -1
  42. package/dist/lib/form/SelectTable.vue.js +13 -4
  43. package/dist/lib/form/style.css +1 -21
  44. package/dist/lib/index.js +25 -20
  45. package/dist/lib/package.json.js +1 -1
  46. package/dist/lib/page-layout/PageLayout.vue.js +1 -1
  47. package/dist/lib/page-table/ActionColumn.vue.d.ts +11 -0
  48. package/dist/lib/page-table/ActionColumn.vue.js +137 -0
  49. package/dist/lib/page-table/ActionColumn.vue3.js +5 -0
  50. package/dist/lib/page-table/PageTable.vue.d.ts +35 -26
  51. package/dist/lib/page-table/PageTable.vue.js +83 -32
  52. package/dist/lib/page-table/index.d.ts +3 -1
  53. package/dist/lib/page-table/index.js +4 -0
  54. package/dist/lib/page-table/style.css +9 -0
  55. package/dist/lib/style.css +90 -2
  56. package/dist/lib/styles.css +1 -1
  57. package/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  /* 禁止使用 @apply,所有 TailwindCSS 工具类直接写在 class 中 */
3
3
  /* 样式文件仅用于定义组件特定的自定义纯 CSS 样式 */
4
4
  /* AddInput 组件样式变量 */
5
- :root {
5
+ .jky-add-input, :root {
6
6
  --jky-add-input-gap: 12px;
7
7
  --jky-add-input-row-gap: 8px;
8
8
  --jky-add-input-min-width: 100px;
@@ -0,0 +1,69 @@
1
+ import { AMapTrackPlaybackProps } from './types';
2
+ declare function startAnimation(): void;
3
+ declare function pauseAnimation(): void;
4
+ declare function resumeAnimation(): void;
5
+ declare function stopAnimation(): void;
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {
10
+ isPlaying: boolean;
11
+ isPaused: boolean;
12
+ start: typeof startAnimation;
13
+ pause: typeof pauseAnimation;
14
+ resume: typeof resumeAnimation;
15
+ stop: typeof stopAnimation;
16
+ }): any;
17
+ };
18
+ refs: {};
19
+ rootEl: HTMLDivElement;
20
+ };
21
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
22
+ declare const __VLS_component: import('vue').DefineComponent<AMapTrackPlaybackProps, {
23
+ start: typeof startAnimation;
24
+ pause: typeof pauseAnimation;
25
+ resume: typeof resumeAnimation;
26
+ stop: typeof stopAnimation;
27
+ isPlaying: globalThis.Ref<boolean, boolean>;
28
+ isPaused: globalThis.Ref<boolean, boolean>;
29
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
30
+ stop: () => any;
31
+ pause: () => any;
32
+ start: () => any;
33
+ resume: () => any;
34
+ end: () => any;
35
+ moving: (data: {
36
+ passedPath: import('./types').MapCenter[];
37
+ target: any;
38
+ }) => any;
39
+ }, string, import('vue').PublicProps, Readonly<AMapTrackPlaybackProps> & Readonly<{
40
+ onStop?: (() => any) | undefined;
41
+ onPause?: (() => any) | undefined;
42
+ onStart?: (() => any) | undefined;
43
+ onResume?: (() => any) | undefined;
44
+ onEnd?: (() => any) | undefined;
45
+ onMoving?: ((data: {
46
+ passedPath: import('./types').MapCenter[];
47
+ target: any;
48
+ }) => any) | undefined;
49
+ }>, {
50
+ duration: number;
51
+ autoPlay: boolean;
52
+ autoRotation: boolean;
53
+ loop: boolean;
54
+ showPath: boolean;
55
+ showPassedPath: boolean;
56
+ pathColor: string;
57
+ passedPathColor: string;
58
+ pathWeight: number;
59
+ carIcon: string;
60
+ carIconOffset: [number, number];
61
+ initialZoom: number;
62
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
63
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
64
+ export default _default;
65
+ type __VLS_WithTemplateSlots<T, S> = T & {
66
+ new (): {
67
+ $slots: S;
68
+ };
69
+ };
@@ -0,0 +1,237 @@
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, openBlock, createElementBlock, renderSlot, unref } from "vue";
21
+ const _hoisted_1 = { class: "jky-track-playback" };
22
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
23
+ name: "JkyATrackPlayback"
24
+ }), {
25
+ __name: "ATrackPlayback",
26
+ props: {
27
+ path: {},
28
+ autoPlay: { type: Boolean, default: false },
29
+ duration: { default: 500 },
30
+ autoRotation: { type: Boolean, default: true },
31
+ loop: { type: Boolean, default: false },
32
+ showPath: { type: Boolean, default: true },
33
+ showPassedPath: { type: Boolean, default: true },
34
+ pathColor: { default: "#28F" },
35
+ passedPathColor: { default: "#AF5" },
36
+ pathWeight: { default: 6 },
37
+ carIcon: { default: "https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png" },
38
+ carIconOffset: { default: () => [-13, -26] },
39
+ initialCenter: {},
40
+ initialZoom: { default: 17 }
41
+ },
42
+ emits: ["start", "pause", "resume", "stop", "end", "moving"],
43
+ setup(__props, { expose: __expose, emit: __emit }) {
44
+ const props = __props;
45
+ const emit = __emit;
46
+ const amapContext = inject("amapContext", null);
47
+ const mapInstance = (amapContext == null ? void 0 : amapContext.map) || null;
48
+ const marker = ref(null);
49
+ const polyline = ref(null);
50
+ const passedPolyline = ref(null);
51
+ const isPlaying = ref(false);
52
+ const isPaused = ref(false);
53
+ function initTrackPlayback() {
54
+ if (!mapInstance || !props.path || props.path.length === 0)
55
+ return;
56
+ const AMap = window.AMap;
57
+ if (!AMap) {
58
+ console.error("AMap 未加载");
59
+ return;
60
+ }
61
+ AMap.plugin("AMap.MoveAnimation", () => {
62
+ createMarker();
63
+ if (props.showPath) {
64
+ createPolyline();
65
+ }
66
+ if (props.showPassedPath) {
67
+ createPassedPolyline();
68
+ }
69
+ fitView();
70
+ if (marker.value) {
71
+ marker.value.on("moving", (e) => {
72
+ emit("moving", {
73
+ passedPath: e.passedPath,
74
+ target: e.target
75
+ });
76
+ if (passedPolyline.value) {
77
+ passedPolyline.value.setPath(e.passedPath);
78
+ }
79
+ mapInstance == null ? void 0 : mapInstance.setCenter(e.target.getPosition(), true);
80
+ });
81
+ marker.value.on("moveend", () => {
82
+ isPlaying.value = false;
83
+ isPaused.value = false;
84
+ emit("end");
85
+ if (props.loop && !isPaused.value) {
86
+ setTimeout(() => {
87
+ if (props.loop) {
88
+ startAnimation();
89
+ }
90
+ }, 500);
91
+ }
92
+ });
93
+ }
94
+ if (props.autoPlay) {
95
+ startAnimation();
96
+ }
97
+ });
98
+ }
99
+ function createMarker() {
100
+ var _a;
101
+ const AMap = window.AMap;
102
+ const startPosition = ((_a = props.path) == null ? void 0 : _a[0]) || props.initialCenter;
103
+ if (!startPosition)
104
+ return;
105
+ marker.value = new AMap.Marker({
106
+ map: mapInstance,
107
+ position: startPosition,
108
+ icon: props.carIcon,
109
+ offset: new AMap.Pixel(...props.carIconOffset)
110
+ });
111
+ }
112
+ function createPolyline() {
113
+ const AMap = window.AMap;
114
+ polyline.value = new AMap.Polyline({
115
+ map: mapInstance,
116
+ path: props.path,
117
+ showDir: true,
118
+ strokeColor: props.pathColor,
119
+ strokeWeight: props.pathWeight
120
+ });
121
+ }
122
+ function createPassedPolyline() {
123
+ const AMap = window.AMap;
124
+ passedPolyline.value = new AMap.Polyline({
125
+ map: mapInstance,
126
+ path: [],
127
+ strokeColor: props.passedPathColor,
128
+ strokeWeight: props.pathWeight
129
+ });
130
+ }
131
+ function fitView() {
132
+ if (!mapInstance || !props.path || props.path.length === 0)
133
+ return;
134
+ if (props.initialCenter) {
135
+ mapInstance.setCenter(props.initialCenter);
136
+ } else {
137
+ mapInstance.setCenter(props.path[0]);
138
+ }
139
+ if (props.initialZoom) {
140
+ mapInstance.setZoom(props.initialZoom);
141
+ } else {
142
+ mapInstance.setFitView();
143
+ }
144
+ }
145
+ function startAnimation() {
146
+ if (!marker.value || !props.path || props.path.length === 0)
147
+ return;
148
+ isPlaying.value = true;
149
+ isPaused.value = false;
150
+ marker.value.moveAlong(props.path, {
151
+ duration: props.duration,
152
+ autoRotation: props.autoRotation
153
+ });
154
+ emit("start");
155
+ }
156
+ function pauseAnimation() {
157
+ if (!marker.value || !isPlaying.value)
158
+ return;
159
+ marker.value.pauseMove();
160
+ isPaused.value = true;
161
+ emit("pause");
162
+ }
163
+ function resumeAnimation() {
164
+ if (!marker.value || !isPaused.value)
165
+ return;
166
+ marker.value.resumeMove();
167
+ isPaused.value = false;
168
+ emit("resume");
169
+ }
170
+ function stopAnimation() {
171
+ if (!marker.value)
172
+ return;
173
+ marker.value.stopMove();
174
+ isPlaying.value = false;
175
+ isPaused.value = false;
176
+ emit("stop");
177
+ }
178
+ __expose({
179
+ start: startAnimation,
180
+ pause: pauseAnimation,
181
+ resume: resumeAnimation,
182
+ stop: stopAnimation,
183
+ isPlaying,
184
+ isPaused
185
+ });
186
+ watch(
187
+ () => props.path,
188
+ (newPath) => {
189
+ if (newPath && newPath.length > 0) {
190
+ if (polyline.value) {
191
+ mapInstance == null ? void 0 : mapInstance.remove(polyline.value);
192
+ }
193
+ if (passedPolyline.value) {
194
+ mapInstance == null ? void 0 : mapInstance.remove(passedPolyline.value);
195
+ }
196
+ if (marker.value) {
197
+ mapInstance == null ? void 0 : mapInstance.remove(marker.value);
198
+ }
199
+ initTrackPlayback();
200
+ }
201
+ },
202
+ { deep: true }
203
+ );
204
+ onMounted(() => {
205
+ if (mapInstance) {
206
+ initTrackPlayback();
207
+ }
208
+ });
209
+ onUnmounted(() => {
210
+ if (marker.value) {
211
+ marker.value.stopMove();
212
+ mapInstance == null ? void 0 : mapInstance.remove(marker.value);
213
+ }
214
+ if (polyline.value) {
215
+ mapInstance == null ? void 0 : mapInstance.remove(polyline.value);
216
+ }
217
+ if (passedPolyline.value) {
218
+ mapInstance == null ? void 0 : mapInstance.remove(passedPolyline.value);
219
+ }
220
+ });
221
+ return (_ctx, _cache) => {
222
+ return openBlock(), createElementBlock("div", _hoisted_1, [
223
+ renderSlot(_ctx.$slots, "default", {
224
+ isPlaying: unref(isPlaying),
225
+ isPaused: unref(isPaused),
226
+ start: startAnimation,
227
+ pause: pauseAnimation,
228
+ resume: resumeAnimation,
229
+ stop: stopAnimation
230
+ })
231
+ ]);
232
+ };
233
+ }
234
+ }));
235
+ export {
236
+ _sfc_main as default
237
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./ATrackPlayback.vue.js";
2
+ /* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -1,7 +1,9 @@
1
1
  import { InstallWithSFC } from '../utils';
2
2
  import { default as AMap } from './AMap.vue';
3
3
  import { default as AMarker } from './AMarker.vue';
4
+ import { default as ATrackPlayback } from './ATrackPlayback.vue';
4
5
  export declare const JkyAMap: InstallWithSFC<typeof AMap>;
5
6
  export declare const JkyAMarker: InstallWithSFC<typeof AMarker>;
7
+ export declare const JkyATrackPlayback: InstallWithSFC<typeof ATrackPlayback>;
6
8
  export default JkyAMap;
7
- export { AMarker };
9
+ export { AMarker, ATrackPlayback };
@@ -2,12 +2,17 @@ import _sfc_main from "./AMap.vue.js";
2
2
  /* empty css */
3
3
  import _sfc_main$1 from "./AMarker.vue.js";
4
4
  /* empty css */
5
+ import _sfc_main$2 from "./ATrackPlayback.vue.js";
6
+ /* empty css */
5
7
  import { installWithSFC } from "../utils/with-install.js";
6
8
  const JkyAMap = installWithSFC(_sfc_main);
7
9
  const JkyAMarker = installWithSFC(_sfc_main$1);
10
+ const JkyATrackPlayback = installWithSFC(_sfc_main$2);
8
11
  export {
9
12
  _sfc_main$1 as AMarker,
13
+ _sfc_main$2 as ATrackPlayback,
10
14
  JkyAMap,
11
15
  JkyAMarker,
16
+ JkyATrackPlayback,
12
17
  JkyAMap as default
13
18
  };
@@ -1,7 +1,3 @@
1
1
 
2
- /* JkyAMarker 组件样式 - 参考高德官方示例 */
3
- .amap-icon img,
4
- .amap-marker-content img {
5
- width: 25px;
6
- height: 34px;
7
- }
2
+ /* 轨迹回放组件不需要额外样式 */
3
+ /* 所有样式通过 TailwindCSS 工具类或外部组件控制 */
@@ -1,14 +1,7 @@
1
- /* AMap 高德地图组件样式 */
2
- .jky-amap-container {
3
- /* 地图容器样式 */
4
- position: relative;
5
- overflow: hidden;
6
1
 
7
- /* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
8
- .amap-logo {
9
- display: none !important;
10
- }
11
- .amap-copyright {
12
- display: none !important;
13
- }
2
+ /* JkyAMarker 组件样式 - 参考高德官方示例 */
3
+ .amap-icon img,
4
+ .amap-marker-content img {
5
+ width: 25px;
6
+ height: 34px;
14
7
  }
@@ -0,0 +1,14 @@
1
+ /* AMap 高德地图组件样式 */
2
+ .jky-amap-container {
3
+ /* 地图容器样式 */
4
+ position: relative;
5
+ overflow: hidden;
6
+
7
+ /* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
8
+ .amap-logo {
9
+ display: none !important;
10
+ }
11
+ .amap-copyright {
12
+ display: none !important;
13
+ }
14
+ }
@@ -1,6 +1,6 @@
1
1
  import { JkyAddInput } from "./add-input/index.js";
2
2
  import { JkyAMap } from "./amap/index.js";
3
- import { JkyAMarker } from "./amap/index.js";
3
+ import { 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";
@@ -10,6 +10,7 @@ import { JkyModal } from "./modal/index.js";
10
10
  import { JkyPageHeader } from "./page-header/index.js";
11
11
  import { JkyPageLayout } from "./page-layout/index.js";
12
12
  import { JkyPageTable } from "./page-table/index.js";
13
+ import { JkyActionColumn } from "./page-table/index.js";
13
14
  import { JkyRichEditor } from "./rich-editor/index.js";
14
15
  import { JkySayHello } from "./say-hello/index.js";
15
16
  import { JkyTabs } from "./tabs/index.js";
@@ -32,6 +33,8 @@ const components = [
32
33
  export {
33
34
  JkyAMap,
34
35
  JkyAMarker,
36
+ JkyATrackPlayback,
37
+ JkyActionColumn,
35
38
  JkyAddInput,
36
39
  JkyButton,
37
40
  JkyButtonNav,
@@ -1,7 +1,6 @@
1
1
  import { FormProps } from './types';
2
2
  type __VLS_Props = FormProps;
3
3
  declare function validate(callback?: (isValid: boolean, invalidFields?: any) => void): Promise<boolean>;
4
- declare function resetFields(): void;
5
4
  declare function clearValidate(props?: any): void;
6
5
  declare function getFormInstance(): ({
7
6
  $: import('vue').ComponentInternalInstance;
@@ -107,7 +106,6 @@ type __VLS_PublicProps = {
107
106
  } & __VLS_Props;
108
107
  declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
109
108
  validate: typeof validate;
110
- resetFields: typeof resetFields;
111
109
  clearValidate: typeof clearValidate;
112
110
  getFormInstance: typeof getFormInstance;
113
111
  formRef: globalThis.Ref<({
@@ -327,11 +325,11 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
327
325
  }) => any) | undefined;
328
326
  }>, {
329
327
  size: import('element-plus').ComponentSize;
328
+ disabled: boolean;
330
329
  grid: import('./types').GridConfig;
331
330
  inline: boolean;
332
331
  labelPosition: "left" | "right" | "top";
333
332
  labelWidth: string | number;
334
- showTitle: boolean;
335
333
  gutter: number;
336
334
  defaultSpan: number;
337
335
  responsive: boolean;
@@ -340,6 +338,8 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
340
338
  footerClass: string;
341
339
  submitText: string;
342
340
  cancelText: string;
341
+ submitDisabled: boolean;
342
+ cancelDisabled: boolean;
343
343
  showCount: number;
344
344
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
345
345
  formRef: ({