@chlp-tech/rpa-ui 0.0.11 → 0.0.13

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 (32) hide show
  1. package/dist/MediaAccountPreview/index.d.ts +11 -0
  2. package/dist/MediaAccountPreview/index.js +39 -0
  3. package/dist/MediaAccountPreview/index.module.less +35 -0
  4. package/dist/account-select/index.d.ts +6 -38
  5. package/dist/account-select/index.js +256 -185
  6. package/dist/account-select/index.module.less +152 -39
  7. package/dist/account-select/type.d.ts +90 -0
  8. package/dist/account-select/type.js +1 -0
  9. package/dist/cover-modal/index.d.ts +10 -0
  10. package/dist/cover-modal/index.js +64 -0
  11. package/dist/drawer-task/index.d.ts +2 -2
  12. package/dist/drawer-task/index.js +3 -1
  13. package/dist/drawer-task/index.module.less +6 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.js +3 -0
  16. package/dist/publish-account2/imgs/close.svg +25 -0
  17. package/dist/publish-account2/imgs/fb.svg +20 -0
  18. package/dist/publish-account2/imgs/ins.svg +36 -0
  19. package/dist/publish-account2/imgs/tk.svg +31 -0
  20. package/dist/publish-account2/imgs/tt.svg +21 -0
  21. package/dist/publish-account2/imgs/yt.svg +25 -0
  22. package/dist/publish-account2/index.d.ts +37 -0
  23. package/dist/publish-account2/index.js +144 -0
  24. package/dist/publish-account2/index.module.less +83 -0
  25. package/dist/publish-status/imgs/delete.svg +22 -0
  26. package/dist/publish-status/imgs/pause.svg +27 -0
  27. package/dist/publish-status/index.js +26 -0
  28. package/dist/release-video-card/index.d.ts +1 -0
  29. package/dist/release-video-card/index.js +21 -8
  30. package/dist/release-video-card/index.module.less +1 -0
  31. package/dist/text-ellipsis/index.js +8 -4
  32. package/package.json +3 -2
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ interface Account {
3
+ label: string;
4
+ value: string;
5
+ data?: any;
6
+ error?: boolean;
7
+ remark?: string;
8
+ language?: string;
9
+ country?: string;
10
+ ownerUserName?: string;
11
+ icon: string;
12
+ }
13
+ interface SocialMediaAccounts {
14
+ fb: Account[];
15
+ ins: Account[];
16
+ tk: Account[];
17
+ yt: Account[];
18
+ tt: Account[];
19
+ }
20
+ interface AccountBlockProps {
21
+ active?: boolean;
22
+ onClick?: () => void;
23
+ width?: number | string;
24
+ onErrorClose?: (account: Account) => void;
25
+ account: Account;
26
+ }
27
+ interface PublishAccountProps {
28
+ accounts: SocialMediaAccounts;
29
+ boxWidth?: number | string;
30
+ onAccountSelect: (account: Account) => void;
31
+ onErrorClose?: (account: Account) => void;
32
+ }
33
+ declare const AccountComponent: {
34
+ PublishAccount: React.FC<PublishAccountProps>;
35
+ AccountBlock: React.FC<AccountBlockProps>;
36
+ };
37
+ export default AccountComponent;
@@ -0,0 +1,144 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ import React, { useState, useEffect } from "react";
12
+ import { Avatar, Row, Col, Popover } from 'antd';
13
+ import classNames from 'classnames';
14
+ import TextEllipsis from "../text-ellipsis";
15
+ import MediaAccountPreview from "../MediaAccountPreview";
16
+ import Fb from "./imgs/fb.svg";
17
+ import Ins from "./imgs/ins.svg";
18
+ import Tk from "./imgs/tk.svg";
19
+ import Yt from "./imgs/yt.svg";
20
+ import Tt from "./imgs/tt.svg";
21
+ import CloseIcon from "./imgs/close.svg";
22
+ import styles from "./index.module.less";
23
+ var AccountBlock = function AccountBlock(_ref) {
24
+ var _account$remark;
25
+ var active = _ref.active,
26
+ onClick = _ref.onClick,
27
+ account = _ref.account,
28
+ onErrorClose = _ref.onErrorClose,
29
+ width = _ref.width;
30
+ var isError = account.error;
31
+ return /*#__PURE__*/React.createElement(Popover, {
32
+ rootClassName: styles.previewPopBox,
33
+ content: /*#__PURE__*/React.createElement(MediaAccountPreview, {
34
+ nickname: account.label,
35
+ remark: account.remark,
36
+ language: account.language,
37
+ country: account.country,
38
+ width: 450,
39
+ ownerUsername: account.ownerUserName
40
+ })
41
+ }, /*#__PURE__*/React.createElement("div", {
42
+ className: classNames(styles['account-wrap'], _defineProperty(_defineProperty({}, styles['error'], isError), styles['active'], active)),
43
+ onClick: onClick,
44
+ style: {
45
+ width: width,
46
+ background: active && isError ? '#FEECEC' : active && !isError ? '#E9F1FF' : '#F5F7FA'
47
+ }
48
+ }, /*#__PURE__*/React.createElement("div", {
49
+ className: styles['flex']
50
+ }, /*#__PURE__*/React.createElement(Avatar, {
51
+ size: 24,
52
+ src: account.icon
53
+ }), /*#__PURE__*/React.createElement("div", {
54
+ className: "".concat(styles['account-wrap_text'], " ").concat(isError ? styles['error-text'] : active ? styles['active'] : ''),
55
+ style: {
56
+ color: active && isError ? '#FA4441' : active && !isError ? '#004FD3' : '#142A51'
57
+ }
58
+ }, account.label), account.remark && ((_account$remark = account.remark) === null || _account$remark === void 0 ? void 0 : _account$remark.length) > 0 && /*#__PURE__*/React.createElement("div", {
59
+ className: styles.remarkText
60
+ }, /*#__PURE__*/React.createElement(TextEllipsis, {
61
+ lines: 1,
62
+ showTooltip: false
63
+ }, account.remark)), isError && /*#__PURE__*/React.createElement("img", {
64
+ src: CloseIcon,
65
+ alt: "",
66
+ className: "".concat(styles['close-icon']),
67
+ onClick: function onClick(e) {
68
+ e.stopPropagation();
69
+ if (onErrorClose) {
70
+ onErrorClose(account);
71
+ }
72
+ }
73
+ }))));
74
+ };
75
+ var PublishAccount = function PublishAccount(_ref2) {
76
+ var accounts = _ref2.accounts,
77
+ onAccountSelect = _ref2.onAccountSelect,
78
+ onErrorClose = _ref2.onErrorClose,
79
+ boxWidth = _ref2.boxWidth;
80
+ var _useState = useState(null),
81
+ _useState2 = _slicedToArray(_useState, 2),
82
+ selectedAccount = _useState2[0],
83
+ setSelectedAccount = _useState2[1];
84
+ var getFirstAvailableAccount = function getFirstAvailableAccount() {
85
+ for (var _i = 0, _arr = ['fb', 'ins', 'tk', 'yt']; _i < _arr.length; _i++) {
86
+ var platform = _arr[_i];
87
+ if (accounts[platform] && accounts[platform].length > 0) {
88
+ return accounts[platform][0];
89
+ }
90
+ }
91
+ return null;
92
+ };
93
+ useEffect(function () {
94
+ var firstAccount = getFirstAvailableAccount();
95
+ if (firstAccount) {
96
+ setSelectedAccount(firstAccount);
97
+ onAccountSelect(firstAccount);
98
+ }
99
+ }, [accounts]);
100
+ var renderAccounts = function renderAccounts(platform, icon) {
101
+ var _accounts$platform;
102
+ if (!accounts[platform] || accounts[platform].length === 0) {
103
+ return null;
104
+ }
105
+ return /*#__PURE__*/React.createElement(Row, {
106
+ gutter: 12,
107
+ style: {
108
+ marginBottom: 12
109
+ }
110
+ }, /*#__PURE__*/React.createElement(Col, {
111
+ span: 2
112
+ }, /*#__PURE__*/React.createElement("img", {
113
+ src: icon,
114
+ alt: platform
115
+ })), /*#__PURE__*/React.createElement(Col, {
116
+ span: 22
117
+ }, /*#__PURE__*/React.createElement("div", {
118
+ style: {
119
+ display: 'flex',
120
+ alignItems: 'center',
121
+ flexWrap: 'wrap',
122
+ gap: 12
123
+ }
124
+ }, (_accounts$platform = accounts[platform]) === null || _accounts$platform === void 0 ? void 0 : _accounts$platform.map(function (account) {
125
+ return /*#__PURE__*/React.createElement(AccountBlock, {
126
+ key: account.value,
127
+ width: boxWidth,
128
+ active: (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.value) === account.value,
129
+ onClick: function onClick() {
130
+ setSelectedAccount(account);
131
+ onAccountSelect(account);
132
+ },
133
+ onErrorClose: onErrorClose,
134
+ account: account
135
+ });
136
+ }))));
137
+ };
138
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderAccounts('fb', Fb), renderAccounts('ins', Ins), renderAccounts('tk', Tk), renderAccounts('yt', Yt), renderAccounts('tt', Tt));
139
+ };
140
+ var AccountComponent = {
141
+ PublishAccount: PublishAccount,
142
+ AccountBlock: AccountBlock
143
+ };
144
+ export default AccountComponent;
@@ -0,0 +1,83 @@
1
+ .account-wrap {
2
+ padding: 6px 8px 6px 8px;
3
+ background: #F5F7FA;
4
+ border-radius: 8px;
5
+ border: 1px solid #F5F7FA;
6
+ cursor: pointer;
7
+ display: inline-block;
8
+
9
+ &.error {
10
+ border-color: #FA4441;
11
+
12
+ &.error-active {
13
+ background: #FEECEC;
14
+
15
+ &_text {
16
+ color: #FA4441;
17
+ }
18
+ }
19
+ }
20
+
21
+ &:hover {
22
+ &.error .close-icon {
23
+ opacity: 1;
24
+ visibility: visible;
25
+ }
26
+ }
27
+
28
+ .close-icon {
29
+ opacity: 0;
30
+ visibility: hidden;
31
+ transition: opacity 0.3s;
32
+ }
33
+
34
+ &.active {
35
+ border-color: #004FD3;
36
+ background: #E9F1FF;
37
+ }
38
+
39
+ &_icon {
40
+ width: 24px;
41
+ height: 24px;
42
+ border-radius: 60%;
43
+ }
44
+
45
+ &_text {
46
+ flex: 1;
47
+ font-weight: 500;
48
+ font-size: 14px;
49
+ color: #142A51;
50
+ line-height: 20px;
51
+ text-align: left;
52
+ font-style: normal;
53
+ overflow: hidden;
54
+ transition: all 0.3s;
55
+ // 单行省略
56
+ text-overflow: ellipsis;
57
+ white-space: nowrap;
58
+ &.active {
59
+ color: #004FD3;
60
+ }
61
+ }
62
+ }
63
+
64
+ .flex {
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: space-between;
68
+ gap: 4px;
69
+ }
70
+
71
+ .remarkText {
72
+ width: 80px;
73
+ font-size: 12px;
74
+ color: #9EA7B5;
75
+ }
76
+
77
+ .previewPopBox {
78
+ :global {
79
+ .ant-popover-inner {
80
+ padding: 0px !important;
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 62 (91390) - https://sketch.com -->
4
+ <title>矩形</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="广告投放2025" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <g id="广告管理-广告看板--" transform="translate(-1606.000000, -457.000000)">
8
+ <g id="编组-15备份-5" transform="translate(1352.000000, 301.000000)">
9
+ <g id="编组-39备份-4" transform="translate(248.000000, 152.000000)">
10
+ <g id="编组-37">
11
+ <g id="编组备份-8" transform="translate(6.000000, 4.000000)">
12
+ <rect id="矩形" fill-opacity="0.01" fill="#FFFFFF" fill-rule="nonzero" x="0" y="0" width="16" height="16"></rect>
13
+ <g id="delete-02-solid-rounded" transform="translate(1.500000, 1.000000)" fill="#3F5270">
14
+ <path d="M7.06054222,0.175945778 C7.41216,0.207392889 7.74262222,0.314695111 8.02641778,0.526344 C8.23629333,0.682876444 8.38208,0.874483556 8.50664889,1.08200089 C8.62207111,1.27429867 8.73830222,1.51405333 8.87008889,1.78602667 L9.135,2.33268069 L11.3555556,2.33333333 L11.355,2.33368069 L11.8222222,2.33376889 C12.1658756,2.33376889 12.4444444,2.61235022 12.4444444,2.95599111 C12.4444444,3.29963822 12.1658756,3.57821333 11.8222222,3.57821333 L11.279,3.57768069 L10.9402222,9.11953778 C10.8924978,9.89930667 10.8546044,10.5181067 10.7770133,11.0123378 C10.6973689,11.5192622 10.5699378,11.9413778 10.3150133,12.3106044 C10.0818044,12.6484089 9.78158222,12.9335111 9.43338667,13.1477422 C9.05277333,13.3819467 8.62779556,13.4843644 8.12192889,13.5333333 L4.310376,13.5333333 C3.80395556,13.4841778 3.37849244,13.3815733 2.99761778,13.1469333 C2.649192,12.9323289 2.34885156,12.6467289 2.11572978,12.3083644 C1.86089867,11.9385156 1.73385956,11.5157778 1.65484356,11.0081689 C1.57779378,10.5131911 1.54076533,9.89352 1.49409244,9.11263111 L1.163,3.57768069 L0.622222222,3.57821333 L0.622222222,3.57821333 C0.278581333,3.57821333 -2.48689958e-14,3.29963822 -2.48689958e-14,2.95599111 C-2.48689958e-14,2.61235022 0.278581333,2.33376889 0.622222222,2.33376889 L1.088,2.33368069 L1.08888889,2.33333333 L3.366,2.33268069 L3.58745956,1.84809956 C3.71598578,1.56610844 3.82917422,1.31775467 3.94287289,1.11846933 C4.06551911,0.903510222 4.21070844,0.704585778 4.42313511,0.541619556 C4.71042133,0.321228444 5.04752889,0.209496 5.40704889,0.176767111 C5.58749333,0.160340444 5.76890568,0.156372049 5.95029037,0.155680691 L6.22222222,0.155953778 C6.54005333,0.156464 6.82577778,0.154945778 7.06054222,0.175945778 Z M4.66666667,5.88678222 C4.408936,5.88678222 4.2,6.09572444 4.2,6.35344889 L4.2,6.35344889 L4.2,10.0867822 C4.2,10.3445689 4.408936,10.5534489 4.66666667,10.5534489 C4.92439733,10.5534489 5.13333333,10.3445689 5.13333333,10.0867822 L5.13333333,10.0867822 L5.13333333,6.35344889 C5.13333333,6.09572444 4.92439733,5.88678222 4.66666667,5.88678222 Z M7.77777778,5.88678222 C7.52005333,5.88678222 7.31111111,6.09572444 7.31111111,6.35344889 L7.31111111,10.0867822 C7.31111111,10.3445689 7.52005333,10.5534489 7.77777778,10.5534489 C8.03550222,10.5534489 8.24444444,10.3445689 8.24444444,10.0867822 L8.24444444,6.35344889 C8.24444444,6.09572444 8.03550222,5.88678222 7.77777778,5.88678222 Z M6.40088383,1.40054522 L6.24368889,1.40043556 C5.90096889,1.40043556 5.68524444,1.40103289 5.51985778,1.41608444 C5.28708444,1.43727733 5.14198222,1.52797867 5.02376,1.73516622 C4.94639761,1.87076947 4.86217705,2.05223239 4.73420413,2.33270199 L7.752,2.33268069 L7.68621346,2.19696296 C7.58180543,1.98284333 7.50779556,1.8359237 7.43966222,1.72243556 C7.32000889,1.52311911 7.17664889,1.43574667 6.94966222,1.41544356 C6.81521037,1.40341911 6.64679556,1.40101319 6.40088383,1.40054522 Z" id="形状结合"></path>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </svg>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 62 (91390) - https://sketch.com -->
4
+ <title>矩形</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="广告投放2025" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <g id="发布管理-广告帖子--" transform="translate(-1511.000000, -981.000000)" fill-rule="nonzero">
8
+ <g id="编组-15备份-8" transform="translate(1352.000000, 824.000000)">
9
+ <g id="编组-39备份-4" transform="translate(152.000000, 152.000000)">
10
+ <g id="编组-37">
11
+ <g>
12
+ <g id="Icon/Checkbox-Normal" transform="translate(6.000000, 4.000000)">
13
+ <g id="编组">
14
+ <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
15
+ <g id="poweroff-circle-fill">
16
+ <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
17
+ <path d="M8,1 C4.134375,1 1,4.134375 1,8 C1,11.865625 4.134375,15 8,15 C11.865625,15 15,11.865625 15,8 C15,4.134375 11.865625,1 8,1 Z M6.75,10.375 C6.75,10.44375 6.69375,10.5 6.625,10.5 L5.875,10.5 C5.80625,10.5 5.75,10.44375 5.75,10.375 L5.75,5.625 C5.75,5.55625 5.80625,5.5 5.875,5.5 L6.625,5.5 C6.69375,5.5 6.75,5.55625 6.75,5.625 L6.75,10.375 Z M10.25,10.375 C10.25,10.44375 10.19375,10.5 10.125,10.5 L9.375,10.5 C9.30625,10.5 9.25,10.44375 9.25,10.375 L9.25,5.625 C9.25,5.55625 9.30625,5.5 9.375,5.5 L10.125,5.5 C10.19375,5.5 10.25,5.55625 10.25,5.625 L10.25,10.375 Z" id="形状" fill="#3F5270"></path>
18
+ </g>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ </g>
24
+ </g>
25
+ </g>
26
+ </g>
27
+ </svg>
@@ -5,6 +5,8 @@ import Wait from "./imgs/wait.svg";
5
5
  import Success from "./imgs/success.svg";
6
6
  import Fail from "./imgs/fail.svg";
7
7
  import Publish from "./imgs/publish.svg";
8
+ import Pause from "./imgs/pause.svg";
9
+ import Delete from "./imgs/delete.svg";
8
10
  var statusTag = {
9
11
  0: {
10
12
  bgColor: '#ECEFF4',
@@ -35,6 +37,30 @@ var statusTag = {
35
37
  textColor: '#004FD3',
36
38
  text: '发布中',
37
39
  icon: Publish
40
+ },
41
+ 5: {
42
+ bgColor: '#E9F1FF',
43
+ textColor: '#004FD3',
44
+ text: '排队中',
45
+ icon: Publish
46
+ },
47
+ 6: {
48
+ bgColor: '#ECEFF4',
49
+ textColor: '#3F5270',
50
+ text: '已暂停',
51
+ icon: Pause
52
+ },
53
+ 7: {
54
+ bgColor: '#E9F1FF',
55
+ textColor: '#004FD3',
56
+ text: '审核中',
57
+ icon: Publish
58
+ },
59
+ 8: {
60
+ bgColor: '#ECEFF4',
61
+ textColor: '#3F5270',
62
+ text: '已删除',
63
+ icon: Delete
38
64
  }
39
65
  };
40
66
  var StatusTag = function StatusTag(_ref) {
@@ -19,6 +19,7 @@ interface Props {
19
19
  isAd?: boolean;
20
20
  id: string | number;
21
21
  onDelete?: (id: string | number) => void;
22
+ onPauseOrStart?: (id: string | number) => void;
22
23
  mediaInfo: {
23
24
  url: string[];
24
25
  type: string;
@@ -110,6 +110,25 @@ var MediaCardList = function MediaCardList(props) {
110
110
  };
111
111
  var ReleaseVideoCard = function ReleaseVideoCard(props) {
112
112
  var _props$mediaInfo, _props$countData$view, _props$countData, _props$countData$like, _props$countData2, _props$countData$comm, _props$countData3, _ref2, _props$editComponent, _props$detailComponen;
113
+ var dropMenus = function dropMenus() {
114
+ var list = [];
115
+ // if ([1, 6].includes(props.status)) {
116
+ // list.push({
117
+ // label: <div>{props.status === 1 ? '暂停' : '启用'}</div>,
118
+ // key: 'pause',
119
+ // onClick: () => props?.onPauseOrStart?.(props.id),
120
+ // })
121
+ // }
122
+ list.push({
123
+ label: '删除',
124
+ key: 'delete',
125
+ onClick: function onClick() {
126
+ var _props$onDelete;
127
+ return props === null || props === void 0 || (_props$onDelete = props.onDelete) === null || _props$onDelete === void 0 ? void 0 : _props$onDelete.call(props, props.id);
128
+ }
129
+ });
130
+ return list;
131
+ };
113
132
  return /*#__PURE__*/React.createElement("div", {
114
133
  className: styles['card']
115
134
  }, /*#__PURE__*/React.createElement("div", {
@@ -194,16 +213,10 @@ var ReleaseVideoCard = function ReleaseVideoCard(props) {
194
213
  marginRight: 12,
195
214
  cursor: 'pointer'
196
215
  }
197
- }, [0, 1].includes(props.status) ? /*#__PURE__*/React.createElement(React.Fragment, null, (_props$editComponent = props.editComponent) !== null && _props$editComponent !== void 0 ? _props$editComponent : /*#__PURE__*/React.createElement("span", null, "\u7F16\u8F91")) : [2, 3].includes(props.status) ? /*#__PURE__*/React.createElement(React.Fragment, null, (_props$detailComponen = props.detailComponent) !== null && _props$detailComponen !== void 0 ? _props$detailComponen : /*#__PURE__*/React.createElement("span", null, "\u8BE6\u60C5")) : null), [0, 1].includes(props.status) ? /*#__PURE__*/React.createElement(Dropdown, {
216
+ }, [0, 1].includes(props.status) ? /*#__PURE__*/React.createElement(React.Fragment, null, (_props$editComponent = props.editComponent) !== null && _props$editComponent !== void 0 ? _props$editComponent : /*#__PURE__*/React.createElement("span", null, "\u7F16\u8F91")) : [2, 3].includes(props.status) ? /*#__PURE__*/React.createElement(React.Fragment, null, (_props$detailComponen = props.detailComponent) !== null && _props$detailComponen !== void 0 ? _props$detailComponen : /*#__PURE__*/React.createElement("span", null, "\u8BE6\u60C5")) : null), [0, 1, 6].includes(props.status) ? /*#__PURE__*/React.createElement(Dropdown, {
198
217
  trigger: ['click'],
199
218
  menu: {
200
- items: [{
201
- label: '删除',
202
- key: 'delete',
203
- onClick: function onClick() {
204
- return (props === null || props === void 0 ? void 0 : props.onDelete) && props.onDelete(props.id);
205
- }
206
- }]
219
+ items: dropMenus()
207
220
  }
208
221
  }, /*#__PURE__*/React.createElement("div", {
209
222
  style: {
@@ -24,6 +24,7 @@
24
24
  text-align: left;
25
25
  font-style: normal;
26
26
  flex: 1;
27
+ min-width: 0;
27
28
  display: flex;
28
29
  flex-direction: column;
29
30
  justify-content: space-around;
@@ -27,7 +27,7 @@ var TextEllipsis = function TextEllipsis(_ref) {
27
27
  var parentElement = parentRef.current;
28
28
  var parentWidth = parentElement.clientWidth;
29
29
  var textWidth = textElement.scrollWidth;
30
- setIsTruncated(textWidth > parentWidth);
30
+ setIsTruncated(textWidth >= parentWidth);
31
31
  }
32
32
  };
33
33
  checkTruncation();
@@ -41,17 +41,21 @@ var TextEllipsis = function TextEllipsis(_ref) {
41
41
  }, /*#__PURE__*/React.createElement("div", {
42
42
  className: styles['text-ellipsis'],
43
43
  ref: parentRef,
44
+ style: {
45
+ width: '100%'
46
+ }
47
+ }, /*#__PURE__*/React.createElement("div", {
48
+ ref: textRef,
44
49
  style: {
45
50
  display: '-webkit-box',
51
+ width: 'max-content',
52
+ maxWidth: '100%',
46
53
  WebkitBoxOrient: 'vertical',
47
54
  WebkitLineClamp: lines,
48
55
  overflow: 'hidden',
49
56
  textOverflow: 'ellipsis',
50
- width: '100%',
51
57
  wordBreak: 'break-all'
52
58
  }
53
- }, /*#__PURE__*/React.createElement("div", {
54
- ref: textRef
55
59
  }, children)));
56
60
  };
57
61
  export default TextEllipsis;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chlp-tech/rpa-ui",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "rpa-ui",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@ant-design/icons": ">=4.18.0",
39
- "antd": ">=4.18.0",
39
+ "antd": ">=5.25.0",
40
40
  "react": ">=16.9.0",
41
41
  "react-dom": ">=16.9.0"
42
42
  },
@@ -62,6 +62,7 @@
62
62
  },
63
63
  "dependencies": {
64
64
  "@webav/av-cliper": "^1.0.11",
65
+ "classnames": "^2.5.1",
65
66
  "dayjs": "^1.11.13",
66
67
  "js-md5": "^0.8.3",
67
68
  "styled-components": "^6.1.12"