@vue-start/pro 0.3.2 → 0.4.2

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,21 @@
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.4.0](https://github.com/zxeryu/vue-start/compare/@vue-start/pro@0.3.2...@vue-start/pro@0.4.0) (2022-09-02)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **pro:** curd columns sign ([19ca887](https://github.com/zxeryu/vue-start/commit/19ca887b2f0826c64a0cae7b6abe093ab6d1f525))
11
+ - **pro:** dispatch support fun ([9c9528c](https://github.com/zxeryu/vue-start/commit/9c9528cf305e6e3bf1daebc57afb5d5ac9d9fd21))
12
+
13
+ ### Features
14
+
15
+ - module render ([1e14e95](https://github.com/zxeryu/vue-start/commit/1e14e956e8712db277d2e9020b392243b454a846))
16
+
17
+ ### Performance Improvements
18
+
19
+ - props/slots convert ([06c9655](https://github.com/zxeryu/vue-start/commit/06c9655f0622278e18770699b1d643fe10cbbdca))
20
+
6
21
  ## [0.3.2](https://github.com/zxeryu/vue-start/compare/@vue-start/pro@0.3.1...@vue-start/pro@0.3.2) (2022-08-29)
7
22
 
8
23
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as vue from 'vue';
2
2
  import { ExtractPropTypes, PropType, VNode, Ref as Ref$1 } from 'vue';
3
- import { Ref, UnwrapNestedRefs, ComputedRef } from '@vue/reactivity';
3
+ import { UnwrapNestedRefs, Ref, ComputedRef } from '@vue/reactivity';
4
4
  import { Subject } from 'rxjs';
5
5
  import { IRequestActor } from '@vue-start/request';
6
6
 
@@ -43,16 +43,9 @@ declare type TColumn = {
43
43
  };
44
44
  formFieldProps?: Record<string, any>;
45
45
  search?: boolean;
46
- hideInTable?: boolean;
47
- hideInForm?: boolean;
48
- hideInDetail?: boolean;
49
- searchSort?: boolean;
50
- tableSort?: boolean;
51
- formSort?: boolean;
52
- descSort?: boolean;
53
46
  extra?: {
54
47
  desc?: any;
55
- };
48
+ } & Record<string, any>;
56
49
  };
57
50
  declare type TColumns = TColumn[];
58
51
  /**
@@ -96,6 +89,7 @@ interface FieldNames {
96
89
  children?: string;
97
90
  }
98
91
 
92
+ /***************************************** curd模式 *****************************************/
99
93
  /**
100
94
  * 获取Column的valueType,默认"text"
101
95
  * @param column
@@ -121,16 +115,68 @@ declare const getFormItemEl: (formElementMap: any, column: TColumn, needRules?:
121
115
  * @param value
122
116
  */
123
117
  declare const getItemEl: <T extends TColumn>(elementMap: any, column: T, value: any) => VNode | null;
118
+ /***************************************** 通用模式 *****************************************/
119
+ declare type InternalNamePath = (string | number)[];
120
+ declare type NamePath = string | number | InternalNamePath;
121
+ interface IHighConfig {
122
+ registerStateList?: {
123
+ name: NamePath;
124
+ mapName?: NamePath;
125
+ }[];
126
+ registerEventList?: {
127
+ name: string;
128
+ sendEventName?: TActionEvent["type"];
129
+ }[];
130
+ registerPropsTrans?: {
131
+ name: NamePath;
132
+ isFun?: boolean;
133
+ needParams?: boolean;
134
+ }[];
135
+ }
136
+ /**
137
+ * 组件树描述
138
+ */
139
+ interface IElementConfig {
140
+ elementType: string;
141
+ elementId: string;
142
+ elementProps?: Record<string, any>;
143
+ slots?: {
144
+ [name: string]: ((...params$: any[]) => any) | (IElementConfig & {
145
+ needParams?: boolean;
146
+ });
147
+ };
148
+ children?: IElementConfig[];
149
+ childrenSlotName?: string;
150
+ highConfig$?: IHighConfig;
151
+ }
152
+ declare const renderElements: (elementMap: TElementMap, elementConfigs: IElementConfig[]) => (VNode | null)[];
153
+ /**
154
+ *
155
+ * @param elementMap
156
+ * @param elementConfig
157
+ */
158
+ declare const renderElement: (elementMap: TElementMap, elementConfig: IElementConfig) => VNode<vue.RendererNode, vue.RendererElement, {
159
+ [key: string]: any;
160
+ }>;
161
+ /**
162
+ * 获取第一层级属性名
163
+ * 如:['aaa','bbb',...] 中的 'aaa'
164
+ * 如:"aaa.bbb.ccc..." 中的 'aaa'
165
+ */
166
+ declare const getFirstPropName: (name: NamePath) => string | number | undefined;
167
+ /**
168
+ * 处理highConfig$
169
+ */
170
+ declare const Wrapper: vue.DefineComponent<{
171
+ elementMap: TElementMap;
172
+ elementConfig: IElementConfig;
173
+ }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{
174
+ elementMap: TElementMap;
175
+ elementConfig: IElementConfig;
176
+ }>, {}>;
177
+
124
178
  interface IProModuleProvide {
125
- columns: Ref<TColumns>;
126
- getFormItemVNode: (column: TColumn, needRules: boolean | undefined) => VNode | null;
127
- getItemVNode: (column: TColumn, value: any) => VNode | null;
128
- elementMap: {
129
- [key: string]: any;
130
- };
131
- formElementMap: {
132
- [key: string]: any;
133
- };
179
+ elementMap: TElementMap;
134
180
  subject$: Subject<TActionEvent>;
135
181
  sendEvent: (action: TActionEvent) => void;
136
182
  state: UnwrapNestedRefs<Record<string, any>>;
@@ -166,29 +212,16 @@ declare const proModuleProps: () => {
166
212
  type: PropType<Record<string, any>>;
167
213
  };
168
214
  /**
169
- * 配置(静态)
170
- */
171
- columns: {
172
- type: PropType<TColumns>;
173
- };
174
- /**
175
- * 配置(动态)
176
- * columns动态属性兼容
177
- */
178
- columnState: {
179
- type: PropType<Record<string, any>>;
180
- };
181
- /**
182
- * 展示组件集
215
+ * 组件集
183
216
  */
184
217
  elementMap: {
185
218
  type: PropType<TElementMap>;
186
219
  };
187
220
  /**
188
- * 录入组件集
221
+ * 组件描述(树)
189
222
  */
190
- formElementMap: {
191
- type: PropType<TElementMap>;
223
+ elementConfigs: {
224
+ type: PropType<IElementConfig[]>;
192
225
  };
193
226
  /**
194
227
  * requests
@@ -206,29 +239,16 @@ declare const ProModule: vue.DefineComponent<Partial<ExtractPropTypes<{
206
239
  type: PropType<Record<string, any>>;
207
240
  };
208
241
  /**
209
- * 配置(静态)
210
- */
211
- columns: {
212
- type: PropType<TColumns>;
213
- };
214
- /**
215
- * 配置(动态)
216
- * columns动态属性兼容
217
- */
218
- columnState: {
219
- type: PropType<Record<string, any>>;
220
- };
221
- /**
222
- * 展示组件集
242
+ * 组件集
223
243
  */
224
244
  elementMap: {
225
245
  type: PropType<TElementMap>;
226
246
  };
227
247
  /**
228
- * 录入组件集
248
+ * 组件描述(树)
229
249
  */
230
- formElementMap: {
231
- type: PropType<TElementMap>;
250
+ elementConfigs: {
251
+ type: PropType<IElementConfig[]>;
232
252
  };
233
253
  /**
234
254
  * requests
@@ -244,29 +264,16 @@ declare const ProModule: vue.DefineComponent<Partial<ExtractPropTypes<{
244
264
  type: PropType<Record<string, any>>;
245
265
  };
246
266
  /**
247
- * 配置(静态)
248
- */
249
- columns: {
250
- type: PropType<TColumns>;
251
- };
252
- /**
253
- * 配置(动态)
254
- * columns动态属性兼容
255
- */
256
- columnState: {
257
- type: PropType<Record<string, any>>;
258
- };
259
- /**
260
- * 展示组件集
267
+ * 组件集
261
268
  */
262
269
  elementMap: {
263
270
  type: PropType<TElementMap>;
264
271
  };
265
272
  /**
266
- * 录入组件集
273
+ * 组件描述(树)
267
274
  */
268
- formElementMap: {
269
- type: PropType<TElementMap>;
275
+ elementConfigs: {
276
+ type: PropType<IElementConfig[]>;
270
277
  };
271
278
  /**
272
279
  * requests
@@ -410,6 +417,25 @@ declare type TCurdActionEvent = {
410
417
  source?: TActionEvent["source"];
411
418
  };
412
419
  declare const proCurdProps: () => {
420
+ /**
421
+ * 配置(静态)
422
+ */
423
+ columns: {
424
+ type: PropType<TColumns>;
425
+ };
426
+ /**
427
+ * 配置(动态)
428
+ * columns动态属性兼容
429
+ */
430
+ columnState: {
431
+ type: PropType<Record<string, any>>;
432
+ };
433
+ /**
434
+ * 录入组件集
435
+ */
436
+ formElementMap: {
437
+ type: PropType<TElementMap>;
438
+ };
413
439
  /**
414
440
  * 列表 或 详情 的唯一标识
415
441
  */
@@ -444,6 +470,12 @@ declare type ProCurdProps = CurdProps & Omit<ProModuleProps, "state" | "requests
444
470
  declare const ProCurd: vue.DefineComponent<ProCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProCurdProps>, {}>;
445
471
 
446
472
  interface IProCurdProvide {
473
+ columns: Ref<TColumns>;
474
+ getSignColumns: (signName: string) => TColumns;
475
+ getFormItemVNode: (column: TColumn, needRules: boolean | undefined) => VNode | null;
476
+ getItemVNode: (column: TColumn, value: any) => VNode | null;
477
+ elementMap: TElementMap;
478
+ formElementMap: TElementMap;
447
479
  rowKey: string;
448
480
  curdState: UnwrapNestedRefs<ICurdState>;
449
481
  formColumns: Ref<TColumns>;
@@ -526,6 +558,9 @@ declare const ProPageCurd: vue.DefineComponent<ProPageCurdProps, {}, {}, {}, {},
526
558
  declare const createCurdDesc: (Descriptions: any, DescriptionsItem: any) => any;
527
559
 
528
560
  declare const proCurdAddOrEditProps: () => {
561
+ signName: {
562
+ type: StringConstructor;
563
+ };
529
564
  operateBar: {
530
565
  type: BooleanConstructor;
531
566
  default: boolean;
@@ -711,7 +746,6 @@ declare const proSearchFormProps: () => {
711
746
  */
712
747
  model: {
713
748
  type: PropType<Record<string, any>>;
714
- required: boolean;
715
749
  };
716
750
  /**
717
751
  * 初始化触发 onFinish
@@ -857,6 +891,7 @@ interface IProFormListProvide {
857
891
  pathList: (string | number)[];
858
892
  }
859
893
  declare const useProFormList: () => IProFormListProvide;
894
+ declare const provideProFormList: (ctx: IProFormListProvide) => void;
860
895
  declare const proFormListProps: () => {
861
896
  rowKey: {
862
897
  type: StringConstructor;
@@ -926,4 +961,4 @@ declare const generateId: () => string;
926
961
  */
927
962
  declare const createExpose: (methods: string[], targetRef: Ref$1) => {};
928
963
 
929
- export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TData, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, findTargetInTree, findTargetListInTree, generateId, getColumnFormItemName, getColumnValueType, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProModule, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
964
+ export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, 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, TData, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, findTargetInTree, findTargetListInTree, generateId, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };