shineout 1.9.0-rc.6 → 1.9.0

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 (235) hide show
  1. package/css/Alert/styles/index.js +2 -0
  2. package/css/AnimationList/AbsoluteList.js +47 -24
  3. package/css/AnimationList/styles/index.js +2 -0
  4. package/css/Breadcrumb/styles/index.js +2 -0
  5. package/css/Button/Button.js +3 -0
  6. package/css/Button/Group.js +3 -1
  7. package/css/Button/styles/button.css +22 -2
  8. package/css/Button/styles/index.js +2 -0
  9. package/css/Card/styles/index.js +2 -0
  10. package/css/CardGroup/styles/index.js +2 -0
  11. package/css/Carousel/styles/index.js +2 -0
  12. package/css/Cascader/Cascader.js +93 -47
  13. package/css/Cascader/styles/index.js +2 -0
  14. package/css/Checkbox/styles/index.js +2 -0
  15. package/css/DataList/styles/index.js +2 -0
  16. package/css/DatePicker/index.d.ts +5 -1
  17. package/css/DatePicker/styles/datepicker.css +1 -1
  18. package/css/DatePicker/styles/index.js +2 -0
  19. package/css/Divider/styles/index.js +2 -0
  20. package/css/Dropdown/index.js +16 -8
  21. package/css/Dropdown/styles/dropdown.css +51 -29
  22. package/css/Dropdown/styles/index.js +2 -0
  23. package/css/EditableArea/EditableArea.js +1 -1
  24. package/css/EditableArea/styles/index.js +2 -0
  25. package/css/Form/Field.js +6 -11
  26. package/css/Form/formContext.js +4 -1
  27. package/css/Form/styles/index.js +2 -0
  28. package/css/Gap/styles/index.js +2 -0
  29. package/css/Icon/styles/index.js +2 -0
  30. package/css/Image/styles/index.js +2 -0
  31. package/css/Input/Input.js +26 -7
  32. package/css/Input/Number.js +9 -2
  33. package/css/Input/clear.js +6 -3
  34. package/css/Input/index.d.ts +9 -0
  35. package/css/Input/styles/index.js +2 -0
  36. package/css/InputTitle/styles/inputTitle.css +68 -7
  37. package/css/Lazyload/styles/index.js +2 -0
  38. package/css/Menu/styles/index.js +2 -0
  39. package/css/Menu/styles/menu.css +3 -3
  40. package/css/Message/styles/index.js +2 -0
  41. package/css/Modal/styles/index.js +2 -0
  42. package/css/Pagination/styles/index.js +2 -0
  43. package/css/Popover/styles/index.js +2 -0
  44. package/css/Progress/styles/index.js +2 -0
  45. package/css/Radio/styles/index.js +2 -0
  46. package/css/Rate/styles/index.js +2 -0
  47. package/css/Rule/styles/index.js +2 -0
  48. package/css/Scroll/styles/index.js +2 -0
  49. package/css/Select/Result.js +9 -4
  50. package/css/Select/styles/index.js +2 -0
  51. package/css/Slider/styles/index.js +2 -0
  52. package/css/Spin/styles/index.js +2 -0
  53. package/css/Sticky/styles/index.js +2 -0
  54. package/css/Table/SeperateTable.js +43 -47
  55. package/css/Table/SimpleTable.js +2 -1
  56. package/css/Table/TreeExpand.js +3 -2
  57. package/css/Table/index.d.ts +9 -0
  58. package/css/Table/index.js +1 -1
  59. package/css/Table/styles/index.js +2 -0
  60. package/css/Table/styles/table.css +18 -18
  61. package/css/Tabs/styles/index.js +2 -0
  62. package/css/Tag/index.d.ts +15 -1
  63. package/css/Tag/styles/index.js +2 -0
  64. package/css/Textarea/Textarea.js +2 -2
  65. package/css/Tooltip/styles/index.js +2 -0
  66. package/css/Transfer/styles/index.js +2 -0
  67. package/css/Tree/styles/index.js +2 -0
  68. package/css/TreeSelect/Result.js +6 -3
  69. package/css/TreeSelect/styles/index.js +2 -0
  70. package/css/Upload/styles/index.js +2 -0
  71. package/css/hoc/delay.js +1 -0
  72. package/css/hoc/styles/index.js +2 -0
  73. package/css/index.d.ts +1 -2
  74. package/css/index.js +1 -3
  75. package/css/utils/vars-inject.js +1 -0
  76. package/dist/shineout.js +632 -1042
  77. package/dist/shineout.js.map +1 -1
  78. package/dist/shineout.min.js +1 -1
  79. package/dist/theme.antd.css +3 -1
  80. package/dist/theme.antd2.css +3 -1
  81. package/dist/theme.default.css +3 -1
  82. package/dist/theme.shineout.css +3 -1
  83. package/es/Alert/styles/index.js +1 -0
  84. package/es/AnimationList/AbsoluteList.js +47 -24
  85. package/es/AnimationList/styles/index.js +1 -0
  86. package/es/Breadcrumb/styles/index.js +1 -0
  87. package/es/Button/Button.js +2 -0
  88. package/es/Button/Group.js +2 -1
  89. package/es/Button/styles/button.less +24 -2
  90. package/es/Button/styles/index.js +1 -0
  91. package/es/Card/styles/index.js +1 -0
  92. package/es/CardGroup/styles/index.js +1 -0
  93. package/es/Carousel/styles/index.js +1 -0
  94. package/es/Cascader/Cascader.js +93 -47
  95. package/es/Cascader/styles/index.js +1 -0
  96. package/es/Checkbox/styles/index.js +1 -0
  97. package/es/DataList/styles/index.js +1 -0
  98. package/es/DatePicker/index.d.ts +5 -1
  99. package/es/DatePicker/styles/datepicker.less +1 -1
  100. package/es/DatePicker/styles/index.js +1 -0
  101. package/es/Divider/styles/index.js +1 -0
  102. package/es/Dropdown/index.js +15 -8
  103. package/es/Dropdown/styles/dropdown.less +66 -32
  104. package/es/Dropdown/styles/index.js +1 -0
  105. package/es/EditableArea/EditableArea.js +1 -1
  106. package/es/EditableArea/styles/index.js +1 -0
  107. package/es/Form/Field.js +6 -11
  108. package/es/Form/formContext.js +4 -1
  109. package/es/Form/styles/index.js +1 -0
  110. package/es/Gap/styles/index.js +1 -0
  111. package/es/Icon/styles/index.js +1 -0
  112. package/es/Image/styles/index.js +1 -0
  113. package/es/Input/Input.js +27 -8
  114. package/es/Input/Number.js +9 -2
  115. package/es/Input/clear.js +6 -3
  116. package/es/Input/index.d.ts +9 -0
  117. package/es/Input/styles/index.js +1 -0
  118. package/es/InputTitle/styles/inputTitle.less +41 -7
  119. package/es/Lazyload/styles/index.js +1 -0
  120. package/es/Menu/styles/index.js +1 -0
  121. package/es/Menu/styles/menu.less +1 -1
  122. package/es/Message/styles/index.js +1 -0
  123. package/es/Modal/styles/index.js +1 -0
  124. package/es/Pagination/styles/index.js +1 -0
  125. package/es/Popover/styles/index.js +1 -0
  126. package/es/Progress/styles/index.js +1 -0
  127. package/es/Radio/styles/index.js +1 -0
  128. package/es/Rate/styles/index.js +1 -0
  129. package/es/Rule/styles/index.js +1 -0
  130. package/es/Scroll/styles/index.js +1 -0
  131. package/es/Select/Result.js +8 -4
  132. package/es/Select/styles/index.js +1 -0
  133. package/es/Slider/styles/index.js +1 -0
  134. package/es/Spin/styles/index.js +1 -0
  135. package/es/Sticky/styles/index.js +1 -0
  136. package/es/Table/SeperateTable.js +43 -47
  137. package/es/Table/SimpleTable.js +2 -1
  138. package/es/Table/TreeExpand.js +3 -2
  139. package/es/Table/index.d.ts +9 -0
  140. package/es/Table/index.js +1 -1
  141. package/es/Table/styles/index.js +1 -0
  142. package/es/Table/styles/table.less +25 -25
  143. package/es/Tabs/styles/index.js +1 -0
  144. package/es/Tag/index.d.ts +15 -1
  145. package/es/Tag/styles/index.js +1 -0
  146. package/es/Textarea/Textarea.js +2 -2
  147. package/es/Tooltip/styles/index.js +1 -0
  148. package/es/Transfer/styles/index.js +1 -0
  149. package/es/Tree/styles/index.js +1 -0
  150. package/es/TreeSelect/Result.js +5 -3
  151. package/es/TreeSelect/styles/index.js +1 -0
  152. package/es/Upload/styles/index.js +1 -0
  153. package/es/hoc/delay.js +1 -0
  154. package/es/hoc/styles/index.js +1 -0
  155. package/es/index.d.ts +1 -2
  156. package/es/index.js +1 -2
  157. package/es/styles/themes/cssvar.less +2 -0
  158. package/es/utils/vars-inject.js +1 -0
  159. package/lib/Alert/styles/index.js +2 -0
  160. package/lib/AnimationList/AbsoluteList.js +47 -24
  161. package/lib/AnimationList/styles/index.js +2 -0
  162. package/lib/Breadcrumb/styles/index.js +2 -0
  163. package/lib/Button/Button.js +3 -0
  164. package/lib/Button/Group.js +3 -1
  165. package/lib/Button/styles/button.less +24 -2
  166. package/lib/Button/styles/index.js +2 -0
  167. package/lib/Card/styles/index.js +2 -0
  168. package/lib/CardGroup/styles/index.js +2 -0
  169. package/lib/Carousel/styles/index.js +2 -0
  170. package/lib/Cascader/Cascader.js +93 -47
  171. package/lib/Cascader/styles/index.js +2 -0
  172. package/lib/Checkbox/styles/index.js +2 -0
  173. package/lib/DataList/styles/index.js +2 -0
  174. package/lib/DatePicker/index.d.ts +5 -1
  175. package/lib/DatePicker/styles/datepicker.less +1 -1
  176. package/lib/DatePicker/styles/index.js +2 -0
  177. package/lib/Divider/styles/index.js +2 -0
  178. package/lib/Dropdown/index.js +16 -8
  179. package/lib/Dropdown/styles/dropdown.less +66 -32
  180. package/lib/Dropdown/styles/index.js +2 -0
  181. package/lib/EditableArea/EditableArea.js +1 -1
  182. package/lib/EditableArea/styles/index.js +2 -0
  183. package/lib/Form/Field.js +6 -11
  184. package/lib/Form/formContext.js +4 -1
  185. package/lib/Form/styles/index.js +2 -0
  186. package/lib/Gap/styles/index.js +2 -0
  187. package/lib/Icon/styles/index.js +2 -0
  188. package/lib/Image/styles/index.js +2 -0
  189. package/lib/Input/Input.js +26 -7
  190. package/lib/Input/Number.js +9 -2
  191. package/lib/Input/clear.js +6 -3
  192. package/lib/Input/index.d.ts +9 -0
  193. package/lib/Input/styles/index.js +2 -0
  194. package/lib/InputTitle/styles/inputTitle.less +41 -7
  195. package/lib/Lazyload/styles/index.js +2 -0
  196. package/lib/Menu/styles/index.js +2 -0
  197. package/lib/Menu/styles/menu.less +1 -1
  198. package/lib/Message/styles/index.js +2 -0
  199. package/lib/Modal/styles/index.js +2 -0
  200. package/lib/Pagination/styles/index.js +2 -0
  201. package/lib/Popover/styles/index.js +2 -0
  202. package/lib/Progress/styles/index.js +2 -0
  203. package/lib/Radio/styles/index.js +2 -0
  204. package/lib/Rate/styles/index.js +2 -0
  205. package/lib/Rule/styles/index.js +2 -0
  206. package/lib/Scroll/styles/index.js +2 -0
  207. package/lib/Select/Result.js +9 -4
  208. package/lib/Select/styles/index.js +2 -0
  209. package/lib/Slider/styles/index.js +2 -0
  210. package/lib/Spin/styles/index.js +2 -0
  211. package/lib/Sticky/styles/index.js +2 -0
  212. package/lib/Table/SeperateTable.js +43 -47
  213. package/lib/Table/SimpleTable.js +2 -1
  214. package/lib/Table/TreeExpand.js +3 -2
  215. package/lib/Table/index.d.ts +9 -0
  216. package/lib/Table/index.js +1 -1
  217. package/lib/Table/styles/index.js +2 -0
  218. package/lib/Table/styles/table.less +25 -25
  219. package/lib/Tabs/styles/index.js +2 -0
  220. package/lib/Tag/index.d.ts +15 -1
  221. package/lib/Tag/styles/index.js +2 -0
  222. package/lib/Textarea/Textarea.js +2 -2
  223. package/lib/Tooltip/styles/index.js +2 -0
  224. package/lib/Transfer/styles/index.js +2 -0
  225. package/lib/Tree/styles/index.js +2 -0
  226. package/lib/TreeSelect/Result.js +6 -3
  227. package/lib/TreeSelect/styles/index.js +2 -0
  228. package/lib/Upload/styles/index.js +2 -0
  229. package/lib/hoc/delay.js +1 -0
  230. package/lib/hoc/styles/index.js +2 -0
  231. package/lib/index.d.ts +1 -2
  232. package/lib/index.js +1 -3
  233. package/lib/styles/themes/cssvar.less +2 -0
  234. package/lib/utils/vars-inject.js +1 -0
  235. package/package.json +1 -1
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.alertClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _classname = _interopRequireDefault(require("../../utils/classname"));
9
11
 
10
12
  var _alert = _interopRequireDefault(require("./alert.css"));
@@ -52,8 +52,8 @@ function initRoot() {
52
52
  document.body.appendChild(root);
53
53
  }
54
54
 
55
- var getOverDocStyle = function getOverDocStyle() {
56
- return (0, _config.isRTL)() ? {
55
+ var getOverDocStyle = function getOverDocStyle(right) {
56
+ return right ? {
57
57
  left: 0,
58
58
  right: 'auto'
59
59
  } : {
@@ -162,10 +162,16 @@ function _default(List) {
162
162
  top: rootContainer.scrollTop
163
163
  };
164
164
  this.containerRect = containerRect;
165
+ this.containerScroll = containerScroll;
165
166
 
166
167
  if (listPosition.includes(position)) {
167
168
  style.left = rect.left - containerRect.left + containerScroll.left;
168
169
 
170
+ if ((0, _config.isRTL)()) {
171
+ style.right = containerRect.width - rect.width - style.left;
172
+ style.left = 'auto';
173
+ }
174
+
169
175
  if (position === 'drop-down') {
170
176
  style.top = rect.top - containerRect.top + rect.height + containerScroll.top;
171
177
  } else {
@@ -179,23 +185,18 @@ function _default(List) {
179
185
  if (h === 'left') {
180
186
  style.left = rect.left - containerRect.left + containerScroll.left;
181
187
  } else {
182
- style.left = rect.right - containerRect.left + containerScroll.left;
183
- style.transform = 'translateX(-100%)';
188
+ style.right = containerRect.width - rect.width - rect.left + containerRect.left - containerScroll.left;
189
+ style.left = 'auto';
184
190
  }
185
191
 
186
192
  if (v === 'bottom') {
187
193
  style.top = rect.bottom - containerRect.top + containerScroll.top + PICKER_V_MARGIN;
188
194
  } else {
189
195
  style.top = rect.top - containerRect.top + containerScroll.top - PICKER_V_MARGIN;
190
- style.transform = style.transform ? 'translate(-100%, -100%)' : 'translateY(-100%)';
196
+ style.transform = 'translateY(-100%)';
191
197
  }
192
198
  }
193
199
 
194
- if (rtl && style.left) {
195
- style.right = containerRect.width - rect.width - style.left;
196
- style.left = 'auto';
197
- }
198
-
199
200
  return style;
200
201
  };
201
202
 
@@ -239,30 +240,52 @@ function _default(List) {
239
240
  }
240
241
  };
241
242
 
243
+ _proto.isRight = function isRight() {
244
+ var position = this.props.position;
245
+ var isRight = false;
246
+
247
+ if (position.indexOf('right') > 1) {
248
+ isRight = true;
249
+ }
250
+
251
+ if ((0, _config.isRTL)()) {
252
+ isRight = !isRight;
253
+ }
254
+
255
+ return isRight;
256
+ };
257
+
242
258
  _proto.resetPosition = function resetPosition(clean) {
243
259
  var _this$props2 = this.props,
244
260
  focus = _this$props2.focus,
245
261
  parentElement = _this$props2.parentElement;
246
262
  if (!this.el || !focus || this.ajustdoc && !clean) return;
247
- var pos = this.el.getBoundingClientRect();
248
- var left = pos.left;
249
-
250
- if (parentElement) {
251
- // because the position changes
252
- // eslint-disable-next-line prefer-destructuring
253
- left = parentElement.getBoundingClientRect().left;
254
- }
255
-
263
+ var width = this.el.offsetWidth;
264
+ var pos = parentElement && parentElement.getBoundingClientRect() || {
265
+ left: 0,
266
+ right: 0
267
+ };
256
268
  var containerRect = this.containerRect || {
257
269
  left: 0,
258
270
  width: 0
259
271
  };
272
+ var containerScroll = this.containerScroll || {
273
+ left: 0
274
+ };
260
275
  var overdoc;
261
276
 
262
- if ((0, _config.isRTL)()) {
263
- overdoc = pos.left < containerRect.left;
277
+ if (this.isRight()) {
278
+ if ((0, _config.isRTL)() && containerScroll.left) {
279
+ // this condition the style left: 0 will not meet expect so not set overdoc
280
+ overdoc = false;
281
+ } else {
282
+ overdoc = pos.right - width < containerRect.left;
283
+ }
284
+ } else if (!(0, _config.isRTL)() && containerScroll.left) {
285
+ // this condition the style right: 0 will not meet expect so not set overdoc
286
+ overdoc = false;
264
287
  } else {
265
- overdoc = left - containerRect.left + pos.width > (containerRect.width || _document.docSize.width);
288
+ overdoc = pos.left - containerRect.left + width + containerScroll.left > (containerRect.width || _document.docSize.width);
266
289
  }
267
290
 
268
291
  if (this.state.overdoc === overdoc) return;
@@ -294,7 +317,7 @@ function _default(List) {
294
317
  props = (0, _objectWithoutPropertiesLoose2.default)(_this$props3, ["parentElement", "absolute", "focus", "rootClass", "position", "scrollLeft", "scrollTop", "scrollElement", "style", "zIndex", "getResetPosition", "autoAdapt"]);
295
318
  var parsed = parseInt(zIndex, 10);
296
319
  if (!Number.isNaN(parsed)) style.zIndex = parsed;
297
- var mergeStyle = Object.assign({}, style, this.state.overdoc ? getOverDocStyle() : undefined);
320
+ var mergeStyle = Object.assign({}, style, this.state.overdoc ? getOverDocStyle(this.isRight()) : undefined);
298
321
  return _react.default.createElement(List, (0, _extends2.default)({
299
322
  getRef: this.handleRef
300
323
  }, props, {
@@ -339,7 +362,7 @@ function _default(List) {
339
362
  style = _ref.style;
340
363
 
341
364
  this.element.className = mergeClass;
342
- var mergeStyle = Object.assign({}, style, props.style, this.state.overdoc ? getOverDocStyle() : undefined);
365
+ var mergeStyle = Object.assign({}, style, props.style, this.state.overdoc ? getOverDocStyle(this.isRight()) : undefined);
343
366
  if (zIndex || typeof zIndex === 'number') mergeStyle.zIndex = parseInt(zIndex, 10);
344
367
  return _reactDom.default.createPortal(_react.default.createElement(List, (0, _extends2.default)({
345
368
  getRef: this.handleRef
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.listClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _classname = _interopRequireDefault(require("../../utils/classname"));
9
11
 
10
12
  var _list = _interopRequireDefault(require("./list.css"));
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.breadcrumbClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _breadcrumb = _interopRequireDefault(require("./breadcrumb.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -29,6 +29,8 @@ var _element = require("../utils/dom/element");
29
29
 
30
30
  var _styles = require("./styles");
31
31
 
32
+ var _config = require("../config");
33
+
32
34
  var Button =
33
35
  /*#__PURE__*/
34
36
  function (_PureComponent) {
@@ -80,6 +82,7 @@ function (_PureComponent) {
80
82
  large: size === 'large',
81
83
  small: size === 'small',
82
84
  text: text && 'text',
85
+ rtl: (0, _config.isRTL)(),
83
86
  disabled: disabled
84
87
  }), this.props.className);
85
88
 
@@ -21,6 +21,8 @@ var _proptypes = require("../utils/proptypes");
21
21
 
22
22
  var _styles = require("./styles");
23
23
 
24
+ var _config = require("../config");
25
+
24
26
  var ButtonGroup =
25
27
  /*#__PURE__*/
26
28
  function (_PureComponent) {
@@ -39,7 +41,7 @@ function (_PureComponent) {
39
41
  size = _this$props.size,
40
42
  type = _this$props.type;
41
43
  var typeSetted = type !== 'default';
42
- var className = (0, _classnames.default)((0, _styles.buttonClass)('group', (outline || !typeSetted) && 'outline'), this.props.className);
44
+ var className = (0, _classnames.default)((0, _styles.buttonClass)('group', (outline || !typeSetted) && 'outline', (0, _config.isRTL)() && 'group-rtl'), this.props.className);
43
45
  return _react.default.createElement("div", {
44
46
  className: className
45
47
  }, _react.Children.toArray(children).map(function (child) {
@@ -889,27 +889,47 @@ fieldset[disabled] .so-button-link:focus {
889
889
  -ms-transform: translateY(-50%);
890
890
  transform: translateY(-50%);
891
891
  }
892
+ .so-button-group-rtl.so-button-group .so-button:before {
893
+ left: auto;
894
+ right: 0;
895
+ }
892
896
  .so-button-group .so-button:first-child {
893
897
  margin-left: 0;
894
898
  border-left-width: 1px;
895
899
  }
900
+ .so-button-group-rtl.so-button-group .so-button:first-child {
901
+ border-right-width: 1px;
902
+ border-left-width: 0;
903
+ }
896
904
  .so-button-group .so-button:first-child:before {
897
905
  display: none;
898
906
  }
899
907
  .so-button-group .so-button:last-child {
900
908
  border-right-width: 1px;
901
909
  }
910
+ .so-button-group-rtl.so-button-group .so-button:last-child {
911
+ border-left-width: 1px;
912
+ border-right-width: 0;
913
+ }
902
914
  .so-button-group .so-button:not(:first-child):not(:last-child) {
903
915
  border-radius: 0;
904
916
  }
905
- .so-button-group .so-button:first-child:not(:last-child) {
917
+ .so-button-group .so-button:first-child:not(:last-child):not(.so-button-rtl) {
906
918
  border-bottom-right-radius: 0;
907
919
  border-top-right-radius: 0;
908
920
  }
909
- .so-button-group .so-button:last-child:not(:first-child) {
921
+ .so-button-group .so-button:first-child:not(:last-child).so-button-rtl {
910
922
  border-bottom-left-radius: 0;
911
923
  border-top-left-radius: 0;
912
924
  }
925
+ .so-button-group .so-button:last-child:not(:first-child):not(.so-button-rtl) {
926
+ border-bottom-left-radius: 0;
927
+ border-top-left-radius: 0;
928
+ }
929
+ .so-button-group .so-button:last-child:not(:first-child).so-button-rtl {
930
+ border-bottom-right-radius: 0;
931
+ border-top-right-radius: 0;
932
+ }
913
933
  .so-button-group .so-button:before {
914
934
  border-left-color: #d9d9d9;
915
935
  -webkit-transition: all 0.2s;
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.buttonClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _button = _interopRequireDefault(require("./button.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.cardClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _card = _interopRequireDefault(require("./card.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.cardGroupClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _cardGroup = _interopRequireDefault(require("./cardGroup.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.carouselClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _carousel = _interopRequireDefault(require("./carousel.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -116,6 +116,12 @@ function (_PureComponent) {
116
116
 
117
117
  var _proto = Cascader.prototype;
118
118
 
119
+ _proto.componentDidMount = function componentDidMount() {
120
+ _PureComponent.prototype.componentDidMount.call(this);
121
+
122
+ this.updatePathByValue();
123
+ };
124
+
119
125
  _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
120
126
  this.datum.mode = this.props.mode;
121
127
  var _this$props = this.props,
@@ -123,7 +129,11 @@ function (_PureComponent) {
123
129
  filterDataChange = _this$props.filterDataChange,
124
130
  filterText = _this$props.filterText;
125
131
  if (!filterDataChange && prevProps.data !== this.props.data) this.datum.setData(this.props.data, true);
126
- if (prevProps.value !== this.props.value) this.datum.setValue(this.props.value || []);
132
+
133
+ if (prevProps.value !== this.props.value) {
134
+ this.datum.setValue(this.props.value || []);
135
+ this.updatePathByValue();
136
+ }
127
137
 
128
138
  if (prevState.focus !== this.state.focus && !this.state.focus && onFilter) {
129
139
  setTimeout(function () {
@@ -185,6 +195,30 @@ function (_PureComponent) {
185
195
  }));
186
196
  };
187
197
 
198
+ _proto.updatePathByValue = function updatePathByValue() {
199
+ var _this$props3 = this.props,
200
+ mode = _this$props3.mode,
201
+ value = _this$props3.value;
202
+ if (mode !== undefined) return;
203
+ if (value === this.lastValue) return;
204
+
205
+ if (!value || !value.length) {
206
+ this.setState({
207
+ path: []
208
+ });
209
+ } else {
210
+ var v = value[value.length - 1];
211
+ var data = this.datum.getDataById(v);
212
+ var id = this.datum.getKey(data);
213
+
214
+ var _ref2 = this.datum.getPath(id) || {},
215
+ path = _ref2.path;
216
+
217
+ path = path || [];
218
+ this.handlePathChange(id, null, path);
219
+ }
220
+ };
221
+
188
222
  _proto.handleClickAway = function handleClickAway(e) {
189
223
  var desc = isDescendent(e.target, this.selectId);
190
224
 
@@ -198,12 +232,18 @@ function (_PureComponent) {
198
232
  _proto.handlePathChange = function handlePathChange(id, data, path, fromClick) {
199
233
  var _this2 = this;
200
234
 
201
- var _this$props3 = this.props,
202
- childrenKey = _this$props3.childrenKey,
203
- finalDismiss = _this$props3.finalDismiss;
235
+ var _this$props4 = this.props,
236
+ childrenKey = _this$props4.childrenKey,
237
+ finalDismiss = _this$props4.finalDismiss,
238
+ loader = _this$props4.loader;
204
239
 
205
240
  if (fromClick && data) {
206
241
  var leaf = !data[childrenKey] || data[childrenKey].length === 0;
242
+
243
+ if (loader && typeof loader === 'function' && data[childrenKey] === undefined) {
244
+ leaf = false;
245
+ }
246
+
207
247
  if (finalDismiss && leaf) this.handleState(false);
208
248
  }
209
249
 
@@ -248,9 +288,9 @@ function (_PureComponent) {
248
288
  if (focus && e && e.target.classList.contains((0, _styles2.cascaderClass)('close'))) return; // if remove node, return
249
289
 
250
290
  if (e && (0, _element.getParent)(e.target, "." + (0, _styles2.cascaderClass)('remove-container'))) return;
251
- var _this$props4 = this.props,
252
- height = _this$props4.height,
253
- onCollapse = _this$props4.onCollapse;
291
+ var _this$props5 = this.props,
292
+ height = _this$props5.height,
293
+ onCollapse = _this$props5.onCollapse;
254
294
  var position = this.props.position;
255
295
 
256
296
  if (!position) {
@@ -294,34 +334,40 @@ function (_PureComponent) {
294
334
  };
295
335
 
296
336
  _proto.handleChange = function handleChange() {
297
- var _this$props5 = this.props,
298
- onChange = _this$props5.onChange,
299
- onFilter = _this$props5.onFilter,
300
- filterText = _this$props5.filterText;
337
+ var _this$props6 = this.props,
338
+ onChange = _this$props6.onChange,
339
+ onFilter = _this$props6.onFilter,
340
+ filterText = _this$props6.filterText;
301
341
 
302
342
  if (this.input) {
303
343
  this.input.reset();
304
344
  this.input.focus();
305
345
  }
306
346
 
307
- onChange.apply(void 0, arguments);
347
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
348
+ args[_key] = arguments[_key];
349
+ }
350
+
351
+ var value = args[0];
352
+ this.lastValue = value;
353
+ onChange.apply(void 0, args);
308
354
  if (onFilter && filterText) onFilter('');
309
355
  };
310
356
 
311
357
  _proto.renderList = function renderList() {
312
358
  var _this4 = this;
313
359
 
314
- var _this$props6 = this.props,
315
- data = _this$props6.data,
316
- keygen = _this$props6.keygen,
317
- renderItem = _this$props6.renderItem,
318
- mode = _this$props6.mode,
319
- loader = _this$props6.loader,
320
- onItemClick = _this$props6.onItemClick,
321
- expandTrigger = _this$props6.expandTrigger,
322
- childrenKey = _this$props6.childrenKey,
323
- absolute = _this$props6.absolute,
324
- height = _this$props6.height;
360
+ var _this$props7 = this.props,
361
+ data = _this$props7.data,
362
+ keygen = _this$props7.keygen,
363
+ renderItem = _this$props7.renderItem,
364
+ mode = _this$props7.mode,
365
+ loader = _this$props7.loader,
366
+ onItemClick = _this$props7.onItemClick,
367
+ expandTrigger = _this$props7.expandTrigger,
368
+ childrenKey = _this$props7.childrenKey,
369
+ absolute = _this$props7.absolute,
370
+ height = _this$props7.height;
325
371
  var path = this.state.path;
326
372
  var props = {
327
373
  datum: this.datum,
@@ -382,9 +428,9 @@ function (_PureComponent) {
382
428
  };
383
429
 
384
430
  _proto.renderAbsoluteList = function renderAbsoluteList() {
385
- var _this$props7 = this.props,
386
- absolute = _this$props7.absolute,
387
- zIndex = _this$props7.zIndex;
431
+ var _this$props8 = this.props,
432
+ absolute = _this$props8.absolute,
433
+ zIndex = _this$props8.zIndex;
388
434
  var _this$state = this.state,
389
435
  focus = _this$state.focus,
390
436
  position = _this$state.position;
@@ -406,17 +452,17 @@ function (_PureComponent) {
406
452
  };
407
453
 
408
454
  _proto.renderFilterList = function renderFilterList() {
409
- var _this$props8 = this.props,
410
- absolute = _this$props8.absolute,
411
- onFilter = _this$props8.onFilter,
412
- filterText = _this$props8.filterText,
413
- zIndex = _this$props8.zIndex,
414
- data = _this$props8.data,
415
- childrenKey = _this$props8.childrenKey,
416
- renderItem = _this$props8.renderItem,
417
- expandTrigger = _this$props8.expandTrigger,
418
- height = _this$props8.height,
419
- loading = _this$props8.loading;
455
+ var _this$props9 = this.props,
456
+ absolute = _this$props9.absolute,
457
+ onFilter = _this$props9.onFilter,
458
+ filterText = _this$props9.filterText,
459
+ zIndex = _this$props9.zIndex,
460
+ data = _this$props9.data,
461
+ childrenKey = _this$props9.childrenKey,
462
+ renderItem = _this$props9.renderItem,
463
+ expandTrigger = _this$props9.expandTrigger,
464
+ height = _this$props9.height,
465
+ loading = _this$props9.loading;
420
466
  var _this$state2 = this.state,
421
467
  focus = _this$state2.focus,
422
468
  position = _this$state2.position;
@@ -445,11 +491,11 @@ function (_PureComponent) {
445
491
  };
446
492
 
447
493
  _proto.renderPanel = function renderPanel() {
448
- var _this$props9 = this.props,
449
- filterText = _this$props9.filterText,
450
- data = _this$props9.data,
451
- mode = _this$props9.mode,
452
- loading = _this$props9.loading;
494
+ var _this$props10 = this.props,
495
+ filterText = _this$props10.filterText,
496
+ data = _this$props10.data,
497
+ mode = _this$props10.mode,
498
+ loading = _this$props10.loading;
453
499
  if (loading) return this.renderFilterList();
454
500
  if (!filterText || filterText && mode !== undefined || data.length === 0) return this.renderAbsoluteList();
455
501
  return this.renderFilterList();
@@ -458,11 +504,11 @@ function (_PureComponent) {
458
504
  _proto.render = function render() {
459
505
  var _this5 = this;
460
506
 
461
- var _this$props10 = this.props,
462
- placeholder = _this$props10.placeholder,
463
- disabled = _this$props10.disabled,
464
- size = _this$props10.size,
465
- other = (0, _objectWithoutPropertiesLoose2.default)(_this$props10, ["placeholder", "disabled", "size"]);
507
+ var _this$props11 = this.props,
508
+ placeholder = _this$props11.placeholder,
509
+ disabled = _this$props11.disabled,
510
+ size = _this$props11.size,
511
+ other = (0, _objectWithoutPropertiesLoose2.default)(_this$props11, ["placeholder", "disabled", "size"]);
466
512
  var focus = this.state.focus;
467
513
  var className = (0, _classnames.default)((0, _styles2.cascaderClass)('_', size, focus && 'focus', other.mode !== undefined && 'multiple', disabled === true && 'disabled', (0, _config.isRTL)() && 'rtl'), (0, _styles.selectClass)(this.state.position, focus && 'focus'));
468
514
  return _react.default.createElement("div", {
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.cascaderClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _cascader = _interopRequireDefault(require("./cascader.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.checkinputClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _checkinput = _interopRequireDefault(require("./checkinput.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.listClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _classname = _interopRequireDefault(require("../../utils/classname"));
9
11
 
10
12
  var _list = _interopRequireDefault(require("./list.css"));
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { StandardProps, FormItemStandardProps, CommonProps } from '../@types/common'
3
+ import { ReactNode } from "react"
3
4
 
4
5
  export type DateTimeType = Date | number | string | undefined
5
6
 
@@ -18,8 +19,10 @@ export interface QuickSelect extends Base {
18
19
  value?: Array<DateTimeType> | DateTimeType;
19
20
  }
20
21
 
22
+ export type FormItemProps<T> = Omit<FormItemStandardProps<T>, 'name'>
23
+
21
24
  export interface DatePickerProps<T =DatePickerValue > extends StandardProps,
22
- FormItemStandardProps<T>,
25
+ FormItemProps<T>,
23
26
  Pick<CommonProps, 'absolute'> {
24
27
 
25
28
  /**
@@ -260,6 +263,7 @@ FormItemStandardProps<T>,
260
263
  * default: -
261
264
  */
262
265
  innerTitle?: ReactNode;
266
+ name: string | string[]
263
267
  }
264
268
 
265
269
  declare class DatePicker extends React.Component<DatePickerProps, {}> {
@@ -32,7 +32,7 @@ label.so-datepicker-r-time {
32
32
  display: flex;
33
33
  }
34
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));
35
+ background: var(--primary-color-fade-5, rgba(51, 153, 255, 0.05));
36
36
  border-radius: 50px;
37
37
  }
38
38
  .so-datepicker-inner {
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.datepickerClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _datepicker = _interopRequireDefault(require("./datepicker.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.dividerClass = void 0;
7
7
 
8
+ require("../../styles/normalize.css");
9
+
8
10
  var _divider = _interopRequireDefault(require("./divider.css"));
9
11
 
10
12
  var _classname = _interopRequireDefault(require("../../utils/classname"));
@@ -215,24 +215,33 @@ function (_PureComponent) {
215
215
  outline = _this$props2.outline,
216
216
  size = _this$props2.size,
217
217
  disabled = _this$props2.disabled,
218
- isSub = _this$props2.isSub;
218
+ isSub = _this$props2.isSub,
219
+ position = _this$props2.position;
219
220
  var rtl = (0, _config.isRTL)();
220
221
  var buttonClassName = (0, _styles.dropdownClass)('button', !placeholder && 'split-button', rtl && 'rtl');
221
222
  var spanClassName = (0, _styles.dropdownClass)('button-content');
222
223
 
223
224
  var caret = _react.default.createElement("span", {
225
+ key: "caret",
224
226
  className: (0, _styles.dropdownClass)('caret', rtl && 'rtl')
225
227
  }, _react.default.createElement(_Caret.default, null));
226
228
 
229
+ var childs = [_react.default.createElement("span", {
230
+ key: "text",
231
+ className: spanClassName
232
+ }, placeholder), caret];
233
+
234
+ if (['left-bottom', 'left-top'].includes(position)) {
235
+ childs.reverse();
236
+ }
237
+
227
238
  if (isSub) {
228
239
  return _react.default.createElement("a", {
229
240
  key: "button",
230
241
  className: (0, _styles.dropdownClass)('button', 'item', this.state.show && 'active'),
231
242
  "data-role": "item",
232
243
  onClick: this.handleFocus
233
- }, _react.default.createElement("span", {
234
- className: spanClassName
235
- }, placeholder), caret);
244
+ }, childs);
236
245
  }
237
246
 
238
247
  return _react.default.createElement(_Button.default, {
@@ -243,9 +252,7 @@ function (_PureComponent) {
243
252
  type: type,
244
253
  size: size,
245
254
  key: "button"
246
- }, _react.default.createElement("span", {
247
- className: spanClassName
248
- }, placeholder), caret);
255
+ }, childs);
249
256
  };
250
257
 
251
258
  _proto.renderList = function renderList(data, placeholder, position) {
@@ -310,7 +317,8 @@ function (_PureComponent) {
310
317
  var show = this.state.show;
311
318
  var position = this.getPosition();
312
319
  var wrapClassName = (0, _styles.dropdownClass)('_', position, show && 'show', {
313
- 'split-dropdown': !placeholder
320
+ 'split-dropdown': !placeholder,
321
+ rtl: (0, _config.isRTL)()
314
322
  });
315
323
  if (className) wrapClassName += " " + className;
316
324
  return _react.default.createElement("div", (0, _extends2.default)({