File tree 3 files changed +28
-2
lines changed 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @codingapi/ui-framework" ,
3
- "version" : " 0.0.24 " ,
3
+ "version" : " 0.0.25 " ,
4
4
"description" : " A UI Framework built with React and Typescript" ,
5
5
"keywords" : [
6
6
" ui" ,
Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+ import { FormItemProps } from "./types" ;
3
+
4
+ export class FormFactory {
5
+ private readonly items = new Map < string , React . Component < FormItemProps > > ;
6
+
7
+ private constructor ( ) {
8
+
9
+ }
10
+
11
+ private static instance = new FormFactory ( ) ;
12
+
13
+ public static getInstance ( ) {
14
+ return this . instance ;
15
+ }
16
+
17
+ public addItem ( type : string , item : React . Component < FormItemProps > ) : void {
18
+ this . items . set ( type , item ) ;
19
+ }
20
+
21
+ public getItem ( type : string ) : React . Component < FormItemProps > | undefined {
22
+ return this . items . get ( type ) ;
23
+ }
24
+
25
+ }
Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ export * from './antd';
3
3
export * from './instance' ;
4
4
export * from './listener' ;
5
5
export * from './utils' ;
6
- export * from './validate' ;
6
+ export * from './validate' ;
7
+ export * from './fatory' ;
You can’t perform that action at this time.
0 commit comments