@qn-pandora/pandora-component 4.0.4 → 4.0.6

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 (33) hide show
  1. package/CHANGELOG.json +46 -0
  2. package/CHANGELOG.md +17 -1
  3. package/es/components/AutoComplete/index.d.ts +2 -1
  4. package/es/components/AutoComplete/index.js +2 -2
  5. package/es/components/KeyValuePair/index.d.ts +4 -0
  6. package/es/components/KeyValuePair/index.js +5 -3
  7. package/es/components/KeyValuePair/style.css +4 -0
  8. package/es/components/KeyValuePair/style.less +4 -0
  9. package/es/components/Menu/Option.d.ts +4 -0
  10. package/es/components/Selector/index.d.ts +2 -0
  11. package/es/components/Selector/index.js +2 -2
  12. package/es/components/Table/index.js +4 -1
  13. package/es/components/Table/style.css +3 -0
  14. package/es/components/Table/style.less +5 -0
  15. package/es/components/Transfer/List/index.js +15 -8
  16. package/es/index.css +3167 -3160
  17. package/es/index.less +14 -14
  18. package/lib/components/AutoComplete/index.d.ts +2 -1
  19. package/lib/components/AutoComplete/index.js +2 -2
  20. package/lib/components/KeyValuePair/index.d.ts +4 -0
  21. package/lib/components/KeyValuePair/index.js +5 -3
  22. package/lib/components/KeyValuePair/style.css +4 -0
  23. package/lib/components/KeyValuePair/style.less +4 -0
  24. package/lib/components/Menu/Option.d.ts +4 -0
  25. package/lib/components/Selector/index.d.ts +2 -0
  26. package/lib/components/Selector/index.js +2 -2
  27. package/lib/components/Table/index.js +4 -1
  28. package/lib/components/Table/style.css +3 -0
  29. package/lib/components/Table/style.less +5 -0
  30. package/lib/components/Transfer/List/index.js +14 -7
  31. package/lib/index.css +2571 -2564
  32. package/lib/index.less +15 -15
  33. package/package.json +4 -4
package/es/index.less CHANGED
@@ -1,17 +1,17 @@
1
1
  @import './style\mixin.less';
2
2
  @import './style\theme.less';
3
3
  @import './components\AutoComplete\style.less';
4
- @import './components\Card\style.less';
5
- @import './components\Button\style.less';
6
4
  @import './components\Breadcrumb\style.less';
5
+ @import './components\Button\style.less';
6
+ @import './components\Card\style.less';
7
7
  @import './components\CheckboxList\style.less';
8
+ @import './components\Checkbox\style.less';
8
9
  @import './components\CheckTransformList\style.less';
9
10
  @import './components\Collapse\style.less';
10
- @import './components\Checkbox\style.less';
11
11
  @import './components\CollapsiblePanel\style.less';
12
12
  @import './components\DateTimePicker\style.less';
13
- @import './components\Drawer\style.less';
14
13
  @import './components\FileResumable\style.less';
14
+ @import './components\Drawer\style.less';
15
15
  @import './components\Input\style.less';
16
16
  @import './components\KeyValuePair\style.less';
17
17
  @import './components\Menu\style.less';
@@ -21,30 +21,30 @@
21
21
  @import './components\OptionList\style.less';
22
22
  @import './components\RadioGroup\style.less';
23
23
  @import './components\RangeInput\style.less';
24
- @import './components\Selector\style.less';
25
- @import './components\Spin\style.less';
26
24
  @import './components\RemarkName\style.less';
25
+ @import './components\Spin\style.less';
26
+ @import './components\Selector\style.less';
27
27
  @import './components\Steps\style.less';
28
28
  @import './components\Table\style.less';
29
- @import './components\Timeline\style.less';
30
- @import './components\Tabs\style.less';
31
29
  @import './components\TagList\style.less';
30
+ @import './components\Tabs\style.less';
31
+ @import './components\Timeline\style.less';
32
32
  @import './components\Transfer\style.less';
33
33
  @import './components\TreeSelector\style.less';
34
- @import './components\Card\RowExtra\style.less';
35
34
  @import './components\Card\SearchInput\style.less';
35
+ @import './components\Card\RowExtra\style.less';
36
36
  @import './components\DateTimePicker\Base\style.less';
37
37
  @import './components\DateTimePicker\BaseMobile\style.less';
38
38
  @import './components\DateTimePicker\DisplayInput\style.less';
39
- @import './components\OptionList\InlineOptionList\style.less';
40
39
  @import './components\OptionList\OptionItem\style.less';
41
40
  @import './components\OptionList\PopoverOptionList\style.less';
41
+ @import './components\OptionList\InlineOptionList\style.less';
42
42
  @import './components\Steps\ControlButton\style.less';
43
43
  @import './components\Table\ColumnTag\style.less';
44
+ @import './components\TagList\Tag\style.less';
44
45
  @import './components\Timeline\TimelineItem\style.less';
46
+ @import './components\TagList\TagSwitch\style.less';
45
47
  @import './components\Transfer\List\style.less';
46
- @import './components\TagList\Tag\style.less';
47
48
  @import './components\Transfer\ListBody\style.less';
48
- @import './components\TagList\TagSwitch\style.less';
49
- @import './components\DateTimePicker\Collapse\Panel\style.less';
50
- @import './components\DateTimePicker\BaseMobile\Absolute\style.less';
49
+ @import './components\DateTimePicker\BaseMobile\Absolute\style.less';
50
+ @import './components\DateTimePicker\Collapse\Panel\style.less';
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import type { RefObject } from 'react';
2
2
  import { AutoCompleteProps as BaseAutoCompleteProps } from 'antd/es/auto-complete';
3
3
  export declare type AutoSelectValue = string | undefined;
4
4
  export interface IAutoCompleteProps extends Omit<BaseAutoCompleteProps, 'value' | 'onChange'> {
@@ -14,6 +14,7 @@ export interface IAutoCompleteProps extends Omit<BaseAutoCompleteProps, 'value'
14
14
  * AutoSelectValue同value类型一致
15
15
  */
16
16
  onChange?: (value: AutoSelectValue) => void;
17
+ selectorRef?: RefObject<any>;
17
18
  }
18
19
  export declare function AutoComplete(props: IAutoCompleteProps): JSX.Element;
19
20
  declare const _default: (props: IAutoCompleteProps & {
@@ -40,7 +40,7 @@ var style_1 = require("../../constants/style");
40
40
  var debounce_1 = __importDefault(require("../../hoc/debounce"));
41
41
  function AutoComplete(props) {
42
42
  var _a;
43
- var className = props.className, dropdownClassName = props.dropdownClassName, ellipsis = props.ellipsis, other = __rest(props, ["className", "dropdownClassName", "ellipsis"]);
43
+ var className = props.className, dropdownClassName = props.dropdownClassName, ellipsis = props.ellipsis, selectorRef = props.selectorRef, other = __rest(props, ["className", "dropdownClassName", "ellipsis", "selectorRef"]);
44
44
  var filterOption = React.useCallback(function (inputValue, option) {
45
45
  var prefix = (inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()) || '';
46
46
  var _a = option || {}, value = _a.value, title = _a.title, children = _a.children, label = _a.label;
@@ -60,7 +60,7 @@ function AutoComplete(props) {
60
60
  ? lodash_1.includes(value.toLowerCase(), prefix)
61
61
  : true;
62
62
  }, []);
63
- return (React.createElement(antd_1.AutoComplete, __assign({ className: classnames_1.default(className, style_1.SDK_PREFIX + "-auto-complete", style_1.SDK_PREFIX + "-selector"), dropdownClassName: classnames_1.default(style_1.SDK_PREFIX + "-selector-dropdown", (_a = {}, _a[style_1.SDK_PREFIX + "-selector-no-ellipsis"] = !ellipsis, _a), dropdownClassName), filterOption: filterOption, showSearch: true }, other)));
63
+ return (React.createElement(antd_1.AutoComplete, __assign({ ref: selectorRef, className: classnames_1.default(className, style_1.SDK_PREFIX + "-auto-complete", style_1.SDK_PREFIX + "-selector"), dropdownClassName: classnames_1.default(style_1.SDK_PREFIX + "-selector-dropdown", (_a = {}, _a[style_1.SDK_PREFIX + "-selector-no-ellipsis"] = !ellipsis, _a), dropdownClassName), filterOption: filterOption, showSearch: true }, other)));
64
64
  }
65
65
  exports.AutoComplete = AutoComplete;
66
66
  exports.default = debounce_1.default(AutoComplete);
@@ -20,5 +20,9 @@ export interface IKeyValuePairProps {
20
20
  * value的class name
21
21
  */
22
22
  valueClassName?: string;
23
+ /**
24
+ * 是否是富文本
25
+ */
26
+ htmlContent?: boolean;
23
27
  }
24
28
  export default function KeyValuePair(props: IKeyValuePairProps): JSX.Element;
@@ -14,9 +14,11 @@ var React = __importStar(require("react"));
14
14
  var classnames_1 = __importDefault(require("classnames"));
15
15
  var style_1 = require("../../constants/style");
16
16
  function KeyValuePair(props) {
17
- var label = props.label, value = props.value, labelClassName = props.labelClassName, valueClassName = props.valueClassName;
17
+ var label = props.label, value = props.value, labelClassName = props.labelClassName, valueClassName = props.valueClassName, htmlContent = props.htmlContent;
18
18
  return (React.createElement("div", { className: classnames_1.default(props.className) },
19
- React.createElement("span", { className: classnames_1.default(style_1.SDK_PREFIX + "-key-value-label", labelClassName) }, label),
20
- React.createElement("span", { className: classnames_1.default(style_1.SDK_PREFIX + "-key-value-value", valueClassName) }, value)));
19
+ React.createElement("span", { className: classnames_1.default(style_1.SDK_PREFIX + "-key-value-label", !!htmlContent && style_1.SDK_PREFIX + "-key-value-label-top", labelClassName) }, label),
20
+ htmlContent ? (React.createElement("span", { className: classnames_1.default(style_1.SDK_PREFIX + "-key-value-value", valueClassName), dangerouslySetInnerHTML: {
21
+ __html: value
22
+ } })) : (React.createElement("span", { className: classnames_1.default(style_1.SDK_PREFIX + "-key-value-value", valueClassName) }, value))));
21
23
  }
22
24
  exports.default = KeyValuePair;
@@ -17,6 +17,10 @@
17
17
  color: #666;
18
18
  width: 30%;
19
19
  }
20
+ .pandora-sdk-key-value-label-top {
21
+ padding-top: 10px;
22
+ vertical-align: top;
23
+ }
20
24
  .pandora-sdk-key-value-value {
21
25
  color: #333;
22
26
  width: 70%;
@@ -14,6 +14,10 @@
14
14
  color: @font-color-6;
15
15
  width: 30%;
16
16
  }
17
+ .@{sdk-prefix}-key-value-label-top {
18
+ padding-top: 10px;
19
+ vertical-align: top;
20
+ }
17
21
 
18
22
  .@{sdk-prefix}-key-value-value {
19
23
  color: @font-color-7;
@@ -14,6 +14,10 @@ export interface IOption {
14
14
  * 路由
15
15
  */
16
16
  weburl?: string;
17
+ /**
18
+ * 内部链接
19
+ */
20
+ internalUrl?: string;
17
21
  /**
18
22
  * 路由调整方式
19
23
  */
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { RefObject } from 'react';
2
3
  import { SelectProps, SelectValue } from 'antd/es/select';
3
4
  import PropTypes from 'prop-types';
4
5
  declare type IValue = string | number;
@@ -53,6 +54,7 @@ export interface ISelectorProps<VT> extends Omit<SelectProps<VT>, 'options'> {
53
54
  */
54
55
  ellipsis?: boolean;
55
56
  isCustomFilter?: boolean;
57
+ selectorRef?: RefObject<any>;
56
58
  }
57
59
  /**
58
60
  * 下拉选择组件封装
@@ -139,8 +139,8 @@ var Selector = /** @class */ (function (_super) {
139
139
  };
140
140
  Selector.prototype.render = function () {
141
141
  var _a;
142
- var _b = this.props, options = _b.options, groupOptions = _b.groupOptions, createOptionText = _b.createOptionText, selectAllOptionText = _b.selectAllOptionText, className = _b.className, dropdownClassName = _b.dropdownClassName, getPopupContainer = _b.getPopupContainer, ellipsis = _b.ellipsis, _c = _b.showArrow, showArrow = _c === void 0 ? true : _c, isCustomFilter = _b.isCustomFilter, otherProps = __rest(_b, ["options", "groupOptions", "createOptionText", "selectAllOptionText", "className", "dropdownClassName", "getPopupContainer", "ellipsis", "showArrow", "isCustomFilter"]);
143
- return (React.createElement(antd_1.Select, __assign({ className: classnames_1.default(style_1.SDK_PREFIX + "-selector", className), dropdownClassName: classnames_1.default(style_1.SDK_PREFIX + "-selector-dropdown", (_a = {}, _a[style_1.SDK_PREFIX + "-selector-no-ellipsis"] = !ellipsis, _a), dropdownClassName), getPopupContainer: getPopupContainer || this.context.getPopupContainer, filterOption: this.handleFilter }, otherProps, { removeIcon: React.createElement(compatible_1.Icon, { type: "close-circle", theme: "filled", className: style_1.SDK_PREFIX + "-close-icon" }), showArrow: showArrow, showSearch: true }),
142
+ var _b = this.props, options = _b.options, groupOptions = _b.groupOptions, createOptionText = _b.createOptionText, selectAllOptionText = _b.selectAllOptionText, className = _b.className, dropdownClassName = _b.dropdownClassName, getPopupContainer = _b.getPopupContainer, ellipsis = _b.ellipsis, _c = _b.showArrow, showArrow = _c === void 0 ? true : _c, isCustomFilter = _b.isCustomFilter, selectorRef = _b.selectorRef, otherProps = __rest(_b, ["options", "groupOptions", "createOptionText", "selectAllOptionText", "className", "dropdownClassName", "getPopupContainer", "ellipsis", "showArrow", "isCustomFilter", "selectorRef"]);
143
+ return (React.createElement(antd_1.Select, __assign({ className: classnames_1.default(style_1.SDK_PREFIX + "-selector", className), dropdownClassName: classnames_1.default(style_1.SDK_PREFIX + "-selector-dropdown", (_a = {}, _a[style_1.SDK_PREFIX + "-selector-no-ellipsis"] = !ellipsis, _a), dropdownClassName), getPopupContainer: getPopupContainer || this.context.getPopupContainer, filterOption: this.handleFilter }, otherProps, { removeIcon: React.createElement(compatible_1.Icon, { type: "close-circle", theme: "filled", className: style_1.SDK_PREFIX + "-close-icon" }), showArrow: showArrow, ref: selectorRef, showSearch: true }),
144
144
  createOptionText && (React.createElement(antd_1.Select.Option, __assign({}, { className: style_1.SDK_PREFIX + "-selector-create-option" }, { key: "selector_create", disabled: true }, noneValueOption),
145
145
  React.createElement("a", { className: style_1.SDK_PREFIX + "-selector-create-lint", onClick: this.handleCreateClick }, createOptionText))),
146
146
  selectAllOptionText && (React.createElement(antd_1.Select.Option, __assign({}, { className: style_1.SDK_PREFIX + "-selector-create-option" }, { key: "selector_select_all", disabled: true }, noneValueOption),
@@ -238,9 +238,12 @@ var Table = /** @class */ (function (_super) {
238
238
  : rowClassName(record, index, indent));
239
239
  };
240
240
  Table.prototype.getDisabledStatus = function (option) {
241
+ var _this = this;
241
242
  var noneSelected = this.selectedRowKeys.length === 0;
242
243
  var disabled = typeof option.disabled === 'function'
243
- ? option.disabled(__spread(this.undisabledData))
244
+ ? option.disabled(__spread(this.undisabledData.filter(function (item, index) {
245
+ return _this.selectedRowKeys.indexOf(_this.getRowKey(item, index)) !== -1;
246
+ })))
244
247
  : option.disabled;
245
248
  return noneSelected || disabled;
246
249
  };
@@ -1512,6 +1512,9 @@ textarea.ant-pagination-options-quick-jumper input {
1512
1512
  .pandora-sdk-table-wrapper .ant-table-tbody > tr > td:last-child {
1513
1513
  padding-right: 20px;
1514
1514
  }
1515
+ .pandora-sdk-table-wrapper .ant-table-tbody > tr > td:first-child:has(.pandora-sdk-table-empty) {
1516
+ padding: 0;
1517
+ }
1515
1518
  .pandora-sdk-table-wrapper .ant-table-thead > tr > th .anticon-filter {
1516
1519
  line-height: 20px;
1517
1520
  }
@@ -42,6 +42,11 @@
42
42
  .@{ant-prefix}-table-tbody > tr > td:last-child {
43
43
  padding-right: 20px;
44
44
  }
45
+ .@{ant-prefix}-table-tbody
46
+ > tr
47
+ > td:first-child:has(.@{sdk-prefix}-table-empty) {
48
+ padding: 0;
49
+ }
45
50
 
46
51
  .@{ant-prefix}-table-thead > tr > th .anticon-filter {
47
52
  line-height: 20px;
@@ -33,6 +33,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
33
33
  var react_1 = __importStar(require("react"));
34
34
  var antd_1 = require("antd");
35
35
  var config_provider_1 = require("antd/es/config-provider");
36
+ var lodash_1 = require("lodash");
36
37
  var pandora_component_icons_1 = require("@qn-pandora/pandora-component-icons");
37
38
  var ListBody_1 = __importDefault(require("../ListBody"));
38
39
  var language_1 = require("../../../utils/language");
@@ -42,17 +43,23 @@ function List(props) {
42
43
  var _a = __read(react_1.useState(''), 2), searchValue = _a[0], setSearchValue = _a[1];
43
44
  var locale = react_1.useContext(config_provider_1.ConfigContext).locale;
44
45
  var title = props.title, type = props.type, searchPlaceHolder = props.searchPlaceHolder, _b = props.dataSource, dataSource = _b === void 0 ? [] : _b, _c = props.targetKeys, targetKeys = _c === void 0 ? [] : _c, selectAllTitle = props.selectAllTitle, onTargetKeysChange = props.onTargetKeysChange;
46
+ var filterDataSource = react_1.useMemo(function () {
47
+ return dataSource.filter(function (item) { return item.name.includes(searchValue); });
48
+ }, [dataSource, searchValue]);
45
49
  var onToggleAll = react_1.useCallback(function (e) {
50
+ var newTargetKeys = [];
51
+ var allTargetKeys = filterDataSource.map(function (item) { return item.key; });
46
52
  if (e.target.checked === true) {
47
- var targetKeys_1 = dataSource.map(function (item) { return item.key; });
48
- onTargetKeysChange(targetKeys_1);
53
+ newTargetKeys = __spread(new Set(__spread(targetKeys, allTargetKeys)));
49
54
  }
50
55
  else {
51
- onTargetKeysChange([]);
56
+ newTargetKeys = targetKeys.filter(function (item) { return !lodash_1.includes(allTargetKeys, item); });
52
57
  }
53
- }, [dataSource, onTargetKeysChange]);
54
- var selectedAllNode = (react_1.default.createElement(antd_1.Checkbox, { className: style_1.SDK_PREFIX + "-transfer-mb10", checked: dataSource.every(function (item) { return item.checked; }), indeterminate: dataSource.some(function (item) { return item.checked; }) &&
55
- !dataSource.every(function (item) { return item.checked; }), onChange: onToggleAll },
58
+ onTargetKeysChange(newTargetKeys);
59
+ }, [filterDataSource, targetKeys, onTargetKeysChange]);
60
+ var selectedAllNode = (react_1.default.createElement(antd_1.Checkbox, { className: style_1.SDK_PREFIX + "-transfer-mb10", checked: !!filterDataSource.length &&
61
+ filterDataSource.every(function (item) { return item.checked; }), indeterminate: filterDataSource.some(function (item) { return item.checked; }) &&
62
+ !filterDataSource.every(function (item) { return item.checked; }), onChange: onToggleAll },
56
63
  react_1.default.createElement("strong", null, selectAllTitle || language_1.formatString(type_1.TransferLocale.select_all, locale))));
57
64
  var onCheckboxChange = react_1.useCallback(function (key, checked) {
58
65
  var keys = __spread(targetKeys);
@@ -70,6 +77,6 @@ function List(props) {
70
77
  react_1.default.createElement(antd_1.Input, { placeholder: searchPlaceHolder ||
71
78
  language_1.formatString(type_1.TransferLocale.placeholder, locale), value: searchValue, onChange: function (e) { return setSearchValue(e.target.value); }, className: style_1.SDK_PREFIX + "-transfer-mb10", prefix: react_1.default.createElement(pandora_component_icons_1.Search, { className: style_1.SDK_PREFIX + "-search-icon" }) })),
72
79
  type === "source" /* Source */ && selectedAllNode,
73
- react_1.default.createElement(ListBody_1.default, { dataSource: dataSource.filter(function (item) { return item.name.includes(searchValue); }), onChange: onCheckboxChange })));
80
+ react_1.default.createElement(ListBody_1.default, { dataSource: filterDataSource, onChange: onCheckboxChange })));
74
81
  }
75
82
  exports.default = List;