@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
@@ -1925,7 +1925,6 @@ a.ant-btn-sm {
1925
1925
  .pandora-sdk-button {
1926
1926
  -webkit-box-shadow: none;
1927
1927
  box-shadow: none;
1928
- border-radius: 2px;
1929
1928
  }
1930
1929
  .pandora-sdk-button.pandora-sdk-button-disabled {
1931
1930
  background: #eee !important;
@@ -3,7 +3,6 @@
3
3
 
4
4
  .@{sdk-prefix}-button {
5
5
  box-shadow: none;
6
- border-radius: @border-radius-base;
7
6
 
8
7
  &.@{sdk-prefix}-button-disabled {
9
8
  background: @button-disabled-bg!important;
@@ -29,7 +29,7 @@ import { SDK_PREFIX } from '../../constants/style';
29
29
  /**
30
30
  * 卡片组件封装
31
31
  */
32
- export default function Card(props) {
32
+ function Card(props) {
33
33
  var className = props.className, otherProps = __rest(props, ["className"]);
34
34
  return (React.createElement(AntdCard, __assign({ className: classnames(className, SDK_PREFIX + "-card") }, otherProps)));
35
35
  }
@@ -37,3 +37,4 @@ Card.RowExtra = RowExtra;
37
37
  Card.SearchInput = SearchInput;
38
38
  Card.Grid = AntdCard.Grid;
39
39
  Card.Meta = AntdCard.Meta;
40
+ export default Card;
@@ -20,6 +20,6 @@ export default function Item(props) {
20
20
  React.createElement("div", { className: SDK_PREFIX + "-check-transform-checkbox-group" }, options.map(function (item) {
21
21
  return (React.createElement("div", { key: item.value },
22
22
  React.createElement(Checkbox, { value: item.value, checked: item.checked, onChange: onCheckboxChange },
23
- React.createElement(NameLimiter, { name: item.text, length: 18 }))));
23
+ React.createElement(NameLimiter, { name: item.text }))));
24
24
  })))));
25
25
  }
@@ -1371,7 +1371,15 @@ textarea.ant-input {
1371
1371
  .ant-tooltip-rtl .ant-tooltip-inner {
1372
1372
  text-align: right;
1373
1373
  }
1374
- .pandora-sdk-name-tooltip .ant-tooltip-inner {
1374
+ .pandora-sdk-name-limit {
1375
+ max-width: 100%;
1376
+ display: inline-block;
1377
+ vertical-align: top;
1378
+ white-space: nowrap;
1379
+ text-overflow: ellipsis;
1380
+ overflow: hidden;
1381
+ }
1382
+ .pandora-sdk-name-limit-tooltip .ant-tooltip-inner {
1375
1383
  max-width: 400px !important;
1376
1384
  max-height: 200px !important;
1377
1385
  overflow: auto;
@@ -5,6 +5,7 @@ export interface IOptionItem {
5
5
  text?: string | React.ReactNode;
6
6
  value: CheckboxValueType;
7
7
  indeterminate?: boolean | ((item: IOptionItem) => boolean);
8
+ disabled?: boolean | ((item: IOptionItem) => boolean);
8
9
  }
9
10
  export interface ICheckboxListProps {
10
11
  /**
@@ -9,10 +9,11 @@ export default function CheckboxList(props) {
9
9
  options.map(function (option) {
10
10
  // 将 option string的形式进行格式化
11
11
  var optionItem = typeof option === 'string' ? { value: option } : option;
12
- var key = optionItem.key, value = optionItem.value, text = optionItem.text, indeterminate = optionItem.indeterminate;
12
+ var key = optionItem.key, value = optionItem.value, text = optionItem.text, indeterminate = optionItem.indeterminate, disabled = optionItem.disabled;
13
13
  var indeterminateState = typeof indeterminate === 'function'
14
14
  ? indeterminate(optionItem)
15
15
  : indeterminate;
16
- return (React.createElement(Checkbox, { className: classnames(SDK_PREFIX + "-checkbox-item", itemClassName), key: String(key || value), value: value, indeterminate: indeterminateState }, text || value));
16
+ var disabledState = typeof disabled === 'function' ? disabled(optionItem) : disabled;
17
+ return (React.createElement(Checkbox, { className: classnames(SDK_PREFIX + "-checkbox-item", itemClassName), key: String(key || value), value: value, indeterminate: indeterminateState, disabled: disabledState }, text || value));
17
18
  })));
18
19
  }
@@ -15,7 +15,7 @@ import Panel from './Panel';
15
15
  /**
16
16
  * 折叠面板组件封装
17
17
  */
18
- export default function Collapse(props) {
18
+ function Collapse(props) {
19
19
  var children = props.children, defaultActiveKey = props.defaultActiveKey, className = props.className;
20
20
  var getPanels = React.useCallback(function () {
21
21
  var newChildren = [];
@@ -39,3 +39,4 @@ export default function Collapse(props) {
39
39
  return React.createElement("div", { className: className }, getPanels());
40
40
  }
41
41
  Collapse.Panel = Panel;
42
+ export default Collapse;
@@ -16,7 +16,7 @@ export declare type TCollapsiblePanelProps = Omit<IPanelContentProps, 'active'>
16
16
  disabled?: boolean;
17
17
  header: string | React.ReactNode;
18
18
  };
19
- export default class CollapsiblePanel extends React.Component<TCollapsiblePanelProps, {
19
+ declare class CollapsiblePanel extends React.Component<TCollapsiblePanelProps, {
20
20
  active: boolean;
21
21
  }> {
22
22
  static PanelContent: typeof PanelContent;
@@ -30,4 +30,4 @@ export default class CollapsiblePanel extends React.Component<TCollapsiblePanelP
30
30
  toggle: () => void;
31
31
  render(): JSX.Element;
32
32
  }
33
- export {};
33
+ export default CollapsiblePanel;
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import React from 'react';
24
24
  import { default as AntdConfigProvider } from 'antd/es/config-provider';
25
25
  import { LocaleProvider, generateLocaleConsumer, generateUseLocale } from './context';
26
- export default function ConfigProvider(props) {
26
+ function ConfigProvider(props) {
27
27
  var locale = props.locale, otherProps = __rest(props, ["locale"]);
28
28
  var _a = locale || {}, antdLocale = _a.antd, otherLocale = __rest(_a, ["antd"]);
29
29
  return (React.createElement(LocaleProvider, { locale: otherLocale },
@@ -31,3 +31,4 @@ export default function ConfigProvider(props) {
31
31
  }
32
32
  ConfigProvider.generateLocaleConsumer = generateLocaleConsumer;
33
33
  ConfigProvider.generateUseLocale = generateUseLocale;
34
+ export default ConfigProvider;
@@ -44,7 +44,7 @@ import { timeFormat } from '../../../constants/time';
44
44
  import Button from '../../Button';
45
45
  import Collapse from '../../Collapse';
46
46
  import Selector from '../../Selector';
47
- import NameLimiter, { SplitType } from '../../NameLimiter';
47
+ import NameLimiter from '../../NameLimiter';
48
48
  import RelativeTimePicker from './relativeTimePicker';
49
49
  import Time from '../time';
50
50
  import { defaultPresets, EPresetMode, relativeMap, RangePreset, rangePresetOptions, TimeType, RelativeUnitValue } from '../constants';
@@ -246,7 +246,7 @@ var Base = /** @class */ (function (_super) {
246
246
  return (React.createElement("div", { key: preset.value, className: classnames(SDK_PREFIX + "-datetime-pick-item", (_a = {},
247
247
  _a['active'] = value && preset.value === value.preset,
248
248
  _a)), onClick: function () { return _this.handlePresetClick(preset); } },
249
- React.createElement(NameLimiter, { name: preset.text, length: 12, type: SplitType.End })));
249
+ React.createElement(NameLimiter, { name: preset.text })));
250
250
  });
251
251
  };
252
252
  Base.prototype.handlePresetClick = function (preset) {
@@ -22,7 +22,7 @@ export interface IDateTimePickerProps extends IBaseProps {
22
22
  /**
23
23
  * 弹出层时间选择组件封装
24
24
  */
25
- export default class DateTimePicker extends React.Component<IDateTimePickerProps, any> {
25
+ declare class DateTimePicker extends React.Component<IDateTimePickerProps, any> {
26
26
  static Base: typeof Base;
27
27
  static BaseMobile: typeof BaseMobile;
28
28
  visible: boolean;
@@ -31,3 +31,4 @@ export default class DateTimePicker extends React.Component<IDateTimePickerProps
31
31
  handleChange(value: Time): void;
32
32
  render(): JSX.Element;
33
33
  }
34
+ export default DateTimePicker;
@@ -27,7 +27,7 @@ import { Password } from './Password';
27
27
  import { TextArea } from './TextArea';
28
28
  import NumberInput from './NumberInput';
29
29
  var useCallback = React.useCallback;
30
- export default function Input(props) {
30
+ function Input(props) {
31
31
  var onChange = props.onChange, restProps = __rest(props, ["onChange"]);
32
32
  var handleChange = useCallback(function (e) {
33
33
  if (onChange) {
@@ -40,3 +40,4 @@ Input.DebounceInput = debounceWrapper(Input);
40
40
  Input.Password = Password;
41
41
  Input.TextArea = TextArea;
42
42
  Input.NumberInput = NumberInput;
43
+ export default Input;
@@ -13,9 +13,9 @@ export interface IMenuProps extends Omit<MenuProps, 'options' | 'mode'> {
13
13
  }
14
14
  export declare function Menue(props: React.PropsWithChildren<IMenuProps>): JSX.Element;
15
15
  export declare namespace Menue {
16
- var Divider: typeof import("rc-menu").Divider;
16
+ var Divider;
17
17
  var Item: typeof import("antd/lib/menu/MenuItem").default;
18
18
  var SubMenu: typeof import("antd/lib/menu/SubMenu").default;
19
- var ItemGroup: typeof import("rc-menu").MenuItemGroup;
19
+ var ItemGroup;
20
20
  }
21
21
  export default Menue;
@@ -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,42 +1,33 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- import * as React from 'react';
1
+ var __read = (this && this.__read) || function (o, n) {
2
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
3
+ if (!m) return o;
4
+ var i = m.call(o), r, ar = [], e;
5
+ try {
6
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
7
+ }
8
+ catch (error) { e = { error: error }; }
9
+ finally {
10
+ try {
11
+ if (r && !r.done && (m = i["return"])) m.call(i);
12
+ }
13
+ finally { if (e) throw e.error; }
14
+ }
15
+ return ar;
16
+ };
17
+ import React, { useLayoutEffect, useRef, useState } from 'react';
15
18
  import { Tooltip } from 'antd';
16
19
  import { SDK_PREFIX } from '../../constants/style';
17
- import { getBytes, getTransformerString } from './transformer';
18
- export var SplitType;
19
- (function (SplitType) {
20
- SplitType["End"] = "end";
21
- SplitType["Between"] = "between";
22
- })(SplitType || (SplitType = {}));
23
- var NameLimiter = /** @class */ (function (_super) {
24
- __extends(NameLimiter, _super);
25
- function NameLimiter() {
26
- return _super !== null && _super.apply(this, arguments) || this;
27
- }
28
- NameLimiter.prototype.render = function () {
29
- var _a = this.props, name = _a.name, length = _a.length, title = _a.title, type = _a.type;
30
- var displayName = name;
31
- var needFormat = getBytes(displayName) > length;
32
- var nameSpan = (React.createElement("span", null, needFormat
33
- ? getTransformerString(displayName, length, type)
34
- : displayName));
35
- if (title || needFormat) {
36
- return (React.createElement(Tooltip, { overlayClassName: SDK_PREFIX + "-name-tooltip", placement: "top", title: title || displayName }, nameSpan));
20
+ export default function NameLimiter(_a) {
21
+ var name = _a.name, title = _a.title;
22
+ var _b = __read(useState(false), 2), ellipsis = _b[0], setEllipsis = _b[1];
23
+ var _c = __read(useState(false), 2), visible = _c[0], setVisible = _c[1];
24
+ var ref = useRef(null);
25
+ useLayoutEffect(function () {
26
+ if (!ref.current) {
27
+ return;
37
28
  }
38
- return nameSpan;
39
- };
40
- return NameLimiter;
41
- }(React.PureComponent));
42
- export default NameLimiter;
29
+ setEllipsis(ref.current.clientWidth < ref.current.scrollWidth);
30
+ });
31
+ return (React.createElement(Tooltip, { overlayClassName: SDK_PREFIX + "-name-limit-tooltip", placement: "top", title: title || name, visible: (!!title || ellipsis) && visible, onVisibleChange: setVisible },
32
+ React.createElement("span", { className: SDK_PREFIX + "-name-limit", ref: ref }, name)));
33
+ }
@@ -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;
@@ -28,7 +28,7 @@ export * from './constants';
28
28
  /**
29
29
  * 资源列表页面表格中操作列表
30
30
  */
31
- export default function OptionList(props) {
31
+ function OptionList(props) {
32
32
  var mode = props.mode, _a = props.options, options = _a === void 0 ? [] : _a, placement = props.placement, className = props.className, popupClassName = props.popupClassName, other = __rest(props, ["mode", "options", "placement", "className", "popupClassName"]);
33
33
  var globalShowMode = mode === 'popover' ? EShowMode.POPOVER : EShowMode.INLINE;
34
34
  var showingOptions = options.filter(function (op) { return !op.hidden; });
@@ -51,3 +51,4 @@ export default function OptionList(props) {
51
51
  OptionList.EShowMode = EShowMode;
52
52
  OptionList.InlineOptionList = InlineOptionList;
53
53
  OptionList.PopoverOptionList = PopoverOptionList;
54
+ export 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
  /**
@@ -1,17 +1,15 @@
1
1
  import * as React from 'react';
2
- import { SDK_PREFIX } from '../../constants/style';
3
2
  import NameLimiter from '../../components/NameLimiter';
4
3
  export var IgnoreDesString = '由logkit';
5
4
  /**
6
5
  * 资源名称展示位'名称(备注)'
7
6
  */
8
7
  export default function RemarkName(props) {
9
- var name = props.name, remark = props.remark, length = props.length;
8
+ var name = props.name, remark = props.remark;
10
9
  var getTooltip = function () {
11
10
  return remark && remark !== name && !remark.startsWith(IgnoreDesString)
12
11
  ? name + "(" + (remark && remark.trim()) + ")"
13
12
  : '';
14
13
  };
15
- return (React.createElement("span", { className: SDK_PREFIX + "-remark-name" },
16
- React.createElement(NameLimiter, { name: name, title: getTooltip(), length: length })));
14
+ return React.createElement(NameLimiter, { name: name, title: getTooltip() });
17
15
  }
@@ -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
- }
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
- import { isArray } from 'lodash';
2
+ import { isArray, isUndefined } from 'lodash';
3
3
  import Radio from 'antd/es/radio';
4
4
  import classnames from 'classnames';
5
5
  import { SDK_PREFIX } from '../../constants/style';
6
6
  var useCallback = React.useCallback, useMemo = React.useMemo;
7
7
  export default function SolidRadioGroup(props) {
8
- 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;
8
+ 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;
9
9
  var handleChange = useCallback(function (e) {
10
10
  if (onChange) {
11
11
  onChange(e.target.value);
@@ -19,8 +19,11 @@ export default function SolidRadioGroup(props) {
19
19
  return (React.createElement(Radio.Group, { className: classnames(SDK_PREFIX + "-solid-radio-group", className), value: value, onChange: handleChange, size: size },
20
20
  radioOptions.map(function (option) {
21
21
  var _a;
22
- var value = option.value, item = option.item, disabled = option.disabled;
23
- return (React.createElement(Radio.Button, { key: value.toString(), value: value, disabled: disabled, className: classnames((_a = {}, _a[SDK_PREFIX + "-solid-radio-item"] = !disabled, _a), buttonClassName) }, item));
22
+ var value = option.value, item = option.item;
23
+ var disableRealVal = isUndefined(option.disabled)
24
+ ? disabled
25
+ : option.disabled;
26
+ return (React.createElement(Radio.Button, { key: value.toString(), value: value, disabled: disableRealVal, className: classnames((_a = {}, _a[SDK_PREFIX + "-solid-radio-item"] = !disableRealVal, _a), buttonClassName) }, item));
24
27
  }),
25
28
  children));
26
29
  }
@@ -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 {
@@ -44,7 +44,7 @@ import Step from './Step';
44
44
  import ControlButton from './ControlButton';
45
45
  import { Provider } from './context';
46
46
  var useMemo = React.useMemo, useState = React.useState, useCallback = React.useCallback;
47
- export default function Steps(props) {
47
+ function Steps(props) {
48
48
  var _a = __read(useState(0), 2), stepLength = _a[0], setStepLength = _a[1];
49
49
  var current = props.current, _b = props.steps, steps = _b === void 0 ? [] : _b, className = props.className, children = props.children, otherProps = __rest(props, ["current", "steps", "className", "children"]);
50
50
  var handleAddSteps = useCallback(function () {
@@ -70,3 +70,4 @@ export default function Steps(props) {
70
70
  }
71
71
  Steps.Step = Step;
72
72
  Steps.ControlButton = ControlButton;
73
+ export 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;