fmui-base 2.3.34 → 2.3.36

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.
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.3.36:单选多选可输入,输入内容过多时不换行
7
+ - 2.3.35:upload:鸿蒙微信端上传异常点击无反应问题
6
8
  - 2.3.34:移动端支持新疆CA电子签章功能,去除截图base64png图片的操作
7
9
  - 2.3.33:移动端支持新疆CA电子签章功能,移动端选人组件增加一些再次加载的入口
8
10
  - 2.3.32:移动端子表字段为空时不存,只读情况下不再默认拼一行空子表
@@ -393,13 +393,21 @@ var SelectInput = function (_React$Component) {
393
393
  { className: 'dd-select-input-option-text' },
394
394
  option.text
395
395
  ),
396
- showInput ? _react2.default.createElement('input', {
396
+ showInput ? _react2.default.createElement('textarea', {
397
397
  className: 'dd-select-input-text',
398
- type: 'text',
398
+ rows: 1,
399
399
  value: _this3.state.inputValues[optionValue] || ''
400
400
  // 输入框只有在当前项已选中且 readOnly=false 时才允许输入。
401
401
  , disabled: inputDisabled,
402
+ ref: function ref(el) {
403
+ if (el) {
404
+ el.style.height = 'auto';
405
+ el.style.height = el.scrollHeight + 'px';
406
+ }
407
+ },
402
408
  onChange: function onChange(e) {
409
+ e.target.style.height = 'auto';
410
+ e.target.style.height = e.target.scrollHeight + 'px';
403
411
  _this3.handleInputChange(optionValue, e.target.value);
404
412
  },
405
413
  onBlur: function onBlur() {
@@ -4,7 +4,8 @@
4
4
 
5
5
  .dd-select-input-option {
6
6
  display: flex;
7
- align-items: center;
7
+ align-items: flex-start;
8
+ width: 100%;
8
9
  margin: 8px 0;
9
10
  cursor: pointer;
10
11
  }
@@ -21,6 +22,7 @@
21
22
  width: 18px;
22
23
  height: 18px;
23
24
  margin-right: 8px;
25
+ margin-top: 2px;
24
26
  border: 1px solid #c7ced9;
25
27
  background: #fff;
26
28
  transition: all .2s ease;
@@ -67,21 +69,35 @@
67
69
  .dd-select-input-option-text {
68
70
  margin-right: 8px;
69
71
  min-width: 32px;
72
+ max-width: 40%;
73
+ flex: 0 1 auto;
74
+ white-space: normal;
75
+ word-break: break-word;
76
+ line-height: 1.4;
70
77
  }
71
78
 
72
79
  .dd-select-input-text {
73
- flex: 1;
74
- min-width: 120px;
80
+ flex: 1 1 0;
81
+ min-width: 0;
82
+ width: auto;
83
+ max-width: 100%;
75
84
  border: none;
76
85
  border-bottom: 1px solid #ddd;
77
86
  outline: none;
78
87
  padding: 4px 2px;
79
88
  font-size: 14px;
89
+ line-height: 1.4;
80
90
  background-color: transparent;
91
+ white-space: pre-wrap;
92
+ word-break: break-all;
93
+ overflow-wrap: anywhere;
94
+ resize: none;
95
+ overflow: hidden;
96
+ field-sizing: content;
81
97
  }
82
98
 
83
99
  .dd-select-input-text:disabled {
84
100
  color: #333;
85
101
  border-bottom-color: #eee;
86
102
  cursor: not-allowed;
87
- }
103
+ }
@@ -139,6 +139,11 @@ var PageHome = function (_React$Component) {
139
139
  var canDel = props.canDel;
140
140
  //可下载
141
141
  var canDownload = props.canDownload;
142
+ // 普通微信端:UA 判断(thirdMenuType 可能为 null,且值为 WX 而非 WeChat)
143
+ var isWeChatClient = _this.isRegularWeChatClient();
144
+ // 鸿蒙端:不设 input accept,事件内校验文件类型
145
+ var isHarmonyClient = _this.isHarmonyClient();
146
+ var skipInputAccept = isWeChatClient && isHarmonyClient;
142
147
  // 公众号不展示下载按钮
143
148
  if (getLoginUserInfo().thirdMenuType == 'WeChat') {
144
149
  canDownload = false;
@@ -243,7 +248,10 @@ var PageHome = function (_React$Component) {
243
248
  returnOnce: returnOnce,
244
249
  percent1: 0,
245
250
  showProgress: true,
246
- isDesktop: isDesktop
251
+ isDesktop: isDesktop,
252
+ isWeChatClient: isWeChatClient,
253
+ isHarmonyClient: isHarmonyClient,
254
+ skipInputAccept: skipInputAccept
247
255
  };
248
256
  return _this;
249
257
  }
@@ -253,6 +261,36 @@ var PageHome = function (_React$Component) {
253
261
  value: function GenNonDuplicateID(randomLength) {
254
262
  return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36);
255
263
  }
264
+
265
+ // 普通微信(非企业微信):与 base.js 中 isRegularWeChat 逻辑一致
266
+
267
+ }, {
268
+ key: 'isRegularWeChatClient',
269
+ value: function isRegularWeChatClient() {
270
+ if (typeof isRegularWeChat !== 'undefined') {
271
+ return !!isRegularWeChat;
272
+ }
273
+ var ua = navigator.userAgent || '';
274
+ return (/MicroMessenger/i.test(ua) && !/wxwork/i.test(ua)
275
+ );
276
+ }
277
+
278
+ // 鸿蒙端:thirdMenuType=MH、emp JSBridge 或 UA 识别
279
+
280
+ }, {
281
+ key: 'isHarmonyClient',
282
+ value: function isHarmonyClient() {
283
+ var thirdMenuType = getLoginUserInfo().thirdMenuType;
284
+ if (thirdMenuType == 'MH') {
285
+ return true;
286
+ }
287
+ if (typeof emp !== 'undefined') {
288
+ return true;
289
+ }
290
+ var ua = navigator.userAgent || '';
291
+ return (/HarmonyOS|OpenHarmony/i.test(ua)
292
+ );
293
+ }
256
294
  }, {
257
295
  key: 'del',
258
296
  value: function del(delIndex) {
@@ -269,7 +307,8 @@ var PageHome = function (_React$Component) {
269
307
  name: 'file',
270
308
  url: this.state.uploadUrl,
271
309
  autoPending: true,
272
- accept: t.state.accept,
310
+ // 普通微信/鸿蒙端不设 input accept,避免选择文件异常
311
+ accept: t.state.skipInputAccept ? null : t.state.accept,
273
312
  multiple: true,
274
313
  fileSizeLimit: t.state.fileSizeLimit
275
314
  };
@@ -300,7 +339,15 @@ var PageHome = function (_React$Component) {
300
339
  request.setParam('businessExt', t.state.businessExt);
301
340
  console.info(request.getParam('token'));
302
341
  }).on(_uploadcore.Events.QUEUE_FILE_ADDED, function (file) {
303
- // return false;
342
+ // 普通微信/鸿蒙端:事件内校验文件类型(input 未设 accept)
343
+ if (t.state.skipInputAccept && t.state.accept && !t.isFileExtensionAllowed(file)) {
344
+ file.cancel();
345
+ _Toast2.default.show({
346
+ type: 'error',
347
+ content: '文件类型错误!'
348
+ });
349
+ return false;
350
+ }
304
351
  //判断总文件大小不超过
305
352
  var fileAllSizeLimit = t.state.fileAllSizeLimit;
306
353
  if (fileAllSizeLimit > 0) {
@@ -508,6 +555,28 @@ var PageHome = function (_React$Component) {
508
555
  });
509
556
  return up;
510
557
  }
558
+ // 校验文件扩展名(普通微信端 input 不设 accept 时使用)
559
+
560
+ }, {
561
+ key: 'isFileExtensionAllowed',
562
+ value: function isFileExtensionAllowed(file) {
563
+ var accept = this.state.accept;
564
+ if (!accept || !accept.extensions) {
565
+ return true;
566
+ }
567
+ var allowedExts = accept.extensions.toLowerCase().split(',').map(function (ext) {
568
+ return ext.trim().replace(/^\./, '');
569
+ });
570
+ var fileExt = (file.ext || '').toLowerCase().replace(/^\./, '');
571
+ if (!fileExt && file.name) {
572
+ var parts = file.name.split('.');
573
+ if (parts.length > 1) {
574
+ fileExt = parts[parts.length - 1].toLowerCase();
575
+ }
576
+ }
577
+ return allowedExts.indexOf(fileExt) >= 0;
578
+ }
579
+
511
580
  //计算大小
512
581
 
513
582
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.34",
3
+ "version": "2.3.36",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",