@zohodesk/components 1.5.3 → 1.5.4
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/README.md +5 -0
- package/es/Tag/Tag.js +5 -2
- package/es/Tag/props/propTypes.js +2 -0
- package/lib/Tag/Tag.js +6 -2
- package/lib/Tag/props/propTypes.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development across projects.
|
|
4
4
|
|
|
5
|
+
# 1.5.4
|
|
6
|
+
|
|
7
|
+
- **Tag**
|
|
8
|
+
- Added support for rendering left & right custom children using `renderLeftChildren`,`renderRightChildren` prop.
|
|
9
|
+
|
|
5
10
|
# 1.5.3
|
|
6
11
|
|
|
7
12
|
- **CheckBox, Radio**
|
package/es/Tag/Tag.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { defaultProps } from "./props/defaultProps";
|
|
3
3
|
import { propTypes } from "./props/propTypes";
|
|
4
|
+
import { renderNode } from '@zohodesk/utils';
|
|
4
5
|
import { Icon } from '@zohodesk/icons';
|
|
5
6
|
import Avatar from "../Avatar/Avatar";
|
|
6
7
|
import { Container } from "../Layout";
|
|
@@ -84,6 +85,8 @@ export default class Tag extends PureComponent {
|
|
|
84
85
|
a11y,
|
|
85
86
|
needEffect,
|
|
86
87
|
isReadOnly,
|
|
88
|
+
renderLeftChildren,
|
|
89
|
+
renderRightChildren,
|
|
87
90
|
customProps
|
|
88
91
|
} = this.props;
|
|
89
92
|
const {
|
|
@@ -113,7 +116,7 @@ export default class Tag extends PureComponent {
|
|
|
113
116
|
"aria-labelledby": getAriaId,
|
|
114
117
|
"data-selector-id": dataSelectorId,
|
|
115
118
|
...customAttributes
|
|
116
|
-
}, hasAvatar ? /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
}, renderNode(renderLeftChildren), hasAvatar ? /*#__PURE__*/React.createElement("div", {
|
|
117
120
|
className: style.avatar
|
|
118
121
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
119
122
|
palette: isDarkPalette ? 'info' : avatarPalette,
|
|
@@ -150,7 +153,7 @@ export default class Tag extends PureComponent {
|
|
|
150
153
|
isBold: true,
|
|
151
154
|
name: "ZD-close2",
|
|
152
155
|
size: "8"
|
|
153
|
-
}))));
|
|
156
|
+
}))), renderNode(renderRightChildren));
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
}
|
|
@@ -35,6 +35,8 @@ export const propTypes = {
|
|
|
35
35
|
needEffect: PropTypes.bool,
|
|
36
36
|
isReadOnly: PropTypes.bool,
|
|
37
37
|
dataSelectorId: PropTypes.string,
|
|
38
|
+
renderLeftChildren: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
39
|
+
renderRightChildren: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
38
40
|
customProps: PropTypes.shape({
|
|
39
41
|
avatarProps: PropTypes.exact(AvatarPropTypes),
|
|
40
42
|
iconProps: PropTypes.exact(IconPropTypes)
|
package/lib/Tag/Tag.js
CHANGED
|
@@ -13,6 +13,8 @@ var _defaultProps = require("./props/defaultProps");
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = require("./props/propTypes");
|
|
15
15
|
|
|
16
|
+
var _utils = require("@zohodesk/utils");
|
|
17
|
+
|
|
16
18
|
var _icons = require("@zohodesk/icons");
|
|
17
19
|
|
|
18
20
|
var _Avatar = _interopRequireDefault(require("../Avatar/Avatar"));
|
|
@@ -141,6 +143,8 @@ var Tag = /*#__PURE__*/function (_PureComponent) {
|
|
|
141
143
|
a11y = _this$props4.a11y,
|
|
142
144
|
needEffect = _this$props4.needEffect,
|
|
143
145
|
isReadOnly = _this$props4.isReadOnly,
|
|
146
|
+
renderLeftChildren = _this$props4.renderLeftChildren,
|
|
147
|
+
renderRightChildren = _this$props4.renderRightChildren,
|
|
144
148
|
customProps = _this$props4.customProps;
|
|
145
149
|
var _customProps$avatarPr = customProps.avatarProps,
|
|
146
150
|
avatarProps = _customProps$avatarPr === void 0 ? {} : _customProps$avatarPr,
|
|
@@ -169,7 +173,7 @@ var Tag = /*#__PURE__*/function (_PureComponent) {
|
|
|
169
173
|
tabIndex: disabled ? '-1' : '0',
|
|
170
174
|
"aria-labelledby": getAriaId,
|
|
171
175
|
"data-selector-id": dataSelectorId
|
|
172
|
-
}, customAttributes), hasAvatar ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
176
|
+
}, customAttributes), (0, _utils.renderNode)(renderLeftChildren), hasAvatar ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
173
177
|
className: _TagModule["default"].avatar
|
|
174
178
|
}, /*#__PURE__*/_react["default"].createElement(_Avatar["default"], _extends({
|
|
175
179
|
palette: isDarkPalette ? 'info' : avatarPalette,
|
|
@@ -202,7 +206,7 @@ var Tag = /*#__PURE__*/function (_PureComponent) {
|
|
|
202
206
|
isBold: true,
|
|
203
207
|
name: "ZD-close2",
|
|
204
208
|
size: "8"
|
|
205
|
-
}))));
|
|
209
|
+
}))), (0, _utils.renderNode)(renderRightChildren));
|
|
206
210
|
}
|
|
207
211
|
}]);
|
|
208
212
|
|
|
@@ -47,6 +47,8 @@ var propTypes = {
|
|
|
47
47
|
needEffect: _propTypes["default"].bool,
|
|
48
48
|
isReadOnly: _propTypes["default"].bool,
|
|
49
49
|
dataSelectorId: _propTypes["default"].string,
|
|
50
|
+
renderLeftChildren: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].func]),
|
|
51
|
+
renderRightChildren: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].func]),
|
|
50
52
|
customProps: _propTypes["default"].shape({
|
|
51
53
|
avatarProps: _propTypes["default"].exact(_propTypes2.propTypes),
|
|
52
54
|
iconProps: _propTypes["default"].exact(_propTypes3.IconProps)
|