@mdsfe/mds-ui 0.2.11-rc.8 → 0.3.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 (128) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/_locale/default.js +18 -0
  3. package/dist/_locale/format.js +54 -0
  4. package/dist/_locale/index.js +56 -6
  5. package/dist/_locale/lang/en.js +144 -0
  6. package/dist/_locale/{zh-CN.js → lang/zh-CN.js} +22 -3
  7. package/dist/_mixin/locale.js +1 -1
  8. package/dist/_util/iconfont/index.js +12 -13
  9. package/dist/_util/util.js +7 -0
  10. package/dist/affix.js +6 -6
  11. package/dist/alert.js +6 -6
  12. package/dist/anchor.js +6 -6
  13. package/dist/avatar.js +17 -8
  14. package/dist/backtop.js +11 -11
  15. package/dist/badge.js +17 -17
  16. package/dist/bordershadow.js +6 -6
  17. package/dist/breadcrumb.js +6 -6
  18. package/dist/button.js +6 -6
  19. package/dist/card.js +6 -6
  20. package/dist/carousel.js +80 -80
  21. package/dist/cascader.js +96 -61
  22. package/dist/cascaderpanel.js +54 -29
  23. package/dist/checkbox.js +10 -10
  24. package/dist/col.js +10 -10
  25. package/dist/collapse.js +6 -6
  26. package/dist/color.js +6 -6
  27. package/dist/datepicker.js +287 -280
  28. package/dist/divider.js +6 -6
  29. package/dist/drawer.js +20 -20
  30. package/dist/dropdown.js +19 -19
  31. package/dist/empty.js +31 -14
  32. package/dist/font/iconfont.06f3ab6.woff2 +0 -0
  33. package/dist/font/{iconfont.78779fe.ttf → iconfont.3bffbc2.ttf} +0 -0
  34. package/dist/font/iconfont.dd6d5df.woff +0 -0
  35. package/dist/font.js +6 -6
  36. package/dist/form.js +14 -14
  37. package/dist/icon.js +6 -6
  38. package/dist/index.js +1 -1
  39. package/dist/input.js +16 -16
  40. package/dist/inputnumber.js +13 -13
  41. package/dist/layout.js +6 -6
  42. package/dist/list.js +6 -6
  43. package/dist/loading.js +6 -6
  44. package/dist/mds-ui.min.css +1 -1
  45. package/dist/mds-ui.min.js +1884 -1386
  46. package/dist/menu.js +18 -18
  47. package/dist/message.js +10 -10
  48. package/dist/modal.js +60 -38
  49. package/dist/notification.js +20 -20
  50. package/dist/pagination.js +75 -35
  51. package/dist/popconfirm.js +561 -31
  52. package/dist/popover.js +27 -27
  53. package/dist/progress.js +6 -6
  54. package/dist/radio.js +10 -10
  55. package/dist/rate.js +10 -10
  56. package/dist/row.js +10 -10
  57. package/dist/select.js +99 -79
  58. package/dist/slider.js +58 -37
  59. package/dist/slottable.js +75 -50
  60. package/dist/steps.js +6 -6
  61. package/dist/style/affix.css +299 -2
  62. package/dist/style/alert.css +299 -2
  63. package/dist/style/anchor.css +299 -2
  64. package/dist/style/avatar.css +299 -2
  65. package/dist/style/badge.css +299 -2
  66. package/dist/style/bordershadow.css +299 -2
  67. package/dist/style/breadcrumb.css +299 -2
  68. package/dist/style/button.css +299 -2
  69. package/dist/style/card.css +299 -2
  70. package/dist/style/carousel.css +299 -2
  71. package/dist/style/checkbox.css +299 -2
  72. package/dist/style/col.css +299 -2
  73. package/dist/style/collapse.css +299 -2
  74. package/dist/style/color.css +299 -2
  75. package/dist/style/datepicker.css +299 -2
  76. package/dist/style/divider.css +299 -2
  77. package/dist/style/drawer.css +299 -2
  78. package/dist/style/dropdown.css +299 -2
  79. package/dist/style/empty.css +299 -2
  80. package/dist/style/font.css +299 -2
  81. package/dist/style/form.css +299 -2
  82. package/dist/style/icon.css +299 -2
  83. package/dist/style/input.css +299 -2
  84. package/dist/style/inputnumber.css +299 -2
  85. package/dist/style/layout.css +299 -2
  86. package/dist/style/list.css +299 -2
  87. package/dist/style/loading.css +299 -2
  88. package/dist/style/menu.css +299 -2
  89. package/dist/style/modal.css +299 -2
  90. package/dist/style/notification.css +299 -2
  91. package/dist/style/pagination.css +299 -2
  92. package/dist/style/popconfirm.css +299 -2
  93. package/dist/style/popover.css +299 -2
  94. package/dist/style/progress.css +299 -2
  95. package/dist/style/radio.css +299 -2
  96. package/dist/style/rate.css +299 -2
  97. package/dist/style/row.css +299 -2
  98. package/dist/style/select.css +299 -2
  99. package/dist/style/slider.css +299 -2
  100. package/dist/style/slottable.css +299 -2
  101. package/dist/style/steps.css +299 -2
  102. package/dist/style/switch.css +299 -2
  103. package/dist/style/table.css +299 -2
  104. package/dist/style/tabs.css +299 -2
  105. package/dist/style/tag.css +299 -2
  106. package/dist/style/text.css +299 -2
  107. package/dist/style/timeline.css +299 -2
  108. package/dist/style/timepicker.css +299 -2
  109. package/dist/style/tooltip.css +299 -2
  110. package/dist/style/tree.css +299 -2
  111. package/dist/style/typography.css +299 -2
  112. package/dist/style/upload.css +299 -2
  113. package/dist/switch.js +10 -10
  114. package/dist/table.js +261 -166
  115. package/dist/tabs.js +6 -6
  116. package/dist/tag.js +6 -6
  117. package/dist/text.js +681 -681
  118. package/dist/timeline.js +6 -6
  119. package/dist/timepicker.js +571 -41
  120. package/dist/tooltip.js +25 -25
  121. package/dist/transfer.js +48 -34
  122. package/dist/transition.js +4 -4
  123. package/dist/tree.js +77 -77
  124. package/dist/typography.js +6 -6
  125. package/dist/upload.js +60 -32
  126. package/package.json +4 -2
  127. package/dist/font/iconfont.7f549f9.woff +0 -0
  128. package/dist/font/iconfont.9a16feb.woff2 +0 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,23 @@
1
- ## [0.2.10](http://igit.58corp.com/matrix/mds-ui/compare/v0.2.9...v0.2.10) (2023-04-09)
1
+ ## [0.3.0](http://igit.58corp.com/matrix/mds-ui/compare/v0.2.10...v0.3.0) (2024-09-21)
2
+
3
+ ### Features
4
+
5
+ * 🎸 新增 国际化引用能力,支持切换语言【中/英】
6
+ * 🎸 扩展 Icon图标库
7
+ * 增加彩色风格文件类型图标
8
+ * 增加数据业务定义图标
9
+
10
+ ### Bug Fixes
11
+
12
+ * 🐛 修复 Slider滑动输入条 可选参数`line`,选中态为短横线样式
13
+ * 🐛 修复 Pagination分页组件 `totalSeat`设置无效的的问题
14
+ * 🐛 修复 Dropdown下拉菜单 事件捕获的异常
15
+
16
+ ### Performance Improvements
17
+
18
+ * ⚡️ 优化文本按钮,支持嵌套文本标签用例
19
+
20
+ ## [0.2.10](http://igit.58corp.com/matrix/mds-ui/compare/v0.2.9...v0.2.10) (2024-04-09)
2
21
 
3
22
  ### Features
4
23
 
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+ exports.tfn = undefined;
5
+
6
+ var _zhCN = require('./lang/zh-CN.js');
7
+
8
+ var _zhCN2 = _interopRequireDefault(_zhCN);
9
+
10
+ var _util = require('../_util/util.js');
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var tfn = exports.tfn = function tfn(path) {
15
+ return (0, _util.getValueByPath)(_zhCN2.default, path, '');
16
+ };
17
+
18
+ exports.default = { tfn: tfn };
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _typeof2 = require('babel-runtime/helpers/typeof');
6
+
7
+ var _typeof3 = _interopRequireDefault(_typeof2);
8
+
9
+ exports.default = function (Vue) {
10
+ /**
11
+ * template
12
+ *
13
+ * @param {String} string
14
+ * @param {Array} ...args
15
+ * @return {String}
16
+ */
17
+
18
+ function template(string) {
19
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
20
+ args[_key - 1] = arguments[_key];
21
+ }
22
+
23
+ if (args.length === 1 && (0, _typeof3.default)(args[0]) === 'object') {
24
+ args = args[0];
25
+ }
26
+
27
+ if (!args || !args.hasOwnProperty) {
28
+ args = {};
29
+ }
30
+
31
+ return string.replace(RE_NARGS, function (match, prefix, i, index) {
32
+ var result = void 0;
33
+
34
+ if (string[index - 1] === '{' && string[index + match.length] === '}') {
35
+ return i;
36
+ } else {
37
+ result = (0, _util.hasOwn)(args, i) ? args[i] : null;
38
+ if (result === null || result === undefined) {
39
+ return '';
40
+ }
41
+
42
+ return result;
43
+ }
44
+ });
45
+ }
46
+
47
+ return template;
48
+ };
49
+
50
+ var _util = require('../_util/util');
51
+
52
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
53
+
54
+ var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
@@ -1,18 +1,68 @@
1
1
  'use strict';
2
2
 
3
3
  exports.__esModule = true;
4
- exports.tfn = undefined;
4
+ exports.i18n = exports.use = exports.t = undefined;
5
5
 
6
- var _zhCN = require('./zh-CN.js');
6
+ var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
7
+
8
+ var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
9
+
10
+ var _zhCN = require('./lang/zh-CN');
7
11
 
8
12
  var _zhCN2 = _interopRequireDefault(_zhCN);
9
13
 
10
- var _util = require('../_util/util.js');
14
+ var _vue = require('vue');
15
+
16
+ var _vue2 = _interopRequireDefault(_vue);
17
+
18
+ var _deepmerge = require('deepmerge');
19
+
20
+ var _deepmerge2 = _interopRequireDefault(_deepmerge);
21
+
22
+ var _format = require('./format');
23
+
24
+ var _format2 = _interopRequireDefault(_format);
11
25
 
12
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
27
 
14
- var tfn = exports.tfn = function tfn(path) {
15
- return (0, _util.getValueByPath)(_zhCN2.default, path, '');
28
+ var format = (0, _format2.default)(_vue2.default);
29
+ var lang = _zhCN2.default;
30
+ var merged = false;
31
+
32
+ var i18nHandler = function i18nHandler() {
33
+ var vuei18n = (0, _getPrototypeOf2.default)(this || _vue2.default).$t;
34
+ if (typeof vuei18n === 'function' && !!_vue2.default.locale) {
35
+ if (!merged) {
36
+ merged = true;
37
+ _vue2.default.locale(_vue2.default.config.lang, (0, _deepmerge2.default)(lang, _vue2.default.locale(_vue2.default.config.lang) || {}, { clone: true }));
38
+ }
39
+ return vuei18n.apply(this, arguments);
40
+ }
41
+ };
42
+
43
+ var t = exports.t = function t(path, options) {
44
+ var value = i18nHandler.apply(this, arguments);
45
+ if (value !== null && value !== undefined) return value;
46
+
47
+ var array = path.split('.');
48
+ var current = lang;
49
+
50
+ for (var i = 0, j = array.length; i < j; i++) {
51
+ var property = array[i];
52
+ value = current[property];
53
+ if (i === j - 1) return format(value, options);
54
+ if (!value) return '';
55
+ current = value;
56
+ }
57
+ return '';
58
+ };
59
+
60
+ var use = exports.use = function use(l) {
61
+ lang = l || lang;
62
+ };
63
+
64
+ var i18n = exports.i18n = function i18n(fn) {
65
+ i18nHandler = fn || i18nHandler;
16
66
  };
17
67
 
18
- exports.default = { tfn: tfn };
68
+ exports.default = { use: use, t: t, i18n: i18n };
@@ -0,0 +1,144 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+ exports.default = {
5
+ mds: {
6
+ colorpicker: {
7
+ confirm: 'OK',
8
+ clear: 'Clear'
9
+ },
10
+ timepicker: {
11
+ placeholder: 'Select time',
12
+ startTime: 'Start Time',
13
+ endTime: 'End Time'
14
+ },
15
+ datepicker: {
16
+ now: 'Now',
17
+ today: 'Today',
18
+ cancel: 'Cancel',
19
+ clear: 'Clear',
20
+ confirm: 'OK',
21
+ selectDate: 'Select date',
22
+ selectTime: 'Select time',
23
+ startDate: 'Start Date',
24
+ startTime: 'Start Time',
25
+ endDate: 'End Date',
26
+ endTime: 'End Time',
27
+ prevYear: 'Previous Year',
28
+ nextYear: 'Next Year',
29
+ prevMonth: 'Previous Month',
30
+ nextMonth: 'Next Month',
31
+ year: '',
32
+ month1: 'January',
33
+ month2: 'February',
34
+ month3: 'March',
35
+ month4: 'April',
36
+ month5: 'May',
37
+ month6: 'June',
38
+ month7: 'July',
39
+ month8: 'August',
40
+ month9: 'September',
41
+ month10: 'October',
42
+ month11: 'November',
43
+ month12: 'December',
44
+ week: 'week',
45
+ weeks: {
46
+ sun: 'Sun',
47
+ mon: 'Mon',
48
+ tue: 'Tue',
49
+ wed: 'Wed',
50
+ thu: 'Thu',
51
+ fri: 'Fri',
52
+ sat: 'Sat'
53
+ },
54
+ months: {
55
+ jan: 'Jan',
56
+ feb: 'Feb',
57
+ mar: 'Mar',
58
+ apr: 'Apr',
59
+ may: 'May',
60
+ jun: 'Jun',
61
+ jul: 'Jul',
62
+ aug: 'Aug',
63
+ sep: 'Sep',
64
+ oct: 'Oct',
65
+ nov: 'Nov',
66
+ dec: 'Dec'
67
+ }
68
+ },
69
+ select: {
70
+ loading: 'Loading',
71
+ noMatch: 'No matching data',
72
+ noData: 'No data',
73
+ placeholder: 'Select'
74
+ },
75
+ cascader: {
76
+ emptyText: 'No matching data',
77
+ noMatch: 'No matching data',
78
+ loading: 'Loading',
79
+ placeholder: 'Select',
80
+ filterPlaceholder: 'Enter keyword',
81
+ noData: 'No data'
82
+ },
83
+ pagination: {
84
+ goto: 'Go to',
85
+ pageText: '',
86
+ placeholder: 'Select',
87
+ pagesize: '/page',
88
+ total: 'Total {total}',
89
+ pageClassifier: ''
90
+
91
+ },
92
+ messagebox: {
93
+ title: 'Message',
94
+ confirm: 'OK',
95
+ cancel: 'Cancel',
96
+ error: 'Illegal input'
97
+ },
98
+ upload: {
99
+ deleteTip: 'press delete to remove',
100
+ delete: 'Delete',
101
+ preview: 'Preview',
102
+ uploadFileText: 'Upload Files',
103
+ uploadPicText: 'Upload Pictures',
104
+ uploadDescText: 'Drag and drop the file here, or ',
105
+ uploadClickText: 'Click to upload',
106
+ continue: 'Continue'
107
+ },
108
+ table: {
109
+ loadText: 'Loading',
110
+ emptyText: 'No Data',
111
+ confirmFilter: 'Confirm',
112
+ resetFilter: 'Reset',
113
+ clearFilter: 'All'
114
+ },
115
+ tree: {
116
+ emptyText: 'No Data'
117
+ },
118
+ transfer: {
119
+ noMatch: 'No matching data',
120
+ noData: 'No data',
121
+ titles: ['List 1', 'List 2'], // to be translated
122
+ filterPlaceholder: 'Enter keyword', // to be translated
123
+ noCheckedFormat: '{total} items', // to be translated
124
+ hasCheckedFormat: '{checked}/{total} checked' // to be translated
125
+ },
126
+ image: {
127
+ error: 'FAILED'
128
+ },
129
+ pageHeader: {
130
+ title: 'Back' // to be translated
131
+ },
132
+ popconfirm: {
133
+ confirmButtonText: 'Yes',
134
+ cancelButtonText: 'No'
135
+ },
136
+ modal: {
137
+ confirmText: 'OK',
138
+ cancelText: 'Cancel'
139
+ },
140
+ empty: {
141
+ description: 'No Data'
142
+ }
143
+ }
144
+ };
@@ -7,6 +7,11 @@ exports.default = {
7
7
  confirm: '确定',
8
8
  clear: '清空'
9
9
  },
10
+ timepicker: {
11
+ placeholder: '请选择时间',
12
+ startTime: '开始时间',
13
+ endTime: '结束时间'
14
+ },
10
15
  datepicker: {
11
16
  now: '此刻',
12
17
  today: '今天',
@@ -36,7 +41,7 @@ exports.default = {
36
41
  month10: '10 月',
37
42
  month11: '11 月',
38
43
  month12: '12 月',
39
- week: '周次',
44
+ // week: '周次',
40
45
  weeks: {
41
46
  sun: '日',
42
47
  mon: '一',
@@ -68,13 +73,16 @@ exports.default = {
68
73
  placeholder: '请选择'
69
74
  },
70
75
  cascader: {
76
+ emptyText: '没有找到相关结果',
71
77
  noMatch: '无匹配数据',
72
78
  loading: '加载中',
73
79
  placeholder: '请选择',
80
+ filterPlaceholder: '请输入搜索',
74
81
  noData: '暂无数据'
75
82
  },
76
83
  pagination: {
77
84
  goto: '前往',
85
+ placeholder: '请选择',
78
86
  pagesize: '条/页',
79
87
  total: '共 {total} 条',
80
88
  pageClassifier: '页'
@@ -89,14 +97,18 @@ exports.default = {
89
97
  deleteTip: '按 delete 键可删除',
90
98
  delete: '删除',
91
99
  preview: '查看图片',
100
+ uploadFileText: '上传文件',
101
+ uploadPhotoText: '上传图片',
102
+ uploadDescText: '将文件拖拽到此处, 或',
103
+ uploadClickText: '点击上传',
92
104
  continue: '继续上传'
93
105
  },
94
106
  table: {
107
+ loadText: '加载中',
95
108
  emptyText: '暂无数据',
96
109
  confirmFilter: '筛选',
97
110
  resetFilter: '重置',
98
- clearFilter: '全部',
99
- sumText: '合计'
111
+ clearFilter: '全部'
100
112
  },
101
113
  tree: {
102
114
  emptyText: '暂无数据'
@@ -118,6 +130,13 @@ exports.default = {
118
130
  popconfirm: {
119
131
  confirmButtonText: '确定',
120
132
  cancelButtonText: '取消'
133
+ },
134
+ modal: {
135
+ cancelText: '取消',
136
+ confirmText: '确定'
137
+ },
138
+ empty: {
139
+ description: '暂无数据'
121
140
  }
122
141
  }
123
142
  };
@@ -11,7 +11,7 @@ exports.default = {
11
11
  args[_key] = arguments[_key];
12
12
  }
13
13
 
14
- return _index.tfn.apply(this, args);
14
+ return _index.t.apply(this, args);
15
15
  }
16
16
  }
17
17
  };