@qn-pandora/pandora-component 4.3.0 → 4.3.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@qn-pandora/pandora-component",
3
3
  "entries": [
4
+ {
5
+ "version": "4.3.1",
6
+ "tag": "@qn-pandora/pandora-component_v4.3.1",
7
+ "date": "Mon, 30 Oct 2023 08:56:57 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "2023-10-30发包"
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.3.0` to `^3.3.1`"
17
+ },
18
+ {
19
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.3.0` to `^3.3.1`"
20
+ }
21
+ ]
22
+ }
23
+ },
4
24
  {
5
25
  "version": "4.3.0",
6
26
  "tag": "@qn-pandora/pandora-component_v4.3.0",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
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 Mon, 30 Oct 2023 08:56:57 GMT and should not be manually modified.
4
+
5
+ ## 4.3.1
6
+ Mon, 30 Oct 2023 08:56:57 GMT
7
+
8
+ ### Patches
9
+
10
+ - 2023-10-30发包
4
11
 
5
12
  ## 4.3.0
6
13
  Tue, 24 Oct 2023 08:06:30 GMT
@@ -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,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
  };
package/es/index.css CHANGED
@@ -13202,6 +13202,12 @@ textarea.ant-pagination-options-quick-jumper input {
13202
13202
  .pandora-sdk-tree-select-dropdown .ant-empty {
13203
13203
  text-align: center;
13204
13204
  }
13205
+ .pandora-sdk-card-search-input {
13206
+ min-width: 200px;
13207
+ }
13208
+ .pandora-sdk-card-search-input i {
13209
+ color: #bfbfbf;
13210
+ }
13205
13211
  .ant-row {
13206
13212
  display: -webkit-box;
13207
13213
  display: -ms-flexbox;
@@ -19091,12 +19097,6 @@ textarea.ant-pagination-options-quick-jumper input {
19091
19097
  .pandora-sdk-card-row-extra button {
19092
19098
  min-width: 80px;
19093
19099
  }
19094
- .pandora-sdk-card-search-input {
19095
- min-width: 200px;
19096
- }
19097
- .pandora-sdk-card-search-input i {
19098
- color: #bfbfbf;
19099
- }
19100
19100
  .ant-picker {
19101
19101
  -webkit-box-sizing: border-box;
19102
19102
  box-sizing: border-box;
package/es/index.less CHANGED
@@ -32,8 +32,8 @@
32
32
  @import './components/Timeline/style.less';
33
33
  @import './components/Transfer/style.less';
34
34
  @import './components/TreeSelector/style.less';
35
- @import './components/Card/RowExtra/style.less';
36
35
  @import './components/Card/SearchInput/style.less';
36
+ @import './components/Card/RowExtra/style.less';
37
37
  @import './components/DateTimePicker/Base/style.less';
38
38
  @import './components/DateTimePicker/BaseMobile/style.less';
39
39
  @import './components/DateTimePicker/DisplayInput/style.less';
@@ -391,6 +391,7 @@
391
391
  @close-icon-hover-color: #f4f5f6;
392
392
 
393
393
  @agent-markdown-scorll-bar-color: #c9cdd4;
394
+ @agent-scene-icon-color: #c9cdd4;
394
395
  @agent-markdown-header-background-color: rgb(52, 53, 65);
395
396
  @agent-box-shadow-color: rgba(53, 53, 53, 0.07);
396
397
  @agent-cursor-color: #282828;
@@ -398,8 +399,12 @@
398
399
  @agent-example-desc-color: #595959;
399
400
  @agent-input-border-color: #e9e9e9;
400
401
  @agent-border-color: #e8e8e8;
402
+ @agent-scene-name-color: #86909c;
401
403
  @background-color-fa: #fafafa;
402
404
  @background-color-f5: #f5f5f5;
403
405
  @background-color-f4: #f4f5f6;
404
406
  @background-linear-color: rgba(244, 245, 246, 0);
405
407
  @background-color-e2: #e2e4e6;
408
+ @color-error-bg: #fff2f0;
409
+ @color-error: #fd4345;
410
+ @agent-scene-background-color: rgba(0, 0, 0, 0.06);
@@ -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>;
@@ -20,8 +20,8 @@ var language_1 = require("../../../utils/language");
20
20
  var type_1 = require("../../../constants/language/modal/type");
21
21
  exports.CloseIcon = function (props) {
22
22
  var locale = react_1.useContext(config_provider_1.ConfigContext).locale;
23
- var className = props.className, onClick = props.onClick;
24
- return (react_1.default.createElement(antd_1.Tooltip, { title: language_1.formatString(type_1.ModalLocale.close_tooltip, locale) },
23
+ var className = props.className, onClick = props.onClick, getPopupContainer = props.getPopupContainer;
24
+ return (react_1.default.createElement(antd_1.Tooltip, { title: language_1.formatString(type_1.ModalLocale.close_tooltip, locale), getPopupContainer: getPopupContainer },
25
25
  react_1.default.createElement(pandora_component_icons_1.Close, { className: classnames_1.default(style_1.SDK_PREFIX + "-modal-close-icon", className), onClick: onClick })));
26
26
  };
27
27
  exports.default = exports.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;
@@ -53,13 +53,15 @@ var lodash_1 = require("lodash");
53
53
  var mobx_react_1 = require("mobx-react");
54
54
  var mobx_1 = require("mobx");
55
55
  var antd_1 = require("antd");
56
- var screenfull_1 = __importDefault(require("screenfull"));
56
+ var config_provider_1 = require("antd/es/config-provider");
57
57
  var pandora_component_icons_1 = require("@qn-pandora/pandora-component-icons");
58
58
  var dom_1 = require("../../utils/dom");
59
59
  var style_1 = require("../../constants/style");
60
60
  var modalPopupContainer_1 = __importDefault(require("../../hoc/modalPopupContainer"));
61
61
  var bind_1 = __importDefault(require("../../utils/bind"));
62
62
  var CloseIcon_1 = __importDefault(require("./CloseIcon"));
63
+ var language_1 = require("../../utils/language");
64
+ var type_1 = require("../../constants/language/modal/type");
63
65
  var DEFAULT_WIDTH = '50%';
64
66
  var SMALL_WIDTH = '38%';
65
67
  var LARGE_WIDTH = '75%';
@@ -91,7 +93,9 @@ var Drawer = /** @class */ (function (_super) {
91
93
  Object.defineProperty(Drawer.prototype, "extra", {
92
94
  get: function () {
93
95
  var _a = this.props, closable = _a.closable, closeIconPlacement = _a.closeIconPlacement, showFullScreen = _a.showFullScreen;
94
- var fullIcon = showFullScreen === true ? (this.isFullscreen ? (react_1.default.createElement(pandora_component_icons_1.FullscreenExitOutlined, { onClick: this.handleFull, className: style_1.SDK_PREFIX + "-drawer-header-full-icon" })) : (react_1.default.createElement(pandora_component_icons_1.FullscreenOutlined, { onClick: this.handleFull, className: style_1.SDK_PREFIX + "-drawer-header-full-icon" }))) : null;
96
+ var fullIcon = showFullScreen === true ? (this.isFullscreen ? (react_1.default.createElement(antd_1.Tooltip, { title: language_1.formatString(type_1.ModalLocale.exit_full, this.context.locale) },
97
+ react_1.default.createElement(pandora_component_icons_1.FullscreenExitOutlined, { onClick: this.handleFull, className: style_1.SDK_PREFIX + "-drawer-header-full-icon" }))) : (react_1.default.createElement(antd_1.Tooltip, { title: language_1.formatString(type_1.ModalLocale.full, this.context.locale) },
98
+ react_1.default.createElement(pandora_component_icons_1.FullscreenOutlined, { onClick: this.handleFull, className: style_1.SDK_PREFIX + "-drawer-header-full-icon" })))) : null;
95
99
  if (closable !== false && closeIconPlacement === 'right') {
96
100
  return (react_1.default.createElement(react_1.default.Fragment, null,
97
101
  this.props.extra,
@@ -116,12 +120,7 @@ var Drawer = /** @class */ (function (_super) {
116
120
  this.isFullscreen = isFullscreen;
117
121
  };
118
122
  Drawer.prototype.handleFull = function () {
119
- var draw = document.querySelector("." + this.drawerId);
120
- if (!screenfull_1.default || !draw) {
121
- return;
122
- }
123
123
  this.setIsFullscreen(!this.isFullscreen);
124
- screenfull_1.default.toggle(draw);
125
124
  };
126
125
  Drawer.prototype.onMouseDown = function () {
127
126
  this.setIsResizing(true);
@@ -189,16 +188,6 @@ var Drawer = /** @class */ (function (_super) {
189
188
  };
190
189
  Drawer.prototype.componentDidMount = function () {
191
190
  document.body.addEventListener('mousedown', this.onMouseClick);
192
- var onScreenFullChange = this.props.onScreenFullChange;
193
- if (this.props.showFullScreen) {
194
- if (screenfull_1.default && onScreenFullChange) {
195
- screenfull_1.default.on('change', function () {
196
- if (screenfull_1.default) {
197
- onScreenFullChange(screenfull_1.default.isFullscreen);
198
- }
199
- });
200
- }
201
- }
202
191
  if (this.props.canDrag) {
203
192
  document.addEventListener('mousemove', this.throttleMouseMove);
204
193
  document.addEventListener('mouseup', this.onMouseUp);
@@ -220,10 +209,11 @@ var Drawer = /** @class */ (function (_super) {
220
209
  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"]);
221
210
  return (react_1.default.createElement(antd_1.Drawer, __assign({ className: classnames_1.default(this.drawerId, style_1.SDK_PREFIX + "-drawer", className, (_a = {},
222
211
  _a[style_1.SDK_PREFIX + "-drawer-no-mask"] = this.props.mask === false,
223
- _a)), width: this.realWidth || 800, zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra, closeIcon: react_1.default.createElement(CloseIcon_1.default, { className: style_1.SDK_PREFIX + "-drawer-close-icon", onClick: this.handleClose }), onClose: this.handleClose }, other),
212
+ _a)), width: this.isFullscreen ? '100%' : this.realWidth || 800, zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra, closeIcon: react_1.default.createElement(CloseIcon_1.default, { className: style_1.SDK_PREFIX + "-drawer-close-icon", onClick: this.handleClose }), onClose: this.handleClose }, other),
224
213
  canDrag && (react_1.default.createElement("div", { className: style_1.SDK_PREFIX + "-scroll-handler", onMouseDown: this.onMouseDown })),
225
214
  children));
226
215
  };
216
+ Drawer.contextType = config_provider_1.ConfigContext;
227
217
  __decorate([
228
218
  mobx_1.observable,
229
219
  __metadata("design:type", Object)
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.modal_en = {
4
- close_tooltip: 'close modal'
4
+ close_tooltip: 'close modal',
5
+ full: 'Full',
6
+ exit_full: 'Exit Full Screen'
5
7
  };
@@ -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,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.modal_zh = {
4
- close_tooltip: '关闭弹窗'
4
+ close_tooltip: '关闭弹窗',
5
+ full: '全屏',
6
+ exit_full: '退出全屏'
5
7
  };