@vue-start/pro 0.4.10 → 0.4.12

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { ExtractPropTypes, PropType, VNode, Ref as Ref$1 } from 'vue';
2
+ import { ExtractPropTypes, PropType, VNode, App, Ref as Ref$1 } from 'vue';
3
3
  import { UnwrapNestedRefs, Ref, ComputedRef } from '@vue/reactivity';
4
4
  import { Subject } from 'rxjs';
5
5
  import { IRequestActor } from '@vue-start/request';
@@ -296,11 +296,78 @@ declare const useModuleEvent: (cb: (action: TActionEvent) => void) => void;
296
296
  declare const useDoneRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
297
297
  declare const useFailedRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
298
298
  declare const useComposeRequestActor: (actors: (IRequestActor | string)[], options: {
299
- onStart?: ((actor: IRequestActor) => void) | undefined;
300
299
  onSuccess?: ((actor: IRequestActor) => void) | undefined;
301
300
  onFailed?: ((actor: IRequestActor) => void) | undefined;
302
301
  onFinish?: ((actor: IRequestActor) => void) | undefined;
303
- }, cancelWhileUnmount?: boolean | undefined) => void;
302
+ }, cancelWhileUnmount?: boolean) => void;
303
+
304
+ declare const proBasePropsFn: () => {
305
+ /**
306
+ * 组件集
307
+ */
308
+ elementMap: {
309
+ type: PropType<TElementMap>;
310
+ };
311
+ /**
312
+ * form组件集(使用FormItem包裹的组件集合)
313
+ * readonly模式下使用elementMap中的组件渲染
314
+ */
315
+ formElementMap: {
316
+ type: PropType<TElementMap>;
317
+ };
318
+ /**
319
+ * 基础项配置
320
+ */
321
+ columns: {
322
+ type: PropType<TColumns>;
323
+ };
324
+ /**
325
+ * 对 column 进行补充
326
+ * 通常对columns为静态值时候使用
327
+ */
328
+ columnState: {
329
+ type: PropType<Record<string, any>>;
330
+ };
331
+ };
332
+ declare type ProBaseProps = Partial<ExtractPropTypes<ReturnType<typeof proBasePropsFn>>>;
333
+ declare const proBaseProps: ProBaseProps;
334
+ interface IProConfigProvide {
335
+ /**
336
+ * 组件集
337
+ */
338
+ elementMap?: TElementMap;
339
+ /**
340
+ * form组件集(使用FormItem包裹的组件集合)
341
+ */
342
+ formElementMap?: TElementMap;
343
+ }
344
+ declare const proConfigProps: () => {
345
+ config: {
346
+ type: PropType<IProConfigProvide>;
347
+ default: {};
348
+ };
349
+ };
350
+ declare const useProConfig: () => IProConfigProvide;
351
+ declare type ProConfigProps = Partial<ExtractPropTypes<ReturnType<typeof proConfigProps>>>;
352
+ /**
353
+ * 组件方式注册
354
+ */
355
+ declare const ProConfig: vue.DefineComponent<Partial<ExtractPropTypes<{
356
+ config: {
357
+ type: PropType<IProConfigProvide>;
358
+ default: {};
359
+ };
360
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
361
+ config: {
362
+ type: PropType<IProConfigProvide>;
363
+ default: {};
364
+ };
365
+ }>>>, {}>;
366
+ /**
367
+ * app.use 方式注册
368
+ * @param config
369
+ */
370
+ declare const createProConfig: (config?: IProConfigProvide) => (app: App) => void;
304
371
 
305
372
  interface IProTableProvideExtra extends Record<string, any> {
306
373
  }
@@ -355,18 +422,6 @@ declare const proTableProps: () => {
355
422
  column: {
356
423
  type: PropType<TTableColumn>;
357
424
  };
358
- columns: {
359
- type: PropType<TTableColumns>;
360
- };
361
- columnState: {
362
- type: PropType<Record<string, any>>;
363
- };
364
- /**
365
- * 展示控件集合,readonly模式下使用这些组件渲染
366
- */
367
- elementMap: {
368
- type: PropType<TElementMap>;
369
- };
370
425
  /**
371
426
  * 序号
372
427
  */
@@ -389,8 +444,8 @@ declare const proTableProps: () => {
389
444
  type: PropType<IProTableProvideExtra>;
390
445
  };
391
446
  };
392
- declare type ProTableProps = Partial<ExtractPropTypes<ReturnType<typeof proTableProps>>>;
393
- declare const createTable: (Table: any, Props?: any, tableMethods?: string[] | undefined) => any;
447
+ declare type ProTableProps = Partial<ExtractPropTypes<ReturnType<typeof proTableProps>>> & ProBaseProps;
448
+ declare const createTable: (Table: any, Props?: any, tableMethods?: string[]) => any;
394
449
 
395
450
  declare type TPageState = {
396
451
  page: number;
@@ -426,25 +481,6 @@ declare type TCurdActionEvent = {
426
481
  source?: TActionEvent["source"];
427
482
  };
428
483
  declare const proCurdProps: () => {
429
- /**
430
- * 配置(静态)
431
- */
432
- columns: {
433
- type: PropType<TColumns>;
434
- };
435
- /**
436
- * 配置(动态)
437
- * columns动态属性兼容
438
- */
439
- columnState: {
440
- type: PropType<Record<string, any>>;
441
- };
442
- /**
443
- * 录入组件集
444
- */
445
- formElementMap: {
446
- type: PropType<TElementMap>;
447
- };
448
484
  /**
449
485
  * 列表 或 详情 的唯一标识
450
486
  */
@@ -472,7 +508,7 @@ declare const proCurdProps: () => {
472
508
  type: PropType<Record<string, any>>;
473
509
  };
474
510
  };
475
- declare type CurdProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdProps>>>;
511
+ declare type CurdProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdProps>>> & ProBaseProps;
476
512
  declare const CurdMethods: string[];
477
513
  declare type ProCurdProps = CurdProps & Omit<ProModuleProps, "state" | "requests"> & {
478
514
  curdState?: UnwrapNestedRefs<ICurdState>;
@@ -600,7 +636,7 @@ declare const proCurdAddOrEditProps: () => {
600
636
  };
601
637
  };
602
638
  declare type ProCurdAddOrEditProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdAddOrEditProps>>>;
603
- declare const createCurdForm: (Form: any, Button: any, convertFormProps?: ((curdState: ICurdState) => Record<string, any>) | undefined, formMethods?: string[] | undefined) => any;
639
+ declare const createCurdForm: (Form: any, Button: any, convertFormProps?: ((curdState: ICurdState) => Record<string, any>) | undefined, formMethods?: string[]) => any;
604
640
 
605
641
  declare const proCurdListProps: () => {
606
642
  /**
@@ -733,27 +769,6 @@ declare const proFormProps: () => {
733
769
  disableStateRules: {
734
770
  type: PropType<BooleanRulesObjType>;
735
771
  };
736
- /**
737
- *
738
- */
739
- columns: {
740
- type: PropType<TColumns>;
741
- };
742
- columnState: {
743
- type: PropType<Record<string, any>>;
744
- };
745
- /**
746
- * 展示控件集合,readonly模式下使用这些组件渲染
747
- */
748
- elementMap: {
749
- type: PropType<TElementMap>;
750
- };
751
- /**
752
- * 录入控件集合
753
- */
754
- formElementMap: {
755
- type: PropType<TElementMap>;
756
- };
757
772
  /**
758
773
  * 是否启用rules验证
759
774
  */
@@ -768,7 +783,7 @@ declare const proFormProps: () => {
768
783
  type: PropType<IProFormProvideExtra>;
769
784
  };
770
785
  };
771
- declare type ProFormProps = Partial<ExtractPropTypes<ReturnType<typeof proFormProps>>>;
786
+ declare type ProFormProps = Partial<ExtractPropTypes<ReturnType<typeof proFormProps>>> & ProBaseProps;
772
787
  declare const createForm: (Form: any, Grid: any, formMethods: string[]) => any;
773
788
 
774
789
  declare enum SearchMode {
@@ -777,12 +792,6 @@ declare enum SearchMode {
777
792
  }
778
793
  declare type ISearchMode = keyof typeof SearchMode;
779
794
  declare const proSearchFormProps: () => {
780
- /**
781
- * 需要监听的对象
782
- */
783
- model: {
784
- type: PropType<Record<string, any>>;
785
- };
786
795
  /**
787
796
  * 初始化触发 onFinish
788
797
  */
@@ -797,13 +806,6 @@ declare const proSearchFormProps: () => {
797
806
  type: PropType<"AUTO" | "MANUAL">;
798
807
  default: SearchMode;
799
808
  };
800
- /**
801
- * 配置 同ProForm中的columns
802
- * 可以根据column中valueType计算出默认的debounceKeys
803
- */
804
- columns: {
805
- type: PropType<TColumns>;
806
- };
807
809
  /**
808
810
  * 需要debounce处理的字段
809
811
  */
@@ -819,7 +821,7 @@ declare const proSearchFormProps: () => {
819
821
  default: number;
820
822
  };
821
823
  };
822
- declare type ProSearchFormProps = Partial<ExtractPropTypes<ReturnType<typeof proSearchFormProps>>>;
824
+ declare type ProSearchFormProps = Partial<ExtractPropTypes<ReturnType<typeof proSearchFormProps>>> & ProFormProps;
823
825
  /**
824
826
  * 该组件只是个模式,最终返回null,不做任何渲染,应配合着ProForm的包装类一起使用
825
827
  * 针对传入的model(监听对象)做相应的finish(回调)处理
@@ -877,9 +879,7 @@ declare const createFormItemCompFn: <T extends FormItemProps>(FormItem: any, con
877
879
  slots: {
878
880
  type: ObjectConstructor;
879
881
  };
880
- }>> & Record<string, any> extends vue.ComponentPropsOptions<{
881
- [x: string]: unknown;
882
- }> ? ExtractPropTypes<T & Partial<ExtractPropTypes<{
882
+ }>> & Record<string, any> extends infer T_1 ? T_1 extends T & Partial<ExtractPropTypes<{
883
883
  readonly: {
884
884
  type: BooleanConstructor;
885
885
  default: undefined;
@@ -893,21 +893,9 @@ declare const createFormItemCompFn: <T extends FormItemProps>(FormItem: any, con
893
893
  slots: {
894
894
  type: ObjectConstructor;
895
895
  };
896
- }>> & Record<string, any>> : T & Partial<ExtractPropTypes<{
897
- readonly: {
898
- type: BooleanConstructor;
899
- default: undefined;
900
- };
901
- fieldProps: {
902
- type: ObjectConstructor;
903
- };
904
- showProps: {
905
- type: ObjectConstructor;
906
- };
907
- slots: {
908
- type: ObjectConstructor;
909
- };
910
- }>> & Record<string, any>>, vue.ExtractDefaultPropTypes<T & Partial<ExtractPropTypes<{
896
+ }>> & Record<string, any> ? T_1 extends vue.ComponentPropsOptions<{
897
+ [x: string]: unknown;
898
+ }> ? ExtractPropTypes<T_1> : T_1 : never : never>, vue.ExtractDefaultPropTypes<T & Partial<ExtractPropTypes<{
911
899
  readonly: {
912
900
  type: BooleanConstructor;
913
901
  default: undefined;
@@ -947,7 +935,7 @@ declare const createFormList: (FormItem: any) => any;
947
935
  * @param showState
948
936
  * @param showStateRules
949
937
  */
950
- declare const getValidValues: (values: Record<string, any>, showState?: BooleanObjType | undefined, showStateRules?: BooleanRulesObjType | undefined) => Record<string, any>;
938
+ declare const getValidValues: (values: Record<string, any>, showState?: BooleanObjType, showStateRules?: BooleanRulesObjType) => Record<string, any>;
951
939
  /**
952
940
  * string类型的path转为arr
953
941
  * @param path
@@ -968,4 +956,4 @@ declare const mergeStateToList: (list: Record<string, any>[], listState: Record<
968
956
  */
969
957
  declare const createExpose: (methods: string[], targetRef: Ref$1) => {};
970
958
 
971
- export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, TreeOption, TreeOptions, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
959
+ export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProConfigProvide, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProBaseProps, ProConfig, ProConfigProps, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, TreeOption, TreeOptions, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createProConfig, createSearchForm, createTable, defaultPage, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, proBaseProps, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProConfig, useProCurd, useProForm, useProFormList, useProModule, useProTable };