@douyinfe/semi-ui 2.30.0-alpha.0 → 2.30.0-alpha.2

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 (79) hide show
  1. package/dist/css/semi.css +41 -4
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +79 -27
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/anchor/index.d.ts +1 -1
  8. package/lib/cjs/autoComplete/index.d.ts +1 -1
  9. package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
  10. package/lib/cjs/carousel/index.d.ts +2 -2
  11. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  12. package/lib/cjs/datePicker/datePicker.d.ts +3 -3
  13. package/lib/cjs/datePicker/monthsGrid.d.ts +3 -3
  14. package/lib/cjs/datePicker/quickControl.d.ts +1 -1
  15. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  16. package/lib/cjs/dropdown/index.d.ts +1 -1
  17. package/lib/cjs/form/baseForm.d.ts +4 -4
  18. package/lib/cjs/form/field.d.ts +4 -4
  19. package/lib/cjs/overflowList/index.d.ts +1 -1
  20. package/lib/cjs/popover/index.d.ts +1 -1
  21. package/lib/cjs/radio/radio.d.ts +1 -1
  22. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  23. package/lib/cjs/select/index.d.ts +1 -1
  24. package/lib/cjs/steps/basicStep.d.ts +2 -1
  25. package/lib/cjs/steps/basicStep.js +5 -4
  26. package/lib/cjs/steps/basicSteps.js +6 -3
  27. package/lib/cjs/steps/fillStep.d.ts +2 -1
  28. package/lib/cjs/steps/fillStep.js +2 -1
  29. package/lib/cjs/steps/fillSteps.js +10 -11
  30. package/lib/cjs/steps/index.d.ts +59 -0
  31. package/lib/cjs/steps/index.js +9 -0
  32. package/lib/cjs/steps/navStep.d.ts +2 -1
  33. package/lib/cjs/steps/navStep.js +2 -2
  34. package/lib/cjs/steps/navSteps.js +4 -2
  35. package/lib/cjs/steps/step.d.ts +0 -1
  36. package/lib/cjs/steps/step.js +3 -2
  37. package/lib/cjs/table/Table.d.ts +2 -2
  38. package/lib/cjs/timeline/item.d.ts +7 -0
  39. package/lib/cjs/timeline/item.js +41 -3
  40. package/lib/cjs/tooltip/index.d.ts +1 -1
  41. package/lib/cjs/typography/numeral.d.ts +1 -1
  42. package/lib/cjs/typography/title.d.ts +1 -1
  43. package/lib/es/anchor/index.d.ts +1 -1
  44. package/lib/es/autoComplete/index.d.ts +1 -1
  45. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  46. package/lib/es/carousel/index.d.ts +2 -2
  47. package/lib/es/datePicker/dateInput.d.ts +1 -1
  48. package/lib/es/datePicker/datePicker.d.ts +3 -3
  49. package/lib/es/datePicker/monthsGrid.d.ts +3 -3
  50. package/lib/es/datePicker/quickControl.d.ts +1 -1
  51. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  52. package/lib/es/dropdown/index.d.ts +1 -1
  53. package/lib/es/form/baseForm.d.ts +4 -4
  54. package/lib/es/form/field.d.ts +4 -4
  55. package/lib/es/overflowList/index.d.ts +1 -1
  56. package/lib/es/popover/index.d.ts +1 -1
  57. package/lib/es/radio/radio.d.ts +1 -1
  58. package/lib/es/radio/radioGroup.d.ts +1 -1
  59. package/lib/es/select/index.d.ts +1 -1
  60. package/lib/es/steps/basicStep.d.ts +2 -1
  61. package/lib/es/steps/basicStep.js +5 -4
  62. package/lib/es/steps/basicSteps.js +6 -3
  63. package/lib/es/steps/fillStep.d.ts +2 -1
  64. package/lib/es/steps/fillStep.js +2 -1
  65. package/lib/es/steps/fillSteps.js +11 -11
  66. package/lib/es/steps/index.d.ts +59 -0
  67. package/lib/es/steps/index.js +6 -0
  68. package/lib/es/steps/navStep.d.ts +2 -1
  69. package/lib/es/steps/navStep.js +2 -2
  70. package/lib/es/steps/navSteps.js +4 -2
  71. package/lib/es/steps/step.d.ts +0 -1
  72. package/lib/es/steps/step.js +3 -2
  73. package/lib/es/table/Table.d.ts +2 -2
  74. package/lib/es/timeline/item.d.ts +7 -0
  75. package/lib/es/timeline/item.js +41 -3
  76. package/lib/es/tooltip/index.d.ts +1 -1
  77. package/lib/es/typography/numeral.d.ts +1 -1
  78. package/lib/es/typography/title.d.ts +1 -1
  79. package/package.json +8 -8
@@ -78992,8 +78992,8 @@ const BasicStep = props => {
78992
78992
  onClick,
78993
78993
  onChange,
78994
78994
  onKeyDown,
78995
- type: typeInProps,
78996
- direction: directionInProps
78995
+ usedInC2D,
78996
+ direction: direction
78997
78997
  } = props;
78998
78998
 
78999
78999
  const renderIcon = () => {
@@ -79055,8 +79055,8 @@ const BasicStep = props => {
79055
79055
  const classString = classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(status), {
79056
79056
  ["".concat(prefixCls, "-active")]: active,
79057
79057
  ["".concat(prefixCls, "-done")]: done,
79058
- ["".concat(prefixCls, "-basic")]: typeInProps,
79059
- ["".concat(prefixCls, "-").concat(directionInProps)]: directionInProps,
79058
+ ["".concat(prefixCls, "-basic")]: usedInC2D,
79059
+ ["".concat(prefixCls, "-").concat(direction)]: direction,
79060
79060
  ["".concat(prefixCls, "-small")]: size === 'small'
79061
79061
  }, className);
79062
79062
 
@@ -79121,6 +79121,7 @@ BasicStep.defaultProps = {
79121
79121
  status: 'wait',
79122
79122
  className: ''
79123
79123
  };
79124
+ BasicStep.elementType = 'Steps.BasicStep';
79124
79125
  /* harmony default export */ var basicStep = (BasicStep);
79125
79126
  // CONCATENATED MODULE: ./steps/fillStep.tsx
79126
79127
 
@@ -79223,7 +79224,7 @@ const FillStep = props => {
79223
79224
  [prefixCls]: true,
79224
79225
  ["".concat(prefixCls, "-").concat(status)]: Boolean(status),
79225
79226
  ["".concat(prefixCls, "-clickable")]: onClick,
79226
- ["".concat(prefixCls, "-fill")]: props.type === 'fill'
79227
+ ["".concat(prefixCls, "-fill")]: props.usedInC2D
79227
79228
  }, className),
79228
79229
  style: style,
79229
79230
  onClick: e => {
@@ -79258,6 +79259,7 @@ FillStep.defaultProps = {
79258
79259
  status: 'wait',
79259
79260
  className: ''
79260
79261
  };
79262
+ FillStep.elementType = 'Steps.FillStep';
79261
79263
  /* harmony default export */ var fillStep = (FillStep);
79262
79264
  // CONCATENATED MODULE: ./steps/navStep.tsx
79263
79265
 
@@ -79281,12 +79283,11 @@ const NavStep = props => {
79281
79283
  onKeyDown,
79282
79284
  onChange,
79283
79285
  lastOne,
79284
- type,
79285
79286
  size
79286
79287
  } = props;
79287
79288
  const classString = classnames_default()(prefixCls, {
79288
79289
  ["".concat(prefixCls, "-active")]: active,
79289
- ["".concat(prefixCls, "-nav")]: type,
79290
+ ["".concat(prefixCls, "-nav")]: props.usedInC2D,
79290
79291
  ["".concat(prefixCls, "-small")]: size === 'small'
79291
79292
  }, className);
79292
79293
 
@@ -79350,6 +79351,7 @@ NavStep.defaultProps = {
79350
79351
  active: false,
79351
79352
  className: ''
79352
79353
  };
79354
+ NavStep.elementType = 'Steps.NavStep';
79353
79355
  /* harmony default export */ var navStep = (NavStep);
79354
79356
  // CONCATENATED MODULE: ./steps/context.ts
79355
79357
 
@@ -79362,8 +79364,9 @@ NavStep.defaultProps = {
79362
79364
 
79363
79365
 
79364
79366
  const Step = props => {
79365
- const stepContext = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["useContext"])(steps_context);
79366
- const type = stepContext ? stepContext.type : props.type;
79367
+ const {
79368
+ type
79369
+ } = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["useContext"])(steps_context);
79367
79370
 
79368
79371
  const renderStep = () => {
79369
79372
  switch (type) {
@@ -79409,19 +79412,20 @@ const fillSteps_Steps = props => {
79409
79412
  onChange
79410
79413
  } = props;
79411
79414
  const inner = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["useMemo"])(() => {
79412
- const filteredChildren = external_root_React_commonjs2_react_commonjs_react_amd_react_["Children"].toArray(children).filter(c => /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(c));
79413
- const colStyle = direction === 'vertical' ? null : {
79414
- width: "".concat(100 / filteredChildren.length, "%")
79415
- };
79415
+ const filteredChildren = external_root_React_commonjs2_react_commonjs_react_amd_react_["Children"].toArray(children).filter(c => /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(c)); // const colStyle = direction === 'vertical' ? null : { width: `${100 / filteredChildren.length }%` };
79416
+
79416
79417
  const content = external_root_React_commonjs2_react_commonjs_react_amd_react_["Children"].map(filteredChildren, (child, index) => {
79417
79418
  if (!child) {
79418
79419
  return null;
79419
79420
  }
79420
79421
 
79421
79422
  const stepNumber = initial + index;
79422
- const childProps = Object.assign({
79423
- stepNumber: "".concat(stepNumber + 1)
79424
- }, child.props);
79423
+ const childProps = Object.assign(Object.assign({
79424
+ stepNumber: "".concat(stepNumber + 1),
79425
+ direction
79426
+ }, child.props), {
79427
+ total: filteredChildren.length
79428
+ });
79425
79429
 
79426
79430
  if (status === 'error' && index === current - 1) {
79427
79431
  childProps.className = "".concat(prefixCls, "-next-error");
@@ -79441,11 +79445,10 @@ const fillSteps_Steps = props => {
79441
79445
  if (index !== current) {
79442
79446
  onChange(index + initial);
79443
79447
  }
79444
- };
79448
+ }; // return <Col style={colStyle}>{cloneElement(child, { ...childProps })}</Col>;
79445
79449
 
79446
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(grid_col, {
79447
- style: colStyle
79448
- }, /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["cloneElement"])(child, Object.assign({}, childProps)));
79450
+
79451
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(grid_col, null, /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["cloneElement"])(child, Object.assign({}, childProps)));
79449
79452
  });
79450
79453
  return content;
79451
79454
  }, [children, initial, prefixCls, direction, status, current, onChange]);
@@ -79508,10 +79511,13 @@ const basicSteps_Steps = props => {
79508
79511
  }
79509
79512
 
79510
79513
  const stepNumber = initial + index;
79511
- const childProps = Object.assign({
79514
+ const childProps = Object.assign(Object.assign({
79512
79515
  stepNumber: "".concat(stepNumber + 1),
79513
- size
79514
- }, child.props);
79516
+ size,
79517
+ direction
79518
+ }, child.props), {
79519
+ total: filteredChildren.length
79520
+ });
79515
79521
 
79516
79522
  if (status === 'error' && index === current - 1) {
79517
79523
  childProps.className = "".concat(prefixCls, "-next-error");
@@ -79598,10 +79604,12 @@ const navSteps_Steps = props => {
79598
79604
  return null;
79599
79605
  }
79600
79606
 
79601
- const childProps = Object.assign({
79607
+ const childProps = Object.assign(Object.assign({
79602
79608
  index,
79603
79609
  total
79604
- }, child.props);
79610
+ }, child.props), {
79611
+ size
79612
+ });
79605
79613
  childProps.active = index === current;
79606
79614
 
79607
79615
  childProps.onChange = () => {
@@ -79665,6 +79673,9 @@ var steps_rest = undefined && undefined.__rest || function (s, e) {
79665
79673
 
79666
79674
 
79667
79675
 
79676
+
79677
+
79678
+
79668
79679
  class steps_Steps extends external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"] {
79669
79680
  renderComponent() {
79670
79681
  const _a = this.props,
@@ -79702,6 +79713,9 @@ class steps_Steps extends external_root_React_commonjs2_react_commonjs_react_amd
79702
79713
  }
79703
79714
 
79704
79715
  steps_Steps.Step = steps_step;
79716
+ steps_Steps.FillStep = fillStep;
79717
+ steps_Steps.BasicStep = basicStep;
79718
+ steps_Steps.NavStep = navStep;
79705
79719
  steps_Steps.propTypes = {
79706
79720
  onChange: prop_types_default.a.func,
79707
79721
  type: prop_types_default.a.oneOf(['fill', 'basic', 'nav']),
@@ -88432,6 +88446,41 @@ const timeline_constants_strings = {
88432
88446
 
88433
88447
  const timeline_item_prefixCls = timeline_constants_cssClasses.ITEM;
88434
88448
  class timeline_item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
88449
+ constructor() {
88450
+ super(...arguments); // getC2DCls is used in C2D, it does not work in non-C2D scenes
88451
+
88452
+ this.getC2DCls = () => {
88453
+ let c2dCls = '';
88454
+ const {
88455
+ mode,
88456
+ oddIndex,
88457
+ lastOne
88458
+ } = this.props;
88459
+
88460
+ if (mode) {
88461
+ switch (mode) {
88462
+ case 'center':
88463
+ c2dCls = "".concat(timeline_item_prefixCls, "-center ").concat(timeline_item_prefixCls, "-left");
88464
+ break;
88465
+
88466
+ case 'alternate':
88467
+ c2dCls = "".concat(timeline_item_prefixCls, "-alternate ").concat(timeline_item_prefixCls, "-").concat(oddIndex ? 'left' : 'right');
88468
+ break;
88469
+
88470
+ default:
88471
+ c2dCls = "".concat(timeline_item_prefixCls, "-").concat(mode, " ").concat(mode === 'right' ? "".concat(timeline_item_prefixCls, "-mode-right") : '');
88472
+ break;
88473
+ }
88474
+ }
88475
+
88476
+ if (!lastOne) {
88477
+ c2dCls += " ".concat(timeline_item_prefixCls, "-not-last-child");
88478
+ }
88479
+
88480
+ return c2dCls;
88481
+ };
88482
+ }
88483
+
88435
88484
  render() {
88436
88485
  const {
88437
88486
  className,
@@ -88444,7 +88493,7 @@ class timeline_item_Item extends external_root_React_commonjs2_react_commonjs_re
88444
88493
  extra,
88445
88494
  onClick
88446
88495
  } = this.props;
88447
- const itemCls = classnames_default()(timeline_item_prefixCls, className);
88496
+ const itemCls = classnames_default()(timeline_item_prefixCls, className, this.getC2DCls());
88448
88497
  const dotCls = classnames_default()({
88449
88498
  ["".concat(timeline_item_prefixCls, "-head")]: true,
88450
88499
  ["".concat(timeline_item_prefixCls, "-head-custom")]: dot,
@@ -88484,13 +88533,16 @@ timeline_item_Item.propTypes = {
88484
88533
  position: prop_types_default.a.oneOf(timeline_constants_strings.ITEM_POS),
88485
88534
  className: prop_types_default.a.string,
88486
88535
  style: prop_types_default.a.object,
88487
- onClick: prop_types_default.a.func
88536
+ onClick: prop_types_default.a.func,
88537
+ mode: prop_types_default.a.string,
88538
+ lastOne: prop_types_default.a.bool
88488
88539
  };
88489
88540
  timeline_item_Item.defaultProps = {
88490
88541
  type: 'default',
88491
88542
  time: '',
88492
88543
  onClick: noop_default.a
88493
88544
  };
88545
+ timeline_item_Item.elementType = 'Timeline.Item';
88494
88546
  // CONCATENATED MODULE: ./timeline/index.tsx
88495
88547
 
88496
88548