@qn-pandora/pandora-component 4.0.5 → 4.0.7

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,52 @@
1
1
  {
2
2
  "name": "@qn-pandora/pandora-component",
3
3
  "entries": [
4
+ {
5
+ "version": "4.0.7",
6
+ "tag": "@qn-pandora/pandora-component_v4.0.7",
7
+ "date": "Thu, 23 Mar 2023 07:12:05 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "2023.03.23发布"
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.0.9` to `^3.0.10`"
17
+ },
18
+ {
19
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.0.9` to `^3.0.10`"
20
+ },
21
+ {
22
+ "comment": "Updating dependency \"@qn-pandora/pandora-tools\" from `^2.0.8` to `^2.0.9`"
23
+ }
24
+ ]
25
+ }
26
+ },
27
+ {
28
+ "version": "4.0.6",
29
+ "tag": "@qn-pandora/pandora-component_v4.0.6",
30
+ "date": "Mon, 13 Mar 2023 11:30:17 GMT",
31
+ "comments": {
32
+ "patch": [
33
+ {
34
+ "comment": "2023.03.13发布"
35
+ }
36
+ ],
37
+ "dependency": [
38
+ {
39
+ "comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.0.8` to `^3.0.9`"
40
+ },
41
+ {
42
+ "comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.0.8` to `^3.0.9`"
43
+ },
44
+ {
45
+ "comment": "Updating dependency \"@qn-pandora/pandora-tools\" from `^2.0.7` to `^2.0.8`"
46
+ }
47
+ ]
48
+ }
49
+ },
4
50
  {
5
51
  "version": "4.0.5",
6
52
  "tag": "@qn-pandora/pandora-component_v4.0.5",
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, 15 Feb 2023 09:26:50 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 23 Mar 2023 07:12:05 GMT and should not be manually modified.
4
+
5
+ ## 4.0.7
6
+
7
+ Thu, 23 Mar 2023 07:12:05 GMT
8
+
9
+ ### Patches
10
+
11
+ - 2023.03.23 发布
12
+
13
+ ## 4.0.6
14
+
15
+ Mon, 13 Mar 2023 11:30:17 GMT
16
+
17
+ ### Patches
18
+
19
+ - 2023.03.13 发布
4
20
 
5
21
  ## 4.0.5
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;
@@ -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),