jky-component-lib 0.0.123 → 0.0.126

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 (39) hide show
  1. package/dist/es/amap/style.css +13 -2
  2. package/dist/es/amap/style2.css +5 -12
  3. package/dist/es/amap/style3.css +2 -6
  4. package/dist/es/components.js +3 -1
  5. package/dist/es/form/Form.vue.js +12 -2
  6. package/dist/es/form/FormItem.vue.js +71 -17
  7. package/dist/es/form/LinkedSelect.vue.d.ts +34 -0
  8. package/dist/es/form/LinkedSelect.vue.js +146 -0
  9. package/dist/es/form/LinkedSelect.vue3.js +5 -0
  10. package/dist/es/form/index.d.ts +3 -1
  11. package/dist/es/form/index.js +4 -0
  12. package/dist/es/index.js +2 -1
  13. package/dist/es/package.json.js +1 -1
  14. package/dist/es/page-table/ActionColumn.vue.d.ts +1 -1
  15. package/dist/es/page-table/ActionColumn.vue.js +13 -7
  16. package/dist/es/page-table/PageTable.vue.d.ts +7 -1
  17. package/dist/es/page-table/PageTable.vue.js +11 -4
  18. package/dist/es/page-table-v2/PageTableV2.vue.d.ts +3 -1
  19. package/dist/es/style.css +36 -0
  20. package/dist/lib/amap/style.css +13 -2
  21. package/dist/lib/amap/style2.css +5 -12
  22. package/dist/lib/amap/style3.css +2 -6
  23. package/dist/lib/components.js +2 -0
  24. package/dist/lib/form/Form.vue.js +12 -2
  25. package/dist/lib/form/FormItem.vue.js +68 -14
  26. package/dist/lib/form/LinkedSelect.vue.d.ts +34 -0
  27. package/dist/lib/form/LinkedSelect.vue.js +146 -0
  28. package/dist/lib/form/LinkedSelect.vue3.js +5 -0
  29. package/dist/lib/form/index.d.ts +3 -1
  30. package/dist/lib/form/index.js +4 -0
  31. package/dist/lib/index.js +1 -0
  32. package/dist/lib/package.json.js +1 -1
  33. package/dist/lib/page-table/ActionColumn.vue.d.ts +1 -1
  34. package/dist/lib/page-table/ActionColumn.vue.js +13 -7
  35. package/dist/lib/page-table/PageTable.vue.d.ts +7 -1
  36. package/dist/lib/page-table/PageTable.vue.js +11 -4
  37. package/dist/lib/page-table-v2/PageTableV2.vue.d.ts +3 -1
  38. package/dist/lib/style.css +36 -0
  39. package/package.json +1 -1
@@ -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;
@@ -64,6 +64,8 @@ declare const _default: import('vue').DefineComponent<PageTableV2Props, {
64
64
  readonly footerClass?: string | undefined;
65
65
  readonly submitText?: string | undefined;
66
66
  readonly cancelText?: string | undefined;
67
+ readonly submitIcon?: string | undefined;
68
+ readonly cancelIcon?: string | undefined;
67
69
  readonly submitDisabled?: boolean | undefined;
68
70
  readonly cancelDisabled?: boolean | undefined;
69
71
  readonly showCount?: number | undefined;
package/dist/es/style.css CHANGED
@@ -682,6 +682,38 @@
682
682
  mask-repeat: no-repeat;
683
683
  }
684
684
 
685
+ .icon-\[ant-design--search-outlined\] {
686
+ width: 1em;
687
+ height: 1em;
688
+ -webkit-mask-image: var(--svg);
689
+ -webkit-mask-image: var(--svg);
690
+ -webkit-mask-image: var(--svg);
691
+ mask-image: var(--svg);
692
+ --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' width='1024' height='1024'%3E%3Cpath fill='black' d='M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1S492.1 112 412 112s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6M570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4'/%3E%3C/svg%3E");
693
+ background-color: currentColor;
694
+ display: inline-block;
695
+ -webkit-mask-size: 100% 100%;
696
+ mask-size: 100% 100%;
697
+ -webkit-mask-repeat: no-repeat;
698
+ mask-repeat: no-repeat;
699
+ }
700
+
701
+ .icon-\[ant-design--sync-outlined\] {
702
+ width: 1em;
703
+ height: 1em;
704
+ -webkit-mask-image: var(--svg);
705
+ -webkit-mask-image: var(--svg);
706
+ -webkit-mask-image: var(--svg);
707
+ mask-image: var(--svg);
708
+ --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' width='1024' height='1024'%3E%3Cpath fill='black' d='M168 504.2c1-43.7 10-86.1 26.9-126c17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 0 1 755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92C282.7 92 96.3 275.6 92 503.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8m756 7.8h-60c-4.4 0-7.9 3.5-8 7.8c-1 43.7-10 86.1-26.9 126c-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 0 1 512.1 856a342.24 342.24 0 0 1-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 0 0-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 0 0-8-8.2'/%3E%3C/svg%3E");
709
+ background-color: currentColor;
710
+ display: inline-block;
711
+ -webkit-mask-size: 100% 100%;
712
+ mask-size: 100% 100%;
713
+ -webkit-mask-repeat: no-repeat;
714
+ mask-repeat: no-repeat;
715
+ }
716
+
685
717
  .icon-\[carbon--apple\] {
686
718
  width: 1em;
687
719
  height: 1em;
@@ -1822,6 +1854,10 @@
1822
1854
  min-width: calc(var(--spacing) * 25);
1823
1855
  }
1824
1856
 
1857
+ .min-w-30 {
1858
+ min-width: calc(var(--spacing) * 30);
1859
+ }
1860
+
1825
1861
  .flex-1 {
1826
1862
  flex: 1;
1827
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,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
  }
@@ -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 工具类或外部组件控制 */
@@ -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;
@@ -59,6 +59,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
59
59
  footerClass: { default: "" },
60
60
  submitText: { default: "提交" },
61
61
  cancelText: { default: "取消" },
62
+ submitIcon: {},
63
+ cancelIcon: {},
62
64
  submitDisabled: { type: Boolean, default: false },
63
65
  cancelDisabled: { type: Boolean, default: false },
64
66
  showCount: { default: 999 },
@@ -220,7 +222,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
220
222
  onClick: handleCancel
221
223
  }, {
222
224
  default: vue.withCtx(() => [
223
- vue.createTextVNode(vue.toDisplayString(__props.cancelText), 1)
225
+ props.cancelIcon ? (vue.openBlock(), vue.createElementBlock("span", {
226
+ key: 0,
227
+ class: vue.normalizeClass([props.cancelIcon, "mr-2"])
228
+ }, null, 2)) : vue.createCommentVNode("", true),
229
+ vue.createTextVNode(" " + vue.toDisplayString(__props.cancelText), 1)
224
230
  ]),
225
231
  _: 1
226
232
  }, 8, ["disabled"]),
@@ -231,7 +237,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
231
237
  onClick: handleSubmit
232
238
  }, {
233
239
  default: vue.withCtx(() => [
234
- vue.createTextVNode(vue.toDisplayString(__props.submitText), 1)
240
+ props.submitIcon ? (vue.openBlock(), vue.createElementBlock("span", {
241
+ key: 0,
242
+ class: vue.normalizeClass([props.submitIcon, "mr-2"])
243
+ }, null, 2)) : vue.createCommentVNode("", true),
244
+ vue.createTextVNode(" " + vue.toDisplayString(__props.submitText), 1)
235
245
  ]),
236
246
  _: 1
237
247
  }, 8, ["disabled"])
@@ -57,6 +57,8 @@ 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");
61
+ ;/* empty css */
60
62
  const SelectTable_vue_vue_type_script_setup_true_lang = require("./SelectTable.vue.js");
61
63
  ;/* empty css */
62
64
  const _hoisted_1 = {
@@ -106,6 +108,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
106
108
  const props = __props;
107
109
  const loading = vue.ref(false);
108
110
  const componentProps = vue.ref({});
111
+ const rules = vue.ref(null);
109
112
  function loadComponentProps() {
110
113
  return __async(this, null, function* () {
111
114
  const configProps = props.config.componentProps;
@@ -133,20 +136,49 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
133
136
  componentProps.value = configProps;
134
137
  });
135
138
  }
136
- vue.watch(
137
- () => props.model,
138
- () => {
139
- loadComponentProps();
140
- },
141
- { deep: true }
142
- );
139
+ function loadRules() {
140
+ return __async(this, null, function* () {
141
+ const configRules = props.config.rules;
142
+ if (!configRules) {
143
+ rules.value = null;
144
+ return;
145
+ }
146
+ if (typeof configRules === "function") {
147
+ loading.value = true;
148
+ try {
149
+ const result = yield configRules({
150
+ model: props.model,
151
+ field: props.field,
152
+ $form: props.model
153
+ });
154
+ rules.value = result || null;
155
+ } catch (error) {
156
+ console.error("Failed to load rules:", error);
157
+ rules.value = null;
158
+ } finally {
159
+ loading.value = false;
160
+ }
161
+ return;
162
+ }
163
+ rules.value = configRules;
164
+ });
165
+ }
143
166
  loadComponentProps();
167
+ loadRules();
144
168
  const modelValue = vue.computed({
145
169
  get: () => props.model[props.field],
146
170
  set: (val) => {
147
171
  props.model[props.field] = val;
148
172
  }
149
173
  });
174
+ vue.watch(
175
+ () => props.model,
176
+ () => {
177
+ loadComponentProps();
178
+ loadRules();
179
+ },
180
+ { deep: true }
181
+ );
150
182
  const isHidden = vue.computed(() => {
151
183
  if (typeof props.config.hidden === "function") {
152
184
  return props.config.hidden({
@@ -266,11 +298,20 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
266
298
  return vue.h(ElementPlus.ElAutocomplete, autocompleteProps, _componentSlotsObj);
267
299
  }
268
300
  case "datepicker":
269
- return vue.h(ElementPlus.ElDatePicker, __spreadValues(__spreadValues({}, commonProps), componentProps.value), _componentSlotsObj);
301
+ return vue.h(ElementPlus.ElDatePicker, __spreadValues(__spreadValues({
302
+ startPlaceholder: "开始日期",
303
+ endPlaceholder: "结束日期"
304
+ }, commonProps), componentProps.value), _componentSlotsObj);
270
305
  case "datetime-picker":
271
- return vue.h(ElementPlus.ElDatePicker, __spreadValues(__spreadValues({}, commonProps), componentProps.value), _componentSlotsObj);
306
+ return vue.h(ElementPlus.ElDatePicker, __spreadValues(__spreadValues({
307
+ startPlaceholder: "开始日期",
308
+ endPlaceholder: "结束日期"
309
+ }, commonProps), componentProps.value), _componentSlotsObj);
272
310
  case "time-picker":
273
- return vue.h(ElementPlus.ElTimePicker, __spreadValues(__spreadValues({}, commonProps), componentProps.value), _componentSlotsObj);
311
+ return vue.h(ElementPlus.ElTimePicker, __spreadValues(__spreadValues({
312
+ startPlaceholder: "开始时间",
313
+ endPlaceholder: "结束时间"
314
+ }, commonProps), componentProps.value), _componentSlotsObj);
274
315
  case "time-select":
275
316
  return vue.h(ElementPlus.ElTimeSelect, __spreadValues(__spreadValues({}, commonProps), componentProps.value), _componentSlotsObj);
276
317
  case "radio-group": {
@@ -453,6 +494,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
453
494
  const addInputProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
454
495
  return vue.h(index.JkyAddInput, addInputProps, _componentSlotsObj);
455
496
  }
497
+ // 联动下拉框
498
+ case "linked-select":
499
+ return vue.h(LinkedSelect_vue_vue_type_script_setup_true_lang.default, {
500
+ "config": props.config.config,
501
+ "modelValue": modelValue.value,
502
+ "disabled": props.disabled,
503
+ "componentProps": componentProps.value,
504
+ "onUpdate:modelValue": (val) => {
505
+ props.model[props.field] = val;
506
+ }
507
+ }, _componentSlotsObj);
456
508
  case "custom":
457
509
  return (_b = (_a = props.config).render) == null ? void 0 : _b.call(_a, commonProps);
458
510
  default:
@@ -510,7 +562,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
510
562
  return (_ctx, _cache) => {
511
563
  return isHidden.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1)) : __props.config.title && !__props.config.label ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElFormItem), vue.mergeProps({
512
564
  key: 1,
513
- prop: __props.field
565
+ prop: __props.field,
566
+ rules: rules.value
514
567
  }, __spreadValues(__spreadValues({}, formItemProps.value), _ctx.$attrs), {
515
568
  class: ["jky-form-item jky-form-item--no-label", [__props.config.useDefaultBorderClass ? "border-l-4 border-solid border-l-(--el-color-primary) bg-(--el-color-primary)/50 pl-1.5" : "", __props.config.class]],
516
569
  style: [__props.config.customStyle]
@@ -526,10 +579,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
526
579
  __props.config.help && !__props.config.help.tooltip ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderHelpText()), { key: 0 })) : vue.createCommentVNode("", true)
527
580
  ]),
528
581
  _: 1
529
- }, 16, ["prop", "class", "style"])) : (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElFormItem), vue.mergeProps({
582
+ }, 16, ["prop", "rules", "class", "style"])) : (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElFormItem), vue.mergeProps({
530
583
  key: 2,
531
584
  label: __props.config.label,
532
- prop: __props.field
585
+ prop: __props.field,
586
+ rules: rules.value
533
587
  }, __spreadValues(__spreadValues({}, formItemProps.value), _ctx.$attrs), {
534
588
  class: ["jky-form-item", [__props.config.class]]
535
589
  }), vue.createSlots({
@@ -553,7 +607,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
553
607
  ]),
554
608
  key: "0"
555
609
  } : void 0
556
- ]), 1040, ["label", "prop", "class"]));
610
+ ]), 1040, ["label", "prop", "rules", "class"]));
557
611
  };
558
612
  }
559
613
  }));
@@ -0,0 +1,34 @@
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
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
22
+ }>, {
23
+ modelValue: any[];
24
+ disabled: boolean;
25
+ config: LinkedSelectConfig;
26
+ componentProps: Record<string, any>;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
28
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
29
+ export default _default;
30
+ type __VLS_WithTemplateSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,146 @@
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"],
56
+ setup(__props, { emit: __emit }) {
57
+ const props = __props;
58
+ const emit = __emit;
59
+ const linkedSelectOptions = vue.ref([]);
60
+ const linkedSelectLoading = vue.ref([]);
61
+ function loadLinkedSelectOptions() {
62
+ return __async(this, null, function* () {
63
+ if (!props.config) {
64
+ return;
65
+ }
66
+ const level = props.config.level || 1;
67
+ linkedSelectLoading.value = Array.from({ length: level }, () => false);
68
+ if (props.config.getAllOptions) {
69
+ try {
70
+ const allOptions = yield props.config.getAllOptions(props.modelValue);
71
+ linkedSelectOptions.value = allOptions;
72
+ } catch (error) {
73
+ console.error("Failed to load linked select options:", error);
74
+ linkedSelectOptions.value = Array.from({ length: level }, () => []);
75
+ }
76
+ return;
77
+ }
78
+ if (props.config.getOptions) {
79
+ try {
80
+ const options = [];
81
+ for (let i = 0; i < level; i++) {
82
+ linkedSelectLoading.value[i] = true;
83
+ const levelOptions = yield props.config.getOptions(i + 1, props.modelValue || []);
84
+ options.push(levelOptions);
85
+ linkedSelectLoading.value[i] = false;
86
+ }
87
+ linkedSelectOptions.value = options;
88
+ } catch (error) {
89
+ console.error("Failed to load linked select options:", error);
90
+ linkedSelectOptions.value = Array.from({ length: level }, () => []);
91
+ }
92
+ }
93
+ });
94
+ }
95
+ vue.onMounted(() => {
96
+ loadLinkedSelectOptions();
97
+ });
98
+ vue.watch(
99
+ () => props.modelValue,
100
+ () => {
101
+ loadLinkedSelectOptions();
102
+ },
103
+ { deep: true }
104
+ );
105
+ function handleValueChange(index, val) {
106
+ const newValue = Array.isArray(props.modelValue) ? [...props.modelValue] : [];
107
+ newValue[index] = val;
108
+ emit("update:modelValue", newValue);
109
+ }
110
+ return (_ctx, _cache) => {
111
+ var _a;
112
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
113
+ vue.renderSlot(_ctx.$slots, "prefix"),
114
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Array.from({ length: ((_a = __props.config) == null ? void 0 : _a.level) || 1 }), (_, index) => {
115
+ var _a2, _b, _c, _d, _e, _f;
116
+ return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElSelect), vue.mergeProps({
117
+ key: index,
118
+ "model-value": Array.isArray(__props.modelValue) ? __props.modelValue[index] : void 0,
119
+ placeholder: ((_b = (_a2 = __props.config) == null ? void 0 : _a2.placeholders) == null ? void 0 : _b[index]) || "请选择",
120
+ disabled: __props.disabled,
121
+ filterable: (_d = (_c = __props.config) == null ? void 0 : _c.filterable) != null ? _d : false,
122
+ clearable: (_f = (_e = __props.config) == null ? void 0 : _e.clearable) != null ? _f : true,
123
+ loading: linkedSelectLoading.value[index],
124
+ class: "flex-1 min-w-30"
125
+ }, { ref_for: true }, __props.componentProps, {
126
+ "onUpdate:modelValue": ($event) => handleValueChange(index, $event)
127
+ }), {
128
+ default: vue.withCtx(() => [
129
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(linkedSelectOptions.value[index] || [], (option) => {
130
+ return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElSelect).Option, {
131
+ key: option.value,
132
+ value: option.value,
133
+ label: option.label,
134
+ disabled: option.disabled
135
+ }, null, 8, ["value", "label", "disabled"]);
136
+ }), 128))
137
+ ]),
138
+ _: 2
139
+ }, 1040, ["model-value", "placeholder", "disabled", "filterable", "clearable", "loading", "onUpdate:modelValue"]);
140
+ }), 128)),
141
+ vue.renderSlot(_ctx.$slots, "suffix")
142
+ ]);
143
+ };
144
+ }
145
+ }));
146
+ exports.default = _sfc_main;
@@ -0,0 +1,5 @@
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
+ ;/* empty css */
5
+ 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,11 @@
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");
6
+ ;/* empty css */
5
7
  const withInstall = require("../utils/with-install.js");
6
8
  const JkyForm = withInstall.installWithSFC(Form_vue_vue_type_script_setup_true_lang.default);
9
+ const JkyLinkedSelect = withInstall.installWithSFC(LinkedSelect_vue_vue_type_script_setup_true_lang.default);
7
10
  exports.JkyForm = JkyForm;
11
+ exports.JkyLinkedSelect = JkyLinkedSelect;
8
12
  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.123";
3
+ const version = "0.0.126";
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;
@@ -21,7 +21,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
21
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
22
22
  const vue = require("vue");
23
23
  const ElementPlus = require("element-plus");
24
- const _hoisted_1 = { class: "jky-action-column flex gap-2 items-center" };
24
+ const _hoisted_1 = { class: "jky-action-column flex items-center justify-center" };
25
25
  const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
26
26
  name: "JkyActionColumn"
27
27
  }), {
@@ -72,22 +72,28 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
72
72
  }
73
73
  emit("click", button, props.row, props.index);
74
74
  }
75
+ function getButtonLabel(button) {
76
+ if (typeof button.label === "function") {
77
+ return button.label(props.row, props.index);
78
+ }
79
+ return button.label;
80
+ }
75
81
  return (_ctx, _cache) => {
76
82
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
77
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayButtons.value, (button) => {
83
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayButtons.value, (button, i) => {
78
84
  return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElButton), {
79
- key: button.label,
85
+ key: i,
80
86
  type: button.type || "primary",
81
87
  size: button.size || "small",
82
88
  disabled: button.disabled,
83
89
  icon: button.icon,
84
90
  plain: button.plain,
85
- class: vue.normalizeClass(button.class),
91
+ class: vue.normalizeClass(["ml-0!", button.class]),
86
92
  text: "",
87
93
  onClick: ($event) => handleButtonClick(button)
88
94
  }, {
89
95
  default: vue.withCtx(() => [
90
- vue.createTextVNode(vue.toDisplayString(button.label), 1)
96
+ vue.createTextVNode(vue.toDisplayString(getButtonLabel(button)), 1)
91
97
  ]),
92
98
  _: 2
93
99
  }, 1032, ["type", "size", "disabled", "icon", "plain", "class", "onClick"]);
@@ -101,12 +107,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
101
107
  default: vue.withCtx(() => [
102
108
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(collapsedButtons.value, (button) => {
103
109
  return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElDropdownItem), {
104
- key: button.label,
110
+ key: typeof button.label === "function" ? button.label(__props.row, __props.index) : button.label,
105
111
  disabled: button.disabled,
106
112
  onClick: ($event) => handleButtonClick(button)
107
113
  }, {
108
114
  default: vue.withCtx(() => [
109
- vue.createTextVNode(vue.toDisplayString(button.label), 1)
115
+ vue.createTextVNode(vue.toDisplayString(getButtonLabel(button)), 1)
110
116
  ]),
111
117
  _: 2
112
118
  }, 1032, ["disabled", "onClick"]);
@@ -29,6 +29,8 @@ declare function __VLS_template(): {
29
29
  readonly footerClass?: string | undefined;
30
30
  readonly submitText?: string | undefined;
31
31
  readonly cancelText?: string | undefined;
32
+ readonly submitIcon?: string | undefined;
33
+ readonly cancelIcon?: string | undefined;
32
34
  readonly submitDisabled?: boolean | undefined;
33
35
  readonly cancelDisabled?: boolean | undefined;
34
36
  readonly showCount?: number | undefined;
@@ -2810,18 +2812,20 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
2810
2812
  }>, {
2811
2813
  title: string;
2812
2814
  loading: boolean;
2815
+ emptyText: string;
2813
2816
  toolbarButtonLimit: number;
2814
2817
  withCard: boolean;
2815
2818
  filterItems: import('./types').FilterItemConfig[];
2816
2819
  showSearchButton: boolean;
2817
2820
  searchText: string;
2818
2821
  resetText: string;
2822
+ searchIcon: string;
2823
+ resetIcon: string;
2819
2824
  selection: boolean;
2820
2825
  selectionColumn: import('./types').TableColumnConfig;
2821
2826
  selectedRows: any[];
2822
2827
  border: boolean;
2823
2828
  stripe: boolean;
2824
- emptyText: string;
2825
2829
  formProps: Partial<import('../form').FormProps>;
2826
2830
  tableProps: Partial<import('element-plus').TableProps>;
2827
2831
  paginationProps: Partial<import('element-plus').PaginationProps>;
@@ -2843,6 +2847,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
2843
2847
  readonly footerClass?: string | undefined;
2844
2848
  readonly submitText?: string | undefined;
2845
2849
  readonly cancelText?: string | undefined;
2850
+ readonly submitIcon?: string | undefined;
2851
+ readonly cancelIcon?: string | undefined;
2846
2852
  readonly submitDisabled?: boolean | undefined;
2847
2853
  readonly cancelDisabled?: boolean | undefined;
2848
2854
  readonly showCount?: number | undefined;