@qn-pandora/pandora-component 4.3.0 → 4.3.2

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@qn-pandora/pandora-component",
3
3
  "entries": [
4
+ {
5
+ "version": "4.3.2",
6
+ "tag": "@qn-pandora/pandora-component_v4.3.2",
7
+ "date": "Thu, 16 Nov 2023 11:14:33 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "2023-11-16发包"
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.3.1` to `^3.3.2`"
17
+ }
18
+ ]
19
+ }
20
+ },
21
+ {
22
+ "version": "4.3.1",
23
+ "tag": "@qn-pandora/pandora-component_v4.3.1",
24
+ "date": "Mon, 30 Oct 2023 08:56:57 GMT",
25
+ "comments": {
26
+ "patch": [
27
+ {
28
+ "comment": "2023-10-30发包"
29
+ }
30
+ ],
31
+ "dependency": [
32
+ {
33
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.3.0` to `^3.3.1`"
34
+ },
35
+ {
36
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.3.0` to `^3.3.1`"
37
+ }
38
+ ]
39
+ }
40
+ },
4
41
  {
5
42
  "version": "4.3.0",
6
43
  "tag": "@qn-pandora/pandora-component_v4.3.0",
package/CHANGELOG.md CHANGED
@@ -1,43 +1,65 @@
1
1
  # Change Log - @qn-pandora/pandora-component
2
2
 
3
- This log was last generated on Tue, 24 Oct 2023 08:06:30 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 16 Nov 2023 11:14:33 GMT and should not be manually modified.
4
+
5
+ ## 4.3.2
6
+
7
+ Thu, 16 Nov 2023 11:14:33 GMT
8
+
9
+ ### Patches
10
+
11
+ - 2023-11-16 发包
12
+
13
+ ## 4.3.1
14
+
15
+ Mon, 30 Oct 2023 08:56:57 GMT
16
+
17
+ ### Patches
18
+
19
+ - 2023-10-30 发包
4
20
 
5
21
  ## 4.3.0
22
+
6
23
  Tue, 24 Oct 2023 08:06:30 GMT
7
24
 
8
25
  ### Minor changes
9
26
 
10
- - 2023-10-24发包
27
+ - 2023-10-24 发包
11
28
 
12
29
  ## 4.2.0
30
+
13
31
  Mon, 25 Sep 2023 07:36:39 GMT
14
32
 
15
33
  ### Minor changes
16
34
 
17
- - 2023-09-25发包
35
+ - 2023-09-25 发包
18
36
 
19
37
  ## 4.1.6
38
+
20
39
  Fri, 25 Aug 2023 10:29:46 GMT
21
40
 
22
41
  ### Patches
23
42
 
24
- - 2023-08-25发包
43
+ - 2023-08-25 发包
25
44
 
26
45
  ## 4.1.5
46
+
27
47
  Fri, 25 Aug 2023 09:17:44 GMT
28
48
 
29
49
  ### Patches
30
50
 
31
- - 2023-08-25发包
51
+ - 2023-08-25 发包
32
52
 
33
53
  ## 4.1.4
54
+
34
55
  Thu, 24 Aug 2023 09:24:03 GMT
35
56
 
36
57
  ### Patches
37
58
 
38
- - 2023.08.24发包
59
+ - 2023.08.24 发包
39
60
 
40
61
  ## 4.1.3
62
+
41
63
  Wed, 26 Jul 2023 09:10:30 GMT
42
64
 
43
65
  ### Patches
@@ -45,55 +67,63 @@ Wed, 26 Jul 2023 09:10:30 GMT
45
67
  - 2023.07.26 publish
46
68
 
47
69
  ## 4.1.2
70
+
48
71
  Tue, 25 Jul 2023 09:47:47 GMT
49
72
 
50
73
  ### Patches
51
74
 
52
- - 2023.07.25发包
75
+ - 2023.07.25 发包
53
76
 
54
77
  ## 4.1.1
78
+
55
79
  Thu, 20 Jul 2023 07:02:58 GMT
56
80
 
57
81
  ### Patches
58
82
 
59
- - 2023.07.20发包
83
+ - 2023.07.20 发包
60
84
 
61
85
  ## 4.1.0
86
+
62
87
  Tue, 27 Jun 2023 06:38:00 GMT
63
88
 
64
89
  ### Minor changes
65
90
 
66
- - 2023.06.27发包
91
+ - 2023.06.27 发包
67
92
 
68
93
  ## 4.0.12
94
+
69
95
  Mon, 29 May 2023 10:29:42 GMT
70
96
 
71
97
  ### Patches
72
98
 
73
- - 2023.05.29发包
99
+ - 2023.05.29 发包
74
100
 
75
101
  ## 4.0.11
102
+
76
103
  Wed, 24 May 2023 07:19:25 GMT
77
104
 
78
105
  ### Patches
79
106
 
80
- - 2023.05.24发包
107
+ - 2023.05.24 发包
81
108
 
82
109
  ## 4.0.10
110
+
83
111
  Tue, 23 May 2023 03:12:29 GMT
84
112
 
85
113
  ### Patches
86
114
 
87
- - 2023.05.23发布
115
+ - 2023.05.23 发布
88
116
 
89
117
  ## 4.0.9
118
+
90
119
  Wed, 19 Apr 2023 03:15:25 GMT
91
120
 
92
121
  ### Patches
93
122
 
94
- - 2023.04.19发包
123
+ - 2023.04.19 发包
95
124
 
96
125
  ## 4.0.8
126
+
97
127
  Tue, 04 Apr 2023 08:26:02 GMT
98
128
 
99
129
  ### Patches
@@ -101,20 +131,23 @@ Tue, 04 Apr 2023 08:26:02 GMT
101
131
  - 2023.04.04
102
132
 
103
133
  ## 4.0.7
134
+
104
135
  Thu, 23 Mar 2023 07:12:05 GMT
105
136
 
106
137
  ### Patches
107
138
 
108
- - 2023.03.23发布
139
+ - 2023.03.23 发布
109
140
 
110
141
  ## 4.0.6
142
+
111
143
  Mon, 13 Mar 2023 11:30:17 GMT
112
144
 
113
145
  ### Patches
114
146
 
115
- - 2023.03.13发布
147
+ - 2023.03.13 发布
116
148
 
117
149
  ## 4.0.5
150
+
118
151
  Wed, 15 Feb 2023 09:26:50 GMT
119
152
 
120
153
  ### Patches
@@ -122,6 +155,7 @@ Wed, 15 Feb 2023 09:26:50 GMT
122
155
  - 2023.02.15 发布
123
156
 
124
157
  ## 4.0.4
158
+
125
159
  Wed, 11 Jan 2023 08:25:05 GMT
126
160
 
127
161
  ### Patches
@@ -129,6 +163,7 @@ Wed, 11 Jan 2023 08:25:05 GMT
129
163
  - 2023-01-11 发布
130
164
 
131
165
  ## 4.0.3
166
+
132
167
  Tue, 10 Jan 2023 03:03:58 GMT
133
168
 
134
169
  ### Patches
@@ -136,20 +171,23 @@ Tue, 10 Jan 2023 03:03:58 GMT
136
171
  - 2023-01-10 发布
137
172
 
138
173
  ## 4.0.2
174
+
139
175
  Tue, 29 Nov 2022 03:37:07 GMT
140
176
 
141
177
  ### Patches
142
178
 
143
- - 2022.11.29发布
179
+ - 2022.11.29 发布
144
180
 
145
181
  ## 4.0.1
182
+
146
183
  Mon, 17 Oct 2022 06:49:55 GMT
147
184
 
148
185
  ### Patches
149
186
 
150
- - 22年10月16日发布
187
+ - 22 10 16 日发布
151
188
 
152
189
  ## 4.0.0
190
+
153
191
  Tue, 14 Jun 2022 09:21:39 GMT
154
192
 
155
193
  ### Breaking changes
@@ -157,9 +195,9 @@ Tue, 14 Jun 2022 09:21:39 GMT
157
195
  - 很久没发版了,统一发个大版本
158
196
 
159
197
  ## 3.0.0
198
+
160
199
  Mon, 20 Dec 2021 11:46:43 GMT
161
200
 
162
201
  ### Breaking changes
163
202
 
164
- - 仓库迁移至rush后统一发个大版本
165
-
203
+ - 仓库迁移至 rush 后统一发个大版本
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  export interface IProps {
3
3
  className?: string;
4
+ getPopupContainer?: () => HTMLElement;
4
5
  onClick?: (e: any) => void;
5
6
  }
6
7
  export declare const CloseIcon: React.FC<IProps>;
@@ -8,8 +8,8 @@ import { formatString } from '../../../utils/language';
8
8
  import { ModalLocale } from '../../../constants/language/modal/type';
9
9
  export var CloseIcon = function (props) {
10
10
  var locale = useContext(ConfigContext).locale;
11
- var className = props.className, onClick = props.onClick;
12
- return (React.createElement(Tooltip, { title: formatString(ModalLocale.close_tooltip, locale) },
11
+ var className = props.className, onClick = props.onClick, getPopupContainer = props.getPopupContainer;
12
+ return (React.createElement(Tooltip, { title: formatString(ModalLocale.close_tooltip, locale), getPopupContainer: getPopupContainer },
13
13
  React.createElement(Close, { className: classnames(SDK_PREFIX + "-modal-close-icon", className), onClick: onClick })));
14
14
  };
15
15
  export default CloseIcon;
@@ -78,6 +78,7 @@ export declare class Drawer extends React.Component<React.PropsWithChildren<IDra
78
78
  realWidth: React.ReactText;
79
79
  isFullscreen: boolean;
80
80
  throttleMouseMove: import("lodash").DebouncedFunc<(e: any) => void>;
81
+ static contextType: React.Context<import("antd/es/config-provider").ConfigConsumerProps>;
81
82
  get closable(): boolean | undefined;
82
83
  get extra(): JSX.Element;
83
84
  setIsResizing(isResizing?: boolean): void;
@@ -47,14 +47,16 @@ import classnames from 'classnames';
47
47
  import { throttle } from 'lodash';
48
48
  import { observer } from 'mobx-react';
49
49
  import { observable, action, computed } from 'mobx';
50
- import { Drawer as BaseDrawer } from 'antd';
51
- import screenfull from 'screenfull';
50
+ import { Drawer as BaseDrawer, Tooltip } from 'antd';
51
+ import { ConfigContext } from 'antd/es/config-provider';
52
52
  import { FullscreenExitOutlined, FullscreenOutlined } from '@qn-pandora/pandora-component-icons';
53
53
  import { doesDOMMatchSelector } from '../../utils/dom';
54
54
  import { SDK_PREFIX, ANT_PREFIX } from '../../constants/style';
55
55
  import modalPopupContainerWrapper from '../../hoc/modalPopupContainer';
56
56
  import bind from '../../utils/bind';
57
57
  import CloseIcon from './CloseIcon';
58
+ import { formatString } from '../../utils/language';
59
+ import { ModalLocale } from '../../constants/language/modal/type';
58
60
  var DEFAULT_WIDTH = '50%';
59
61
  var SMALL_WIDTH = '38%';
60
62
  var LARGE_WIDTH = '75%';
@@ -86,7 +88,9 @@ var Drawer = /** @class */ (function (_super) {
86
88
  Object.defineProperty(Drawer.prototype, "extra", {
87
89
  get: function () {
88
90
  var _a = this.props, closable = _a.closable, closeIconPlacement = _a.closeIconPlacement, showFullScreen = _a.showFullScreen;
89
- var fullIcon = showFullScreen === true ? (this.isFullscreen ? (React.createElement(FullscreenExitOutlined, { onClick: this.handleFull, className: SDK_PREFIX + "-drawer-header-full-icon" })) : (React.createElement(FullscreenOutlined, { onClick: this.handleFull, className: SDK_PREFIX + "-drawer-header-full-icon" }))) : null;
91
+ var fullIcon = showFullScreen === true ? (this.isFullscreen ? (React.createElement(Tooltip, { title: formatString(ModalLocale.exit_full, this.context.locale) },
92
+ React.createElement(FullscreenExitOutlined, { onClick: this.handleFull, className: SDK_PREFIX + "-drawer-header-full-icon" }))) : (React.createElement(Tooltip, { title: formatString(ModalLocale.full, this.context.locale) },
93
+ React.createElement(FullscreenOutlined, { onClick: this.handleFull, className: SDK_PREFIX + "-drawer-header-full-icon" })))) : null;
90
94
  if (closable !== false && closeIconPlacement === 'right') {
91
95
  return (React.createElement(React.Fragment, null,
92
96
  this.props.extra,
@@ -111,12 +115,7 @@ var Drawer = /** @class */ (function (_super) {
111
115
  this.isFullscreen = isFullscreen;
112
116
  };
113
117
  Drawer.prototype.handleFull = function () {
114
- var draw = document.querySelector("." + this.drawerId);
115
- if (!screenfull || !draw) {
116
- return;
117
- }
118
118
  this.setIsFullscreen(!this.isFullscreen);
119
- screenfull.toggle(draw);
120
119
  };
121
120
  Drawer.prototype.onMouseDown = function () {
122
121
  this.setIsResizing(true);
@@ -184,16 +183,6 @@ var Drawer = /** @class */ (function (_super) {
184
183
  };
185
184
  Drawer.prototype.componentDidMount = function () {
186
185
  document.body.addEventListener('mousedown', this.onMouseClick);
187
- var onScreenFullChange = this.props.onScreenFullChange;
188
- if (this.props.showFullScreen) {
189
- if (screenfull && onScreenFullChange) {
190
- screenfull.on('change', function () {
191
- if (screenfull) {
192
- onScreenFullChange(screenfull.isFullscreen);
193
- }
194
- });
195
- }
196
- }
197
186
  if (this.props.canDrag) {
198
187
  document.addEventListener('mousemove', this.throttleMouseMove);
199
188
  document.addEventListener('mouseup', this.onMouseUp);
@@ -215,10 +204,11 @@ var Drawer = /** @class */ (function (_super) {
215
204
  var _b = this.props, width = _b.width, className = _b.className, children = _b.children, canDrag = _b.canDrag, visible = _b.visible, closable = _b.closable, extra = _b.extra, size = _b.size, onClose = _b.onClose, other = __rest(_b, ["width", "className", "children", "canDrag", "visible", "closable", "extra", "size", "onClose"]);
216
205
  return (React.createElement(BaseDrawer, __assign({ className: classnames(this.drawerId, SDK_PREFIX + "-drawer", className, (_a = {},
217
206
  _a[SDK_PREFIX + "-drawer-no-mask"] = this.props.mask === false,
218
- _a)), width: this.realWidth || 800, zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra, closeIcon: React.createElement(CloseIcon, { className: SDK_PREFIX + "-drawer-close-icon", onClick: this.handleClose }), onClose: this.handleClose }, other),
207
+ _a)), width: this.isFullscreen ? '100%' : this.realWidth || 800, zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra, closeIcon: React.createElement(CloseIcon, { className: SDK_PREFIX + "-drawer-close-icon", onClick: this.handleClose }), onClose: this.handleClose }, other),
219
208
  canDrag && (React.createElement("div", { className: SDK_PREFIX + "-scroll-handler", onMouseDown: this.onMouseDown })),
220
209
  children));
221
210
  };
211
+ Drawer.contextType = ConfigContext;
222
212
  __decorate([
223
213
  observable,
224
214
  __metadata("design:type", Object)
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import type { TooltipPlacement } from 'antd/es/tooltip';
2
3
  /**
3
4
  * 对于超出容器宽度的名称进行省略,使用Tooltip展示。
4
5
  */
@@ -7,5 +8,6 @@ export interface INameLimiterProps {
7
8
  name: string;
8
9
  /** 用于显示Tooltip的title */
9
10
  title?: string;
11
+ placement?: TooltipPlacement;
10
12
  }
11
- export default function NameLimiter({ name, title }: INameLimiterProps): JSX.Element;
13
+ export default function NameLimiter({ name, title, placement }: INameLimiterProps): JSX.Element;
@@ -18,7 +18,7 @@ import React, { useLayoutEffect, useRef, useState } from 'react';
18
18
  import { Tooltip } from 'antd';
19
19
  import { SDK_PREFIX } from '../../constants/style';
20
20
  export default function NameLimiter(_a) {
21
- var name = _a.name, title = _a.title;
21
+ var name = _a.name, title = _a.title, placement = _a.placement;
22
22
  var _b = __read(useState(false), 2), ellipsis = _b[0], setEllipsis = _b[1];
23
23
  var _c = __read(useState(false), 2), visible = _c[0], setVisible = _c[1];
24
24
  var ref = useRef(null);
@@ -29,6 +29,6 @@ export default function NameLimiter(_a) {
29
29
  }
30
30
  setEllipsis(ref.current.clientWidth < ref.current.scrollWidth);
31
31
  });
32
- return (React.createElement(Tooltip, { overlayClassName: SDK_PREFIX + "-name-limit-tooltip", placement: "top", title: title || name, visible: (!!title || ellipsis) && visible, onVisibleChange: setVisible },
32
+ return (React.createElement(Tooltip, { overlayClassName: SDK_PREFIX + "-name-limit-tooltip", placement: placement || 'top', title: title || name, visible: (!!title || ellipsis) && visible, onVisibleChange: setVisible },
33
33
  React.createElement("span", { className: SDK_PREFIX + "-name-limit", ref: ref }, name)));
34
34
  }
@@ -1,3 +1,5 @@
1
1
  export var modal_en = {
2
- close_tooltip: 'close modal'
2
+ close_tooltip: 'close modal',
3
+ full: 'Full',
4
+ exit_full: 'Exit Full Screen'
3
5
  };
@@ -1,4 +1,6 @@
1
1
  export interface IModalLocale {
2
2
  close_tooltip: string;
3
+ full: string;
4
+ exit_full: string;
3
5
  }
4
6
  export declare const ModalLocale: IModalLocale;
@@ -1,3 +1,5 @@
1
1
  export var modal_zh = {
2
- close_tooltip: '关闭弹窗'
2
+ close_tooltip: '关闭弹窗',
3
+ full: '全屏',
4
+ exit_full: '退出全屏'
3
5
  };