@douyinfe/semi-ui 2.33.1 → 2.33.2-alpha.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.
@@ -2,7 +2,7 @@
2
2
  import { strings } from '@douyinfe/semi-foundation/lib/cjs/calendar/constants';
3
3
  import type { ArrayElement } from '../_base/base';
4
4
  import type { BaseProps } from '../_base/baseComponent';
5
- import type { EventObject, weeekStartsOnEnum } from '@douyinfe/semi-foundation/lib/cjs/calendar/foundation';
5
+ import type { EventObject, weekStartsOnEnum } from '@douyinfe/semi-foundation/lib/cjs/calendar/foundation';
6
6
  export interface CalendarProps extends BaseProps {
7
7
  displayValue?: Date;
8
8
  range?: Date[];
@@ -10,7 +10,7 @@ export interface CalendarProps extends BaseProps {
10
10
  events?: EventObject[];
11
11
  mode?: ArrayElement<typeof strings.MODE>;
12
12
  showCurrTime?: boolean;
13
- weekStartsOn?: weeekStartsOnEnum;
13
+ weekStartsOn?: weekStartsOnEnum;
14
14
  scrollTop?: number;
15
15
  onClick?: (e: React.MouseEvent, value: Date) => void;
16
16
  onClose?: (e: React.MouseEvent) => void;
@@ -138,7 +138,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
138
138
  preventScroll?: boolean;
139
139
  showRestTagsPopover?: boolean;
140
140
  restTagsPopoverProps?: import("../popover").PopoverProps;
141
- } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
141
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
142
142
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
143
143
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
144
144
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -86,7 +86,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
86
86
  preventScroll?: boolean;
87
87
  showRestTagsPopover?: boolean;
88
88
  restTagsPopoverProps?: import("../popover").PopoverProps;
89
- } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
89
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
90
90
  declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
91
91
  declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
92
92
  declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
@@ -145,11 +145,11 @@ export declare function withError(props: ModalReactProps): {
145
145
  size?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").Size;
146
146
  style?: React.CSSProperties;
147
147
  className?: string;
148
- motion?: boolean;
149
148
  getPopupContainer?: () => HTMLElement;
150
149
  footer?: React.ReactNode;
151
150
  header?: React.ReactNode;
152
151
  direction?: any;
152
+ motion?: boolean;
153
153
  width?: string | number;
154
154
  height?: string | number;
155
155
  mask?: boolean;
@@ -204,10 +204,10 @@ export declare function withError(props: ModalReactProps): {
204
204
  title?: string;
205
205
  name?: string;
206
206
  value?: string | number | readonly string[];
207
- onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
208
- onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
209
207
  form?: string;
210
208
  slot?: string;
209
+ onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
210
+ onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
211
211
  hidden?: boolean;
212
212
  color?: string;
213
213
  onChange?: React.FormEventHandler<HTMLButtonElement>;
@@ -11,8 +11,6 @@ var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
11
11
 
12
12
  var _difference2 = _interopRequireDefault(require("lodash/difference"));
13
13
 
14
- var _isNull2 = _interopRequireDefault(require("lodash/isNull"));
15
-
16
14
  var _omit2 = _interopRequireDefault(require("lodash/omit"));
17
15
 
18
16
  var _each2 = _interopRequireDefault(require("lodash/each"));
@@ -868,6 +866,8 @@ class Table extends _baseComponent.default {
868
866
 
869
867
  const queries = _foundation.default.initColumnsFilteredValueAndSorterOrder((0, _utils2.cloneDeep)(cachedflattenColumns));
870
868
 
869
+ const filteredSortedDataSource = this.foundation.getFilteredSortedDataSource(this.props.dataSource, queries);
870
+ const pageData = this.foundation.getCurrentPageData(filteredSortedDataSource, this.props.pagination, queries);
871
871
  this.state = {
872
872
  /**
873
873
  * Cached props
@@ -881,11 +881,11 @@ class Table extends _baseComponent.default {
881
881
  * State calculated based on prop
882
882
  */
883
883
  queries,
884
- dataSource: [],
884
+ dataSource: pageData.dataSource,
885
885
  flattenData: [],
886
886
  expandedRowKeys: [...(props.expandedRowKeys || []), ...(props.defaultExpandedRowKeys || [])],
887
887
  rowSelection: props.rowSelection ? (0, _isObject2.default)(props.rowSelection) ? Object.assign({}, props.rowSelection) : {} : null,
888
- pagination: props.pagination && typeof props.pagination === 'object' ? Object.assign({}, props.pagination) : props.pagination || false,
888
+ pagination: pageData.pagination,
889
889
 
890
890
  /**
891
891
  * Internal state
@@ -1454,12 +1454,11 @@ class Table extends _baseComponent.default {
1454
1454
  * TODO: After merging issue 1007, you can place it in the constructor to complete
1455
1455
  * The reason is that #1007 exposes the parameters required by getCurrentPageData in the constructor
1456
1456
  */
1457
-
1458
- if ((0, _isNull2.default)(dataSource)) {
1459
- const pageData = this.foundation.getCurrentPageData(this.props.dataSource);
1460
- dataSource = pageData.dataSource;
1461
- pagination = pageData.pagination;
1462
- }
1457
+ // if (isNull(dataSource)) {
1458
+ // const pageData: BasePageData<RecordType> = this.foundation.getCurrentPageData(this.props.dataSource);
1459
+ // dataSource = pageData.dataSource;
1460
+ // pagination = pageData.pagination;
1461
+ // }
1463
1462
 
1464
1463
  const props = Object.assign(Object.assign(Object.assign({}, rest), this.state), {
1465
1464
  // props not in rest
@@ -2,7 +2,7 @@
2
2
  import { strings } from '@douyinfe/semi-foundation/lib/es/calendar/constants';
3
3
  import type { ArrayElement } from '../_base/base';
4
4
  import type { BaseProps } from '../_base/baseComponent';
5
- import type { EventObject, weeekStartsOnEnum } from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
5
+ import type { EventObject, weekStartsOnEnum } from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
6
6
  export interface CalendarProps extends BaseProps {
7
7
  displayValue?: Date;
8
8
  range?: Date[];
@@ -10,7 +10,7 @@ export interface CalendarProps extends BaseProps {
10
10
  events?: EventObject[];
11
11
  mode?: ArrayElement<typeof strings.MODE>;
12
12
  showCurrTime?: boolean;
13
- weekStartsOn?: weeekStartsOnEnum;
13
+ weekStartsOn?: weekStartsOnEnum;
14
14
  scrollTop?: number;
15
15
  onClick?: (e: React.MouseEvent, value: Date) => void;
16
16
  onClose?: (e: React.MouseEvent) => void;
@@ -138,7 +138,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
138
138
  preventScroll?: boolean;
139
139
  showRestTagsPopover?: boolean;
140
140
  restTagsPopoverProps?: import("../popover").PopoverProps;
141
- } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
141
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
142
142
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
143
143
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
144
144
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -86,7 +86,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
86
86
  preventScroll?: boolean;
87
87
  showRestTagsPopover?: boolean;
88
88
  restTagsPopoverProps?: import("../popover").PopoverProps;
89
- } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
89
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
90
90
  declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
91
91
  declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
92
92
  declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
@@ -145,11 +145,11 @@ export declare function withError(props: ModalReactProps): {
145
145
  size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
146
146
  style?: React.CSSProperties;
147
147
  className?: string;
148
- motion?: boolean;
149
148
  getPopupContainer?: () => HTMLElement;
150
149
  footer?: React.ReactNode;
151
150
  header?: React.ReactNode;
152
151
  direction?: any;
152
+ motion?: boolean;
153
153
  width?: string | number;
154
154
  height?: string | number;
155
155
  mask?: boolean;
@@ -204,10 +204,10 @@ export declare function withError(props: ModalReactProps): {
204
204
  title?: string;
205
205
  name?: string;
206
206
  value?: string | number | readonly string[];
207
- onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
208
- onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
209
207
  form?: string;
210
208
  slot?: string;
209
+ onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
210
+ onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
211
211
  hidden?: boolean;
212
212
  color?: string;
213
213
  onChange?: React.FormEventHandler<HTMLButtonElement>;
@@ -1,7 +1,6 @@
1
1
  import _isObject from "lodash/isObject";
2
2
  import _isFunction from "lodash/isFunction";
3
3
  import _difference from "lodash/difference";
4
- import _isNull from "lodash/isNull";
5
4
  import _omit from "lodash/omit";
6
5
  import _each from "lodash/each";
7
6
  import _flattenDeep from "lodash/flattenDeep";
@@ -822,6 +821,8 @@ class Table extends BaseComponent {
822
821
  const columns = this.getColumns(props.columns, props.children);
823
822
  const cachedflattenColumns = flattenColumns(columns);
824
823
  const queries = TableFoundation.initColumnsFilteredValueAndSorterOrder(cloneDeep(cachedflattenColumns));
824
+ const filteredSortedDataSource = this.foundation.getFilteredSortedDataSource(this.props.dataSource, queries);
825
+ const pageData = this.foundation.getCurrentPageData(filteredSortedDataSource, this.props.pagination, queries);
825
826
  this.state = {
826
827
  /**
827
828
  * Cached props
@@ -835,11 +836,11 @@ class Table extends BaseComponent {
835
836
  * State calculated based on prop
836
837
  */
837
838
  queries,
838
- dataSource: [],
839
+ dataSource: pageData.dataSource,
839
840
  flattenData: [],
840
841
  expandedRowKeys: [...(props.expandedRowKeys || []), ...(props.defaultExpandedRowKeys || [])],
841
842
  rowSelection: props.rowSelection ? _isObject(props.rowSelection) ? Object.assign({}, props.rowSelection) : {} : null,
842
- pagination: props.pagination && typeof props.pagination === 'object' ? Object.assign({}, props.pagination) : props.pagination || false,
843
+ pagination: pageData.pagination,
843
844
 
844
845
  /**
845
846
  * Internal state
@@ -1411,12 +1412,11 @@ class Table extends BaseComponent {
1411
1412
  * TODO: After merging issue 1007, you can place it in the constructor to complete
1412
1413
  * The reason is that #1007 exposes the parameters required by getCurrentPageData in the constructor
1413
1414
  */
1414
-
1415
- if (_isNull(dataSource)) {
1416
- const pageData = this.foundation.getCurrentPageData(this.props.dataSource);
1417
- dataSource = pageData.dataSource;
1418
- pagination = pageData.pagination;
1419
- }
1415
+ // if (isNull(dataSource)) {
1416
+ // const pageData: BasePageData<RecordType> = this.foundation.getCurrentPageData(this.props.dataSource);
1417
+ // dataSource = pageData.dataSource;
1418
+ // pagination = pageData.pagination;
1419
+ // }
1420
1420
 
1421
1421
  const props = Object.assign(Object.assign(Object.assign({}, rest), this.state), {
1422
1422
  // props not in rest
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.33.1",
3
+ "version": "2.33.2-alpha.1",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -17,12 +17,12 @@
17
17
  "lib/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@douyinfe/semi-animation": "2.33.1",
21
- "@douyinfe/semi-animation-react": "2.33.1",
22
- "@douyinfe/semi-foundation": "2.33.1",
23
- "@douyinfe/semi-icons": "2.33.1",
24
- "@douyinfe/semi-illustrations": "2.33.1",
25
- "@douyinfe/semi-theme-default": "2.33.1",
20
+ "@douyinfe/semi-animation": "2.33.2-alpha.1",
21
+ "@douyinfe/semi-animation-react": "2.33.2-alpha.1",
22
+ "@douyinfe/semi-foundation": "2.33.2-alpha.1",
23
+ "@douyinfe/semi-icons": "2.33.2-alpha.1",
24
+ "@douyinfe/semi-illustrations": "2.33.2-alpha.1",
25
+ "@douyinfe/semi-theme-default": "2.33.2-alpha.1",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "1810821764823ef746b7a88aae299d12a31cca5d",
72
+ "gitHead": "2deb728849055607d3d4019fecd2eee522b74f52",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",