jky-component-lib 0.0.126 → 0.0.129

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 (53) hide show
  1. package/dist/es/amap/AMapPicker/AMapPicker.vue.d.ts +43 -0
  2. package/dist/es/amap/AMapPicker/AMapPicker.vue.js +142 -0
  3. package/dist/es/amap/AMapPicker/AMapPicker.vue2.js +4 -0
  4. package/dist/es/amap/index.d.ts +3 -1
  5. package/dist/es/amap/index.js +10 -6
  6. package/dist/es/amap/style.css +5 -12
  7. package/dist/es/amap/style2.css +2 -6
  8. package/dist/es/amap/style3.css +13 -2
  9. package/dist/es/components.js +7 -3
  10. package/dist/es/form/AMapPickerItem.vue.d.ts +19 -0
  11. package/dist/es/form/AMapPickerItem.vue.js +104 -0
  12. package/dist/es/form/AMapPickerItem.vue3.js +5 -0
  13. package/dist/es/form/Form.vue.d.ts +2 -2
  14. package/dist/es/form/FormItem.vue.js +31 -14
  15. package/dist/es/form/LinkedSelect.vue.d.ts +2 -0
  16. package/dist/es/form/LinkedSelect.vue.js +68 -53
  17. package/dist/es/form/{LinkedSelect.vue3.js → LinkedSelect.vue2.js} +0 -1
  18. package/dist/es/form/index.d.ts +3 -1
  19. package/dist/es/form/index.js +4 -1
  20. package/dist/es/index.js +10 -6
  21. package/dist/es/modal/Modal.vue.d.ts +3 -3
  22. package/dist/es/package.json.js +1 -1
  23. package/dist/es/page-table/PageTable.vue.d.ts +10 -10
  24. package/dist/es/page-table/PageTableColumn.vue.d.ts +1 -1
  25. package/dist/es/page-table-v2/PageTableV2.vue.d.ts +5 -5
  26. package/dist/es/style.css +14 -0
  27. package/dist/lib/amap/AMapPicker/AMapPicker.vue.d.ts +43 -0
  28. package/dist/lib/amap/AMapPicker/AMapPicker.vue.js +142 -0
  29. package/dist/lib/amap/AMapPicker/AMapPicker.vue2.js +4 -0
  30. package/dist/lib/amap/index.d.ts +3 -1
  31. package/dist/lib/amap/index.js +4 -0
  32. package/dist/lib/amap/style.css +5 -12
  33. package/dist/lib/amap/style2.css +2 -6
  34. package/dist/lib/amap/style3.css +13 -2
  35. package/dist/lib/components.js +27 -23
  36. package/dist/lib/form/AMapPickerItem.vue.d.ts +19 -0
  37. package/dist/lib/form/AMapPickerItem.vue.js +104 -0
  38. package/dist/lib/form/AMapPickerItem.vue3.js +5 -0
  39. package/dist/lib/form/Form.vue.d.ts +2 -2
  40. package/dist/lib/form/FormItem.vue.js +26 -9
  41. package/dist/lib/form/LinkedSelect.vue.d.ts +2 -0
  42. package/dist/lib/form/LinkedSelect.vue.js +66 -51
  43. package/dist/lib/form/{LinkedSelect.vue3.js → LinkedSelect.vue2.js} +0 -1
  44. package/dist/lib/form/index.d.ts +3 -1
  45. package/dist/lib/form/index.js +4 -1
  46. package/dist/lib/index.js +19 -15
  47. package/dist/lib/modal/Modal.vue.d.ts +3 -3
  48. package/dist/lib/package.json.js +1 -1
  49. package/dist/lib/page-table/PageTable.vue.d.ts +10 -10
  50. package/dist/lib/page-table/PageTableColumn.vue.d.ts +1 -1
  51. package/dist/lib/page-table-v2/PageTableV2.vue.d.ts +5 -5
  52. package/dist/lib/style.css +14 -0
  53. package/package.json +1 -1
@@ -37,8 +37,8 @@ var __async = (__this, __arguments, generator) => {
37
37
  step((generator = generator.apply(__this, __arguments)).next());
38
38
  });
39
39
  };
40
- import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, renderSlot, Fragment, renderList, createBlock, unref, mergeProps, withCtx } from "vue";
41
- import { ElSelect } from "element-plus";
40
+ import { defineComponent, ref, onMounted, openBlock, createElementBlock, renderSlot, Fragment, renderList, unref, createBlock, mergeProps, withCtx, watch } from "vue";
41
+ import { ElSelect, ElOption } from "element-plus";
42
42
  const _hoisted_1 = { class: "flex gap-2" };
43
43
  const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
44
44
  name: "JkyLinkedSelect"
@@ -50,82 +50,97 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
50
50
  disabled: { type: Boolean, default: false },
51
51
  componentProps: { default: void 0 }
52
52
  },
53
- emits: ["update:modelValue"],
53
+ emits: ["update:modelValue", "change"],
54
54
  setup(__props, { emit: __emit }) {
55
+ var _a;
55
56
  const props = __props;
56
57
  const emit = __emit;
57
- const linkedSelectOptions = ref([]);
58
- const linkedSelectLoading = ref([]);
59
- function loadLinkedSelectOptions() {
58
+ const level = ((_a = props.config) == null ? void 0 : _a.level) || 1;
59
+ const optionsList = ref(Array.from({ length: level }, () => []));
60
+ const loadingList = ref(Array.from({ length: level }, () => false));
61
+ const values = ref(
62
+ props.modelValue && props.modelValue.length > 0 ? props.modelValue.slice(0, level) : Array.from({ length: level }, () => void 0)
63
+ );
64
+ function loadOptions(levelIndex, value) {
60
65
  return __async(this, null, function* () {
61
- if (!props.config) {
66
+ var _a2;
67
+ if (!((_a2 = props.config) == null ? void 0 : _a2.getOptions) || levelIndex >= level) {
62
68
  return;
63
69
  }
64
- const level = props.config.level || 1;
65
- linkedSelectLoading.value = Array.from({ length: level }, () => false);
66
- if (props.config.getAllOptions) {
67
- try {
68
- const allOptions = yield props.config.getAllOptions(props.modelValue);
69
- linkedSelectOptions.value = allOptions;
70
- } catch (error) {
71
- console.error("Failed to load linked select options:", error);
72
- linkedSelectOptions.value = Array.from({ length: level }, () => []);
73
- }
74
- return;
70
+ loadingList.value[levelIndex] = true;
71
+ try {
72
+ const levelOptions = yield props.config.getOptions(levelIndex + 1, value);
73
+ optionsList.value[levelIndex] = levelOptions || [];
74
+ } catch (error) {
75
+ console.error("Failed to load linked select options:", error);
76
+ optionsList.value[levelIndex] = [];
77
+ } finally {
78
+ loadingList.value[levelIndex] = false;
75
79
  }
76
- if (props.config.getOptions) {
77
- try {
78
- const options = [];
79
- for (let i = 0; i < level; i++) {
80
- linkedSelectLoading.value[i] = true;
81
- const levelOptions = yield props.config.getOptions(i + 1, props.modelValue || []);
82
- options.push(levelOptions);
83
- linkedSelectLoading.value[i] = false;
84
- }
85
- linkedSelectOptions.value = options;
86
- } catch (error) {
87
- console.error("Failed to load linked select options:", error);
88
- linkedSelectOptions.value = Array.from({ length: level }, () => []);
80
+ });
81
+ }
82
+ function loadDisplayData() {
83
+ return __async(this, null, function* () {
84
+ for (let i = 0; i < level - 1; i++) {
85
+ if (values.value[i] !== void 0 && values.value[i] !== null) {
86
+ yield loadOptions(i + 1, values.value[i]);
89
87
  }
90
88
  }
91
89
  });
92
90
  }
93
- onMounted(() => {
94
- loadLinkedSelectOptions();
95
- });
96
- watch(
97
- () => props.modelValue,
98
- () => {
99
- loadLinkedSelectOptions();
100
- },
101
- { deep: true }
102
- );
103
- function handleValueChange(index, val) {
104
- const newValue = Array.isArray(props.modelValue) ? [...props.modelValue] : [];
105
- newValue[index] = val;
91
+ function watchModelValue() {
92
+ watch(
93
+ () => props.modelValue,
94
+ (newVal) => __async(null, null, function* () {
95
+ if (newVal && newVal.length > 0) {
96
+ values.value = [...newVal];
97
+ yield loadDisplayData();
98
+ }
99
+ }),
100
+ { deep: true }
101
+ );
102
+ }
103
+ function handleSelectChange(index, value) {
104
+ for (let i = index + 1; i < level; i++) {
105
+ values.value[i] = void 0;
106
+ optionsList.value[i] = [];
107
+ }
108
+ const newValue = [...values.value];
106
109
  emit("update:modelValue", newValue);
110
+ emit("change", newValue);
111
+ if (value !== void 0 && value !== null && index + 1 < level) {
112
+ loadOptions(index + 1, value);
113
+ }
107
114
  }
115
+ onMounted(() => {
116
+ var _a2;
117
+ watchModelValue();
118
+ loadDisplayData();
119
+ if ((_a2 = props.config) == null ? void 0 : _a2.getOptions) {
120
+ loadOptions(0, void 0);
121
+ }
122
+ });
108
123
  return (_ctx, _cache) => {
109
- var _a;
110
124
  return openBlock(), createElementBlock("div", _hoisted_1, [
111
125
  renderSlot(_ctx.$slots, "prefix"),
112
- (openBlock(true), createElementBlock(Fragment, null, renderList(Array.from({ length: ((_a = __props.config) == null ? void 0 : _a.level) || 1 }), (_, index) => {
126
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Array.from({ length: unref(level) }), (_, index) => {
113
127
  var _a2, _b, _c, _d, _e, _f;
114
128
  return openBlock(), createBlock(unref(ElSelect), mergeProps({
115
129
  key: index,
116
- "model-value": Array.isArray(__props.modelValue) ? __props.modelValue[index] : void 0,
130
+ modelValue: values.value[index],
131
+ "onUpdate:modelValue": ($event) => values.value[index] = $event,
117
132
  placeholder: ((_b = (_a2 = __props.config) == null ? void 0 : _a2.placeholders) == null ? void 0 : _b[index]) || "请选择",
118
- disabled: __props.disabled,
133
+ disabled: __props.disabled || index > 0 && values.value[index - 1] === void 0 && values.value[index - 1] !== null,
119
134
  filterable: (_d = (_c = __props.config) == null ? void 0 : _c.filterable) != null ? _d : false,
120
135
  clearable: (_f = (_e = __props.config) == null ? void 0 : _e.clearable) != null ? _f : true,
121
- loading: linkedSelectLoading.value[index],
136
+ loading: loadingList.value[index],
122
137
  class: "flex-1 min-w-30"
123
138
  }, { ref_for: true }, __props.componentProps, {
124
- "onUpdate:modelValue": ($event) => handleValueChange(index, $event)
139
+ onChange: ($event) => handleSelectChange(index, $event)
125
140
  }), {
126
141
  default: withCtx(() => [
127
- (openBlock(true), createElementBlock(Fragment, null, renderList(linkedSelectOptions.value[index] || [], (option) => {
128
- return openBlock(), createBlock(unref(ElSelect).Option, {
142
+ (openBlock(true), createElementBlock(Fragment, null, renderList(optionsList.value[index] || [], (option) => {
143
+ return openBlock(), createBlock(unref(ElOption), {
129
144
  key: option.value,
130
145
  value: option.value,
131
146
  label: option.label,
@@ -134,7 +149,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
134
149
  }), 128))
135
150
  ]),
136
151
  _: 2
137
- }, 1040, ["model-value", "placeholder", "disabled", "filterable", "clearable", "loading", "onUpdate:modelValue"]);
152
+ }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "filterable", "clearable", "loading", "onChange"]);
138
153
  }), 128)),
139
154
  renderSlot(_ctx.$slots, "suffix")
140
155
  ]);
@@ -1,5 +1,4 @@
1
1
  import _sfc_main from "./LinkedSelect.vue.js";
2
- /* empty css */
3
2
  export {
4
3
  _sfc_main as default
5
4
  };
@@ -1,7 +1,9 @@
1
1
  import { InstallWithSFC } from '../utils';
2
+ import { default as AMapPickerItem } from './AMapPickerItem.vue';
2
3
  import { default as Form } from './Form.vue';
3
4
  import { default as LinkedSelect } from './LinkedSelect.vue';
4
- export type { ComponentPropsMap, ComponentPropsType, DynamicComponentProps, FormComponentType, FormItemChildConfig, FormItemConfig, FormItemOption, FormItemProps, FormItemPropsContext, FormProps, FormValidateResult, GridConfig, HelpConfig, HelpType, LinkedSelectConfig, ResponsiveBreakpoint, ResponsiveConfig, SelectTableComponentProps, SelectTableProps, StaticComponentProps, } from './types';
5
+ export type { AMapPickerItemProps, ComponentPropsMap, ComponentPropsType, DynamicComponentProps, FormComponentType, FormItemChildConfig, FormItemConfig, FormItemOption, FormItemProps, FormItemPropsContext, FormProps, FormValidateResult, GridConfig, HelpConfig, HelpType, LinkedSelectConfig, ResponsiveBreakpoint, ResponsiveConfig, SelectTableComponentProps, SelectTableProps, StaticComponentProps, } from './types';
5
6
  export declare const JkyForm: InstallWithSFC<typeof Form>;
6
7
  export declare const JkyLinkedSelect: InstallWithSFC<typeof LinkedSelect>;
8
+ export declare const JkyAMapPickerItem: InstallWithSFC<typeof AMapPickerItem>;
7
9
  export default JkyForm;
@@ -1,11 +1,14 @@
1
+ import _sfc_main$2 from "./AMapPickerItem.vue.js";
2
+ /* empty css */
1
3
  import _sfc_main from "./Form.vue.js";
2
4
  /* empty css */
3
5
  import _sfc_main$1 from "./LinkedSelect.vue.js";
4
- /* empty css */
5
6
  import { installWithSFC } from "../utils/with-install.js";
6
7
  const JkyForm = installWithSFC(_sfc_main);
7
8
  const JkyLinkedSelect = installWithSFC(_sfc_main$1);
9
+ const JkyAMapPickerItem = installWithSFC(_sfc_main$2);
8
10
  export {
11
+ JkyAMapPickerItem,
9
12
  JkyForm,
10
13
  JkyLinkedSelect,
11
14
  JkyForm as default
package/dist/es/index.js CHANGED
@@ -2,17 +2,18 @@ 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 { default as default2 } from "./amap/AMarker.vue.js";
5
+ import { default as default2 } from "./amap/AMapPicker/AMapPicker.vue.js";
6
+ import { default as default3 } from "./amap/AMarker.vue.js";
6
7
  /* empty css */
7
- import { default as default3 } from "./amap/ATrackPlayback.vue.js";
8
+ import { default as default4 } from "./amap/ATrackPlayback.vue.js";
8
9
  /* empty css */
9
- import { JkyAMap, JkyAMarker, JkyATrackPlayback } from "./amap/index.js";
10
+ import { JkyAMap, JkyAMapPicker, JkyAMarker, JkyATrackPlayback } from "./amap/index.js";
11
+ import { JkyAMapPickerItem, JkyForm, JkyLinkedSelect } from "./form/index.js";
10
12
  import { JkyActionColumn, JkyPageTable, JkyPageTableColumn } from "./page-table/index.js";
11
13
  import { JkyAddInput } from "./add-input/index.js";
12
14
  import { JkyButton } from "./button/index.js";
13
15
  import { JkyButtonNav } from "./button-nav/index.js";
14
16
  import { JkyCodeMirrorEditor } from "./code-mirror-editor/index.js";
15
- import { JkyForm, JkyLinkedSelect } from "./form/index.js";
16
17
  import { JkyMenu } from "./menu/index.js";
17
18
  import { JkyModal } from "./modal/index.js";
18
19
  import { JkyPageHeader } from "./page-header/index.js";
@@ -27,9 +28,12 @@ const installer = createInstaller(components);
27
28
  const install = installer.install;
28
29
  const version = installer.version;
29
30
  export {
30
- default2 as AMarker,
31
- default3 as ATrackPlayback,
31
+ default2 as AMapPicker,
32
+ default3 as AMarker,
33
+ default4 as ATrackPlayback,
32
34
  JkyAMap,
35
+ JkyAMapPicker,
36
+ JkyAMapPickerItem,
33
37
  JkyAMarker,
34
38
  JkyATrackPlayback,
35
39
  JkyActionColumn,
@@ -44,8 +44,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
44
44
  "update:modelValue": (value: boolean) => any;
45
45
  cancel: () => any;
46
46
  close: () => any;
47
- open: () => any;
48
47
  confirm: () => any;
48
+ open: () => any;
49
49
  opened: () => any;
50
50
  closed: () => any;
51
51
  typeChange: (type: import('./types').ModalType) => any;
@@ -53,8 +53,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
53
53
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
54
54
  onCancel?: (() => any) | undefined;
55
55
  onClose?: (() => any) | undefined;
56
- onOpen?: (() => any) | undefined;
57
56
  onConfirm?: (() => any) | undefined;
57
+ onOpen?: (() => any) | undefined;
58
58
  onOpened?: (() => any) | undefined;
59
59
  onClosed?: (() => any) | undefined;
60
60
  "onUpdate:mode"?: ((value: "dialog" | "drawer") => any) | undefined;
@@ -63,8 +63,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
63
63
  onTypeChange?: ((type: import('./types').ModalType) => any) | undefined;
64
64
  }>, {
65
65
  title: string;
66
- cancelText: string;
67
66
  confirmText: string;
67
+ cancelText: string;
68
68
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
69
69
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
70
70
  export default _default;
@@ -1,4 +1,4 @@
1
- const version = "0.0.126";
1
+ const version = "0.0.129";
2
2
  export {
3
3
  version
4
4
  };
@@ -381,11 +381,11 @@ declare function __VLS_template(): {
381
381
  fields?: any;
382
382
  }) => any;
383
383
  }, string, {
384
+ cancelText: string;
385
+ footerClass: string;
384
386
  watchDeep: boolean;
385
387
  showFooter: boolean;
386
- footerClass: string;
387
388
  submitText: string;
388
- cancelText: string;
389
389
  submitDisabled: boolean;
390
390
  cancelDisabled: boolean;
391
391
  showCount: number;
@@ -410,11 +410,11 @@ declare function __VLS_template(): {
410
410
  $nextTick: typeof nextTick;
411
411
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
412
412
  } & Readonly<{
413
+ cancelText: string;
414
+ footerClass: string;
413
415
  watchDeep: boolean;
414
416
  showFooter: boolean;
415
- footerClass: string;
416
417
  submitText: string;
417
- cancelText: string;
418
418
  submitDisabled: boolean;
419
419
  cancelDisabled: boolean;
420
420
  showCount: number;
@@ -429,7 +429,7 @@ declare function __VLS_template(): {
429
429
  valid: boolean;
430
430
  fields?: any;
431
431
  }) => any) | undefined;
432
- }>, "form" | "validate" | "clearValidate" | ("watchDeep" | "showFooter" | "footerClass" | "submitText" | "cancelText" | "submitDisabled" | "cancelDisabled" | "showCount") | "getFormInstance"> & {
432
+ }>, "form" | "validate" | "clearValidate" | ("cancelText" | "footerClass" | "watchDeep" | "showFooter" | "submitText" | "submitDisabled" | "cancelDisabled" | "showCount") | "getFormInstance"> & {
433
433
  validate: (callback?: (isValid: boolean, invalidFields?: any) => void) => Promise<boolean>;
434
434
  clearValidate: (props?: any) => void;
435
435
  getFormInstance: () => ({
@@ -3199,11 +3199,11 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
3199
3199
  fields?: any;
3200
3200
  }) => any;
3201
3201
  }, string, {
3202
+ cancelText: string;
3203
+ footerClass: string;
3202
3204
  watchDeep: boolean;
3203
3205
  showFooter: boolean;
3204
- footerClass: string;
3205
3206
  submitText: string;
3206
- cancelText: string;
3207
3207
  submitDisabled: boolean;
3208
3208
  cancelDisabled: boolean;
3209
3209
  showCount: number;
@@ -3228,11 +3228,11 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
3228
3228
  $nextTick: typeof nextTick;
3229
3229
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
3230
3230
  } & Readonly<{
3231
+ cancelText: string;
3232
+ footerClass: string;
3231
3233
  watchDeep: boolean;
3232
3234
  showFooter: boolean;
3233
- footerClass: string;
3234
3235
  submitText: string;
3235
- cancelText: string;
3236
3236
  submitDisabled: boolean;
3237
3237
  cancelDisabled: boolean;
3238
3238
  showCount: number;
@@ -3247,7 +3247,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
3247
3247
  valid: boolean;
3248
3248
  fields?: any;
3249
3249
  }) => any) | undefined;
3250
- }>, "form" | "validate" | "clearValidate" | ("watchDeep" | "showFooter" | "footerClass" | "submitText" | "cancelText" | "submitDisabled" | "cancelDisabled" | "showCount") | "getFormInstance"> & {
3250
+ }>, "form" | "validate" | "clearValidate" | ("cancelText" | "footerClass" | "watchDeep" | "showFooter" | "submitText" | "submitDisabled" | "cancelDisabled" | "showCount") | "getFormInstance"> & {
3251
3251
  validate: (callback?: (isValid: boolean, invalidFields?: any) => void) => Promise<boolean>;
3252
3252
  clearValidate: (props?: any) => void;
3253
3253
  getFormInstance: () => ({
@@ -21,10 +21,10 @@ declare const __VLS_component: import('vue').DefineComponent<PageTableColumnProp
21
21
  column: import('element-plus').TableColumnCtx<any>;
22
22
  index: number;
23
23
  }) => any;
24
+ align: string;
24
25
  prop: string;
25
26
  minWidth: string | number;
26
27
  sortable: boolean | string;
27
- align: string;
28
28
  headerAlign: string;
29
29
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -416,11 +416,11 @@ declare const _default: import('vue').DefineComponent<PageTableV2Props, {
416
416
  fields?: any;
417
417
  }) => any;
418
418
  }, string, {
419
+ cancelText: string;
420
+ footerClass: string;
419
421
  watchDeep: boolean;
420
422
  showFooter: boolean;
421
- footerClass: string;
422
423
  submitText: string;
423
- cancelText: string;
424
424
  submitDisabled: boolean;
425
425
  cancelDisabled: boolean;
426
426
  showCount: number;
@@ -445,11 +445,11 @@ declare const _default: import('vue').DefineComponent<PageTableV2Props, {
445
445
  $nextTick: typeof import('vue').nextTick;
446
446
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
447
447
  } & Readonly<{
448
+ cancelText: string;
449
+ footerClass: string;
448
450
  watchDeep: boolean;
449
451
  showFooter: boolean;
450
- footerClass: string;
451
452
  submitText: string;
452
- cancelText: string;
453
453
  submitDisabled: boolean;
454
454
  cancelDisabled: boolean;
455
455
  showCount: number;
@@ -464,7 +464,7 @@ declare const _default: import('vue').DefineComponent<PageTableV2Props, {
464
464
  valid: boolean;
465
465
  fields?: any;
466
466
  }) => any) | undefined;
467
- }>, "form" | "validate" | "clearValidate" | ("watchDeep" | "showFooter" | "footerClass" | "submitText" | "cancelText" | "submitDisabled" | "cancelDisabled" | "showCount") | "getFormInstance"> & {
467
+ }>, "form" | "validate" | "clearValidate" | ("cancelText" | "footerClass" | "watchDeep" | "showFooter" | "submitText" | "submitDisabled" | "cancelDisabled" | "showCount") | "getFormInstance"> & {
468
468
  validate: (callback?: (isValid: boolean, invalidFields?: any) => void) => Promise<boolean>;
469
469
  clearValidate: (props?: any) => void;
470
470
  getFormInstance: () => ({
package/dist/es/style.css CHANGED
@@ -496,6 +496,10 @@
496
496
  left: calc(var(--spacing) * 0);
497
497
  }
498
498
 
499
+ .left-4 {
500
+ left: calc(var(--spacing) * 4);
501
+ }
502
+
499
503
  .z-30 {
500
504
  z-index: 30;
501
505
  }
@@ -2326,6 +2330,16 @@
2326
2330
  }
2327
2331
  }
2328
2332
 
2333
+ .bg-white\/90 {
2334
+ background-color: #ffffffe6;
2335
+ }
2336
+
2337
+ @supports (color: color-mix(in lab, red, red)) {
2338
+ .bg-white\/90 {
2339
+ background-color: color-mix(in oklab, var(--color-white) 90%, transparent);
2340
+ }
2341
+ }
2342
+
2329
2343
  .bg-yellow-50 {
2330
2344
  background-color: var(--color-yellow-50);
2331
2345
  }
@@ -0,0 +1,43 @@
1
+ import { AMapPickerProps, CoordinateValue } from './types';
2
+ type __VLS_Props = AMapPickerProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: CoordinateValue | null;
5
+ } & __VLS_Props;
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ button?(_: {}): any;
10
+ };
11
+ refs: {};
12
+ rootEl: HTMLDivElement;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ "update:modelValue": (value: CoordinateValue | null) => any;
17
+ } & {
18
+ "update:modelValue": (value: CoordinateValue | null) => any;
19
+ change: (value: CoordinateValue | null) => any;
20
+ cancel: () => any;
21
+ confirm: (value: CoordinateValue | null) => any;
22
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
+ "onUpdate:modelValue"?: ((value: CoordinateValue | null) => any) | undefined;
24
+ onChange?: ((value: CoordinateValue | null) => any) | undefined;
25
+ onCancel?: (() => any) | undefined;
26
+ onConfirm?: ((value: CoordinateValue | null) => any) | undefined;
27
+ }>, {
28
+ size: string | number;
29
+ title: string;
30
+ center: [number, number];
31
+ disabled: boolean;
32
+ token: string;
33
+ zoom: number;
34
+ mode: "dialog" | "drawer";
35
+ buttonText: string;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
37
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
38
+ export default _default;
39
+ type __VLS_WithTemplateSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
22
+ const vue = require("vue");
23
+ const ElementPlus = require("element-plus");
24
+ const Modal_vue_vue_type_script_setup_true_lang = require("../../modal/Modal.vue.js");
25
+ ;/* empty css */
26
+ const AMap_vue_vue_type_script_setup_true_lang = require("../AMap.vue.js");
27
+ ;/* empty css */
28
+ const AMarker_vue_vue_type_script_setup_true_lang = require("../AMarker.vue.js");
29
+ ;/* empty css */
30
+ const _hoisted_1 = { class: "inline-block jky-amap-picker" };
31
+ const _hoisted_2 = { class: "relative overflow-hidden jky-amap-picker__map-wrapper" };
32
+ const _hoisted_3 = {
33
+ key: 0,
34
+ class: "absolute left-4 top-2 p-2 bg-white/90 shadow-blueGray flex items-center gap-x-2 jky-amap-picker__coordinate-info"
35
+ };
36
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
37
+ name: "JkyAMapPicker"
38
+ }), {
39
+ __name: "AMapPicker",
40
+ props: /* @__PURE__ */ vue.mergeModels({
41
+ token: { default: "75f62fbef756459563f042e5a2a1fd7c" },
42
+ buttonText: { default: "选择坐标" },
43
+ title: { default: "选择坐标位置" },
44
+ mode: { default: "dialog" },
45
+ size: { default: "800px" },
46
+ zoom: { default: 11 },
47
+ center: { default: () => [116.397428, 39.90923] },
48
+ disabled: { type: Boolean, default: false }
49
+ }, {
50
+ "modelValue": {},
51
+ "modelModifiers": {}
52
+ }),
53
+ emits: /* @__PURE__ */ vue.mergeModels(["update:modelValue", "change", "confirm", "cancel"], ["update:modelValue"]),
54
+ setup(__props, { emit: __emit }) {
55
+ const props = __props;
56
+ const emit = __emit;
57
+ const modelValue = vue.useModel(__props, "modelValue");
58
+ const modalVisible = vue.ref(false);
59
+ const selectedCoordinate = vue.ref(null);
60
+ function openModal() {
61
+ if (props.disabled)
62
+ return;
63
+ selectedCoordinate.value = modelValue.value ? __spreadValues({}, modelValue.value) : null;
64
+ modalVisible.value = true;
65
+ }
66
+ function handleMapClick(data) {
67
+ if (data && data.lnglat) {
68
+ selectedCoordinate.value = {
69
+ lng: data.lnglat.lng,
70
+ lat: data.lnglat.lat
71
+ };
72
+ }
73
+ }
74
+ function handleConfirm() {
75
+ modelValue.value = selectedCoordinate.value;
76
+ emit("change", selectedCoordinate.value);
77
+ emit("confirm", selectedCoordinate.value);
78
+ modalVisible.value = false;
79
+ }
80
+ function handleCancel() {
81
+ emit("cancel");
82
+ modalVisible.value = false;
83
+ }
84
+ return (_ctx, _cache) => {
85
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
86
+ vue.renderSlot(_ctx.$slots, "button", {}, () => [
87
+ vue.createVNode(vue.unref(ElementPlus.ElButton), {
88
+ type: "primary",
89
+ disabled: __props.disabled,
90
+ onClick: openModal
91
+ }, {
92
+ default: vue.withCtx(() => [
93
+ vue.createTextVNode(vue.toDisplayString(__props.buttonText), 1)
94
+ ]),
95
+ _: 1
96
+ }, 8, ["disabled"])
97
+ ]),
98
+ vue.createVNode(Modal_vue_vue_type_script_setup_true_lang.default, {
99
+ modelValue: modalVisible.value,
100
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modalVisible.value = $event),
101
+ title: __props.title,
102
+ mode: __props.mode,
103
+ size: __props.size,
104
+ onConfirm: handleConfirm,
105
+ onCancel: handleCancel
106
+ }, {
107
+ default: vue.withCtx(() => [
108
+ vue.createElementVNode("div", _hoisted_2, [
109
+ vue.createVNode(AMap_vue_vue_type_script_setup_true_lang.default, {
110
+ token: __props.token,
111
+ zoom: __props.zoom,
112
+ center: __props.center,
113
+ height: "320px",
114
+ onClick: handleMapClick
115
+ }, {
116
+ default: vue.withCtx(() => {
117
+ var _a, _b;
118
+ return [
119
+ selectedCoordinate.value ? (vue.openBlock(), vue.createBlock(AMarker_vue_vue_type_script_setup_true_lang.default, {
120
+ key: 0,
121
+ markers: [{
122
+ position: [(_a = selectedCoordinate.value) == null ? void 0 : _a.lng, (_b = selectedCoordinate.value) == null ? void 0 : _b.lat]
123
+ }],
124
+ draggable: ""
125
+ }, null, 8, ["markers"])) : vue.createCommentVNode("", true)
126
+ ];
127
+ }),
128
+ _: 1
129
+ }, 8, ["token", "zoom", "center"]),
130
+ selectedCoordinate.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
131
+ vue.createElementVNode("span", null, "经度: " + vue.toDisplayString(selectedCoordinate.value.lng.toFixed(6)), 1),
132
+ vue.createElementVNode("span", null, "纬度: " + vue.toDisplayString(selectedCoordinate.value.lat.toFixed(6)), 1)
133
+ ])) : vue.createCommentVNode("", true)
134
+ ])
135
+ ]),
136
+ _: 1
137
+ }, 8, ["modelValue", "title", "mode", "size"])
138
+ ]);
139
+ };
140
+ }
141
+ }));
142
+ exports.default = _sfc_main;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const AMapPicker_vue_vue_type_script_setup_true_lang = require("./AMapPicker.vue.js");
4
+ exports.default = AMapPicker_vue_vue_type_script_setup_true_lang.default;
@@ -1,9 +1,11 @@
1
1
  import { InstallWithSFC } from '../utils';
2
2
  import { default as AMap } from './AMap.vue';
3
+ import { default as AMapPicker } from './AMapPicker/AMapPicker.vue';
3
4
  import { default as AMarker } from './AMarker.vue';
4
5
  import { default as ATrackPlayback } from './ATrackPlayback.vue';
5
6
  export declare const JkyAMap: InstallWithSFC<typeof AMap>;
7
+ export declare const JkyAMapPicker: InstallWithSFC<typeof AMapPicker>;
6
8
  export declare const JkyAMarker: InstallWithSFC<typeof AMarker>;
7
9
  export declare const JkyATrackPlayback: InstallWithSFC<typeof ATrackPlayback>;
8
10
  export default JkyAMap;
9
- export { AMarker, ATrackPlayback };
11
+ export { AMapPicker, AMarker, ATrackPlayback };