eoss-ui 0.6.12 → 0.6.14

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 (64) hide show
  1. package/lib/button-group.js +104 -88
  2. package/lib/button.js +104 -88
  3. package/lib/checkbox-group.js +104 -88
  4. package/lib/data-table-form.js +104 -88
  5. package/lib/data-table.js +104 -88
  6. package/lib/date-picker.js +104 -88
  7. package/lib/dialog.js +104 -88
  8. package/lib/eoss-ui.common.js +212 -168
  9. package/lib/flow-group.js +104 -88
  10. package/lib/flow-list.js +104 -88
  11. package/lib/flow.js +104 -88
  12. package/lib/form.js +104 -88
  13. package/lib/handle-user.js +104 -88
  14. package/lib/handler.js +104 -88
  15. package/lib/icon.js +113 -91
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +104 -88
  18. package/lib/input.js +104 -88
  19. package/lib/login.js +104 -88
  20. package/lib/main.js +164 -141
  21. package/lib/nav.js +104 -88
  22. package/lib/page.js +104 -88
  23. package/lib/pagination.js +104 -88
  24. package/lib/player.js +104 -88
  25. package/lib/qr-code.js +104 -88
  26. package/lib/radio-group.js +104 -88
  27. package/lib/retrial-auth.js +104 -88
  28. package/lib/select-ganged.js +104 -88
  29. package/lib/select.js +104 -88
  30. package/lib/selector-panel.js +104 -88
  31. package/lib/selector.js +104 -88
  32. package/lib/sizer.js +104 -88
  33. package/lib/steps.js +104 -88
  34. package/lib/switch.js +104 -88
  35. package/lib/table-form.js +104 -88
  36. package/lib/tabs.js +104 -88
  37. package/lib/theme-chalk/index.css +1 -1
  38. package/lib/theme-chalk/main.css +1 -1
  39. package/lib/theme-chalk/simplicity.css +1 -1
  40. package/lib/tips.js +104 -88
  41. package/lib/tree-group.js +104 -88
  42. package/lib/tree.js +104 -88
  43. package/lib/upload.js +130 -99
  44. package/lib/utils/util.js +104 -88
  45. package/lib/wujie.js +104 -88
  46. package/lib/wxlogin.js +104 -88
  47. package/package.json +1 -1
  48. package/packages/.DS_Store +0 -0
  49. package/packages/dialog/.DS_Store +0 -0
  50. package/packages/icon/src/main.vue +7 -1
  51. package/packages/main/.DS_Store +0 -0
  52. package/packages/main/src/default/index.vue +4 -4
  53. package/packages/main/src/main.vue +16 -10
  54. package/packages/main/src/simplicity/avatar.vue +6 -2
  55. package/packages/main/src/simplicity/index.vue +4 -4
  56. package/packages/main/src/simplicity/message.vue +0 -1
  57. package/packages/theme-chalk/lib/index.css +1 -1
  58. package/packages/theme-chalk/lib/main.css +1 -1
  59. package/packages/theme-chalk/lib/simplicity.css +1 -1
  60. package/packages/theme-chalk/src/simplicity.scss +1 -0
  61. package/packages/upload/src/main.vue +28 -8
  62. package/src/.DS_Store +0 -0
  63. package/src/index.js +1 -1
  64. package/src/utils/util.js +12 -1
package/lib/nav.js CHANGED
@@ -555,7 +555,6 @@ var average = function average() {
555
555
 
556
556
  return average;
557
557
  };
558
-
559
558
  /**
560
559
  * browser
561
560
  * @desc:浏览器类型
@@ -570,6 +569,22 @@ var browser = function browser() {
570
569
  }
571
570
  }
572
571
  };
572
+ /**
573
+ * busEmit
574
+ * @desc:发送事件
575
+ * @author huangbo
576
+ * @date 2022年5月7日
577
+ **/
578
+ var busEmit = function busEmit() {
579
+ var vm = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this;
580
+ var _ref2 = arguments[1];
581
+ var method = _ref2.method,
582
+ args = _ref2.args;
583
+
584
+ var bus = win.$wujie ? win.$wujie.bus : vm.bus || vm.$root.Bus;
585
+ bus && bus.$emit(method, args);
586
+ window.postMessage({ method: method, query: args }, '*');
587
+ };
573
588
 
574
589
  /**
575
590
  * calculateNetworkDays
@@ -794,9 +809,9 @@ var debounce = function debounce(callback, wait) {
794
809
  * @param {String} [url] - url地址
795
810
  * @param {String,Array} [key] - 参数名
796
811
  **/
797
- var delUrlParam = function delUrlParam(_ref2) {
798
- var url = _ref2.url,
799
- key = _ref2.key;
812
+ var delUrlParam = function delUrlParam(_ref3) {
813
+ var url = _ref3.url,
814
+ key = _ref3.key;
800
815
 
801
816
  var pUrl = '';
802
817
  try {
@@ -922,10 +937,10 @@ var esDecode = function esDecode(value) {
922
937
  * @param {string} [data] - 被加密的字符串
923
938
  * @param {string} [key] - 公钥
924
939
  **/
925
- var esmEncrypt = function esmEncrypt(_ref3) {
926
- var data = _ref3.data,
927
- key = _ref3.key,
928
- mode = _ref3.mode;
940
+ var esmEncrypt = function esmEncrypt(_ref4) {
941
+ var data = _ref4.data,
942
+ key = _ref4.key,
943
+ mode = _ref4.mode;
929
944
 
930
945
  var cipherMode = mode ? mode : 1;
931
946
  if (!new RegExp('^04').test(key)) {
@@ -943,10 +958,10 @@ var esmEncrypt = function esmEncrypt(_ref3) {
943
958
  * @param {string} [data] - 被解密的加密字符串
944
959
  * @param {string} [key] - 私钥
945
960
  **/
946
- var esmDecode = function esmDecode(_ref4) {
947
- var data = _ref4.data,
948
- key = _ref4.key,
949
- mode = _ref4.mode;
961
+ var esmDecode = function esmDecode(_ref5) {
962
+ var data = _ref5.data,
963
+ key = _ref5.key,
964
+ mode = _ref5.mode;
950
965
 
951
966
  var cipherMode = mode ? mode : 1;
952
967
  if (new RegExp('^04').test(key)) {
@@ -963,10 +978,10 @@ var esmDecode = function esmDecode(_ref4) {
963
978
  * @date 2022年5月7日
964
979
  * @param {String/Array} [attrs] - 要排除的属性
965
980
  **/
966
- var exclAttribute = function exclAttribute(_ref5) {
967
- var _ref5$attrs = _ref5.attrs,
968
- attrs = _ref5$attrs === undefined ? 'value' : _ref5$attrs,
969
- data = _ref5.data;
981
+ var exclAttribute = function exclAttribute(_ref6) {
982
+ var _ref6$attrs = _ref6.attrs,
983
+ attrs = _ref6$attrs === undefined ? 'value' : _ref6$attrs,
984
+ data = _ref6.data;
970
985
 
971
986
  var obj = extend(true, {}, data);
972
987
  if (Array.isArray(attrs)) {
@@ -991,14 +1006,14 @@ var exclAttribute = function exclAttribute(_ref5) {
991
1006
  * @param {name} [string] - 导出文件名
992
1007
  * @param {numbers} [boolean] - 序号
993
1008
  **/
994
- var exportXls = function exportXls(_ref6) {
995
- var _ref6$thead = _ref6.thead,
996
- thead = _ref6$thead === undefined ? [] : _ref6$thead,
997
- _ref6$data = _ref6.data,
998
- data = _ref6$data === undefined ? [] : _ref6$data,
999
- name = _ref6.name,
1000
- numbers = _ref6.numbers,
1001
- option = _ref6.option;
1009
+ var exportXls = function exportXls(_ref7) {
1010
+ var _ref7$thead = _ref7.thead,
1011
+ thead = _ref7$thead === undefined ? [] : _ref7$thead,
1012
+ _ref7$data = _ref7.data,
1013
+ data = _ref7$data === undefined ? [] : _ref7$data,
1014
+ name = _ref7.name,
1015
+ numbers = _ref7.numbers,
1016
+ option = _ref7.option;
1002
1017
 
1003
1018
  var tbody = '';
1004
1019
  var aligns = [];
@@ -1047,15 +1062,15 @@ var exportXls = function exportXls(_ref6) {
1047
1062
  var _loop2 = function _loop2(_i5) {
1048
1063
  tbody += '<tr>';
1049
1064
 
1050
- var _loop3 = function _loop3(_x2) {
1065
+ var _loop3 = function _loop3(_x3) {
1051
1066
  var field = '';
1052
- var valueKey = keys[fields[_x2]] && keys[fields[_x2]].valueKey ? keys[fields[_x2]].valueKey : 'value';
1053
- var labelKey = keys[fields[_x2]] && keys[fields[_x2]].labelKey ? keys[fields[_x2]].labelKey : 'name';
1054
- if (option[fields[_x2]]) {
1055
- if (Array.isArray(data[_i5][fields[_x2]])) {
1067
+ var valueKey = keys[fields[_x3]] && keys[fields[_x3]].valueKey ? keys[fields[_x3]].valueKey : 'value';
1068
+ var labelKey = keys[fields[_x3]] && keys[fields[_x3]].labelKey ? keys[fields[_x3]].labelKey : 'name';
1069
+ if (option[fields[_x3]]) {
1070
+ if (Array.isArray(data[_i5][fields[_x3]])) {
1056
1071
  field = [];
1057
- data[_i5][fields[_x2]].forEach(function (ele) {
1058
- option[fields[_x2]].forEach(function (item) {
1072
+ data[_i5][fields[_x3]].forEach(function (ele) {
1073
+ option[fields[_x3]].forEach(function (item) {
1059
1074
  // eslint-disable-next-line eqeqeq
1060
1075
  if (item[valueKey] == ele) {
1061
1076
  field.push(item[labelKey]);
@@ -1064,10 +1079,10 @@ var exportXls = function exportXls(_ref6) {
1064
1079
  });
1065
1080
  });
1066
1081
  field = field.join(' ');
1067
- } else if (typeof data[_i5][fields[_x2]] === 'string' && keys[fields[_x2]] && keys[fields[_x2]].multiple) {
1082
+ } else if (typeof data[_i5][fields[_x3]] === 'string' && keys[fields[_x3]] && keys[fields[_x3]].multiple) {
1068
1083
  field = [];
1069
- data[_i5][fields[_x2]].split(',').forEach(function (ele) {
1070
- option[fields[_x2]].forEach(function (item) {
1084
+ data[_i5][fields[_x3]].split(',').forEach(function (ele) {
1085
+ option[fields[_x3]].forEach(function (item) {
1071
1086
  // eslint-disable-next-line eqeqeq
1072
1087
  if (item[valueKey] == ele) {
1073
1088
  field.push(item[labelKey]);
@@ -1077,32 +1092,32 @@ var exportXls = function exportXls(_ref6) {
1077
1092
  });
1078
1093
  field = field.join(' ');
1079
1094
  } else {
1080
- option[fields[_x2]].forEach(function (item) {
1095
+ option[fields[_x3]].forEach(function (item) {
1081
1096
  // eslint-disable-next-line eqeqeq
1082
- if (item[valueKey] == data[_i5][fields[_x2]]) {
1097
+ if (item[valueKey] == data[_i5][fields[_x3]]) {
1083
1098
  field = item[labelKey];
1084
1099
  return;
1085
1100
  }
1086
1101
  });
1087
1102
  }
1088
- } else if (_typeof(data[_i5][fields[_x2]]) === 'object' && keys[fields[_x2]]) {
1089
- if (Array.isArray(data[_i5][fields[_x2]])) {
1090
- data[_i5][fields[_x2]].forEach(function (item) {
1103
+ } else if (_typeof(data[_i5][fields[_x3]]) === 'object' && keys[fields[_x3]]) {
1104
+ if (Array.isArray(data[_i5][fields[_x3]])) {
1105
+ data[_i5][fields[_x3]].forEach(function (item) {
1091
1106
  field = [];
1092
1107
  field.push({}.toString.call(item) === '[object Object]' ? item[labelKey] : item);
1093
1108
  });
1094
1109
  field = field.join(' ');
1095
1110
  } else {
1096
- field = data[_i5][fields[_x2]][labelKey];
1111
+ field = data[_i5][fields[_x3]][labelKey];
1097
1112
  }
1098
1113
  } else {
1099
- field = data[_i5][fields[_x2]];
1114
+ field = data[_i5][fields[_x3]];
1100
1115
  }
1101
- tbody += '<td align="' + aligns[_x2] + '">' + field + '</td>';
1116
+ tbody += '<td align="' + aligns[_x3] + '">' + field + '</td>';
1102
1117
  };
1103
1118
 
1104
- for (var _x2 in fields) {
1105
- _loop3(_x2);
1119
+ for (var _x3 in fields) {
1120
+ _loop3(_x3);
1106
1121
  }
1107
1122
  tbody += '</tr>';
1108
1123
  };
@@ -1986,11 +2001,11 @@ var hsvTorgb = function hsvTorgb($h, $s, $v) {
1986
2001
  * @param {value} [array] - 需要对比的值的数组集合
1987
2002
  * @param {callback} [function] - 回调函数
1988
2003
  **/
1989
- var identical = function identical(_ref7) {
1990
- var value = _ref7.value,
1991
- callback = _ref7.callback,
1992
- _ref7$msg = _ref7.msg,
1993
- msg = _ref7$msg === undefined ? ['请输入值', '请再次输入', '输入不一致!'] : _ref7$msg;
2004
+ var identical = function identical(_ref8) {
2005
+ var value = _ref8.value,
2006
+ callback = _ref8.callback,
2007
+ _ref8$msg = _ref8.msg,
2008
+ msg = _ref8$msg === undefined ? ['请输入值', '请再次输入', '输入不一致!'] : _ref8$msg;
1994
2009
 
1995
2010
  if (value && value.length > 1) {
1996
2011
  var val = value[0];
@@ -2127,15 +2142,15 @@ var isFunction = function isFunction(obj) {
2127
2142
  * @param {sting} [loginPage] - 第三方登录页面地址
2128
2143
  * @param {boolean} [redirect] - 是否重定向(用于新脚手架)
2129
2144
  **/
2130
- var isLogined = function isLogined(_ref8) {
2131
- var to = _ref8.to,
2132
- from = _ref8.from,
2133
- next = _ref8.next,
2134
- _ref8$exclude = _ref8.exclude,
2135
- exclude = _ref8$exclude === undefined ? [] : _ref8$exclude,
2136
- cookie = _ref8.cookie,
2137
- loginPage = _ref8.loginPage,
2138
- redirect = _ref8.redirect;
2145
+ var isLogined = function isLogined(_ref9) {
2146
+ var to = _ref9.to,
2147
+ from = _ref9.from,
2148
+ next = _ref9.next,
2149
+ _ref9$exclude = _ref9.exclude,
2150
+ exclude = _ref9$exclude === undefined ? [] : _ref9$exclude,
2151
+ cookie = _ref9.cookie,
2152
+ loginPage = _ref9.loginPage,
2153
+ redirect = _ref9.redirect;
2139
2154
 
2140
2155
  if (cookie === undefined) {
2141
2156
  cookie = getParams({ name: 'cookie' });
@@ -2363,9 +2378,9 @@ var isObjectEqual = function isObjectEqual(obj, _obj) {
2363
2378
  * @param {string/array} [url] - 地址
2364
2379
  * @param {boolean} [single] - 是否做js沙箱隔离
2365
2380
  **/
2366
- var jointUrl = function jointUrl(_ref9) {
2367
- var url = _ref9.url,
2368
- reg = _ref9.reg;
2381
+ var jointUrl = function jointUrl(_ref10) {
2382
+ var url = _ref10.url,
2383
+ reg = _ref10.reg;
2369
2384
 
2370
2385
  if (startWith(url, ['https', 'http', 'blob:'], true) || !reg || !reg.length) {
2371
2386
  return url;
@@ -2380,13 +2395,13 @@ var jointUrl = function jointUrl(_ref9) {
2380
2395
  return startWith(url, reg) ? url : reg + url;
2381
2396
  };
2382
2397
 
2383
- var loadJs = function loadJs(_ref10) {
2384
- var url = _ref10.url,
2385
- _ref10$type = _ref10.type,
2386
- type = _ref10$type === undefined ? 'text/javascript' : _ref10$type,
2387
- id = _ref10.id,
2388
- _ref10$single = _ref10.single,
2389
- single = _ref10$single === undefined ? true : _ref10$single;
2398
+ var loadJs = function loadJs(_ref11) {
2399
+ var url = _ref11.url,
2400
+ _ref11$type = _ref11.type,
2401
+ type = _ref11$type === undefined ? 'text/javascript' : _ref11$type,
2402
+ id = _ref11.id,
2403
+ _ref11$single = _ref11.single,
2404
+ single = _ref11$single === undefined ? true : _ref11$single;
2390
2405
 
2391
2406
  return new Promise(function (resolve, reject) {
2392
2407
  var script = document.getElementById(id) || document.createElement('script');
@@ -2521,11 +2536,11 @@ var queryParams = function queryParams(obj) {
2521
2536
  * @param {string} [url] - 消息源的 URI
2522
2537
  * @param {function} [callback] - 回调函数
2523
2538
  **/
2524
- var receiveMessage = function receiveMessage(_ref11) {
2525
- var _ref11$data = _ref11.data,
2526
- data = _ref11$data === undefined ? {} : _ref11$data,
2527
- url = _ref11.url,
2528
- callback = _ref11.callback;
2539
+ var receiveMessage = function receiveMessage(_ref12) {
2540
+ var _ref12$data = _ref12.data,
2541
+ data = _ref12$data === undefined ? {} : _ref12$data,
2542
+ url = _ref12.url,
2543
+ callback = _ref12.callback;
2529
2544
 
2530
2545
  win.addEventListener('message', function (e) {
2531
2546
  if (url !== undefined) {
@@ -2569,9 +2584,9 @@ var removeStorage = function removeStorage(key) {
2569
2584
  * @param {string、number} [data] - 数字或字符串型数字
2570
2585
  * @param {number} [precision] - 需要的小数位数
2571
2586
  **/
2572
- var replenish = function replenish(_ref12) {
2573
- var data = _ref12.data,
2574
- precision = _ref12.precision;
2587
+ var replenish = function replenish(_ref13) {
2588
+ var data = _ref13.data,
2589
+ precision = _ref13.precision;
2575
2590
 
2576
2591
  if (data && precision && precision > 0) {
2577
2592
  var power = Math.pow(10, precision);
@@ -2717,10 +2732,10 @@ var setScale = function setScale() {
2717
2732
  * @param {object} [data] - 数据---其中type必须表示操作类型
2718
2733
  * @param {string} [url] - 指定的消息发送URI地址
2719
2734
  **/
2720
- var sendMessage = function sendMessage(_ref13) {
2721
- var _ref13$data = _ref13.data,
2722
- data = _ref13$data === undefined ? {} : _ref13$data,
2723
- url = _ref13.url;
2735
+ var sendMessage = function sendMessage(_ref14) {
2736
+ var _ref14$data = _ref14.data,
2737
+ data = _ref14$data === undefined ? {} : _ref14$data,
2738
+ url = _ref14.url;
2724
2739
 
2725
2740
  var iframes = document.getElementsByTagName('iframe');
2726
2741
  for (var i = 0; i < iframes.length; i++) {
@@ -2764,10 +2779,10 @@ var setFavicon = function setFavicon(url) {
2764
2779
  * @param {String, Array, Object} [key] - 数据的名称,array类型表示多个key保存同一个value,object类型时对象的属性名称作为key属性值作为value
2765
2780
  * @param {String} [value] - 数据的值
2766
2781
  **/
2767
- var setStorage = function setStorage(_ref14) {
2768
- var type = _ref14.type,
2769
- key = _ref14.key,
2770
- value = _ref14.value;
2782
+ var setStorage = function setStorage(_ref15) {
2783
+ var type = _ref15.type,
2784
+ key = _ref15.key,
2785
+ value = _ref15.value;
2771
2786
 
2772
2787
  if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
2773
2788
  value = JSON.stringify(value);
@@ -3061,10 +3076,10 @@ var upperCase = function upperCase(text) {
3061
3076
  * @param {Object} [url] - url地址
3062
3077
  * @param {Object} [param] - 被转换的对象
3063
3078
  **/
3064
- var urlJoinParams = function urlJoinParams(_ref15) {
3065
- var url = _ref15.url,
3066
- param = _ref15.param,
3067
- timestamp = _ref15.timestamp;
3079
+ var urlJoinParams = function urlJoinParams(_ref16) {
3080
+ var url = _ref16.url,
3081
+ param = _ref16.param,
3082
+ timestamp = _ref16.timestamp;
3068
3083
 
3069
3084
  var arry = decodeURI(url).split('?');
3070
3085
  var times = new Date().getTime();
@@ -3185,6 +3200,7 @@ var watermark = function watermark(option) {
3185
3200
  arrUnique: arrUnique,
3186
3201
  average: average,
3187
3202
  browser: browser,
3203
+ busEmit: busEmit,
3188
3204
  calculateNetworkDays: calculateNetworkDays,
3189
3205
  concatenate: concatenate,
3190
3206
  dateAddDays: dateAddDays,