jky-component-lib 0.0.125 → 0.0.127

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 (35) hide show
  1. package/dist/es/amap/style.css +13 -2
  2. package/dist/es/amap/style2.css +2 -6
  3. package/dist/es/amap/style3.css +5 -12
  4. package/dist/es/components.js +3 -1
  5. package/dist/es/form/FormItem.vue.js +23 -11
  6. package/dist/es/form/LinkedSelect.vue.d.ts +36 -0
  7. package/dist/es/form/LinkedSelect.vue.js +161 -0
  8. package/dist/es/form/LinkedSelect.vue2.js +4 -0
  9. package/dist/es/form/index.d.ts +3 -1
  10. package/dist/es/form/index.js +3 -0
  11. package/dist/es/index.js +2 -1
  12. package/dist/es/package.json.js +1 -1
  13. package/dist/es/page-table/ActionColumn.vue.d.ts +1 -1
  14. package/dist/es/page-table/ActionColumn.vue.js +1 -1
  15. package/dist/es/page-table/PageTable.vue.d.ts +1 -1
  16. package/dist/es/page-table-v2/PageTableV2.vue.d.ts +1 -1
  17. package/dist/es/style.css +4 -0
  18. package/dist/lib/amap/style.css +13 -2
  19. package/dist/lib/amap/style2.css +2 -6
  20. package/dist/lib/amap/style3.css +5 -12
  21. package/dist/lib/components.js +2 -0
  22. package/dist/lib/form/FormItem.vue.js +20 -8
  23. package/dist/lib/form/LinkedSelect.vue.d.ts +36 -0
  24. package/dist/lib/form/LinkedSelect.vue.js +161 -0
  25. package/dist/lib/form/LinkedSelect.vue2.js +4 -0
  26. package/dist/lib/form/index.d.ts +3 -1
  27. package/dist/lib/form/index.js +3 -0
  28. package/dist/lib/index.js +1 -0
  29. package/dist/lib/package.json.js +1 -1
  30. package/dist/lib/page-table/ActionColumn.vue.d.ts +1 -1
  31. package/dist/lib/page-table/ActionColumn.vue.js +1 -1
  32. package/dist/lib/page-table/PageTable.vue.d.ts +1 -1
  33. package/dist/lib/page-table-v2/PageTableV2.vue.d.ts +1 -1
  34. package/dist/lib/style.css +4 -0
  35. package/package.json +1 -1
@@ -1,3 +1,14 @@
1
+ /* AMap 高德地图组件样式 */
2
+ .jky-amap-container {
3
+ /* 地图容器样式 */
4
+ position: relative;
5
+ overflow: hidden;
1
6
 
2
- /* 轨迹回放组件不需要额外样式 */
3
- /* 所有样式通过 TailwindCSS 工具类或外部组件控制 */
7
+ /* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
8
+ .amap-logo {
9
+ display: none !important;
10
+ }
11
+ .amap-copyright {
12
+ display: none !important;
13
+ }
14
+ }
@@ -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
  }
@@ -4,7 +4,7 @@ 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";
7
- import { JkyForm } from "./form/index.js";
7
+ import { JkyForm, JkyLinkedSelect } from "./form/index.js";
8
8
  import { JkyMenu } from "./menu/index.js";
9
9
  import { JkyModal } from "./modal/index.js";
10
10
  import { JkyPageHeader } from "./page-header/index.js";
@@ -22,6 +22,7 @@ const components = [
22
22
  JkyPageHeader,
23
23
  JkyMenu,
24
24
  JkyForm,
25
+ JkyLinkedSelect,
25
26
  JkyCodeMirrorEditor,
26
27
  JkyAddInput,
27
28
  JkyRichEditor,
@@ -42,6 +43,7 @@ export {
42
43
  JkyButtonNav,
43
44
  JkyCodeMirrorEditor,
44
45
  JkyForm,
46
+ JkyLinkedSelect,
45
47
  JkyMenu,
46
48
  JkyModal,
47
49
  JkyPageHeader,
@@ -49,13 +49,14 @@ var __async = (__this, __arguments, generator) => {
49
49
  step((generator = generator.apply(__this, __arguments)).next());
50
50
  });
51
51
  };
52
- import { defineComponent, ref, watch, computed, openBlock, createElementBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, resolveDynamicComponent, Fragment, createTextVNode, toDisplayString, createCommentVNode, createSlots, h } from "vue";
52
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, resolveDynamicComponent, Fragment, createTextVNode, toDisplayString, createCommentVNode, createSlots, h } from "vue";
53
53
  import { Plus, CircleCloseFilled, CircleCheckFilled, WarningFilled, QuestionFilled } from "@element-plus/icons-vue";
54
54
  import { ElFormItem, ElDivider, ElInput, ElUpload, ElButton, ElIcon, ElInputNumber, ElRate, ElTransfer, ElSelectV2, ElMention, ElInputTag, ElColorPickerPanel, ElColorPicker, ElTreeSelect, ElCascader, ElSlider, ElSwitch, ElCheckboxGroup, ElCheckbox, ElRadioGroup, ElRadioButton, ElRadio, ElTimeSelect, ElTimePicker, ElDatePicker, ElAutocomplete, ElSelect, ElTooltip } from "element-plus";
55
55
  import { JkyAddInput } from "../add-input/index.js";
56
56
  import { JkyCodeMirrorEditor } from "../code-mirror-editor/index.js";
57
57
  import { JkyRichEditor } from "../rich-editor/index.js";
58
- import _sfc_main$1 from "./SelectTable.vue.js";
58
+ import _sfc_main$1 from "./LinkedSelect.vue.js";
59
+ import _sfc_main$2 from "./SelectTable.vue.js";
59
60
  /* empty css */
60
61
  const _hoisted_1 = {
61
62
  key: 0,
@@ -159,14 +160,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
159
160
  rules.value = configRules;
160
161
  });
161
162
  }
162
- watch(
163
- () => props.model,
164
- () => {
165
- loadComponentProps();
166
- loadRules();
167
- },
168
- { deep: true }
169
- );
170
163
  loadComponentProps();
171
164
  loadRules();
172
165
  const modelValue = computed({
@@ -175,6 +168,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
175
168
  props.model[props.field] = val;
176
169
  }
177
170
  });
171
+ watch(
172
+ () => props.model,
173
+ () => {
174
+ loadComponentProps();
175
+ loadRules();
176
+ },
177
+ { deep: true }
178
+ );
178
179
  const isHidden = computed(() => {
179
180
  if (typeof props.config.hidden === "function") {
180
181
  return props.config.hidden({
@@ -420,7 +421,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
420
421
  }
421
422
  // 表格选择器
422
423
  case "select-table":
423
- return h(_sfc_main$1, __spreadProps(__spreadValues(__spreadValues({}, commonProps), componentProps.value), {
424
+ return h(_sfc_main$2, __spreadProps(__spreadValues(__spreadValues({}, commonProps), componentProps.value), {
424
425
  labelWidth: formItemProps.value.labelWidth
425
426
  }), _componentSlotsObj);
426
427
  case "rate":
@@ -490,6 +491,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
490
491
  const addInputProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
491
492
  return h(JkyAddInput, addInputProps, _componentSlotsObj);
492
493
  }
494
+ // 联动下拉框
495
+ case "linked-select":
496
+ return h(_sfc_main$1, {
497
+ "config": props.config.config,
498
+ "modelValue": modelValue.value,
499
+ "disabled": props.disabled,
500
+ "componentProps": componentProps.value,
501
+ "onUpdate:modelValue": (val) => {
502
+ props.model[props.field] = val;
503
+ }
504
+ }, _componentSlotsObj);
493
505
  case "custom":
494
506
  return (_b = (_a = props.config).render) == null ? void 0 : _b.call(_a, commonProps);
495
507
  default:
@@ -0,0 +1,36 @@
1
+ import { LinkedSelectConfig } from './types';
2
+ interface Props {
3
+ config?: LinkedSelectConfig;
4
+ modelValue?: any[];
5
+ disabled?: boolean;
6
+ componentProps?: Record<string, any>;
7
+ }
8
+ declare function __VLS_template(): {
9
+ attrs: Partial<{}>;
10
+ slots: {
11
+ prefix?(_: {}): any;
12
+ suffix?(_: {}): any;
13
+ };
14
+ refs: {};
15
+ rootEl: HTMLDivElement;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
+ "update:modelValue": (value: any[]) => any;
20
+ change: (value: any[]) => any;
21
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
23
+ onChange?: ((value: any[]) => any) | undefined;
24
+ }>, {
25
+ modelValue: any[];
26
+ disabled: boolean;
27
+ config: LinkedSelectConfig;
28
+ componentProps: Record<string, any>;
29
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
30
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
+ export default _default;
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,161 @@
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
+ var __async = (__this, __arguments, generator) => {
21
+ return new Promise((resolve, reject) => {
22
+ var fulfilled = (value) => {
23
+ try {
24
+ step(generator.next(value));
25
+ } catch (e) {
26
+ reject(e);
27
+ }
28
+ };
29
+ var rejected = (value) => {
30
+ try {
31
+ step(generator.throw(value));
32
+ } catch (e) {
33
+ reject(e);
34
+ }
35
+ };
36
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
+ step((generator = generator.apply(__this, __arguments)).next());
38
+ });
39
+ };
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
+ const _hoisted_1 = { class: "flex gap-2" };
43
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
44
+ name: "JkyLinkedSelect"
45
+ }), {
46
+ __name: "LinkedSelect",
47
+ props: {
48
+ config: { default: void 0 },
49
+ modelValue: { default: () => [] },
50
+ disabled: { type: Boolean, default: false },
51
+ componentProps: { default: void 0 }
52
+ },
53
+ emits: ["update:modelValue", "change"],
54
+ setup(__props, { emit: __emit }) {
55
+ var _a;
56
+ const props = __props;
57
+ const emit = __emit;
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) {
65
+ return __async(this, null, function* () {
66
+ var _a2;
67
+ if (!((_a2 = props.config) == null ? void 0 : _a2.getOptions) || levelIndex >= level) {
68
+ return;
69
+ }
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;
79
+ }
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]);
87
+ }
88
+ }
89
+ });
90
+ }
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];
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
+ }
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
+ });
123
+ return (_ctx, _cache) => {
124
+ return openBlock(), createElementBlock("div", _hoisted_1, [
125
+ renderSlot(_ctx.$slots, "prefix"),
126
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Array.from({ length: unref(level) }), (_, index) => {
127
+ var _a2, _b, _c, _d, _e, _f;
128
+ return openBlock(), createBlock(unref(ElSelect), mergeProps({
129
+ key: index,
130
+ modelValue: values.value[index],
131
+ "onUpdate:modelValue": ($event) => values.value[index] = $event,
132
+ placeholder: ((_b = (_a2 = __props.config) == null ? void 0 : _a2.placeholders) == null ? void 0 : _b[index]) || "请选择",
133
+ disabled: __props.disabled || index > 0 && values.value[index - 1] === void 0 && values.value[index - 1] !== null,
134
+ filterable: (_d = (_c = __props.config) == null ? void 0 : _c.filterable) != null ? _d : false,
135
+ clearable: (_f = (_e = __props.config) == null ? void 0 : _e.clearable) != null ? _f : true,
136
+ loading: loadingList.value[index],
137
+ class: "flex-1 min-w-30"
138
+ }, { ref_for: true }, __props.componentProps, {
139
+ onChange: ($event) => handleSelectChange(index, $event)
140
+ }), {
141
+ default: withCtx(() => [
142
+ (openBlock(true), createElementBlock(Fragment, null, renderList(optionsList.value[index] || [], (option) => {
143
+ return openBlock(), createBlock(unref(ElOption), {
144
+ key: option.value,
145
+ value: option.value,
146
+ label: option.label,
147
+ disabled: option.disabled
148
+ }, null, 8, ["value", "label", "disabled"]);
149
+ }), 128))
150
+ ]),
151
+ _: 2
152
+ }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "filterable", "clearable", "loading", "onChange"]);
153
+ }), 128)),
154
+ renderSlot(_ctx.$slots, "suffix")
155
+ ]);
156
+ };
157
+ }
158
+ }));
159
+ export {
160
+ _sfc_main as default
161
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./LinkedSelect.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -1,5 +1,7 @@
1
1
  import { InstallWithSFC } from '../utils';
2
2
  import { default as Form } from './Form.vue';
3
- export type { ComponentPropsMap, ComponentPropsType, DynamicComponentProps, FormComponentType, FormItemChildConfig, FormItemConfig, FormItemOption, FormItemProps, FormItemPropsContext, FormProps, FormValidateResult, GridConfig, HelpConfig, HelpType, ResponsiveBreakpoint, ResponsiveConfig, SelectTableComponentProps, SelectTableProps, StaticComponentProps, } from './types';
3
+ 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';
4
5
  export declare const JkyForm: InstallWithSFC<typeof Form>;
6
+ export declare const JkyLinkedSelect: InstallWithSFC<typeof LinkedSelect>;
5
7
  export default JkyForm;
@@ -1,8 +1,11 @@
1
1
  import _sfc_main from "./Form.vue.js";
2
2
  /* empty css */
3
+ import _sfc_main$1 from "./LinkedSelect.vue.js";
3
4
  import { installWithSFC } from "../utils/with-install.js";
4
5
  const JkyForm = installWithSFC(_sfc_main);
6
+ const JkyLinkedSelect = installWithSFC(_sfc_main$1);
5
7
  export {
6
8
  JkyForm,
9
+ JkyLinkedSelect,
7
10
  JkyForm as default
8
11
  };
package/dist/es/index.js CHANGED
@@ -12,7 +12,7 @@ import { JkyAddInput } from "./add-input/index.js";
12
12
  import { JkyButton } from "./button/index.js";
13
13
  import { JkyButtonNav } from "./button-nav/index.js";
14
14
  import { JkyCodeMirrorEditor } from "./code-mirror-editor/index.js";
15
- import { JkyForm } from "./form/index.js";
15
+ import { JkyForm, JkyLinkedSelect } from "./form/index.js";
16
16
  import { JkyMenu } from "./menu/index.js";
17
17
  import { JkyModal } from "./modal/index.js";
18
18
  import { JkyPageHeader } from "./page-header/index.js";
@@ -39,6 +39,7 @@ export {
39
39
  JkyCodeMirrorEditor,
40
40
  JkyComponentLibResolver,
41
41
  JkyForm,
42
+ JkyLinkedSelect,
42
43
  JkyMenu,
43
44
  JkyModal,
44
45
  JkyPageHeader,
@@ -1,4 +1,4 @@
1
- const version = "0.0.125";
1
+ const version = "0.0.127";
2
2
  export {
3
3
  version
4
4
  };
@@ -5,7 +5,7 @@ declare const _default: import('vue').DefineComponent<ActionColumnProps, {}, {},
5
5
  onClick?: ((button: ActionColumnButtonConfig, row: any, index: number) => any) | undefined;
6
6
  }>, {
7
7
  index: number;
8
- row: any;
9
8
  config: ActionColumnConfig;
9
+ row: any;
10
10
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
11
11
  export default _default;
@@ -86,7 +86,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
86
86
  disabled: button.disabled,
87
87
  icon: button.icon,
88
88
  plain: button.plain,
89
- class: normalizeClass(button.class),
89
+ class: normalizeClass(["ml-0!", button.class]),
90
90
  text: "",
91
91
  onClick: ($event) => handleButtonClick(button)
92
92
  }, {
@@ -2812,6 +2812,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
2812
2812
  }>, {
2813
2813
  title: string;
2814
2814
  loading: boolean;
2815
+ emptyText: string;
2815
2816
  toolbarButtonLimit: number;
2816
2817
  withCard: boolean;
2817
2818
  filterItems: import('./types').FilterItemConfig[];
@@ -2825,7 +2826,6 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
2825
2826
  selectedRows: any[];
2826
2827
  border: boolean;
2827
2828
  stripe: boolean;
2828
- emptyText: string;
2829
2829
  formProps: Partial<import('../form').FormProps>;
2830
2830
  tableProps: Partial<import('element-plus').TableProps>;
2831
2831
  paginationProps: Partial<import('element-plus').PaginationProps>;
@@ -37,13 +37,13 @@ declare const _default: import('vue').DefineComponent<PageTableV2Props, {
37
37
  }>, {
38
38
  title: string;
39
39
  loading: boolean;
40
+ emptyText: string;
40
41
  toolbarButtonLimit: number;
41
42
  withCard: boolean;
42
43
  filterItems: import('../form').FormProps["items"];
43
44
  showSearchButton: boolean;
44
45
  searchText: string;
45
46
  resetText: string;
46
- emptyText: string;
47
47
  formProps: Partial<import('../form').FormProps>;
48
48
  tableProps: Partial<import('element-plus').TableV2Props<any>>;
49
49
  autoSearchDelay: number;
package/dist/es/style.css CHANGED
@@ -1854,6 +1854,10 @@
1854
1854
  min-width: calc(var(--spacing) * 25);
1855
1855
  }
1856
1856
 
1857
+ .min-w-30 {
1858
+ min-width: calc(var(--spacing) * 30);
1859
+ }
1860
+
1857
1861
  .flex-1 {
1858
1862
  flex: 1;
1859
1863
  }
@@ -1,3 +1,14 @@
1
+ /* AMap 高德地图组件样式 */
2
+ .jky-amap-container {
3
+ /* 地图容器样式 */
4
+ position: relative;
5
+ overflow: hidden;
1
6
 
2
- /* 轨迹回放组件不需要额外样式 */
3
- /* 所有样式通过 TailwindCSS 工具类或外部组件控制 */
7
+ /* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
8
+ .amap-logo {
9
+ display: none !important;
10
+ }
11
+ .amap-copyright {
12
+ display: none !important;
13
+ }
14
+ }
@@ -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
  }
@@ -22,6 +22,7 @@ const components = [
22
22
  index$9.JkyPageHeader,
23
23
  index$7.JkyMenu,
24
24
  index$6.JkyForm,
25
+ index$6.JkyLinkedSelect,
25
26
  index$5.JkyCodeMirrorEditor,
26
27
  index$2.JkyAddInput,
27
28
  index$c.JkyRichEditor,
@@ -40,6 +41,7 @@ exports.JkyButton = index$3.JkyButton;
40
41
  exports.JkyButtonNav = index$4.JkyButtonNav;
41
42
  exports.JkyCodeMirrorEditor = index$5.JkyCodeMirrorEditor;
42
43
  exports.JkyForm = index$6.JkyForm;
44
+ exports.JkyLinkedSelect = index$6.JkyLinkedSelect;
43
45
  exports.JkyMenu = index$7.JkyMenu;
44
46
  exports.JkyModal = index$8.JkyModal;
45
47
  exports.JkyPageHeader = index$9.JkyPageHeader;
@@ -57,6 +57,7 @@ const ElementPlus = require("element-plus");
57
57
  const index = require("../add-input/index.js");
58
58
  const index$2 = require("../code-mirror-editor/index.js");
59
59
  const index$1 = require("../rich-editor/index.js");
60
+ const LinkedSelect_vue_vue_type_script_setup_true_lang = require("./LinkedSelect.vue.js");
60
61
  const SelectTable_vue_vue_type_script_setup_true_lang = require("./SelectTable.vue.js");
61
62
  ;/* empty css */
62
63
  const _hoisted_1 = {
@@ -161,14 +162,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
161
162
  rules.value = configRules;
162
163
  });
163
164
  }
164
- vue.watch(
165
- () => props.model,
166
- () => {
167
- loadComponentProps();
168
- loadRules();
169
- },
170
- { deep: true }
171
- );
172
165
  loadComponentProps();
173
166
  loadRules();
174
167
  const modelValue = vue.computed({
@@ -177,6 +170,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
177
170
  props.model[props.field] = val;
178
171
  }
179
172
  });
173
+ vue.watch(
174
+ () => props.model,
175
+ () => {
176
+ loadComponentProps();
177
+ loadRules();
178
+ },
179
+ { deep: true }
180
+ );
180
181
  const isHidden = vue.computed(() => {
181
182
  if (typeof props.config.hidden === "function") {
182
183
  return props.config.hidden({
@@ -492,6 +493,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
492
493
  const addInputProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
493
494
  return vue.h(index.JkyAddInput, addInputProps, _componentSlotsObj);
494
495
  }
496
+ // 联动下拉框
497
+ case "linked-select":
498
+ return vue.h(LinkedSelect_vue_vue_type_script_setup_true_lang.default, {
499
+ "config": props.config.config,
500
+ "modelValue": modelValue.value,
501
+ "disabled": props.disabled,
502
+ "componentProps": componentProps.value,
503
+ "onUpdate:modelValue": (val) => {
504
+ props.model[props.field] = val;
505
+ }
506
+ }, _componentSlotsObj);
495
507
  case "custom":
496
508
  return (_b = (_a = props.config).render) == null ? void 0 : _b.call(_a, commonProps);
497
509
  default:
@@ -0,0 +1,36 @@
1
+ import { LinkedSelectConfig } from './types';
2
+ interface Props {
3
+ config?: LinkedSelectConfig;
4
+ modelValue?: any[];
5
+ disabled?: boolean;
6
+ componentProps?: Record<string, any>;
7
+ }
8
+ declare function __VLS_template(): {
9
+ attrs: Partial<{}>;
10
+ slots: {
11
+ prefix?(_: {}): any;
12
+ suffix?(_: {}): any;
13
+ };
14
+ refs: {};
15
+ rootEl: HTMLDivElement;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
+ "update:modelValue": (value: any[]) => any;
20
+ change: (value: any[]) => any;
21
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
23
+ onChange?: ((value: any[]) => any) | undefined;
24
+ }>, {
25
+ modelValue: any[];
26
+ disabled: boolean;
27
+ config: LinkedSelectConfig;
28
+ componentProps: Record<string, any>;
29
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
30
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
+ export default _default;
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,161 @@
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
+ var __async = (__this, __arguments, generator) => {
22
+ return new Promise((resolve, reject) => {
23
+ var fulfilled = (value) => {
24
+ try {
25
+ step(generator.next(value));
26
+ } catch (e) {
27
+ reject(e);
28
+ }
29
+ };
30
+ var rejected = (value) => {
31
+ try {
32
+ step(generator.throw(value));
33
+ } catch (e) {
34
+ reject(e);
35
+ }
36
+ };
37
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
38
+ step((generator = generator.apply(__this, __arguments)).next());
39
+ });
40
+ };
41
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
42
+ const vue = require("vue");
43
+ const ElementPlus = require("element-plus");
44
+ const _hoisted_1 = { class: "flex gap-2" };
45
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
46
+ name: "JkyLinkedSelect"
47
+ }), {
48
+ __name: "LinkedSelect",
49
+ props: {
50
+ config: { default: void 0 },
51
+ modelValue: { default: () => [] },
52
+ disabled: { type: Boolean, default: false },
53
+ componentProps: { default: void 0 }
54
+ },
55
+ emits: ["update:modelValue", "change"],
56
+ setup(__props, { emit: __emit }) {
57
+ var _a;
58
+ const props = __props;
59
+ const emit = __emit;
60
+ const level = ((_a = props.config) == null ? void 0 : _a.level) || 1;
61
+ const optionsList = vue.ref(Array.from({ length: level }, () => []));
62
+ const loadingList = vue.ref(Array.from({ length: level }, () => false));
63
+ const values = vue.ref(
64
+ props.modelValue && props.modelValue.length > 0 ? props.modelValue.slice(0, level) : Array.from({ length: level }, () => void 0)
65
+ );
66
+ function loadOptions(levelIndex, value) {
67
+ return __async(this, null, function* () {
68
+ var _a2;
69
+ if (!((_a2 = props.config) == null ? void 0 : _a2.getOptions) || levelIndex >= level) {
70
+ return;
71
+ }
72
+ loadingList.value[levelIndex] = true;
73
+ try {
74
+ const levelOptions = yield props.config.getOptions(levelIndex + 1, value);
75
+ optionsList.value[levelIndex] = levelOptions || [];
76
+ } catch (error) {
77
+ console.error("Failed to load linked select options:", error);
78
+ optionsList.value[levelIndex] = [];
79
+ } finally {
80
+ loadingList.value[levelIndex] = false;
81
+ }
82
+ });
83
+ }
84
+ function loadDisplayData() {
85
+ return __async(this, null, function* () {
86
+ for (let i = 0; i < level - 1; i++) {
87
+ if (values.value[i] !== void 0 && values.value[i] !== null) {
88
+ yield loadOptions(i + 1, values.value[i]);
89
+ }
90
+ }
91
+ });
92
+ }
93
+ function watchModelValue() {
94
+ vue.watch(
95
+ () => props.modelValue,
96
+ (newVal) => __async(null, null, function* () {
97
+ if (newVal && newVal.length > 0) {
98
+ values.value = [...newVal];
99
+ yield loadDisplayData();
100
+ }
101
+ }),
102
+ { deep: true }
103
+ );
104
+ }
105
+ function handleSelectChange(index, value) {
106
+ for (let i = index + 1; i < level; i++) {
107
+ values.value[i] = void 0;
108
+ optionsList.value[i] = [];
109
+ }
110
+ const newValue = [...values.value];
111
+ emit("update:modelValue", newValue);
112
+ emit("change", newValue);
113
+ if (value !== void 0 && value !== null && index + 1 < level) {
114
+ loadOptions(index + 1, value);
115
+ }
116
+ }
117
+ vue.onMounted(() => {
118
+ var _a2;
119
+ watchModelValue();
120
+ loadDisplayData();
121
+ if ((_a2 = props.config) == null ? void 0 : _a2.getOptions) {
122
+ loadOptions(0, void 0);
123
+ }
124
+ });
125
+ return (_ctx, _cache) => {
126
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
127
+ vue.renderSlot(_ctx.$slots, "prefix"),
128
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Array.from({ length: vue.unref(level) }), (_, index) => {
129
+ var _a2, _b, _c, _d, _e, _f;
130
+ return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElSelect), vue.mergeProps({
131
+ key: index,
132
+ modelValue: values.value[index],
133
+ "onUpdate:modelValue": ($event) => values.value[index] = $event,
134
+ placeholder: ((_b = (_a2 = __props.config) == null ? void 0 : _a2.placeholders) == null ? void 0 : _b[index]) || "请选择",
135
+ disabled: __props.disabled || index > 0 && values.value[index - 1] === void 0 && values.value[index - 1] !== null,
136
+ filterable: (_d = (_c = __props.config) == null ? void 0 : _c.filterable) != null ? _d : false,
137
+ clearable: (_f = (_e = __props.config) == null ? void 0 : _e.clearable) != null ? _f : true,
138
+ loading: loadingList.value[index],
139
+ class: "flex-1 min-w-30"
140
+ }, { ref_for: true }, __props.componentProps, {
141
+ onChange: ($event) => handleSelectChange(index, $event)
142
+ }), {
143
+ default: vue.withCtx(() => [
144
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(optionsList.value[index] || [], (option) => {
145
+ return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElOption), {
146
+ key: option.value,
147
+ value: option.value,
148
+ label: option.label,
149
+ disabled: option.disabled
150
+ }, null, 8, ["value", "label", "disabled"]);
151
+ }), 128))
152
+ ]),
153
+ _: 2
154
+ }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "filterable", "clearable", "loading", "onChange"]);
155
+ }), 128)),
156
+ vue.renderSlot(_ctx.$slots, "suffix")
157
+ ]);
158
+ };
159
+ }
160
+ }));
161
+ exports.default = _sfc_main;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const LinkedSelect_vue_vue_type_script_setup_true_lang = require("./LinkedSelect.vue.js");
4
+ exports.default = LinkedSelect_vue_vue_type_script_setup_true_lang.default;
@@ -1,5 +1,7 @@
1
1
  import { InstallWithSFC } from '../utils';
2
2
  import { default as Form } from './Form.vue';
3
- export type { ComponentPropsMap, ComponentPropsType, DynamicComponentProps, FormComponentType, FormItemChildConfig, FormItemConfig, FormItemOption, FormItemProps, FormItemPropsContext, FormProps, FormValidateResult, GridConfig, HelpConfig, HelpType, ResponsiveBreakpoint, ResponsiveConfig, SelectTableComponentProps, SelectTableProps, StaticComponentProps, } from './types';
3
+ 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';
4
5
  export declare const JkyForm: InstallWithSFC<typeof Form>;
6
+ export declare const JkyLinkedSelect: InstallWithSFC<typeof LinkedSelect>;
5
7
  export default JkyForm;
@@ -2,7 +2,10 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const Form_vue_vue_type_script_setup_true_lang = require("./Form.vue.js");
4
4
  ;/* empty css */
5
+ const LinkedSelect_vue_vue_type_script_setup_true_lang = require("./LinkedSelect.vue.js");
5
6
  const withInstall = require("../utils/with-install.js");
6
7
  const JkyForm = withInstall.installWithSFC(Form_vue_vue_type_script_setup_true_lang.default);
8
+ const JkyLinkedSelect = withInstall.installWithSFC(LinkedSelect_vue_vue_type_script_setup_true_lang.default);
7
9
  exports.JkyForm = JkyForm;
10
+ exports.JkyLinkedSelect = JkyLinkedSelect;
8
11
  exports.default = JkyForm;
package/dist/lib/index.js CHANGED
@@ -43,6 +43,7 @@ exports.JkyButton = index$3.JkyButton;
43
43
  exports.JkyButtonNav = index$4.JkyButtonNav;
44
44
  exports.JkyCodeMirrorEditor = index$5.JkyCodeMirrorEditor;
45
45
  exports.JkyForm = index$6.JkyForm;
46
+ exports.JkyLinkedSelect = index$6.JkyLinkedSelect;
46
47
  exports.JkyMenu = index$7.JkyMenu;
47
48
  exports.JkyModal = index$8.JkyModal;
48
49
  exports.JkyPageHeader = index$9.JkyPageHeader;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "0.0.125";
3
+ const version = "0.0.127";
4
4
  exports.version = version;
@@ -5,7 +5,7 @@ declare const _default: import('vue').DefineComponent<ActionColumnProps, {}, {},
5
5
  onClick?: ((button: ActionColumnButtonConfig, row: any, index: number) => any) | undefined;
6
6
  }>, {
7
7
  index: number;
8
- row: any;
9
8
  config: ActionColumnConfig;
9
+ row: any;
10
10
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
11
11
  export default _default;
@@ -88,7 +88,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
88
88
  disabled: button.disabled,
89
89
  icon: button.icon,
90
90
  plain: button.plain,
91
- class: vue.normalizeClass(button.class),
91
+ class: vue.normalizeClass(["ml-0!", button.class]),
92
92
  text: "",
93
93
  onClick: ($event) => handleButtonClick(button)
94
94
  }, {
@@ -2812,6 +2812,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
2812
2812
  }>, {
2813
2813
  title: string;
2814
2814
  loading: boolean;
2815
+ emptyText: string;
2815
2816
  toolbarButtonLimit: number;
2816
2817
  withCard: boolean;
2817
2818
  filterItems: import('./types').FilterItemConfig[];
@@ -2825,7 +2826,6 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
2825
2826
  selectedRows: any[];
2826
2827
  border: boolean;
2827
2828
  stripe: boolean;
2828
- emptyText: string;
2829
2829
  formProps: Partial<import('../form').FormProps>;
2830
2830
  tableProps: Partial<import('element-plus').TableProps>;
2831
2831
  paginationProps: Partial<import('element-plus').PaginationProps>;
@@ -37,13 +37,13 @@ declare const _default: import('vue').DefineComponent<PageTableV2Props, {
37
37
  }>, {
38
38
  title: string;
39
39
  loading: boolean;
40
+ emptyText: string;
40
41
  toolbarButtonLimit: number;
41
42
  withCard: boolean;
42
43
  filterItems: import('../form').FormProps["items"];
43
44
  showSearchButton: boolean;
44
45
  searchText: string;
45
46
  resetText: string;
46
- emptyText: string;
47
47
  formProps: Partial<import('../form').FormProps>;
48
48
  tableProps: Partial<import('element-plus').TableV2Props<any>>;
49
49
  autoSearchDelay: number;
@@ -1854,6 +1854,10 @@
1854
1854
  min-width: calc(var(--spacing) * 25);
1855
1855
  }
1856
1856
 
1857
+ .min-w-30 {
1858
+ min-width: calc(var(--spacing) * 30);
1859
+ }
1860
+
1857
1861
  .flex-1 {
1858
1862
  flex: 1;
1859
1863
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jky-component-lib",
3
3
  "type": "module",
4
- "version": "0.0.125",
4
+ "version": "0.0.127",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },