@lingxiteam/theme-utils 0.1.6 → 0.1.8

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,11 +1,11 @@
1
- # theme-utils
1
+ # @lingxiteam/theme-utils
2
2
 
3
3
  antd@4 theme class utils, css utils
4
4
 
5
5
  ```js
6
- pnpm i theme-utils
6
+ pnpm i @lingxiteam/theme-utils
7
7
 
8
- import {} from 'theme-utils';
8
+ import {} from '@lingxiteam/theme-utils';
9
9
  ```
10
10
 
11
11
  新建场景描述:
@@ -81,3 +81,48 @@ insertRules('12312', css);
81
81
  ```js
82
82
  insertLink('12312', 'http://xxx.css', true);
83
83
  ```
84
+
85
+ ## 关于配置
86
+
87
+ ```ts
88
+ {
89
+ type: '类型',
90
+ variable: {
91
+ // 允许配置项
92
+ fontSize: {
93
+ // 对应编辑器的类型,px color select marginInput 四种
94
+ type: 'px',
95
+ label: '尺寸',
96
+ groupsName: '文字' ,
97
+ desc: '说明文字',
98
+ // 继承其他组件属性时要标记不可编辑
99
+ canEdit: false,
100
+ // 编辑从什么地方支撑这个属性
101
+ extendsKey: 'Form',
102
+ },
103
+ },
104
+ groupsName: '分组名称',
105
+ icon: '图标名称要和组件库对应上',
106
+ title: '标题',
107
+ defaultValue: [
108
+ {
109
+ // 上面定义的配置项的默认值
110
+ fontSize: '14px',
111
+ },
112
+ ],
113
+ // 根据上面的配置项和下面的模版解析得到最终挂在的 css
114
+ tpl: '.hh { font-size: fontSize}',
115
+ // 预览用数据,编辑器中推拽出来的 dsl ,可直接复制,View 下的 components,维护时如预览页面有变更,可直接替换这个数据,无需详细比对
116
+ components: [],
117
+ };
118
+ ```
119
+
120
+ ### 关于继承
121
+
122
+ 因为继承在预览和自定义样式时需要先加载父级的样式,所以需要在工具中写明哪些组件需要先获取。
123
+
124
+ 如: theme-utils/src/lx-mobile.ts#L63 和 theme-utils/src/lx.ts#L62
125
+
126
+ ```ts
127
+ const extend: any = { }
128
+ ```
@@ -15,6 +15,7 @@ export declare const Button: {
15
15
  type: string;
16
16
  label: string;
17
17
  groupsName: string;
18
+ desc: string;
18
19
  };
19
20
  backgroundColor: {
20
21
  type: string;
@@ -14,7 +14,8 @@ export var Button = {
14
14
  fontSize: {
15
15
  type: 'px',
16
16
  label: '文本尺寸',
17
- groupsName: '文字'
17
+ groupsName: '文字',
18
+ desc: '按钮高度不会随着文字大小变化,因为按钮有4种大小规格'
18
19
  },
19
20
  backgroundColor: {
20
21
  type: 'color',
@@ -61,6 +61,12 @@ export declare const Cascader: {
61
61
  type: string;
62
62
  label: string;
63
63
  groupsName: string;
64
+ desc: string;
65
+ };
66
+ iconTop: {
67
+ type: string;
68
+ label: string;
69
+ groupsName: string;
64
70
  };
65
71
  iconColor: {
66
72
  type: string;
@@ -73,6 +79,7 @@ export declare const Cascader: {
73
79
  title: string;
74
80
  defaultValue: {
75
81
  iconFontSize: string;
82
+ iconTop: string;
76
83
  iconColor: string;
77
84
  }[];
78
85
  tpl: string;
@@ -60,6 +60,12 @@ export var Cascader = {
60
60
  iconFontSize: {
61
61
  type: 'px',
62
62
  label: '下拉图标尺寸',
63
+ groupsName: '文字',
64
+ desc: '请根据实际【文本尺寸】调整,不宜与【文本尺寸】大小差异过大'
65
+ },
66
+ iconTop: {
67
+ type: 'px',
68
+ label: '下拉图标距离顶部',
63
69
  groupsName: '文字'
64
70
  },
65
71
  iconColor: {
@@ -73,9 +79,10 @@ export var Cascader = {
73
79
  title: '级联选择',
74
80
  defaultValue: [{
75
81
  iconFontSize: '12px',
82
+ iconTop: '16px',
76
83
  iconColor: 'rgba(28,36,46,.25)'
77
84
  }],
78
- tpl: ".ued-cascader-wrap .pcfactory-select-arrow{\n color: iconColor;\n width: iconFontSize;\n height: iconFontSize;\n .anticon>svg{\n width: iconFontSize;\n height: iconFontSize;\n }\n }\n .ued-cascader-wrap .pcfactory-select-clear{\n color: iconColor;\n width: iconFontSize;\n height: iconFontSize;\n .anticon>svg{\n width: iconFontSize;\n height: iconFontSize;\n }\n }",
85
+ tpl: ".ued-cascader-wrap .pcfactory-select-arrow{\n color: iconColor;\n width: iconFontSize;\n height: iconFontSize;\n top: iconTop;\n .anticon>svg{\n width: iconFontSize;\n height: iconFontSize;\n }\n }\n .ued-cascader-wrap .pcfactory-select-clear{\n color: iconColor;\n width: iconFontSize;\n height: iconFontSize;\n top: iconTop;\n .anticon>svg{\n width: iconFontSize;\n height: iconFontSize;\n }\n }",
79
86
  components: [{
80
87
  id: 'Form_180373',
81
88
  label: '表单',
@@ -62,7 +62,7 @@ export var Input = {
62
62
  icon: 'icon-ico-comp-ipt',
63
63
  title: '输入框',
64
64
  defaultValue: [{}],
65
- tpl: "",
65
+ tpl: '',
66
66
  components: [{
67
67
  id: 'Form_180373',
68
68
  label: '表单',
@@ -62,7 +62,7 @@ export var InputNumber = {
62
62
  icon: 'icon-ico-comp-inputnumber',
63
63
  title: '数字输入框',
64
64
  defaultValue: [{}],
65
- tpl: "",
65
+ tpl: '',
66
66
  components: [{
67
67
  id: 'Form_180373',
68
68
  label: '表单',
@@ -62,7 +62,7 @@ export var MultipleSelect = {
62
62
  icon: 'icon-ico-comp-multipleselect',
63
63
  title: '下拉复选',
64
64
  defaultValue: [{}],
65
- tpl: "",
65
+ tpl: '',
66
66
  components: [{
67
67
  id: 'Form_180373',
68
68
  label: '表单',
@@ -79,7 +79,7 @@ export var Select = {
79
79
  title: '下拉单选',
80
80
  defaultValue: [{
81
81
  iconFontSize: '12px',
82
- iconTop: '12px',
82
+ iconTop: '16px',
83
83
  iconColor: 'rgba(28,36,46,.25)'
84
84
  }],
85
85
  tpl: ".ued-select-wrap .pcfactory-select-arrow{\n color: iconColor;\n width: iconFontSize;\n height: iconFontSize;\n top: iconTop;\n .anticon>svg{\n width: iconFontSize;\n height: iconFontSize;\n }\n }\n .ued-select-wrap .pcfactory-select-clear{\n color: iconColor;\n width: iconFontSize;\n height: iconFontSize;\n top: iconTop;\n .anticon>svg{\n width: iconFontSize;\n height: iconFontSize;\n }\n }",
@@ -25,6 +25,6 @@ export var Text = {
25
25
  lineHeight: '0px',
26
26
  fontSize: '14px'
27
27
  }],
28
- tpl: "",
28
+ tpl: '',
29
29
  components: []
30
30
  };
@@ -62,7 +62,7 @@ export var TextArea = {
62
62
  icon: 'icon-ico-comp-textarea',
63
63
  title: '多行输入',
64
64
  defaultValue: [{}],
65
- tpl: "",
65
+ tpl: '',
66
66
  components: [{
67
67
  id: 'Form_180373',
68
68
  label: '表单',
@@ -80,7 +80,7 @@ export var TreeSelect = {
80
80
  defaultValue: [{
81
81
  iconFontSize: '12px',
82
82
  iconColor: 'rgba(28,36,46,.25)',
83
- iconTop: '12px'
83
+ iconTop: '16px'
84
84
  }],
85
85
  tpl: ".ued-treeSelect-wrap .pcfactory-select-arrow{\n color: iconColor;\n width: iconFontSize;\n height: iconFontSize;\n top: iconTop;\n .anticon>svg{\n width: iconFontSize;\n height: iconFontSize;\n }\n }\n .ued-treeSelect-wrap .pcfactory-select-clear{\n color: iconColor;\n width: iconFontSize;\n height: iconFontSize;\n top: iconTop;\n .anticon>svg{\n width: iconFontSize;\n height: iconFontSize;\n }\n }",
86
86
  components: [{
package/dist/css.js CHANGED
@@ -12,6 +12,8 @@ import { compile, stringify, serialize } from 'stylis';
12
12
  export function stringifyCss(tpl, values) {
13
13
  if (!tpl) return '';
14
14
  var result = tpl;
15
+
16
+ // eslint-disable-next-line guard-for-in
15
17
  for (var key in values) {
16
18
  var value = values[key];
17
19
  var regex = new RegExp("".concat(key, "\\b"), 'g');
@@ -26,6 +28,7 @@ export function parseCss(tpl, a) {
26
28
  var aRegex = /\.(\w+)\s*{\s*(.*?)\s*}/g;
27
29
  var aMatches = _toConsumableArray(a.matchAll(aRegex));
28
30
  var result = {};
31
+ // eslint-disable-next-line
29
32
  var _loop = function _loop() {
30
33
  var tplMatch = tplMatches[i];
31
34
  var tplSelector = tplMatch[1];
@@ -39,6 +42,7 @@ export function parseCss(tpl, a) {
39
42
  var aStyles = aMatch[2].split(';').map(function (style) {
40
43
  return style.trim();
41
44
  }).filter(Boolean);
45
+ // eslint-disable-next-line
42
46
  var _loop2 = function _loop2() {
43
47
  var tplStyle = tplStyles[j];
44
48
  var _tplStyle$split$map = tplStyle.split(':').map(function (item) {
@@ -97,10 +101,10 @@ export function insertRules(id, rules) {
97
101
  var selector = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document.head;
98
102
  var style = document.getElementById(id);
99
103
  if (!style) {
100
- var _style = document.createElement('style');
101
- _style.id = id;
102
- (selector !== null && selector !== void 0 ? selector : document.head).appendChild(_style);
103
- _style.innerHTML = rules;
104
+ style = document.createElement('style');
105
+ style.id = id;
106
+ (selector !== null && selector !== void 0 ? selector : document.head).appendChild(style);
107
+ style.innerHTML = rules;
104
108
  } else {
105
109
  style.innerHTML = rules;
106
110
  }
@@ -107,7 +107,7 @@ export var Accordion = {
107
107
  borderColor: '#DDD',
108
108
  borderRadius: '4px'
109
109
  }],
110
- tpl: "\n .lcdp-accordion .lcdp-accordion-header{\n color: textColor;\n font-weight: fontWeight;\n font-size: fontSize;\n line-height: lineHeight;\n background: backgroundColor;\n }\n .lcdp-accordion-header-default-icon{\n height: tagSize;\n background: titleColor;\n margin-right: tagMargin;\n }\n .adm-list-item-content{\n border-color: lineColor;\n }\n\n .lcdp-accordion .adm-collapse-arrow svg{\n color: arrowColor;\n width: arrowSize;\n height: arrowSize;\n }\n .lcdp-accordion .adm-list-item-content-main{\n background: bodyBgColor;\n }\n .lcdp-accordion{\n .adm-collapse{\n border-radius: borderRadius;\n border-color: borderColor !important;\n }\n }",
110
+ tpl: "\n .lcdp-accordion .lcdp-accordion-header{\n color: textColor;\n font-weight: fontWeight;\n font-size: fontSize;\n line-height: lineHeight;\n background: backgroundColor;\n }\n .lcdp-accordion .lcdp-accordion-header-default-icon{\n height: tagSize;\n background: titleColor;\n margin-right: tagMargin;\n }\n .adm-list-item-content{\n border-color: lineColor;\n }\n\n .lcdp-accordion .adm-collapse-arrow svg{\n color: arrowColor;\n width: arrowSize;\n height: arrowSize;\n }\n .lcdp-accordion .adm-list-item-content-main{\n background: bodyBgColor;\n }\n .lcdp-accordion{\n .adm-collapse{\n border-radius: borderRadius;\n border-color: borderColor !important;\n }\n }",
111
111
  components: [{
112
112
  id: 'Accordion_960849',
113
113
  label: '折叠面板',
@@ -144,7 +144,7 @@ export var DAddressPicker = {
144
144
  icon: 'icon-ico-comp-app-DAddressPicker',
145
145
  title: '地址',
146
146
  defaultValue: [{}],
147
- tpl: "",
147
+ tpl: '',
148
148
  components: [{
149
149
  id: 'DForm_333712',
150
150
  label: '表单',
@@ -144,7 +144,7 @@ export var DMultiplePicker = {
144
144
  icon: 'icon-ico-comp-app-DMultiplePicker',
145
145
  title: '多项选择',
146
146
  defaultValue: [{}],
147
- tpl: "",
147
+ tpl: '',
148
148
  components: [{
149
149
  id: 'DForm_333712',
150
150
  label: '表单',
@@ -144,7 +144,7 @@ export var DformDate = {
144
144
  icon: 'icon-ico-comp-app-DformDate',
145
145
  title: '时间选择',
146
146
  defaultValue: [{}],
147
- tpl: "",
147
+ tpl: '',
148
148
  components: [{
149
149
  id: 'DForm_333712',
150
150
  label: '表单',
@@ -128,7 +128,7 @@ export var DformInputNumber = {
128
128
  icon: 'icon-ico-comp-app-inputnumber',
129
129
  title: '数字输入',
130
130
  defaultValue: [{}],
131
- tpl: "",
131
+ tpl: '',
132
132
  components: [{
133
133
  id: 'DForm_333712',
134
134
  label: '表单',
@@ -144,7 +144,7 @@ export var DformPicker = {
144
144
  icon: 'icon-ico-comp-app-DformPicker',
145
145
  title: '单项选择',
146
146
  defaultValue: [{}],
147
- tpl: "",
147
+ tpl: '',
148
148
  components: [{
149
149
  id: 'DForm_333712',
150
150
  label: '表单',
@@ -144,7 +144,7 @@ export var DformSelect = {
144
144
  icon: 'icon-ico-comp-app-DformSelect',
145
145
  title: '多列选择',
146
146
  defaultValue: [{}],
147
- tpl: "",
147
+ tpl: '',
148
148
  components: [{
149
149
  id: 'DForm_333712',
150
150
  label: '表单',
@@ -11,7 +11,7 @@ export var Divider = {
11
11
  icon: 'icon-ico-comp-divider',
12
12
  title: '分割线',
13
13
  defaultValue: [{}],
14
- tpl: "",
14
+ tpl: '',
15
15
  components: [{
16
16
  id: 'Divider_0510467',
17
17
  label: '分割线',
@@ -77,7 +77,7 @@ export var Grid = {
77
77
  fontSize: '12px',
78
78
  fontWeight: '400'
79
79
  }],
80
- tpl: "\n .use-app-grid{\n background-color: backgroundColor;\n }\n .am-grid {\n border-radius: borderRadius;\n --adm-font-size-4: fontSize;\n --adm-color-text: textColor\n }\n .am-grid.am-grid-line:not(.am-grid-carousel){\n border:1PX solid borderColor;\n border-bottom:none;\n }\n .am-grid.am-grid-line .am-grid-flex:last-child{\n border-color: borderColor;\n border-bottom-right-radius: borderRadius;\n border-bottom-left-radius: borderRadius;\n }\n .am-grid.am-grid-line .am-grid-flex:first-child{\n border-top-left-radius: borderRadius;\n }\n .am-grid.am-grid-line .am-grid-flex .am-grid-flex-item:first-child{\n border: none;\n }\n .am-grid.am-grid-line .am-grid-flex{\n border-color: lineColor;\n }\n .am-grid.am-grid-square .am-grid-item .am-grid-item-inner-content .am-grid-icon{\n width: iconSize;\n }\n .am-grid .am-grid-flex .am-grid-flex-item .am-grid-item-content .am-grid-item-inner-content .am-grid-text{\n line-height: lineHeight;\n font-weight: fontWeight;\n }",
80
+ tpl: "\n .use-app-grid{\n background-color: backgroundColor;\n border-radius: borderRadius;\n }\n .am-grid {\n background-color: backgroundColor;\n border-radius: borderRadius;\n --adm-font-size-4: fontSize;\n --adm-color-text: textColor\n }\n .am-grid.am-grid-line:not(.am-grid-carousel){\n border:1PX solid borderColor;\n border-bottom:none;\n }\n .am-grid.am-grid-line .am-grid-flex:last-child{\n border-color: borderColor;\n border-bottom-right-radius: borderRadius;\n border-bottom-left-radius: borderRadius;\n }\n .am-grid.am-grid-line .am-grid-flex:first-child{\n border-top-left-radius: borderRadius;\n }\n .am-grid.am-grid-line .am-grid-flex .am-grid-flex-item:first-child{\n border: none;\n }\n .am-grid.am-grid-line .am-grid-flex{\n border-color: lineColor;\n }\n .am-grid.am-grid-square .am-grid-item .am-grid-item-inner-content .am-grid-icon{\n width: iconSize;\n }\n .am-grid .am-grid-flex .am-grid-flex-item .am-grid-item-content .am-grid-item-inner-content .am-grid-text{\n line-height: lineHeight;\n font-weight: fontWeight;\n }",
81
81
  components: [{
82
82
  id: 'Grid_842271',
83
83
  label: '宫格',
@@ -97,7 +97,7 @@ export var SearchView = {
97
97
  sBorderColor: 'rgba(0,0,0,0)',
98
98
  sBorderRadius: '18px'
99
99
  }],
100
- tpl: "\n .alita-search-view-wrap{\n --adm-color-background: backgroundColor;\n padding: paddingValue;\n border: 1PX solid borderColor;\n border-radius: borderRadius;\n }\n .alita-search-bar-input{\n background-color: sBackgroundColor;\ncolor: textColor;\nfont-size: fontSize;\nfont-weight: fontWeight;\npadding: sPaddingValue;\nborder-radius: sBorderRadius;\nborder: 1PX solid sBorderColor;\n }\n .alita-search-bar-search{\n width: iconSize;\n height: iconSize;\n }",
100
+ tpl: "\n .alita-search-view-wrap{\n --adm-color-background: backgroundColor;\n padding: paddingValue;\n border: 1PX solid borderColor;\n border-radius: borderRadius;\n }\n .alita-search-view-wrap .alita-search-bar-input{\n background-color: sBackgroundColor;\ncolor: textColor;\nfont-size: fontSize;\nfont-weight: fontWeight;\npadding: sPaddingValue;\nborder-radius: sBorderRadius;\nborder: 1PX solid sBorderColor;\n }\n .alita-search-view-wrap .alita-search-bar-search{\n width: iconSize;\n height: iconSize;\n }",
101
101
  components: [{
102
102
  id: 'SearchView_197467',
103
103
  label: '搜索',
@@ -117,13 +117,13 @@ export var StaticTabs = {
117
117
  fontWeight: '400',
118
118
  fontSize: '15px',
119
119
  lineHeight: '100%',
120
- selectBorderRadius: '0',
120
+ selectBorderRadius: '12px',
121
121
  // paddingValue:'8px 0 8px 0',
122
122
  bodyBgColor: 'rgba(0,0,0,0)',
123
123
  borderColor: 'rgba(0,0,0,0)',
124
124
  lineColor: '#108ee9'
125
125
  }],
126
- tpl: "\n\n .am-tabs-default-bar-tab{\nfont-weight: fontWeight;\nborder-top-left-radius: selectBorderRadius;\n border-top-right-radius: selectBorderRadius;\n color: textColor;\nfont-size: fontSize;\nborder: 1px solid borderColor;\nbackground-color: backgroundColor;\n }\n .am-tabs-default-bar-tab-active {\n background-color: selectBgColor;\n color: selectTextColor;\nfont-weight: selectFontWeight;\n }\n .am-tabs-pane-wrap{\n background-color: bodyBgColor;\n }\n .am-tabs-default-bar-underline{\n border-color: lineColor;\n }",
126
+ tpl: "\n .am-tabs-default-bar-top .am-tabs-default-bar-tab{\nfont-weight: fontWeight;\nborder-top-left-radius: selectBorderRadius;\n border-top-right-radius: selectBorderRadius;\n color: textColor;\nfont-size: fontSize;\nborder: 1px solid borderColor;\nbackground-color: backgroundColor;\n }\n .am-tabs-default-bar-content .am-tabs-default-bar-tab-active::before, .am-tabs-default-bar-content .am-tabs-default-bar-tab-active::after{\n background: selectBgColor;\n }\n .am-tabs-default-bar-content .am-tabs-default-bar-tab-active::before{\n left: 0;\n }\n .am-tabs-bottom, .am-tabs-top{\n border-radius: selectBorderRadius;\n }\n .am-tabs-default-bar-content .am-tabs-default-bar-tab-active {\n background-color: selectBgColor;\n color: selectTextColor;\nfont-weight: selectFontWeight;\n }\n .am-tabs-pane-wrap{\n background-color: bodyBgColor;\n }\n .am-tabs-default-bar-animated .am-tabs-default-bar-underline{\n border-color: lineColor;\n }",
127
127
  components: [{
128
128
  id: 'StaticTabs_828878',
129
129
  label: '静态标签页',
@@ -1,4 +1,4 @@
1
- export declare const Table: {
1
+ export declare const DynamicTable: {
2
2
  type: string;
3
3
  variable: {
4
4
  textColor: {
@@ -1,5 +1,5 @@
1
- export var Table = {
2
- type: 'Table',
1
+ export var DynamicTable = {
2
+ type: 'DynamicTable',
3
3
  variable: {
4
4
  textColor: {
5
5
  type: 'color',
package/dist/lx-mobile.js CHANGED
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
7
7
  import { stringifyCss, parseCss } from "./css";
8
8
  import { objToListByGroupsName } from "./utils";
9
9
  import { Button } from "./h5config/Button";
10
- import { Table } from "./h5config/Table";
10
+ import { DynamicTable } from "./h5config/Table";
11
11
  import { FilterItems } from "./h5config/FilterItems";
12
12
  import { NoticeBarPlus } from "./h5config/NoticeBarPlus";
13
13
  import { StaticTabs } from "./h5config/StaticTabs";
@@ -39,7 +39,7 @@ export var MOBILE_ASSETS_CSS_TPL = {
39
39
  // TODO: 分割线 style 写死,最后修改方案
40
40
  // Divider,
41
41
  Card: Card,
42
- Table: Table,
42
+ DynamicTable: DynamicTable,
43
43
  FilterItems: FilterItems,
44
44
  NoticeBarPlus: NoticeBarPlus,
45
45
  StaticTabs: StaticTabs,
@@ -98,18 +98,14 @@ export function px2rem(obj) {
98
98
  var remValues = values.map(function (val) {
99
99
  if (val.includes('px')) {
100
100
  var parsedValue = parseFloat(val);
101
- return parsedValue / 50 + 'rem';
101
+ return "".concat(parsedValue / 50, "rem");
102
102
  }
103
103
  return val;
104
104
  });
105
105
  value = remValues.join(' ');
106
- }
107
- // 处理其他属性的值
108
- else {
109
- if (value.includes('px')) {
110
- var parsedValue = parseFloat(value);
111
- value = parsedValue / 50 + 'rem';
112
- }
106
+ } else if (value.includes('px')) {
107
+ var parsedValue = parseFloat(value);
108
+ value = "".concat(parsedValue / 50, "rem");
113
109
  }
114
110
  remObj[key] = value;
115
111
  }
@@ -128,6 +124,7 @@ export function parseValueRem(values) {
128
124
  if ((_values$key = values[key]) !== null && _values$key !== void 0 && _values$key.includes('rem')) {
129
125
  values[key] = rem2px(values[key]);
130
126
  }
127
+ return key;
131
128
  });
132
129
  return values;
133
130
  }
@@ -136,12 +133,11 @@ export function parseValueRem(values) {
136
133
  export function stringifyMobileCssByTypePreview(type, values) {
137
134
  if (extend[type]) {
138
135
  var cfg = getMobileItemByType(extend[type]);
139
- var item = getMobileItemByType(type);
140
- return stringifyCss(cfg.tpl, px2rem(_objectSpread(_objectSpread({}, cfg.defaultValue[0]), values))) + stringifyCss(item.tpl, px2rem(values));
141
- } else {
142
136
  var _item = getMobileItemByType(type);
143
- return stringifyCss(_item.tpl, px2rem(values));
137
+ return stringifyCss(cfg.tpl, px2rem(_objectSpread(_objectSpread({}, cfg.defaultValue[0]), values))) + stringifyCss(_item.tpl, px2rem(values));
144
138
  }
139
+ var item = getMobileItemByType(type);
140
+ return stringifyCss(item.tpl, px2rem(values));
145
141
  }
146
142
  export function stringifyMobileCssByType(type, values) {
147
143
  var item = getMobileItemByType(type);
package/dist/lx.js CHANGED
@@ -99,12 +99,11 @@ export function stringifyCssByType(type, values) {
99
99
  export function stringifyCssByTypePreview(type, values) {
100
100
  if (extend[type]) {
101
101
  var cfg = getItemByType(extend[type]);
102
- var item = getItemByType(type);
103
- return stringifyCss(cfg.tpl, _objectSpread(_objectSpread({}, cfg.defaultValue[0]), values)) + stringifyCss(item.tpl, values);
104
- } else {
105
102
  var _item = getItemByType(type);
106
- return stringifyCss(_item.tpl, values);
103
+ return stringifyCss(cfg.tpl, _objectSpread(_objectSpread({}, cfg.defaultValue[0]), values)) + stringifyCss(_item.tpl, values);
107
104
  }
105
+ var item = getItemByType(type);
106
+ return stringifyCss(item.tpl, values);
108
107
  }
109
108
  export function parseCssByType(type, css) {
110
109
  var item = getItemByType(type);
package/dist/utils.js CHANGED
@@ -13,6 +13,7 @@ export function objToListByGroupsName(obj) {
13
13
  var groups = {};
14
14
 
15
15
  // 遍历对象,根据groupsName属性进行分组
16
+ // eslint-disable-next-line guard-for-in
16
17
  for (var key in obj) {
17
18
  var item = obj[key];
18
19
  var groupName = item.groupsName;
@@ -42,6 +43,7 @@ export function __objToListByGroupsName(obj) {
42
43
  var groups = {};
43
44
 
44
45
  // 遍历对象,根据groupsName属性进行分组
46
+ // eslint-disable-next-line guard-for-in
45
47
  for (var key in obj) {
46
48
  var item = obj[key];
47
49
  var groupName = item.groupsName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/theme-utils",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",