cc1-form 1.1.38 → 1.1.39

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.
@@ -1,4 +1,5 @@
1
1
  import TSys from '../../utils/TSys';
2
+ import type { curdConfType } from './index';
2
3
  /**
3
4
  * TCurd 组件的完整配置接口,用于声明搜索、表格、分页、表单、工具栏、API 等全部行为
4
5
  *
@@ -282,25 +283,11 @@ export interface CurdConfig<T = any> {
282
283
  /**
283
284
  * 打开弹窗前执行处理
284
285
  */
285
- openBefore?: (data: T, update: {
286
- /** 标题 */
287
- title: string;
288
- /** 类型 */
289
- type: any;
290
- /** 表单数据 */
291
- form: T;
292
- }) => any;
286
+ openBefore?: (data: T, update: curdConfType['conf']['update']) => any;
293
287
  /**
294
288
  * 打开弹窗后执行处理
295
289
  */
296
- openAfter?: (data: T, update: {
297
- /** 标题 */
298
- title: string;
299
- /** 类型 */
300
- type: any;
301
- /** 表单数据 */
302
- form: T;
303
- }) => any;
290
+ openAfter?: (data: T, update: curdConfType['conf']['update']) => any;
304
291
  /**
305
292
  * 关闭弹窗前执行处理
306
293
  */
@@ -308,25 +295,11 @@ export interface CurdConfig<T = any> {
308
295
  /**
309
296
  * 提交前执行处理
310
297
  */
311
- submitBefore?: (form: T, update: {
312
- /** 标题 */
313
- title: string;
314
- /** 类型 */
315
- type: any;
316
- /** 表单数据 */
317
- form: T;
318
- }) => any;
298
+ submitBefore?: (form: T, update: curdConfType['conf']['update']) => any;
319
299
  /**
320
300
  * 提交后执行处理
321
301
  */
322
- submitAfter?: (form: T, update: {
323
- /** 标题 */
324
- title: string;
325
- /** 类型 */
326
- type: any;
327
- /** 表单数据 */
328
- form: T;
329
- }) => any;
302
+ submitAfter?: (form: T, update: curdConfType['conf']['update']) => any;
330
303
  }>;
331
304
  /**
332
305
  * 表格列和新增编辑表单字段
@@ -561,12 +534,12 @@ export interface CurdConfigColumn<T = any> {
561
534
  /** 文本配置 */
562
535
  text?: Partial<{
563
536
  /** 搜索文本配置 */
564
- search: {
537
+ search: Partial<{
565
538
  /** 搜索文本标签 如果为空字符串则不显示标签 */
566
539
  label: string;
567
540
  /** 搜索文本占位符 */
568
541
  placeholder: string;
569
- };
542
+ }>;
570
543
  /** 新增编辑表单文本配置 */
571
544
  form: Partial<{
572
545
  /** 新增编辑表单文本标签 如果为false则不显示标签 */
@@ -672,7 +645,7 @@ export type CurdOptions<T = any> = {
672
645
  */
673
646
  data: CurdSelectData[];
674
647
  /** 获取数据回调,如果传入,会在初始化、新增、编辑时调用,返回数据源后不再进行请求,如果返回false不进行更改之前的数据 */
675
- dataApi: (param?: T) => CurdSelectData[] | Promise<CurdSelectData[]> | boolean;
648
+ dataApi: (param: T, type: 'init' | 'update') => CurdSelectData[] | Promise<CurdSelectData[]> | boolean;
676
649
  /** 获取数据挂载配置 */
677
650
  dataApiConfig: {
678
651
  /** 是否只获取一次数据 - 默认为true */
@@ -765,7 +738,7 @@ export type CurdOptions<T = any> = {
765
738
  */
766
739
  data: CurdSelectData[];
767
740
  /** 获取数据回调,如果传入,会在初始化、新增、编辑时调用,返回数据源后不再进行请求,如果返回false不进行更改之前的数据 */
768
- dataApi: (param?: T) => CurdSelectData[] | Promise<CurdSelectData[]> | boolean;
741
+ dataApi: (param: T, type: 'init' | 'update') => CurdSelectData[] | Promise<CurdSelectData[]> | boolean;
769
742
  /** 获取数据挂载配置 */
770
743
  dataApiConfig: {
771
744
  /** 是否只获取一次数据 - 默认为true */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc1-form",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
4
4
  "description": "我来助你-表单组件库",
5
5
  "repository": {
6
6
  "type": "git",