@zgfe/modules-attribution 1.0.1

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 (107) hide show
  1. package/README.md +33 -0
  2. package/dist/esm/components/common/index.d.ts +6 -0
  3. package/dist/esm/components/common/index.js +21 -0
  4. package/dist/esm/components/common/styles/index.less +27 -0
  5. package/dist/esm/components/index.d.ts +6 -0
  6. package/dist/esm/components/index.js +6 -0
  7. package/dist/esm/components/option/index.d.ts +5 -0
  8. package/dist/esm/components/option/index.js +199 -0
  9. package/dist/esm/components/option/styles/index.less +17 -0
  10. package/dist/esm/components/option/types.d.ts +9 -0
  11. package/dist/esm/components/option/types.js +1 -0
  12. package/dist/esm/components/renderContent/index.d.ts +5 -0
  13. package/dist/esm/components/renderContent/index.js +92 -0
  14. package/dist/esm/components/renderContent/styles/index.less +21 -0
  15. package/dist/esm/components/renderContent/types.d.ts +15 -0
  16. package/dist/esm/components/renderContent/types.js +1 -0
  17. package/dist/esm/components/searchPanel/index.d.ts +5 -0
  18. package/dist/esm/components/searchPanel/index.js +122 -0
  19. package/dist/esm/components/searchPanel/styles/index.less +38 -0
  20. package/dist/esm/components/searchPanel/types.d.ts +10 -0
  21. package/dist/esm/components/searchPanel/types.js +1 -0
  22. package/dist/esm/components/showList/index.d.ts +10 -0
  23. package/dist/esm/components/showList/index.js +92 -0
  24. package/dist/esm/components/showList/listPanel.d.ts +9 -0
  25. package/dist/esm/components/showList/listPanel.js +118 -0
  26. package/dist/esm/components/showList/styles/index.less +75 -0
  27. package/dist/esm/components/showList/types.d.ts +9 -0
  28. package/dist/esm/components/showList/types.js +1 -0
  29. package/dist/esm/components/table/index.d.ts +5 -0
  30. package/dist/esm/components/table/index.js +194 -0
  31. package/dist/esm/components/table/styles/index.less +12 -0
  32. package/dist/esm/components/table/types.d.ts +11 -0
  33. package/dist/esm/components/table/types.js +1 -0
  34. package/dist/esm/components/title/index.d.ts +5 -0
  35. package/dist/esm/components/title/index.js +184 -0
  36. package/dist/esm/components/title/searchTitle.d.ts +7 -0
  37. package/dist/esm/components/title/searchTitle.js +47 -0
  38. package/dist/esm/components/title/styles/index.less +72 -0
  39. package/dist/esm/components/title/styles/search.less +27 -0
  40. package/dist/esm/components/title/types.d.ts +7 -0
  41. package/dist/esm/components/title/types.js +1 -0
  42. package/dist/esm/constants/apis.d.ts +9 -0
  43. package/dist/esm/constants/apis.js +9 -0
  44. package/dist/esm/constants/chart.d.ts +2 -0
  45. package/dist/esm/constants/chart.js +24 -0
  46. package/dist/esm/constants/color.d.ts +1 -0
  47. package/dist/esm/constants/color.js +1 -0
  48. package/dist/esm/constants/fields.d.ts +218 -0
  49. package/dist/esm/constants/fields.js +242 -0
  50. package/dist/esm/constants/index.d.ts +6 -0
  51. package/dist/esm/constants/index.js +6 -0
  52. package/dist/esm/constants/initData.d.ts +17 -0
  53. package/dist/esm/constants/initData.js +30 -0
  54. package/dist/esm/index.d.ts +2 -0
  55. package/dist/esm/index.js +2 -0
  56. package/dist/esm/modules/content/index.d.ts +5 -0
  57. package/dist/esm/modules/content/index.js +218 -0
  58. package/dist/esm/modules/content/styles/index.less +7 -0
  59. package/dist/esm/modules/content/types.d.ts +8 -0
  60. package/dist/esm/modules/content/types.js +2 -0
  61. package/dist/esm/modules/content/utiles.d.ts +12 -0
  62. package/dist/esm/modules/content/utiles.js +231 -0
  63. package/dist/esm/modules/home/demo/create.d.ts +3 -0
  64. package/dist/esm/modules/home/demo/create.js +54 -0
  65. package/dist/esm/modules/home/demo/edit.d.ts +3 -0
  66. package/dist/esm/modules/home/demo/edit.js +80 -0
  67. package/dist/esm/modules/home/demo/index.d.ts +4 -0
  68. package/dist/esm/modules/home/demo/index.js +52 -0
  69. package/dist/esm/modules/home/demo/scene.d.ts +3 -0
  70. package/dist/esm/modules/home/demo/scene.js +74 -0
  71. package/dist/esm/modules/home/demo/styles/index.less +33 -0
  72. package/dist/esm/modules/home/index.d.ts +5 -0
  73. package/dist/esm/modules/home/index.js +172 -0
  74. package/dist/esm/modules/home/styles/index.less +37 -0
  75. package/dist/esm/modules/home/types.d.ts +19 -0
  76. package/dist/esm/modules/home/types.js +2 -0
  77. package/dist/esm/modules/leftPanel/components/globalAttribute.d.ts +8 -0
  78. package/dist/esm/modules/leftPanel/components/globalAttribute.js +64 -0
  79. package/dist/esm/modules/leftPanel/components/panel.d.ts +4 -0
  80. package/dist/esm/modules/leftPanel/components/panel.js +87 -0
  81. package/dist/esm/modules/leftPanel/demo/index.d.ts +3 -0
  82. package/dist/esm/modules/leftPanel/demo/index.js +28 -0
  83. package/dist/esm/modules/leftPanel/index.d.ts +6 -0
  84. package/dist/esm/modules/leftPanel/index.js +285 -0
  85. package/dist/esm/modules/leftPanel/styles/index.less +55 -0
  86. package/dist/esm/modules/leftPanel/types.d.ts +27 -0
  87. package/dist/esm/modules/leftPanel/types.js +2 -0
  88. package/dist/esm/modules/leftPanel/utils.d.ts +5 -0
  89. package/dist/esm/modules/leftPanel/utils.js +262 -0
  90. package/dist/esm/style/image/noData.png +0 -0
  91. package/dist/esm/style/image/ring.svg +9 -0
  92. package/dist/esm/style/index.less +47 -0
  93. package/dist/esm/style/theme.d.ts +15 -0
  94. package/dist/esm/style/theme.js +16 -0
  95. package/dist/esm/types.d.ts +46 -0
  96. package/dist/esm/types.js +2 -0
  97. package/dist/esm/utils/ajaxConfig.d.ts +8 -0
  98. package/dist/esm/utils/ajaxConfig.js +47 -0
  99. package/dist/esm/utils/base64.d.ts +23 -0
  100. package/dist/esm/utils/base64.js +132 -0
  101. package/dist/esm/utils/formData.d.ts +18 -0
  102. package/dist/esm/utils/formData.js +485 -0
  103. package/dist/esm/utils/transfer.d.ts +65 -0
  104. package/dist/esm/utils/transfer.js +206 -0
  105. package/dist/esm/utils/util.d.ts +32 -0
  106. package/dist/esm/utils/util.js +177 -0
  107. package/package.json +54 -0
@@ -0,0 +1,206 @@
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 moment from 'moment';
8
+ import util from "./util";
9
+
10
+ /**
11
+ * 老事件分析的查询数据
12
+ */
13
+
14
+ export function transferEventSearchData(params) {
15
+ var userPropList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
16
+ var eventGroupList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
17
+ var eventEnvList = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
18
+ var result = {
19
+ userGroup: params.user_group.split(','),
20
+ targets: [],
21
+ chartType: params.chartType
22
+ };
23
+ // 时间
24
+ var timeData = params.time;
25
+ if (util.isString(timeData)) {
26
+ timeData = JSON.parse(timeData);
27
+ }
28
+ var time = timeData.dimension_date.split(',');
29
+ var unit = time[0];
30
+ var begin = timeData.begin_date;
31
+ var end = timeData.end_date;
32
+ if (time.includes('total') || begin.indexOf('-') < 0) {
33
+ result.time = {
34
+ unit: unit,
35
+ relative: [begin, end],
36
+ begin: moment().subtract(begin, unit).format('YYYY-MM-DD'),
37
+ end: moment().subtract(end, 'days').format('YYYY-MM-DD')
38
+ };
39
+ } else {
40
+ result.time = {
41
+ unit: unit,
42
+ begin: begin,
43
+ end: end
44
+ };
45
+ }
46
+ // 全局属性(平台)
47
+ if (params.platform) {
48
+ var envData;
49
+ eventEnvList.forEach(function (env) {
50
+ if (env.name === 'platform') {
51
+ envData = env;
52
+ }
53
+ });
54
+ if (envData) {
55
+ var platforms = ['android', 'ios', 'js'];
56
+ result.globalFilters = {
57
+ relation: 'and',
58
+ conditions: [{
59
+ attrId: envData.id,
60
+ attrName: 'platform',
61
+ dimensionSub: 'platform',
62
+ label: envData.label,
63
+ category: envData.category,
64
+ type: envData.type,
65
+ operator: 'equal',
66
+ propCategory: 'envProp',
67
+ values: [platforms[params.platform - 1]]
68
+ }]
69
+ };
70
+ }
71
+ }
72
+ // 属性细分
73
+ if (params.dimension_sub && params.event) {
74
+ var data = transferDimension(userPropList, eventGroupList, eventEnvList, params.dimension_sub, params.event, params.event_attr, params.user_attr);
75
+ if (data) {
76
+ result.globalDimensions = [data];
77
+ }
78
+ }
79
+ // 指标
80
+ var targets = {
81
+ type: params.module,
82
+ alias: '',
83
+ eventGroupId: params.event_group_id || 0,
84
+ eventId: params.event || -100,
85
+ analysisDimension: {
86
+ analysisIndex: params.analysis_index,
87
+ analysisAttr: params.event_attr
88
+ }
89
+ };
90
+ if (params.filter_condition) {
91
+ var conditions = [];
92
+ var filterCondition = params.filter_condition;
93
+ if (util.isString(filterCondition)) {
94
+ filterCondition = JSON.parse(filterCondition);
95
+ }
96
+ var _filterCondition = filterCondition,
97
+ eventCondition = _filterCondition.eventCondition,
98
+ userCondition = _filterCondition.userCondition;
99
+ if (eventCondition && eventCondition.eventSingleConditions) {
100
+ eventCondition.eventSingleConditions.forEach(function (e) {
101
+ if (e.happenTime && e.happenTime.params.length) {
102
+ if (e.happenTime.params[0] === 'relative') {
103
+ result.time.relative = [e.happenTime.params[1], e.happenTime.params[2]];
104
+ }
105
+ }
106
+ if (e.eventName) {
107
+ targets.eventName = e.eventName;
108
+ }
109
+ if (e.attrConditions) {
110
+ conditions = conditions.concat(transferCondition(e.attrConditions));
111
+ }
112
+ if (e.environmentConditions) {
113
+ conditions = conditions.concat(transferCondition(e.environmentConditions));
114
+ }
115
+ });
116
+ }
117
+ if (userCondition && userCondition.userSingleConditions) {
118
+ conditions = conditions.concat(transferCondition(userCondition.userSingleConditions));
119
+ }
120
+ targets.filters = {
121
+ conditions: conditions,
122
+ relation: 'and'
123
+ };
124
+ }
125
+ result.targets = [targets];
126
+ return result;
127
+ }
128
+
129
+ /**
130
+ * 转化属性细分
131
+ * @param userPropList 用户属性
132
+ * @param eventGroupList 事件属性
133
+ * @param eventEnvList 环境属性
134
+ * @param eventId 事件id
135
+ * @param dimensionSub dimension_sub
136
+ * @param eventAttr 事件属性name
137
+ * @param userAttr 用户属性name
138
+ * @returns
139
+ */
140
+ function transferDimension(userPropList, eventGroupList, eventEnvList, dimensionSub, eventId, eventAttr, userAttr) {
141
+ var data;
142
+ // 事件属性
143
+ if (eventAttr) {
144
+ eventGroupList.forEach(function (group) {
145
+ group.eventList.forEach(function (event) {
146
+ if (event.id === eventId) {
147
+ event.attrList.forEach(function (attr) {
148
+ if (attr.label === eventAttr && !data) {
149
+ data = {
150
+ attrId: attr.id,
151
+ attrName: attr.label,
152
+ propCategory: 'eventProp',
153
+ type: attr.type
154
+ };
155
+ }
156
+ });
157
+ }
158
+ });
159
+ });
160
+ } else if (userAttr) {
161
+ // 用户属性
162
+ userPropList.forEach(function (user) {
163
+ if (user.name === userAttr) {
164
+ data = _objectSpread({
165
+ attrId: user.id,
166
+ attrName: user.name
167
+ }, user);
168
+ }
169
+ });
170
+ } else {
171
+ // 环境属性
172
+ eventEnvList.forEach(function (env) {
173
+ if (env.name === dimensionSub) {
174
+ data = _objectSpread({
175
+ attrId: env.id,
176
+ attrName: env.name
177
+ }, env);
178
+ }
179
+ });
180
+ }
181
+ return data;
182
+ }
183
+
184
+ /**
185
+ * 转化筛选属性
186
+ * @param conditions 筛选属性
187
+ * @returns
188
+ */
189
+ function transferCondition(conditions) {
190
+ var result = [];
191
+ conditions.forEach(function (attr) {
192
+ result.push({
193
+ subtype: attr.subtype,
194
+ attrId: attr.attrId,
195
+ attrName: attr.name,
196
+ label: attr.text,
197
+ type: attr.type,
198
+ propCategory: attr.isEventProp ? 'eventProp' : attr.isUserProp ? 'userProp' : 'envProp',
199
+ category: attr.category,
200
+ dimensionSub: attr.category,
201
+ operator: attr.operator,
202
+ values: attr.params
203
+ });
204
+ });
205
+ return result;
206
+ }
@@ -0,0 +1,32 @@
1
+ declare let util: {
2
+ dayTime: number;
3
+ type(obj: any): string;
4
+ isObject(obj: any): boolean;
5
+ isArray(obj: any): boolean;
6
+ isString(obj: any): boolean;
7
+ isNumber(obj: any): boolean;
8
+ isDate(obj: any): boolean;
9
+ isFunction(obj: any): boolean;
10
+ isEqual(a?: {}, b?: {}): boolean;
11
+ equal(a: any, b: any): boolean;
12
+ random(min: number, max: number): number;
13
+ guid(): string;
14
+ mergeObject(defaults: {
15
+ [x: string]: any;
16
+ }, option: {
17
+ [x: string]: any;
18
+ }): {
19
+ [x: string]: any;
20
+ };
21
+ toThousands(num: number): string;
22
+ toDoubleNumber(num: number): string;
23
+ dateFormat(date?: any, formatter?: string): string;
24
+ timeFormat(date: any, formatter: string | undefined, autoShort: any): string | undefined;
25
+ strMiddleSplit(str: string, config?: {
26
+ maxLength: number;
27
+ beginLength: number;
28
+ endLength: number;
29
+ replaceStr: string;
30
+ }): string;
31
+ };
32
+ export default util;
@@ -0,0 +1,177 @@
1
+ var util = {
2
+ dayTime: 24 * 60 * 60 * 1000,
3
+ type: function type(obj) {
4
+ return Object.prototype.toString.call(obj);
5
+ },
6
+ isObject: function isObject(obj) {
7
+ return this.type(obj) === '[object Object]';
8
+ },
9
+ isArray: function isArray(obj) {
10
+ return this.type(obj) === '[object Array]';
11
+ },
12
+ isString: function isString(obj) {
13
+ return this.type(obj) === '[object String]';
14
+ },
15
+ isNumber: function isNumber(obj) {
16
+ return this.type(obj) === '[object Number]';
17
+ },
18
+ isDate: function isDate(obj) {
19
+ return this.type(obj) === '[object Date]';
20
+ },
21
+ isFunction: function isFunction(obj) {
22
+ return this.type(obj) === '[object Function]';
23
+ },
24
+ isEqual: function isEqual() {
25
+ var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26
+ var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
27
+ return JSON.stringify(a) === JSON.stringify(b);
28
+ },
29
+ equal: function equal(a, b) {
30
+ return JSON.stringify(a) === JSON.stringify(b);
31
+ },
32
+ /**
33
+ * 获取指定范围的随机数
34
+ * @param min
35
+ * @param max
36
+ * @returns {*}
37
+ */
38
+ random: function random(min, max) {
39
+ return Math.round(Math.random() * (max - min)) + min;
40
+ },
41
+ guid: function guid() {
42
+ function s4() {
43
+ return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
44
+ }
45
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
46
+ },
47
+ mergeObject: function mergeObject(defaults, option) {
48
+ defaults = defaults || {};
49
+ option = option || {};
50
+ for (var prop in defaults) {
51
+ if (this.isObject(defaults[prop])) {
52
+ option[prop] = option[prop] ? option[prop] : {};
53
+ this.mergeObject(defaults[prop], option[prop]);
54
+ } else if (this.isArray(defaults[prop])) {
55
+ if (!option[prop] || !option[prop].length) {
56
+ option[prop] = defaults[prop];
57
+ } else {
58
+ var i = 0;
59
+ var optLenght = option[prop].length;
60
+ var defaultLength = defaults[prop].length;
61
+ for (i; i < optLenght && i < defaultLength; i++) {
62
+ option[prop][i] = this.mergeObject(defaults[prop][i], option[prop][i]);
63
+ }
64
+ }
65
+ } else {
66
+ option[prop] = option[prop] === null || option[prop] === undefined ? defaults[prop] : option[prop];
67
+ }
68
+ }
69
+ return option;
70
+ },
71
+ /**
72
+ * 将数字转为千分位分割格式
73
+ * @param num
74
+ * @returns {string}
75
+ */
76
+ toThousands: function toThousands(num) {
77
+ var source = String(num).split('.'); // 按小数点分成2部分
78
+ source[0] = source[0].replace(new RegExp('(\\d)(?=(\\d{3})+$)', 'ig'), '$1,'); // 只将整数部分进行都好分割
79
+ return source.join('.'); // 再将小数部分合并进来
80
+ },
81
+ /**
82
+ * 为单数前补0
83
+ * @param num
84
+ * @returns {string}
85
+ */
86
+ toDoubleNumber: function toDoubleNumber(num) {
87
+ // num += ''
88
+ var num2 = num.toString();
89
+ return num > 9 ? num2 : '0' + num2;
90
+ },
91
+ /**
92
+ * 日期格式化
93
+ * @param date
94
+ * @param formatter
95
+ * @returns {string}
96
+ */
97
+ dateFormat: function dateFormat() {
98
+ var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
99
+ var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
100
+ return formatter.replace('yyyy', date.getFullYear()).replace('mm', this.toDoubleNumber(date.getMonth() + 1)).replace('dd', this.toDoubleNumber(date.getDate()));
101
+ },
102
+ /**
103
+ * 日期格式化
104
+ * @param date
105
+ * @param formatter
106
+ * @returns {string}
107
+ */
108
+ timeFormat: function timeFormat() {
109
+ var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
110
+ var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hh:mm:ss';
111
+ var autoShort = arguments.length > 2 ? arguments[2] : undefined;
112
+ if (this.isDate(date)) {
113
+ return formatter.replace('hh', this.toDoubleNumber(date.getHours())).replace('mm', this.toDoubleNumber(date.getMinutes())).replace('ss', this.toDoubleNumber(date.getSeconds()));
114
+ } else if (this.isNumber(date)) {
115
+ // formatter 格式化规则 如:{s:'秒', h:'小时', m: '分钟'}
116
+ var s = parseInt(date / 1000 + '');
117
+ var m = parseInt(s / 60 + '');
118
+ var h = parseInt(m / 60 + '');
119
+ s = s - m * 60;
120
+ m = m - h * 60;
121
+ if (!h && autoShort) {
122
+ formatter = formatter.replace(/hh\S*?mm/, 'mm');
123
+ if (!m) {
124
+ formatter = formatter.replace(/mm\S*?ss/, 'ss');
125
+ return formatter.replace('ss', s + '');
126
+ }
127
+ }
128
+ return formatter.replace('hh', this.toDoubleNumber(h)).replace('mm', this.toDoubleNumber(m)).replace('ss', this.toDoubleNumber(s));
129
+ }
130
+ },
131
+ /**
132
+ * 从中间拆分字符串,长度超出的话,解析为xxx...xxx
133
+ * @param str
134
+ * @param config
135
+ * @returns {string}
136
+ */
137
+ strMiddleSplit: function strMiddleSplit(str) {
138
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
139
+ maxLength: 20,
140
+ beginLength: 8,
141
+ endLength: 8,
142
+ replaceStr: '...'
143
+ };
144
+ str += '';
145
+ var reg = {
146
+ // eslint-disable-next-line
147
+ fullCharReg: /[^\x00-\xff]/,
148
+ // eslint-disable-next-line
149
+ fullCharsReg: /[^\x00-\xff]/g,
150
+ anyChars: /[\S\s]{1}/g
151
+ };
152
+ var fullCharLength = (str.match(reg.fullCharsReg) || []).length;
153
+ var fullLength = str.length + fullCharLength;
154
+ var beginArr = [];
155
+ var beginLength = 0;
156
+ var endArr = [];
157
+ var endLength = 0;
158
+ if (fullLength > config.maxLength) {
159
+ var strArr = str.match(reg.anyChars) || [];
160
+ strArr.forEach(function (char) {
161
+ if (beginLength >= config.beginLength) return;
162
+ var len = reg.fullCharReg.test(char) ? 2 : 1;
163
+ beginLength += len;
164
+ beginArr.push(char);
165
+ });
166
+ strArr.reverse().forEach(function (char) {
167
+ if (endLength >= config.endLength) return;
168
+ var len = reg.fullCharReg.test(char) ? 2 : 1;
169
+ endLength += len;
170
+ endArr.push(char);
171
+ });
172
+ return beginArr.join('') + config.replaceStr + endArr.reverse().join('');
173
+ }
174
+ return str;
175
+ }
176
+ };
177
+ export default util;
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@zgfe/modules-attribution",
3
+ "version": "1.0.1",
4
+ "scripts": {
5
+ "start": "dumi dev",
6
+ "docs:build": "dumi build",
7
+ "docs:deploy": "gh-pages -d docs-dist",
8
+ "build": "father build",
9
+ "deploy": "npm run docs:build && npm run docs:deploy",
10
+ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
11
+ "test": "umi-test",
12
+ "test:coverage": "umi-test --coverage",
13
+ "prepublishOnly": "npm run build",
14
+ "pub": "lerna publish"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "module": "dist/esm/index.js",
20
+ "typings": "dist/esm/index.d.ts",
21
+ "gitHooks": {
22
+ "pre-commit": "lint-staged"
23
+ },
24
+ "lint-staged": {
25
+ "*.{js,jsx,less,md,json}": [
26
+ "prettier --write"
27
+ ],
28
+ "*.ts?(x)": [
29
+ "prettier --parser=typescript --write"
30
+ ]
31
+ },
32
+ "dependencies": {
33
+ "react": "^18.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "@testing-library/jest-dom": "^5.15.1",
37
+ "@testing-library/react": "^13.0.0",
38
+ "@types/jest": "^27.0.3",
39
+ "@umijs/fabric": "^2.8.1",
40
+ "@umijs/test": "^3.0.5",
41
+ "@zgfe/business-lib": "1.1.30-insight.0",
42
+ "antd": "4.21.4",
43
+ "dumi": "^1.1.0",
44
+ "echarts": "^5.3.2",
45
+ "echarts-for-react": "^3.0.2",
46
+ "father": "^4.0.0-rc.2",
47
+ "gh-pages": "^3.0.0",
48
+ "lerna": "^4.0.0",
49
+ "lint-staged": "^10.0.7",
50
+ "prettier": "^2.2.1",
51
+ "yorkie": "^2.0.0"
52
+ },
53
+ "gitHead": "2077663358b3d87a849ecbf08e2619327e8e26f4"
54
+ }