@shaonq/vue 1.4.2 → 1.4.3

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.
package/lib/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { Component } from 'vue';
4
4
  import { ComponentOptionsMixin } from 'vue';
5
5
  import { ComponentProvideOptions } from 'vue';
6
6
  import { ComputedOptions } from 'vue';
7
+ import { CSSProperties } from 'vue';
7
8
  import { DefineComponent } from 'vue';
8
9
  import { ExtractPropTypes } from 'vue';
9
10
  import { FormItem } from '@arco-design/web-vue';
@@ -238,8 +239,15 @@ declare type ComponentAttrHandler = (util: OrcFormUtilBind, index?: any) => unkn
238
239
  /** componentAttr 支持的静态值类型 */
239
240
  declare type ComponentAttrValue = null | boolean | number | string | RecordAny_3 | RecordAny_3[] | ComponentAttrHandler;
240
241
 
241
- export declare interface CssType extends Partial<CSSStyleDeclaration>, RecordAny_2 {
242
- }
242
+ /**
243
+ * 单元格样式:对象 | 支持动态函数
244
+ * @param {Object} params
245
+ * @param {any} params.row - 行数据
246
+ * @param {number} params.rowIndex - 行索引
247
+ * @param {RecordAny} params.column - 列配置
248
+ * @param {number} params.columnIndex - 列索引
249
+ */
250
+ export declare type CssType = Partial<CSSProperties> & RecordAny_2;
243
251
 
244
252
  export declare const deepClone: <T = RecordAny | RecordAny[]>(origin: T) => T;
245
253
 
@@ -297,15 +305,15 @@ declare interface FieldOption {
297
305
 
298
306
  export declare function findObject<T extends RecordAny>(obj: T, keys?: string | string[]): T;
299
307
 
300
- /** 行数据格式化 千分位|日期 */
308
+ /** 行数据格式化工具:千分位|日期|百分比 */
301
309
  export declare const formatTable: {
302
- /** 千分位|保留小数 */
310
+ /** 千分位格式化,支持小数位控制 */
303
311
  tf: (val: any, digits?: any) => any;
304
- /** 快捷格式化日期 */
312
+ /** 快捷日期格式化 yyyy-MM-dd */
305
313
  t: (val: any) => string;
306
- /** 完整格式化日期 yyyy-MM-dd HH:mm:ss */
314
+ /** 完整日期格式化,默认 yyyy-MM-dd HH:mm:ss */
307
315
  time: (val: any, f?: string) => string;
308
- /** percent 格式化百分比 */
316
+ /** 百分比格式化,默认保留2位小数,数据自动×100 */
309
317
  p: (val: any, digits?: any, percent?: string) => string;
310
318
  };
311
319
 
@@ -517,11 +525,11 @@ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<Extract
517
525
  onSubmit?: ((...args: any[]) => any) | undefined;
518
526
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
519
527
  }>, {
520
- grid: Record<string, any>;
521
528
  disabled: boolean;
522
529
  loading: boolean;
523
- modelValue: Record<string, any>;
530
+ grid: Record<string, any>;
524
531
  span: number;
532
+ modelValue: Record<string, any>;
525
533
  config: OrcFormItem[];
526
534
  labelWidth: string;
527
535
  labelAlign: "left" | "right";
@@ -568,7 +576,7 @@ export declare const OrcFormButton: __VLS_WithTemplateSlots_6< DefineComponent<E
568
576
  "onUpdate:modelValue"?: ((data: RecordAny) => any) | undefined;
569
577
  }>, {
570
578
  title: string;
571
- size: "large" | "medium" | "small" | "mini";
579
+ size: "medium" | "large" | "small" | "mini";
572
580
  modelValue: RecordAny;
573
581
  gutter: number;
574
582
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
@@ -1123,7 +1131,7 @@ export declare const OrcQuill: DefineComponent<ExtractPropTypes<{
1123
1131
  default: string;
1124
1132
  };
1125
1133
  toolbar: {
1126
- type: (ArrayConstructor | StringConstructor)[];
1134
+ type: (StringConstructor | ArrayConstructor)[];
1127
1135
  default: string;
1128
1136
  };
1129
1137
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
@@ -1134,14 +1142,14 @@ export declare const OrcQuill: DefineComponent<ExtractPropTypes<{
1134
1142
  default: string;
1135
1143
  };
1136
1144
  toolbar: {
1137
- type: (ArrayConstructor | StringConstructor)[];
1145
+ type: (StringConstructor | ArrayConstructor)[];
1138
1146
  default: string;
1139
1147
  };
1140
1148
  }>> & Readonly<{
1141
1149
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
1142
1150
  }>, {
1143
- modelValue: string;
1144
1151
  toolbar: string | unknown[];
1152
+ modelValue: string;
1145
1153
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
1146
1154
 
1147
1155
  export declare const OrcSearch: __VLS_WithTemplateSlots_4< DefineComponent<ExtractPropTypes<__VLS_WithDefaults_4<__VLS_TypePropsToRuntimeProps_4<{
@@ -1214,7 +1222,7 @@ export declare interface OrcSearchItem extends RecordAny {
1214
1222
  * - `'date'` — 日期选择器(配合 `multiple: true` 可实现日期范围)
1215
1223
  * - `'number'` — 数字输入框(配合 `min`/`max` 限制范围)
1216
1224
  */
1217
- type?: 'input' | 'select' | 'date' | 'number';
1225
+ type?: 'input' | 'select' | 'date' | 'number' | string;
1218
1226
  /** 字段名(对应提交数据的 key) */
1219
1227
  name: string;
1220
1228
  /** 显示标签 */
@@ -1260,7 +1268,7 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
1260
1268
  getSelection(): RecordAny_2[];
1261
1269
  getCheckboxKeySelection(keys?: string[] | undefined): RecordAny_2[];
1262
1270
  getReserveSelection(): RecordAny_2[];
1263
- clearSelection(): void; /** 计算分页信息 */
1271
+ clearSelection(): void;
1264
1272
  insertRow(record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined): Promise<{
1265
1273
  row: RecordAny_2;
1266
1274
  rows: RecordAny_2[];
@@ -1273,16 +1281,14 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
1273
1281
  setSelectionRow(row: any, bool?: boolean | undefined): void;
1274
1282
  loading: Ref<boolean, boolean>;
1275
1283
  setLoading: typeof setLoading;
1276
- /** 执行搜索 ,是否返回第一页 */
1277
1284
  dataInit(isFirst?: boolean | undefined): Promise<void>;
1278
- /** 加载数据 */
1279
1285
  loadData(list: any[]): void;
1280
1286
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1281
1287
  "update:selectedKeys": (...args: any[]) => void;
1282
1288
  confirm: (...args: any[]) => void;
1283
1289
  change: (...args: any[]) => void;
1284
- cellClick: (...args: any[]) => void;
1285
1290
  onReset: (...args: any[]) => void;
1291
+ cellClick: (...args: any[]) => void;
1286
1292
  cellDblclick: (...args: any[]) => void;
1287
1293
  }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_3<Props_2>, {
1288
1294
  isHover: boolean;
@@ -1297,13 +1303,13 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
1297
1303
  "onUpdate:selectedKeys"?: ((...args: any[]) => any) | undefined;
1298
1304
  onConfirm?: ((...args: any[]) => any) | undefined;
1299
1305
  onChange?: ((...args: any[]) => any) | undefined;
1300
- onCellClick?: ((...args: any[]) => any) | undefined;
1301
1306
  onOnReset?: ((...args: any[]) => any) | undefined;
1307
+ onCellClick?: ((...args: any[]) => any) | undefined;
1302
1308
  onCellDblclick?: ((...args: any[]) => any) | undefined;
1303
1309
  }>, {
1304
1310
  data: RecordAny_2[];
1305
1311
  option: OrcTableOption;
1306
- size: "large" | "medium" | "small" | "mini";
1312
+ size: "medium" | "large" | "small" | "mini";
1307
1313
  locale: I18nType;
1308
1314
  isHover: boolean;
1309
1315
  selectedKeys: string[];
@@ -1317,7 +1323,7 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
1317
1323
  rowIndex: number;
1318
1324
  columnIndex: number;
1319
1325
  value: any;
1320
- updateValue: (value: string | number | boolean | RecordAny_2 | null) => void;
1326
+ updateValue: (newValue: any) => void;
1321
1327
  formatValue: any;
1322
1328
  }): any;
1323
1329
  footer?(_: {}): any;
@@ -1432,6 +1438,14 @@ export declare interface OrcTableItem extends RecordAny_2 {
1432
1438
  filterMultiple?: boolean;
1433
1439
  /** 自定义过滤方法 */
1434
1440
  filterMethod?: VxeColumnPropTypes.FilterMethod;
1441
+ /** 数据类型 */
1442
+ dataType?: 'link' | 'number' | 'date' | 'time' | 'string' | 'status';
1443
+ /** orc-search 联动 */
1444
+ search?: {
1445
+ show?: boolean;
1446
+ hidden?: boolean;
1447
+ options?: RecordAny_2[];
1448
+ } & RecordAny_2;
1435
1449
  }
1436
1450
 
1437
1451
  /**
@@ -1579,33 +1593,17 @@ declare interface Props {
1579
1593
  }
1580
1594
 
1581
1595
  declare type Props_2 = {
1582
- /** 表格标题,显示在工具栏左侧 */
1583
1596
  title?: string;
1584
- /** 表格高度(像素或百分比) */
1585
1597
  height?: number | string;
1586
- /** 多语言 */
1587
1598
  locale?: I18nType;
1588
- /** 是否隐藏工具栏 */
1589
1599
  hideToolbar?: boolean;
1590
- /** 是否隐藏列设置按钮 */
1591
1600
  hideSetting?: boolean;
1592
- /** 是否隐藏底部分页 */
1593
1601
  hidePagination?: boolean;
1594
- /** 是否启用行悬停效果,默认 true */
1595
1602
  isHover?: boolean;
1596
- /** 表格尺寸 */
1597
1603
  size?: 'large' | 'medium' | 'small' | 'mini';
1598
- /** 选中行 key 列表(v-model) */
1599
1604
  selectedKeys?: string[];
1600
- /** 静态数据源 */
1601
1605
  data?: RecordAny_2[];
1602
- /** 表格配置 */
1603
1606
  option?: OrcTableOption;
1604
- /**
1605
- * 列配置持久化钩子
1606
- * - getColumn: 异步获取用户保存的列配置,返回 `[err, columns]`
1607
- * - setColumn: 保存用户调整后的列配置
1608
- */
1609
1607
  hook?: {
1610
1608
  getColumn: () => Promise<[boolean, RecordAny_2[]]>;
1611
1609
  setColumn: (list: RecordAny_2[]) => void;
@@ -1802,7 +1800,7 @@ export declare const useDictStore: StoreDefinition<"orc-dict", Pick<{
1802
1800
  */
1803
1801
  export declare function useOrcSearch(initialList: OrcSearchItem[] | (() => OrcSearchItem[]), local?: Ref<string>): readonly [Ref<{
1804
1802
  [x: string]: any;
1805
- type?: "number" | "input" | "select" | "date" | undefined;
1803
+ type?: string | undefined;
1806
1804
  name: string;
1807
1805
  label: string;
1808
1806
  defaultValue?: string | number | boolean | string[] | undefined;
@@ -1821,7 +1819,7 @@ export declare function useOrcSearch(initialList: OrcSearchItem[] | (() => OrcSe
1821
1819
  rules?: RecordAny | RecordAny[] | undefined;
1822
1820
  }[], OrcSearchItem[] | {
1823
1821
  [x: string]: any;
1824
- type?: "number" | "input" | "select" | "date" | undefined;
1822
+ type?: string | undefined;
1825
1823
  name: string;
1826
1824
  label: string;
1827
1825
  defaultValue?: string | number | boolean | string[] | undefined;