@yuntijs/ui 1.0.0-beta.16 → 1.0.0-beta.17

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.
@@ -0,0 +1,17 @@
1
+ import { Table as AntdTable, TableProps } from 'antd';
2
+ import { AnyObject } from 'antd/es/_util/type';
3
+ import React from 'react';
4
+ export { type TableColumnGroupType, type TableColumnProps, type TableColumnsType, type TableColumnType, type TablePaginationConfig, type TableProps, } from 'antd';
5
+ type YuntiTable = <RecordType extends AnyObject = AnyObject>(props: TableProps<RecordType>) => React.ReactElement;
6
+ export declare const Table: YuntiTable & {
7
+ displayName?: typeof AntdTable.displayName;
8
+ SELECTION_COLUMN: typeof AntdTable.SELECTION_COLUMN;
9
+ EXPAND_COLUMN: typeof AntdTable.EXPAND_COLUMN;
10
+ SELECTION_ALL: typeof AntdTable.SELECTION_ALL;
11
+ SELECTION_INVERT: typeof AntdTable.SELECTION_INVERT;
12
+ SELECTION_NONE: typeof AntdTable.SELECTION_NONE;
13
+ Column: typeof AntdTable.Column;
14
+ ColumnGroup: typeof AntdTable.ColumnGroup;
15
+ Summary: typeof AntdTable.Summary;
16
+ };
17
+ export default Table;
@@ -0,0 +1,51 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["columns"];
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ import { Table as AntdTable, Tooltip } from 'antd';
7
+ import React from 'react';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ export var Table = function Table(props) {
10
+ var columns = props.columns,
11
+ otherProps = _objectWithoutProperties(props, _excluded);
12
+ var formatColumns;
13
+ if (columns) {
14
+ formatColumns = columns.map(function (item) {
15
+ if (!item.render) {
16
+ item.render = function (text) {
17
+ return text !== null && text !== void 0 ? text : '-';
18
+ };
19
+ }
20
+ if (item.ellipsis && item.ellipsis !== true && item.ellipsis.showTitle || item.ellipsis === true) {
21
+ var tooltipProps = item.ellipsis === true ? {} : item.ellipsis;
22
+ return _objectSpread(_objectSpread({}, item), {}, {
23
+ ellipsis: {
24
+ showTitle: false
25
+ },
26
+ render: function render(text) {
27
+ return text || text === 0 ? /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
28
+ placement: "topLeft",
29
+ title: text,
30
+ children: text
31
+ })) : '-';
32
+ }
33
+ });
34
+ }
35
+ return item;
36
+ });
37
+ }
38
+ return /*#__PURE__*/_jsx(AntdTable, _objectSpread(_objectSpread({}, otherProps), {}, {
39
+ columns: formatColumns
40
+ }));
41
+ };
42
+ Table.displayName = 'Table';
43
+ Table.SELECTION_COLUMN = AntdTable.SELECTION_COLUMN;
44
+ Table.EXPAND_COLUMN = AntdTable.EXPAND_COLUMN;
45
+ Table.SELECTION_ALL = AntdTable.SELECTION_ALL;
46
+ Table.SELECTION_INVERT = AntdTable.SELECTION_INVERT;
47
+ Table.SELECTION_NONE = AntdTable.SELECTION_NONE;
48
+ Table.Column = AntdTable.Column;
49
+ Table.ColumnGroup = AntdTable.ColumnGroup;
50
+ Table.Summary = AntdTable.Summary;
51
+ export default Table;
package/es/index.d.ts CHANGED
@@ -14,9 +14,10 @@ export * from './FormHelper';
14
14
  export * from './Modal';
15
15
  export * from './notification';
16
16
  export * from './Radio';
17
+ export * from './Table';
17
18
  export { Affix, type AffixProps, Anchor, type AnchorProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, BackTop, type BackTopProps, Badge, // @todo composed type
18
19
  type BadgeProps, Button, // @todo dependence unifiedLink. link type, hover primary color, back button
19
20
  type ButtonProps, Calendar, type CalendarProps, Carousel, type CarouselProps, Cascader, type CascaderProps, Checkbox, type CheckboxProps, Col, Collapse, type CollapseProps, ColorPicker, type ColorPickerProps, type ColProps, // @todo center style
20
- type CountdownProps, DatePicker, type DatePickerProps, Dropdown, type DropDownProps, Empty, type EmptyProps, Flex, type FlexProps, FloatButton, type FloatButtonProps, Form, type FormInstance, type FormItemProps, type FormListFieldData, type FormListOperation, type FormProps, type FormRule, type GlobalToken, Grid, Image, type ImageProps, Input, InputNumber, type InputNumberProps, type InputProps, type InputRef, Layout, type LayoutProps, List, type ListProps, type MappingAlgorithm, type MentionProps, Mentions, Menu, type MenuItemProps, type MenuProps, type MenuRef, type MenuTheme, message, type MessageArgsProps, Pagination, type PaginationProps, Popconfirm, type PopconfirmProps, Popover, type PopoverProps, Progress, type ProgressProps, QRCode, type QRCodeProps, type QRPropsCanvas, type QRPropsSvg, Rate, type RateProps, type RefSelectProps, Result, type ResultProps, Row, type RowProps, Segmented, type SegmentedProps, Select, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderSingleProps, Space, type SpaceProps, Spin, type SpinProps, Statistic, type StatisticProps, type StepProps, Steps, type StepsProps, type SubMenuProps, Switch, type SwitchProps, Table, type TableColumnGroupType, type TableColumnProps, type TableColumnsType, type TableColumnType, type TablePaginationConfig, type TableProps, type TabPaneProps, Tabs, type TabsProps, Tag, type TagProps, type TagType, theme, Timeline, type TimelineItemProps, type TimelineProps, TimePicker, type TimePickerProps, type TimeRangePickerProps, Tooltip, type TooltipProps, Tour, type TourProps, type TourStepProps, Transfer, type TransferProps, Tree, type TreeDataNode, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyProps, Upload, type UploadFile, type UploadProps, version, Watermark, type WatermarkProps, } from 'antd';
21
+ type CountdownProps, DatePicker, type DatePickerProps, Dropdown, type DropDownProps, Empty, type EmptyProps, Flex, type FlexProps, FloatButton, type FloatButtonProps, Form, type FormInstance, type FormItemProps, type FormListFieldData, type FormListOperation, type FormProps, type FormRule, type GlobalToken, Grid, Image, type ImageProps, Input, InputNumber, type InputNumberProps, type InputProps, type InputRef, Layout, type LayoutProps, List, type ListProps, type MappingAlgorithm, type MentionProps, Mentions, Menu, type MenuItemProps, type MenuProps, type MenuRef, type MenuTheme, message, type MessageArgsProps, Pagination, type PaginationProps, Popconfirm, type PopconfirmProps, Popover, type PopoverProps, Progress, type ProgressProps, QRCode, type QRCodeProps, type QRPropsCanvas, type QRPropsSvg, Rate, type RateProps, type RefSelectProps, Result, type ResultProps, Row, type RowProps, Segmented, type SegmentedProps, Select, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderSingleProps, Space, type SpaceProps, Spin, type SpinProps, Statistic, type StatisticProps, type StepProps, Steps, type StepsProps, type SubMenuProps, Switch, type SwitchProps, type TabPaneProps, Tabs, type TabsProps, Tag, type TagProps, type TagType, theme, Timeline, type TimelineItemProps, type TimelineProps, TimePicker, type TimePickerProps, type TimeRangePickerProps, Tooltip, type TooltipProps, Tour, type TourProps, type TourStepProps, Transfer, type TransferProps, Tree, type TreeDataNode, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyProps, Upload, type UploadFile, type UploadProps, version, Watermark, type WatermarkProps, } from 'antd';
21
22
  export { Highlighter, type HighlighterProps, Markdown, type MarkdownProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from '@lobehub/ui';
22
23
  export { useResponsive, useTheme, useThemeMode } from 'antd-style';
package/es/index.js CHANGED
@@ -16,6 +16,7 @@ export * from "./FormHelper";
16
16
  export * from "./Modal";
17
17
  export * from "./notification";
18
18
  export * from "./Radio";
19
+ export * from "./Table";
19
20
 
20
21
  // ~ antd
21
22
  export { Affix, Anchor, AutoComplete, Avatar, BackTop, Badge // @todo composed type
@@ -23,7 +24,7 @@ export { Affix, Anchor, AutoComplete, Avatar, BackTop, Badge // @todo composed t
23
24
  , Calendar, Carousel, Cascader, Checkbox, Col, Collapse, ColorPicker
24
25
 
25
26
  // @todo center style
26
- , DatePicker, Dropdown, Empty, Flex, FloatButton, Form, Grid, Image, Input, InputNumber, Layout, List, Mentions, Menu, message, Pagination, Popconfirm, Popover, Progress, QRCode, Rate, Result, Row, Segmented, Select, Skeleton, Slider, Space, Spin, Statistic, Steps, Switch, Table, Tabs, Tag, theme, Timeline, TimePicker, Tooltip, Tour, Transfer, Tree, TreeSelect, Typography, Upload, version, Watermark } from 'antd';
27
+ , DatePicker, Dropdown, Empty, Flex, FloatButton, Form, Grid, Image, Input, InputNumber, Layout, List, Mentions, Menu, message, Pagination, Popconfirm, Popover, Progress, QRCode, Rate, Result, Row, Segmented, Select, Skeleton, Slider, Space, Spin, Statistic, Steps, Switch, Tabs, Tag, theme, Timeline, TimePicker, Tooltip, Tour, Transfer, Tree, TreeSelect, Typography, Upload, version, Watermark } from 'antd';
27
28
 
28
29
  // ~ @lobehub/ui
29
30
  export { Highlighter, Markdown, SyntaxHighlighter } from '@lobehub/ui';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuntijs/ui",
3
- "version": "1.0.0-beta.16",
3
+ "version": "1.0.0-beta.17",
4
4
  "description": "☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps",
5
5
  "keywords": [
6
6
  "yuntijs",
@@ -98,7 +98,7 @@
98
98
  "@types/react-dom": "^18",
99
99
  "@vitest/coverage-v8": "latest",
100
100
  "@yuntijs/lint": "^1.4.0",
101
- "antd": "^5.12.5",
101
+ "antd": "^5.16.1",
102
102
  "antd-style": "^3",
103
103
  "babel-plugin-antd-style": "latest",
104
104
  "commitlint": "^18",