@lingxiteam/theme-utils 0.5.2 → 0.5.3

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.
Files changed (127) hide show
  1. package/package.json +1 -1
  2. package/dist/config/Button.d.ts +0 -113
  3. package/dist/config/Button.js +0 -277
  4. package/dist/config/Card.d.ts +0 -144
  5. package/dist/config/Card.js +0 -162
  6. package/dist/config/Cascader.d.ts +0 -196
  7. package/dist/config/Cascader.js +0 -225
  8. package/dist/config/Checkbox.d.ts +0 -162
  9. package/dist/config/Checkbox.js +0 -178
  10. package/dist/config/CheckboxGroup.d.ts +0 -184
  11. package/dist/config/CheckboxGroup.js +0 -192
  12. package/dist/config/Collapse.d.ts +0 -186
  13. package/dist/config/Collapse.js +0 -330
  14. package/dist/config/Container.d.ts +0 -275
  15. package/dist/config/Container.js +0 -301
  16. package/dist/config/DatePicker.d.ts +0 -179
  17. package/dist/config/DatePicker.js +0 -179
  18. package/dist/config/Description.d.ts +0 -106
  19. package/dist/config/Description.js +0 -126
  20. package/dist/config/Divider.d.ts +0 -61
  21. package/dist/config/Divider.js +0 -61
  22. package/dist/config/Form.d.ts +0 -3071
  23. package/dist/config/Form.js +0 -1358
  24. package/dist/config/Icon.d.ts +0 -55
  25. package/dist/config/Icon.js +0 -55
  26. package/dist/config/Input.d.ts +0 -159
  27. package/dist/config/Input.js +0 -159
  28. package/dist/config/InputNumber.d.ts +0 -154
  29. package/dist/config/InputNumber.js +0 -154
  30. package/dist/config/Link.d.ts +0 -128
  31. package/dist/config/Link.js +0 -120
  32. package/dist/config/MultipleSelect.d.ts +0 -167
  33. package/dist/config/MultipleSelect.js +0 -175
  34. package/dist/config/Radio.d.ts +0 -239
  35. package/dist/config/Radio.js +0 -261
  36. package/dist/config/RangePicker.d.ts +0 -182
  37. package/dist/config/RangePicker.js +0 -182
  38. package/dist/config/Select.d.ts +0 -190
  39. package/dist/config/Select.js +0 -198
  40. package/dist/config/StdUpload.d.ts +0 -197
  41. package/dist/config/StdUpload.js +0 -211
  42. package/dist/config/Switch.d.ts +0 -141
  43. package/dist/config/Switch.js +0 -151
  44. package/dist/config/Table.d.ts +0 -482
  45. package/dist/config/Table.js +0 -560
  46. package/dist/config/Tabs.d.ts +0 -230
  47. package/dist/config/Tabs.js +0 -970
  48. package/dist/config/Tag.d.ts +0 -173
  49. package/dist/config/Tag.js +0 -548
  50. package/dist/config/Text.d.ts +0 -34
  51. package/dist/config/Text.js +0 -34
  52. package/dist/config/TextArea.d.ts +0 -151
  53. package/dist/config/TextArea.js +0 -151
  54. package/dist/config/TimePicker.d.ts +0 -180
  55. package/dist/config/TimePicker.js +0 -180
  56. package/dist/config/Tree.d.ts +0 -151
  57. package/dist/config/Tree.js +0 -195
  58. package/dist/config/TreeSelect.d.ts +0 -197
  59. package/dist/config/TreeSelect.js +0 -213
  60. package/dist/css.d.ts +0 -6
  61. package/dist/css.js +0 -126
  62. package/dist/demo.d.ts +0 -5
  63. package/dist/demo.js +0 -79
  64. package/dist/h5config/Accordion.d.ts +0 -410
  65. package/dist/h5config/Accordion.js +0 -548
  66. package/dist/h5config/Button.d.ts +0 -142
  67. package/dist/h5config/Button.js +0 -253
  68. package/dist/h5config/Card.d.ts +0 -275
  69. package/dist/h5config/Card.js +0 -535
  70. package/dist/h5config/DAddressPicker.d.ts +0 -188
  71. package/dist/h5config/DAddressPicker.js +0 -230
  72. package/dist/h5config/DCheckbox.d.ts +0 -202
  73. package/dist/h5config/DCheckbox.js +0 -248
  74. package/dist/h5config/DForm.d.ts +0 -1597
  75. package/dist/h5config/DForm.js +0 -932
  76. package/dist/h5config/DMultiplePicker.d.ts +0 -189
  77. package/dist/h5config/DMultiplePicker.js +0 -235
  78. package/dist/h5config/DformDate.d.ts +0 -191
  79. package/dist/h5config/DformDate.js +0 -233
  80. package/dist/h5config/DformFile.d.ts +0 -277
  81. package/dist/h5config/DformFile.js +0 -292
  82. package/dist/h5config/DformImagePicker.d.ts +0 -138
  83. package/dist/h5config/DformImagePicker.js +0 -156
  84. package/dist/h5config/DformInput.d.ts +0 -189
  85. package/dist/h5config/DformInput.js +0 -231
  86. package/dist/h5config/DformInputNumber.d.ts +0 -173
  87. package/dist/h5config/DformInputNumber.js +0 -215
  88. package/dist/h5config/DformPicker.d.ts +0 -190
  89. package/dist/h5config/DformPicker.js +0 -236
  90. package/dist/h5config/DformRadio.d.ts +0 -210
  91. package/dist/h5config/DformRadio.js +0 -256
  92. package/dist/h5config/DformRangePicker.d.ts +0 -195
  93. package/dist/h5config/DformRangePicker.js +0 -237
  94. package/dist/h5config/DformSelect.d.ts +0 -198
  95. package/dist/h5config/DformSelect.js +0 -262
  96. package/dist/h5config/DformSwitch.d.ts +0 -145
  97. package/dist/h5config/DformSwitch.js +0 -163
  98. package/dist/h5config/DformTextArea.d.ts +0 -184
  99. package/dist/h5config/DformTextArea.js +0 -226
  100. package/dist/h5config/Divider.d.ts +0 -53
  101. package/dist/h5config/Divider.js +0 -90
  102. package/dist/h5config/FilterItems.d.ts +0 -154
  103. package/dist/h5config/FilterItems.js +0 -204
  104. package/dist/h5config/Grid.d.ts +0 -235
  105. package/dist/h5config/Grid.js +0 -278
  106. package/dist/h5config/Icon.d.ts +0 -54
  107. package/dist/h5config/Icon.js +0 -54
  108. package/dist/h5config/Link.d.ts +0 -51
  109. package/dist/h5config/Link.js +0 -51
  110. package/dist/h5config/LoadMore.d.ts +0 -527
  111. package/dist/h5config/LoadMore.js +0 -940
  112. package/dist/h5config/NoticeBarPlus.d.ts +0 -111
  113. package/dist/h5config/NoticeBarPlus.js +0 -141
  114. package/dist/h5config/SearchView.d.ts +0 -135
  115. package/dist/h5config/SearchView.js +0 -177
  116. package/dist/h5config/StaticTabs.d.ts +0 -121
  117. package/dist/h5config/StaticTabs.js +0 -180
  118. package/dist/h5config/Table.d.ts +0 -197
  119. package/dist/h5config/Table.js +0 -589
  120. package/dist/index.d.ts +0 -4
  121. package/dist/index.js +0 -4
  122. package/dist/lx-mobile.d.ts +0 -23
  123. package/dist/lx-mobile.js +0 -174
  124. package/dist/lx.d.ts +0 -24
  125. package/dist/lx.js +0 -139
  126. package/dist/utils.d.ts +0 -12
  127. package/dist/utils.js +0 -67
package/dist/lx-mobile.js DELETED
@@ -1,174 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
- import { stringifyCss, parseCss, prefixAnyCSS } from "./css";
8
- import { objToListByGroupsName } from "./utils";
9
- import { Button } from "./h5config/Button";
10
- import { DynamicTable } from "./h5config/Table";
11
- import { FilterItems } from "./h5config/FilterItems";
12
- import { NoticeBarPlus } from "./h5config/NoticeBarPlus";
13
- import { StaticTabs } from "./h5config/StaticTabs";
14
- import { Grid } from "./h5config/Grid";
15
- import { SearchView } from "./h5config/SearchView";
16
- import { DForm } from "./h5config/DForm";
17
- import { DformInput } from "./h5config/DformInput";
18
- import { DformTextArea } from "./h5config/DformTextArea";
19
- import { DformInputNumber } from "./h5config/DformInputNumber";
20
- import { DformRadio } from "./h5config/DformRadio";
21
- import { DCheckbox } from "./h5config/DCheckbox";
22
- import { DformPicker } from "./h5config/DformPicker";
23
- import { DMultiplePicker } from "./h5config/DMultiplePicker";
24
- import { DformSelect } from "./h5config/DformSelect";
25
- import { DAddressPicker } from "./h5config/DAddressPicker";
26
- import { DformDate } from "./h5config/DformDate";
27
- import { DformRangePicker } from "./h5config/DformRangePicker";
28
- import { DformSwitch } from "./h5config/DformSwitch";
29
- import { DformImagePicker } from "./h5config/DformImagePicker";
30
- import { DformFile } from "./h5config/DformFile";
31
- import { Icon } from "./h5config/Icon";
32
- import { ALink } from "./h5config/Link";
33
- import { Card } from "./h5config/Card";
34
- import { Accordion } from "./h5config/Accordion";
35
- export var THEME_KEYS_MOBILE_TITLE = {
36
- '@brand-primary': '主题色',
37
- '@border-color-base': '边框色',
38
- '@font-size-base': '主字号',
39
- '@color-text-base': '主文本色',
40
- '@color-text-placeholder': '警告色',
41
- '@font-size-heading': '标题字',
42
- '@button-font-size': '按钮字号',
43
- '@fill-base': '背景色',
44
- '@brand-primary-tap': '点击色',
45
- '@color-link': '链接色'
46
- };
47
- export var MOBILE_ASSETS_CSS_TPL = {
48
- Icon: Icon,
49
- ALink: ALink,
50
- Button: Button,
51
- // TODO: 分割线 style 写死,最后修改方案
52
- // Divider,
53
- Card: Card,
54
- DynamicTable: DynamicTable,
55
- FilterItems: FilterItems,
56
- NoticeBarPlus: NoticeBarPlus,
57
- StaticTabs: StaticTabs,
58
- Grid: Grid,
59
- SearchView: SearchView,
60
- // TODO: 动态列表自己并没有样式才对
61
- // LoadMore,
62
- DForm: DForm,
63
- DformInput: DformInput,
64
- DformTextArea: DformTextArea,
65
- DformInputNumber: DformInputNumber,
66
- DformRadio: DformRadio,
67
- DCheckbox: DCheckbox,
68
- DformPicker: DformPicker,
69
- DMultiplePicker: DMultiplePicker,
70
- DformSelect: DformSelect,
71
- DAddressPicker: DAddressPicker,
72
- DformDate: DformDate,
73
- DformRangePicker: DformRangePicker,
74
- DformSwitch: DformSwitch,
75
- DformImagePicker: DformImagePicker,
76
- DformFile: DformFile,
77
- Accordion: Accordion
78
- };
79
- export var mobileExtend = {
80
- DformInput: 'DForm',
81
- DformTextArea: 'DForm',
82
- DformInputNumber: 'DForm',
83
- DformRadio: 'DForm',
84
- DCheckbox: 'DForm',
85
- DformPicker: 'DForm',
86
- DMultiplePicker: 'DForm',
87
- DformSelect: 'DForm',
88
- DAddressPicker: 'DForm',
89
- DformDate: 'DForm',
90
- DformRangePicker: 'DForm',
91
- DformSwitch: 'DForm',
92
- DformImagePicker: 'DForm',
93
- DformFile: 'DForm'
94
- };
95
- export var MOBILE_ASSETS_COMPONENT_LIST = objToListByGroupsName(Object.values(MOBILE_ASSETS_CSS_TPL));
96
- export function getMobileItemByType(type) {
97
- var com = MOBILE_ASSETS_CSS_TPL[type];
98
- if (!type || !com) return {
99
- tpl: ''
100
- };
101
- return com;
102
- }
103
- export function px2rem(obj) {
104
- var remObj = {};
105
- for (var key in obj) {
106
- if (obj.hasOwnProperty(key)) {
107
- var value = obj[key];
108
- if (value) {
109
- var _value;
110
- var values = (_value = value) === null || _value === void 0 ? void 0 : _value.split(' ');
111
- if (values.length > 0) {
112
- var remValues = values.map(function (val) {
113
- if (val.includes('px')) {
114
- var parsedValue = parseFloat(val);
115
- return "".concat(parsedValue / 50, "rem");
116
- }
117
- return val;
118
- });
119
- value = remValues.join(' ');
120
- } else if (value.includes('px')) {
121
- var parsedValue = parseFloat(value);
122
- value = "".concat(parsedValue / 50, "rem");
123
- }
124
- }
125
- remObj[key] = value;
126
- }
127
- }
128
- return remObj;
129
- }
130
- export function rem2px(rem) {
131
- // TODO: 这个方法不对,现在没用到就没有修改
132
- var str = rem.split('rem');
133
- if (!str[0]) return '0';
134
- return "".concat((Number.parseFloat(str[0]) * 100).toFixed(1), "px");
135
- }
136
- export function parseValueRem(values) {
137
- Object.keys(values).map(function (key) {
138
- var _values$key;
139
- if ((_values$key = values[key]) !== null && _values$key !== void 0 && _values$key.includes('rem')) {
140
- values[key] = rem2px(values[key]);
141
- }
142
- return key;
143
- });
144
- return values;
145
- }
146
-
147
- // 临时解决方案,将只对它有影响的值,生成继承的样式
148
- export function stringifyMobileCssByTypePreview(type, values) {
149
- if (mobileExtend[type]) {
150
- var cfg = getMobileItemByType(mobileExtend[type]);
151
- var _item = getMobileItemByType(type);
152
- return stringifyCss(cfg.tpl, px2rem(_objectSpread(_objectSpread({}, cfg.defaultValue[0]), values))) + stringifyCss(_item.tpl, px2rem(values));
153
- }
154
- var item = getMobileItemByType(type);
155
- return stringifyCss(item.tpl, px2rem(values));
156
- }
157
- export function stringifyMobileCssByType(type, values) {
158
- var item = getMobileItemByType(type);
159
- return stringifyCss(item.tpl, px2rem(values));
160
- }
161
- export function parseMobileCssByType(type, css) {
162
- var item = getMobileItemByType(type);
163
- return parseValueRem(parseCss(item.tpl, css));
164
- }
165
- export function prefixMobileCSS(type, values, prefix) {
166
- if (mobileExtend[type]) {
167
- var _cfg$itemCustomTpl;
168
- var cfg = getMobileItemByType(mobileExtend[type]);
169
- var _item2 = getMobileItemByType(type);
170
- return prefixAnyCSS(stringifyCss((_cfg$itemCustomTpl = cfg === null || cfg === void 0 ? void 0 : cfg.itemCustomTpl) !== null && _cfg$itemCustomTpl !== void 0 ? _cfg$itemCustomTpl : cfg === null || cfg === void 0 ? void 0 : cfg.tpl, px2rem(_objectSpread(_objectSpread({}, cfg.defaultValue[0]), values))), prefix, cfg === null || cfg === void 0 ? void 0 : cfg.hasPrefixClass) + prefixAnyCSS(stringifyCss(_item2.tpl, px2rem(values)), prefix, _item2 === null || _item2 === void 0 ? void 0 : _item2.hasPrefixClass);
171
- }
172
- var item = getMobileItemByType(type);
173
- return prefixAnyCSS(stringifyCss(item.tpl, px2rem(values)), prefix, item === null || item === void 0 ? void 0 : item.hasPrefixClass);
174
- }
package/dist/lx.d.ts DELETED
@@ -1,24 +0,0 @@
1
- export declare const THEME_KEYS_TITLE: {
2
- '@primary-color': string;
3
- '@font-size-base': string;
4
- '@heading-color': string;
5
- '@text-color': string;
6
- '@text-color-secondary': string;
7
- '@disabled-color': string;
8
- '@border-radius-base': string;
9
- '@padding': string;
10
- '@border-color-base': string;
11
- '@box-shadow-base': string;
12
- '@link-color': string;
13
- '@success-color': string;
14
- '@warning-color': string;
15
- '@error-color': string;
16
- };
17
- export declare const ASSETS_CSS_TPL: any;
18
- export declare const pcExtend: any;
19
- export declare const ASSETS_COMPONENT_LIST: unknown[];
20
- export declare function getItemByType(type: string): any;
21
- export declare function stringifyCssByType(type: string, values: any): string;
22
- export declare function stringifyCssByTypePreview(type: string, values: any): string;
23
- export declare function parseCssByType(type: string, css: string): any;
24
- export declare function prefixCSS(type: string, values: any, prefix: string): string;
package/dist/lx.js DELETED
@@ -1,139 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
- import { stringifyCss, parseCss, prefixAnyCSS } from "./css";
8
- import { objToListByGroupsName } from "./utils";
9
- import { Button } from "./config/Button";
10
- // 文本放在不同的组件下,会有不同的效果,暂不支持配置
11
- // import { Text } from './config/Text';
12
- import { Icon } from "./config/Icon";
13
- import { Link } from "./config/Link";
14
- import { Container } from "./config/Container";
15
- import { Form } from "./config/Form";
16
- import { Input } from "./config/Input";
17
- import { Card } from "./config/Card";
18
- import { Collapse } from "./config/Collapse";
19
- import { Tabs } from "./config/Tabs";
20
- import { TextArea } from "./config/TextArea";
21
- import { InputNumber } from "./config/InputNumber";
22
- import { Radio } from "./config/Radio";
23
- import { CheckboxGroup } from "./config/CheckboxGroup";
24
- import { Checkbox } from "./config/Checkbox";
25
- import { Select } from "./config/Select";
26
- import { MultipleSelect } from "./config/MultipleSelect";
27
- import { DatePicker } from "./config/DatePicker";
28
- import { TimePicker } from "./config/TimePicker";
29
- import { RangePicker } from "./config/RangePicker";
30
- import { TreeSelect } from "./config/TreeSelect";
31
- import { Cascader } from "./config/Cascader";
32
- import { Switch } from "./config/Switch";
33
- import { StdUpload } from "./config/StdUpload";
34
- import { Table } from "./config/Table";
35
- import { Tag } from "./config/Tag";
36
- import { Tree } from "./config/Tree";
37
- import { Description } from "./config/Description";
38
- export var THEME_KEYS_TITLE = {
39
- '@primary-color': '主题色',
40
- '@font-size-base': '主字号',
41
- '@heading-color': '标题色',
42
- '@text-color': '主文本色',
43
- '@text-color-secondary': '次文本色',
44
- '@disabled-color': '失效色',
45
- '@border-radius-base': '圆角',
46
- '@padding': '边距',
47
- '@border-color-base': '边框颜色',
48
- '@box-shadow-base': '浮层阴影',
49
- '@link-color': '链接色',
50
- '@success-color': '成功色',
51
- '@warning-color': '警告色',
52
- '@error-color': '错误色'
53
- };
54
- export var ASSETS_CSS_TPL = {
55
- Button: Button,
56
- Container: Container,
57
- Form: Form,
58
- Card: Card,
59
- Collapse: Collapse,
60
- Tabs: Tabs,
61
- Icon: Icon,
62
- Link: Link,
63
- Input: Input,
64
- TextArea: TextArea,
65
- InputNumber: InputNumber,
66
- Radio: Radio,
67
- CheckboxGroup: CheckboxGroup,
68
- Checkbox: Checkbox,
69
- Select: Select,
70
- MultipleSelect: MultipleSelect,
71
- DatePicker: DatePicker,
72
- TimePicker: TimePicker,
73
- RangePicker: RangePicker,
74
- TreeSelect: TreeSelect,
75
- Cascader: Cascader,
76
- Switch: Switch,
77
- StdUpload: StdUpload,
78
- Table: Table,
79
- Tag: Tag,
80
- Tree: Tree,
81
- Description: Description
82
- };
83
- export var pcExtend = {
84
- Input: 'Form',
85
- TextArea: 'Form',
86
- InputNumber: 'Form',
87
- Radio: 'Form',
88
- CheckboxGroup: 'Form',
89
- Checkbox: 'Form',
90
- Select: 'Form',
91
- MultipleSelect: 'Form',
92
- DatePicker: 'Form',
93
- TimePicker: 'Form',
94
- RangePicker: 'Form',
95
- TreeSelect: 'Form',
96
- Cascader: 'Form',
97
- Switch: 'Form',
98
- StdUpload: 'Form',
99
- Table: 'Container',
100
- Card: 'Container',
101
- Collapse: 'Container'
102
- };
103
- export var ASSETS_COMPONENT_LIST = objToListByGroupsName(Object.values(ASSETS_CSS_TPL));
104
- export function getItemByType(type) {
105
- var com = ASSETS_CSS_TPL[type];
106
- if (!type || !com) return {
107
- tpl: ''
108
- };
109
- return com;
110
- }
111
- export function stringifyCssByType(type, values) {
112
- var item = getItemByType(type);
113
- return stringifyCss(item.tpl, values);
114
- }
115
-
116
- // 临时解决方案,将只对它有影响的值,生成继承的样式
117
- export function stringifyCssByTypePreview(type, values) {
118
- if (pcExtend[type]) {
119
- var cfg = getItemByType(pcExtend[type]);
120
- var _item = getItemByType(type);
121
- return stringifyCss(cfg.tpl, _objectSpread(_objectSpread({}, cfg.defaultValue[0]), values)) + stringifyCss(_item.tpl, values);
122
- }
123
- var item = getItemByType(type);
124
- return stringifyCss(item.tpl, values);
125
- }
126
- export function parseCssByType(type, css) {
127
- var item = getItemByType(type);
128
- return parseCss(item.tpl, css);
129
- }
130
- export function prefixCSS(type, values, prefix) {
131
- if (pcExtend[type]) {
132
- var _cfg$itemCustomTpl;
133
- var cfg = getItemByType(pcExtend[type]);
134
- var _item2 = getItemByType(type);
135
- return prefixAnyCSS(stringifyCss((_cfg$itemCustomTpl = cfg === null || cfg === void 0 ? void 0 : cfg.itemCustomTpl) !== null && _cfg$itemCustomTpl !== void 0 ? _cfg$itemCustomTpl : cfg === null || cfg === void 0 ? void 0 : cfg.tpl, _objectSpread(_objectSpread({}, cfg.defaultValue[0]), values)), prefix, cfg !== null && cfg !== void 0 && cfg.hasCustomNoPrefixClass ? false : cfg === null || cfg === void 0 ? void 0 : cfg.hasPrefixClass) + prefixAnyCSS(stringifyCss(_item2.tpl, values), prefix, _item2 === null || _item2 === void 0 ? void 0 : _item2.hasPrefixClass);
136
- }
137
- var item = getItemByType(type);
138
- return prefixAnyCSS(stringifyCss(item.tpl, values), prefix, item === null || item === void 0 ? void 0 : item.hasPrefixClass);
139
- }
package/dist/utils.d.ts DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * 根据 groupsName 将对象分成数组
3
- * @param obj
4
- * @returns
5
- */
6
- export declare function objToListByGroupsName(obj: any): unknown[];
7
- /**
8
- * (内部方法) 根据 groupsName 将对象分成数组
9
- * @param obj
10
- * @returns
11
- */
12
- export declare function __objToListByGroupsName(obj: any): unknown[];
package/dist/utils.js DELETED
@@ -1,67 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
11
- */
12
- export function objToListByGroupsName(obj) {
13
- var groups = {};
14
-
15
- // 遍历对象,根据groupsName属性进行分组
16
- // eslint-disable-next-line guard-for-in
17
- for (var key in obj) {
18
- var item = obj[key];
19
- var groupName = item.groupsName;
20
- if (!groups[groupName]) {
21
- groups[groupName] = {
22
- groupName: groupName,
23
- id: Object.keys(groups).length + 1,
24
- items: []
25
- };
26
- }
27
- groups[groupName].items.push(_objectSpread({
28
- key: key
29
- }, item));
30
- }
31
-
32
- // 将分组转换为数组
33
- var result = Object.values(groups);
34
- return result;
35
- }
36
-
37
- /**
38
- * (内部方法) 根据 groupsName 将对象分成数组
39
- * @param obj
40
- * @returns
41
- */
42
- export function __objToListByGroupsName(obj) {
43
- var groups = {};
44
-
45
- // 遍历对象,根据groupsName属性进行分组
46
- // eslint-disable-next-line guard-for-in
47
- for (var key in obj) {
48
- var item = obj[key];
49
- var groupName = item.groupsName;
50
- if (!groups[groupName]) {
51
- groups[groupName] = {
52
- groupName: groupName,
53
- id: Object.keys(groups).length + 1,
54
- items: []
55
- };
56
- }
57
- groups[groupName].items.push({
58
- key: key,
59
- type: item.type,
60
- icon: item.icon
61
- });
62
- }
63
-
64
- // 将分组转换为数组
65
- var result = Object.values(groups);
66
- return result;
67
- }