@teamix/pro 1.3.16 → 1.4.1

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 (126) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +27284 -20379
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/dist/pro.min.js.LICENSE.txt +0 -2
  6. package/es/actions/index.js +5 -1
  7. package/es/card/index.d.ts +1 -1
  8. package/es/card/index.js +3 -2
  9. package/es/card/selectable.js +2 -2
  10. package/es/card/utils.js +2 -2
  11. package/es/form/Components/Editable/index.js +14 -10
  12. package/es/form/Components/FormGroup/index.js +10 -6
  13. package/es/form/Components/LightFilter/index.js +10 -7
  14. package/es/form/Components/Text/index.js +2 -4
  15. package/es/form/Filter/AdvancedFilter.js +3 -6
  16. package/es/form/Filter/Layout.js +12 -13
  17. package/es/form/Filter/LightFilter.js +3 -6
  18. package/es/form/Filter/SimpleFilter.js +3 -6
  19. package/es/form/Filter/index.js +9 -10
  20. package/es/form/Filter/index2.js +5 -10
  21. package/es/form/Filter/useBindUrl.js +14 -14
  22. package/es/form/ProForm/index.d.ts +3 -2
  23. package/es/form/ProForm/index.js +7 -17
  24. package/es/form/SchemaForm/initializeSelectTable.js +3 -6
  25. package/es/form/typing.d.ts +0 -3
  26. package/es/index.d.ts +1 -1
  27. package/es/index.js +2 -3
  28. package/es/info/components/InfoValueItem/index.js +2 -2
  29. package/es/info/components/ProInfoItem/index.js +3 -2
  30. package/es/info/components/tableInfo/index.js +1 -1
  31. package/es/nocode/pages/editor.js +2 -2
  32. package/es/nocode/pages/playground.js +2 -2
  33. package/es/nocode/pages/renderer.js +2 -2
  34. package/es/nocode/playground.js +2 -2
  35. package/es/page-header/index.d.ts +2 -1
  36. package/es/page-header/index.js +3 -2
  37. package/es/sidebar/components/sidebar-container/index.js +2 -2
  38. package/es/sidebar/components/tree/index.js +2 -2
  39. package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +2 -2
  40. package/es/sidebar/components/tree-node/components/IconAction/index.js +2 -2
  41. package/es/sidebar/components/tree-node/components/IconSwitch/index.js +2 -2
  42. package/es/sidebar/components/tree-node/index.js +3 -3
  43. package/es/sidebar/index.js +2 -2
  44. package/es/sidebar/typing.d.ts +2 -1
  45. package/es/table/components/Filter/index.js +2 -2
  46. package/es/table/components/Layout/index.js +3 -2
  47. package/es/table/components/Pagination/index.js +13 -9
  48. package/es/table/components/ToolBar/DensityIcon.js +2 -2
  49. package/es/table/components/ToolBar/FilterColumnIcon.js +6 -12
  50. package/es/table/components/ToolBar/FullScreenIcon.js +2 -2
  51. package/es/table/components/ToolBar/RefreshIcon.js +2 -2
  52. package/es/table/components/ToolBar/index.js +2 -2
  53. package/es/table/index.js +16 -23
  54. package/es/table/index.scss +7 -0
  55. package/es/table/typing.d.ts +3 -1
  56. package/es/table/utils/columnRender.d.ts +1 -1
  57. package/es/table/utils/columnRender.js +8 -5
  58. package/es/table/utils/genProColumnToColumn.d.ts +1 -1
  59. package/es/table/utils/genProColumnToColumn.js +2 -1
  60. package/es/table/utils/pureColumnRender.js +2 -2
  61. package/es/timeline/ProTimeLineItem/index.js +3 -3
  62. package/es/timeline/index.js +2 -2
  63. package/es/timeline/typing.d.ts +1 -1
  64. package/lib/actions/index.js +5 -1
  65. package/lib/card/index.d.ts +1 -1
  66. package/lib/card/index.js +4 -2
  67. package/lib/card/selectable.js +1 -1
  68. package/lib/card/utils.js +1 -1
  69. package/lib/form/Components/Editable/index.js +14 -10
  70. package/lib/form/Components/FormGroup/index.js +10 -6
  71. package/lib/form/Components/LightFilter/index.js +10 -7
  72. package/lib/form/Components/Text/index.js +2 -4
  73. package/lib/form/Filter/AdvancedFilter.js +2 -6
  74. package/lib/form/Filter/Layout.js +11 -13
  75. package/lib/form/Filter/LightFilter.js +2 -6
  76. package/lib/form/Filter/SimpleFilter.js +2 -6
  77. package/lib/form/Filter/index.js +8 -10
  78. package/lib/form/Filter/index2.js +4 -10
  79. package/lib/form/Filter/useBindUrl.js +13 -13
  80. package/lib/form/ProForm/index.d.ts +3 -2
  81. package/lib/form/ProForm/index.js +6 -18
  82. package/lib/form/SchemaForm/initializeSelectTable.js +2 -6
  83. package/lib/form/typing.d.ts +0 -3
  84. package/lib/index.d.ts +1 -1
  85. package/lib/index.js +1 -1
  86. package/lib/info/components/InfoValueItem/index.js +1 -1
  87. package/lib/info/components/ProInfoItem/index.js +6 -4
  88. package/lib/info/components/tableInfo/index.js +4 -4
  89. package/lib/nocode/pages/editor.js +1 -1
  90. package/lib/nocode/pages/playground.js +1 -1
  91. package/lib/nocode/pages/renderer.js +1 -1
  92. package/lib/nocode/playground.js +1 -1
  93. package/lib/page-header/index.d.ts +2 -1
  94. package/lib/page-header/index.js +5 -3
  95. package/lib/sidebar/components/sidebar-container/index.js +1 -1
  96. package/lib/sidebar/components/tree/index.js +1 -1
  97. package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +1 -1
  98. package/lib/sidebar/components/tree-node/components/IconAction/index.js +1 -1
  99. package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +1 -1
  100. package/lib/sidebar/components/tree-node/index.js +3 -3
  101. package/lib/sidebar/index.js +1 -1
  102. package/lib/sidebar/typing.d.ts +2 -1
  103. package/lib/table/components/Filter/index.js +1 -1
  104. package/lib/table/components/Layout/index.js +5 -3
  105. package/lib/table/components/Pagination/index.js +12 -9
  106. package/lib/table/components/ToolBar/DensityIcon.js +1 -1
  107. package/lib/table/components/ToolBar/FilterColumnIcon.js +7 -11
  108. package/lib/table/components/ToolBar/FullScreenIcon.js +1 -1
  109. package/lib/table/components/ToolBar/RefreshIcon.js +1 -1
  110. package/lib/table/components/ToolBar/index.js +1 -1
  111. package/lib/table/index.js +15 -23
  112. package/lib/table/index.scss +7 -0
  113. package/lib/table/typing.d.ts +3 -1
  114. package/lib/table/utils/columnRender.d.ts +1 -1
  115. package/lib/table/utils/columnRender.js +14 -5
  116. package/lib/table/utils/genProColumnToColumn.d.ts +1 -1
  117. package/lib/table/utils/genProColumnToColumn.js +2 -1
  118. package/lib/table/utils/pureColumnRender.js +8 -2
  119. package/lib/timeline/ProTimeLineItem/index.js +4 -2
  120. package/lib/timeline/index.js +1 -1
  121. package/lib/timeline/typing.d.ts +1 -1
  122. package/package.json +1 -1
  123. package/es/form/ProForm/useFieldSchema.d.ts +0 -7
  124. package/es/form/ProForm/useFieldSchema.js +0 -109
  125. package/lib/form/ProForm/useFieldSchema.d.ts +0 -7
  126. package/lib/form/ProForm/useFieldSchema.js +0 -118
@@ -22,8 +22,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
22
22
 
23
23
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
24
 
25
- import cls from 'classnames';
26
- import { usePrefixCls, isStr, isPlainObj, isArr } from '@teamix/utils';
25
+ import { usePrefixCls, cls, isStr, isPlainObj, isArr } from '@teamix/utils';
27
26
  import pureGenProColumnToColumn from '../../table/utils/pureGenProColumnToColumn';
28
27
  /**
29
28
  * 将可被 ProForm 识别的上下文转换为仅被 ProTable 识别的上下文
@@ -85,15 +84,13 @@ var initialize = function initialize(item) {
85
84
  var _item$children = item.children,
86
85
  children = _item$children === void 0 ? [] : _item$children,
87
86
  props = item.props;
88
- var prefixCls = usePrefixCls('', {
89
- prefix: 'teamix-pro-form-select-table-column-tree'
90
- });
87
+ var prefixCls = usePrefixCls('teamix-pro-form-select-table-column-tree');
91
88
  var columns = props === null || props === void 0 ? void 0 : (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.map(function (value, index) {
92
89
  var column = adapterContext(value);
93
90
 
94
91
  if ((props === null || props === void 0 ? void 0 : props.isTree) && index === 0) {
95
92
  return _objectSpread(_objectSpread({}, column), {}, {
96
- className: cls(column.className, prefixCls)
93
+ className: cls(prefixCls(), column.className)
97
94
  });
98
95
  }
99
96
 
@@ -78,9 +78,6 @@ export interface ProFormProps extends IFormLayoutProps {
78
78
  onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
79
79
  onInitialComplete?: (form: FormType) => void;
80
80
  }
81
- export declare type ComposedProForm = React.FC<ProFormProps> & {
82
- Field?: React.FC<any>;
83
- };
84
81
  export interface FilterProps extends ProFormProps {
85
82
  form: FormType;
86
83
  defaultFilterValue?: string;
package/es/index.d.ts CHANGED
@@ -27,5 +27,5 @@ export * from './table';
27
27
  export * from './sidebar';
28
28
  export * from './utils';
29
29
  export * from './timeline';
30
- declare const version = "1.3.16";
30
+ declare const version = "1.4.1";
31
31
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -29,9 +29,8 @@ export * from './page-header';
29
29
  export * from './skeleton';
30
30
  export * from './table';
31
31
  export * from './sidebar';
32
- export * from './utils'; // export * from './sidebar';
33
-
32
+ export * from './utils';
34
33
  export * from './timeline';
35
- var version = '1.3.16';
34
+ var version = '1.4.1';
36
35
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
37
36
  ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils };
@@ -32,14 +32,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
32
32
 
33
33
  import TeamixIcon from '@teamix/icon';
34
34
  import ProField from '../../../field';
35
- import { baseClass, getTargetValue, request } from '@teamix/utils';
35
+ import { usePrefixCls, getTargetValue, request } from '@teamix/utils';
36
36
  import PopConfirm from '@teamix/pop-confirm';
37
37
  import React, { useMemo, useState } from 'react';
38
38
  import './index.scss';
39
39
  import ProForm, { createForm, formilyReactive } from '../../../form';
40
40
  import { Message } from '@alicloudfe/components';
41
41
  import { ProActionGroup } from '../../../actions';
42
- var cls = baseClass('teamix-pro-info');
42
+ var cls = usePrefixCls('teamix-pro-info');
43
43
  var toJS = formilyReactive.toJS;
44
44
 
45
45
  var InfoValueItem = function InfoValueItem(props) {
@@ -1,9 +1,10 @@
1
1
  import { Grid } from '@alicloudfe/components';
2
2
  import { ProSkeletonRaw } from '../../..';
3
- import { baseClass, Ellipsis, LabelIconTip } from '@teamix/utils';
3
+ import { usePrefixCls } from '@teamix/utils';
4
4
  import React from 'react';
5
+ import { Ellipsis, LabelIconTip } from '../../../field';
5
6
  import './index.scss';
6
- var cls = baseClass('teamix-pro-field-info-form-item');
7
+ var cls = usePrefixCls('teamix-pro-field-info-form-item');
7
8
  var Row = Grid.Row,
8
9
  Col = Grid.Col;
9
10
 
@@ -20,7 +20,7 @@ import React, { useMemo } from 'react';
20
20
  import './index.scss';
21
21
  import { Table } from '@alicloudfe/components';
22
22
  import './index.scss';
23
- import { LabelIconTip } from '@teamix/utils';
23
+ import { LabelIconTip } from '../../../field';
24
24
  import InfoValueItem from '../InfoValueItem';
25
25
  import { ProSkeletonRaw } from '../../..';
26
26
  import { getDataIndexValue } from '../../utils';
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import SVG from '@teamix/svg';
3
- import { baseClass } from '@teamix/utils';
3
+ import { usePrefixCls } from '@teamix/utils';
4
4
  import { PagePlayground } from './playground';
5
5
  import { PageMap, PageDefaultInitialValues } from '.';
6
- var cls = baseClass('teamix-pro-pager');
6
+ var cls = usePrefixCls('teamix-pro-pager');
7
7
  export var PageEditor = function PageEditor(props) {
8
8
  var type = props.type,
9
9
  initialValues = props.initialValues,
@@ -21,12 +21,12 @@ import { Balloon } from '@alicloudfe/components';
21
21
  import { useDebounceFn } from '@teamix/hooks';
22
22
  import Icon from '@teamix/icon';
23
23
  import SVG from '@teamix/svg';
24
- import { baseClass } from '@teamix/utils';
24
+ import { usePrefixCls } from '@teamix/utils';
25
25
  import { useAction } from '../../actions';
26
26
  import { initConfigurator } from '../configurators';
27
27
  import { ComponentConfiguratorMap } from '../configurators/map';
28
28
  import { PlayGroundLayout } from '../playground';
29
- var cls = baseClass('teamix-nocode');
29
+ var cls = usePrefixCls('teamix-nocode');
30
30
  export var PagePlayground = function PagePlayground(props) {
31
31
  var _useState = useState(undefined),
32
32
  _useState2 = _slicedToArray(_useState, 2),
@@ -38,9 +38,9 @@ import SVG from '@teamix/svg';
38
38
  import PageContainer from '../../page-container';
39
39
  import PageHeader from '../../page-header';
40
40
  import { ProSkeletonRaw } from '../../skeleton';
41
- import { baseClass } from '@teamix/utils';
41
+ import { usePrefixCls } from '@teamix/utils';
42
42
  import { PageMap } from '.';
43
- var cls = baseClass('teamix-nocode');
43
+ var cls = usePrefixCls('teamix-nocode');
44
44
 
45
45
  var Loading = function Loading(props) {
46
46
  return /*#__PURE__*/React.createElement(PageContainer, _objectSpread({
@@ -17,10 +17,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
19
  import React, { useMemo } from 'react';
20
- import { baseClass } from '@teamix/utils';
20
+ import { usePrefixCls } from '@teamix/utils';
21
21
  import { useDebounceFn } from '@teamix/hooks';
22
22
  import { initConfigurator } from './configurators';
23
- var cls = baseClass('teamix-nocode-playground');
23
+ var cls = usePrefixCls('teamix-nocode-playground');
24
24
  export var PlayGroundLayout = function PlayGroundLayout(props) {
25
25
  return /*#__PURE__*/React.createElement("div", {
26
26
  className: cls()
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ItemProps } from '@alicloudfe/components/types/breadcrumb';
3
- import { LinkPath, ProTagItem, CapsuleTabType } from '@teamix/utils';
3
+ import { LinkPath } from '@teamix/utils';
4
+ import { CapsuleTabType, ProTagItem } from '../field';
4
5
  import { ProActionGroupProps } from '../actions';
5
6
  import { ProInfoProps } from '../info';
6
7
  import './index.scss';
@@ -17,12 +17,13 @@ import { useHistory } from 'react-router-dom';
17
17
  import classnames from 'classnames';
18
18
  import TeamixIcon from '@teamix/icon';
19
19
  import { Breadcrumb, Balloon } from '@alicloudfe/components';
20
- import { baseClass, goToLink, renderTags, isPresetColor, getColor, getColorClassName, getBackgroundColorClassName, CapsuleTab } from '@teamix/utils';
20
+ import { usePrefixCls, goToLink, isPresetColor, getColor, getColorClassName, getBackgroundColorClassName } from '@teamix/utils';
21
+ import { CapsuleTab, renderTags } from '../field';
21
22
  import { ProActionGroup } from '../actions';
22
23
  import { ProSkeletonRaw } from '../skeleton';
23
24
  import ProInfo from '../info';
24
25
  import './index.scss';
25
- var cls = baseClass('teamix-pro-page-header');
26
+ var cls = usePrefixCls('teamix-pro-page-header');
26
27
  var Tooltip = Balloon.Tooltip;
27
28
 
28
29
  var renderNav = function renderNav(breadcrumbs) {
@@ -33,11 +33,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
33
33
  import { Button, MenuButton, Message } from '@alicloudfe/components';
34
34
  import { ProCard } from '../../../card';
35
35
  import ProField from '@teamix/pro-field';
36
- import { baseClass } from '@teamix/utils';
36
+ import { usePrefixCls } from '@teamix/utils';
37
37
  import React, { useEffect, useRef, useState } from 'react';
38
38
  import './index.scss';
39
39
  import TeamixIcon from '@teamix/icon';
40
- var cls = baseClass('teamix-pro-sidebar-container');
40
+ var cls = usePrefixCls('teamix-pro-sidebar-container');
41
41
 
42
42
  var ProSidebarContainer = function ProSidebarContainer(props) {
43
43
  var children = props.children,
@@ -33,7 +33,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
33
33
  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; }
34
34
 
35
35
  import { Tree } from '@alicloudfe/components';
36
- import { baseClass } from '@teamix/utils';
36
+ import { usePrefixCls } from '@teamix/utils';
37
37
  import React, { useEffect, useMemo, useState } from 'react';
38
38
  import { renderTreeNode, renderTreeNodeDependenceValue } from '../tree-node';
39
39
  import './index.scss';
@@ -42,7 +42,7 @@ import { filterTreeData, getAllNodeKey, getTreeLevelKey, loop } from '../../util
42
42
  import { useUpdateEffect } from '@teamix/hooks';
43
43
  import { useActionType } from '../../utils/action-ref';
44
44
  import cloneDeep from 'lodash.clonedeep';
45
- var cls = baseClass('teamix-pro-sidebar-tree');
45
+ var cls = usePrefixCls('teamix-pro-sidebar-tree');
46
46
 
47
47
  var ProSidebarTree = function ProSidebarTree(props) {
48
48
  var _ref;
@@ -17,10 +17,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
19
  import { Balloon } from '@alicloudfe/components';
20
- import { baseClass } from '@teamix/utils';
20
+ import { usePrefixCls } from '@teamix/utils';
21
21
  import React, { useEffect, useState } from 'react';
22
22
  import './index.scss';
23
- var cls = baseClass('teamix-pro-hover-tooltip');
23
+ var cls = usePrefixCls('teamix-pro-hover-tooltip');
24
24
 
25
25
  var ProHoverTooltip = function ProHoverTooltip(props) {
26
26
  var trigger = props.trigger,
@@ -18,11 +18,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
19
  import TeamixIcon from '@teamix/icon';
20
20
  import { useAction } from '../../../../..';
21
- import { baseClass } from '@teamix/utils';
21
+ import { usePrefixCls } from '@teamix/utils';
22
22
  import React, { useState } from 'react';
23
23
  import ProHoverTooltip from '../HoverTooltip';
24
24
  import './index.scss';
25
- var cls = baseClass('teamix-pro-sidebar-icon-action');
25
+ var cls = usePrefixCls('teamix-pro-sidebar-icon-action');
26
26
 
27
27
  var ProIconAction = function ProIconAction(props) {
28
28
  var _popupProps$wrapperCl;
@@ -11,11 +11,11 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  import TeamixIcon from '@teamix/icon';
14
- import { baseClass } from '@teamix/utils';
14
+ import { usePrefixCls } from '@teamix/utils';
15
15
  import React, { isValidElement, useEffect, useState } from 'react';
16
16
  import ProHoverTooltip from '../HoverTooltip';
17
17
  import './index.scss';
18
- var cls = baseClass('teamix-pro-icon-switch');
18
+ var cls = usePrefixCls('teamix-pro-icon-switch');
19
19
 
20
20
  var ProIconSwitch = function ProIconSwitch(props) {
21
21
  var visibleProp = props.visible,
@@ -26,13 +26,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
26
 
27
27
  import { Tree } from '@alicloudfe/components';
28
28
  import { ProActionGroup } from '../../../actions';
29
- import { baseClass, renderTags } from '@teamix/utils';
29
+ import { usePrefixCls } from '@teamix/utils';
30
30
  import React, { isValidElement, useState } from 'react';
31
- import ProField from '@teamix/pro-field';
31
+ import ProField, { renderTags } from '@teamix/pro-field';
32
32
  import ProIconAction from './components/IconAction';
33
33
  import ProIconSwitch from './components/IconSwitch';
34
34
  import ProHoverTooltip from './components/HoverTooltip';
35
- var cls = baseClass('teamix-pro-sidebar-tree');
35
+ var cls = usePrefixCls('teamix-pro-sidebar-tree');
36
36
 
37
37
  var ProSideBarTreeNode = function ProSideBarTreeNode(props) {
38
38
  var tag = props.tag,
@@ -24,7 +24,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
24
24
 
25
25
  import React, { useEffect, useRef, useState } from 'react';
26
26
  import './index.scss';
27
- import { baseClass, doCommonRequest } from '@teamix/utils';
27
+ import { usePrefixCls, doCommonRequest } from '@teamix/utils';
28
28
  import ProSidebarContainer from './components/sidebar-container';
29
29
  import ProSidebarTree from './components/tree';
30
30
  import { getTreeLevel, ProSkeletonRaw } from '..';
@@ -32,7 +32,7 @@ import { useActionType } from './utils/action-ref';
32
32
  import debounce from 'lodash.debounce';
33
33
  export * from './typing';
34
34
  export * from './utils';
35
- var cls = baseClass('teamix-pro-sidebar');
35
+ var cls = usePrefixCls('teamix-pro-sidebar');
36
36
 
37
37
  var ProSidebar = function ProSidebar(props) {
38
38
  var selectedKeys = props.selectedKeys,
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { MessageProps } from '@alifd/next/types/message';
3
3
  import { TreeProps } from '@alifd/next/types/tree';
4
- import { CommonRequestConfig, ProTagItem } from '@teamix/utils';
4
+ import { CommonRequestConfig } from '@teamix/utils';
5
+ import { ProTagItem } from '../field';
5
6
  import { ProActionConfig, ProCardProps, ProFieldProps, ProFieldRenderProps, ProFieldType } from '..';
6
7
  /** ProSidebar 定义 */
7
8
  export declare type ProSidebarProps = {
@@ -28,10 +28,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
28
  import React, { useEffect, useMemo, useState } from 'react';
29
29
  import TeamixIcon from '@teamix/icon';
30
30
  import { Button, Dropdown, Menu } from '@alicloudfe/components';
31
- import { baseClass, getMessage } from '@teamix/utils';
31
+ import { usePrefixCls, getMessage } from '@teamix/utils';
32
32
  import './index.scss';
33
33
  var CheckboxItem = Menu.CheckboxItem;
34
- var cls = baseClass('teamix-pro-table-toolbar-filter');
34
+ var cls = usePrefixCls('teamix-pro-table-toolbar-filter');
35
35
  var RadioItem = Menu.RadioItem;
36
36
 
37
37
  var Filter = function Filter(props) {
@@ -13,13 +13,14 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
13
13
  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; }
14
14
 
15
15
  import React, { isValidElement } from 'react';
16
- import { Header, baseClass } from '@teamix/utils';
16
+ import { usePrefixCls } from '@teamix/utils';
17
+ import { Header } from '../../../field';
17
18
  import { ProActionGroup } from '../../../actions';
18
19
  import { QueryFilter, QueryFilterLayout } from '../../../form';
19
20
  import ToolBar from '../ToolBar';
20
21
  import QuickAction from '../QuickAction';
21
22
  import './index.scss';
22
- var cls = baseClass('teamix-pro-table-layout');
23
+ var cls = usePrefixCls('teamix-pro-table-layout');
23
24
 
24
25
  var Layout = function Layout(props) {
25
26
  var header = props.header,
@@ -25,10 +25,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
25
25
  // 自适应宽度的翻页器
26
26
  import React, { useState, useEffect } from 'react';
27
27
  import { Pagination, Balloon, Select, Button, Input, Icon } from '@alicloudfe/components';
28
- import { getMessage, baseClass, usePrefixCls } from '@teamix/utils';
28
+ import { getMessage, cls, usePrefixCls } from '@teamix/utils';
29
29
  import { useResponsiveProps } from '@teamix/hooks';
30
30
  import './index.scss';
31
- var cls = baseClass('teamix-pro-pagination');
32
31
  export default (function (props) {
33
32
  var className = props.className,
34
33
  propsOnChange = props.onChange,
@@ -42,6 +41,11 @@ export default (function (props) {
42
41
  responsivePaginationType = props.responsivePaginationType,
43
42
  otherProps = _objectWithoutProperties(props, _excluded);
44
43
 
44
+ var basePrefix = usePrefixCls('', {
45
+ base: true
46
+ });
47
+ var prefixCls = usePrefixCls('teamix-pro-pagination');
48
+
45
49
  var _useResponsiveProps = useResponsiveProps([480, 590, 700], ['mini', 'small', 'simple', 'normal']),
46
50
  responsiveProps = _useResponsiveProps.responsiveProps,
47
51
  paginationWrapperRef = _useResponsiveProps.ref;
@@ -97,11 +101,11 @@ export default (function (props) {
97
101
  total: total
98
102
  }))
99
103
  }, /*#__PURE__*/React.createElement("div", {
100
- className: cls('custom-total-content')
104
+ className: prefixCls('custom-total-content')
101
105
  }, /*#__PURE__*/React.createElement("div", {
102
106
  className: "title"
103
107
  }, getMessage('pageSize')), /*#__PURE__*/React.createElement(Select, {
104
- className: cls('custom-page-size-selector'),
108
+ className: prefixCls('custom-page-size-selector'),
105
109
  dataSource: pageSizeList,
106
110
  defaultValue: pageSize,
107
111
  followTrigger: true,
@@ -158,9 +162,9 @@ export default (function (props) {
158
162
  };
159
163
 
160
164
  return /*#__PURE__*/React.createElement("div", {
161
- className: cls('custom-jumper')
165
+ className: prefixCls('custom-jumper')
162
166
  }, /*#__PURE__*/React.createElement(Button, {
163
- className: "".concat(usePrefixCls(), "prev ").concat(usePrefixCls(), "pagination-item"),
167
+ className: basePrefix('prev', 'pagination-item'),
164
168
  onClick: handlePrevClick,
165
169
  disabled: Number(currentPage) <= 1
166
170
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -182,7 +186,7 @@ export default (function (props) {
182
186
  marginRight: 4
183
187
  }
184
188
  }, "/"), getTotalPage(total, pageSize)), /*#__PURE__*/React.createElement(Button, {
185
- className: "".concat(usePrefixCls(), "next ").concat(usePrefixCls(), "pagination-item"),
189
+ className: basePrefix('next', 'pagination-item'),
186
190
  onClick: handleNextClick,
187
191
  //@ts-ignore
188
192
  disabled: total && Number(currentPage) >= getTotalPage(total, pageSize)
@@ -200,7 +204,7 @@ export default (function (props) {
200
204
  }, otherProps));
201
205
  } else {
202
206
  return /*#__PURE__*/React.createElement("div", {
203
- className: "".concat(cls('custom-mini-pagination'), " ").concat(usePrefixCls(), "pagination")
207
+ className: cls(basePrefix('pagination'), prefixCls('custom-mini-pagination'))
204
208
  }, customTotalRender(total), customJumpRender());
205
209
  }
206
210
  }
@@ -249,7 +253,7 @@ export default (function (props) {
249
253
  // 用于获取翻页器响应式 ref
250
254
  React.createElement("div", {
251
255
  ref: paginationWrapperRef,
252
- className: cls('wrapper')
256
+ className: prefixCls('wrapper')
253
257
  }, renderPagination())
254
258
  );
255
259
  });
@@ -15,11 +15,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  */
16
16
  import { Button, Dropdown, Menu } from '@alicloudfe/components';
17
17
  import TeamixIcon from '@teamix/icon';
18
- import { baseClass, getMessage } from '@teamix/utils';
18
+ import { usePrefixCls, getMessage } from '@teamix/utils';
19
19
  import React, { useState } from 'react';
20
20
  import './index.scss';
21
21
  var RadioItem = Menu.RadioItem;
22
- var cls = baseClass('teamix-pro-table-toolbar-icon');
22
+ var cls = usePrefixCls('teamix-pro-table-toolbar-icon');
23
23
 
24
24
  var DensityIcon = function DensityIcon(props) {
25
25
  var _actionRef$current;
@@ -29,29 +29,23 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
29
29
  */
30
30
  import { Button, Dropdown, Menu, Dialog, Grid, Checkbox } from '@alicloudfe/components';
31
31
  import TeamixIcon from '@teamix/icon';
32
- import { baseClass, getMessage } from '@teamix/utils';
32
+ import { usePrefixCls, getMessage, getGlobalConfig } from '@teamix/utils';
33
33
  import React, { useState, useEffect } from 'react';
34
34
  import { cloneDeep, off, on } from '../../utils';
35
+ import { Ellipsis } from '../../../field';
35
36
  import './index.scss';
36
- import { Ellipsis, getCookie } from '@teamix/utils';
37
37
  var CheckboxItem = Menu.CheckboxItem;
38
38
  var Row = Grid.Row,
39
39
  Col = Grid.Col;
40
- var cls = baseClass('teamix-pro-table-toolbar-filter-column'); // 判断是否是 root 组织
41
-
42
- var isRoot = getCookie('organizationId') === '1';
40
+ var cls = usePrefixCls('teamix-pro-table-toolbar-filter-column');
43
41
 
44
42
  var processColumns = function processColumns(columns) {
45
- if (isRoot) {
46
- // root 组织下不显示标签管理
47
- columns = columns.filter(function (item) {
48
- return item.valueType !== 'selectGroup';
49
- });
50
- } // hidden 为 true 时不展示
43
+ var _getGlobalConfig;
51
44
 
45
+ var globalFilterColumns = (_getGlobalConfig = getGlobalConfig('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns; // hidden 为 true 时不展示
52
46
 
53
47
  columns = columns.filter(function (item) {
54
- return (item === null || item === void 0 ? void 0 : item.hidden) !== true;
48
+ return (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
55
49
  });
56
50
  return columns.map(function (item) {
57
51
  if (item.columnFilters === false) {
@@ -15,10 +15,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  */
16
16
  import { Button } from '@alicloudfe/components';
17
17
  import TeamixIcon from '@teamix/icon';
18
- import { baseClass } from '@teamix/utils';
18
+ import { usePrefixCls } from '@teamix/utils';
19
19
  import React, { useEffect, useState } from 'react';
20
20
  import './index.scss';
21
- var cls = baseClass('teamix-pro-table-toolbar-icon');
21
+ var cls = usePrefixCls('teamix-pro-table-toolbar-icon');
22
22
 
23
23
  var FullScreenIcon = function FullScreenIcon(props) {
24
24
  var _actionRef$current3, _actionRef$current3$o;
@@ -3,10 +3,10 @@
3
3
  */
4
4
  import { Button, Balloon } from '@alicloudfe/components';
5
5
  import TeamixIcon from '@teamix/icon';
6
- import { baseClass, getMessage } from '@teamix/utils';
6
+ import { usePrefixCls, getMessage } from '@teamix/utils';
7
7
  import React from 'react';
8
8
  import './index.scss';
9
- var cls = baseClass('teamix-pro-table-toolbar-icon');
9
+ var cls = usePrefixCls('teamix-pro-table-toolbar-icon');
10
10
 
11
11
  var LayoutIcon = function LayoutIcon(props) {
12
12
  var actionRef = props.actionRef; // const [fullscreen, setFullscreen] = useState<boolean>(false);
@@ -4,14 +4,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  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; }
6
6
 
7
- import { baseClass } from '@teamix/utils';
7
+ import { usePrefixCls } from '@teamix/utils';
8
8
  import React from 'react';
9
9
  import FullScreenIcon from './FullScreenIcon';
10
10
  import FilterColumnIcon from './FilterColumnIcon';
11
11
  import DensityIcon from './DensityIcon';
12
12
  import RefreshIcon from './RefreshIcon';
13
13
  import './index.scss';
14
- var cls = baseClass('teamix-pro-table-toolbar');
14
+ var cls = usePrefixCls('teamix-pro-table-toolbar');
15
15
  var presetToolBarMap = {
16
16
  refresh: RefreshIcon,
17
17
  density: DensityIcon,
package/es/table/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 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", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll"];
1
+ 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", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context"];
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
4
 
@@ -36,7 +36,7 @@ import React, { useState, useEffect, useRef } from 'react';
36
36
  import { Table, Checkbox } from '@alicloudfe/components';
37
37
  import Pagination from './components/Pagination';
38
38
  import genProColumnToColumn from './utils/genProColumnToColumn';
39
- import { baseClass, useRequest, request as utilResquest, getDeepValue, getMessage, pickProps, getCookie, usePrefixCls } from '@teamix/utils';
39
+ import { getGlobalConfig, useRequest, request as utilResquest, getDeepValue, getMessage, pickProps, usePrefixCls } from '@teamix/utils';
40
40
  import { ProSkeletonRaw as Skeleton } from '../skeleton';
41
41
  import './index.scss';
42
42
  import Layout from './components/Layout';
@@ -46,15 +46,11 @@ import getTableSortIcons from './utils/getTableSortIcons';
46
46
  import useTableSelection from './utils/useTableSelection';
47
47
  import FullScreen from './components/ToolBar/Fullscreen';
48
48
  import EmptyContent from './components/EmptyContent';
49
- import { formilyReactive } from '../form';
50
49
  import { ProActionGroup } from '../actions';
51
50
  import classNames from 'classnames';
52
51
  import ProPageContainer from '../page-container';
53
52
  export * from './typing';
54
- var cls = baseClass('teamix-pro-table');
55
- var toJS = formilyReactive.toJS; // 判断是否是 root 组织
56
-
57
- var isRoot = getCookie('organizationId') === '1';
53
+ var cls = usePrefixCls('teamix-pro-table');
58
54
  /**
59
55
  * 处理原生传入的 columns 以便于 选择列 方便处理
60
56
  * @param columns 原生传入的 columns
@@ -62,24 +58,17 @@ var isRoot = getCookie('organizationId') === '1';
62
58
  */
63
59
 
64
60
  var processColumns = function processColumns(columns, initialColumns) {
65
- var _filterColumns;
61
+ var _getGlobalConfig;
66
62
 
63
+ var globalFilterColumns = (_getGlobalConfig = getGlobalConfig('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns;
67
64
  var filterColumns = columns.filter(function (item) {
68
- return item.columnFilters !== false && (item === null || item === void 0 ? void 0 : item.hidden) !== true;
69
- });
70
-
71
- if (isRoot) {
72
- // root 组织下不显示标签管理
73
- filterColumns = filterColumns.filter(function (item) {
74
- return item.valueType !== 'selectGroup';
75
- });
76
- } // 处理只剩一列批量选择的情况下宽度错乱问题
77
-
65
+ return item.columnFilters !== false && (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
66
+ }); // 处理只剩一列批量选择的情况下宽度错乱问题
78
67
 
79
- if ((_filterColumns = filterColumns) === null || _filterColumns === void 0 ? void 0 : _filterColumns.length) {
80
- var _filterColumns2, _initialColumns$;
68
+ if (filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) {
69
+ var _initialColumns$;
81
70
 
82
- if (((_filterColumns2 = filterColumns) === null || _filterColumns2 === void 0 ? void 0 : _filterColumns2.length) === 1) {
71
+ if ((filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) === 1) {
83
72
  var _filterColumns$, _filterColumns$2;
84
73
 
85
74
  if ((_filterColumns$ = filterColumns[0]) === null || _filterColumns$ === void 0 ? void 0 : _filterColumns$.width) {
@@ -181,6 +170,7 @@ var ProTable = function ProTable(props) {
181
170
  _props$size = props.size,
182
171
  propsSize = _props$size === void 0 ? 'medium' : _props$size,
183
172
  disableSelectAll = props.disableSelectAll,
173
+ context = props.context,
184
174
  otherProps = _objectWithoutProperties(props, _excluded);
185
175
 
186
176
  var targetPageKey = pageKey || globalPageKey;
@@ -269,7 +259,10 @@ var ProTable = function ProTable(props) {
269
259
 
270
260
  var tableDom = tableRef.current;
271
261
  var headerDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements = tableDom.getElementsByClassName('teamix-pro-table-layout')) === null || _tableDom$getElements === void 0 ? void 0 : _tableDom$getElements[0];
272
- var tableHeaderDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements2 = tableDom.getElementsByClassName("".concat(usePrefixCls(), "table-header-inner"))) === null || _tableDom$getElements2 === void 0 ? void 0 : _tableDom$getElements2[0];
262
+ var basePrefix = usePrefixCls('', {
263
+ base: true
264
+ });
265
+ var tableHeaderDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements2 = tableDom.getElementsByClassName(basePrefix('table-header-inner'))) === null || _tableDom$getElements2 === void 0 ? void 0 : _tableDom$getElements2[0];
273
266
  return new Promise(function (resolve) {
274
267
  setTimeout(function () {
275
268
  var _headerDom$offsetHeig, _tableHeaderDom$offse;
@@ -819,7 +812,7 @@ var ProTable = function ProTable(props) {
819
812
  }), /*#__PURE__*/React.createElement(Table.StickyLock, _objectSpread({
820
813
  hasBorder: false,
821
814
  dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
822
- columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef),
815
+ columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context),
823
816
  loading: getTableLoading(),
824
817
  className: classNames('teamix-pro-table', tableClassName, {
825
818
  'with-row-select': rowSelection
@@ -134,4 +134,11 @@ $fullscreenPadding: 24px;
134
134
  color: var(--table-row-hover-color);
135
135
  }
136
136
  }
137
+ }
138
+
139
+ // 排序icon hover 颜色跟随主题
140
+ .next-table-sort.next-table-header-icon {
141
+ a:hover {
142
+ color: var(--color-brand1-5);
143
+ }
137
144
  }