fan-standard-comp 4.1.13 → 4.1.15
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/dist/fan-standard-comp.min.js +1 -1
- package/es/ButtonGroup/index.d.ts +1 -1
- package/es/ButtonGroup/index.js +99 -35
- package/es/FormComp/RenderItemGroup/index.js +25 -10
- package/es/FormComp/VarTemplate/index.js +15 -7
- package/es/Navigation/index.d.ts +10 -0
- package/es/Navigation/index.js +182 -0
- package/es/Navigation/style/index.d.ts +6 -0
- package/es/Navigation/style/index.js +34 -0
- package/es/StandardContent/WrapperContent.js +1 -1
- package/es/StandardContent/styles/Wrapper.js +3 -1
- package/es/StandardTable/index.js +5 -3
- package/es/StandardTable/types.d.ts +1 -0
- package/es/locales/bn-BD/settings.d.ts +9 -0
- package/es/locales/bn-BD/settings.js +10 -1
- package/es/locales/bn-BD.d.ts +9 -0
- package/es/locales/en-US/settings.d.ts +2 -0
- package/es/locales/en-US/settings.js +2 -0
- package/es/locales/en-US.d.ts +2 -0
- package/es/locales/fa-IR/settings.d.ts +9 -0
- package/es/locales/fa-IR/settings.js +10 -1
- package/es/locales/fa-IR.d.ts +9 -0
- package/es/locales/id-ID/settings.d.ts +9 -0
- package/es/locales/id-ID/settings.js +10 -1
- package/es/locales/id-ID.d.ts +9 -0
- package/es/locales/ja-JP/settings.d.ts +9 -0
- package/es/locales/ja-JP/settings.js +10 -1
- package/es/locales/ja-JP.d.ts +9 -0
- package/es/locales/pt-BR/settings.d.ts +9 -0
- package/es/locales/pt-BR/settings.js +10 -1
- package/es/locales/pt-BR.d.ts +9 -0
- package/es/locales/zh-CN/settings.d.ts +2 -0
- package/es/locales/zh-CN/settings.js +2 -0
- package/es/locales/zh-CN.d.ts +2 -0
- package/es/locales/zh-TW/settings.d.ts +9 -0
- package/es/locales/zh-TW/settings.js +10 -1
- package/es/locales/zh-TW.d.ts +9 -0
- package/lib/ButtonGroup/index.d.ts +1 -1
- package/lib/ButtonGroup/index.js +99 -35
- package/lib/FormComp/RenderItemGroup/index.js +25 -10
- package/lib/FormComp/VarTemplate/index.js +15 -7
- package/lib/Navigation/index.d.ts +10 -0
- package/lib/Navigation/index.js +192 -0
- package/lib/Navigation/style/index.d.ts +6 -0
- package/lib/Navigation/style/index.js +40 -0
- package/lib/StandardContent/WrapperContent.js +1 -1
- package/lib/StandardContent/styles/Wrapper.js +3 -1
- package/lib/StandardTable/index.js +5 -3
- package/lib/StandardTable/types.d.ts +1 -0
- package/lib/locales/bn-BD/settings.d.ts +9 -0
- package/lib/locales/bn-BD/settings.js +10 -1
- package/lib/locales/bn-BD.d.ts +9 -0
- package/lib/locales/en-US/settings.d.ts +2 -0
- package/lib/locales/en-US/settings.js +2 -0
- package/lib/locales/en-US.d.ts +2 -0
- package/lib/locales/fa-IR/settings.d.ts +9 -0
- package/lib/locales/fa-IR/settings.js +10 -1
- package/lib/locales/fa-IR.d.ts +9 -0
- package/lib/locales/id-ID/settings.d.ts +9 -0
- package/lib/locales/id-ID/settings.js +10 -1
- package/lib/locales/id-ID.d.ts +9 -0
- package/lib/locales/ja-JP/settings.d.ts +9 -0
- package/lib/locales/ja-JP/settings.js +10 -1
- package/lib/locales/ja-JP.d.ts +9 -0
- package/lib/locales/pt-BR/settings.d.ts +9 -0
- package/lib/locales/pt-BR/settings.js +10 -1
- package/lib/locales/pt-BR.d.ts +9 -0
- package/lib/locales/zh-CN/settings.d.ts +2 -0
- package/lib/locales/zh-CN/settings.js +2 -0
- package/lib/locales/zh-CN.d.ts +2 -0
- package/lib/locales/zh-TW/settings.d.ts +9 -0
- package/lib/locales/zh-TW/settings.js +10 -1
- package/lib/locales/zh-TW.d.ts +9 -0
- package/package.json +1 -1
package/lib/ButtonGroup/index.js
CHANGED
|
@@ -108,15 +108,19 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
108
108
|
confirmConfig = vItem.confirmConfig,
|
|
109
109
|
render = vItem.render,
|
|
110
110
|
others = _objectWithoutProperties(vItem, _excluded);
|
|
111
|
+
var uniqueId = "".concat(Date.now(), "_").concat(Math.random().toString(36).substr(2, 9));
|
|
111
112
|
return _objectSpread(_objectSpread({}, others), {}, {
|
|
112
|
-
key: code ? code + i : i,
|
|
113
|
+
key: code ? code + i + uniqueId : i + uniqueId,
|
|
114
|
+
// // 使用 useRef 保持 ID 的稳定性(只在组件挂载时生成一次)
|
|
113
115
|
icon: icon ? /*#__PURE__*/_react.default.createElement(_components.IconNode, {
|
|
114
116
|
icon: icon
|
|
115
117
|
}) : null,
|
|
116
118
|
// exName为null时,将不显示名称
|
|
117
119
|
label: /*#__PURE__*/_react.default.createElement("a", {
|
|
118
|
-
onClick: function onClick() {
|
|
119
|
-
return fn && fn(vItem)
|
|
120
|
+
onClick: function onClick(event) {
|
|
121
|
+
return fn && fn(_objectSpread(_objectSpread({}, vItem), {}, {
|
|
122
|
+
event: event
|
|
123
|
+
}));
|
|
120
124
|
}
|
|
121
125
|
}, exName || name),
|
|
122
126
|
children: children && children.length > 0 ? deepTransButtonMenus(children) : undefined
|
|
@@ -189,8 +193,10 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
189
193
|
danger: danger,
|
|
190
194
|
ghost: ghost,
|
|
191
195
|
loading: loading,
|
|
192
|
-
onClick: fn ? function () {
|
|
193
|
-
return fn(item)
|
|
196
|
+
onClick: fn ? function (event) {
|
|
197
|
+
return fn(_objectSpread(_objectSpread({}, item), {}, {
|
|
198
|
+
event: event
|
|
199
|
+
}));
|
|
194
200
|
} : null,
|
|
195
201
|
size: size
|
|
196
202
|
}, others, {
|
|
@@ -307,10 +313,11 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
307
313
|
confirmText = vItem.confirmText,
|
|
308
314
|
confirmConfig = vItem.confirmConfig,
|
|
309
315
|
others = _objectWithoutProperties(vItem, _excluded3);
|
|
316
|
+
var uniqueId = "".concat(Date.now(), "_").concat(Math.random().toString(36).substr(2, 9));
|
|
310
317
|
return {
|
|
311
318
|
danger: others.danger,
|
|
312
319
|
disabled: (0, _filterPermission.btnIsDisabled)(others.disabled, rowParams),
|
|
313
|
-
key: code ? code + i : i,
|
|
320
|
+
key: code ? code + i + uniqueId : i + uniqueId,
|
|
314
321
|
icon: icon && showTextIcon ? /*#__PURE__*/_react.default.createElement(_components.IconNode, {
|
|
315
322
|
icon: icon,
|
|
316
323
|
style: {
|
|
@@ -319,7 +326,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
319
326
|
}) : null,
|
|
320
327
|
// 不显示图标
|
|
321
328
|
label: /*#__PURE__*/_react.default.createElement("a", {
|
|
322
|
-
onClick: function onClick() {
|
|
329
|
+
onClick: function onClick(event) {
|
|
323
330
|
// 配置二次确认
|
|
324
331
|
if (vItem.hasOwnProperty('confirmText') || vItem.hasOwnProperty('confirmConfig')) {
|
|
325
332
|
// @ts-ignore
|
|
@@ -327,7 +334,9 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
327
334
|
} else {
|
|
328
335
|
fn && fn.apply(void 0, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
329
336
|
return rowParams[pItem];
|
|
330
|
-
})))
|
|
337
|
+
})).concat([_objectSpread(_objectSpread({}, vItem), {}, {
|
|
338
|
+
event: event
|
|
339
|
+
})]));
|
|
331
340
|
}
|
|
332
341
|
}
|
|
333
342
|
}, renderCustomLabel(vItem, true)),
|
|
@@ -359,24 +368,42 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
359
368
|
title: /*#__PURE__*/_react.default.createElement(_PopConfirmTitle.default, _extends({}, item, {
|
|
360
369
|
extraRow: rowParams
|
|
361
370
|
})),
|
|
362
|
-
onCancel: function onCancel() {
|
|
371
|
+
onCancel: function onCancel(event) {
|
|
363
372
|
if (item.hasOwnProperty('confirmConfig') && item.confirmConfig.onCancel) {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
373
|
+
if (type === 'action') {
|
|
374
|
+
var _item$confirmConfig;
|
|
375
|
+
(_item$confirmConfig = item.confirmConfig).onCancel.apply(_item$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
376
|
+
return rowParams[pItem];
|
|
377
|
+
})).concat([_objectSpread(_objectSpread({}, item), {}, {
|
|
378
|
+
event: event
|
|
379
|
+
})]));
|
|
380
|
+
}
|
|
381
|
+
if (type === 'text') {
|
|
382
|
+
item.confirmConfig.onCancel(_objectSpread(_objectSpread({}, item), {}, {
|
|
383
|
+
event: event
|
|
384
|
+
}));
|
|
385
|
+
}
|
|
368
386
|
}
|
|
369
387
|
},
|
|
370
|
-
onConfirm: function onConfirm() {
|
|
388
|
+
onConfirm: function onConfirm(event) {
|
|
371
389
|
if (item.hasOwnProperty('confirmConfig') && item.confirmConfig.onConfirm) {
|
|
372
390
|
var _item$confirmConfig2;
|
|
373
391
|
(_item$confirmConfig2 = item.confirmConfig).onConfirm.apply(_item$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
374
392
|
return rowParams[pItem];
|
|
375
393
|
})));
|
|
376
394
|
} else if (item.fn) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
395
|
+
if (type === 'action') {
|
|
396
|
+
item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
397
|
+
return rowParams[pItem];
|
|
398
|
+
})).concat([_objectSpread(_objectSpread({}, item), {}, {
|
|
399
|
+
event: event
|
|
400
|
+
})]));
|
|
401
|
+
}
|
|
402
|
+
if (type === 'text') {
|
|
403
|
+
item.fn(_objectSpread(_objectSpread({}, item), {}, {
|
|
404
|
+
event: event
|
|
405
|
+
}));
|
|
406
|
+
}
|
|
380
407
|
}
|
|
381
408
|
}
|
|
382
409
|
}), /*#__PURE__*/_react.default.createElement("a", {
|
|
@@ -393,10 +420,19 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
393
420
|
// @ts-ignore
|
|
394
421
|
,
|
|
395
422
|
disabled: (0, _filterPermission.btnIsDisabled)(item.disabled, rowParams),
|
|
396
|
-
onClick: item.fn ? function () {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
423
|
+
onClick: item.fn ? function (event) {
|
|
424
|
+
if (type === 'action') {
|
|
425
|
+
item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
426
|
+
return rowParams[pItem];
|
|
427
|
+
})).concat([_objectSpread(_objectSpread({}, item), {}, {
|
|
428
|
+
event: event
|
|
429
|
+
})]));
|
|
430
|
+
}
|
|
431
|
+
if (type === 'text') {
|
|
432
|
+
item.fn(_objectSpread(_objectSpread({}, item), {}, {
|
|
433
|
+
event: event
|
|
434
|
+
}));
|
|
435
|
+
}
|
|
400
436
|
} : undefined
|
|
401
437
|
}, renderCustomLabel(item)));
|
|
402
438
|
};
|
|
@@ -429,7 +465,8 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
429
465
|
rowParams: rowParams
|
|
430
466
|
}));
|
|
431
467
|
}
|
|
432
|
-
|
|
468
|
+
|
|
469
|
+
/*渲染文本形式(包含表格操作列的按钮)type='text' 或 type='action'*/
|
|
433
470
|
return /*#__PURE__*/_react.default.createElement(RenderTextList, _extends({
|
|
434
471
|
key: index
|
|
435
472
|
}, item));
|
|
@@ -471,28 +508,55 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
471
508
|
title: /*#__PURE__*/_react.default.createElement(_PopConfirmTitle.default, _extends({}, popRow, {
|
|
472
509
|
extraRow: rowParams
|
|
473
510
|
})),
|
|
474
|
-
onCancel: function onCancel() {
|
|
511
|
+
onCancel: function onCancel(event) {
|
|
475
512
|
setPopVisibleIndex(-1);
|
|
476
513
|
// 优先调用其 confirmConfig 配置的 onCancel 事件
|
|
477
514
|
if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onCancel) {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
515
|
+
if (type === 'action') {
|
|
516
|
+
var _popRow$confirmConfig;
|
|
517
|
+
(_popRow$confirmConfig = popRow.confirmConfig).onCancel.apply(_popRow$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
518
|
+
return rowParams[pItem];
|
|
519
|
+
})).concat([_objectSpread(_objectSpread({}, popRow), {}, {
|
|
520
|
+
event: event
|
|
521
|
+
})]));
|
|
522
|
+
}
|
|
523
|
+
if (type === 'text') {
|
|
524
|
+
popRow.confirmConfig.onCancel(_objectSpread(_objectSpread({}, popRow), {}, {
|
|
525
|
+
event: event
|
|
526
|
+
}));
|
|
527
|
+
}
|
|
482
528
|
}
|
|
483
529
|
},
|
|
484
|
-
onConfirm: function onConfirm() {
|
|
530
|
+
onConfirm: function onConfirm(event) {
|
|
485
531
|
setPopVisibleIndex(-1);
|
|
486
532
|
// 优先调用其 confirmConfig 配置的 onConfirm 事件
|
|
487
533
|
if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onConfirm) {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
534
|
+
if (type === 'action') {
|
|
535
|
+
var _popRow$confirmConfig2;
|
|
536
|
+
(_popRow$confirmConfig2 = popRow.confirmConfig).onConfirm.apply(_popRow$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
537
|
+
return rowParams[pItem];
|
|
538
|
+
})).concat([_objectSpread(_objectSpread({}, popRow), {}, {
|
|
539
|
+
event: event
|
|
540
|
+
})]));
|
|
541
|
+
}
|
|
542
|
+
if (type === 'text') {
|
|
543
|
+
popRow.confirmConfig.onCancel(_objectSpread(_objectSpread({}, popRow), {}, {
|
|
544
|
+
event: event
|
|
545
|
+
}));
|
|
546
|
+
}
|
|
492
547
|
} else if (popRow.fn) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
548
|
+
if (type === 'action') {
|
|
549
|
+
popRow.fn.apply(popRow, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
550
|
+
return rowParams[pItem];
|
|
551
|
+
})).concat([_objectSpread(_objectSpread({}, popRow), {}, {
|
|
552
|
+
event: event
|
|
553
|
+
})]));
|
|
554
|
+
}
|
|
555
|
+
if (type === 'text') {
|
|
556
|
+
popRow.fn(_objectSpread(_objectSpread({}, popRow), {}, {
|
|
557
|
+
event: event
|
|
558
|
+
}));
|
|
559
|
+
}
|
|
496
560
|
}
|
|
497
561
|
}
|
|
498
562
|
}), /*#__PURE__*/_react.default.createElement(_antd.Dropdown, _extends({
|
|
@@ -31,6 +31,23 @@ var FormItem = _antd.Form.Item;
|
|
|
31
31
|
|
|
32
32
|
// 单个控件配置参数
|
|
33
33
|
|
|
34
|
+
var DescriptionTooltip = function DescriptionTooltip(props) {
|
|
35
|
+
var label = props.label,
|
|
36
|
+
description = props.description;
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
38
|
+
className: 'spec-item-group-label',
|
|
39
|
+
style: {
|
|
40
|
+
display: 'inline-flex'
|
|
41
|
+
}
|
|
42
|
+
}, label, description && /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
43
|
+
title: description
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_SpecIcon.default, {
|
|
45
|
+
name: "info",
|
|
46
|
+
style: {
|
|
47
|
+
marginLeft: label ? '4px' : 0
|
|
48
|
+
}
|
|
49
|
+
})));
|
|
50
|
+
};
|
|
34
51
|
var RenderItemGroup = function RenderItemGroup(props) {
|
|
35
52
|
var itemGroup = props.itemGroup,
|
|
36
53
|
_props$size = props.size,
|
|
@@ -238,11 +255,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
238
255
|
}, item.protoCol), /*#__PURE__*/_react.default.createElement(FormItem, _extends({
|
|
239
256
|
name: type !== 'custom' && (filedName || fieldName),
|
|
240
257
|
className: (0, _classnames.default)(fieldStatus === 'viewOnly' ? 'form-item-view-only' : '', 'spec-item-group-form-item'),
|
|
241
|
-
label: description ? /*#__PURE__*/_react.default.createElement(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}))) : label,
|
|
258
|
+
label: description ? /*#__PURE__*/_react.default.createElement(DescriptionTooltip, {
|
|
259
|
+
label: label,
|
|
260
|
+
description: description
|
|
261
|
+
}) : label,
|
|
246
262
|
rules: item.preExtra || item.extra ? [] : item.rules || (item.fieldOptions ? item.fieldOptions.rules : []),
|
|
247
263
|
required: item.rules && item.rules.filter(function (rItem) {
|
|
248
264
|
return rItem.required;
|
|
@@ -255,11 +271,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
255
271
|
key: index,
|
|
256
272
|
name: type !== 'custom' && (filedName || fieldName),
|
|
257
273
|
className: (0, _classnames.default)(fieldStatus === 'viewOnly' ? 'form-item-view-only' : '', 'spec-item-group-form-item'),
|
|
258
|
-
label: description ? /*#__PURE__*/_react.default.createElement(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}))) : label,
|
|
274
|
+
label: description ? /*#__PURE__*/_react.default.createElement(DescriptionTooltip, {
|
|
275
|
+
label: label,
|
|
276
|
+
description: description
|
|
277
|
+
}) : label,
|
|
263
278
|
rules: item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])
|
|
264
279
|
}, formLayout, item.protoFormItem),
|
|
265
280
|
// type === 'custom' && customRender ? customRender(form, { ...item }, fieldStatus) : type === 'FormList' ? <CustomFormList name={filedName || fieldName} {...item}/> : renderFormField({ ...item })
|
|
@@ -39,7 +39,8 @@ var VarTemplate = function VarTemplate(props) {
|
|
|
39
39
|
value: 'value'
|
|
40
40
|
} : _props$tagsOptionName,
|
|
41
41
|
showCountTip = props.showCountTip,
|
|
42
|
-
onChange = props.onChange
|
|
42
|
+
onChange = props.onChange,
|
|
43
|
+
maxLength = props.maxLength;
|
|
43
44
|
var lang = (0, _useLanguage.useLanguageObject)(); // 当前使用的语言包
|
|
44
45
|
var contentRef = (0, _react.useRef)();
|
|
45
46
|
var _useState = (0, _react.useState)({
|
|
@@ -72,19 +73,25 @@ var VarTemplate = function VarTemplate(props) {
|
|
|
72
73
|
var currentContent = vartData.currentContent,
|
|
73
74
|
startNum = vartData.startNum,
|
|
74
75
|
endNum = vartData.endNum;
|
|
76
|
+
var insert = insertContent(currentContent, key, startNum, endNum);
|
|
77
|
+
var newContent = insert.length > maxLength ? insert.substring(0, maxLength) : insert;
|
|
78
|
+
// if (newContent.length > maxLength) {
|
|
79
|
+
// console.log('字数超出了', newContent, newContent.substring(0, maxLength))
|
|
80
|
+
// }
|
|
81
|
+
// 数字超出需要截取
|
|
75
82
|
setVartData({
|
|
76
|
-
currentContent:
|
|
83
|
+
currentContent: newContent,
|
|
77
84
|
startNum: startNum + key.length,
|
|
78
85
|
// 光标起始位置累加
|
|
79
86
|
endNum: endNum + key.length,
|
|
80
87
|
// 光标起始位置累加
|
|
81
|
-
wordCount:
|
|
88
|
+
wordCount: newContent.length
|
|
82
89
|
});
|
|
83
|
-
if (onChange) onChange(
|
|
90
|
+
if (onChange) onChange(newContent);
|
|
84
91
|
setTimeout(function () {
|
|
85
92
|
moveToCursor(key.length); // 重新定位光标
|
|
86
93
|
});
|
|
87
|
-
}, [vartData]);
|
|
94
|
+
}, [vartData, maxLength]);
|
|
88
95
|
|
|
89
96
|
/**
|
|
90
97
|
* 指定位置插入标签占位符字符串,当光标有选中一段字符时,会将直接将其替换
|
|
@@ -273,13 +280,14 @@ var VarTemplate = function VarTemplate(props) {
|
|
|
273
280
|
onChange: function onChange(e) {
|
|
274
281
|
return handleInputChange(e);
|
|
275
282
|
},
|
|
276
|
-
disabled: disabled || fieldStatus === 'disabled'
|
|
283
|
+
disabled: disabled || fieldStatus === 'disabled',
|
|
284
|
+
maxLength: maxLength
|
|
277
285
|
})), showCountTip && /*#__PURE__*/_react.default.createElement("div", {
|
|
278
286
|
className: "spec-vart-desc",
|
|
279
287
|
style: {
|
|
280
288
|
marginTop: '4px',
|
|
281
289
|
fontSize: '12px'
|
|
282
290
|
}
|
|
283
|
-
}, (lang === null || lang === void 0 ? void 0 : lang['filed.varTemplate.enter']) || '您已录入', " ", /*#__PURE__*/_react.default.createElement("b", null, vartData.wordCount), " ", (lang === null || lang === void 0 ? void 0 : lang['filed.varTemplate.words']) || '个字'));
|
|
291
|
+
}, (lang === null || lang === void 0 ? void 0 : lang['filed.varTemplate.enter']) || '您已录入', " ", /*#__PURE__*/_react.default.createElement("b", null, vartData.wordCount, maxLength ? "/".concat(maxLength) : ''), " ", (lang === null || lang === void 0 ? void 0 : lang['filed.varTemplate.words']) || '个字'));
|
|
284
292
|
};
|
|
285
293
|
var _default = exports.default = VarTemplate;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
//
|
|
22
|
+
// const useDebounce = (value, wait: number) => {
|
|
23
|
+
// const [debounceValue, setDebounceValue] = useState(value)
|
|
24
|
+
// useEffect(() => {
|
|
25
|
+
// const timer = setTimeout(() => setDebounceValue(value), wait)
|
|
26
|
+
// return () => clearTimeout(timer)
|
|
27
|
+
// }, [value, wait])
|
|
28
|
+
// return debounceValue
|
|
29
|
+
// }
|
|
30
|
+
|
|
31
|
+
var Navigation = function Navigation(props) {
|
|
32
|
+
var componentName = 'spec-navigation';
|
|
33
|
+
var _useStyle = (0, _style.default)(componentName),
|
|
34
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
35
|
+
wrapSSR = _useStyle2[0],
|
|
36
|
+
hashId = _useStyle2[1];
|
|
37
|
+
var items = props.items;
|
|
38
|
+
var _useState = (0, _react.useState)([]),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
visibleItems = _useState2[0],
|
|
41
|
+
setVisibleItems = _useState2[1];
|
|
42
|
+
var _useState3 = (0, _react.useState)([]),
|
|
43
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
+
hiddenItems = _useState4[0],
|
|
45
|
+
setHiddenItems = _useState4[1];
|
|
46
|
+
var _useState5 = (0, _react.useState)(false),
|
|
47
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
48
|
+
showMore = _useState6[0],
|
|
49
|
+
setShowMore = _useState6[1];
|
|
50
|
+
var listRef = (0, _react.useRef)(null);
|
|
51
|
+
var containerRef = (0, _react.useRef)(null);
|
|
52
|
+
var itemsRef = (0, _react.useRef)([]);
|
|
53
|
+
var moreButtonRef = (0, _react.useRef)(null);
|
|
54
|
+
var _useState7 = (0, _react.useState)(0),
|
|
55
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
56
|
+
containerWidth = _useState8[0],
|
|
57
|
+
setContainerWidth = _useState8[1];
|
|
58
|
+
var _useState9 = (0, _react.useState)(0),
|
|
59
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
60
|
+
moreButtonWidth = _useState10[0],
|
|
61
|
+
setMoreButtonWidth = _useState10[1];
|
|
62
|
+
// 使用lodash的debounce函数
|
|
63
|
+
var debouncedHandleChange = _lodash.default.debounce(function (_ref) {
|
|
64
|
+
var visible = _ref.visible,
|
|
65
|
+
hidden = _ref.hidden;
|
|
66
|
+
// console.log(event.target.value);
|
|
67
|
+
setVisibleItems(visible);
|
|
68
|
+
setHiddenItems(hidden);
|
|
69
|
+
}, 100); // 延迟500毫秒执行
|
|
70
|
+
|
|
71
|
+
(0, _react.useEffect)(function () {
|
|
72
|
+
var calculateLayout = function calculateLayout() {
|
|
73
|
+
if (!containerRef.current) return;
|
|
74
|
+
|
|
75
|
+
// const containerWidth = containerRef.current.offsetWidth;
|
|
76
|
+
// const moreButtonWidth = moreButtonRef.current?.offsetWidth || 0;
|
|
77
|
+
var totalWidth = 0;
|
|
78
|
+
var visible = []; // 显示的
|
|
79
|
+
var hidden = []; // 隐藏的
|
|
80
|
+
|
|
81
|
+
itemsRef.current.forEach(function (itemEl, index) {
|
|
82
|
+
if (!itemEl) return;
|
|
83
|
+
var itemWidth = itemEl.offsetWidth;
|
|
84
|
+
var remainingWidth = containerWidth - totalWidth - moreButtonWidth;
|
|
85
|
+
if (remainingWidth >= itemWidth && !hidden.length) {
|
|
86
|
+
totalWidth += itemWidth;
|
|
87
|
+
visible.push(items[index]);
|
|
88
|
+
} else {
|
|
89
|
+
hidden.push(items[index]);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
debouncedHandleChange({
|
|
93
|
+
visible: visible,
|
|
94
|
+
hidden: hidden
|
|
95
|
+
});
|
|
96
|
+
// setVisibleItems(visible);
|
|
97
|
+
// setHiddenItems(hidden);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// 初始计算
|
|
101
|
+
calculateLayout();
|
|
102
|
+
|
|
103
|
+
// 添加窗口resize监听
|
|
104
|
+
var handleResize = function handleResize() {
|
|
105
|
+
calculateLayout();
|
|
106
|
+
setShowMore(false); // 窗口resize时关闭下拉菜单
|
|
107
|
+
};
|
|
108
|
+
window.addEventListener('resize', handleResize);
|
|
109
|
+
return function () {
|
|
110
|
+
return window.removeEventListener('resize', handleResize);
|
|
111
|
+
};
|
|
112
|
+
}, [items, containerWidth, moreButtonWidth]);
|
|
113
|
+
(0, _react.useEffect)(function () {
|
|
114
|
+
var container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current; // ?.offsetWidth;
|
|
115
|
+
setContainerWidth((container === null || container === void 0 ? void 0 : container.clientWidth) || 0);
|
|
116
|
+
var button = moreButtonRef === null || moreButtonRef === void 0 ? void 0 : moreButtonRef.current; // ?.offsetWidth;
|
|
117
|
+
setMoreButtonWidth((button === null || button === void 0 ? void 0 : button.clientWidth) || 0);
|
|
118
|
+
}, [containerRef === null || containerRef === void 0 ? void 0 : containerRef.current, moreButtonRef === null || moreButtonRef === void 0 ? void 0 : moreButtonRef.current, hiddenItems]);
|
|
119
|
+
// useEffect(() => {
|
|
120
|
+
// const button = moreButtonRef?.current // ?.offsetWidth;
|
|
121
|
+
// setMoreButtonWidth(button?.clientWidth || 0)
|
|
122
|
+
// }, [moreButtonRef?.current, hiddenItems])
|
|
123
|
+
// console.log(containerWidth, moreButtonWidth)
|
|
124
|
+
return wrapSSR( /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
style: {
|
|
126
|
+
width: '100%'
|
|
127
|
+
}
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
129
|
+
ref: listRef,
|
|
130
|
+
style: {
|
|
131
|
+
width: '100%',
|
|
132
|
+
height: '20px',
|
|
133
|
+
backgroundColor: '#ff1133'
|
|
134
|
+
}
|
|
135
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
136
|
+
ref: containerRef,
|
|
137
|
+
className: (0, _classnames.default)(componentName, hashId, "spec-navigation-container"),
|
|
138
|
+
style: {
|
|
139
|
+
// display: 'flex',
|
|
140
|
+
width: '100%'
|
|
141
|
+
// // overflow: 'hidden',
|
|
142
|
+
// boxSizing: "border-box",
|
|
143
|
+
// position: 'relative',
|
|
144
|
+
// paddingRight: '80px', // 为更多按钮预留空间
|
|
145
|
+
}
|
|
146
|
+
}, items.map(function (item, index) {
|
|
147
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
148
|
+
className: 'spec-navigation-item',
|
|
149
|
+
key: item.id,
|
|
150
|
+
ref: function ref(el) {
|
|
151
|
+
return el && (itemsRef.current[index] = el);
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
opacity: visibleItems.includes(item) ? '1' : '0'
|
|
155
|
+
}
|
|
156
|
+
}, item.label);
|
|
157
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
158
|
+
className: 'spec-navigation-item more-item',
|
|
159
|
+
style: {
|
|
160
|
+
position: 'relative',
|
|
161
|
+
flexShrink: 0,
|
|
162
|
+
display: hiddenItems.length > 0 ? 'block' : 'none'
|
|
163
|
+
}
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
165
|
+
ref: moreButtonRef,
|
|
166
|
+
onClick: function onClick() {
|
|
167
|
+
return setShowMore(!showMore);
|
|
168
|
+
},
|
|
169
|
+
style: {
|
|
170
|
+
marginLeft: '8px'
|
|
171
|
+
}
|
|
172
|
+
}, "\u66F4\u591A"), showMore && /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
+
style: {
|
|
174
|
+
position: 'absolute',
|
|
175
|
+
top: '100%',
|
|
176
|
+
right: 0,
|
|
177
|
+
backgroundColor: 'white',
|
|
178
|
+
border: '1px solid #ccc',
|
|
179
|
+
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
|
180
|
+
zIndex: 100
|
|
181
|
+
}
|
|
182
|
+
}, hiddenItems.map(function (item) {
|
|
183
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
184
|
+
key: item.id,
|
|
185
|
+
style: {
|
|
186
|
+
padding: '8px 16px',
|
|
187
|
+
whiteSpace: 'nowrap'
|
|
188
|
+
}
|
|
189
|
+
}, item.label);
|
|
190
|
+
}))))));
|
|
191
|
+
};
|
|
192
|
+
var _default = exports.default = Navigation;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _genStyleHook = require("../../theme/utils/genStyleHook");
|
|
8
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
var NavLeafScrollStyleFunc = function NavLeafScrollStyleFunc(prefix) {
|
|
13
|
+
var prepareComponentToken = function prepareComponentToken(token) {
|
|
14
|
+
return {
|
|
15
|
+
fontWeight: 400
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
19
|
+
var prefixCls = ".".concat(prefix);
|
|
20
|
+
return [_defineProperty({}, prefixCls, {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
width: '100%',
|
|
23
|
+
overflow: 'hidden',
|
|
24
|
+
boxSizing: "border-box",
|
|
25
|
+
// position: 'relative',
|
|
26
|
+
// paddingRight: '80px',
|
|
27
|
+
|
|
28
|
+
outline: 'none',
|
|
29
|
+
'.spec-navigation-item': {
|
|
30
|
+
position: 'relative',
|
|
31
|
+
display: 'inline-block',
|
|
32
|
+
flexShrink: 0,
|
|
33
|
+
padding: '0 16px',
|
|
34
|
+
whiteSpace: 'nowrap'
|
|
35
|
+
}
|
|
36
|
+
})];
|
|
37
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
var _default = exports.default = NavLeafScrollStyleFunc;
|
|
@@ -68,7 +68,7 @@ var WrapperContent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
return wrapSSR( /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
-
className: (0, _classnames.default)(componentName, className, noMargin ? 'has-margin' : '', proLayoutProps !== null && proLayoutProps !== void 0 && (_proLayoutProps$heade = proLayoutProps.header) !== null && _proLayoutProps$heade !== void 0 && _proLayoutProps$heade.fixed || header !== null && header !== void 0 && header.fixed ? componentName + '-fixed' : '', hashId),
|
|
71
|
+
className: (0, _classnames.default)(componentName, className, noMargin ? 'has-no-margin' : '', proLayoutProps !== null && proLayoutProps !== void 0 && (_proLayoutProps$heade = proLayoutProps.header) !== null && _proLayoutProps$heade !== void 0 && _proLayoutProps$heade.fixed || header !== null && header !== void 0 && header.fixed ? componentName + '-fixed' : '', hashId),
|
|
72
72
|
style: style,
|
|
73
73
|
ref: contentRef
|
|
74
74
|
}, proLayoutProps !== null && proLayoutProps !== void 0 && proLayoutProps.header || header ? /*#__PURE__*/_react.default.createElement(_ContentHeader.default
|
|
@@ -20,7 +20,7 @@ var WrapperContentStyleFunc = function WrapperContentStyleFunc(prefix) {
|
|
|
20
20
|
};
|
|
21
21
|
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
22
22
|
var prefixCls = ".".concat(prefix);
|
|
23
|
-
return [_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, _objectSpread(_objectSpread({
|
|
23
|
+
return [_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, _objectSpread(_objectSpread({
|
|
24
24
|
position: 'relative',
|
|
25
25
|
// padding: token.paddingMD,
|
|
26
26
|
// margin: -token.marginMD,
|
|
@@ -57,6 +57,8 @@ var WrapperContentStyleFunc = function WrapperContentStyleFunc(prefix) {
|
|
|
57
57
|
height: '100%'
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
}), '&.has-no-margin', {
|
|
61
|
+
margin: 0
|
|
60
62
|
}), '.spec-wrapper-content-spinning', {
|
|
61
63
|
// width: '100%',
|
|
62
64
|
// height: '100%'
|
|
@@ -92,8 +92,10 @@ var StandardTable = function StandardTable(props) {
|
|
|
92
92
|
showSizeChanger: true,
|
|
93
93
|
pageSizeOptions: ['5', '10', '15', '20', '30', '50'],
|
|
94
94
|
showTotal: function showTotal(total, range) {
|
|
95
|
-
|
|
95
|
+
var unitKey = "".concat((lang === null || lang === void 0 ? void 0 : lang['table.pagination.unit']) || '条');
|
|
96
|
+
return "".concat(range[0], "-").concat(range[1], " ").concat(unitKey, ",").concat((lang === null || lang === void 0 ? void 0 : lang['table.pagination.total']) || '共', " ").concat(total, " ").concat(unitKey);
|
|
96
97
|
},
|
|
98
|
+
// Total ${total} items
|
|
97
99
|
pageSize: (pagination === null || pagination === void 0 ? void 0 : pagination.pageSize) || (pagination === null || pagination === void 0 ? void 0 : pagination.size)
|
|
98
100
|
}, paginationConfig), pagination);
|
|
99
101
|
if (columns) {
|
|
@@ -124,7 +126,7 @@ var StandardTable = function StandardTable(props) {
|
|
|
124
126
|
var _colItem4, _colItem5, _colItem6;
|
|
125
127
|
if (recombinationGroup.length === 0) return '-';
|
|
126
128
|
return /*#__PURE__*/_react.default.createElement(_index.default, _extends({
|
|
127
|
-
type: "
|
|
129
|
+
type: "action",
|
|
128
130
|
min: colItem.min || 2 // 配置按钮展示最少数量,其他的将会被折叠
|
|
129
131
|
,
|
|
130
132
|
options: recombinationGroup,
|
|
@@ -204,7 +206,7 @@ var StandardTable = function StandardTable(props) {
|
|
|
204
206
|
var notShowHead = !extra && !placeButtonGroup && !placeTitle; // 不显示ant-card-head
|
|
205
207
|
return wrapSSR( /*#__PURE__*/_react.default.createElement(_antd.Card, {
|
|
206
208
|
className: (0, _classnames.default)(componentName, 'standard-table', className, hashId),
|
|
207
|
-
|
|
209
|
+
variant: 'borderless',
|
|
208
210
|
title: notShowHead ? null : buttonGroupPlacement === 'left' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, placeTitle, placeButtonGroup) : placeTitle,
|
|
209
211
|
extra: notShowHead ? null : buttonGroupPlacement === 'left' ? extra : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, placeButtonGroup, extra)
|
|
210
212
|
}, /*#__PURE__*/_react.default.createElement(_antd.Table, _extends({
|