first commit
This commit is contained in:
5
frontend/node_modules/rc-table/es/utils/expandUtil.d.ts
generated
vendored
Normal file
5
frontend/node_modules/rc-table/es/utils/expandUtil.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import type { RenderExpandIconProps, Key, GetRowKey, ExpandableConfig } from '../interface';
|
||||
export declare function renderExpandIcon<RecordType>({ prefixCls, record, onExpand, expanded, expandable, }: RenderExpandIconProps<RecordType>): React.JSX.Element;
|
||||
export declare function findAllChildrenKeys<RecordType>(data: readonly RecordType[], getRowKey: GetRowKey<RecordType>, childrenColumnName: string): Key[];
|
||||
export declare function computedExpandedClassName<RecordType>(cls: ExpandableConfig<RecordType>['expandedRowClassName'], record: RecordType, index: number, indent: number): string;
|
||||
44
frontend/node_modules/rc-table/es/utils/expandUtil.js
generated
vendored
Normal file
44
frontend/node_modules/rc-table/es/utils/expandUtil.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
export function renderExpandIcon(_ref) {
|
||||
var prefixCls = _ref.prefixCls,
|
||||
record = _ref.record,
|
||||
onExpand = _ref.onExpand,
|
||||
expanded = _ref.expanded,
|
||||
expandable = _ref.expandable;
|
||||
var expandClassName = "".concat(prefixCls, "-row-expand-icon");
|
||||
if (!expandable) {
|
||||
return /*#__PURE__*/React.createElement("span", {
|
||||
className: classNames(expandClassName, "".concat(prefixCls, "-row-spaced"))
|
||||
});
|
||||
}
|
||||
var onClick = function onClick(event) {
|
||||
onExpand(record, event);
|
||||
event.stopPropagation();
|
||||
};
|
||||
return /*#__PURE__*/React.createElement("span", {
|
||||
className: classNames(expandClassName, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-row-expanded"), expanded), "".concat(prefixCls, "-row-collapsed"), !expanded)),
|
||||
onClick: onClick
|
||||
});
|
||||
}
|
||||
export function findAllChildrenKeys(data, getRowKey, childrenColumnName) {
|
||||
var keys = [];
|
||||
function dig(list) {
|
||||
(list || []).forEach(function (item, index) {
|
||||
keys.push(getRowKey(item, index));
|
||||
dig(item[childrenColumnName]);
|
||||
});
|
||||
}
|
||||
dig(data);
|
||||
return keys;
|
||||
}
|
||||
export function computedExpandedClassName(cls, record, index, indent) {
|
||||
if (typeof cls === 'string') {
|
||||
return cls;
|
||||
}
|
||||
if (typeof cls === 'function') {
|
||||
return cls(record, index, indent);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
13
frontend/node_modules/rc-table/es/utils/fixUtil.d.ts
generated
vendored
Normal file
13
frontend/node_modules/rc-table/es/utils/fixUtil.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Direction, FixedType, StickyOffsets } from '../interface';
|
||||
export interface FixedInfo {
|
||||
fixLeft: number | false;
|
||||
fixRight: number | false;
|
||||
lastFixLeft: boolean;
|
||||
firstFixRight: boolean;
|
||||
lastFixRight: boolean;
|
||||
firstFixLeft: boolean;
|
||||
isSticky: boolean;
|
||||
}
|
||||
export declare function getCellFixedInfo(colStart: number, colEnd: number, columns: readonly {
|
||||
fixed?: FixedType;
|
||||
}[], stickyOffsets: StickyOffsets, direction: Direction): FixedInfo;
|
||||
46
frontend/node_modules/rc-table/es/utils/fixUtil.js
generated
vendored
Normal file
46
frontend/node_modules/rc-table/es/utils/fixUtil.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
export function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction) {
|
||||
var startColumn = columns[colStart] || {};
|
||||
var endColumn = columns[colEnd] || {};
|
||||
var fixLeft;
|
||||
var fixRight;
|
||||
if (startColumn.fixed === 'left') {
|
||||
fixLeft = stickyOffsets.left[direction === 'rtl' ? colEnd : colStart];
|
||||
} else if (endColumn.fixed === 'right') {
|
||||
fixRight = stickyOffsets.right[direction === 'rtl' ? colStart : colEnd];
|
||||
}
|
||||
var lastFixLeft = false;
|
||||
var firstFixRight = false;
|
||||
var lastFixRight = false;
|
||||
var firstFixLeft = false;
|
||||
var nextColumn = columns[colEnd + 1];
|
||||
var prevColumn = columns[colStart - 1];
|
||||
|
||||
// need show shadow only when canLastFix is true
|
||||
var canLastFix = nextColumn && !nextColumn.fixed || prevColumn && !prevColumn.fixed || columns.every(function (col) {
|
||||
return col.fixed === 'left';
|
||||
});
|
||||
if (direction === 'rtl') {
|
||||
if (fixLeft !== undefined) {
|
||||
var prevFixLeft = prevColumn && prevColumn.fixed === 'left';
|
||||
firstFixLeft = !prevFixLeft && canLastFix;
|
||||
} else if (fixRight !== undefined) {
|
||||
var nextFixRight = nextColumn && nextColumn.fixed === 'right';
|
||||
lastFixRight = !nextFixRight && canLastFix;
|
||||
}
|
||||
} else if (fixLeft !== undefined) {
|
||||
var nextFixLeft = nextColumn && nextColumn.fixed === 'left';
|
||||
lastFixLeft = !nextFixLeft && canLastFix;
|
||||
} else if (fixRight !== undefined) {
|
||||
var prevFixRight = prevColumn && prevColumn.fixed === 'right';
|
||||
firstFixRight = !prevFixRight && canLastFix;
|
||||
}
|
||||
return {
|
||||
fixLeft: fixLeft,
|
||||
fixRight: fixRight,
|
||||
lastFixLeft: lastFixLeft,
|
||||
firstFixRight: firstFixRight,
|
||||
lastFixRight: lastFixRight,
|
||||
firstFixLeft: firstFixLeft,
|
||||
isSticky: stickyOffsets.isSticky
|
||||
};
|
||||
}
|
||||
5
frontend/node_modules/rc-table/es/utils/legacyUtil.d.ts
generated
vendored
Normal file
5
frontend/node_modules/rc-table/es/utils/legacyUtil.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { ExpandableConfig, LegacyExpandableProps } from '../interface';
|
||||
export declare const INTERNAL_COL_DEFINE = "RC_TABLE_INTERNAL_COL_DEFINE";
|
||||
export declare function getExpandableProps<RecordType>(props: LegacyExpandableProps<RecordType> & {
|
||||
expandable?: ExpandableConfig<RecordType>;
|
||||
}): ExpandableConfig<RecordType>;
|
||||
24
frontend/node_modules/rc-table/es/utils/legacyUtil.js
generated
vendored
Normal file
24
frontend/node_modules/rc-table/es/utils/legacyUtil.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
||||
var _excluded = ["expandable"];
|
||||
import warning from "rc-util/es/warning";
|
||||
export var INTERNAL_COL_DEFINE = 'RC_TABLE_INTERNAL_COL_DEFINE';
|
||||
export function getExpandableProps(props) {
|
||||
var expandable = props.expandable,
|
||||
legacyExpandableConfig = _objectWithoutProperties(props, _excluded);
|
||||
var config;
|
||||
if ('expandable' in props) {
|
||||
config = _objectSpread(_objectSpread({}, legacyExpandableConfig), expandable);
|
||||
} else {
|
||||
if (process.env.NODE_ENV !== 'production' && ['indentSize', 'expandedRowKeys', 'defaultExpandedRowKeys', 'defaultExpandAllRows', 'expandedRowRender', 'expandRowByClick', 'expandIcon', 'onExpand', 'onExpandedRowsChange', 'expandedRowClassName', 'expandIconColumnIndex', 'showExpandColumn', 'title'].some(function (prop) {
|
||||
return prop in props;
|
||||
})) {
|
||||
warning(false, 'expanded related props have been moved into `expandable`.');
|
||||
}
|
||||
config = legacyExpandableConfig;
|
||||
}
|
||||
if (config.showExpandColumn === false) {
|
||||
config.expandIconColumnIndex = -1;
|
||||
}
|
||||
return config;
|
||||
}
|
||||
4
frontend/node_modules/rc-table/es/utils/offsetUtil.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-table/es/utils/offsetUtil.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export declare function getOffset(node: HTMLElement | Window): {
|
||||
left: number;
|
||||
top: number;
|
||||
};
|
||||
14
frontend/node_modules/rc-table/es/utils/offsetUtil.js
generated
vendored
Normal file
14
frontend/node_modules/rc-table/es/utils/offsetUtil.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { getDOM } from "rc-util/es/Dom/findDOMNode";
|
||||
|
||||
// Copy from `rc-util/Dom/css.js`
|
||||
export function getOffset(node) {
|
||||
var element = getDOM(node);
|
||||
var box = element.getBoundingClientRect();
|
||||
var docElem = document.documentElement;
|
||||
|
||||
// < ie8 not support win.pageXOffset, use docElem.scrollLeft instead
|
||||
return {
|
||||
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
|
||||
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
|
||||
};
|
||||
}
|
||||
9
frontend/node_modules/rc-table/es/utils/valueUtil.d.ts
generated
vendored
Normal file
9
frontend/node_modules/rc-table/es/utils/valueUtil.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="react" />
|
||||
import type { DataIndex, Key } from '../interface';
|
||||
export interface GetColumnKeyColumn<T = any> {
|
||||
key?: Key;
|
||||
dataIndex?: DataIndex<T>;
|
||||
}
|
||||
export declare function getColumnsKey<T = any>(columns: readonly GetColumnKeyColumn<T>[]): import("react").Key[];
|
||||
export declare function validateValue<T>(val: T): boolean;
|
||||
export declare function validNumberValue(value: any): boolean;
|
||||
29
frontend/node_modules/rc-table/es/utils/valueUtil.js
generated
vendored
Normal file
29
frontend/node_modules/rc-table/es/utils/valueUtil.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
var INTERNAL_KEY_PREFIX = 'RC_TABLE_KEY';
|
||||
function toArray(arr) {
|
||||
if (arr === undefined || arr === null) {
|
||||
return [];
|
||||
}
|
||||
return Array.isArray(arr) ? arr : [arr];
|
||||
}
|
||||
export function getColumnsKey(columns) {
|
||||
var columnKeys = [];
|
||||
var keys = {};
|
||||
columns.forEach(function (column) {
|
||||
var _ref = column || {},
|
||||
key = _ref.key,
|
||||
dataIndex = _ref.dataIndex;
|
||||
var mergedKey = key || toArray(dataIndex).join('-') || INTERNAL_KEY_PREFIX;
|
||||
while (keys[mergedKey]) {
|
||||
mergedKey = "".concat(mergedKey, "_next");
|
||||
}
|
||||
keys[mergedKey] = true;
|
||||
columnKeys.push(mergedKey);
|
||||
});
|
||||
return columnKeys;
|
||||
}
|
||||
export function validateValue(val) {
|
||||
return val !== null && val !== undefined;
|
||||
}
|
||||
export function validNumberValue(value) {
|
||||
return typeof value === 'number' && !Number.isNaN(value);
|
||||
}
|
||||
Reference in New Issue
Block a user