sun-biz 0.0.4-beta.55 → 0.0.4-beta.58

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.
@@ -2331,6 +2331,10 @@ const Table_exports_ = Tablevue_type_script_setup_true_lang_tsx_name_Table;
2331
2331
  });
2332
2332
  const TableContainer_exports_ = TableContainervue_type_script_lang_ts_setup_true_name_ProTableContainer;
2333
2333
  /* ESM default export */ const TableContainer = TableContainer_exports_;
2334
+ const Paginationvue_type_script_setup_true_lang_ts_name_Pagination_hoisted_1 = {
2335
+ key: 0,
2336
+ class: "pagination-slot"
2337
+ };
2334
2338
  /* ESM default export */ const Paginationvue_type_script_setup_true_lang_ts_name_Pagination = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
2335
2339
  __name: 'Pagination',
2336
2340
  props: {
@@ -2341,30 +2345,82 @@ const TableContainer_exports_ = TableContainervue_type_script_lang_ts_setup_true
2341
2345
  },
2342
2346
  handleCurrentChange: {
2343
2347
  type: Function
2348
+ },
2349
+ layout: {},
2350
+ enableCustomPageSize: {
2351
+ type: Boolean
2344
2352
  }
2345
2353
  },
2346
2354
  setup (__props) {
2355
+ const props = __props;
2356
+ const pageSize = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)({
2357
+ get: ()=>props.pageInfo.pageSize,
2358
+ set: (val)=>{
2359
+ const value = Number(val);
2360
+ // 修改时只能录入正整数
2361
+ if (Number.isInteger(value) && value > 0) props.handleSizeChange(value);
2362
+ }
2363
+ });
2364
+ const computedLayout = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
2365
+ if (props.enableCustomPageSize) return (props.layout ?? 'total, sizes, prev, pager, next').replace('sizes', 'slot');
2366
+ return props.layout ?? 'total, sizes, prev, pager, next';
2367
+ });
2347
2368
  return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElPagination), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
2348
2369
  "current-page": _ctx.pageInfo.pageNumber,
2349
2370
  "page-size": _ctx.pageInfo.pageSize,
2350
2371
  total: _ctx.pageInfo.total,
2351
2372
  "page-sizes": _ctx.pageSizes,
2352
- layout: "total, sizes, prev, pager, next",
2373
+ layout: computedLayout.value,
2353
2374
  onSizeChange: _ctx.handleSizeChange,
2354
2375
  onCurrentChange: _ctx.handleCurrentChange,
2355
2376
  "set-scroll-top": 500,
2356
2377
  background: ""
2357
- }, _ctx.$attrs), null, 16, [
2378
+ }, _ctx.$attrs), {
2379
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2380
+ props.enableCustomPageSize ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("span", Paginationvue_type_script_setup_true_lang_ts_name_Pagination_hoisted_1, [
2381
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElSelect), {
2382
+ class: "size-select",
2383
+ modelValue: pageSize.value,
2384
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>pageSize.value = $event),
2385
+ filterable: "",
2386
+ "allow-create": "",
2387
+ "default-first-option": "",
2388
+ "reserve-keyword": false
2389
+ }, {
2390
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2391
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(_ctx.pageSizes, (item)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElOption), {
2392
+ key: item,
2393
+ label: item + '条/页',
2394
+ value: item
2395
+ }, null, 8, [
2396
+ "label",
2397
+ "value"
2398
+ ]))), 128))
2399
+ ]),
2400
+ _: 1
2401
+ }, 8, [
2402
+ "modelValue"
2403
+ ])
2404
+ ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
2405
+ ]),
2406
+ _: 1
2407
+ }, 16, [
2358
2408
  "current-page",
2359
2409
  "page-size",
2360
2410
  "total",
2361
2411
  "page-sizes",
2412
+ "layout",
2362
2413
  "onSizeChange",
2363
2414
  "onCurrentChange"
2364
2415
  ]));
2365
2416
  }
2366
2417
  });
2367
- const Pagination_exports_ = Paginationvue_type_script_setup_true_lang_ts_name_Pagination;
2418
+ const Pagination_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(Paginationvue_type_script_setup_true_lang_ts_name_Pagination, [
2419
+ [
2420
+ '__scopeId',
2421
+ "data-v-eb218d18"
2422
+ ]
2423
+ ]);
2368
2424
  /* ESM default export */ const Pagination = Pagination_exports_;
2369
2425
  const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1 = {
2370
2426
  class: "relative flex flex-1 flex-col overflow-hidden"
@@ -2480,6 +2536,10 @@ const SELECTION = 'selection';
2480
2536
  scrollLoad: {
2481
2537
  type: Function,
2482
2538
  default: void 0
2539
+ },
2540
+ enableCustomPageSize: {
2541
+ type: Boolean,
2542
+ default: false
2483
2543
  }
2484
2544
  },
2485
2545
  emits: [
@@ -3065,11 +3125,13 @@ const SELECTION = 'selection';
3065
3125
  "page-info": paginationInfo.value,
3066
3126
  "page-sizes": props.pageSizes,
3067
3127
  "handle-size-change": handleSizeChange,
3068
- "handle-current-change": changeCurrentPage
3128
+ "handle-current-change": changeCurrentPage,
3129
+ "enable-custom-page-size": props.enableCustomPageSize
3069
3130
  }, null, 8, [
3070
3131
  "layout",
3071
3132
  "page-info",
3072
- "page-sizes"
3133
+ "page-sizes",
3134
+ "enable-custom-page-size"
3073
3135
  ])
3074
3136
  ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
3075
3137
  ]));
@@ -4387,7 +4449,7 @@ const patient_accessvue_type_script_setup_true_lang_ts_hoisted_1 = {
4387
4449
  indexTypeCode: data.indexTypeCode
4388
4450
  }
4389
4451
  });
4390
- return res?.data;
4452
+ return res?.data?.bizOutputParam;
4391
4453
  };
4392
4454
  /** 处理检索结果 */ const handleSearchResult = (res, cardInfo)=>{
4393
4455
  // 查询的结果 超过一条 则需要 弹出弹窗让用户选择
@@ -6309,17 +6371,19 @@ const printReceiptBtn_exports_ = printReceiptBtnvue_type_script_setup_true_lang_
6309
6371
  /**
6310
6372
  * 方向键监听的 hook
6311
6373
  * @param hookActive hook是否激活
6312
- * @returns
6313
- */ function useDirectionKey(hookActive, cb) {
6374
+ * @param cb 键盘事件回调函数
6375
+ * @param options 配置选项
6376
+ */ function useDirectionKey(hookActive, cb, options) {
6377
+ const { immediate = false } = options || {};
6314
6378
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(hookActive, (v)=>{
6315
6379
  if (v) document.addEventListener('keydown', cb);
6316
- else // 移除事件监听
6317
- window.removeEventListener('keydown', cb);
6380
+ else document.removeEventListener('keydown', cb);
6381
+ }, {
6382
+ immediate
6318
6383
  });
6319
6384
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount)(()=>{
6320
- console.log('useDirectionKey onBeforeUnmount');
6385
+ document.removeEventListener('keydown', cb);
6321
6386
  });
6322
- // return {};
6323
6387
  }
6324
6388
  /**
6325
6389
  * table-select 模式枚举值
@@ -6329,7 +6393,7 @@ const printReceiptBtn_exports_ = printReceiptBtnvue_type_script_setup_true_lang_
6329
6393
  return TableSelectMode;
6330
6394
  }({});
6331
6395
  const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_1 = {
6332
- class: "flex h-full flex-col"
6396
+ class: "test flex h-full flex-col"
6333
6397
  };
6334
6398
  const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_2 = {
6335
6399
  class: "header flex items-center"
@@ -6388,22 +6452,22 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
6388
6452
  default: 'default'
6389
6453
  },
6390
6454
  simpleConfig: {
6391
- default: (props)=>'simple' === props.mode ? {
6392
- showHeader: false
6393
- } : {}
6455
+ default: void 0
6394
6456
  },
6395
6457
  complexConfig: {
6396
- default: ()=>({
6397
- width: 400
6398
- })
6458
+ default: void 0
6399
6459
  },
6400
6460
  highlightCurrentRow: {
6401
6461
  type: Boolean,
6402
6462
  default: true
6403
6463
  },
6464
+ rowClassName: {},
6404
6465
  data: {
6405
6466
  default: ()=>[]
6406
6467
  },
6468
+ exists: {
6469
+ default: ()=>[]
6470
+ },
6407
6471
  remoteMethod: {
6408
6472
  type: Function,
6409
6473
  default: void 0
@@ -6412,7 +6476,8 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
6412
6476
  modelValue: {},
6413
6477
  modelModifiers: {}
6414
6478
  }), [
6415
- "nextPage"
6479
+ "nextPage",
6480
+ "blur"
6416
6481
  ], [
6417
6482
  "update:modelValue"
6418
6483
  ];
@@ -69,6 +69,8 @@ export interface PaginationProps {
69
69
  pageSizes: number[];
70
70
  handleSizeChange: (size: number) => void;
71
71
  handleCurrentChange: (currentPage: number) => void;
72
+ layout?: string;
73
+ enableCustomPageSize?: boolean;
72
74
  }
73
75
  export declare namespace Table {
74
76
  interface PageInfo {
@@ -19,26 +19,42 @@
19
19
  background-color: #0000 !important;
20
20
  }
21
21
 
22
- .input[data-v-bf6cf296] .el-input__inner {
22
+ .size-select[data-v-eb218d18] {
23
+ color: #606266;
24
+ width: 110px;
25
+ margin-left: 10px;
26
+ font-weight: 400;
27
+ }
28
+
29
+ .input[data-v-d8701274] .el-input__inner {
23
30
  cursor: pointer !important;
24
31
  }
25
- .table-select-popover[data-v-bf6cf296] {
32
+ .table-select-popover[data-v-d8701274] {
26
33
  height: 350px;
27
34
  width: auto !important;
28
35
  }
29
- .table-select-popover-simple .header[data-v-bf6cf296] {
36
+ .table-select-popover-simple .header[data-v-d8701274] {
30
37
  width: 100%;
31
38
  }
32
- .table-select-popover-simple .header > span[data-v-bf6cf296] {
39
+ .table-select-popover-simple .header > span[data-v-d8701274] {
33
40
  flex: var(--simple-column-flex);
34
41
  }
35
- .table-select-popover-simple .cell[data-v-bf6cf296] {
42
+ .table-select-popover-simple .cell[data-v-d8701274] {
36
43
  width: 100%;
37
44
  }
38
- .table-select-popover-simple .cell > span[data-v-bf6cf296] {
45
+ .table-select-popover-simple .cell > span[data-v-d8701274] {
39
46
  flex: var(--simple-column-flex);
40
47
  }
41
48
 
49
+ .table-select-popover .exist-row {
50
+ --el-table-tr-bg-color: #f2f5fc;
51
+ color: #a8abb2;
52
+ --el-table-row-hover-bg-color: #f2f5fc !important;
53
+ }
54
+ .table-select-popover .exist-row.current-row {
55
+ --el-table-current-row-bg-color: #f2f5fc;
56
+ }
57
+
42
58
 
43
59
 
44
60
  .disabled-user-tooltip, .disabled-user-tooltip .el-tooltip__trigger {
@@ -2,6 +2,9 @@ import { Ref } from 'vue';
2
2
  /**
3
3
  * 方向键监听的 hook
4
4
  * @param hookActive hook是否激活
5
- * @returns
5
+ * @param cb 键盘事件回调函数
6
+ * @param options 配置选项
6
7
  */
7
- export default function useDirectionKey(hookActive: Ref<boolean>, cb: (e: KeyboardEvent) => void): void;
8
+ export default function useDirectionKey(hookActive: Ref<boolean>, cb: (e: KeyboardEvent) => void, options?: {
9
+ immediate?: boolean;
10
+ }): void;
@@ -1,5 +1,7 @@
1
1
  import { ComponentSize } from 'element-sun';
2
- import { ColumnProps } from '@/components/pro-table';
2
+ import { ColumnProps } from '../../pro-table';
3
+ import type { ComponentExposed } from '@/types';
4
+ import type TableSelect from '../index.vue';
3
5
  /**
4
6
  * 简易模式 option 类型
5
7
  */
@@ -84,8 +86,15 @@ export interface TableSelectProps<T extends Record<PropertyKey, any>> {
84
86
  complexConfig?: ISelectComplexConfig;
85
87
  /** 是否高亮当前行 */
86
88
  highlightCurrentRow?: boolean;
89
+ /** 行类名 */
90
+ rowClassName?: (args: {
91
+ row: T;
92
+ rowIndex: number;
93
+ }) => string;
87
94
  /** 表格数据 */
88
95
  data: T[];
96
+ /** 已存在的行数据 key 数组 */
97
+ exists?: string[];
89
98
  /** 远程加载数据的方法 */
90
99
  remoteMethod?: RemoteMethod<string | undefined>;
91
100
  }
@@ -105,5 +114,18 @@ export interface ISelectComplexConfig {
105
114
  * 弹窗最大高度
106
115
  */
107
116
  maxHeight?: string | number;
117
+ /**
118
+ * 是否显示 prefix
119
+ */
120
+ showPrefix?: boolean;
121
+ /**
122
+ * 失焦时清除
123
+ */
124
+ clearWhenBlur?: boolean;
108
125
  }
126
+ /**
127
+ * TableSelect 组件实例类型
128
+ * 用于获取组件 exposed 的方法和属性
129
+ */
130
+ export type TableSelectInstance = ComponentExposed<typeof TableSelect>;
109
131
  export {};
package/dist/index.js CHANGED
@@ -2367,6 +2367,10 @@ const Table_exports_ = Tablevue_type_script_setup_true_lang_tsx_name_Table;
2367
2367
  });
2368
2368
  const TableContainer_exports_ = TableContainervue_type_script_lang_ts_setup_true_name_ProTableContainer;
2369
2369
  /* ESM default export */ const TableContainer = TableContainer_exports_;
2370
+ const Paginationvue_type_script_setup_true_lang_ts_name_Pagination_hoisted_1 = {
2371
+ key: 0,
2372
+ class: "pagination-slot"
2373
+ };
2370
2374
  /* ESM default export */ const Paginationvue_type_script_setup_true_lang_ts_name_Pagination = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
2371
2375
  __name: 'Pagination',
2372
2376
  props: {
@@ -2377,30 +2381,82 @@ const TableContainer_exports_ = TableContainervue_type_script_lang_ts_setup_true
2377
2381
  },
2378
2382
  handleCurrentChange: {
2379
2383
  type: Function
2384
+ },
2385
+ layout: {},
2386
+ enableCustomPageSize: {
2387
+ type: Boolean
2380
2388
  }
2381
2389
  },
2382
2390
  setup (__props) {
2391
+ const props = __props;
2392
+ const pageSize = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)({
2393
+ get: ()=>props.pageInfo.pageSize,
2394
+ set: (val)=>{
2395
+ const value = Number(val);
2396
+ // 修改时只能录入正整数
2397
+ if (Number.isInteger(value) && value > 0) props.handleSizeChange(value);
2398
+ }
2399
+ });
2400
+ const computedLayout = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
2401
+ if (props.enableCustomPageSize) return (props.layout ?? 'total, sizes, prev, pager, next').replace('sizes', 'slot');
2402
+ return props.layout ?? 'total, sizes, prev, pager, next';
2403
+ });
2383
2404
  return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElPagination), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
2384
2405
  "current-page": _ctx.pageInfo.pageNumber,
2385
2406
  "page-size": _ctx.pageInfo.pageSize,
2386
2407
  total: _ctx.pageInfo.total,
2387
2408
  "page-sizes": _ctx.pageSizes,
2388
- layout: "total, sizes, prev, pager, next",
2409
+ layout: computedLayout.value,
2389
2410
  onSizeChange: _ctx.handleSizeChange,
2390
2411
  onCurrentChange: _ctx.handleCurrentChange,
2391
2412
  "set-scroll-top": 500,
2392
2413
  background: ""
2393
- }, _ctx.$attrs), null, 16, [
2414
+ }, _ctx.$attrs), {
2415
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2416
+ props.enableCustomPageSize ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("span", Paginationvue_type_script_setup_true_lang_ts_name_Pagination_hoisted_1, [
2417
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElSelect), {
2418
+ class: "size-select",
2419
+ modelValue: pageSize.value,
2420
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>pageSize.value = $event),
2421
+ filterable: "",
2422
+ "allow-create": "",
2423
+ "default-first-option": "",
2424
+ "reserve-keyword": false
2425
+ }, {
2426
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
2427
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(_ctx.pageSizes, (item)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElOption), {
2428
+ key: item,
2429
+ label: item + '条/页',
2430
+ value: item
2431
+ }, null, 8, [
2432
+ "label",
2433
+ "value"
2434
+ ]))), 128))
2435
+ ]),
2436
+ _: 1
2437
+ }, 8, [
2438
+ "modelValue"
2439
+ ])
2440
+ ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
2441
+ ]),
2442
+ _: 1
2443
+ }, 16, [
2394
2444
  "current-page",
2395
2445
  "page-size",
2396
2446
  "total",
2397
2447
  "page-sizes",
2448
+ "layout",
2398
2449
  "onSizeChange",
2399
2450
  "onCurrentChange"
2400
2451
  ]));
2401
2452
  }
2402
2453
  });
2403
- const Pagination_exports_ = Paginationvue_type_script_setup_true_lang_ts_name_Pagination;
2454
+ const Pagination_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(Paginationvue_type_script_setup_true_lang_ts_name_Pagination, [
2455
+ [
2456
+ '__scopeId',
2457
+ "data-v-eb218d18"
2458
+ ]
2459
+ ]);
2404
2460
  /* ESM default export */ const Pagination = Pagination_exports_;
2405
2461
  const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1 = {
2406
2462
  class: "relative flex flex-1 flex-col overflow-hidden"
@@ -2516,6 +2572,10 @@ const SELECTION = 'selection';
2516
2572
  scrollLoad: {
2517
2573
  type: Function,
2518
2574
  default: void 0
2575
+ },
2576
+ enableCustomPageSize: {
2577
+ type: Boolean,
2578
+ default: false
2519
2579
  }
2520
2580
  },
2521
2581
  emits: [
@@ -3101,11 +3161,13 @@ const SELECTION = 'selection';
3101
3161
  "page-info": paginationInfo.value,
3102
3162
  "page-sizes": props.pageSizes,
3103
3163
  "handle-size-change": handleSizeChange,
3104
- "handle-current-change": changeCurrentPage
3164
+ "handle-current-change": changeCurrentPage,
3165
+ "enable-custom-page-size": props.enableCustomPageSize
3105
3166
  }, null, 8, [
3106
3167
  "layout",
3107
3168
  "page-info",
3108
- "page-sizes"
3169
+ "page-sizes",
3170
+ "enable-custom-page-size"
3109
3171
  ])
3110
3172
  ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
3111
3173
  ]));
@@ -4887,7 +4949,7 @@ const patient_accessvue_type_script_setup_true_lang_ts_hoisted_1 = {
4887
4949
  indexTypeCode: data.indexTypeCode
4888
4950
  }
4889
4951
  });
4890
- return res?.data;
4952
+ return res?.data?.bizOutputParam;
4891
4953
  };
4892
4954
  /** 处理检索结果 */ const handleSearchResult = (res, cardInfo)=>{
4893
4955
  // 查询的结果 超过一条 则需要 弹出弹窗让用户选择
@@ -11103,17 +11165,19 @@ const invoice_exports_ = invoicevue_type_script_setup_true_lang_ts_name_proInvoi
11103
11165
  /**
11104
11166
  * 方向键监听的 hook
11105
11167
  * @param hookActive hook是否激活
11106
- * @returns
11107
- */ function useDirectionKey(hookActive, cb) {
11168
+ * @param cb 键盘事件回调函数
11169
+ * @param options 配置选项
11170
+ */ function useDirectionKey(hookActive, cb, options) {
11171
+ const { immediate = false } = options || {};
11108
11172
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(hookActive, (v)=>{
11109
11173
  if (v) document.addEventListener('keydown', cb);
11110
- else // 移除事件监听
11111
- window.removeEventListener('keydown', cb);
11174
+ else document.removeEventListener('keydown', cb);
11175
+ }, {
11176
+ immediate
11112
11177
  });
11113
11178
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount)(()=>{
11114
- console.log('useDirectionKey onBeforeUnmount');
11179
+ document.removeEventListener('keydown', cb);
11115
11180
  });
11116
- // return {};
11117
11181
  }
11118
11182
  /**
11119
11183
  * table-select 模式枚举值
@@ -11123,7 +11187,7 @@ const invoice_exports_ = invoicevue_type_script_setup_true_lang_ts_name_proInvoi
11123
11187
  return TableSelectMode;
11124
11188
  }({});
11125
11189
  const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_1 = {
11126
- class: "flex h-full flex-col"
11190
+ class: "test flex h-full flex-col"
11127
11191
  };
11128
11192
  const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_2 = {
11129
11193
  class: "header flex items-center"
@@ -11184,22 +11248,22 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11184
11248
  default: 'default'
11185
11249
  },
11186
11250
  simpleConfig: {
11187
- default: (props)=>'simple' === props.mode ? {
11188
- showHeader: false
11189
- } : {}
11251
+ default: void 0
11190
11252
  },
11191
11253
  complexConfig: {
11192
- default: ()=>({
11193
- width: 400
11194
- })
11254
+ default: void 0
11195
11255
  },
11196
11256
  highlightCurrentRow: {
11197
11257
  type: Boolean,
11198
11258
  default: true
11199
11259
  },
11260
+ rowClassName: {},
11200
11261
  data: {
11201
11262
  default: ()=>[]
11202
11263
  },
11264
+ exists: {
11265
+ default: ()=>[]
11266
+ },
11203
11267
  remoteMethod: {
11204
11268
  type: Function,
11205
11269
  default: void 0
@@ -11209,14 +11273,30 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11209
11273
  modelModifiers: {}
11210
11274
  }),
11211
11275
  emits: /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeModels)([
11212
- "nextPage"
11276
+ "nextPage",
11277
+ "blur"
11213
11278
  ], [
11214
11279
  "update:modelValue"
11215
11280
  ]),
11216
11281
  setup (__props, { expose: __expose, emit: __emit }) {
11217
11282
  const model = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useModel)(__props, "modelValue");
11218
11283
  const props = __props;
11284
+ const getRowClassName = ({ row })=>{
11285
+ if (props.exists?.includes(row[props.rowKey])) return 'exist-row cursor-not-allowed';
11286
+ return 'cursor-pointer';
11287
+ };
11219
11288
  const isSimpleMode = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>'simple' === props.mode);
11289
+ // 合并默认配置和用户传入的配置
11290
+ const mergedComplexConfig = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>({
11291
+ showPrefix: true,
11292
+ width: 400,
11293
+ clearWhenBlur: true,
11294
+ ...props.complexConfig
11295
+ }));
11296
+ const mergedSimpleConfig = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>({
11297
+ showHeader: false,
11298
+ ...props.simpleConfig
11299
+ }));
11220
11300
  const simpleColumns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
11221
11301
  if (isSimpleMode.value) return props.columns || [];
11222
11302
  return [];
@@ -11233,16 +11313,19 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11233
11313
  const popoverVisible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(props.popoverVisible);
11234
11314
  const inputValue = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('');
11235
11315
  const keydownIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(-1);
11236
- const rowElements = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
11237
- // 此处添加 props.data.length 是为了将 props.data n纳入依赖
11238
- if (tableRef.value?.proTableRef && props.data.length) {
11239
- const elRowSelector = '.el-table__body tbody .el-table__row';
11240
- const rowElements = Array.from((tableRef.value?.proTableRef.$el).querySelectorAll(elRowSelector));
11241
- console.log(rowElements.length);
11242
- return rowElements;
11316
+ const rowElements = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
11317
+ /**
11318
+ * 更新行元素缓存
11319
+ */ function updateRowElements() {
11320
+ if (!popoverVisible.value || !tableRef.value?.proTableRef || !props.data.length) {
11321
+ rowElements.value = [];
11322
+ return;
11243
11323
  }
11244
- return [];
11245
- });
11324
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.nextTick)(()=>{
11325
+ const elRowSelector = '.el-table__body tbody .el-table__row';
11326
+ rowElements.value = Array.from((tableRef.value?.proTableRef.$el).querySelectorAll(elRowSelector));
11327
+ });
11328
+ }
11246
11329
  function setCurrentRow() {
11247
11330
  const option = props.data[keydownIndex.value];
11248
11331
  if (option) tableRef.value?.proTableRef.setCurrentRow(option);
@@ -11258,18 +11341,21 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11258
11341
  });
11259
11342
  }
11260
11343
  }
11261
- // 键盘事件处理函数
11262
- const handleKeydown = (e)=>{
11263
- // 处理键盘事件逻辑
11264
- if ('Enter' === e.key) handleRowClick(props.data[keydownIndex.value]);
11265
- else if ('ArrowUp' === e.key) {
11266
- keydownIndex.value--;
11267
- keydownIndex.value = Math.max(keydownIndex.value, 0);
11344
+ /**
11345
+ * 键盘事件处理函数
11346
+ */ const handleKeydown = (e)=>{
11347
+ if (!props.data.length) return;
11348
+ if ('Enter' === e.key) {
11349
+ const row = props.data[keydownIndex.value];
11350
+ if (row && keydownIndex.value >= 0) handleRowClick(row);
11351
+ } else if ('ArrowUp' === e.key) {
11352
+ e.preventDefault();
11353
+ keydownIndex.value = Math.max(keydownIndex.value - 1, 0);
11268
11354
  setCurrentRow();
11269
11355
  scrollToCurrentRow();
11270
11356
  } else if ('ArrowDown' === e.key) {
11271
- keydownIndex.value++;
11272
- keydownIndex.value = Math.min(keydownIndex.value, props.data.length - 1);
11357
+ e.preventDefault();
11358
+ keydownIndex.value = Math.min(keydownIndex.value + 1, props.data.length - 1);
11273
11359
  setCurrentRow();
11274
11360
  scrollToCurrentRow();
11275
11361
  }
@@ -11292,13 +11378,14 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11292
11378
  /**
11293
11379
  * 聚焦事件
11294
11380
  */ function focus() {
11295
- console.log('table-select focus');
11381
+ inputSearchRef.value?.focus();
11296
11382
  toggleVisible();
11297
11383
  }
11298
11384
  /**
11299
11385
  * 点击行
11300
11386
  * @param row 点击的行
11301
11387
  */ function handleRowClick(row) {
11388
+ if (!row || props.exists?.includes(row[props.rowKey])) return;
11302
11389
  // 多选
11303
11390
  if ((0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.isArray)(model.value)) {
11304
11391
  const existedIndex = model.value.findIndex((item)=>item[props.rowKey] === row[props.rowKey]);
@@ -11323,27 +11410,42 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11323
11410
  model.value = row;
11324
11411
  keydownIndex.value = index;
11325
11412
  }
11326
- popoverRef.value?.hide();
11413
+ popoverVisible.value = false;
11414
+ // popoverRef.value?.hide();
11327
11415
  }
11328
11416
  }
11329
11417
  /**
11330
11418
  * 输入框输入
11331
11419
  * @param v 输入的值
11332
11420
  */ function handleInput(v) {
11333
- (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(()=>{
11334
- // 存在异步行为,要判断
11335
- if (props.remoteMethod) props.remoteMethod(v);
11336
- }, 500)();
11421
+ debouncedQuery(v);
11337
11422
  popoverVisible.value = true;
11338
11423
  }
11424
+ const debouncedQuery = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)((v)=>{
11425
+ if (props.remoteMethod) props.remoteMethod(v);
11426
+ }, 500);
11339
11427
  /**
11340
11428
  * 处理下拉加载
11341
11429
  */ function handleScrollLoad() {
11342
11430
  emits('nextPage');
11343
11431
  }
11344
11432
  function handleClickOutside(e) {
11345
- if (e.target === inputSearchRef.value?.$el) return;
11346
- popoverVisible.value = false;
11433
+ if (inputSearchRef.value?.$el && inputSearchRef.value?.$el.contains(e.target)) return;
11434
+ {
11435
+ const hasNoSelection = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.isArray)(model.value) && 0 === model.value.length || !model.value;
11436
+ if (mergedComplexConfig.value.clearWhenBlur && hasNoSelection) // 只有当输入框有内容但没有选中值时,才需要重置并重新请求
11437
+ {
11438
+ if (inputValue.value) {
11439
+ reset();
11440
+ debouncedQuery('');
11441
+ }
11442
+ }
11443
+ // 总是关闭弹窗
11444
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.nextTick)(()=>{
11445
+ popoverVisible.value = false;
11446
+ });
11447
+ emits('blur');
11448
+ }
11347
11449
  }
11348
11450
  function toggleVisible() {
11349
11451
  popoverVisible.value = true;
@@ -11410,13 +11512,25 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11410
11512
  // // 启动动画
11411
11513
  // requestAnimationFrame(updateScroll);
11412
11514
  // }
11413
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect)(()=>{
11414
- if (model.value) inputValue.value = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.isArray)(model.value) ? '' : model.value[props.labelKey];
11415
- if (props.data.length > 0 && model.value && !(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.isArray)(model.value)) {
11416
- const index = props.data.findIndex((item)=>item[props.rowKey] === model.value[props.rowKey]);
11417
- keydownIndex.value = index;
11418
- setCurrentRow();
11419
- }
11515
+ // 同步 model 到 inputValue
11516
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(model, (val)=>{
11517
+ if ((0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.isArray)(val)) inputValue.value = '';
11518
+ else inputValue.value = val ? val[props.labelKey] : '';
11519
+ }, {
11520
+ immediate: true
11521
+ });
11522
+ // 同步外部 popoverVisible
11523
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(()=>props.popoverVisible, (val)=>{
11524
+ popoverVisible.value = val;
11525
+ });
11526
+ // 监听数据变化和弹层状态,更新行元素
11527
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)([
11528
+ ()=>props.data,
11529
+ popoverVisible
11530
+ ], ()=>{
11531
+ updateRowElements();
11532
+ }, {
11533
+ deep: true
11420
11534
  });
11421
11535
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeMount)(()=>{
11422
11536
  if (isSimpleMode.value) document.documentElement.style.setProperty('--simple-column-flex', `0 0 ${Math.floor(100 / simpleColumns.value.length)}%`);
@@ -11427,6 +11541,10 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11427
11541
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
11428
11542
  if (props.immediate && props.remoteMethod) props.remoteMethod();
11429
11543
  });
11544
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted)(()=>{
11545
+ // 取消待执行的防抖函数
11546
+ debouncedQuery?.cancel?.();
11547
+ });
11430
11548
  __expose({
11431
11549
  reset,
11432
11550
  focus,
@@ -11442,13 +11560,15 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11442
11560
  }, [
11443
11561
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElInput), {
11444
11562
  class: "input",
11445
- "prefix-icon": "Search",
11563
+ "prefix-icon": mergedComplexConfig.value.showPrefix ? 'Search' : '',
11446
11564
  modelValue: inputValue.value,
11447
11565
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>inputValue.value = $event),
11448
11566
  ref_key: "inputSearchRef",
11449
11567
  ref: inputSearchRef,
11450
11568
  size: _ctx.size,
11451
- placeholder: _ctx.placeholder || '请输入检索内容',
11569
+ placeholder: _ctx.placeholder || _ctx.$t('global:placeholder.input.template', {
11570
+ content: _ctx.$t('global:search') + _ctx.$t('global:content')
11571
+ }),
11452
11572
  clearable: "",
11453
11573
  onKeydownCapture: _cache[1] || (_cache[1] = (0, __WEBPACK_EXTERNAL_MODULE_vue__.withKeys)((0, __WEBPACK_EXTERNAL_MODULE_vue__.withModifiers)(()=>{}, [
11454
11574
  "prevent"
@@ -11484,6 +11604,7 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11484
11604
  key: "1"
11485
11605
  } : void 0
11486
11606
  ]), 1032, [
11607
+ "prefix-icon",
11487
11608
  "modelValue",
11488
11609
  "size",
11489
11610
  "placeholder"
@@ -11491,7 +11612,7 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11491
11612
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElPopover), {
11492
11613
  ref_key: "popoverRef",
11493
11614
  ref: popoverRef,
11494
- width: _ctx.complexConfig.width,
11615
+ width: mergedComplexConfig.value.width,
11495
11616
  visible: popoverVisible.value,
11496
11617
  "virtual-ref": inputSearchRef.value,
11497
11618
  "virtual-triggering": "",
@@ -11505,10 +11626,11 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11505
11626
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "header"),
11506
11627
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), {
11507
11628
  ref: "table",
11508
- "max-height": _ctx.complexConfig.maxHeight,
11629
+ "max-height": mergedComplexConfig.value.maxHeight,
11509
11630
  "component-no": _ctx.componentNo,
11510
11631
  "row-key": _ctx.rowKey,
11511
11632
  "current-row-key": _ctx.currentRowKey,
11633
+ "row-class-name": getRowClassName,
11512
11634
  "highlight-current-row": _ctx.highlightCurrentRow,
11513
11635
  columns: complexColumns.value,
11514
11636
  data: _ctx.data,
@@ -11552,14 +11674,16 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11552
11674
  clearable: "",
11553
11675
  "popper-class": "table-select-popover-simple",
11554
11676
  size: _ctx.size,
11555
- placeholder: "请输入检索内容",
11677
+ placeholder: _ctx.$t('global:placeholder.input.template', {
11678
+ content: _ctx.$t('global:search') + _ctx.$t('global:content')
11679
+ }),
11556
11680
  "value-key": _ctx.rowKey
11557
11681
  }, (0, __WEBPACK_EXTERNAL_MODULE_vue__.createSlots)({
11558
11682
  default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
11559
11683
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "default", {}, ()=>[
11560
- ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(_ctx.data, (item, index)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_option, {
11684
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(_ctx.data, (item)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_option, {
11561
11685
  class: "cell flex items-center",
11562
- key: index,
11686
+ key: item[_ctx.rowKey],
11563
11687
  label: item[_ctx.labelKey],
11564
11688
  value: item
11565
11689
  }, {
@@ -11577,15 +11701,15 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11577
11701
  ]),
11578
11702
  _: 2
11579
11703
  }, [
11580
- _ctx.simpleConfig?.showHeader ? {
11704
+ mergedSimpleConfig.value.showHeader ? {
11581
11705
  name: "header",
11582
11706
  fn: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
11583
11707
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "header", {
11584
11708
  columns: simpleColumns.value
11585
11709
  }, ()=>[
11586
11710
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_2, [
11587
- ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(simpleColumns.value, (head, index)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("span", {
11588
- key: index
11711
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(simpleColumns.value, (head)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("span", {
11712
+ key: head.key
11589
11713
  }, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(head.label), 1))), 128))
11590
11714
  ])
11591
11715
  ])
@@ -11595,6 +11719,7 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11595
11719
  ]), 1032, [
11596
11720
  "modelValue",
11597
11721
  "size",
11722
+ "placeholder",
11598
11723
  "value-key"
11599
11724
  ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
11600
11725
  ], 64);
@@ -11604,7 +11729,7 @@ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Recor
11604
11729
  const table_select_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E, [
11605
11730
  [
11606
11731
  '__scopeId',
11607
- "data-v-bf6cf296"
11732
+ "data-v-d8701274"
11608
11733
  ]
11609
11734
  ]);
11610
11735
  /* ESM default export */ const table_select = table_select_exports_;
@@ -19,6 +19,13 @@
19
19
  background-color: #0000 !important;
20
20
  }
21
21
 
22
+ .size-select[data-v-eb218d18] {
23
+ color: #606266;
24
+ width: 110px;
25
+ margin-left: 10px;
26
+ font-weight: 400;
27
+ }
28
+
22
29
 
23
30
 
24
31
  .disabled-user-tooltip, .disabled-user-tooltip .el-tooltip__trigger {
@@ -59,26 +66,35 @@
59
66
  margin-top: 8px !important;
60
67
  }
61
68
 
62
- .input[data-v-bf6cf296] .el-input__inner {
69
+ .input[data-v-d8701274] .el-input__inner {
63
70
  cursor: pointer !important;
64
71
  }
65
- .table-select-popover[data-v-bf6cf296] {
72
+ .table-select-popover[data-v-d8701274] {
66
73
  height: 350px;
67
74
  width: auto !important;
68
75
  }
69
- .table-select-popover-simple .header[data-v-bf6cf296] {
76
+ .table-select-popover-simple .header[data-v-d8701274] {
70
77
  width: 100%;
71
78
  }
72
- .table-select-popover-simple .header > span[data-v-bf6cf296] {
79
+ .table-select-popover-simple .header > span[data-v-d8701274] {
73
80
  flex: var(--simple-column-flex);
74
81
  }
75
- .table-select-popover-simple .cell[data-v-bf6cf296] {
82
+ .table-select-popover-simple .cell[data-v-d8701274] {
76
83
  width: 100%;
77
84
  }
78
- .table-select-popover-simple .cell > span[data-v-bf6cf296] {
85
+ .table-select-popover-simple .cell > span[data-v-d8701274] {
79
86
  flex: var(--simple-column-flex);
80
87
  }
81
88
 
89
+ .table-select-popover .exist-row {
90
+ --el-table-tr-bg-color: #f2f5fc;
91
+ color: #a8abb2;
92
+ --el-table-row-hover-bg-color: #f2f5fc !important;
93
+ }
94
+ .table-select-popover .exist-row.current-row {
95
+ --el-table-current-row-bg-color: #f2f5fc;
96
+ }
97
+
82
98
 
83
99
 
84
100
 
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Vue 组件类型工具
3
+ * @see https://github.com/vuejs/language-tools/blob/master/packages/component-type-helpers/index.ts
4
+ */
5
+ /**
6
+ * 提取组件通过 defineExpose 暴露的类型
7
+ * @example
8
+ * ```ts
9
+ * import { ref } from 'vue';
10
+ * import { TableSelect, type ComponentExposed } from 'sun-biz';
11
+ *
12
+ * type TableSelectInstance = ComponentExposed<typeof TableSelect>;
13
+ * const tableSelectRef = ref<TableSelectInstance>();
14
+ * ```
15
+ */
16
+ export type ComponentExposed<T> = T extends new (...args: any) => infer E ? E : T extends (props: any, ctx: any, expose: (exposed: infer E) => any, ...args: any) => any ? NonNullable<E> : {};
17
+ /**
18
+ * 提取组件的 Props 类型
19
+ * @example
20
+ * ```ts
21
+ * import { TableSelect, type ComponentProps } from 'sun-biz';
22
+ *
23
+ * type TableSelectProps = ComponentProps<typeof TableSelect>;
24
+ * ```
25
+ */
26
+ export type ComponentProps<T> = T extends new (...args: any) => {
27
+ $props: infer P;
28
+ } ? NonNullable<P> : T extends (props: infer P, ...args: any) => any ? P : {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sun-biz",
3
- "version": "0.0.4-beta.55",
3
+ "version": "0.0.4-beta.58",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "src/*",