@qn-pandora/pandora-component 2.2.1 → 2.2.2

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 (83) hide show
  1. package/es/components/Button/style.css +0 -1
  2. package/es/components/Button/style.less +0 -1
  3. package/es/components/Card/index.js +2 -1
  4. package/es/components/CheckTransformList/Item/index.js +1 -1
  5. package/es/components/CheckTransformList/style.css +9 -1
  6. package/es/components/CheckboxList/index.d.ts +1 -0
  7. package/es/components/CheckboxList/index.js +3 -2
  8. package/es/components/Collapse/index.js +2 -1
  9. package/es/components/CollapsiblePanel/index.d.ts +2 -2
  10. package/es/components/ConfigProvider/index.js +2 -1
  11. package/es/components/DateTimePicker/Base/index.js +2 -2
  12. package/es/components/DateTimePicker/index.d.ts +2 -1
  13. package/es/components/Input/index.js +2 -1
  14. package/es/components/Menu/index.d.ts +2 -2
  15. package/es/components/NameLimiter/index.d.ts +3 -13
  16. package/es/components/NameLimiter/index.js +30 -39
  17. package/es/components/NameLimiter/style.css +9 -1
  18. package/es/components/NameLimiter/style.less +10 -1
  19. package/es/components/OptionList/index.js +2 -1
  20. package/es/components/RemarkName/index.d.ts +0 -2
  21. package/es/components/RemarkName/index.js +2 -4
  22. package/es/components/RemarkName/style.css +9 -5
  23. package/es/components/RemarkName/style.less +0 -5
  24. package/es/components/SolidRadioGroup/index.js +7 -4
  25. package/es/components/SolidRadioGroup/style.css +4 -0
  26. package/es/components/SolidRadioGroup/style.less +5 -0
  27. package/es/components/Steps/index.js +2 -1
  28. package/es/components/Table/index.d.ts +9 -24
  29. package/es/components/Table/index.js +40 -8
  30. package/es/components/TagList/Tag/style.css +3 -3
  31. package/es/components/TagList/Tag/style.less +3 -3
  32. package/es/components/TagList/index.js +3 -2
  33. package/es/components/TagList/style.css +3 -3
  34. package/es/components/TagList/style.less +8 -8
  35. package/es/index.css +46 -39
  36. package/es/index.d.ts +1 -1
  37. package/es/index.js +1 -1
  38. package/es/index.less +4 -4
  39. package/es/style/theme.less +5 -4
  40. package/lib/components/Button/style.css +0 -1
  41. package/lib/components/Button/style.less +0 -1
  42. package/lib/components/Card/index.js +1 -1
  43. package/lib/components/CheckTransformList/Item/index.js +1 -1
  44. package/lib/components/CheckTransformList/style.css +9 -1
  45. package/lib/components/CheckboxList/index.d.ts +1 -0
  46. package/lib/components/CheckboxList/index.js +3 -2
  47. package/lib/components/Collapse/index.js +1 -1
  48. package/lib/components/CollapsiblePanel/index.d.ts +2 -2
  49. package/lib/components/ConfigProvider/index.js +1 -1
  50. package/lib/components/DateTimePicker/Base/index.js +2 -2
  51. package/lib/components/DateTimePicker/index.d.ts +2 -1
  52. package/lib/components/Input/index.js +1 -1
  53. package/lib/components/Menu/index.d.ts +2 -2
  54. package/lib/components/NameLimiter/index.d.ts +3 -13
  55. package/lib/components/NameLimiter/index.js +30 -38
  56. package/lib/components/NameLimiter/style.css +9 -1
  57. package/lib/components/NameLimiter/style.less +10 -1
  58. package/lib/components/OptionList/index.js +1 -1
  59. package/lib/components/RemarkName/index.d.ts +0 -2
  60. package/lib/components/RemarkName/index.js +2 -4
  61. package/lib/components/RemarkName/style.css +9 -5
  62. package/lib/components/RemarkName/style.less +0 -5
  63. package/lib/components/SolidRadioGroup/index.js +6 -3
  64. package/lib/components/SolidRadioGroup/style.css +4 -0
  65. package/lib/components/SolidRadioGroup/style.less +5 -0
  66. package/lib/components/Steps/index.js +1 -1
  67. package/lib/components/Table/index.d.ts +9 -24
  68. package/lib/components/Table/index.js +39 -7
  69. package/lib/components/TagList/Tag/style.css +3 -3
  70. package/lib/components/TagList/Tag/style.less +3 -3
  71. package/lib/components/TagList/index.js +2 -2
  72. package/lib/components/TagList/style.css +3 -3
  73. package/lib/components/TagList/style.less +8 -8
  74. package/lib/index.css +1724 -1717
  75. package/lib/index.d.ts +1 -1
  76. package/lib/index.js +0 -1
  77. package/lib/index.less +2 -2
  78. package/lib/style/theme.less +5 -4
  79. package/package.json +22 -22
  80. package/es/components/NameLimiter/transformer.d.ts +0 -6
  81. package/es/components/NameLimiter/transformer.js +0 -84
  82. package/lib/components/NameLimiter/transformer.d.ts +0 -6
  83. package/lib/components/NameLimiter/transformer.js +0 -91
@@ -1,21 +1,11 @@
1
- import * as React from 'react';
2
- export declare enum SplitType {
3
- End = "end",
4
- Between = "between"
5
- }
1
+ /// <reference types="react" />
6
2
  /**
7
- * 对于过长的名称进行format,并增加Tooltip
3
+ * 对于超出容器宽度的名称进行省略,使用Tooltip展示。
8
4
  */
9
5
  export interface INameLimiterProps {
10
6
  /** 资源名称 */
11
7
  name: string;
12
- /** 展示的最大长度,资源名称超过该长度会展示前后个一半的资源名称,中间使用省略号 */
13
- length: number;
14
8
  /** 用于显示Tooltip的title */
15
9
  title?: string;
16
- /** 省略号位置 */
17
- type?: SplitType;
18
- }
19
- export default class NameLimiter extends React.PureComponent<INameLimiterProps, any> {
20
- render(): JSX.Element;
21
10
  }
11
+ export default function NameLimiter({ name, title }: INameLimiterProps): JSX.Element;
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
15
18
  var __importStar = (this && this.__importStar) || function (mod) {
16
19
  if (mod && mod.__esModule) return mod;
17
20
  var result = {};
@@ -20,32 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
20
23
  return result;
21
24
  };
22
25
  Object.defineProperty(exports, "__esModule", { value: true });
23
- var React = __importStar(require("react"));
26
+ var react_1 = __importStar(require("react"));
24
27
  var antd_1 = require("antd");
25
28
  var style_1 = require("../../constants/style");
26
- var transformer_1 = require("./transformer");
27
- var SplitType;
28
- (function (SplitType) {
29
- SplitType["End"] = "end";
30
- SplitType["Between"] = "between";
31
- })(SplitType = exports.SplitType || (exports.SplitType = {}));
32
- var NameLimiter = /** @class */ (function (_super) {
33
- __extends(NameLimiter, _super);
34
- function NameLimiter() {
35
- return _super !== null && _super.apply(this, arguments) || this;
36
- }
37
- NameLimiter.prototype.render = function () {
38
- var _a = this.props, name = _a.name, length = _a.length, title = _a.title, type = _a.type;
39
- var displayName = name;
40
- var needFormat = transformer_1.getBytes(displayName) > length;
41
- var nameSpan = (React.createElement("span", null, needFormat
42
- ? transformer_1.getTransformerString(displayName, length, type)
43
- : displayName));
44
- if (title || needFormat) {
45
- return (React.createElement(antd_1.Tooltip, { overlayClassName: style_1.SDK_PREFIX + "-name-tooltip", placement: "top", title: title || displayName }, nameSpan));
29
+ function NameLimiter(_a) {
30
+ var name = _a.name, title = _a.title;
31
+ var _b = __read(react_1.useState(false), 2), ellipsis = _b[0], setEllipsis = _b[1];
32
+ var _c = __read(react_1.useState(false), 2), visible = _c[0], setVisible = _c[1];
33
+ var ref = react_1.useRef(null);
34
+ react_1.useLayoutEffect(function () {
35
+ if (!ref.current) {
36
+ return;
46
37
  }
47
- return nameSpan;
48
- };
49
- return NameLimiter;
50
- }(React.PureComponent));
38
+ setEllipsis(ref.current.clientWidth < ref.current.scrollWidth);
39
+ });
40
+ return (react_1.default.createElement(antd_1.Tooltip, { overlayClassName: style_1.SDK_PREFIX + "-name-limit-tooltip", placement: "top", title: title || name, visible: (!!title || ellipsis) && visible, onVisibleChange: setVisible },
41
+ react_1.default.createElement("span", { className: style_1.SDK_PREFIX + "-name-limit", ref: ref }, name)));
42
+ }
51
43
  exports.default = NameLimiter;
@@ -268,7 +268,15 @@
268
268
  .ant-btn-sm {
269
269
  padding: 0 7px;
270
270
  }
271
- .pandora-sdk-name-tooltip .ant-tooltip-inner {
271
+ .pandora-sdk-name-limit {
272
+ max-width: 100%;
273
+ display: inline-block;
274
+ vertical-align: top;
275
+ white-space: nowrap;
276
+ text-overflow: ellipsis;
277
+ overflow: hidden;
278
+ }
279
+ .pandora-sdk-name-limit-tooltip .ant-tooltip-inner {
272
280
  max-width: 400px !important;
273
281
  max-height: 200px !important;
274
282
  overflow: auto;
@@ -1,7 +1,16 @@
1
1
  @import 'antd/lib/tooltip/style/index.less';
2
2
  @import '../../style/theme.less';
3
3
 
4
- .@{sdk-prefix}-name-tooltip {
4
+ .@{sdk-prefix}-name-limit {
5
+ max-width: 100%;
6
+ display: inline-block;
7
+ vertical-align: top;
8
+ white-space: nowrap;
9
+ text-overflow: ellipsis;
10
+ overflow: hidden;
11
+ }
12
+
13
+ .@{sdk-prefix}-name-limit-tooltip {
5
14
  .@{ant-prefix}-tooltip-inner {
6
15
  max-width: 400px !important;
7
16
  max-height: 200px !important;
@@ -63,7 +63,7 @@ function OptionList(props) {
63
63
  }
64
64
  return (React.createElement(InlineOptionList_1.default, __assign({}, other, { className: className, options: inlineOptions })));
65
65
  }
66
- exports.default = OptionList;
67
66
  OptionList.EShowMode = constants_1.EShowMode;
68
67
  OptionList.InlineOptionList = InlineOptionList_1.default;
69
68
  OptionList.PopoverOptionList = PopoverOptionList_1.default;
69
+ exports.default = OptionList;
@@ -4,8 +4,6 @@ export interface IRemarkName {
4
4
  name: string;
5
5
  /** 备注 */
6
6
  remark?: string;
7
- /** 名称展示最大长度 */
8
- length: number;
9
7
  }
10
8
  export declare const IgnoreDesString = "\u7531logkit";
11
9
  /**
@@ -11,20 +11,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  var React = __importStar(require("react"));
14
- var style_1 = require("../../constants/style");
15
14
  var NameLimiter_1 = __importDefault(require("../../components/NameLimiter"));
16
15
  exports.IgnoreDesString = '由logkit';
17
16
  /**
18
17
  * 资源名称展示位'名称(备注)'
19
18
  */
20
19
  function RemarkName(props) {
21
- var name = props.name, remark = props.remark, length = props.length;
20
+ var name = props.name, remark = props.remark;
22
21
  var getTooltip = function () {
23
22
  return remark && remark !== name && !remark.startsWith(exports.IgnoreDesString)
24
23
  ? name + "(" + (remark && remark.trim()) + ")"
25
24
  : '';
26
25
  };
27
- return (React.createElement("span", { className: style_1.SDK_PREFIX + "-remark-name" },
28
- React.createElement(NameLimiter_1.default, { name: name, title: getTooltip(), length: length })));
26
+ return React.createElement(NameLimiter_1.default, { name: name, title: getTooltip() });
29
27
  }
30
28
  exports.default = RemarkName;
@@ -262,7 +262,15 @@
262
262
  .ant-tooltip-rtl .ant-tooltip-inner {
263
263
  text-align: right;
264
264
  }
265
- .pandora-sdk-name-tooltip .ant-tooltip-inner {
265
+ .pandora-sdk-name-limit {
266
+ max-width: 100%;
267
+ display: inline-block;
268
+ vertical-align: top;
269
+ white-space: nowrap;
270
+ text-overflow: ellipsis;
271
+ overflow: hidden;
272
+ }
273
+ .pandora-sdk-name-limit-tooltip .ant-tooltip-inner {
266
274
  max-width: 400px !important;
267
275
  max-height: 200px !important;
268
276
  overflow: auto;
@@ -275,7 +283,3 @@
275
283
  .ant-btn-sm {
276
284
  padding: 0 7px;
277
285
  }
278
- .pandora-sdk-remark-name {
279
- word-break: break-all;
280
- white-space: nowrap;
281
- }
@@ -1,7 +1,2 @@
1
1
  @import '../NameLimiter/style.less';
2
2
  @import '../../style/theme.less';
3
-
4
- .@{sdk-prefix}-remark-name {
5
- word-break: break-all;
6
- white-space: nowrap;
7
- }
@@ -17,7 +17,7 @@ var classnames_1 = __importDefault(require("classnames"));
17
17
  var style_1 = require("../../constants/style");
18
18
  var useCallback = React.useCallback, useMemo = React.useMemo;
19
19
  function SolidRadioGroup(props) {
20
- var className = props.className, buttonClassName = props.buttonClassName, value = props.value, size = props.size, onChange = props.onChange, children = props.children, _a = props.options, options = _a === void 0 ? {} : _a;
20
+ var className = props.className, buttonClassName = props.buttonClassName, value = props.value, size = props.size, onChange = props.onChange, children = props.children, disabled = props.disabled, _a = props.options, options = _a === void 0 ? {} : _a;
21
21
  var handleChange = useCallback(function (e) {
22
22
  if (onChange) {
23
23
  onChange(e.target.value);
@@ -31,8 +31,11 @@ function SolidRadioGroup(props) {
31
31
  return (React.createElement(radio_1.default.Group, { className: classnames_1.default(style_1.SDK_PREFIX + "-solid-radio-group", className), value: value, onChange: handleChange, size: size },
32
32
  radioOptions.map(function (option) {
33
33
  var _a;
34
- var value = option.value, item = option.item, disabled = option.disabled;
35
- return (React.createElement(radio_1.default.Button, { key: value.toString(), value: value, disabled: disabled, className: classnames_1.default((_a = {}, _a[style_1.SDK_PREFIX + "-solid-radio-item"] = !disabled, _a), buttonClassName) }, item));
34
+ var value = option.value, item = option.item;
35
+ var disableRealVal = lodash_1.isUndefined(option.disabled)
36
+ ? disabled
37
+ : option.disabled;
38
+ return (React.createElement(radio_1.default.Button, { key: value.toString(), value: value, disabled: disableRealVal, className: classnames_1.default((_a = {}, _a[style_1.SDK_PREFIX + "-solid-radio-item"] = !disableRealVal, _a), buttonClassName) }, item));
36
39
  }),
37
40
  children));
38
41
  }
@@ -399,6 +399,10 @@ span.ant-radio + * {
399
399
  border-color: #2c6dd2 !important;
400
400
  color: #2c6dd2 !important;
401
401
  }
402
+ .pandora-sdk-solid-radio-group .ant-radio-button-wrapper-checked.ant-radio-button-wrapper-disabled {
403
+ border-color: #bfbfbf !important;
404
+ color: #333 !important;
405
+ }
402
406
  .pandora-sdk-solid-radio-group .ant-radio-button-wrapper:not(:first-child)::before {
403
407
  background-color: #bfbfbf;
404
408
  }
@@ -18,6 +18,11 @@
18
18
  color: @theme-color !important;
19
19
  }
20
20
 
21
+ .@{ant-prefix}-radio-button-wrapper-checked.@{ant-prefix}-radio-button-wrapper-disabled {
22
+ border-color: @input-border-color !important;
23
+ color: @heading-color!important;
24
+ }
25
+
21
26
  .@{ant-prefix}-radio-button-wrapper {
22
27
  &:not(:first-child) {
23
28
  &::before {
@@ -80,6 +80,6 @@ function Steps(props) {
80
80
  }),
81
81
  children)));
82
82
  }
83
- exports.default = Steps;
84
83
  Steps.Step = Step_1.default;
85
84
  Steps.ControlButton = ControlButton_1.default;
85
+ exports.default = Steps;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { TableProps } from 'antd/es/table';
3
+ import { TableRowSelection } from 'antd/es/table/interface';
3
4
  /**
4
5
  * 表格提供自定义多选, 通过 rowSelection对象的selectedRowKeys和onChange来控制多选的状态
5
6
  * 需要注意的是, 当在外部进行增删改或者外部需要控制选择状态时, 例如删除之后清空全选状态, 需要受控
@@ -17,7 +18,7 @@ export interface IOptionItem {
17
18
  /**
18
19
  * 禁用当前操作
19
20
  */
20
- disabled?: boolean;
21
+ disabled?: boolean | ((selectItems: any[]) => boolean);
21
22
  }
22
23
  export interface ITableProps<T> extends TableProps<T> {
23
24
  /**
@@ -32,7 +33,7 @@ export interface ITableProps<T> extends TableProps<T> {
32
33
  /**
33
34
  * pandora2.0风格的表格
34
35
  */
35
- export default class Table<T = any> extends React.Component<ITableProps<T>, any> {
36
+ declare class Table<T = any> extends React.Component<ITableProps<T>, any> {
36
37
  static Column: typeof import("antd/lib/table/Column").default;
37
38
  static ColumnTag: (props: {
38
39
  tags: any[];
@@ -43,35 +44,19 @@ export default class Table<T = any> extends React.Component<ITableProps<T>, any>
43
44
  checkAll: boolean;
44
45
  UNSAFE_componentWillReceiveProps(nextProps: ITableProps<T>): void;
45
46
  get selectedRowKeys(): React.ReactText[];
46
- get rowSelection(): {
47
- selectedRowKeys: React.ReactText[];
48
- onChange: (selectedRowKeys: string[] | number[], selectedRowsOfCurrentPage: any[]) => void;
49
- preserveSelectedRowKeys?: boolean | undefined;
50
- type?: "checkbox" | "radio" | undefined;
51
- defaultSelectedRowKeys?: React.ReactText[] | undefined;
52
- getCheckboxProps?: ((record: T) => Partial<Pick<import("antd/es/checkbox").CheckboxProps, "type" | "onClick" | "className" | "id" | "style" | "tabIndex" | "children" | "onChange" | "onKeyDown" | "onKeyPress" | "onMouseEnter" | "onMouseLeave" | "autoFocus" | "disabled" | "name" | "value" | "prefixCls" | "indeterminate" | "skipGroup">>) | undefined;
53
- onSelect?: import("antd/es/table/interface").SelectionSelectFn<T> | undefined;
54
- onSelectMultiple?: ((selected: boolean, selectedRows: T[], changeRows: T[]) => void) | undefined;
55
- onSelectAll?: ((selected: boolean, selectedRows: T[], changeRows: T[]) => void) | undefined;
56
- onSelectInvert?: ((selectedRowKeys: React.ReactText[]) => void) | undefined;
57
- onSelectNone?: (() => void) | undefined;
58
- selections?: boolean | import("antd/es/table/hooks/useSelection").INTERNAL_SELECTION_ITEM[] | undefined;
59
- hideSelectAll?: boolean | undefined;
60
- fixed?: boolean | undefined;
61
- columnWidth?: string | number | undefined;
62
- columnTitle?: React.ReactNode;
63
- checkStrictly?: boolean | undefined;
64
- renderCell?: ((value: boolean, record: T, index: number, originNode: React.ReactNode) => string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | import("rc-table/lib/interface").RenderedCell<T> | null | undefined) | undefined;
65
- } | undefined;
47
+ get rowSelection(): TableRowSelection<T> | undefined;
48
+ get undisabledData(): readonly T[];
66
49
  get keysOfCurrentPage(): any[];
67
50
  getRowKey(row: any, index: number): any;
68
51
  setIndeterminate(indeterminate: boolean): void;
69
52
  setCheckAll(checkAll: boolean): void;
70
53
  setCheckboxStatus(selectedRowsOfCurrentPage?: T[], dataSource?: T[]): void;
71
- handleSelectionChange(selectedRowKeys: string[] | number[], selectedRowsOfCurrentPage: any[]): void;
72
- onRowSelectionChange(selectedRowKeys: string[] | number[], selectedRowsOfCurrentPage: any[]): void;
54
+ handleSelectionChange(selectedRowKeys: React.Key[], selectedRowsOfCurrentPage: any[]): void;
55
+ onRowSelectionChange(selectedRowKeys: React.Key[], selectedRowsOfCurrentPage: any[]): void;
73
56
  handleCheckAllChange(e: any): void;
74
57
  handleBatchOptionClick(option: IOptionItem): void;
75
58
  getRowClassName(record: any, index: number, indent: number): string;
59
+ getDisabledStatus(option: IOptionItem): boolean | undefined;
76
60
  render(): JSX.Element;
77
61
  }
62
+ export default Table;
@@ -138,10 +138,23 @@ var Table = /** @class */ (function (_super) {
138
138
  enumerable: true,
139
139
  configurable: true
140
140
  });
141
+ Object.defineProperty(Table.prototype, "undisabledData", {
142
+ get: function () {
143
+ var _a = this.props, dataSource = _a.dataSource, rowSelection = _a.rowSelection;
144
+ var getCheckboxProps = (rowSelection || {}).getCheckboxProps;
145
+ var undisabledData = dataSource || [];
146
+ if (getCheckboxProps) {
147
+ // 如果checkbox有disabled的,要去掉这些rowItem
148
+ undisabledData = undisabledData.filter(function (data) { return !getCheckboxProps(data).disabled; });
149
+ }
150
+ return undisabledData;
151
+ },
152
+ enumerable: true,
153
+ configurable: true
154
+ });
141
155
  Object.defineProperty(Table.prototype, "keysOfCurrentPage", {
142
156
  get: function () {
143
- var dataSource = this.props.dataSource;
144
- return (dataSource || []).map(this.getRowKey);
157
+ return this.undisabledData.map(this.getRowKey);
145
158
  },
146
159
  enumerable: true,
147
160
  configurable: true
@@ -217,19 +230,29 @@ var Table = /** @class */ (function (_super) {
217
230
  ? rowClassName
218
231
  : rowClassName(record, index, indent));
219
232
  };
233
+ Table.prototype.getDisabledStatus = function (option) {
234
+ var noneSelected = this.selectedRowKeys.length === 0;
235
+ var disabled = typeof option.disabled === 'function'
236
+ ? option.disabled(__spread(this.undisabledData))
237
+ : option.disabled;
238
+ return noneSelected || disabled;
239
+ };
220
240
  Table.prototype.render = function () {
221
241
  var _a, _b;
222
242
  var _this = this;
223
243
  var _c = this.props, className = _c.className, batchOptions = _c.batchOptions, scroll = _c.scroll, restProps = __rest(_c, ["className", "batchOptions", "scroll"]);
224
244
  return (React.createElement("div", null,
225
- React.createElement(antd_1.Table, __assign({ scroll: scroll }, restProps, { className: classnames_1.default(style_1.SDK_PREFIX + "-table-wrapper", (_a = {}, _a[style_1.SDK_PREFIX + "-table-scrollX"] = lodash_1.get(scroll, 'x'), _a), (_b = {}, _b[style_1.SDK_PREFIX + "-table-scrollY"] = lodash_1.get(scroll, 'y'), _b), className), rowSelection: batchOptions && this.props.rowSelection
245
+ React.createElement(antd_1.Table, __assign({ scroll: scroll }, restProps, { className: classnames_1.default(style_1.SDK_PREFIX + "-table-wrapper", (_a = {}, _a[style_1.SDK_PREFIX + "-table-scrollX"] = lodash_1.get(scroll, 'x'), _a), (_b = {}, _b[style_1.SDK_PREFIX + "-table-scrollY"] = lodash_1.get(scroll, 'y'), _b), className),
246
+ // 涉及到权限
247
+ // getCheckboxProps只能放到tableBatchWrapper里,因为selectedRowKeys在那个组件计算
248
+ rowSelection: batchOptions && this.props.rowSelection
226
249
  ? this.rowSelection
227
250
  : this.props.rowSelection, rowClassName: this.getRowClassName })),
228
251
  this.props.batchOptions &&
229
252
  this.props.rowSelection &&
230
253
  this.props.dataSource &&
231
254
  this.props.dataSource.length > 0 ? (React.createElement("div", { className: style_1.SDK_PREFIX + "-table-batch-opt" },
232
- React.createElement(antd_1.Checkbox, { indeterminate: this.indeterminate, onChange: this.handleCheckAllChange, checked: this.checkAll, disabled: lodash_1.size(this.props.dataSource) === 0 }),
255
+ React.createElement(antd_1.Checkbox, { indeterminate: this.indeterminate, onChange: this.handleCheckAllChange, checked: this.checkAll, disabled: lodash_1.size(this.undisabledData) === 0 }),
233
256
  React.createElement("span", { className: style_1.SDK_PREFIX + "-table-batch-opt-label" },
234
257
  "\u5DF2\u9009 ",
235
258
  this.selectedRowKeys.length),
@@ -237,9 +260,7 @@ var Table = /** @class */ (function (_super) {
237
260
  var _a;
238
261
  return (React.createElement("span", { key: index, className: classnames_1.default((_a = {},
239
262
  _a[style_1.SDK_PREFIX + "-table-batch-opt-item"] = true,
240
- _a[style_1.SDK_PREFIX + "-table-batch-opt-disabled"] = lodash_1.isUndefined(option.disabled)
241
- ? _this.selectedRowKeys.length === 0
242
- : option.disabled,
263
+ _a[style_1.SDK_PREFIX + "-table-batch-opt-disabled"] = _this.getDisabledStatus(option),
243
264
  _a)), onClick: function () { return _this.handleBatchOptionClick(option); } }, option.text));
244
265
  })))) : null));
245
266
  };
@@ -263,6 +284,11 @@ var Table = /** @class */ (function (_super) {
263
284
  __metadata("design:type", Object),
264
285
  __metadata("design:paramtypes", [])
265
286
  ], Table.prototype, "rowSelection", null);
287
+ __decorate([
288
+ mobx_1.computed,
289
+ __metadata("design:type", Object),
290
+ __metadata("design:paramtypes", [])
291
+ ], Table.prototype, "undisabledData", null);
266
292
  __decorate([
267
293
  mobx_1.computed,
268
294
  __metadata("design:type", Object),
@@ -324,6 +350,12 @@ var Table = /** @class */ (function (_super) {
324
350
  __metadata("design:paramtypes", [Object, Number, Number]),
325
351
  __metadata("design:returntype", void 0)
326
352
  ], Table.prototype, "getRowClassName", null);
353
+ __decorate([
354
+ bind_1.default,
355
+ __metadata("design:type", Function),
356
+ __metadata("design:paramtypes", [Object]),
357
+ __metadata("design:returntype", void 0)
358
+ ], Table.prototype, "getDisabledStatus", null);
327
359
  Table = __decorate([
328
360
  mobx_react_1.observer
329
361
  ], Table);
@@ -9,7 +9,7 @@
9
9
  line-height: 24px;
10
10
  margin-right: 8px;
11
11
  border-radius: 1px;
12
- color: #42526e;
12
+ color: #333;
13
13
  text-align: center;
14
14
  vertical-align: middle;
15
15
  border-radius: 2px;
@@ -47,8 +47,8 @@
47
47
  border-left: 1px solid rgba(44, 109, 210, 0.1);
48
48
  }
49
49
  .pandora-sdk-root .pandora-sdk-content {
50
- padding: 0 4px;
51
- max-width: 200px;
50
+ padding: 0 8px;
51
+ max-width: 150px;
52
52
  vertical-align: middle;
53
53
  overflow: hidden;
54
54
  white-space: nowrap;
@@ -5,7 +5,7 @@
5
5
  line-height: 24px;
6
6
  margin-right: 8px;
7
7
  border-radius: 1px;
8
- color: @font-color-2;
8
+ color: @font-color-7;
9
9
  text-align: center;
10
10
  vertical-align: middle;
11
11
  border-radius: @border-radius-base;
@@ -45,8 +45,8 @@
45
45
  }
46
46
 
47
47
  .@{sdk-prefix}-content {
48
- padding: 0 4px;
49
- max-width: 200px;
48
+ padding: 0 8px;
49
+ max-width: 150px;
50
50
  vertical-align: middle;
51
51
  overflow: hidden;
52
52
  white-space: nowrap;
@@ -69,11 +69,11 @@ function TagList(props) {
69
69
  }
70
70
  return (React.createElement("div", { className: classnames_1.default(style_1.SDK_PREFIX + "-simplify", props.className) },
71
71
  React.Children.toArray(children).slice(0, simplifyTo),
72
- React.createElement(popover_1.default, { content: React.createElement("div", { className: style_1.SDK_PREFIX + "-popover" }, children), getPopupContainer: getPopupContainer },
72
+ React.createElement(popover_1.default, { content: React.createElement("div", { className: style_1.SDK_PREFIX + "-popover" }, React.Children.toArray(children).slice(simplifyTo, childSize)), getPopupContainer: getPopupContainer },
73
73
  React.createElement(pandora_component_icons_1.MoreCircle, { className: style_1.SDK_PREFIX + "-icon" }))));
74
74
  };
75
75
  return (React.createElement("div", { className: classnames_1.default(style_1.SDK_PREFIX + "-taglist-containter", className) }, mode === 'tag' ? getTagList() : getTagSwitchList()));
76
76
  }
77
- exports.default = TagList;
78
77
  TagList.Tag = Tag_1.default;
79
78
  TagList.TagSwitch = TagSwitch_1.default;
79
+ exports.default = TagList;
@@ -266,12 +266,12 @@
266
266
  .pandora-sdk-taglist-containter .pandora-sdk-simplify .pandora-sdk-icon:hover {
267
267
  color: #7a869a;
268
268
  }
269
- .pandora-sdk-taglist-containter .pandora-sdk-popover {
269
+ .pandora-sdk-popover {
270
270
  max-width: 400px;
271
271
  max-height: 1000px;
272
272
  overflow: auto;
273
- padding: 16px;
273
+ padding: 8px !important;
274
274
  }
275
- .pandora-sdk-taglist-containter .pandora-sdk-popover > div {
275
+ .pandora-sdk-popover > div {
276
276
  margin: 4px;
277
277
  }
@@ -15,14 +15,14 @@
15
15
  }
16
16
  }
17
17
  }
18
+ }
18
19
 
19
- .@{sdk-prefix}-popover {
20
- max-width: 400px;
21
- max-height: 1000px;
22
- overflow: auto;
23
- padding: 16px;
24
- > div {
25
- margin: 4px;
26
- }
20
+ .@{sdk-prefix}-popover {
21
+ max-width: 400px;
22
+ max-height: 1000px;
23
+ overflow: auto;
24
+ padding: 8px !important;
25
+ > div {
26
+ margin: 4px;
27
27
  }
28
28
  }