File tree Expand file tree Collapse file tree 11 files changed +104
-45
lines changed
tdesign-miniprogram/packages/components/common
tdesign-react/packages/components Expand file tree Collapse file tree 11 files changed +104
-45
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ export interface Styles {
66
77export type ImageEvent = any ;
88
9- /**
10- * 通用全局类型
11- * */
129export type PlainObject = { [ key : string ] : any } ;
1310
1411export type OptionData = {
@@ -19,15 +16,18 @@ export type OptionData = {
1916export type TreeOptionData < T = string | number > = {
2017 children ?: Array < TreeOptionData < T > > | boolean ;
2118 /** option label content */
22- label ?: string | TNode ;
19+ label ?: string ;
2320 /** option search text */
2421 text ?: string ;
2522 /** option value */
2623 value ?: T ;
2724 /** option node content */
28- content ?: string | TNode ;
25+ content ?: string ;
2926} & PlainObject ;
3027
28+ /**
29+ * 通用全局类型
30+ * */
3131export type SizeEnum = 'small' | 'medium' | 'large' ;
3232
3333export type ShapeEnum = 'circle' | 'round' ;
Original file line number Diff line number Diff line change @@ -36,9 +36,6 @@ export interface UploadDisplayDragEvents {
3636
3737export type ImageEvent < T = any > = SyntheticEvent < T > ;
3838
39- /**
40- * 通用全局类型
41- * */
4239export type PlainObject = { [ key : string ] : any } ;
4340
4441export type OptionData = {
@@ -58,6 +55,9 @@ export type TreeOptionData<T = string | number> = {
5855 content ?: string | TNode ;
5956} & PlainObject ;
6057
58+ /**
59+ * 通用全局类型
60+ * */
6161export type SizeEnum = 'small' | 'medium' | 'large' ;
6262
6363export type ShapeEnum = 'circle' | 'round' ;
Original file line number Diff line number Diff line change @@ -41,9 +41,6 @@ export interface UploadDisplayDragEvents {
4141
4242export type ImageEvent = Event ;
4343
44- /**
45- * 通用全局类型
46- * */
4744export type PlainObject = { [ key : string ] : any } ;
4845
4946export type OptionData = {
@@ -63,6 +60,9 @@ export type TreeOptionData<T = string | number> = {
6360 content ?: string | TNode ;
6461} & PlainObject ;
6562
63+ /**
64+ * 通用全局类型
65+ * */
6666export type SizeEnum = 'small' | 'medium' | 'large' ;
6767
6868export type ShapeEnum = 'circle' | 'round' ;
Original file line number Diff line number Diff line change @@ -36,9 +36,6 @@ export interface UploadDisplayDragEvents {
3636
3737export type ImageEvent < T = any > = SyntheticEvent < T > ;
3838
39- /**
40- * 通用全局类型
41- * */
4239export type PlainObject = { [ key : string ] : any } ;
4340
4441export type OptionData = {
@@ -58,6 +55,9 @@ export type TreeOptionData<T = string | number> = {
5855 content ?: string | TNode ;
5956} & PlainObject ;
6057
58+ /**
59+ * 通用全局类型
60+ * */
6161export type SizeEnum = 'small' | 'medium' | 'large' ;
6262
6363export type ShapeEnum = 'circle' | 'round' ;
Original file line number Diff line number Diff line change @@ -34,9 +34,6 @@ export interface UploadDisplayDragEvents {
3434
3535export type ImageEvent = Event ;
3636
37- /**
38- * 通用全局类型
39- * */
4037export type PlainObject = { [ key : string ] : any } ;
4138
4239export type OptionData = {
@@ -56,6 +53,9 @@ export type TreeOptionData<T = string | number> = {
5653 content ?: string | TNode ;
5754} & PlainObject ;
5855
56+ /**
57+ * 通用全局类型
58+ * */
5959export type SizeEnum = 'small' | 'medium' | 'large' ;
6060
6161export type ShapeEnum = 'circle' | 'round' ;
Original file line number Diff line number Diff line change 22/**
33 * 通用全局类型
44 * */
5- export type PlainObject = { [key: string]: any } ;
6-
7- export type OptionData = {
8- label?: string;
9- value?: string | number;
10- } & PlainObject;
11-
12- export type TreeOptionData<T = string | number > = {
13- children?: Array< TreeOptionData< T>> | boolean;
14- /** option label content */
15- label?: string | TNode;
16- /** option search text */
17- text?: string;
18- /** option value */
19- value?: T;
20- /** option node content */
21- content?: string | TNode;
22- } & PlainObject;
23-
245export type SizeEnum = 'small' | 'medium' | 'large';
256
267export type ShapeEnum = 'circle' | 'round';
Original file line number Diff line number Diff line change @@ -18,20 +18,22 @@ function combineGlobals(framework) {
1818 // 通用全局变量
1919 const baseGlobalData = fs . readFileSync ( baseGlobalPath ) ;
2020 // 框架特有全局变量
21- const moreGlobalData = fs . readFileSync ( path . resolve ( __dirname , current . globalTplPath ) ) ;
21+ const moreGlobalData = fs . readFileSync (
22+ path . resolve ( __dirname , current . globalTplPath )
23+ ) ;
2224 const outputPath = path . resolve ( current . globalPath ) ;
2325 let data = moreGlobalData . toString ( ) + baseGlobalData . toString ( ) ;
2426 if ( [ 'React(PC)' , 'React(Mobile)' ] . includes ( framework ) ) {
2527 data = formatType ( data ) ;
2628 }
27- fs . writeFile (
28- outputPath ,
29- data ,
30- ( err ) => {
31- if ( err ) return console . error ( err ) ;
32- console . log ( chalk . green ( `globals: ${ outputPath } has been created successfully!` ) ) ;
33- } ,
34- ) ;
29+ const callback = ( err ) => {
30+ if ( err ) return console . error ( err ) ;
31+ // eslint-disable-next-line no-console
32+ console . log (
33+ chalk . green ( `globals: ${ outputPath } has been created successfully!` )
34+ ) ;
35+ } ;
36+ fs . writeFile ( outputPath , data , callback ) ;
3537}
3638
3739module . exports = combineGlobals ;
Original file line number Diff line number Diff line change @@ -5,3 +5,22 @@ export interface Styles {
55}
66
77export type ImageEvent = any;
8+
9+ export type PlainObject = { [key: string]: any } ;
10+
11+ export type OptionData = {
12+ label?: string;
13+ value?: string | number;
14+ } & PlainObject;
15+
16+ export type TreeOptionData<T = string | number > = {
17+ children?: Array< TreeOptionData< T>> | boolean;
18+ /** option label content */
19+ label?: string;
20+ /** option search text */
21+ text?: string;
22+ /** option value */
23+ value?: T;
24+ /** option node content */
25+ content?: string;
26+ } & PlainObject;
Original file line number Diff line number Diff line change @@ -35,3 +35,22 @@ export interface UploadDisplayDragEvents {
3535}
3636
3737export type ImageEvent<T = any > = SyntheticEvent<T >;
38+
39+ export type PlainObject = { [key: string]: any } ;
40+
41+ export type OptionData = {
42+ label?: string;
43+ value?: string | number;
44+ } & PlainObject;
45+
46+ export type TreeOptionData<T = string | number > = {
47+ children?: Array< TreeOptionData< T>> | boolean;
48+ /** option label content */
49+ label?: string | TNode;
50+ /** option search text */
51+ text?: string;
52+ /** option value */
53+ value?: T;
54+ /** option node content */
55+ content?: string | TNode;
56+ } & PlainObject;
Original file line number Diff line number Diff line change @@ -33,3 +33,22 @@ export interface UploadDisplayDragEvents {
3333}
3434
3535export type ImageEvent = Event;
36+
37+ export type PlainObject = { [key: string]: any } ;
38+
39+ export type OptionData = {
40+ label?: string;
41+ value?: string | number;
42+ } & PlainObject;
43+
44+ export type TreeOptionData<T = string | number > = {
45+ children?: Array< TreeOptionData< T>> | boolean;
46+ /** option label content */
47+ label?: string | TNode;
48+ /** option search text */
49+ text?: string;
50+ /** option value */
51+ value?: T;
52+ /** option node content */
53+ content?: string | TNode;
54+ } & PlainObject;
You can’t perform that action at this time.
0 commit comments