@qn-pandora/pandora-component 4.0.4 → 4.0.5

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.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
2
  "name": "@qn-pandora/pandora-component",
3
3
  "entries": [
4
+ {
5
+ "version": "4.0.5",
6
+ "tag": "@qn-pandora/pandora-component_v4.0.5",
7
+ "date": "Wed, 15 Feb 2023 09:26:50 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "2023.02.15 发布"
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.0.7` to `^3.0.8`"
17
+ },
18
+ {
19
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.0.7` to `^3.0.8`"
20
+ },
21
+ {
22
+ "comment": "Updating dependency \"@qn-pandora/pandora-tools\" from `^2.0.6` to `^2.0.7`"
23
+ }
24
+ ]
25
+ }
26
+ },
4
27
  {
5
28
  "version": "4.0.4",
6
29
  "tag": "@qn-pandora/pandora-component_v4.0.4",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
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 Wed, 15 Feb 2023 09:26:50 GMT and should not be manually modified.
4
+
5
+ ## 4.0.5
6
+
7
+ Wed, 15 Feb 2023 09:26:50 GMT
8
+
9
+ ### Patches
10
+
11
+ - 2023.02.15 发布
4
12
 
5
13
  ## 4.0.4
6
14
 
@@ -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
  */
@@ -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
  }