eoss-ui 0.5.74 → 0.5.76

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 (72) hide show
  1. package/lib/button-group.js +125 -23
  2. package/lib/button.js +125 -23
  3. package/lib/checkbox-group.js +125 -23
  4. package/lib/data-table-form.js +125 -23
  5. package/lib/data-table.js +155 -40
  6. package/lib/date-picker.js +125 -23
  7. package/lib/dialog.js +125 -23
  8. package/lib/eoss-ui.common.js +520 -296
  9. package/lib/flow-group.js +125 -23
  10. package/lib/flow-list.js +136 -31
  11. package/lib/flow.js +125 -23
  12. package/lib/form.js +125 -23
  13. package/lib/handle-user.js +125 -23
  14. package/lib/handler.js +125 -23
  15. package/lib/index.js +1 -1
  16. package/lib/input-number.js +124 -22
  17. package/lib/input.js +141 -29
  18. package/lib/login.js +293 -143
  19. package/lib/main.js +125 -23
  20. package/lib/nav.js +125 -23
  21. package/lib/page.js +125 -23
  22. package/lib/player.js +125 -23
  23. package/lib/qr-code.js +178 -59
  24. package/lib/radio-group.js +125 -23
  25. package/lib/retrial-auth.js +125 -23
  26. package/lib/select-ganged.js +125 -23
  27. package/lib/select.js +140 -28
  28. package/lib/selector-panel.js +125 -23
  29. package/lib/selector.js +125 -23
  30. package/lib/sizer.js +125 -23
  31. package/lib/steps.js +125 -23
  32. package/lib/switch.js +124 -22
  33. package/lib/table-form.js +125 -23
  34. package/lib/tabs.js +125 -23
  35. package/lib/theme-chalk/base.css +1 -1
  36. package/lib/theme-chalk/index.css +1 -1
  37. package/lib/theme-chalk/login.css +1 -1
  38. package/lib/theme-chalk/main.css +1 -1
  39. package/lib/theme-chalk/menu.css +1 -1
  40. package/lib/theme-chalk/sizer.css +1 -1
  41. package/lib/theme-chalk/upload.css +1 -1
  42. package/lib/tips.js +125 -23
  43. package/lib/toolbar.js +3 -2
  44. package/lib/tree-group.js +159 -57
  45. package/lib/tree.js +140 -26
  46. package/lib/upload.js +125 -23
  47. package/lib/utils/util.js +124 -22
  48. package/lib/wujie.js +125 -23
  49. package/lib/wxlogin.js +152 -34
  50. package/package.json +2 -2
  51. package/packages/data-table/src/main.vue +25 -15
  52. package/packages/flow-list/src/main.vue +63 -41
  53. package/packages/input/src/main.vue +7 -6
  54. package/packages/login/src/main.vue +42 -14
  55. package/packages/qr-code/src/main.vue +48 -37
  56. package/packages/select/src/main.vue +6 -5
  57. package/packages/theme-chalk/lib/base.css +1 -1
  58. package/packages/theme-chalk/lib/index.css +1 -1
  59. package/packages/theme-chalk/lib/login.css +1 -1
  60. package/packages/theme-chalk/lib/main.css +1 -1
  61. package/packages/theme-chalk/lib/menu.css +1 -1
  62. package/packages/theme-chalk/lib/sizer.css +1 -1
  63. package/packages/theme-chalk/lib/upload.css +1 -1
  64. package/packages/theme-chalk/src/base.scss +3 -0
  65. package/packages/theme-chalk/src/login.scss +862 -376
  66. package/packages/theme-chalk/src/main.scss +5 -2
  67. package/packages/toolbar/src/main.vue +16 -6
  68. package/packages/tree/src/main.vue +13 -1
  69. package/packages/tree-group/src/main.vue +24 -37
  70. package/packages/wxlogin/src/main.vue +30 -12
  71. package/src/index.js +1 -1
  72. package/src/utils/util.js +138 -23
@@ -621,6 +621,35 @@ var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
621
621
  return workdays;
622
622
  };
623
623
 
624
+ /**
625
+ * chunkToChinese
626
+ * @desc 将四位数的整数转换为中文大写
627
+ * @param {number} chunk - 数字
628
+ **/
629
+ function chunkToChinese(chunk) {
630
+ var numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
631
+ var capitalDigits = ['', '拾', '佰', '仟'];
632
+
633
+ var result = '';
634
+ var digitIndex = 0;
635
+
636
+ while (chunk > 0) {
637
+ var digit = chunk % 10;
638
+ if (digit > 0) {
639
+ result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
640
+ } else {
641
+ // 当前数字是零,需要判断是否需要添加零
642
+ if (result.charAt(0) !== '零') {
643
+ result = '零' + result;
644
+ }
645
+ }
646
+ chunk = Math.floor(chunk / 10);
647
+ digitIndex++;
648
+ }
649
+
650
+ return result;
651
+ }
652
+
624
653
  /**
625
654
  * concatenate
626
655
  * @desc 指定连接符合并文本
@@ -1816,6 +1845,31 @@ var getWeekday = function getWeekday(date) {
1816
1845
  return adjustedDay === 0 ? 7 : adjustedDay;
1817
1846
  };
1818
1847
 
1848
+ /**
1849
+ * getZoom
1850
+ * @desc 获取缩放比
1851
+ * @param {number} n - 可选参数,表示星期的起始日,0 表示星期天,1 表示星期一,以此类推,默认为 0
1852
+ **/
1853
+ var getZoom = function getZoom() {
1854
+ var ratio = 0;
1855
+ var screen = window.screen;
1856
+ var ua = navigator.userAgent.toLowerCase();
1857
+ if (window.devicePixelRatio !== undefined) {
1858
+ ratio = window.devicePixelRatio;
1859
+ } else if (~ua.indexOf('msie')) {
1860
+ if (screen.deviceXDPI && screen.logicalXDPI) {
1861
+ ratio = screen.deviceXDPI / screen.logicalXDPI;
1862
+ }
1863
+ } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
1864
+ ratio = window.outerWidth / window.innerWidth;
1865
+ }
1866
+
1867
+ if (ratio) {
1868
+ ratio = Math.round(ratio * 100);
1869
+ }
1870
+
1871
+ return ratio / 100;
1872
+ };
1819
1873
  /**
1820
1874
  * handlerUrl
1821
1875
  * @desc:更新url参数中的时间戳
@@ -2250,6 +2304,31 @@ var isObject = function isObject(obj) {
2250
2304
  return typeof Ctor === 'function' && Object.prototype.hasOwnProperty.toString.call(Ctor) === ObjectFunctionString;
2251
2305
  };
2252
2306
 
2307
+ /**
2308
+ * isObjectEqual
2309
+ * @desc:判断对象是否相等
2310
+ * @author huangbo
2311
+ * @date 2022年5月7日
2312
+ * @param {Object} [obj] - 对象
2313
+ * @param {Object} [_obj] - 对象
2314
+ **/
2315
+ var isObjectEqual = function isObjectEqual(obj, _obj) {
2316
+ if (obj === undefined && _obj || obj && _obj === undefined) {
2317
+ return false;
2318
+ }
2319
+ var aProps = Object.getOwnPropertyNames(obj);
2320
+ var bProps = Object.getOwnPropertyNames(_obj);
2321
+ if (aProps.length !== bProps.length) {
2322
+ return false;
2323
+ }
2324
+ for (var i in obj) {
2325
+ if (obj[i] !== _obj[i]) {
2326
+ return false;
2327
+ }
2328
+ }
2329
+ return true;
2330
+ };
2331
+
2253
2332
  /**
2254
2333
  * jointUrl
2255
2334
  * @desc:判断url地址是否以字符开头,没有则添加
@@ -2558,32 +2637,53 @@ var rmbToCapital = function rmbToCapital(number) {
2558
2637
 
2559
2638
  return result;
2560
2639
  };
2640
+ /**
2641
+ * setScale
2642
+ * @desc 设置缩放
2643
+ * @param {number} width - 分辨率宽度
2644
+ * @param {number} height - 分辨率高度
2645
+ **/
2646
+ var setScale = function setScale() {
2647
+ var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1920;
2648
+ var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1080;
2561
2649
 
2562
- // 辅助函数,将四位数的整数转换为中文大写
2563
- function chunkToChinese(chunk) {
2564
- var numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
2565
- var capitalDigits = ['', '拾', '佰', '仟'];
2566
-
2567
- var result = '';
2568
- var digitIndex = 0;
2569
-
2570
- while (chunk > 0) {
2571
- var digit = chunk % 10;
2572
- if (digit > 0) {
2573
- result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
2650
+ var n = 1;
2651
+ var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
2652
+ var zoom = getZoom();
2653
+ if (isMac) {
2654
+ n = 2;
2655
+ } else {
2656
+ n = 1;
2657
+ }
2658
+ if (zoom === 1) {
2659
+ document.body.style.removeProperty('transform');
2660
+ document.body.style.removeProperty('width');
2661
+ document.body.style.removeProperty('height');
2662
+ document.body.style.removeProperty('transform-origin');
2663
+ return;
2664
+ }
2665
+ if (Math.abs(parseInt(width - window.innerWidth * zoom / n, 10)) > 15 && window.innerWidth * zoom / n !== width) {
2666
+ var scale = 'scale(' + window.innerWidth * zoom / width / zoom + ',' + window.innerHeight * zoom / height / zoom + ')';
2667
+ document.body.style.transform = scale;
2668
+ document.body.style.width = width + 'px';
2669
+ document.body.style.height = height + 'px';
2670
+ document.body.style.transformOrigin = '0 0';
2671
+ } else {
2672
+ if (isMac) {
2673
+ var _scale = 'scale(' + 1 * n / zoom + ')';
2674
+ document.body.style.transform = _scale;
2675
+ document.body.style.width = parseInt(window.innerWidth * zoom / n, 10) + 'px';
2676
+ document.body.style.height = parseInt(window.innerHeight * zoom / n, 10) + 'px';
2677
+ document.body.style.transformOrigin = '0 0';
2574
2678
  } else {
2575
- // 当前数字是零,需要判断是否需要添加零
2576
- if (result.charAt(0) !== '零') {
2577
- result = '零' + result;
2578
- }
2679
+ var _scale2 = 'scale(' + 1 * n / zoom + ')';
2680
+ document.body.style.transform = _scale2;
2681
+ document.body.style.width = parseInt(window.innerWidth * zoom / n, 10) + 'px';
2682
+ document.body.style.height = parseInt(window.innerHeight * zoom / n, 10) + 'px';
2683
+ document.body.style.transformOrigin = '0 0';
2579
2684
  }
2580
- chunk = Math.floor(chunk / 10);
2581
- digitIndex++;
2582
2685
  }
2583
-
2584
- return result;
2585
- }
2586
-
2686
+ };
2587
2687
  /**
2588
2688
  * sendMessage
2589
2689
  * @desc:向iframe发送信息
@@ -3105,6 +3205,7 @@ var watermark = function watermark(option) {
3105
3205
  isLogged: isLogged,
3106
3206
  isLogined: isLogined,
3107
3207
  isObject: isObject,
3208
+ isObjectEqual: isObjectEqual,
3108
3209
  jointUrl: jointUrl,
3109
3210
  loadJs: loadJs,
3110
3211
  loading: loading,
@@ -3119,6 +3220,7 @@ var watermark = function watermark(option) {
3119
3220
  rmbToCapital: rmbToCapital,
3120
3221
  sendMessage: sendMessage,
3121
3222
  setFavicon: setFavicon,
3223
+ setScale: setScale,
3122
3224
  setStorage: setStorage,
3123
3225
  socket: socket,
3124
3226
  startWith: startWith,
package/lib/input.js CHANGED
@@ -621,6 +621,35 @@ var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
621
621
  return workdays;
622
622
  };
623
623
 
624
+ /**
625
+ * chunkToChinese
626
+ * @desc 将四位数的整数转换为中文大写
627
+ * @param {number} chunk - 数字
628
+ **/
629
+ function chunkToChinese(chunk) {
630
+ var numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
631
+ var capitalDigits = ['', '拾', '佰', '仟'];
632
+
633
+ var result = '';
634
+ var digitIndex = 0;
635
+
636
+ while (chunk > 0) {
637
+ var digit = chunk % 10;
638
+ if (digit > 0) {
639
+ result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
640
+ } else {
641
+ // 当前数字是零,需要判断是否需要添加零
642
+ if (result.charAt(0) !== '零') {
643
+ result = '零' + result;
644
+ }
645
+ }
646
+ chunk = Math.floor(chunk / 10);
647
+ digitIndex++;
648
+ }
649
+
650
+ return result;
651
+ }
652
+
624
653
  /**
625
654
  * concatenate
626
655
  * @desc 指定连接符合并文本
@@ -1816,6 +1845,31 @@ var getWeekday = function getWeekday(date) {
1816
1845
  return adjustedDay === 0 ? 7 : adjustedDay;
1817
1846
  };
1818
1847
 
1848
+ /**
1849
+ * getZoom
1850
+ * @desc 获取缩放比
1851
+ * @param {number} n - 可选参数,表示星期的起始日,0 表示星期天,1 表示星期一,以此类推,默认为 0
1852
+ **/
1853
+ var getZoom = function getZoom() {
1854
+ var ratio = 0;
1855
+ var screen = window.screen;
1856
+ var ua = navigator.userAgent.toLowerCase();
1857
+ if (window.devicePixelRatio !== undefined) {
1858
+ ratio = window.devicePixelRatio;
1859
+ } else if (~ua.indexOf('msie')) {
1860
+ if (screen.deviceXDPI && screen.logicalXDPI) {
1861
+ ratio = screen.deviceXDPI / screen.logicalXDPI;
1862
+ }
1863
+ } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
1864
+ ratio = window.outerWidth / window.innerWidth;
1865
+ }
1866
+
1867
+ if (ratio) {
1868
+ ratio = Math.round(ratio * 100);
1869
+ }
1870
+
1871
+ return ratio / 100;
1872
+ };
1819
1873
  /**
1820
1874
  * handlerUrl
1821
1875
  * @desc:更新url参数中的时间戳
@@ -2250,6 +2304,31 @@ var isObject = function isObject(obj) {
2250
2304
  return typeof Ctor === 'function' && Object.prototype.hasOwnProperty.toString.call(Ctor) === ObjectFunctionString;
2251
2305
  };
2252
2306
 
2307
+ /**
2308
+ * isObjectEqual
2309
+ * @desc:判断对象是否相等
2310
+ * @author huangbo
2311
+ * @date 2022年5月7日
2312
+ * @param {Object} [obj] - 对象
2313
+ * @param {Object} [_obj] - 对象
2314
+ **/
2315
+ var isObjectEqual = function isObjectEqual(obj, _obj) {
2316
+ if (obj === undefined && _obj || obj && _obj === undefined) {
2317
+ return false;
2318
+ }
2319
+ var aProps = Object.getOwnPropertyNames(obj);
2320
+ var bProps = Object.getOwnPropertyNames(_obj);
2321
+ if (aProps.length !== bProps.length) {
2322
+ return false;
2323
+ }
2324
+ for (var i in obj) {
2325
+ if (obj[i] !== _obj[i]) {
2326
+ return false;
2327
+ }
2328
+ }
2329
+ return true;
2330
+ };
2331
+
2253
2332
  /**
2254
2333
  * jointUrl
2255
2334
  * @desc:判断url地址是否以字符开头,没有则添加
@@ -2558,32 +2637,53 @@ var rmbToCapital = function rmbToCapital(number) {
2558
2637
 
2559
2638
  return result;
2560
2639
  };
2561
-
2562
- // 辅助函数,将四位数的整数转换为中文大写
2563
- function chunkToChinese(chunk) {
2564
- var numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
2565
- var capitalDigits = ['', '拾', '佰', '仟'];
2566
-
2567
- var result = '';
2568
- var digitIndex = 0;
2569
-
2570
- while (chunk > 0) {
2571
- var digit = chunk % 10;
2572
- if (digit > 0) {
2573
- result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
2640
+ /**
2641
+ * setScale
2642
+ * @desc 设置缩放
2643
+ * @param {number} width - 分辨率宽度
2644
+ * @param {number} height - 分辨率高度
2645
+ **/
2646
+ var setScale = function setScale() {
2647
+ var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1920;
2648
+ var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1080;
2649
+
2650
+ var n = 1;
2651
+ var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
2652
+ var zoom = getZoom();
2653
+ if (isMac) {
2654
+ n = 2;
2655
+ } else {
2656
+ n = 1;
2657
+ }
2658
+ if (zoom === 1) {
2659
+ document.body.style.removeProperty('transform');
2660
+ document.body.style.removeProperty('width');
2661
+ document.body.style.removeProperty('height');
2662
+ document.body.style.removeProperty('transform-origin');
2663
+ return;
2664
+ }
2665
+ if (Math.abs(parseInt(width - window.innerWidth * zoom / n, 10)) > 15 && window.innerWidth * zoom / n !== width) {
2666
+ var scale = 'scale(' + window.innerWidth * zoom / width / zoom + ',' + window.innerHeight * zoom / height / zoom + ')';
2667
+ document.body.style.transform = scale;
2668
+ document.body.style.width = width + 'px';
2669
+ document.body.style.height = height + 'px';
2670
+ document.body.style.transformOrigin = '0 0';
2671
+ } else {
2672
+ if (isMac) {
2673
+ var _scale = 'scale(' + 1 * n / zoom + ')';
2674
+ document.body.style.transform = _scale;
2675
+ document.body.style.width = parseInt(window.innerWidth * zoom / n, 10) + 'px';
2676
+ document.body.style.height = parseInt(window.innerHeight * zoom / n, 10) + 'px';
2677
+ document.body.style.transformOrigin = '0 0';
2574
2678
  } else {
2575
- // 当前数字是零,需要判断是否需要添加零
2576
- if (result.charAt(0) !== '零') {
2577
- result = '零' + result;
2578
- }
2679
+ var _scale2 = 'scale(' + 1 * n / zoom + ')';
2680
+ document.body.style.transform = _scale2;
2681
+ document.body.style.width = parseInt(window.innerWidth * zoom / n, 10) + 'px';
2682
+ document.body.style.height = parseInt(window.innerHeight * zoom / n, 10) + 'px';
2683
+ document.body.style.transformOrigin = '0 0';
2579
2684
  }
2580
- chunk = Math.floor(chunk / 10);
2581
- digitIndex++;
2582
2685
  }
2583
-
2584
- return result;
2585
- }
2586
-
2686
+ };
2587
2687
  /**
2588
2688
  * sendMessage
2589
2689
  * @desc:向iframe发送信息
@@ -3105,6 +3205,7 @@ var watermark = function watermark(option) {
3105
3205
  isLogged: isLogged,
3106
3206
  isLogined: isLogined,
3107
3207
  isObject: isObject,
3208
+ isObjectEqual: isObjectEqual,
3108
3209
  jointUrl: jointUrl,
3109
3210
  loadJs: loadJs,
3110
3211
  loading: loading,
@@ -3119,6 +3220,7 @@ var watermark = function watermark(option) {
3119
3220
  rmbToCapital: rmbToCapital,
3120
3221
  sendMessage: sendMessage,
3121
3222
  setFavicon: setFavicon,
3223
+ setScale: setScale,
3122
3224
  setStorage: setStorage,
3123
3225
  socket: socket,
3124
3226
  startWith: startWith,
@@ -3824,6 +3926,8 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
3824
3926
 
3825
3927
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
3826
3928
 
3929
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
3930
+
3827
3931
 
3828
3932
 
3829
3933
 
@@ -4056,26 +4160,34 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
4056
4160
  }, [content]);
4057
4161
  }
4058
4162
  }
4163
+
4164
+ var _$attrs = this.$attrs,
4165
+ prefix = _$attrs.prefix,
4166
+ suffix = _$attrs.suffix,
4167
+ prepend = _$attrs.prepend,
4168
+ append = _$attrs.append,
4169
+ attrs = _objectWithoutProperties(_$attrs, ['prefix', 'suffix', 'prepend', 'append']);
4170
+
4059
4171
  if (this.$slots.prefix) {
4060
4172
  doms.push(h('template', { slot: 'prefix' }, this.$slots.prefix));
4061
- } else if (this.$attrs.prefix) {
4173
+ } else if (prefix) {
4062
4174
  this.renderd(doms, h, 'prefix');
4063
4175
  cls.push('es-input-button-prefix');
4064
4176
  }
4065
4177
  if (this.$slots.suffix) {
4066
4178
  doms.push(h('template', { slot: 'suffix' }, this.$slots.suffix));
4067
- } else if (this.$attrs.suffix) {
4179
+ } else if (suffix) {
4068
4180
  this.renderd(doms, h, 'suffix');
4069
4181
  cls.push('es-input-button-suffix');
4070
4182
  }
4071
4183
  if (this.$slots.prepend) {
4072
4184
  doms.push(h('template', { slot: 'prepend' }, this.$slots.prepend));
4073
- } else if (this.$attrs.prepend) {
4185
+ } else if (prepend) {
4074
4186
  this.renderd(doms, h, 'prepend');
4075
4187
  }
4076
4188
  if (this.$slots.append) {
4077
4189
  doms.push(h('template', { slot: 'append' }, this.$slots.append));
4078
- } else if (this.$attrs.append) {
4190
+ } else if (append) {
4079
4191
  this.renderd(doms, h, 'append');
4080
4192
  }
4081
4193
  if (this.fetchSuggestions || this.url || this.data.length > 0) {
@@ -4084,7 +4196,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
4084
4196
  props: {
4085
4197
  rules: this.rule
4086
4198
  },
4087
- attrs: _extends({}, this.$attrs, {
4199
+ attrs: _extends({}, attrs, {
4088
4200
  fetchSuggestions: this.fetchSuggestions ? this.fetchSuggestions : this.getData,
4089
4201
  triggerOnFocus: this.focusShow,
4090
4202
  value: this.model
@@ -4102,7 +4214,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
4102
4214
  domProps: {
4103
4215
  value: this.model
4104
4216
  },
4105
- attrs: _extends({}, this.$attrs),
4217
+ attrs: _extends({}, attrs),
4106
4218
  on: _extends({}, this.$listeners),
4107
4219
  directives: [{
4108
4220
  name: 'show',