@vue-start/pro 0.2.0 → 0.3.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.3.0](https://github.com/zxeryu/vue-start/compare/@vue-start/pro@0.2.0...@vue-start/pro@0.3.0) (2022-08-22)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **element-pro:** loading ([c512f63](https://github.com/zxeryu/vue-start/commit/c512f638f06acab64242bf85b2475b860097061e))
11
+ - **element-pro:** serial number for table ([32e12aa](https://github.com/zxeryu/vue-start/commit/32e12aa6bdd494464bc2839eaaed5d8ce66330a5))
12
+ - **pro:** ts error ([2daa4e9](https://github.com/zxeryu/vue-start/commit/2daa4e95031a52526860fbc863087aaedd30e3ff))
13
+
14
+ ### Features
15
+
16
+ - **pro:** modal/page curd ([07b696c](https://github.com/zxeryu/vue-start/commit/07b696cf2a327d4ec083ec75f3d5b73c870bfcb3))
17
+
18
+ ### Performance Improvements
19
+
20
+ - **pro:** columnState for table,form ([7f4431e](https://github.com/zxeryu/vue-start/commit/7f4431ebf2d426b93a24e381712d705700561ec9))
21
+
6
22
  # [0.2.0](https://github.com/zxeryu/vue-start/compare/@vue-start/pro@0.1.0...@vue-start/pro@0.2.0) (2022-08-17)
7
23
 
8
24
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -42,6 +42,12 @@ declare type TColumns = TColumn[];
42
42
  declare type TActionEvent = {
43
43
  type: string;
44
44
  payload?: any;
45
+ /**
46
+ * 发送事件源
47
+ * 公共组件(如:Curd)只处理source为undefined的事件
48
+ * 业务组件可以传入该参数覆盖之前的默认行为
49
+ */
50
+ source?: string;
45
51
  extra?: Record<string, any>;
46
52
  };
47
53
  /**
@@ -309,6 +315,9 @@ declare const proTableProps: () => {
309
315
  columns: {
310
316
  type: PropType<TTableColumns>;
311
317
  };
318
+ columnState: {
319
+ type: PropType<Record<string, any>>;
320
+ };
312
321
  /**
313
322
  * 展示控件集合,readonly模式下使用这些组件渲染
314
323
  */
@@ -321,6 +330,21 @@ declare const proTableProps: () => {
321
330
  loading: {
322
331
  type: BooleanConstructor;
323
332
  };
333
+ /**
334
+ * 序号
335
+ */
336
+ serialNumber: {
337
+ type: BooleanConstructor;
338
+ };
339
+ /**
340
+ * 分页
341
+ */
342
+ pagination: {
343
+ type: PropType<{
344
+ page?: number | undefined;
345
+ pageSize?: number | undefined;
346
+ }>;
347
+ };
324
348
  /**
325
349
  * provide传递
326
350
  */
@@ -345,6 +369,9 @@ declare const ProTable: vue.DefineComponent<Partial<ExtractPropTypes<{
345
369
  columns: {
346
370
  type: PropType<TTableColumns>;
347
371
  };
372
+ columnState: {
373
+ type: PropType<Record<string, any>>;
374
+ };
348
375
  /**
349
376
  * 展示控件集合,readonly模式下使用这些组件渲染
350
377
  */
@@ -357,6 +384,21 @@ declare const ProTable: vue.DefineComponent<Partial<ExtractPropTypes<{
357
384
  loading: {
358
385
  type: BooleanConstructor;
359
386
  };
387
+ /**
388
+ * 序号
389
+ */
390
+ serialNumber: {
391
+ type: BooleanConstructor;
392
+ };
393
+ /**
394
+ * 分页
395
+ */
396
+ pagination: {
397
+ type: PropType<{
398
+ page?: number | undefined;
399
+ pageSize?: number | undefined;
400
+ }>;
401
+ };
360
402
  /**
361
403
  * provide传递
362
404
  */
@@ -379,6 +421,9 @@ declare const ProTable: vue.DefineComponent<Partial<ExtractPropTypes<{
379
421
  columns: {
380
422
  type: PropType<TTableColumns>;
381
423
  };
424
+ columnState: {
425
+ type: PropType<Record<string, any>>;
426
+ };
382
427
  /**
383
428
  * 展示控件集合,readonly模式下使用这些组件渲染
384
429
  */
@@ -391,6 +436,21 @@ declare const ProTable: vue.DefineComponent<Partial<ExtractPropTypes<{
391
436
  loading: {
392
437
  type: BooleanConstructor;
393
438
  };
439
+ /**
440
+ * 序号
441
+ */
442
+ serialNumber: {
443
+ type: BooleanConstructor;
444
+ };
445
+ /**
446
+ * 分页
447
+ */
448
+ pagination: {
449
+ type: PropType<{
450
+ page?: number | undefined;
451
+ pageSize?: number | undefined;
452
+ }>;
453
+ };
394
454
  /**
395
455
  * provide传递
396
456
  */
@@ -399,6 +459,10 @@ declare const ProTable: vue.DefineComponent<Partial<ExtractPropTypes<{
399
459
  };
400
460
  }>>>, {}>;
401
461
 
462
+ declare const defaultPage: {
463
+ page: number;
464
+ pageSize: number;
465
+ };
402
466
  interface IListData extends Record<string, any> {
403
467
  total: number;
404
468
  dataSource: Record<string, any>[];
@@ -417,13 +481,14 @@ interface ICurdState extends Record<string, any> {
417
481
  */
418
482
  interface ICurdOperateOpts extends Omit<IRequestOpts, "actor" | "action">, Omit<IOperateItem, "value"> {
419
483
  action: ICurdAction;
420
- actor?: IRequestOpts;
484
+ actor?: IRequestActor;
421
485
  }
422
486
  declare type TCurdActionEvent = {
423
487
  action: ICurdAction;
424
488
  type: ICurdSubAction;
425
489
  record?: Record<string, any>;
426
490
  values?: Record<string, any>;
491
+ source?: TActionEvent["source"];
427
492
  };
428
493
  declare const proCurdProps: () => {
429
494
  /**
@@ -455,7 +520,7 @@ declare const proCurdProps: () => {
455
520
  };
456
521
  declare type CurdProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdProps>>>;
457
522
  declare type ProCurdProps = CurdProps & Omit<ProModuleProps, "state" | "requests"> & {
458
- curdState: UnwrapNestedRefs<ICurdState>;
523
+ curdState?: UnwrapNestedRefs<ICurdState>;
459
524
  };
460
525
  declare const ProCurd: vue.DefineComponent<ProCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProCurdProps>, {}>;
461
526
 
@@ -518,6 +583,27 @@ declare enum CurdAddAction {
518
583
  }
519
584
  declare type ICurdAddAction = keyof typeof CurdAddAction;
520
585
 
586
+ declare const modalCurdProps: () => {
587
+ defaultAddRecord: {
588
+ type: PropType<Record<string, any>>;
589
+ };
590
+ };
591
+ declare type ModalCurdProps = Partial<ExtractPropTypes<ReturnType<typeof modalCurdProps>>>;
592
+ declare type ProModalCurdProps = ModalCurdProps & ProCurdProps;
593
+ declare const ProModalCurd: vue.DefineComponent<ProModalCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProModalCurdProps>, {}>;
594
+
595
+ declare const pageCurdProps: () => {
596
+ defaultAddRecord: {
597
+ type: PropType<Record<string, any>>;
598
+ };
599
+ routeBack: {
600
+ type: PropType<(action: ICurdAction) => void>;
601
+ };
602
+ };
603
+ declare type PageCurdProps = Partial<ExtractPropTypes<ReturnType<typeof pageCurdProps>>>;
604
+ declare type ProPageCurdProps = PageCurdProps & ProCurdProps;
605
+ declare const ProPageCurd: vue.DefineComponent<ProPageCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProPageCurdProps>, {}>;
606
+
521
607
  interface IProFormProvideExtra extends Record<string, any> {
522
608
  }
523
609
  interface IProFormProvide extends IProFormProvideExtra {
@@ -528,7 +614,7 @@ interface IProFormProvide extends IProFormProvideExtra {
528
614
  readonly: Ref<boolean | undefined>;
529
615
  elementMap?: TElementMap;
530
616
  formElementMap?: TElementMap;
531
- formItemVNodes: Ref<(VNode | null)[]>;
617
+ columns: Ref<TColumns>;
532
618
  }
533
619
  declare const useProForm: () => IProFormProvide;
534
620
  declare const proFormProps: () => {
@@ -579,6 +665,9 @@ declare const proFormProps: () => {
579
665
  columns: {
580
666
  type: PropType<TColumns>;
581
667
  };
668
+ columnState: {
669
+ type: PropType<Record<string, any>>;
670
+ };
582
671
  /**
583
672
  * 展示控件集合,readonly模式下使用这些组件渲染
584
673
  */
@@ -654,6 +743,9 @@ declare const ProForm: vue.DefineComponent<{
654
743
  columns: {
655
744
  type: PropType<TColumns>;
656
745
  };
746
+ columnState: {
747
+ type: PropType<Record<string, any>>;
748
+ };
657
749
  /**
658
750
  * 展示控件集合,readonly模式下使用这些组件渲染
659
751
  */
@@ -679,7 +771,7 @@ declare const ProForm: vue.DefineComponent<{
679
771
  provideExtra: {
680
772
  type: PropType<IProFormProvideExtra>;
681
773
  };
682
- }, () => VNode<vue.RendererNode, vue.RendererElement, {
774
+ }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
683
775
  [key: string]: any;
684
776
  }>[] | undefined, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ExtractPropTypes<{
685
777
  /**
@@ -729,6 +821,9 @@ declare const ProForm: vue.DefineComponent<{
729
821
  columns: {
730
822
  type: PropType<TColumns>;
731
823
  };
824
+ columnState: {
825
+ type: PropType<Record<string, any>>;
826
+ };
732
827
  /**
733
828
  * 展示控件集合,readonly模式下使用这些组件渲染
734
829
  */
@@ -1032,6 +1127,18 @@ declare const getValidValues: (values: Record<string, any>, showState?: BooleanO
1032
1127
  * string类型的path转为arr
1033
1128
  * @param path
1034
1129
  */
1035
- declare const convertPathToList: (path: undefined | string | number | (string | number)[]) => undefined | (string | number)[];
1130
+ declare const convertPathToList: (path: undefined | string | number | (string | number)[]) => undefined | (string | number)[];
1131
+ /**
1132
+ * 唯一id
1133
+ */
1134
+ declare const generateId: () => string;
1135
+ /**
1136
+ * 将listState 中的数据通过id merge到 list item中
1137
+ * ps:数组会替换
1138
+ * @param list
1139
+ * @param listState
1140
+ * @param id
1141
+ */
1142
+ declare const mergeStateToList: (list: Record<string, any>[], listState: Record<string, any>, id: string | number | ((item: Record<string, any>) => string | number)) => Record<string, any>[];
1036
1143
 
1037
- export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdSubAction, FormItemProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, ProCurd, ProCurdProps, ProForm, ProFormItemProps, ProFormList, ProFormListProps, ProFormProps, ProModule, ProModuleProps, ProSearchForm, ProSearchFormProps, ProTable, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TOption, TOptions, TTableColumn, TTableColumns, TValueType, convertPathToList, createFormItemCompFn, getColumnFormItemName, getColumnValueType, getFormItemEl, getItemEl, getValidValues, provideProCurd, provideProModule, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
1144
+ export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdSubAction, FormItemProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, ProCurd, ProCurdProps, ProForm, ProFormItemProps, ProFormList, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchForm, ProSearchFormProps, ProTable, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TOption, TOptions, TTableColumn, TTableColumns, TValueType, convertPathToList, createFormItemCompFn, defaultPage, generateId, getColumnFormItemName, getColumnValueType, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProModule, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };