@lingxiteam/theme-utils 0.5.9 → 0.5.10

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/README.md CHANGED
@@ -1,142 +1,142 @@
1
- # @lingxiteam/theme-utils
2
-
3
- antd@4 theme class utils, css utils
4
-
5
- ```js
6
- pnpm i @lingxiteam/theme-utils
7
-
8
- import {} from '@lingxiteam/theme-utils';
9
- ```
10
-
11
- 新建场景描述:
12
-
13
- 1、通过编辑页面 form 得到,theme 的对象 如 { backgroundColor:'red',fontSize:'12px'} 2、根据模版 '.cc{ background-color: backgroundColor; font-size: fontSize;}' 解析 css 3、得到最终 css '.cc{ background-color:red; font-size:12px;bor:123}' 4、将最终 css 提交到服务端
14
-
15
- 编辑场景描述:
16
-
17
- 1、从服务端取得 css 2、根据模版将 css 中的对象取出 { backgroundColor:'red',fontSize:'12px'} 3、将对象赋值到编辑页面 form 4、重复新建场景
18
-
19
- 预览场景描述:
20
-
21
- 1、每次编辑都会实时的生成 css 2、通过 normalizeCSS(css,'#previewId') 将 css 作用到指定 id dom 下 ' #previewId { .cc{ background-color:red; font-size:12px; }}' 3、通过 insertRules('12312', css, document.getElementById('previewId')); 将 style 挂载到预览 dom 上 4、挂载的样式仅会对预览生效
22
-
23
- 使用场景描述:
24
-
25
- 1、通过 insertLink('12312', 'http://xxx.css',true); 在页面上加载所有的生成的 css,将会对所有的场景生效。
26
-
27
- ## stringifyCss
28
-
29
- 根据指定模版,将对象的值解析道模版中,生成最终的 css 字符串
30
-
31
- ```js
32
- const tpl = '.cc{ background-color: backgroundColor; font-size: fontSize;}';
33
- const a = { backgroundColor: 'red', fontSize: '12px' };
34
- const c = stringifyCss(tpl, a);
35
- console.log(c); // .cc{ background-color:red; font-size:12px;}
36
- ```
37
-
38
- ## parseCss
39
-
40
- 根据指定模版,将值从 css 字符串中解析成对象
41
-
42
- ```js
43
- const tpl = '.cc{ background-color: backgroundColor; font-size: fontSize;}';
44
- const a = '.cc{ background-color:red; font-size:12px;}';
45
- const c = parseCss(tpl, a);
46
- console.log(c); // { backgroundColor:'red',fontSize:'12px'}
47
- ```
48
-
49
- ## normalizeCSS
50
-
51
- 编译 css 且支持给 css 提供指定的选择器,如
52
-
53
- ```js
54
- const a = '.a{ .b{ font-size:12px; } }';
55
-
56
- const css = normalizeCSS(a);
57
-
58
- console.log(css);
59
-
60
- // output: '.a .b{font-size:12px;}'
61
-
62
- const css1 = normalizeCSS(a, '.cc');
63
- console.log(css1);
64
- // output: '.cc .a .b{font-size:12px;}'
65
- ```
66
-
67
- ## insertRules
68
-
69
- 将 css 挂载到页面上 `insertRules(id: string, rules: string,selector = document.head,);` 指定 id,会覆盖生产的 style 标签
70
-
71
- ```js
72
- insertRules('12312', css);
73
- ```
74
-
75
- ## insertLink
76
-
77
- 挂载指定的 css link `insertLink(id: string, href: string, insertBefore = false)`
78
-
79
- 可选择指定挂在在 body.firstElementChild 还是 head 中
80
-
81
- ```js
82
- insertLink('12312', 'http://xxx.css', true);
83
- ```
84
-
85
- ## 关于配置
86
-
87
- ```ts
88
- {
89
- type: '类型',
90
- // 所有的 css 有一个父级类名,理论上每一个都需要这个配置,是为了兼容第一版本的数据,因为组件太多,要全部重写一遍需要工作量,所以只修改了异常的组件
91
- hasPrefixClass: true,
92
- // 隐藏自定义类名按钮,当前只有pc端容器
93
- hiddenCustomCss: true,
94
- variable: {
95
- // 允许配置项
96
- fontSize: {
97
- // 对应编辑器的类型,px color select marginInput 四种
98
- type: 'px',
99
- label: '尺寸',
100
- groupsName: '文字' ,
101
- desc: '说明文字',
102
- // 继承其他组件属性时要标记不可编辑
103
- canEdit: false,
104
- // 编辑从什么地方支撑这个属性
105
- extendsKey: 'Form',
106
- // 表示这个字段跟随全局主题变量
107
- followTheme: '@font-size-base',
108
- // 是否隐藏,用于取全局变量,但是不允许用户修改的情况,如表单边框激活颜色
109
- hidden: false,
110
- },
111
- },
112
- groupsName: '分组名称',
113
- icon: '图标名称要和组件库对应上',
114
- title: '标题',
115
- defaultValue: [
116
- {
117
- // 上面定义的配置项的默认值
118
- fontSize: '14px',
119
- },
120
- ],
121
- // 是否跟随主题的开关,存在表示当前为跟随
122
- followThemes: {
123
- '@font-size-base': ['fontSize'],
124
- },
125
- // 根据上面的配置项和下面的模版解析得到最终挂在的 css
126
- tpl: '.hh { font-size: fontSize}',
127
- // 如果它被别人继承,并且自己需要自定义样式,如父级自定义样式为 .aa.list{ .item { } } 子级的自定义样式为 .aa.item { }
128
- itemCustomTpl: '',
129
- // 预览用数据,编辑器中推拽出来的 dsl ,可直接复制,View 下的 components,维护时如预览页面有变更,可直接替换这个数据,无需详细比对
130
- components: [],
131
- };
132
- ```
133
-
134
- ### 关于继承
135
-
136
- 因为继承在预览和自定义样式时需要先加载父级的样式,所以需要在工具中写明哪些组件需要先获取。
137
-
138
- 如: theme-utils/src/lx-mobile.ts#L63 和 theme-utils/src/lx.ts#L62
139
-
140
- ```ts
141
- const extend: any = {};
142
- ```
1
+ # @lingxiteam/theme-utils
2
+
3
+ antd@4 theme class utils, css utils
4
+
5
+ ```js
6
+ pnpm i @lingxiteam/theme-utils
7
+
8
+ import {} from '@lingxiteam/theme-utils';
9
+ ```
10
+
11
+ 新建场景描述:
12
+
13
+ 1、通过编辑页面 form 得到,theme 的对象 如 { backgroundColor:'red',fontSize:'12px'} 2、根据模版 '.cc{ background-color: backgroundColor; font-size: fontSize;}' 解析 css 3、得到最终 css '.cc{ background-color:red; font-size:12px;bor:123}' 4、将最终 css 提交到服务端
14
+
15
+ 编辑场景描述:
16
+
17
+ 1、从服务端取得 css 2、根据模版将 css 中的对象取出 { backgroundColor:'red',fontSize:'12px'} 3、将对象赋值到编辑页面 form 4、重复新建场景
18
+
19
+ 预览场景描述:
20
+
21
+ 1、每次编辑都会实时的生成 css 2、通过 normalizeCSS(css,'#previewId') 将 css 作用到指定 id dom 下 ' #previewId { .cc{ background-color:red; font-size:12px; }}' 3、通过 insertRules('12312', css, document.getElementById('previewId')); 将 style 挂载到预览 dom 上 4、挂载的样式仅会对预览生效
22
+
23
+ 使用场景描述:
24
+
25
+ 1、通过 insertLink('12312', 'http://xxx.css',true); 在页面上加载所有的生成的 css,将会对所有的场景生效。
26
+
27
+ ## stringifyCss
28
+
29
+ 根据指定模版,将对象的值解析道模版中,生成最终的 css 字符串
30
+
31
+ ```js
32
+ const tpl = '.cc{ background-color: backgroundColor; font-size: fontSize;}';
33
+ const a = { backgroundColor: 'red', fontSize: '12px' };
34
+ const c = stringifyCss(tpl, a);
35
+ console.log(c); // .cc{ background-color:red; font-size:12px;}
36
+ ```
37
+
38
+ ## parseCss
39
+
40
+ 根据指定模版,将值从 css 字符串中解析成对象
41
+
42
+ ```js
43
+ const tpl = '.cc{ background-color: backgroundColor; font-size: fontSize;}';
44
+ const a = '.cc{ background-color:red; font-size:12px;}';
45
+ const c = parseCss(tpl, a);
46
+ console.log(c); // { backgroundColor:'red',fontSize:'12px'}
47
+ ```
48
+
49
+ ## normalizeCSS
50
+
51
+ 编译 css 且支持给 css 提供指定的选择器,如
52
+
53
+ ```js
54
+ const a = '.a{ .b{ font-size:12px; } }';
55
+
56
+ const css = normalizeCSS(a);
57
+
58
+ console.log(css);
59
+
60
+ // output: '.a .b{font-size:12px;}'
61
+
62
+ const css1 = normalizeCSS(a, '.cc');
63
+ console.log(css1);
64
+ // output: '.cc .a .b{font-size:12px;}'
65
+ ```
66
+
67
+ ## insertRules
68
+
69
+ 将 css 挂载到页面上 `insertRules(id: string, rules: string,selector = document.head,);` 指定 id,会覆盖生产的 style 标签
70
+
71
+ ```js
72
+ insertRules('12312', css);
73
+ ```
74
+
75
+ ## insertLink
76
+
77
+ 挂载指定的 css link `insertLink(id: string, href: string, insertBefore = false)`
78
+
79
+ 可选择指定挂在在 body.firstElementChild 还是 head 中
80
+
81
+ ```js
82
+ insertLink('12312', 'http://xxx.css', true);
83
+ ```
84
+
85
+ ## 关于配置
86
+
87
+ ```ts
88
+ {
89
+ type: '类型',
90
+ // 所有的 css 有一个父级类名,理论上每一个都需要这个配置,是为了兼容第一版本的数据,因为组件太多,要全部重写一遍需要工作量,所以只修改了异常的组件
91
+ hasPrefixClass: true,
92
+ // 隐藏自定义类名按钮,当前只有pc端容器
93
+ hiddenCustomCss: true,
94
+ variable: {
95
+ // 允许配置项
96
+ fontSize: {
97
+ // 对应编辑器的类型,px color select marginInput 四种
98
+ type: 'px',
99
+ label: '尺寸',
100
+ groupsName: '文字' ,
101
+ desc: '说明文字',
102
+ // 继承其他组件属性时要标记不可编辑
103
+ canEdit: false,
104
+ // 编辑从什么地方支撑这个属性
105
+ extendsKey: 'Form',
106
+ // 表示这个字段跟随全局主题变量
107
+ followTheme: '@font-size-base',
108
+ // 是否隐藏,用于取全局变量,但是不允许用户修改的情况,如表单边框激活颜色
109
+ hidden: false,
110
+ },
111
+ },
112
+ groupsName: '分组名称',
113
+ icon: '图标名称要和组件库对应上',
114
+ title: '标题',
115
+ defaultValue: [
116
+ {
117
+ // 上面定义的配置项的默认值
118
+ fontSize: '14px',
119
+ },
120
+ ],
121
+ // 是否跟随主题的开关,存在表示当前为跟随
122
+ followThemes: {
123
+ '@font-size-base': ['fontSize'],
124
+ },
125
+ // 根据上面的配置项和下面的模版解析得到最终挂在的 css
126
+ tpl: '.hh { font-size: fontSize}',
127
+ // 如果它被别人继承,并且自己需要自定义样式,如父级自定义样式为 .aa.list{ .item { } } 子级的自定义样式为 .aa.item { }
128
+ itemCustomTpl: '',
129
+ // 预览用数据,编辑器中推拽出来的 dsl ,可直接复制,View 下的 components,维护时如预览页面有变更,可直接替换这个数据,无需详细比对
130
+ components: [],
131
+ };
132
+ ```
133
+
134
+ ### 关于继承
135
+
136
+ 因为继承在预览和自定义样式时需要先加载父级的样式,所以需要在工具中写明哪些组件需要先获取。
137
+
138
+ 如: theme-utils/src/lx-mobile.ts#L63 和 theme-utils/src/lx.ts#L62
139
+
140
+ ```ts
141
+ const extend: any = {};
142
+ ```
@@ -93,6 +93,7 @@ export declare const Container: {
93
93
  cardIconType: string;
94
94
  extendNum: number;
95
95
  title: string;
96
+ subTitle: string;
96
97
  bordered: boolean;
97
98
  size: string;
98
99
  hasHeader: boolean;
@@ -160,6 +161,7 @@ export declare const Container: {
160
161
  collapseType: string;
161
162
  extendNum?: undefined;
162
163
  title?: undefined;
164
+ subTitle?: undefined;
163
165
  hasHeader?: undefined;
164
166
  headerColor?: undefined;
165
167
  isFlexColumn?: undefined;
@@ -210,6 +212,7 @@ export declare const Container: {
210
212
  name: string;
211
213
  basicStatus: number;
212
214
  header: string;
215
+ subTitle: string;
213
216
  key: string;
214
217
  };
215
218
  style: {
@@ -277,6 +280,7 @@ export declare const Container: {
277
280
  rowKey: string;
278
281
  cardIconType?: undefined;
279
282
  title?: undefined;
283
+ subTitle?: undefined;
280
284
  hasHeader?: undefined;
281
285
  hasIcon?: undefined;
282
286
  headerColor?: undefined;
@@ -146,6 +146,7 @@ export var Container = {
146
146
  cardIconType: 'middle',
147
147
  extendNum: 3,
148
148
  title: '标题',
149
+ subTitle: '副标题',
149
150
  bordered: true,
150
151
  size: 'default',
151
152
  hasHeader: true,
@@ -214,6 +215,7 @@ export var Container = {
214
215
  name: '折叠子面板',
215
216
  basicStatus: 1,
216
217
  header: '标题1',
218
+ subTitle: '副标题1',
217
219
  key: '1'
218
220
  },
219
221
  style: {
@@ -243,6 +245,7 @@ export var Container = {
243
245
  name: '折叠子面板',
244
246
  basicStatus: 1,
245
247
  header: '标题2',
248
+ subTitle: '副标题2',
246
249
  key: '2'
247
250
  },
248
251
  style: {
@@ -0,0 +1,265 @@
1
+ export declare const Steps: {
2
+ type: string;
3
+ groupsName: string;
4
+ variable: {
5
+ backgroundColor: {
6
+ type: string;
7
+ label: string;
8
+ groupsName: string;
9
+ };
10
+ titleColor: {
11
+ type: string;
12
+ label: string;
13
+ groupsName: string;
14
+ followTheme: string;
15
+ };
16
+ fontSize: {
17
+ type: string;
18
+ label: string;
19
+ groupsName: string;
20
+ };
21
+ lineHeight: {
22
+ type: string;
23
+ label: string;
24
+ groupsName: string;
25
+ };
26
+ fontWeight: {
27
+ type: string;
28
+ label: string;
29
+ groupsName: string;
30
+ options: {
31
+ title: string;
32
+ value: string;
33
+ }[];
34
+ };
35
+ subTextColor: {
36
+ type: string;
37
+ label: string;
38
+ groupsName: string;
39
+ followTheme: string;
40
+ };
41
+ subFontSize: {
42
+ type: string;
43
+ label: string;
44
+ groupsName: string;
45
+ };
46
+ subLineHeight: {
47
+ type: string;
48
+ label: string;
49
+ groupsName: string;
50
+ };
51
+ subFontWeight: {
52
+ type: string;
53
+ label: string;
54
+ groupsName: string;
55
+ options: {
56
+ title: string;
57
+ value: string;
58
+ }[];
59
+ };
60
+ descriptionTextColor: {
61
+ type: string;
62
+ label: string;
63
+ groupsName: string;
64
+ followTheme: string;
65
+ };
66
+ descriptionFontSize: {
67
+ type: string;
68
+ label: string;
69
+ groupsName: string;
70
+ };
71
+ descriptionLineHeight: {
72
+ type: string;
73
+ label: string;
74
+ groupsName: string;
75
+ };
76
+ descriptionFontWeight: {
77
+ type: string;
78
+ label: string;
79
+ groupsName: string;
80
+ options: {
81
+ title: string;
82
+ value: string;
83
+ }[];
84
+ };
85
+ processIconColor: {
86
+ type: string;
87
+ label: string;
88
+ groupsName: string;
89
+ followTheme: string;
90
+ };
91
+ finishIconColor: {
92
+ type: string;
93
+ label: string;
94
+ groupsName: string;
95
+ followTheme: string;
96
+ };
97
+ waitIconColor: {
98
+ type: string;
99
+ label: string;
100
+ groupsName: string;
101
+ followTheme: string;
102
+ };
103
+ errorIconColor: {
104
+ type: string;
105
+ label: string;
106
+ groupsName: string;
107
+ followTheme: string;
108
+ };
109
+ lineColor: {
110
+ type: string;
111
+ label: string;
112
+ groupsName: string;
113
+ followTheme: string;
114
+ };
115
+ };
116
+ icon: string;
117
+ title: string;
118
+ defaultValue: {
119
+ backgroundColor: string;
120
+ fontSize: string;
121
+ lineHeight: string;
122
+ fontWeight: string;
123
+ subFontSize: string;
124
+ subLineHeight: string;
125
+ subFontWeight: string;
126
+ descriptionFontSize: string;
127
+ descriptionLineHeight: string;
128
+ descriptionFontWeight: string;
129
+ }[];
130
+ followThemes: {
131
+ '@primary-color': string[];
132
+ '@text-color-secondary': string[];
133
+ '@border-color-base': string[];
134
+ '@error-color': string[];
135
+ '@heading-color': string[];
136
+ };
137
+ tpl: string;
138
+ components: ({
139
+ id: string;
140
+ label: string;
141
+ compName: string;
142
+ type: string;
143
+ compType: number;
144
+ props: {
145
+ name: string;
146
+ basicStatus: number;
147
+ labelPlacement: string;
148
+ stepStyle: string;
149
+ type: string;
150
+ direction: string;
151
+ size: string;
152
+ iconSetting: {
153
+ label: string;
154
+ value: string;
155
+ }[];
156
+ stepsOptions: {
157
+ id: number;
158
+ title: string;
159
+ status: string;
160
+ subTitle: string;
161
+ description: string;
162
+ }[];
163
+ alias: {
164
+ id: string;
165
+ description: string;
166
+ disabled: string;
167
+ status: string;
168
+ subTitle: string;
169
+ title: string;
170
+ icon: string;
171
+ };
172
+ };
173
+ style: {
174
+ margin?: undefined;
175
+ };
176
+ platform: string;
177
+ setEvents: never[];
178
+ components: never[];
179
+ path: string[];
180
+ } | {
181
+ id: string;
182
+ label: string;
183
+ compName: string;
184
+ type: string;
185
+ compType: number;
186
+ props: {
187
+ name: string;
188
+ basicStatus: number;
189
+ labelPlacement: string;
190
+ stepStyle: string;
191
+ type: string;
192
+ direction: string;
193
+ size: string;
194
+ iconSetting: {
195
+ label: string;
196
+ value: string;
197
+ }[];
198
+ stepsOptions: {
199
+ id: number;
200
+ title: string;
201
+ status: string;
202
+ subTitle: string;
203
+ description: string;
204
+ }[];
205
+ alias: {
206
+ id: string;
207
+ description: string;
208
+ disabled: string;
209
+ status: string;
210
+ subTitle: string;
211
+ title: string;
212
+ icon: string;
213
+ };
214
+ };
215
+ style: {
216
+ margin: string;
217
+ };
218
+ platform: string;
219
+ setEvents: never[];
220
+ components: never[];
221
+ path: string[];
222
+ } | {
223
+ id: string;
224
+ label: string;
225
+ compName: string;
226
+ type: string;
227
+ compType: number;
228
+ props: {
229
+ name: string;
230
+ basicStatus: number;
231
+ labelPlacement: string;
232
+ stepStyle: string;
233
+ type: string;
234
+ direction: string;
235
+ size: string;
236
+ iconSetting: {
237
+ label: string;
238
+ value: string;
239
+ }[];
240
+ stepsOptions: {
241
+ id: number;
242
+ title: string;
243
+ status: string;
244
+ subTitle: string;
245
+ description: string;
246
+ }[];
247
+ alias: {
248
+ id: string;
249
+ description: string;
250
+ disabled: string;
251
+ status: string;
252
+ subTitle: string;
253
+ title: string;
254
+ icon: string;
255
+ };
256
+ };
257
+ style: {
258
+ margin: string;
259
+ };
260
+ platform: string;
261
+ setEvents: never[];
262
+ components: never[];
263
+ path?: undefined;
264
+ })[];
265
+ };
@@ -0,0 +1,535 @@
1
+ export var Steps = {
2
+ type: 'Steps',
3
+ groupsName: '导航',
4
+ variable: {
5
+ backgroundColor: {
6
+ type: 'color',
7
+ label: '背景颜色',
8
+ groupsName: '背景'
9
+ },
10
+ titleColor: {
11
+ type: 'color',
12
+ label: '标题颜色',
13
+ groupsName: '标题',
14
+ followTheme: '@heading-color'
15
+ },
16
+ fontSize: {
17
+ type: 'px',
18
+ label: '标题尺寸',
19
+ groupsName: '标题'
20
+ },
21
+ lineHeight: {
22
+ type: 'px',
23
+ label: '标题行高',
24
+ groupsName: '标题'
25
+ },
26
+ fontWeight: {
27
+ type: 'select',
28
+ label: '标题字重',
29
+ groupsName: '标题',
30
+ options: [{
31
+ title: '100',
32
+ value: '100'
33
+ }, {
34
+ title: '200',
35
+ value: '200'
36
+ }, {
37
+ title: '300',
38
+ value: '300'
39
+ }, {
40
+ title: '400',
41
+ value: '400'
42
+ }, {
43
+ title: '500',
44
+ value: '500'
45
+ }, {
46
+ title: '600',
47
+ value: '600'
48
+ }, {
49
+ title: '700',
50
+ value: '700'
51
+ }]
52
+ },
53
+ subTextColor: {
54
+ type: 'color',
55
+ label: '副标题颜色',
56
+ groupsName: '副标题',
57
+ followTheme: '@text-color-secondary'
58
+ },
59
+ subFontSize: {
60
+ type: 'px',
61
+ label: '副标题尺寸',
62
+ groupsName: '副标题'
63
+ },
64
+ subLineHeight: {
65
+ type: 'px',
66
+ label: '副标题行高',
67
+ groupsName: '副标题'
68
+ },
69
+ subFontWeight: {
70
+ type: 'select',
71
+ label: '副标题字重',
72
+ groupsName: '副标题',
73
+ options: [{
74
+ title: '100',
75
+ value: '100'
76
+ }, {
77
+ title: '200',
78
+ value: '200'
79
+ }, {
80
+ title: '300',
81
+ value: '300'
82
+ }, {
83
+ title: '400',
84
+ value: '400'
85
+ }, {
86
+ title: '500',
87
+ value: '500'
88
+ }, {
89
+ title: '600',
90
+ value: '600'
91
+ }, {
92
+ title: '700',
93
+ value: '700'
94
+ }]
95
+ },
96
+ descriptionTextColor: {
97
+ type: 'color',
98
+ label: '内容颜色',
99
+ groupsName: '描述',
100
+ followTheme: '@text-color-secondary'
101
+ },
102
+ descriptionFontSize: {
103
+ type: 'px',
104
+ label: '内容尺寸',
105
+ groupsName: '描述'
106
+ },
107
+ descriptionLineHeight: {
108
+ type: 'px',
109
+ label: '内容行高',
110
+ groupsName: '描述'
111
+ },
112
+ descriptionFontWeight: {
113
+ type: 'select',
114
+ label: '内容字重',
115
+ groupsName: '描述',
116
+ options: [{
117
+ title: '100',
118
+ value: '100'
119
+ }, {
120
+ title: '200',
121
+ value: '200'
122
+ }, {
123
+ title: '300',
124
+ value: '300'
125
+ }, {
126
+ title: '400',
127
+ value: '400'
128
+ }, {
129
+ title: '500',
130
+ value: '500'
131
+ }, {
132
+ title: '600',
133
+ value: '600'
134
+ }, {
135
+ title: '700',
136
+ value: '700'
137
+ }]
138
+ },
139
+ processIconColor: {
140
+ type: 'color',
141
+ label: '进行中',
142
+ groupsName: '步骤符号',
143
+ followTheme: '@primary-color'
144
+ },
145
+ finishIconColor: {
146
+ type: 'color',
147
+ label: '完成',
148
+ groupsName: '步骤符号',
149
+ followTheme: '@primary-color'
150
+ },
151
+ waitIconColor: {
152
+ type: 'color',
153
+ label: '等待',
154
+ groupsName: '步骤符号',
155
+ followTheme: '@text-color-secondary'
156
+ },
157
+ errorIconColor: {
158
+ type: 'color',
159
+ label: '错误',
160
+ groupsName: '步骤符号',
161
+ followTheme: '@error-color'
162
+ },
163
+ lineColor: {
164
+ type: 'color',
165
+ label: '连接线颜色',
166
+ groupsName: '其他',
167
+ followTheme: '@border-color-base'
168
+ }
169
+ },
170
+ icon: 'icon-ico-comp-steps',
171
+ title: '步骤条',
172
+ defaultValue: [{
173
+ backgroundColor: '#ffffff',
174
+ fontSize: '16px',
175
+ lineHeight: '24px',
176
+ fontWeight: '600',
177
+ subFontSize: '14px',
178
+ subLineHeight: '22px',
179
+ subFontWeight: '400',
180
+ descriptionFontSize: '12px',
181
+ descriptionLineHeight: '16px',
182
+ descriptionFontWeight: '400'
183
+ }],
184
+ followThemes: {
185
+ '@primary-color': ['processIconColor', 'finishIconColor'],
186
+ '@text-color-secondary': ['subTextColor', 'descriptionTextColor', 'waitIconColor'],
187
+ '@border-color-base': ['lineColor'],
188
+ '@error-color': ['errorIconColor'],
189
+ '@heading-color': ['titleColor']
190
+ },
191
+ tpl: "\n .pcfactory-steps {\n background-color: backgroundColor;\n }\n\n .pcfactory-steps-item-title {\n color: titleColor;\n line-height: lineHeight;\n font-size: fontSize;\n font-weight: fontWeight;\n }\n \n .pcfactory-steps-item-finish > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-title,\n .pcfactory-steps-item-process > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-title,\n .pcfactory-steps-item-wait > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-title {\n color: titleColor;\n }\n \n .pcfactory-steps-item-subtitle {\n color: subTextColor;\n line-height: subLineHeight;\n font-size: subFontSize;\n font-weight: subFontWeight;\n }\n\n .pcfactory-steps-item-description {\n color: descriptionTextColor;\n line-height: descriptionLineHeight;\n font-size: descriptionFontSize;\n font-weight: descriptionFontWeight;\n }\n .pcfactory-steps-item-finish > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-description,\n .pcfactory-steps-item-process > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-description,\n .pcfactory-steps-item-wait > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-description {\n color: descriptionTextColor;\n }\n\n\n .ued-step-wrap-finish {\n color: finishIconColor;\n border-color: finishIconColor;\n }\n .ued-step-wrap-dot-finish {\n background-color: finishIconColor;\n }\n .pcfactory-steps-item-finish .pcfactory-steps-item-icon > .pcfactory-steps-icon {\n color: finishIconColor;\n }\n .pcfactory-steps-item-finish > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-title::after {\n background-color: finishIconColor;\n }\n .pcfactory-steps-item-finish > .pcfactory-steps-item-container > .pcfactory-steps-item-tail::after {\n background-color: finishIconColor;\n }\n \n .ued-step-wrap-process {\n border-color: processIconColor;\n background: processIconColor;\n }\n .ued-step-wrap-dot-process {\n background-color: processIconColor;\n }\n .pcfactory-steps-item-custom.pcfactory-steps-item-process .pcfactory-steps-item-icon > .pcfactory-steps-icon {\n color: processIconColor;\n }\n .pcfactory-steps-navigation .pcfactory-steps-item::before {\n background-color: processIconColor;\n }\n\n .ued-step-wrap-wait {\n color: waitIconColor;\n border-color: waitIconColor;\n }\n .ued-step-wrap-dot-wait {\n background-color: waitIconColor;\n }\n .pcfactory-steps-item-wait .pcfactory-steps-item-icon > .pcfactory-steps-icon {\n color: waitIconColor;\n }\n\n .ued-step-wrap-error {\n color: errorIconColor;\n border-color: errorIconColor;\n }\n .ued-step-wrap-dot-error {\n background-color: errorIconColor;\n }\n .pcfactory-steps-item-error .pcfactory-steps-item-icon > .pcfactory-steps-icon {\n color: errorIconColor;\n }\n .pcfactory-steps-item-error > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-title {\n color: errorIconColor;\n }\n .pcfactory-steps-item-error > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-description {\n color: errorIconColor;\n } \n\n .pcfactory-steps-item-process > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-title::after,\n .pcfactory-steps-item-wait > .pcfactory-steps-item-container > .pcfactory-steps-item-content > .pcfactory-steps-item-title::after {\n background-color: lineColor;\n }\n .pcfactory-steps-item-process > .pcfactory-steps-item-container > .pcfactory-steps-item-tail::after,\n .pcfactory-steps-item-wait > .pcfactory-steps-item-container > .pcfactory-steps-item-tail::after {\n background-color: lineColor;\n }\n .pcfactory-steps-navigation .pcfactory-steps-item::after {\n border-color: lineColor;\n }\n \n ",
192
+ components: [{
193
+ id: 'Steps_2037204',
194
+ label: '步骤条',
195
+ compName: 'Steps',
196
+ type: 'Steps',
197
+ compType: 5,
198
+ props: {
199
+ name: '步骤条',
200
+ basicStatus: 1,
201
+ labelPlacement: 'horizontal',
202
+ stepStyle: 'number',
203
+ type: 'default',
204
+ direction: 'horizontal',
205
+ size: 'default',
206
+ iconSetting: [{
207
+ label: '等待状态',
208
+ value: 'wait'
209
+ }, {
210
+ label: '处理中状态',
211
+ value: 'process'
212
+ }, {
213
+ label: '完成状态',
214
+ value: 'finish'
215
+ }, {
216
+ label: '错误状态',
217
+ value: 'error'
218
+ }],
219
+ stepsOptions: [{
220
+ id: 1,
221
+ title: '1',
222
+ status: 'finish',
223
+ subTitle: 'first',
224
+ description: '第一步'
225
+ }, {
226
+ id: 2,
227
+ title: '2',
228
+ status: 'process',
229
+ subTitle: 'second',
230
+ description: '第二步'
231
+ }, {
232
+ id: 3,
233
+ title: '3',
234
+ status: 'wait',
235
+ subTitle: 'third',
236
+ description: '第三步'
237
+ }, {
238
+ id: 4,
239
+ title: '4',
240
+ status: 'error',
241
+ subTitle: 'fourth',
242
+ description: '第四步'
243
+ }],
244
+ alias: {
245
+ id: 'id',
246
+ description: 'description',
247
+ disabled: 'disabled',
248
+ status: 'status',
249
+ subTitle: 'subTitle',
250
+ title: 'title',
251
+ icon: 'icon'
252
+ }
253
+ },
254
+ style: {},
255
+ platform: 'pc',
256
+ setEvents: [],
257
+ components: [],
258
+ path: ['998509', 'View_998509_1']
259
+ }, {
260
+ id: 'Steps_2097604',
261
+ label: '步骤条',
262
+ compName: 'Steps',
263
+ type: 'Steps',
264
+ compType: 5,
265
+ props: {
266
+ name: '步骤条',
267
+ basicStatus: 1,
268
+ labelPlacement: 'horizontal',
269
+ stepStyle: 'icon',
270
+ type: 'default',
271
+ direction: 'horizontal',
272
+ size: 'default',
273
+ iconSetting: [{
274
+ label: '等待状态',
275
+ value: 'wait'
276
+ }, {
277
+ label: '处理中状态',
278
+ value: 'process'
279
+ }, {
280
+ label: '完成状态',
281
+ value: 'finish'
282
+ }, {
283
+ label: '错误状态',
284
+ value: 'error'
285
+ }],
286
+ stepsOptions: [{
287
+ id: 1,
288
+ title: '1',
289
+ status: 'finish',
290
+ subTitle: 'first',
291
+ description: '第一步'
292
+ }, {
293
+ id: 2,
294
+ title: '2',
295
+ status: 'process',
296
+ subTitle: 'second',
297
+ description: '第二步'
298
+ }, {
299
+ id: 3,
300
+ title: '3',
301
+ status: 'wait',
302
+ subTitle: 'third',
303
+ description: '第三步'
304
+ }, {
305
+ id: 4,
306
+ title: '4',
307
+ status: 'error',
308
+ subTitle: 'fourth',
309
+ description: '第四步'
310
+ }],
311
+ alias: {
312
+ id: 'id',
313
+ description: 'description',
314
+ disabled: 'disabled',
315
+ status: 'status',
316
+ subTitle: 'subTitle',
317
+ title: 'title',
318
+ icon: 'icon'
319
+ }
320
+ },
321
+ style: {
322
+ margin: '20px 0 0 0'
323
+ },
324
+ platform: 'pc',
325
+ setEvents: [],
326
+ components: [],
327
+ path: ['998509', 'View_998509_1']
328
+ }, {
329
+ id: 'Steps_3098604',
330
+ label: '步骤条',
331
+ compName: 'Steps',
332
+ type: 'Steps',
333
+ compType: 5,
334
+ props: {
335
+ name: '步骤条',
336
+ basicStatus: 1,
337
+ labelPlacement: 'horizontal',
338
+ stepStyle: 'dot',
339
+ type: 'default',
340
+ direction: 'horizontal',
341
+ size: 'default',
342
+ iconSetting: [{
343
+ label: '等待状态',
344
+ value: 'wait'
345
+ }, {
346
+ label: '处理中状态',
347
+ value: 'process'
348
+ }, {
349
+ label: '完成状态',
350
+ value: 'finish'
351
+ }, {
352
+ label: '错误状态',
353
+ value: 'error'
354
+ }],
355
+ stepsOptions: [{
356
+ id: 1,
357
+ title: '1',
358
+ status: 'finish',
359
+ subTitle: 'first',
360
+ description: '第一步'
361
+ }, {
362
+ id: 2,
363
+ title: '2',
364
+ status: 'process',
365
+ subTitle: 'second',
366
+ description: '第二步'
367
+ }, {
368
+ id: 3,
369
+ title: '3',
370
+ status: 'wait',
371
+ subTitle: 'third',
372
+ description: '第三步'
373
+ }, {
374
+ id: 4,
375
+ title: '4',
376
+ status: 'error',
377
+ subTitle: 'fourth',
378
+ description: '第四步'
379
+ }],
380
+ alias: {
381
+ id: 'id',
382
+ description: 'description',
383
+ disabled: 'disabled',
384
+ status: 'status',
385
+ subTitle: 'subTitle',
386
+ title: 'title',
387
+ icon: 'icon'
388
+ }
389
+ },
390
+ style: {
391
+ margin: '20px 0 0 0'
392
+ },
393
+ platform: 'pc',
394
+ setEvents: [],
395
+ components: [],
396
+ path: ['998509', 'View_998509_1']
397
+ }, {
398
+ id: 'Steps_862902',
399
+ label: '步骤条',
400
+ compName: 'Steps',
401
+ type: 'Steps',
402
+ compType: 5,
403
+ props: {
404
+ name: '步骤条',
405
+ basicStatus: 1,
406
+ labelPlacement: 'horizontal',
407
+ stepStyle: 'number',
408
+ type: 'navigation',
409
+ direction: 'horizontal',
410
+ size: 'default',
411
+ iconSetting: [{
412
+ label: '等待状态',
413
+ value: 'wait'
414
+ }, {
415
+ label: '处理中状态',
416
+ value: 'process'
417
+ }, {
418
+ label: '完成状态',
419
+ value: 'finish'
420
+ }, {
421
+ label: '错误状态',
422
+ value: 'error'
423
+ }],
424
+ stepsOptions: [{
425
+ id: 1,
426
+ title: '1',
427
+ status: 'finish',
428
+ subTitle: 'first',
429
+ description: '第一步'
430
+ }, {
431
+ id: 2,
432
+ title: '2',
433
+ status: 'process',
434
+ subTitle: 'second',
435
+ description: '第二步'
436
+ }, {
437
+ id: 3,
438
+ title: '3',
439
+ status: 'wait',
440
+ subTitle: 'third',
441
+ description: '第三步'
442
+ }, {
443
+ id: 4,
444
+ title: '4',
445
+ status: 'error',
446
+ subTitle: 'fourth',
447
+ description: '第四步'
448
+ }],
449
+ alias: {
450
+ id: 'id',
451
+ description: 'description',
452
+ disabled: 'disabled',
453
+ status: 'status',
454
+ subTitle: 'subTitle',
455
+ title: 'title',
456
+ icon: 'icon'
457
+ }
458
+ },
459
+ style: {
460
+ margin: '20px 0 0 0'
461
+ },
462
+ platform: 'pc',
463
+ setEvents: [],
464
+ components: []
465
+ }, {
466
+ id: 'Steps_1137204',
467
+ label: '步骤条',
468
+ compName: 'Steps',
469
+ type: 'Steps',
470
+ compType: 5,
471
+ props: {
472
+ name: '步骤条',
473
+ basicStatus: 1,
474
+ labelPlacement: 'horizontal',
475
+ stepStyle: 'number',
476
+ type: 'default',
477
+ direction: 'vertical',
478
+ size: 'default',
479
+ iconSetting: [{
480
+ label: '等待状态',
481
+ value: 'wait'
482
+ }, {
483
+ label: '处理中状态',
484
+ value: 'process'
485
+ }, {
486
+ label: '完成状态',
487
+ value: 'finish'
488
+ }, {
489
+ label: '错误状态',
490
+ value: 'error'
491
+ }],
492
+ stepsOptions: [{
493
+ id: 1,
494
+ title: '1',
495
+ status: 'finish',
496
+ subTitle: 'first',
497
+ description: '第一步'
498
+ }, {
499
+ id: 2,
500
+ title: '2',
501
+ status: 'process',
502
+ subTitle: 'second',
503
+ description: '第二步'
504
+ }, {
505
+ id: 3,
506
+ title: '3',
507
+ status: 'wait',
508
+ subTitle: 'third',
509
+ description: '第三步'
510
+ }, {
511
+ id: 4,
512
+ title: '4',
513
+ status: 'error',
514
+ subTitle: 'fourth',
515
+ description: '第四步'
516
+ }],
517
+ alias: {
518
+ id: 'id',
519
+ description: 'description',
520
+ disabled: 'disabled',
521
+ status: 'status',
522
+ subTitle: 'subTitle',
523
+ title: 'title',
524
+ icon: 'icon'
525
+ }
526
+ },
527
+ style: {
528
+ margin: '20px 0 0 0'
529
+ },
530
+ platform: 'pc',
531
+ setEvents: [],
532
+ components: [],
533
+ path: ['998509', 'View_998509_1']
534
+ }]
535
+ };
package/dist/lx.js CHANGED
@@ -35,6 +35,7 @@ import { Table } from "./config/Table";
35
35
  import { Tag } from "./config/Tag";
36
36
  import { Tree } from "./config/Tree";
37
37
  import { Description } from "./config/Description";
38
+ import { Steps } from "./config/Steps";
38
39
  export var THEME_KEYS_TITLE = {
39
40
  '@primary-color': '主题色',
40
41
  '@font-size-base': '主字号',
@@ -78,7 +79,8 @@ export var ASSETS_CSS_TPL = {
78
79
  Table: Table,
79
80
  Tag: Tag,
80
81
  Tree: Tree,
81
- Description: Description
82
+ Description: Description,
83
+ Steps: Steps
82
84
  };
83
85
  export var pcExtend = {
84
86
  Input: 'Form',
package/dist/utils.js CHANGED
@@ -4,10 +4,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- /**
8
- * 根据 groupsName 将对象分成数组
9
- * @param obj
10
- * @returns
7
+ /**
8
+ * 根据 groupsName 将对象分成数组
9
+ * @param obj
10
+ * @returns
11
11
  */
12
12
  export function objToListByGroupsName(obj) {
13
13
  var groups = {};
@@ -34,10 +34,10 @@ export function objToListByGroupsName(obj) {
34
34
  return result;
35
35
  }
36
36
 
37
- /**
38
- * (内部方法) 根据 groupsName 将对象分成数组
39
- * @param obj
40
- * @returns
37
+ /**
38
+ * (内部方法) 根据 groupsName 将对象分成数组
39
+ * @param obj
40
+ * @returns
41
41
  */
42
42
  export function __objToListByGroupsName(obj) {
43
43
  var groups = {};
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "@lingxiteam/theme-utils",
3
- "version": "0.5.9",
4
- "description": "",
5
- "keywords": [],
6
- "license": "MIT",
7
- "author": "",
8
- "main": "dist/index.js",
9
- "types": "dist/index.d.ts",
10
- "files": [
11
- "dist"
12
- ],
13
- "scripts": {
14
- "build": "father build",
15
- "dev": "father dev",
16
- "format": "prettier --write .",
17
- "g": "esno scripts/generateConfig",
18
- "gp": "esno scripts/generatePage",
19
- "test": "esno a.ts"
20
- },
21
- "dependencies": {
22
- "stylis": "^4.3.0"
23
- },
24
- "devDependencies": {
25
- "@types/stylis": "^4.2.0",
26
- "esno": "^0.17.0",
27
- "father": "^4.3.0",
28
- "prettier": "^2.6.2",
29
- "prettier-plugin-organize-imports": "^2.3.4",
30
- "prettier-plugin-packagejson": "^2.2.18"
31
- },
32
- "peerDependencies": {
33
- "antd": "4.18.8"
34
- },
35
- "publishConfig": {
36
- "access": "public"
37
- }
38
- }
1
+ {
2
+ "name": "@lingxiteam/theme-utils",
3
+ "version": "0.5.10",
4
+ "description": "",
5
+ "keywords": [],
6
+ "license": "MIT",
7
+ "author": "",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "build": "father build",
15
+ "dev": "father dev",
16
+ "format": "prettier --write .",
17
+ "g": "esno scripts/generateConfig",
18
+ "gp": "esno scripts/generatePage",
19
+ "test": "esno a.ts"
20
+ },
21
+ "dependencies": {
22
+ "stylis": "^4.3.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/stylis": "^4.2.0",
26
+ "esno": "^0.17.0",
27
+ "father": "^4.3.0",
28
+ "prettier": "^2.6.2",
29
+ "prettier-plugin-organize-imports": "^2.3.4",
30
+ "prettier-plugin-packagejson": "^2.2.18"
31
+ },
32
+ "peerDependencies": {
33
+ "antd": "4.18.8"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ }
38
+ }