@douyinfe/semi-ui 2.10.2-alpha.1 → 2.10.4

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 (38) hide show
  1. package/cascader/index.tsx +4 -2
  2. package/datePicker/__test__/datePicker.test.js +1 -0
  3. package/datePicker/_story/v2/FixTriggerRender.tsx +36 -0
  4. package/datePicker/_story/v2/index.js +1 -0
  5. package/dist/css/semi.css +0 -1
  6. package/dist/umd/semi-ui.js +5103 -3512
  7. package/dist/umd/semi-ui.js.map +1 -1
  8. package/dist/umd/semi-ui.min.js +1 -1
  9. package/dist/umd/semi-ui.min.js.map +1 -1
  10. package/lib/cjs/cascader/index.js +4 -2
  11. package/lib/cjs/form/baseForm.d.ts +1 -1
  12. package/lib/cjs/form/field.d.ts +1 -1
  13. package/lib/cjs/modal/confirm.d.ts +5 -5
  14. package/lib/cjs/select/index.js +27 -24
  15. package/lib/cjs/table/HeadTable.d.ts +2 -1
  16. package/lib/cjs/table/HeadTable.js +2 -1
  17. package/lib/cjs/table/Table.d.ts +1 -1
  18. package/lib/cjs/table/Table.js +2 -0
  19. package/lib/cjs/typography/title.d.ts +1 -1
  20. package/lib/es/cascader/index.js +4 -2
  21. package/lib/es/form/baseForm.d.ts +1 -1
  22. package/lib/es/form/field.d.ts +1 -1
  23. package/lib/es/modal/confirm.d.ts +5 -5
  24. package/lib/es/select/index.js +23 -21
  25. package/lib/es/table/HeadTable.d.ts +2 -1
  26. package/lib/es/table/HeadTable.js +2 -1
  27. package/lib/es/table/Table.d.ts +1 -1
  28. package/lib/es/table/Table.js +2 -0
  29. package/lib/es/typography/title.d.ts +1 -1
  30. package/package.json +9 -9
  31. package/scrollList/_story/ScrollList/index.js +1 -1
  32. package/select/index.tsx +3 -1
  33. package/table/HeadTable.tsx +3 -1
  34. package/table/Table.tsx +2 -0
  35. package/table/_story/v2/FixedOnHeaderRow/index.jsx +134 -0
  36. package/table/_story/v2/index.js +2 -1
  37. package/upload/_story/upload.stories.js +1 -0
  38. package/yarn-error.log +26235 -0
@@ -412,13 +412,15 @@ class Cascader extends BaseComponent<CascaderProps, CascaderState> {
412
412
  realValue as SimpleValueType[][] :
413
413
  [realValue] as SimpleValueType[][];
414
414
  } else {
415
- normallizedValue = [[realValue]];
415
+ if (realValue !== undefined) {
416
+ normallizedValue = [[realValue]];
417
+ }
416
418
  }
417
419
  // formatValuePath is used to save value of valuePath
418
420
  const formatValuePath: (string | number)[][] = [];
419
421
  normallizedValue.forEach((valueItem: SimpleValueType[]) => {
420
422
  const formatItem: (string | number)[] = onChangeWithObject ?
421
- (valueItem as CascaderData[]).map(i => i.value) :
423
+ (valueItem as CascaderData[]).map(i => i?.value) :
422
424
  valueItem as (string | number)[];
423
425
  formatValuePath.push(formatItem);
424
426
  });
@@ -1056,6 +1056,7 @@ describe(`DatePicker`, () => {
1056
1056
  const rightSecondWeek = rightPanel.querySelectorAll(`.${BASE_CLASS_PREFIX}-datepicker-week`)[1];
1057
1057
  const rightSecondWeekDays = rightSecondWeek.querySelectorAll(`.${BASE_CLASS_PREFIX}-datepicker-day`);
1058
1058
  leftSecondWeekDays[0].click();
1059
+ await sleep();
1059
1060
  rightSecondWeekDays[0].click();
1060
1061
 
1061
1062
  const baseElem = elem.find(BaseDatePicker);
@@ -0,0 +1,36 @@
1
+ import React, { useState, useCallback, useMemo } from 'react';
2
+ import { DatePicker, Button, Icon, Space } from '@douyinfe/semi-ui';
3
+
4
+ export default function Demo() {
5
+ const [date, setDate] = useState([]);
6
+ const onChange = useCallback(date => {
7
+ setDate(date);
8
+ console.log(date);
9
+ }, []);
10
+ const onClear = useCallback(e => {
11
+ e && e.stopPropagation();
12
+ setDate(null);
13
+ }, []);
14
+
15
+ const closeIcon = useMemo(() => (date ? <Icon type="close" onClick={onClear} /> : <Icon type="chevron_down" />), [date]);
16
+
17
+ return (
18
+ <Space>
19
+ <DatePicker
20
+ type="dateTimeRange"
21
+ onChange={onChange}
22
+ value={date}
23
+ triggerRender={({ placeholder }) => (
24
+ <Button theme={'light'} icon={closeIcon} iconPosition={'right'}>
25
+ {(date && String(date)) || placeholder}
26
+ </Button>
27
+ )}
28
+ />
29
+ <DatePicker
30
+ type="dateRange"
31
+ motion={false}
32
+ triggerRender={({ placeholder }) => <Button theme={'light'}>{placeholder}</Button>}
33
+ />
34
+ </Space>
35
+ );
36
+ }
@@ -4,3 +4,4 @@ export { default as FixInputRangeFocus } from './FixInputRangeFocus';
4
4
  export { default as InsetInput } from './InsetInput';
5
5
  export { default as InsetInputE2E } from './InsetInputE2E';
6
6
  export { default as FixDefaultPickerValue } from './FixDefaultPickerValue';
7
+ export { default as FixedTriggerRender } from './FixTriggerRender';
package/dist/css/semi.css CHANGED
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /* shadow */
3
2
  /* sizing */
4
3
  /* spacing */