@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/CHANGELOG.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@qn-pandora/pandora-component",
3
3
  "entries": [
4
+ {
5
+ "version": "4.0.6",
6
+ "tag": "@qn-pandora/pandora-component_v4.0.6",
7
+ "date": "Mon, 13 Mar 2023 11:30:17 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "2023.03.13发布"
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.0.8` to `^3.0.9`"
17
+ },
18
+ {
19
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.0.8` to `^3.0.9`"
20
+ },
21
+ {
22
+ "comment": "Updating dependency \"@qn-pandora/pandora-tools\" from `^2.0.7` to `^2.0.8`"
23
+ }
24
+ ]
25
+ }
26
+ },
27
+ {
28
+ "version": "4.0.5",
29
+ "tag": "@qn-pandora/pandora-component_v4.0.5",
30
+ "date": "Wed, 15 Feb 2023 09:26:50 GMT",
31
+ "comments": {
32
+ "patch": [
33
+ {
34
+ "comment": "2023.02.15 发布"
35
+ }
36
+ ],
37
+ "dependency": [
38
+ {
39
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.0.7` to `^3.0.8`"
40
+ },
41
+ {
42
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.0.7` to `^3.0.8`"
43
+ },
44
+ {
45
+ "comment": "Updating dependency \"@qn-pandora/pandora-tools\" from `^2.0.6` to `^2.0.7`"
46
+ }
47
+ ]
48
+ }
49
+ },
4
50
  {
5
51
  "version": "4.0.4",
6
52
  "tag": "@qn-pandora/pandora-component_v4.0.4",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Change Log - @qn-pandora/pandora-component
2
2
 
3
- This log was last generated on Wed, 11 Jan 2023 08:25:05 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 13 Mar 2023 11:30:17 GMT and should not be manually modified.
4
+
5
+ ## 4.0.6
6
+
7
+ Mon, 13 Mar 2023 11:30:17 GMT
8
+
9
+ ### Patches
10
+
11
+ - 2023.03.13 发布
12
+
13
+ ## 4.0.5
14
+
15
+ Wed, 15 Feb 2023 09:26:50 GMT
16
+
17
+ ### Patches
18
+
19
+ - 2023.02.15 发布
4
20
 
5
21
  ## 4.0.4
6
22
 
@@ -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 & {
@@ -28,7 +28,7 @@ import { SDK_PREFIX } from '../../constants/style';
28
28
  import debounceWrapper from '../../hoc/debounce';
29
29
  export function AutoComplete(props) {
30
30
  var _a;
31
- var className = props.className, dropdownClassName = props.dropdownClassName, ellipsis = props.ellipsis, other = __rest(props, ["className", "dropdownClassName", "ellipsis"]);
31
+ var className = props.className, dropdownClassName = props.dropdownClassName, ellipsis = props.ellipsis, selectorRef = props.selectorRef, other = __rest(props, ["className", "dropdownClassName", "ellipsis", "selectorRef"]);
32
32
  var filterOption = React.useCallback(function (inputValue, option) {
33
33
  var prefix = (inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()) || '';
34
34
  var _a = option || {}, value = _a.value, title = _a.title, children = _a.children, label = _a.label;
@@ -48,6 +48,6 @@ export function AutoComplete(props) {
48
48
  ? includes(value.toLowerCase(), prefix)
49
49
  : true;
50
50
  }, []);
51
- return (React.createElement(BaseAutoComplete, __assign({ className: classnames(className, SDK_PREFIX + "-auto-complete", SDK_PREFIX + "-selector"), dropdownClassName: classnames(SDK_PREFIX + "-selector-dropdown", (_a = {}, _a[SDK_PREFIX + "-selector-no-ellipsis"] = !ellipsis, _a), dropdownClassName), filterOption: filterOption, showSearch: true }, other)));
51
+ return (React.createElement(BaseAutoComplete, __assign({ ref: selectorRef, className: classnames(className, SDK_PREFIX + "-auto-complete", SDK_PREFIX + "-selector"), dropdownClassName: classnames(SDK_PREFIX + "-selector-dropdown", (_a = {}, _a[SDK_PREFIX + "-selector-no-ellipsis"] = !ellipsis, _a), dropdownClassName), filterOption: filterOption, showSearch: true }, other)));
52
52
  }
53
53
  export default debounceWrapper(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;
@@ -2,8 +2,10 @@ import * as React from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { SDK_PREFIX } from '../../constants/style';
4
4
  export default function KeyValuePair(props) {
5
- var label = props.label, value = props.value, labelClassName = props.labelClassName, valueClassName = props.valueClassName;
5
+ var label = props.label, value = props.value, labelClassName = props.labelClassName, valueClassName = props.valueClassName, htmlContent = props.htmlContent;
6
6
  return (React.createElement("div", { className: classnames(props.className) },
7
- React.createElement("span", { className: classnames(SDK_PREFIX + "-key-value-label", labelClassName) }, label),
8
- React.createElement("span", { className: classnames(SDK_PREFIX + "-key-value-value", valueClassName) }, value)));
7
+ React.createElement("span", { className: classnames(SDK_PREFIX + "-key-value-label", !!htmlContent && SDK_PREFIX + "-key-value-label-top", labelClassName) }, label),
8
+ htmlContent ? (React.createElement("span", { className: classnames(SDK_PREFIX + "-key-value-value", valueClassName), dangerouslySetInnerHTML: {
9
+ __html: value
10
+ } })) : (React.createElement("span", { className: classnames(SDK_PREFIX + "-key-value-value", valueClassName) }, value))));
9
11
  }
@@ -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
  * 下拉选择组件封装
@@ -127,8 +127,8 @@ var Selector = /** @class */ (function (_super) {
127
127
  };
128
128
  Selector.prototype.render = function () {
129
129
  var _a;
130
- 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"]);
131
- return (React.createElement(Select, __assign({ className: classnames(SDK_PREFIX + "-selector", className), dropdownClassName: classnames(SDK_PREFIX + "-selector-dropdown", (_a = {}, _a[SDK_PREFIX + "-selector-no-ellipsis"] = !ellipsis, _a), dropdownClassName), getPopupContainer: getPopupContainer || this.context.getPopupContainer, filterOption: this.handleFilter }, otherProps, { removeIcon: React.createElement(Icon, { type: "close-circle", theme: "filled", className: SDK_PREFIX + "-close-icon" }), showArrow: showArrow, showSearch: true }),
130
+ 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"]);
131
+ return (React.createElement(Select, __assign({ className: classnames(SDK_PREFIX + "-selector", className), dropdownClassName: classnames(SDK_PREFIX + "-selector-dropdown", (_a = {}, _a[SDK_PREFIX + "-selector-no-ellipsis"] = !ellipsis, _a), dropdownClassName), getPopupContainer: getPopupContainer || this.context.getPopupContainer, filterOption: this.handleFilter }, otherProps, { removeIcon: React.createElement(Icon, { type: "close-circle", theme: "filled", className: SDK_PREFIX + "-close-icon" }), showArrow: showArrow, ref: selectorRef, showSearch: true }),
132
132
  createOptionText && (React.createElement(Select.Option, __assign({}, { className: SDK_PREFIX + "-selector-create-option" }, { key: "selector_create", disabled: true }, noneValueOption),
133
133
  React.createElement("a", { className: SDK_PREFIX + "-selector-create-lint", onClick: this.handleCreateClick }, createOptionText))),
134
134
  selectAllOptionText && (React.createElement(Select.Option, __assign({}, { className: SDK_PREFIX + "-selector-create-option" }, { key: "selector_select_all", disabled: true }, noneValueOption),
@@ -226,9 +226,12 @@ var Table = /** @class */ (function (_super) {
226
226
  : rowClassName(record, index, indent));
227
227
  };
228
228
  Table.prototype.getDisabledStatus = function (option) {
229
+ var _this = this;
229
230
  var noneSelected = this.selectedRowKeys.length === 0;
230
231
  var disabled = typeof option.disabled === 'function'
231
- ? option.disabled(__spread(this.undisabledData))
232
+ ? option.disabled(__spread(this.undisabledData.filter(function (item, index) {
233
+ return _this.selectedRowKeys.indexOf(_this.getRowKey(item, index)) !== -1;
234
+ })))
232
235
  : option.disabled;
233
236
  return noneSelected || disabled;
234
237
  };
@@ -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;
@@ -18,9 +18,10 @@ var __spread = (this && this.__spread) || function () {
18
18
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
19
19
  return ar;
20
20
  };
21
- import React, { useState, useCallback, useContext } from 'react';
21
+ import React, { useState, useCallback, useContext, useMemo } from 'react';
22
22
  import { Input, Checkbox } from 'antd';
23
23
  import { ConfigContext } from 'antd/es/config-provider';
24
+ import { includes } from 'lodash';
24
25
  import { Search } from '@qn-pandora/pandora-component-icons';
25
26
  import ListBody from '../ListBody';
26
27
  import { formatString } from '../../../utils/language';
@@ -30,17 +31,23 @@ export default function List(props) {
30
31
  var _a = __read(useState(''), 2), searchValue = _a[0], setSearchValue = _a[1];
31
32
  var locale = useContext(ConfigContext).locale;
32
33
  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;
34
+ var filterDataSource = useMemo(function () {
35
+ return dataSource.filter(function (item) { return item.name.includes(searchValue); });
36
+ }, [dataSource, searchValue]);
33
37
  var onToggleAll = useCallback(function (e) {
38
+ var newTargetKeys = [];
39
+ var allTargetKeys = filterDataSource.map(function (item) { return item.key; });
34
40
  if (e.target.checked === true) {
35
- var targetKeys_1 = dataSource.map(function (item) { return item.key; });
36
- onTargetKeysChange(targetKeys_1);
41
+ newTargetKeys = __spread(new Set(__spread(targetKeys, allTargetKeys)));
37
42
  }
38
43
  else {
39
- onTargetKeysChange([]);
44
+ newTargetKeys = targetKeys.filter(function (item) { return !includes(allTargetKeys, item); });
40
45
  }
41
- }, [dataSource, onTargetKeysChange]);
42
- var selectedAllNode = (React.createElement(Checkbox, { className: SDK_PREFIX + "-transfer-mb10", checked: dataSource.every(function (item) { return item.checked; }), indeterminate: dataSource.some(function (item) { return item.checked; }) &&
43
- !dataSource.every(function (item) { return item.checked; }), onChange: onToggleAll },
46
+ onTargetKeysChange(newTargetKeys);
47
+ }, [filterDataSource, targetKeys, onTargetKeysChange]);
48
+ var selectedAllNode = (React.createElement(Checkbox, { className: SDK_PREFIX + "-transfer-mb10", checked: !!filterDataSource.length &&
49
+ filterDataSource.every(function (item) { return item.checked; }), indeterminate: filterDataSource.some(function (item) { return item.checked; }) &&
50
+ !filterDataSource.every(function (item) { return item.checked; }), onChange: onToggleAll },
44
51
  React.createElement("strong", null, selectAllTitle || formatString(TransferLocale.select_all, locale))));
45
52
  var onCheckboxChange = useCallback(function (key, checked) {
46
53
  var keys = __spread(targetKeys);
@@ -58,5 +65,5 @@ export default function List(props) {
58
65
  React.createElement(Input, { placeholder: searchPlaceHolder ||
59
66
  formatString(TransferLocale.placeholder, locale), value: searchValue, onChange: function (e) { return setSearchValue(e.target.value); }, className: SDK_PREFIX + "-transfer-mb10", prefix: React.createElement(Search, { className: SDK_PREFIX + "-search-icon" }) })),
60
67
  type === "source" /* Source */ && selectedAllNode,
61
- React.createElement(ListBody, { dataSource: dataSource.filter(function (item) { return item.name.includes(searchValue); }), onChange: onCheckboxChange })));
68
+ React.createElement(ListBody, { dataSource: filterDataSource, onChange: onCheckboxChange })));
62
69
  }