@teamix/pro 1.2.7 → 1.2.11

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 (121) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +756 -368
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/base.d.ts +16 -6
  6. package/es/actions/base.js +66 -12
  7. package/es/actions/confirm.d.ts +1 -1
  8. package/es/actions/danger-confirm.d.ts +1 -1
  9. package/es/actions/dialog-component.d.ts +1 -1
  10. package/es/actions/dialog-form.d.ts +1 -1
  11. package/es/actions/dialog-form.js +4 -4
  12. package/es/actions/dialog-info.d.ts +1 -1
  13. package/es/actions/dialog-table.d.ts +1 -1
  14. package/es/actions/dialog.d.ts +6 -2
  15. package/es/actions/dialog.js +19 -24
  16. package/es/actions/drawer-form.d.ts +1 -1
  17. package/es/actions/drawer-info.d.ts +1 -1
  18. package/es/actions/drawer-table.d.ts +1 -1
  19. package/es/actions/drawer.d.ts +1 -1
  20. package/es/actions/error.d.ts +1 -1
  21. package/es/actions/index.js +25 -21
  22. package/es/actions/index.scss +14 -7
  23. package/es/actions/link.d.ts +2 -2
  24. package/es/actions/link.js +2 -2
  25. package/es/actions/notice.d.ts +1 -1
  26. package/es/actions/request.d.ts +1 -1
  27. package/es/actions/request.js +2 -2
  28. package/es/card/index.d.ts +21 -3
  29. package/es/card/index.js +29 -12
  30. package/es/card/index.scss +71 -2
  31. package/es/card/selectable.d.ts +13 -0
  32. package/es/card/selectable.js +45 -0
  33. package/es/card/tab.d.ts +6 -0
  34. package/es/card/tab.js +27 -0
  35. package/es/form/Filter/index.js +5 -5
  36. package/es/form/ProForm/index.js +3 -23
  37. package/es/form/ProForm/index.scss +9 -0
  38. package/es/form/SchemaForm/index.js +7 -6
  39. package/es/index.d.ts +1 -1
  40. package/es/index.js +7 -4
  41. package/es/info/components/tableInfo/index.js +10 -6
  42. package/es/nocode/configurators/Card.js +31 -8
  43. package/es/page-header/index.d.ts +20 -11
  44. package/es/page-header/index.js +23 -47
  45. package/es/page-header/index.scss +0 -11
  46. package/es/sidebar/components/sidebar-container/index.d.ts +5 -0
  47. package/es/sidebar/components/sidebar-container/index.js +77 -0
  48. package/es/sidebar/components/sidebar-container/index.scss +18 -0
  49. package/es/sidebar/components/tree/index.d.ts +4 -0
  50. package/es/sidebar/components/tree/index.js +162 -0
  51. package/es/sidebar/index.d.ts +5 -0
  52. package/es/sidebar/index.js +70 -0
  53. package/es/sidebar/index.scss +3 -0
  54. package/es/sidebar/typing.d.ts +64 -0
  55. package/es/sidebar/typing.js +1 -0
  56. package/es/table/components/Filter/index.js +3 -3
  57. package/es/table/index.js +12 -3
  58. package/es/table/index.scss +1 -0
  59. package/es/table/typing.d.ts +2 -0
  60. package/es/utils/components/tags/index.d.ts +11 -0
  61. package/es/utils/components/tags/index.js +50 -0
  62. package/es/utils/components/tags/index.scss +12 -0
  63. package/lib/actions/base.d.ts +16 -6
  64. package/lib/actions/base.js +67 -12
  65. package/lib/actions/confirm.d.ts +1 -1
  66. package/lib/actions/danger-confirm.d.ts +1 -1
  67. package/lib/actions/dialog-component.d.ts +1 -1
  68. package/lib/actions/dialog-form.d.ts +1 -1
  69. package/lib/actions/dialog-form.js +3 -3
  70. package/lib/actions/dialog-info.d.ts +1 -1
  71. package/lib/actions/dialog-table.d.ts +1 -1
  72. package/lib/actions/dialog.d.ts +6 -2
  73. package/lib/actions/dialog.js +18 -23
  74. package/lib/actions/drawer-form.d.ts +1 -1
  75. package/lib/actions/drawer-info.d.ts +1 -1
  76. package/lib/actions/drawer-table.d.ts +1 -1
  77. package/lib/actions/drawer.d.ts +1 -1
  78. package/lib/actions/error.d.ts +1 -1
  79. package/lib/actions/index.js +25 -21
  80. package/lib/actions/index.scss +14 -7
  81. package/lib/actions/link.d.ts +2 -2
  82. package/lib/actions/link.js +2 -2
  83. package/lib/actions/notice.d.ts +1 -1
  84. package/lib/actions/request.d.ts +1 -1
  85. package/lib/actions/request.js +2 -2
  86. package/lib/card/index.d.ts +21 -3
  87. package/lib/card/index.js +35 -14
  88. package/lib/card/index.scss +71 -2
  89. package/lib/card/selectable.d.ts +13 -0
  90. package/lib/card/selectable.js +60 -0
  91. package/lib/card/tab.d.ts +6 -0
  92. package/lib/card/tab.js +39 -0
  93. package/lib/form/Filter/index.js +5 -6
  94. package/lib/form/ProForm/index.js +3 -23
  95. package/lib/form/ProForm/index.scss +9 -0
  96. package/lib/form/SchemaForm/index.js +7 -6
  97. package/lib/index.d.ts +1 -1
  98. package/lib/index.js +3 -1
  99. package/lib/info/components/tableInfo/index.js +10 -6
  100. package/lib/nocode/configurators/Card.js +31 -8
  101. package/lib/page-header/index.d.ts +20 -11
  102. package/lib/page-header/index.js +22 -45
  103. package/lib/page-header/index.scss +0 -11
  104. package/lib/sidebar/components/sidebar-container/index.d.ts +5 -0
  105. package/lib/sidebar/components/sidebar-container/index.js +93 -0
  106. package/lib/sidebar/components/sidebar-container/index.scss +18 -0
  107. package/lib/sidebar/components/tree/index.d.ts +4 -0
  108. package/lib/sidebar/components/tree/index.js +179 -0
  109. package/lib/sidebar/index.d.ts +5 -0
  110. package/lib/sidebar/index.js +91 -0
  111. package/lib/sidebar/index.scss +3 -0
  112. package/lib/sidebar/typing.d.ts +64 -0
  113. package/lib/sidebar/typing.js +5 -0
  114. package/lib/table/components/Filter/index.js +2 -2
  115. package/lib/table/index.js +12 -3
  116. package/lib/table/index.scss +1 -0
  117. package/lib/table/typing.d.ts +2 -0
  118. package/lib/utils/components/tags/index.d.ts +11 -0
  119. package/lib/utils/components/tags/index.js +66 -0
  120. package/lib/utils/components/tags/index.scss +12 -0
  121. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ .teamix-pro-sidebar {
2
+ color: var(--color-brand1-6);
3
+ }
@@ -0,0 +1,64 @@
1
+ /// <reference types="react" />
2
+ import { MessageProps } from '@alifd/next/types/message';
3
+ import { TreeProps } from '@alifd/next/types/tree';
4
+ import { ProCardProps, ProFieldProps } from '..';
5
+ /** ProSidebar 定义 */
6
+ export declare type ProSidebarProps = {
7
+ /** 数据源 */
8
+ dataSource?: ProSidebarDataSource;
9
+ /** 节点点击回调 */
10
+ onSelect?: TreeProps['onSelect'];
11
+ /** 树配置 */
12
+ treeProps?: TreeProps;
13
+ /** 卡片配置 */
14
+ cardProps?: ProCardProps;
15
+ } & Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> & Omit<ProSidebarContainerProps, 'onSelect'>;
16
+ /** 数据源定义 */
17
+ export declare type ProSidebarDataSource = ProSidebarDataSourceItem[];
18
+ export declare type ProSidebarDataSourceItem = {
19
+ /** 展示值 */
20
+ label?: React.ReactNode;
21
+ /** 绑定值 */
22
+ value?: any;
23
+ /** icon */
24
+ icon?: React.ReactNode;
25
+ /** 标签 */
26
+ tag?: React.ReactNode;
27
+ /** 右侧操作、状态区 */
28
+ extra?: React.ReactNode;
29
+ /** 子项 */
30
+ children?: ProSidebarDataSourceItem[];
31
+ };
32
+ /** tag 定义 */
33
+ export declare type ProSidebarDataSourceTag = {
34
+ /** 显示值 */
35
+ value: string;
36
+ };
37
+ /** sidebar 容器定义 */
38
+ export declare type ProSidebarContainerProps = {
39
+ children?: React.ReactNode;
40
+ /** 搜索输入提示 */
41
+ searchPlaceholder?: string;
42
+ /** 搜索输入其他参数 ProField 参数 */
43
+ searchProps?: ProFieldProps;
44
+ /** 是否展示搜索框 */
45
+ showSearch?: boolean;
46
+ /** 自定义搜索 */
47
+ customSearch?: React.ReactNode;
48
+ /** 搜索框变化的回调函数 */
49
+ searchOnChange?: (value: any) => void;
50
+ /** 通知提示消息区域 */
51
+ message?: React.ReactNode;
52
+ /** 自定义消息通知区域 */
53
+ customMessage?: React.ReactNode;
54
+ /** 消息通知区域的其他参数 */
55
+ messageProps?: MessageProps;
56
+ } & ProCardProps;
57
+ /** ProSidebarTree 内容定义 */
58
+ export declare type ProSidebarTreeProps = {
59
+ dataSource?: ProSidebarDataSource;
60
+ /** 搜索过滤关键词 */
61
+ searchKey?: string;
62
+ /** 节点点击回调 */
63
+ onChange?: ProSidebarProps['onChange'];
64
+ } & TreeProps;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -237,7 +237,7 @@ var Filter = function Filter(props) {
237
237
  (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7);
238
238
  setVisible(false);
239
239
  }
240
- }, "\u786E\u5B9A"), /*#__PURE__*/_react.default.createElement(_components.Button, {
240
+ }, (0, _utils.getMessage)('ok')), /*#__PURE__*/_react.default.createElement(_components.Button, {
241
241
  type: "normal",
242
242
  size: "small",
243
243
  className: cls({
@@ -254,7 +254,7 @@ var Filter = function Filter(props) {
254
254
  })));
255
255
  (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.filterDataSource) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10, column.dataIndex); // setVisible(!visible);
256
256
  }
257
- }, "\u91CD\u7F6E")))));
257
+ }, (0, _utils.getMessage)('reset'))))));
258
258
  };
259
259
 
260
260
  var _default = Filter;
@@ -55,7 +55,7 @@ Object.keys(_typing).forEach(function (key) {
55
55
  }
56
56
  });
57
57
  });
58
- var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest"];
58
+ var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest"];
59
59
 
60
60
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61
61
 
@@ -141,6 +141,7 @@ var ProTable = function ProTable(props) {
141
141
  getRowSelection = props.getRowSelection,
142
142
  primaryKey = props.primaryKey,
143
143
  footerAction = props.footerAction,
144
+ footer = props.footer,
144
145
  url = props.url,
145
146
  pageKey = props.pageKey,
146
147
  pageSizeKey = props.pageSizeKey,
@@ -766,7 +767,7 @@ var ProTable = function ProTable(props) {
766
767
  }
767
768
  }
768
769
 
769
- if (showPagination || footerAction) {
770
+ if (showPagination) {
770
771
  return /*#__PURE__*/_react.default.createElement("div", {
771
772
  className: cls('footer', {
772
773
  'footer-has-rowSelection': rowSelection
@@ -795,6 +796,14 @@ var ProTable = function ProTable(props) {
795
796
  return onChangePaginationSize(number);
796
797
  }
797
798
  }, props.paginationProps))));
799
+ } else if (!showPagination) {
800
+ return /*#__PURE__*/_react.default.createElement("div", {
801
+ className: cls('footer', {
802
+ 'footer-has-rowSelection': rowSelection
803
+ })
804
+ }, renderRowSelection(), /*#__PURE__*/_react.default.createElement("div", {
805
+ className: cls('footer-right-wrapper')
806
+ }, showSkeleton ? /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Footer.Pagination, null) : footer));
798
807
  }
799
808
  };
800
809
 
@@ -808,7 +817,7 @@ var ProTable = function ProTable(props) {
808
817
 
809
818
  }),
810
819
  ref: tableRef
811
- }, renderTable(), footerSuctionState && footerSuction && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && renderFooter()));
820
+ }, renderTable(), footerSuctionState && footerSuction && !fullscreenState && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && !fullscreenState && renderFooter(), fullscreenState && renderFooter()));
812
821
  };
813
822
 
814
823
  var _default = ProTable;
@@ -13,6 +13,7 @@ $fullscreenPadding: 24px;
13
13
  --checkbox-semi-select-icon-content: '\ead5';
14
14
  &-footer {
15
15
  padding: 8px 0;
16
+ width: 100%;
16
17
  }
17
18
  &-footer-fixed {
18
19
  position: fixed;
@@ -100,6 +100,8 @@ export declare type ProTableProps = {
100
100
  getRowSelection?: (rowSelection: rowSelectionType) => void;
101
101
  /** 表格底部(左侧)配置 */
102
102
  footerAction?: ProActionGroupProps | React.ReactNode;
103
+ /** 表格底部(右层)配置 */
104
+ footer?: React.ReactNode;
103
105
  /** 筛选区自动搜索的防抖时间(毫秒) */
104
106
  filterDebounce?: number;
105
107
  /** ProTable action 的引用,便于手动触发一些方法 */
@@ -0,0 +1,11 @@
1
+ import { TagProps, CloseableProps } from '@alicloudfe/components/types/tag';
2
+ import './index.scss';
3
+ export declare type ProTagItem = (TagProps | (CloseableProps & {
4
+ closable: true;
5
+ })) & {
6
+ /**
7
+ * @deprecated 建议使用 children 代替
8
+ */
9
+ text?: string;
10
+ };
11
+ export declare const renderTags: (tags?: ProTagItem[] | undefined, size?: "small" | "large" | "medium" | undefined) => JSX.Element | null;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderTags = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _components = require("@alicloudfe/components");
11
+
12
+ var _utils = require("@teamix/utils");
13
+
14
+ require("./index.scss");
15
+
16
+ var _excluded = ["text", "children", "closable"];
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
21
+
22
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23
+
24
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
+
26
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
27
+
28
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
+
30
+ var cls = (0, _utils.baseClass)('teamix-pro-tags');
31
+
32
+ var renderTags = function renderTags(tags, size) {
33
+ if (!tags || !tags.length) {
34
+ return null;
35
+ }
36
+
37
+ return /*#__PURE__*/_react.default.createElement(_components.Tag.Group, {
38
+ className: cls('')
39
+ }, tags.map(function (tag, i) {
40
+ // @ts-ignore
41
+ var text = tag.text,
42
+ children = tag.children,
43
+ closable = tag.closable,
44
+ others = _objectWithoutProperties(tag, _excluded);
45
+
46
+ if (closable) {
47
+ return /*#__PURE__*/_react.default.createElement(_components.Tag.Closeable, _objectSpread({
48
+ key: i,
49
+ size: size,
50
+ style: {
51
+ marginBottom: 0
52
+ }
53
+ }, others), text || children);
54
+ }
55
+
56
+ return /*#__PURE__*/_react.default.createElement(_components.Tag, _objectSpread({
57
+ key: i,
58
+ size: size,
59
+ style: {
60
+ marginBottom: 0
61
+ }
62
+ }, others), text || children);
63
+ }));
64
+ };
65
+
66
+ exports.renderTags = renderTags;
@@ -0,0 +1,12 @@
1
+ .teamix-pro-tags {
2
+ display: inline-flex;
3
+ align-items: center;
4
+
5
+ & > div.next-tag {
6
+ margin-right: var(--s-2, 8px);
7
+
8
+ &:last-child {
9
+ margin-right: 0;
10
+ }
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.2.7",
3
+ "version": "1.2.11",
4
4
  "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",