yootd 0.0.2 → 0.0.3

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.
@@ -3,10 +3,9 @@ import { Table as AntTable } from 'antd';
3
3
  import { AnyObject } from 'antd/es/_util/type';
4
4
  import { ColumnType as AntColumnType } from 'antd/es/table';
5
5
  import React from 'react';
6
- import { RefTable } from 'antd/es/table/interface';
7
6
  import './index.scss';
8
7
  type AntTableType = typeof AntTable;
9
- export type { RefTable };
8
+ export type RefTable = <RecordType = AnyObject>(props: React.PropsWithChildren<TableProps<RecordType>> & React.RefAttributes<any>) => React.ReactElement;
10
9
  export type { TablePaginationConfig, TableRef } from 'antd/es/table';
11
10
  export type { ColumnFilterItem, ColumnTitle, ColumnTitleProps, CompareFn, ExpandType, ExpandableConfig, FilterConfirmProps, FilterDropdownProps, FilterKey, FilterSearchType, FilterValue, GetPopupContainer, GetRowKey, Key, RefInternalTable, RowSelectMethod, RowSelectionType, SafeKey, SelectionItem, SelectionItemSelectFn, SelectionSelectFn, SortOrder, SorterResult, SorterTooltipProps, SorterTooltipTarget, TableAction, TableCurrentDataSource, TableLocale, TableRowSelection, TransformColumns, } from 'antd/es/table/interface';
12
11
  export interface TableProps<T = AnyObject> extends Omit<AntTableProps<T>, 'columns'> {
@@ -19,6 +19,9 @@ import React, { forwardRef, useEffect, useMemo, useState } from 'react';
19
19
  import { PrimaryHeaderRow } from "./components/primary-header-row";
20
20
  import { arrayMove } from "../utils/utils";
21
21
  import { PrimaryTBodyRow } from "./components/primary-tbody-row";
22
+
23
+ // import { RefTable } from 'antd/es/table/interface';
24
+
22
25
  import "./index.scss";
23
26
  export var TableRowContext = /*#__PURE__*/React.createContext({});
24
27
  var InternalTable = function InternalTable(_ref, ref) {
@@ -112,12 +115,8 @@ var InternalTable = function InternalTable(_ref, ref) {
112
115
  _columns.push(col);
113
116
  });
114
117
  setInnerColumns(_columns);
115
-
116
- // 如果 keys 为空,则使用 _keys
117
- if (keys.length === 0) {
118
- setKeys(_keys);
119
- }
120
- }, [columns, keys]);
118
+ setKeys(_keys);
119
+ }, [columns]);
121
120
  return /*#__PURE__*/React.createElement(TableRowContext.Provider, {
122
121
  value: {
123
122
  columns: innerColumns,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yootd",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",