shineout 1.8.0 → 1.9.0-rc.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 (127) hide show
  1. package/css/AnimationList/AbsoluteList.js +1 -1
  2. package/css/Cascader/Result.js +3 -2
  3. package/css/Cascader/styles/cascader.css +9 -1
  4. package/css/Checkbox/Group.js +6 -3
  5. package/css/Checkbox/index.d.ts +1 -1
  6. package/css/DatePicker/Container.js +33 -12
  7. package/css/DatePicker/Month.js +7 -1
  8. package/css/DatePicker/Text.js +3 -3
  9. package/css/DatePicker/index.d.ts +9 -0
  10. package/css/DatePicker/styles/datepicker.css +28 -1
  11. package/css/Datum/Tree.js +2 -1
  12. package/css/EditableArea/EditableArea.js +73 -14
  13. package/css/EditableArea/index.d.ts +37 -1
  14. package/css/Form/styles/form.css +62 -5
  15. package/css/Input/Group.js +2 -1
  16. package/css/Input/Input.js +21 -7
  17. package/css/Input/index.d.ts +19 -0
  18. package/css/InputTitle/index.js +11 -0
  19. package/css/InputTitle/inputTitle.js +51 -0
  20. package/css/InputTitle/styles/index.js +13 -0
  21. package/css/InputTitle/styles/inputTitle.css +78 -0
  22. package/css/Menu/Root.js +10 -4
  23. package/css/Modal/events.js +6 -3
  24. package/css/Rule/index.d.ts +26 -3
  25. package/css/Scroll/Scroll.js +31 -11
  26. package/css/Select/Result.js +23 -14
  27. package/css/Select/Select.js +6 -3
  28. package/css/Select/index.d.ts +9 -0
  29. package/css/Select/styles/select.css +234 -151
  30. package/css/Table/SeperateTable.js +9 -5
  31. package/css/Table/resizable.js +1 -1
  32. package/css/Textarea/Textarea.js +45 -13
  33. package/css/Textarea/index.d.ts +68 -23
  34. package/css/Textarea/index.js +15 -1
  35. package/css/Tooltip/styles/tooltip.css +31 -31
  36. package/css/hoc/inputBorder.js +2 -1
  37. package/css/index.d.ts +2 -1
  38. package/css/index.js +6 -2
  39. package/css/utils/cleanProps.js +1 -1
  40. package/dist/shineout.js +713 -303
  41. package/dist/shineout.js.map +1 -1
  42. package/dist/shineout.min.js +1 -1
  43. package/dist/theme.antd.css +1 -1
  44. package/dist/theme.antd2.css +1 -1
  45. package/dist/theme.default.css +1 -1
  46. package/dist/theme.shineout.css +1 -1
  47. package/es/AnimationList/AbsoluteList.js +1 -1
  48. package/es/Cascader/Result.js +3 -2
  49. package/es/Cascader/styles/cascader.less +11 -1
  50. package/es/Checkbox/Group.js +6 -3
  51. package/es/Checkbox/index.d.ts +1 -1
  52. package/es/DatePicker/Container.js +31 -12
  53. package/es/DatePicker/Month.js +7 -1
  54. package/es/DatePicker/Text.js +3 -3
  55. package/es/DatePicker/index.d.ts +9 -0
  56. package/es/DatePicker/styles/datepicker.less +37 -1
  57. package/es/Datum/Tree.js +2 -1
  58. package/es/EditableArea/EditableArea.js +70 -14
  59. package/es/EditableArea/index.d.ts +37 -1
  60. package/es/Form/styles/form.less +60 -5
  61. package/es/Input/Group.js +2 -1
  62. package/es/Input/Input.js +17 -5
  63. package/es/Input/index.d.ts +19 -0
  64. package/es/InputTitle/index.js +2 -0
  65. package/es/InputTitle/inputTitle.js +40 -0
  66. package/es/InputTitle/styles/index.js +3 -0
  67. package/es/InputTitle/styles/inputTitle.less +84 -0
  68. package/es/Menu/Root.js +9 -4
  69. package/es/Modal/events.js +6 -3
  70. package/es/Rule/index.d.ts +26 -3
  71. package/es/Scroll/Scroll.js +31 -11
  72. package/es/Select/Result.js +22 -14
  73. package/es/Select/Select.js +6 -3
  74. package/es/Select/index.d.ts +9 -0
  75. package/es/Select/styles/select.less +229 -146
  76. package/es/Table/SeperateTable.js +9 -5
  77. package/es/Table/resizable.js +1 -1
  78. package/es/Textarea/Textarea.js +42 -13
  79. package/es/Textarea/index.d.ts +68 -23
  80. package/es/Textarea/index.js +14 -1
  81. package/es/Tooltip/styles/tooltip.less +7 -5
  82. package/es/hoc/inputBorder.js +2 -1
  83. package/es/index.d.ts +2 -1
  84. package/es/index.js +2 -1
  85. package/es/styles/themes/base.less +11 -1
  86. package/es/utils/cleanProps.js +1 -1
  87. package/lib/AnimationList/AbsoluteList.js +1 -1
  88. package/lib/Cascader/Result.js +3 -2
  89. package/lib/Cascader/styles/cascader.less +11 -1
  90. package/lib/Checkbox/Group.js +6 -3
  91. package/lib/Checkbox/index.d.ts +1 -1
  92. package/lib/DatePicker/Container.js +33 -12
  93. package/lib/DatePicker/Month.js +7 -1
  94. package/lib/DatePicker/Text.js +3 -3
  95. package/lib/DatePicker/index.d.ts +9 -0
  96. package/lib/DatePicker/styles/datepicker.less +37 -1
  97. package/lib/Datum/Tree.js +2 -1
  98. package/lib/EditableArea/EditableArea.js +73 -14
  99. package/lib/EditableArea/index.d.ts +37 -1
  100. package/lib/Form/styles/form.less +60 -5
  101. package/lib/Input/Group.js +2 -1
  102. package/lib/Input/Input.js +21 -7
  103. package/lib/Input/index.d.ts +19 -0
  104. package/lib/InputTitle/index.js +11 -0
  105. package/lib/InputTitle/inputTitle.js +51 -0
  106. package/lib/InputTitle/styles/index.js +13 -0
  107. package/lib/InputTitle/styles/inputTitle.less +84 -0
  108. package/lib/Menu/Root.js +10 -4
  109. package/lib/Modal/events.js +6 -3
  110. package/lib/Rule/index.d.ts +26 -3
  111. package/lib/Scroll/Scroll.js +31 -11
  112. package/lib/Select/Result.js +23 -14
  113. package/lib/Select/Select.js +6 -3
  114. package/lib/Select/index.d.ts +9 -0
  115. package/lib/Select/styles/select.less +229 -146
  116. package/lib/Table/SeperateTable.js +9 -5
  117. package/lib/Table/resizable.js +1 -1
  118. package/lib/Textarea/Textarea.js +45 -13
  119. package/lib/Textarea/index.d.ts +68 -23
  120. package/lib/Textarea/index.js +15 -1
  121. package/lib/Tooltip/styles/tooltip.less +7 -5
  122. package/lib/hoc/inputBorder.js +2 -1
  123. package/lib/index.d.ts +2 -1
  124. package/lib/index.js +6 -2
  125. package/lib/styles/themes/base.less +11 -1
  126. package/lib/utils/cleanProps.js +1 -1
  127. package/package.json +1 -1
@@ -115,8 +115,8 @@ function _default(List) {
115
115
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
116
116
  var _this2 = this;
117
117
 
118
- if ((0, _shallowEqual.default)(prevProps.value, this.props.value)) return;
119
118
  if (!this.props.focus) this.ajustdoc = false;
119
+ if ((0, _shallowEqual.default)(prevProps.value, this.props.value)) return;
120
120
  setTimeout(function () {
121
121
  _this2.forceUpdate();
122
122
  });
@@ -349,11 +349,12 @@ function (_PureComponent) {
349
349
  compressed = _this$props8.compressed,
350
350
  multiple = _this$props8.multiple;
351
351
  var result = value.length === 0 ? this.renderPlaceholder() : this.renderResult();
352
+ var clearEl = this.renderClear();
352
353
  return _react.default.createElement("div", {
353
354
  ref: this.bindResult,
354
- className: (0, _styles3.cascaderClass)('result', multiple && compressed && 'compressed'),
355
+ className: (0, _styles3.cascaderClass)('result', multiple && compressed && 'compressed', clearEl && 'result-clearable'),
355
356
  style: style
356
- }, result, this.renderIndicator(), this.renderClear());
357
+ }, result, this.renderIndicator(), clearEl);
357
358
  };
358
359
 
359
360
  return Result;
@@ -127,10 +127,18 @@
127
127
  background-color: inherit;
128
128
  color: inherit;
129
129
  }
130
- .so-cascader:not(.so-cascader-disabled) .so-cascader-focus .so-cascader-close,
130
+ .so-cascader-disabled .so-cascader-result .so-select-multi {
131
+ visibility: visible;
132
+ cursor: not-allowed;
133
+ }
134
+ .so-cascader:not(.so-cascader-disabled).so-cascader-focus .so-cascader-close,
131
135
  .so-cascader:not(.so-cascader-disabled) .so-cascader-result:hover .so-cascader-close {
132
136
  display: block;
133
137
  }
138
+ .so-cascader:not(.so-cascader-disabled).so-cascader-focus .so-cascader-result-clearable .so-select-multi,
139
+ .so-cascader:not(.so-cascader-disabled) .so-cascader-result-clearable:hover .so-select-multi {
140
+ visibility: hidden;
141
+ }
134
142
  .so-cascader-multiple .so-cascader-close {
135
143
  right: 19px;
136
144
  }
@@ -108,12 +108,14 @@ function (_PureComponent) {
108
108
  data = _this$props2.data,
109
109
  datum = _this$props2.datum,
110
110
  keygen = _this$props2.keygen,
111
- children = _this$props2.children;
111
+ children = _this$props2.children,
112
+ style = _this$props2.style;
112
113
  var className = (0, _classnames.default)((0, _styles.checkinputClass)('group', ['no-block', 'block'][Number(block)]), this.props.className);
113
114
 
114
115
  if (data === undefined) {
115
116
  return _react.default.createElement("div", {
116
- className: className
117
+ className: className,
118
+ style: style
117
119
  }, _react.default.createElement(_context.Provider, {
118
120
  value: {
119
121
  onRawChange: this.handleRawChange,
@@ -123,7 +125,8 @@ function (_PureComponent) {
123
125
  }
124
126
 
125
127
  return _react.default.createElement("div", {
126
- className: className
128
+ className: className,
129
+ style: style
127
130
  }, data.map(function (d, i) {
128
131
  return _react.default.createElement(_Checkbox.default, {
129
132
  checked: datum.check(d),
@@ -47,7 +47,7 @@ export interface CheckboxProps<T> extends StandardProps, FormItemStandardProps<T
47
47
 
48
48
  // attention: checkbox group value is array
49
49
 
50
- export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'> {
50
+ export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'>, StandardProps {
51
51
 
52
52
  /**
53
53
  * The data item
@@ -55,6 +55,10 @@ var _locale = require("../locale");
55
55
 
56
56
  var _config = require("../config");
57
57
 
58
+ var _InputTitle = _interopRequireDefault(require("../InputTitle"));
59
+
60
+ var _styles3 = require("../InputTitle/styles");
61
+
58
62
  var FadeList = (0, _AnimationList.default)(['fade'], 'fast');
59
63
  var OptionList = (0, _AbsoluteList.default)(function (_ref) {
60
64
  var focus = _ref.focus,
@@ -324,14 +328,15 @@ function (_PureComponent) {
324
328
  }
325
329
  };
326
330
 
327
- _proto.handleTextChange = function handleTextChange(date, index) {
331
+ _proto.handleTextChange = function handleTextChange(date, index, e) {
328
332
  var _this4 = this;
329
333
 
330
334
  var format = this.getFormat();
331
335
  var val = date ? _utils.default.format(date, format) : '';
332
336
 
333
337
  if (!this.props.range) {
334
- this.props.onChange(val, this.triggerValueBlur.bind(this, this.handleBlur));
338
+ var close = !(e && e.target && this.element.contains(e.target));
339
+ this.props.onChange(val, close ? this.triggerValueBlur.bind(this, this.handleBlur) : undefined);
335
340
  return;
336
341
  }
337
342
 
@@ -416,7 +421,7 @@ function (_PureComponent) {
416
421
  var className = (0, _classnames.default)((0, _styles.datepickerClass)('txt', this.state["picker" + key] && 'text-focus'), _utils.default.isInvalid(date) && (0, _styles2.inputClass)('placeholder'));
417
422
  var resultFormat = formatResult || this.getFormat();
418
423
  return _react.default.createElement(_Text.default, {
419
- key: key,
424
+ key: key || 'single',
420
425
  onTextSpanRef: this.bindTextSpan,
421
426
  focusElement: this.textSpan,
422
427
  className: className,
@@ -433,22 +438,36 @@ function (_PureComponent) {
433
438
  };
434
439
 
435
440
  _proto.renderResult = function renderResult() {
441
+ var _this6 = this;
442
+
436
443
  var _this$props4 = this.props,
437
444
  disabled = _this$props4.disabled,
438
445
  range = _this$props4.range,
439
446
  placeholder = _this$props4.placeholder,
440
- type = _this$props4.type;
447
+ type = _this$props4.type,
448
+ innerTitle = _this$props4.innerTitle,
449
+ inputable = _this$props4.inputable;
441
450
  var value = this.props.value;
442
- if (!value && range) value = [];
443
- var isEmpty = !value || value.length === 0;
451
+ if (!value && range) value = []; // const isEmpty = !value || value.length === 0
452
+
444
453
  var clearable = this.props.clearable;
445
454
  if (disabled === true) clearable = false;
455
+ var isEmpty = (range ? value : [value]).reduce(function (result, str) {
456
+ var date = _this6.parseDate(str);
457
+
458
+ return result && _utils.default.isInvalid(date);
459
+ }, true);
446
460
  return _react.default.createElement("div", {
447
461
  className: (0, _styles.datepickerClass)('result')
462
+ }, _react.default.createElement(_InputTitle.default, {
463
+ className: (0, _styles.datepickerClass)('title-box'),
464
+ contentClass: (0, _styles3.inputTitleClass)('hidable'),
465
+ innerTitle: innerTitle,
466
+ open: !isEmpty || inputable && this.state.focus
448
467
  }, range ? [this.renderText(value[0], placeholder[0], 0), _react.default.createElement("span", {
449
468
  key: "-",
450
469
  className: (0, _styles.datepickerClass)('separate')
451
- }, "~"), this.renderText(value[1], placeholder[1], 1)] : this.renderText(value, placeholder), _react.default.createElement(_Icon.default, {
470
+ }, "~"), this.renderText(value[1], placeholder[1], 1)] : this.renderText(value, placeholder)), _react.default.createElement(_Icon.default, {
452
471
  className: isEmpty || !clearable ? '' : 'indecator',
453
472
  name: type === 'time' ? 'Clock' : 'Calendar'
454
473
  }), !isEmpty && clearable && _react.default.createElement(_Icon.default, {
@@ -488,7 +507,7 @@ function (_PureComponent) {
488
507
  };
489
508
 
490
509
  _proto.renderPicker = function renderPicker() {
491
- var _this6 = this;
510
+ var _this7 = this;
492
511
 
493
512
  if (!this.firstRender) return undefined;
494
513
  var _this$props6 = this.props,
@@ -517,7 +536,7 @@ function (_PureComponent) {
517
536
  range: range,
518
537
  quicks: quicks,
519
538
  value: range ? (value || []).map(function (v) {
520
- return _this6.parseDate(v);
539
+ return _this7.parseDate(v);
521
540
  }) : this.parseDate(value),
522
541
  showTimePicker: !!value,
523
542
  allowSingle: allowSingle,
@@ -536,10 +555,11 @@ function (_PureComponent) {
536
555
  range = _this$props7.range,
537
556
  size = _this$props7.size,
538
557
  disabled = _this$props7.disabled,
539
- align = _this$props7.align;
558
+ align = _this$props7.align,
559
+ innerTitle = _this$props7.innerTitle;
540
560
  var focus = this.state.focus;
541
561
  var rtl = (0, _config.isRTL)();
542
- var className = (0, _styles.datepickerClass)('inner', range && 'range', size && "size-" + size, focus && 'focus', disabled === true && 'disabled', align && "align-" + align, getCurrentPosition(this.state.position), rtl && 'rtl');
562
+ var className = (0, _styles.datepickerClass)('inner', range && 'range', size && "size-" + size, focus && 'focus', disabled === true && 'disabled', align && "align-" + align, getCurrentPosition(this.state.position), rtl && 'rtl', innerTitle && 'inner-title');
543
563
  return _react.default.createElement("div", {
544
564
  // eslint-disable-next-line
545
565
  tabIndex: disabled === true ? -1 : 0,
@@ -587,7 +607,8 @@ Container.propTypes = {
587
607
  onPickerChange: _propTypes.default.func,
588
608
  disabledTime: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]),
589
609
  align: _propTypes.default.oneOf(['left', 'right', 'center']),
590
- clearWithUndefined: _propTypes.default.bool
610
+ clearWithUndefined: _propTypes.default.bool,
611
+ innerTitle: _propTypes.default.string
591
612
  };
592
613
  Container.defaultProps = {
593
614
  clearable: true,
@@ -76,7 +76,8 @@ function (_PureComponent) {
76
76
  type = _this$props3.type,
77
77
  current = _this$props3.current,
78
78
  index = _this$props3.index,
79
- rangeDate = _this$props3.rangeDate;
79
+ rangeDate = _this$props3.rangeDate,
80
+ max = _this$props3.max;
80
81
 
81
82
  var date = _utils.default.toDate(MONTHBASE);
82
83
 
@@ -84,6 +85,10 @@ function (_PureComponent) {
84
85
  date.setFullYear(current.getFullYear());
85
86
  var isDisabled = min && _utils.default.compareMonth(min, date, 1) >= 0;
86
87
 
88
+ if (!isDisabled) {
89
+ isDisabled = max && _utils.default.compareMonth(date, max, 1) >= 0;
90
+ }
91
+
87
92
  if (!isDisabled && type === 'month' && typeof disabled === 'function') {
88
93
  isDisabled = disabled(date);
89
94
  }
@@ -137,6 +142,7 @@ Month.propTypes = {
137
142
  current: _propTypes.default.object.isRequired,
138
143
  disabled: _propTypes.default.func,
139
144
  // max: PropTypes.object,
145
+ max: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
140
146
  min: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
141
147
  onChange: _propTypes.default.func.isRequired,
142
148
  onModeChange: _propTypes.default.func.isRequired,
@@ -46,7 +46,7 @@ function (_PureComponent) {
46
46
  var _proto = Text.prototype;
47
47
 
48
48
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
49
- if (prevProps.focus !== this.props.focus && this.props.focus && this.element && this.props.focusElement === this.element) {
49
+ if (prevProps.focus !== this.props.focus && this.props.focus && this.element && (this.props.focusElement === this.element || !this.props.focusElement)) {
50
50
  _element.focusElement.end(this.element);
51
51
  }
52
52
  };
@@ -68,7 +68,7 @@ function (_PureComponent) {
68
68
  if (txt === value) return;
69
69
 
70
70
  if (txt.trim().length === 0) {
71
- onChange(undefined, index);
71
+ onChange(undefined, index, e);
72
72
  } else {
73
73
  var newValue = _utils.default.toDateWithFormat(txt, format, undefined); // if translate fail, clear
74
74
 
@@ -77,7 +77,7 @@ function (_PureComponent) {
77
77
  this.element.innerText = null;
78
78
  }
79
79
 
80
- onChange(newValue, index);
80
+ onChange(newValue, index, e);
81
81
  }
82
82
  };
83
83
 
@@ -251,6 +251,15 @@ FormItemStandardProps<T>,
251
251
  * default: none
252
252
  */
253
253
  onPickerChange?: (value: DatePickerValue, quickSelect: QuickSelect | void, areaType: AreaType) => void;
254
+
255
+ /**
256
+ * inner title
257
+ *
258
+ * 内嵌标题
259
+ *
260
+ * default: -
261
+ */
262
+ innerTitle?: string;
254
263
  }
255
264
 
256
265
  declare class DatePicker extends React.Component<DatePickerProps, {}> {
@@ -26,6 +26,15 @@ label.so-datepicker-r-time {
26
26
  padding: 0 0 8px 0;
27
27
  text-align: center;
28
28
  }
29
+ .so-datepicker-title-box > .so-input-title-box-content {
30
+ display: -webkit-box;
31
+ display: -ms-flexbox;
32
+ display: flex;
33
+ }
34
+ .so-datepicker-range .so-datepicker-title-box .so-datepicker-txt:not(.so-datepicker-text-focus) {
35
+ background: var(--primary-color-fade-10, rgba(51, 153, 255, 0.1));
36
+ border-radius: 50px;
37
+ }
29
38
  .so-datepicker-inner {
30
39
  width: 100%;
31
40
  padding: 6px 24px 6px 12px;
@@ -38,6 +47,15 @@ label.so-datepicker-r-time {
38
47
  .so-datepicker-size-large.so-datepicker-inner {
39
48
  padding: 8px 28px 8px 16px;
40
49
  }
50
+ .so-datepicker-inner-title {
51
+ padding: 4px 20px 4px 8px;
52
+ }
53
+ .so-datepicker-size-small.so-datepicker-inner-title {
54
+ padding: 2px 20px 2px 8px;
55
+ }
56
+ .so-datepicker-size-large.so-datepicker-inner-title {
57
+ padding: 4px 20px 4px 8px;
58
+ }
41
59
  .so-datepicker-result {
42
60
  position: relative;
43
61
  display: -webkit-box;
@@ -86,7 +104,7 @@ label.so-datepicker-r-time {
86
104
  .so-datepicker-separate {
87
105
  margin: 0 8px;
88
106
  }
89
- .so-datepicker-text-focus {
107
+ .so-datepicker-txt.so-datepicker-text-focus {
90
108
  background: var(--primary-color, #3399ff);
91
109
  color: #fff;
92
110
  border-radius: 50px;
@@ -492,6 +510,15 @@ label.so-datepicker-r-time {
492
510
  margin-right: 0;
493
511
  margin-left: -16px;
494
512
  }
513
+ .so-datepicker-rtl.so-datepicker-inner-title {
514
+ padding: 4px 8px 4px 20px;
515
+ }
516
+ .so-datepicker-rtl.so-datepicker-size-small.so-datepicker-inner-title {
517
+ padding: 2px 8px 2px 20px;
518
+ }
519
+ .so-datepicker-rtl.so-datepicker-size-large.so-datepicker-inner-title {
520
+ padding: 4px 8px 4px 20px;
521
+ }
495
522
  .so-datepicker-rtl .so-datepicker-picker .so-datepicker-header .so-datepicker-left,
496
523
  .so-datepicker-rtl .so-datepicker-picker .so-datepicker-header .so-datepicker-right {
497
524
  -webkit-transform: rotate(180deg);
package/css/Datum/Tree.js CHANGED
@@ -303,7 +303,8 @@ function () {
303
303
  var id = _this5.getKey(d, path[path.length - 1], i);
304
304
 
305
305
  if (_this5.dataMap.get(id)) {
306
- console.warn("There is already a key \"" + id + "\" exists. The key must be unique.");
306
+ console.error("There is already a key \"" + id + "\" exists. The key must be unique.");
307
+ return;
307
308
  }
308
309
 
309
310
  _this5.dataMap.set(id, d);
@@ -27,6 +27,14 @@ var _icons = _interopRequireDefault(require("../icons"));
27
27
 
28
28
  var _element = require("../utils/dom/element");
29
29
 
30
+ var _styles2 = require("../Input/styles");
31
+
32
+ var _InputTitle = _interopRequireDefault(require("../InputTitle"));
33
+
34
+ var _styles3 = require("../InputTitle/styles");
35
+
36
+ var noop = function noop() {};
37
+
30
38
  function formatShowValue(value) {
31
39
  if (!value && value !== 0) return '';
32
40
  var arr = String(value).split('\n');
@@ -50,6 +58,7 @@ function (_React$PureComponent) {
50
58
  _this.bindContainer = _this.bindElement.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), 'container');
51
59
  _this.bindInput = _this.bindElement.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), 'input');
52
60
  _this.renderInput = _this.renderInput.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
61
+ _this.renderPlace = _this.renderPlace.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
53
62
  _this.renderTextarea = _this.renderTextarea.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
54
63
  _this.onChange = _this.onChange.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
55
64
  _this.onBlur = _this.onBlur.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
@@ -113,13 +122,18 @@ function (_React$PureComponent) {
113
122
  delay = _this$props.delay,
114
123
  placeholder = _this$props.placeholder,
115
124
  maxHeight = _this$props.maxHeight,
116
- value = _this$props.value;
125
+ value = _this$props.value,
126
+ innerTitle = _this$props.innerTitle,
127
+ placeTitle = _this$props.placeTitle,
128
+ renderFooter = _this$props.renderFooter;
117
129
  if (!showTextarea) return null;
118
130
  return _react.default.createElement("div", {
119
131
  ref: this.bindContainer
120
132
  }, _react.default.createElement(_Textarea.default, {
121
133
  className: (0, _styles.editableAreaClass)('text-area'),
122
134
  autosize: true,
135
+ innerTitle: innerTitle,
136
+ placeTitle: placeTitle,
123
137
  value: value,
124
138
  rows: 1,
125
139
  delay: delay,
@@ -127,35 +141,76 @@ function (_React$PureComponent) {
127
141
  onBlur: this.onBlur,
128
142
  onFocus: this.handleFocus,
129
143
  placeholder: placeholder,
130
- maxHeight: maxHeight
144
+ maxHeight: maxHeight,
145
+ renderFooter: renderFooter
131
146
  }));
132
147
  };
133
148
 
134
- _proto.renderInput = function renderInput() {
149
+ _proto.renderResult = function renderResult() {
135
150
  var _this$props2 = this.props,
136
151
  placeholder = _this$props2.placeholder,
137
152
  disabled = _this$props2.disabled,
138
- value = _this$props2.value;
153
+ value = _this$props2.value,
154
+ renderResult = _this$props2.renderResult,
155
+ placeTitle = _this$props2.placeTitle,
156
+ innerTitle = _this$props2.innerTitle;
157
+ var result = renderResult(value);
158
+ return _react.default.createElement("div", {
159
+ tabIndex: disabled ? -1 : 0,
160
+ className: (0, _classnames.default)((0, _styles.editableAreaClass)('input'), (0, _styles2.inputClass)('_')),
161
+ onFocus: this.showPop
162
+ }, _react.default.createElement(_InputTitle.default, {
163
+ placeTitle: placeTitle,
164
+ innerTitle: innerTitle,
165
+ open: !!value
166
+ }, _react.default.createElement("div", {
167
+ className: (0, _classnames.default)((0, _styles2.inputClass)('spare'), (0, _styles3.inputTitleClass)('hidable')),
168
+ ref: this.bindInput
169
+ }, result || _react.default.createElement("div", {
170
+ className: (0, _styles2.inputClass)('placeholder')
171
+ }, placeholder))));
172
+ };
173
+
174
+ _proto.renderInput = function renderInput() {
175
+ var _this$props3 = this.props,
176
+ placeholder = _this$props3.placeholder,
177
+ disabled = _this$props3.disabled,
178
+ value = _this$props3.value,
179
+ innerTitle = _this$props3.innerTitle,
180
+ placeTitle = _this$props3.placeTitle;
139
181
  return _react.default.createElement(_Input.default, {
182
+ innerTitle: innerTitle,
183
+ placeTitle: placeTitle,
140
184
  forwardedRef: this.bindInput,
141
185
  placeholder: placeholder,
142
186
  value: formatShowValue(value),
187
+ onChange: noop,
143
188
  className: (0, _styles.editableAreaClass)('input'),
144
189
  onFocus: this.showPop,
145
190
  disabled: disabled
146
191
  });
147
192
  };
148
193
 
194
+ _proto.renderPlace = function renderPlace() {
195
+ var renderResult = this.props.renderResult;
196
+
197
+ if (renderResult && typeof renderResult === 'function') {
198
+ return this.renderResult();
199
+ }
200
+
201
+ return this.renderInput();
202
+ };
203
+
149
204
  _proto.render = function render() {
150
205
  var showTextarea = this.state.showTextarea;
151
- var _this$props3 = this.props,
152
- width = _this$props3.width,
153
- style = _this$props3.style,
154
- className = _this$props3.className,
155
- bordered = _this$props3.bordered,
156
- clearable = _this$props3.clearable,
157
- getPopupContainer = _this$props3.getPopupContainer,
158
- value = _this$props3.value;
206
+ var _this$props4 = this.props,
207
+ width = _this$props4.width,
208
+ style = _this$props4.style,
209
+ className = _this$props4.className,
210
+ bordered = _this$props4.bordered,
211
+ clearable = _this$props4.clearable,
212
+ getPopupContainer = _this$props4.getPopupContainer,
213
+ value = _this$props4.value;
159
214
  var cls = (0, _classnames.default)(className, (0, _styles.editableAreaClass)('_', !bordered && 'none-bordered'));
160
215
  var ms = Object.assign({
161
216
  width: width
@@ -166,7 +221,7 @@ function (_React$PureComponent) {
166
221
  return _react.default.createElement("div", {
167
222
  className: cls,
168
223
  style: ms
169
- }, this.renderInput(), _react.default.createElement(_Popover.default, {
224
+ }, this.renderPlace(), _react.default.createElement(_Popover.default, {
170
225
  visible: showTextarea,
171
226
  showArrow: false,
172
227
  className: (0, _styles.editableAreaClass)('popover'),
@@ -199,7 +254,11 @@ Editable.propTypes = {
199
254
  clearable: _propTypes.default.bool,
200
255
  getPopupContainer: _propTypes.default.func,
201
256
  maxHeight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
202
- width: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
257
+ width: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
258
+ innerTitle: _propTypes.default.node,
259
+ placeTitle: _propTypes.default.node,
260
+ renderFooter: _propTypes.default.func,
261
+ renderResult: _propTypes.default.func
203
262
  };
204
263
  var _default = Editable;
205
264
  exports.default = _default;
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { ReactNode } from "react"
2
2
  import {StandardProps, FormItemStandardProps} from '../@types/common'
3
3
 
4
4
  export interface EditableAreaProps extends StandardProps, FormItemStandardProps<string> {
@@ -92,6 +92,42 @@ export interface EditableAreaProps extends StandardProps, FormItemStandardProps<
92
92
  * default: none
93
93
  */
94
94
  width?: number | string;
95
+
96
+ /**
97
+ * inner title
98
+ *
99
+ * 内嵌标题
100
+ *
101
+ * default: -
102
+ */
103
+ innerTitle?: ReactNode,
104
+
105
+ /**
106
+ * Placeholder title, which needs to be used together with innerTitle
107
+ *
108
+ * 占位标题,需要配合 innerTitle 一起使用
109
+ *
110
+ * default: -
111
+ */
112
+ placeTitle?: ReactNode,
113
+
114
+ /**
115
+ * render textarea footer
116
+ *
117
+ * 渲染 textarea footer
118
+ *
119
+ * default: -
120
+ */
121
+ renderFooter?: (value: string)=> ReactNode,
122
+
123
+ /**
124
+ * Customize display results
125
+ *
126
+ * 自定义显示结果
127
+ *
128
+ * default: -
129
+ */
130
+ renderResult?: (value: string)=> ReactNode,
95
131
  }
96
132
 
97
133
  declare class EditableArea extends React.PureComponent<EditableAreaProps, any>{}
@@ -594,7 +594,8 @@
594
594
  overflow: hidden;
595
595
  }
596
596
  .so-input input,
597
- .so-input textarea {
597
+ .so-input textarea,
598
+ .so-input-spare {
598
599
  display: block;
599
600
  width: 100%;
600
601
  padding: 6px 12px;
@@ -642,12 +643,32 @@
642
643
  line-height: var(--common-line-height, 1.42857143);
643
644
  resize: none;
644
645
  }
645
- .so-input input.so-input-number {
646
+ .so-input input.so-input-number:not(.so-input-rtl *) {
647
+ padding-right: 22px;
648
+ }
649
+ .so-input input.so-input-number + .so-input-clear-wrapper .so-input-clear:not(.so-input-rtl *) {
650
+ right: 22px;
651
+ }
652
+ .so-input-rtl input.so-input-number {
653
+ padding-left: 22px;
654
+ }
655
+ .so-input-rtl input.so-input-number + .so-input-clear-wrapper .so-input-clear {
656
+ left: 22px;
657
+ right: auto;
658
+ }
659
+ .so-input:not(.so-input-rtl) .so-input-number-title-box .so-input-title-box-title {
646
660
  padding-right: 22px;
647
661
  }
648
- .so-input input.so-input-number + .so-input-clear-wrapper .so-input-clear {
662
+ .so-input-rtl .so-input-number-title-box .so-input-title-box-title {
663
+ padding-left: 22px;
664
+ }
665
+ .so-input:not(.so-input-rtl) .so-input-number-title-box + .so-input-clear-wrapper .so-input-clear {
649
666
  right: 22px;
650
667
  }
668
+ .so-input-rtl .so-input-number-title-box + .so-input-clear-wrapper .so-input-clear {
669
+ left: 22px;
670
+ right: auto;
671
+ }
651
672
  textarea.so-input-shadow {
652
673
  position: absolute;
653
674
  z-index: 0;
@@ -661,19 +682,55 @@ textarea.so-input-auto-size {
661
682
  textarea.so-input-textarea-resize {
662
683
  resize: vertical;
663
684
  }
685
+ .so-input-with-footer {
686
+ -webkit-box-orient: vertical;
687
+ -webkit-box-direction: normal;
688
+ -ms-flex-direction: column;
689
+ flex-direction: column;
690
+ }
691
+ .so-input-with-footer .so-input-footer {
692
+ padding: 12px 6px;
693
+ border-top: 1px solid var(--input-border-color, #ced4da);
694
+ }
664
695
  .so-input-small {
665
696
  font-size: var(--font-size-small, 12px);
666
697
  line-height: 1.5;
667
698
  }
668
- .so-input-small input {
699
+ .so-input-small input,
700
+ .so-input-small .so-input-spare {
669
701
  padding: 5px 10px;
670
702
  }
703
+ .so-input-small ::-webkit-input-placeholder,
704
+ .so-input-small .so-input-placeholder {
705
+ font-size: var(--font-size-small, 12px);
706
+ }
707
+ .so-input-small ::-ms-input-placeholder,
708
+ .so-input-small .so-input-placeholder {
709
+ font-size: var(--font-size-small, 12px);
710
+ }
711
+ .so-input-small ::placeholder,
712
+ .so-input-small .so-input-placeholder {
713
+ font-size: var(--font-size-small, 12px);
714
+ }
671
715
  .so-input-large {
672
716
  font-size: var(--font-size-large, 18px);
673
717
  }
674
- .so-input-large input {
718
+ .so-input-large input,
719
+ .so-input-large .so-input-spare {
675
720
  padding: 8px 12px;
676
721
  }
722
+ .so-input-large ::-webkit-input-placeholder,
723
+ .so-input-large .so-input-placeholder {
724
+ font-size: var(--font-size-large, 18px);
725
+ }
726
+ .so-input-large ::-ms-input-placeholder,
727
+ .so-input-large .so-input-placeholder {
728
+ font-size: var(--font-size-large, 18px);
729
+ }
730
+ .so-input-large ::placeholder,
731
+ .so-input-large .so-input-placeholder {
732
+ font-size: var(--font-size-large, 18px);
733
+ }
677
734
  .so-input.so-input-rtl {
678
735
  direction: rtl;
679
736
  }
@@ -16,7 +16,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
16
16
  function Group(props) {
17
17
  var children = props.children,
18
18
  style = props.style,
19
- other = (0, _objectWithoutPropertiesLoose2.default)(props, ["children", "style"]);
19
+ inputFocus = props.inputFocus,
20
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, ["children", "style", "inputFocus"]);
20
21
  return _react.Children.toArray(children).map(function (child, i) {
21
22
  if (typeof child === 'string') {
22
23
  return _react.default.createElement("span", {