@kdcloudjs/table 1.2.2-canary.19 → 1.2.2-canary.20

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 (69) hide show
  1. package/LICENSE +568 -568
  2. package/README.md +111 -111
  3. package/dist/@kdcloudjs/table.css +1 -1
  4. package/dist/@kdcloudjs/table.js +760 -530
  5. package/dist/@kdcloudjs/table.js.map +1 -1
  6. package/dist/kd-ui-complete.less +777 -777
  7. package/es/_utils/usePopper.d.ts +1 -1
  8. package/es/style/color/colors.less +1 -1
  9. package/es/style/core/index.less +1 -1
  10. package/es/style/core/motion/other.less +27 -27
  11. package/es/style/core/motion/slide.less +53 -53
  12. package/es/style/core/motion.less +1 -1
  13. package/es/style/core/reset.less +185 -185
  14. package/es/style/index.less +1 -1
  15. package/es/style/mixins/index.less +18 -18
  16. package/es/style/mixins/overlay.less +21 -21
  17. package/es/style/mixins/reset.less +12 -12
  18. package/es/style/themes/default.less +445 -445
  19. package/es/table/base/colgroup.d.ts +2 -2
  20. package/es/table/base/empty.d.ts +1 -1
  21. package/es/table/base/globalStyleComponent.d.ts +2 -2
  22. package/es/table/base/header.d.ts +2 -2
  23. package/es/table/base/html-table.d.ts +2 -2
  24. package/es/table/base/loading.d.ts +1 -1
  25. package/es/table/base/table.d.ts +1 -1
  26. package/es/table/common-views.d.ts +4 -4
  27. package/es/table/internals.d.ts +1 -2
  28. package/es/table/pipeline/features/colGroupExtendable.js +17 -4
  29. package/es/table/pipeline/features/filter/DefaultFilterContent.d.ts +2 -2
  30. package/es/table/pipeline/features/filter/DefaultFilterIcon.d.ts +2 -2
  31. package/es/table/pipeline/features/filter/Filter.d.ts +1 -1
  32. package/es/table/pipeline/features/filter/FilterPanel.d.ts +2 -2
  33. package/es/table/pivot/cross-table/cross-table.d.ts +1 -1
  34. package/es/table/pivot/cross-tree-table/cross-tree-table.d.ts +1 -1
  35. package/es/table/style/index.less +1 -1
  36. package/lib/_utils/usePopper.d.ts +1 -1
  37. package/lib/style/color/colors.less +1 -1
  38. package/lib/style/components.less +1 -1
  39. package/lib/style/core/index.less +1 -1
  40. package/lib/style/core/motion/other.less +27 -27
  41. package/lib/style/core/motion/slide.less +53 -53
  42. package/lib/style/core/motion.less +1 -1
  43. package/lib/style/core/reset.less +185 -185
  44. package/lib/style/index.less +1 -1
  45. package/lib/style/mixins/index.less +18 -18
  46. package/lib/style/mixins/overlay.less +21 -21
  47. package/lib/style/mixins/reset.less +12 -12
  48. package/lib/style/themes/default.less +445 -445
  49. package/lib/table/base/colgroup.d.ts +2 -2
  50. package/lib/table/base/empty.d.ts +1 -1
  51. package/lib/table/base/globalStyleComponent.d.ts +2 -2
  52. package/lib/table/base/header.d.ts +2 -2
  53. package/lib/table/base/html-table.d.ts +2 -2
  54. package/lib/table/base/loading.d.ts +1 -1
  55. package/lib/table/base/table.d.ts +1 -1
  56. package/lib/table/common-views.d.ts +4 -4
  57. package/lib/table/internals.d.ts +1 -2
  58. package/lib/table/pipeline/features/colGroupExtendable.js +17 -4
  59. package/lib/table/pipeline/features/filter/DefaultFilterContent.d.ts +2 -2
  60. package/lib/table/pipeline/features/filter/DefaultFilterIcon.d.ts +2 -2
  61. package/lib/table/pipeline/features/filter/Filter.d.ts +1 -1
  62. package/lib/table/pipeline/features/filter/FilterPanel.d.ts +2 -2
  63. package/lib/table/pivot/cross-table/cross-table.d.ts +1 -1
  64. package/lib/table/pivot/cross-tree-table/cross-tree-table.d.ts +1 -1
  65. package/lib/table/style/index.less +1 -1
  66. package/package.json +219 -219
  67. package/dist/@kdcloudjs/table.min.css +0 -9
  68. package/dist/@kdcloudjs/table.min.js +0 -209
  69. package/dist/@kdcloudjs/table.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { VisibleColumnDescriptor } from './interfaces';
3
3
  export declare function Colgroup({ descriptors }: {
4
4
  descriptors: VisibleColumnDescriptor[];
5
- }): JSX.Element;
5
+ }): React.JSX.Element;
@@ -6,4 +6,4 @@ export interface EmptyTableProps {
6
6
  emptyCellHeight?: number;
7
7
  EmptyContent?: React.ComponentType;
8
8
  }
9
- export declare function EmptyHtmlTable({ descriptors, isLoading, emptyCellHeight, EmptyContent }: EmptyTableProps): JSX.Element;
9
+ export declare function EmptyHtmlTable({ descriptors, isLoading, emptyCellHeight, EmptyContent }: EmptyTableProps): React.JSX.Element;
@@ -1,8 +1,8 @@
1
- import { PureComponent } from 'react';
1
+ import React, { PureComponent } from 'react';
2
2
  interface GlobalStyleComponentProps {
3
3
  direction: string;
4
4
  }
5
5
  export default class GlobalStyleComponent extends PureComponent<GlobalStyleComponentProps> {
6
- render(): JSX.Element;
6
+ render(): React.JSX.Element;
7
7
  }
8
8
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { RenderInfo } from './interfaces';
3
3
  interface TableHeaderProps {
4
4
  info: RenderInfo;
@@ -6,5 +6,5 @@ interface TableHeaderProps {
6
6
  rowCount?: number;
7
7
  stickyRightOffset?: number;
8
8
  }
9
- export default function TableHeader({ info, theaderPosition, rowCount: _rowCount, stickyRightOffset }: TableHeaderProps): JSX.Element;
9
+ export default function TableHeader({ info, theaderPosition, rowCount: _rowCount, stickyRightOffset }: TableHeaderProps): React.JSX.Element;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { RenderInfo } from './interfaces';
3
3
  import { BaseTableProps } from './table';
4
4
  export interface HtmlTableProps extends Required<Pick<BaseTableProps, 'getRowProps' | 'primaryKey'>> {
@@ -14,4 +14,4 @@ export interface HtmlTableProps extends Required<Pick<BaseTableProps, 'getRowPro
14
14
  };
15
15
  tbodyPosition?: 'left' | 'center' | 'right';
16
16
  }
17
- export declare function HtmlTable({ tbodyHtmlTag, getRowProps, primaryKey, stickyRightOffset, data, verticalRenderInfo: verInfo, horizontalRenderInfo: hozInfo, tbodyPosition }: HtmlTableProps): JSX.Element;
17
+ export declare function HtmlTable({ tbodyHtmlTag, getRowProps, primaryKey, stickyRightOffset, data, verticalRenderInfo: verInfo, horizontalRenderInfo: hozInfo, tbodyPosition }: HtmlTableProps): React.JSX.Element;
@@ -9,5 +9,5 @@ interface LoadingProps {
9
9
  LoadingContentWrapper?: React.ComponentType<LoadingContentWrapperProps>;
10
10
  LoadingIcon?: React.ComponentType;
11
11
  }
12
- export default function Loading({ visible, children, LoadingContentWrapper, LoadingIcon }: LoadingProps): JSX.Element;
12
+ export default function Loading({ visible, children, LoadingContentWrapper, LoadingIcon }: LoadingProps): React.JSX.Element;
13
13
  export {};
@@ -170,7 +170,7 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
170
170
  private renderStickyScroll;
171
171
  private getScrollBarWidth;
172
172
  private getStickyScrollContainerStyle;
173
- render(): JSX.Element;
173
+ render(): React.JSX.Element;
174
174
  componentDidMount(): void;
175
175
  componentDidUpdate(prevProps: Readonly<BaseTableProps>, prevState: Readonly<BaseTableState>): void;
176
176
  private didMountOrUpdate;
@@ -10,10 +10,10 @@ interface IconProps extends React.SVGProps<SVGElement> {
10
10
  xmlns?: string;
11
11
  ref?: any;
12
12
  }
13
- declare function CaretDownIcon(props: IconProps): JSX.Element;
14
- declare function InfoIcon(props: IconProps): JSX.Element;
15
- declare function CaretRightIcon(props: IconProps): JSX.Element;
16
- declare function LoadingIcon(props: IconProps): JSX.Element;
13
+ declare function CaretDownIcon(props: IconProps): React.JSX.Element;
14
+ declare function InfoIcon(props: IconProps): React.JSX.Element;
15
+ declare function CaretRightIcon(props: IconProps): React.JSX.Element;
16
+ declare function LoadingIcon(props: IconProps): React.JSX.Element;
17
17
  export declare const icons: {
18
18
  Loading: typeof LoadingIcon;
19
19
  CaretDown: typeof CaretDownIcon;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { ArtColumn } from './interfaces';
3
- declare function safeRenderHeader(column: ArtColumn): number | boolean | import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any>) | (new (props: any) => import("react").Component<any, any, any>)> | import("react").ReactFragment;
2
+ declare function safeRenderHeader(column: ArtColumn): {};
4
3
  declare function safeGetValue(column: ArtColumn, record: any, rowIndex: number): any;
5
4
  declare function safeGetRowKey(primaryKey: string | ((record: any) => string), record: any, rowIndex: number): string;
6
5
  declare function safeGetCellProps(column: ArtColumn, record: any, rowIndex: number): import("./interfaces").CellProps;
@@ -2,7 +2,9 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
3
3
  import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
4
4
  var _templateObject;
5
- import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";
5
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
6
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
7
+ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
6
8
  import React from 'react';
7
9
  import styled from 'styled-components';
8
10
  import { internals } from '../../internals';
@@ -79,11 +81,22 @@ export var colGroupExtendable = function colGroupExtendable() {
79
81
  return makeRecursiveMapper(function (col) {
80
82
  var _a;
81
83
  var _ref2 = (col === null || col === void 0 ? void 0 : col.features) || {},
82
- showExtendIcon = _ref2.showExtendIcon;
84
+ showExtendIcon = _ref2.showExtendIcon,
85
+ collapseDisplayFields = _ref2.collapseDisplayFields;
83
86
  if (showExtendIcon === true && ((_a = col.children) === null || _a === void 0 ? void 0 : _a.length) > 1) {
84
- var _context;
85
87
  col = addIcon(col);
86
- curState[col.code] === false && _spliceInstanceProperty(_context = col.children).call(_context, 1, col.children.length);
88
+ if (curState[col.code] === false) {
89
+ if (Array.isArray(collapseDisplayFields) && collapseDisplayFields.length > 0) {
90
+ var _context, _context2;
91
+ var filtered = _filterInstanceProperty(_context = col.children).call(_context, function (child) {
92
+ return _includesInstanceProperty(collapseDisplayFields).call(collapseDisplayFields, child.code);
93
+ });
94
+ col.children = filtered.length > 0 ? filtered : _sliceInstanceProperty(_context2 = col.children).call(_context2, 0, 1);
95
+ } else {
96
+ var _context3;
97
+ col.children = _sliceInstanceProperty(_context3 = col.children).call(_context3, 0, 1);
98
+ }
99
+ }
87
100
  }
88
101
  return col;
89
102
  })(columns);
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { DefaultFilterPanelProps } from '../../../interfaces';
3
- declare function DefaultFilterContent({ setFilterModel, filterModel, hidePanel, localeText }: DefaultFilterPanelProps): JSX.Element;
3
+ declare function DefaultFilterContent({ setFilterModel, filterModel, hidePanel, localeText }: DefaultFilterPanelProps): React.JSX.Element;
4
4
  export default DefaultFilterContent;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  export default function DefaultFilterIcon({ width, height }: {
3
3
  width: string | number;
4
4
  height: string | number;
5
- }): JSX.Element;
5
+ }): React.JSX.Element;
@@ -20,5 +20,5 @@ interface FilterProps {
20
20
  };
21
21
  direction?: string;
22
22
  }
23
- declare function Filter({ size, style, className, FilterPanelContent, filterIcon, setFilter, setFilterModel, filterModel, isFilterActive, stopClickEventPropagation, stopESCKeyDownEventPropagation, hideFilterPopupHeader, getPopupParent, localeText, direction }: FilterProps): JSX.Element;
23
+ declare function Filter({ size, style, className, FilterPanelContent, filterIcon, setFilter, setFilterModel, filterModel, isFilterActive, stopClickEventPropagation, stopESCKeyDownEventPropagation, hideFilterPopupHeader, getPopupParent, localeText, direction }: FilterProps): React.JSX.Element;
24
24
  export default Filter;
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
2
  interface PositionType {
3
3
  x: number;
4
4
  y: number;
@@ -19,5 +19,5 @@ declare function FilterPanel({ style, children, position, filterIcon, onClose, h
19
19
  onClose: any;
20
20
  hideFilterPopupHeader: any;
21
21
  direction: any;
22
- }): JSX.Element;
22
+ }): React.JSX.Element;
23
23
  export default FilterPanel;
@@ -14,5 +14,5 @@ export interface CrossTableProps extends Omit<TableProps, 'dataSource' | 'column
14
14
  render?(value: any, leftNode: LeftCrossTreeNode, topNode: TopCrossTreeNode, leftDepth: number, topDepth: number): React.ReactNode;
15
15
  getCellProps?(value: any, leftNode: LeftCrossTreeNode, topNode: TopCrossTreeNode, leftDepth: number, topDepth: number): CellProps;
16
16
  }
17
- declare const _default: ({ BaseTableComponent, leftTree, leftTotalNode, topTree, topTotalNode, getValue, getCellProps, leftMetaColumns, render, baseTableRef, ...others }: CrossTableProps) => JSX.Element;
17
+ declare const _default: ({ BaseTableComponent, leftTree, leftTotalNode, topTree, topTotalNode, getValue, getCellProps, leftMetaColumns, render, baseTableRef, ...others }: CrossTableProps) => React.JSX.Element;
18
18
  export default _default;
@@ -34,5 +34,5 @@ export default class CrossTreeTable extends React.Component<CrossTreeTableProps,
34
34
  };
35
35
  constructor(props: Readonly<CrossTreeTableProps>);
36
36
  onChangeOpenKeys: (nextOpenKeys: string[]) => void;
37
- render(): JSX.Element;
37
+ render(): React.JSX.Element;
38
38
  }
@@ -1 +1 @@
1
-
1
+
@@ -25,5 +25,5 @@ export interface PopperProps {
25
25
  getTriggerElement?: (locatorNode: HTMLElement) => HTMLElement;
26
26
  getPopupContainer?: (locatorNode: HTMLElement) => HTMLElement;
27
27
  }
28
- declare function usePopper(locatorElement: React.ReactElement, popperElement: React.ReactElement, props: PopperProps): JSX.Element;
28
+ declare function usePopper(locatorElement: React.ReactElement, popperElement: React.ReactElement, props: PopperProps): React.JSX.Element;
29
29
  export default usePopper;
@@ -1,2 +1,2 @@
1
- // color palettes
1
+ // color palettes
2
2
  @blue-base: #1890ff;
@@ -1 +1 @@
1
- @import "../table/style/index.less";
1
+ @import "../table\style\index.less";
@@ -1,2 +1,2 @@
1
- @import 'motion';
1
+ @import 'motion';
2
2
  @import 'reset';
@@ -1,28 +1,28 @@
1
- @keyframes loadingcircle {
2
- 100% {
3
- transform: rotate(360deg);
4
- }
5
- }
6
-
7
- @keyframes waveEffect {
8
- 100% {
9
- box-shadow: 0 0 0 6px @theme-color;
10
- }
11
- }
12
-
13
- @keyframes fadeEffect {
14
- 100% {
15
- opacity: 0;
16
- }
17
- }
18
-
19
- @keyframes kdRadioEffect {
20
- 0% {
21
- transform: translateY(-50%) scale(0.5);
22
- opacity: 0;
23
- }
24
- 100% {
25
- transform: translateY(-50%) scale(1);
26
- opacity: 1;
27
- }
1
+ @keyframes loadingcircle {
2
+ 100% {
3
+ transform: rotate(360deg);
4
+ }
5
+ }
6
+
7
+ @keyframes waveEffect {
8
+ 100% {
9
+ box-shadow: 0 0 0 6px @theme-color;
10
+ }
11
+ }
12
+
13
+ @keyframes fadeEffect {
14
+ 100% {
15
+ opacity: 0;
16
+ }
17
+ }
18
+
19
+ @keyframes kdRadioEffect {
20
+ 0% {
21
+ transform: translateY(-50%) scale(0.5);
22
+ opacity: 0;
23
+ }
24
+ 100% {
25
+ transform: translateY(-50%) scale(1);
26
+ opacity: 1;
27
+ }
28
28
  }
@@ -1,53 +1,53 @@
1
- @keyframes kdSlideDownIn {
2
- 0% {
3
- transform: scaleY(0.8);
4
- transform-origin: 50% 0%;
5
- opacity: 0;
6
- }
7
- 100% {
8
- transform: scaleY(1);
9
- transform-origin: 50% 0%;
10
- opacity: 1;
11
- }
12
- }
13
-
14
- @keyframes kdSlideDownOut {
15
- 0% {
16
- transform: scaleY(1);
17
- transform-origin: 50% 0%;
18
- opacity: 1;
19
- }
20
- 100% {
21
- transform: scaleY(0.9);
22
- transform-origin: 50% 0%;
23
- opacity: 0;
24
- }
25
- }
26
-
27
- @keyframes kdSlideUpIn {
28
- 0% {
29
- transform-origin: 50% 100%;
30
- opacity: 0;
31
- }
32
- 5% {
33
- transform: scaleY(0.8);
34
- }
35
- 100% {
36
- transform: scaleY(1);
37
- transform-origin: 50% 100%;
38
- opacity: 1;
39
- }
40
- }
41
-
42
- @keyframes kdSlideUpOut {
43
- 0% {
44
- transform: scaleY(1);
45
- transform-origin: 50% 100%;
46
- opacity: 1;
47
- }
48
- 100% {
49
- transform: scaleY(0.9);
50
- transform-origin: 50% 100%;
51
- opacity: 0;
52
- }
53
- }
1
+ @keyframes kdSlideDownIn {
2
+ 0% {
3
+ transform: scaleY(0.8);
4
+ transform-origin: 50% 0%;
5
+ opacity: 0;
6
+ }
7
+ 100% {
8
+ transform: scaleY(1);
9
+ transform-origin: 50% 0%;
10
+ opacity: 1;
11
+ }
12
+ }
13
+
14
+ @keyframes kdSlideDownOut {
15
+ 0% {
16
+ transform: scaleY(1);
17
+ transform-origin: 50% 0%;
18
+ opacity: 1;
19
+ }
20
+ 100% {
21
+ transform: scaleY(0.9);
22
+ transform-origin: 50% 0%;
23
+ opacity: 0;
24
+ }
25
+ }
26
+
27
+ @keyframes kdSlideUpIn {
28
+ 0% {
29
+ transform-origin: 50% 100%;
30
+ opacity: 0;
31
+ }
32
+ 5% {
33
+ transform: scaleY(0.8);
34
+ }
35
+ 100% {
36
+ transform: scaleY(1);
37
+ transform-origin: 50% 100%;
38
+ opacity: 1;
39
+ }
40
+ }
41
+
42
+ @keyframes kdSlideUpOut {
43
+ 0% {
44
+ transform: scaleY(1);
45
+ transform-origin: 50% 100%;
46
+ opacity: 1;
47
+ }
48
+ 100% {
49
+ transform: scaleY(0.9);
50
+ transform-origin: 50% 100%;
51
+ opacity: 0;
52
+ }
53
+ }
@@ -1,2 +1,2 @@
1
- @import 'motion/other';
1
+ @import 'motion/other';
2
2
  @import 'motion/slide';