@hi-ui/tag-input 4.0.8 → 4.0.10
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.md +34 -0
- package/lib/cjs/TagInput.js +32 -22
- package/lib/cjs/TagInputMock.js +27 -16
- package/lib/cjs/use-tag-input.js +3 -0
- package/lib/esm/TagInput.js +12 -12
- package/lib/esm/TagInputMock.js +9 -9
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,39 @@
|
|
1
1
|
# @hi-ui/tag-input
|
2
2
|
|
3
|
+
## 4.0.10
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- build: rollup2 构建
|
8
|
+
- Updated dependencies
|
9
|
+
- @hi-ui/core@4.0.8
|
10
|
+
- @hi-ui/use-latest@4.0.4
|
11
|
+
- @hi-ui/use-merge-refs@4.0.4
|
12
|
+
- @hi-ui/use-outside-click@4.0.4
|
13
|
+
- @hi-ui/use-uncontrolled-state@4.0.4
|
14
|
+
- @hi-ui/icons@4.0.18
|
15
|
+
- @hi-ui/classname@4.0.4
|
16
|
+
- @hi-ui/env@4.0.4
|
17
|
+
- @hi-ui/func-utils@4.0.4
|
18
|
+
- @hi-ui/type-assertion@4.0.4
|
19
|
+
|
20
|
+
## 4.0.9
|
21
|
+
|
22
|
+
### Patch Changes
|
23
|
+
|
24
|
+
- fix: 修复 rollup3 打包 cjs 模块问题
|
25
|
+
- Updated dependencies
|
26
|
+
- @hi-ui/env@4.0.3
|
27
|
+
- @hi-ui/core@4.0.7
|
28
|
+
- @hi-ui/use-latest@4.0.3
|
29
|
+
- @hi-ui/use-merge-refs@4.0.3
|
30
|
+
- @hi-ui/use-outside-click@4.0.3
|
31
|
+
- @hi-ui/use-uncontrolled-state@4.0.3
|
32
|
+
- @hi-ui/icons@4.0.17
|
33
|
+
- @hi-ui/classname@4.0.3
|
34
|
+
- @hi-ui/func-utils@4.0.3
|
35
|
+
- @hi-ui/type-assertion@4.0.3
|
36
|
+
|
3
37
|
## 4.0.8
|
4
38
|
|
5
39
|
### Patch Changes
|
package/lib/cjs/TagInput.js
CHANGED
@@ -9,6 +9,10 @@
|
|
9
9
|
*/
|
10
10
|
'use strict';
|
11
11
|
|
12
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
13
|
+
Object.defineProperty(exports, '__esModule', {
|
14
|
+
value: true
|
15
|
+
});
|
12
16
|
var tslib = require('tslib');
|
13
17
|
var React = require('react');
|
14
18
|
var classname = require('@hi-ui/classname');
|
@@ -19,6 +23,12 @@ var useMergeRefs = require('@hi-ui/use-merge-refs');
|
|
19
23
|
var useTagInput = require('./use-tag-input.js');
|
20
24
|
var useOutsideClick = require('@hi-ui/use-outside-click');
|
21
25
|
var useLatest = require('@hi-ui/use-latest');
|
26
|
+
function _interopDefaultLegacy(e) {
|
27
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
28
|
+
'default': e
|
29
|
+
};
|
30
|
+
}
|
31
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
22
32
|
var _role = 'tag-input';
|
23
33
|
var _prefix = classname.getPrefixCls(_role);
|
24
34
|
var NOOP_ARRAY = [];
|
@@ -96,7 +106,7 @@ var TagInput = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
96
106
|
setExpanded(true);
|
97
107
|
}, []);
|
98
108
|
var cls = classname.cx(prefixCls, className, expanded ? prefixCls + "--expanded" : wrap ? prefixCls + "--wrap" : prefixCls + "--nowrap");
|
99
|
-
return /*#__PURE__*/
|
109
|
+
return /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
100
110
|
ref: useMergeRefs.useMergeRefs(ref, tagInputRef),
|
101
111
|
role: role,
|
102
112
|
className: cls,
|
@@ -108,25 +118,25 @@ var TagInput = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
108
118
|
trySetHover(false);
|
109
119
|
_onMouseLeave === null || _onMouseLeave === void 0 ? void 0 : _onMouseLeave(evt);
|
110
120
|
}
|
111
|
-
}, rest), /*#__PURE__*/
|
121
|
+
}, rest), /*#__PURE__*/React__default["default"].createElement("div", {
|
112
122
|
className: classname.cx(prefixCls + "__container", disabled && 'disabled'),
|
113
123
|
onClick: onClick
|
114
|
-
}, value.length !== 0 ? /*#__PURE__*/
|
124
|
+
}, value.length !== 0 ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
115
125
|
className: prefixCls + "__value"
|
116
|
-
}, /*#__PURE__*/
|
126
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
117
127
|
className: classname.cx(prefixCls + "__tags", wrap && prefixCls + "__tags--all")
|
118
128
|
}, tagList.map(function (option) {
|
119
129
|
var title = displayRender ? displayRender(option) : true;
|
120
130
|
var closeable = !option.disabled;
|
121
|
-
return /*#__PURE__*/
|
131
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
122
132
|
className: prefixCls + "__tag",
|
123
133
|
key: option.id
|
124
|
-
}, /*#__PURE__*/
|
134
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
125
135
|
className: prefixCls + "__tag-content",
|
126
136
|
style: {
|
127
137
|
maxWidth: tagMaxWidth
|
128
138
|
}
|
129
|
-
}, title === true ? option.title : title), closeable ? /*#__PURE__*/
|
139
|
+
}, title === true ? option.title : title), closeable ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
130
140
|
className: prefixCls + "__tag-closed",
|
131
141
|
onClick: function onClick(evt) {
|
132
142
|
if (disabled) return;
|
@@ -136,37 +146,37 @@ var TagInput = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
136
146
|
});
|
137
147
|
tryChangeValue(nextValue, [option], false);
|
138
148
|
}
|
139
|
-
}, /*#__PURE__*/
|
140
|
-
}))) : /*#__PURE__*/
|
149
|
+
}, /*#__PURE__*/React__default["default"].createElement(icons.CloseOutlined, null))) : null);
|
150
|
+
})))) : ( /*#__PURE__*/React__default["default"].createElement("span", {
|
141
151
|
className: prefixCls + "__placeholder"
|
142
|
-
}, placeholder), !!suffix || showClearableIcon && hover || showTagCount ? /*#__PURE__*/
|
152
|
+
}, placeholder)), !!suffix || showClearableIcon && hover || showTagCount ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
143
153
|
className: prefixCls + "__suffix"
|
144
|
-
}, showTagCount ? /*#__PURE__*/
|
154
|
+
}, showTagCount ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
145
155
|
className: classname.cx(prefixCls + "__tag--total"),
|
146
156
|
onClick: handleExpand
|
147
|
-
}, "" + (tagCount > 99 ? '+99' : tagCount)) : showClearableIcon && hover ? /*#__PURE__*/
|
157
|
+
}, "" + (tagCount > 99 ? '+99' : tagCount))) : showClearableIcon && hover ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
148
158
|
className: prefixCls + "__clear",
|
149
159
|
role: "button",
|
150
160
|
tabIndex: -1,
|
151
161
|
onClick: handleClear
|
152
|
-
}, /*#__PURE__*/
|
162
|
+
}, /*#__PURE__*/React__default["default"].createElement(icons.CloseCircleFilled, null))) : null, suffix)) : null), value.length !== 0 && expanded ? ( /*#__PURE__*/React__default["default"].createElement("div", {
|
153
163
|
className: prefixCls + "__container__expand"
|
154
|
-
}, /*#__PURE__*/
|
164
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
155
165
|
className: classname.cx(prefixCls + "__value")
|
156
|
-
}, /*#__PURE__*/
|
166
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
157
167
|
className: classname.cx(prefixCls + "__tags", prefixCls + "__tags--all")
|
158
168
|
}, tagList.map(function (option) {
|
159
169
|
var title = displayRender ? displayRender(option) : true;
|
160
170
|
var closeable = !option.disabled;
|
161
|
-
return /*#__PURE__*/
|
171
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
162
172
|
className: prefixCls + "__tag",
|
163
173
|
key: option.id
|
164
|
-
}, /*#__PURE__*/
|
174
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
165
175
|
className: prefixCls + "__tag-content",
|
166
176
|
style: {
|
167
177
|
maxWidth: tagMaxWidth
|
168
178
|
}
|
169
|
-
}, title === true ? option.title : title), closeable ? /*#__PURE__*/
|
179
|
+
}, title === true ? option.title : title), closeable ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
170
180
|
className: prefixCls + "__tag-closed",
|
171
181
|
onClick: function onClick(evt) {
|
172
182
|
if (disabled) return;
|
@@ -176,15 +186,15 @@ var TagInput = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
176
186
|
});
|
177
187
|
tryChangeValue(nextValue);
|
178
188
|
}
|
179
|
-
}, /*#__PURE__*/
|
180
|
-
}))), showClearableIcon ? /*#__PURE__*/
|
189
|
+
}, /*#__PURE__*/React__default["default"].createElement(icons.CloseOutlined, null))) : null);
|
190
|
+
}))), showClearableIcon ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
181
191
|
className: prefixCls + "__suffix"
|
182
|
-
}, /*#__PURE__*/
|
192
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
183
193
|
className: prefixCls + "__clear",
|
184
194
|
role: "button",
|
185
195
|
tabIndex: -1,
|
186
196
|
onClick: handleClear
|
187
|
-
}, /*#__PURE__*/
|
197
|
+
}, /*#__PURE__*/React__default["default"].createElement(icons.CloseCircleFilled, null)))) : null)) : null);
|
188
198
|
});
|
189
199
|
if (env.__DEV__) {
|
190
200
|
TagInput.displayName = 'TagInput';
|
package/lib/cjs/TagInputMock.js
CHANGED
@@ -9,6 +9,10 @@
|
|
9
9
|
*/
|
10
10
|
'use strict';
|
11
11
|
|
12
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
13
|
+
Object.defineProperty(exports, '__esModule', {
|
14
|
+
value: true
|
15
|
+
});
|
12
16
|
var tslib = require('tslib');
|
13
17
|
var React = require('react');
|
14
18
|
var classname = require('@hi-ui/classname');
|
@@ -18,6 +22,13 @@ var icons = require('@hi-ui/icons');
|
|
18
22
|
var useLatest = require('@hi-ui/use-latest');
|
19
23
|
var typeAssertion = require('@hi-ui/type-assertion');
|
20
24
|
var ResizeDetector = require('react-resize-detector');
|
25
|
+
function _interopDefaultLegacy(e) {
|
26
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
27
|
+
'default': e
|
28
|
+
};
|
29
|
+
}
|
30
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
31
|
+
var ResizeDetector__default = /*#__PURE__*/_interopDefaultLegacy(ResizeDetector);
|
21
32
|
var _role = 'tag-input-mock';
|
22
33
|
var _prefix = classname.getPrefixCls(_role);
|
23
34
|
var NOOP_ARRAY = [];
|
@@ -157,14 +168,14 @@ var TagInputMock = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
157
168
|
var showClearableIcon = clearable && showTags && !disabled;
|
158
169
|
var maxTagWidth = containerWidth - suffixWidth;
|
159
170
|
var cls = classname.cx(prefixCls, className, prefixCls + "--appearance-" + appearance, prefixCls + "--size-" + size, focused && "focused", readOnly && 'readonly', invalid && 'invalid', disabled && prefixCls + "--disabled", wrap && prefixCls + "--wrap", expandable && prefixCls + "--expandable");
|
160
|
-
return /*#__PURE__*/
|
171
|
+
return /*#__PURE__*/React__default["default"].createElement(ResizeDetector__default["default"], {
|
161
172
|
skipOnMount: false,
|
162
173
|
onResize: function onResize(w) {
|
163
174
|
if (w) {
|
164
175
|
setContainerWidth(w);
|
165
176
|
}
|
166
177
|
}
|
167
|
-
}, /*#__PURE__*/
|
178
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
168
179
|
ref: ref,
|
169
180
|
role: role,
|
170
181
|
className: cls,
|
@@ -176,10 +187,10 @@ var TagInputMock = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
176
187
|
trySetHover(false);
|
177
188
|
_onMouseLeave === null || _onMouseLeave === void 0 ? void 0 : _onMouseLeave(evt);
|
178
189
|
}
|
179
|
-
}, rest), showTags ? /*#__PURE__*/
|
190
|
+
}, rest), showTags ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
180
191
|
className: prefixCls + "__tags"
|
181
192
|
}, mergedTagList.map(function (option, index) {
|
182
|
-
return /*#__PURE__*/
|
193
|
+
return /*#__PURE__*/React__default["default"].createElement(MockTag, {
|
183
194
|
hidden: wrap ? false : index > tagMaxCount,
|
184
195
|
maxWidth: maxTagWidth,
|
185
196
|
key: option.id,
|
@@ -196,26 +207,26 @@ var TagInputMock = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
196
207
|
});
|
197
208
|
}
|
198
209
|
});
|
199
|
-
})) : /*#__PURE__*/
|
210
|
+
}))) : ( /*#__PURE__*/React__default["default"].createElement("span", {
|
200
211
|
className: prefixCls + "__placeholder"
|
201
|
-
}, placeholder), /*#__PURE__*/
|
212
|
+
}, placeholder)), /*#__PURE__*/React__default["default"].createElement(ResizeDetector__default["default"], {
|
202
213
|
skipOnMount: false,
|
203
214
|
onResize: function onResize(w) {
|
204
215
|
if (w) {
|
205
216
|
setSuffixWidth(w);
|
206
217
|
}
|
207
218
|
}
|
208
|
-
}, !!suffix || showClearableIcon && hover || showTagCount ? /*#__PURE__*/
|
219
|
+
}, !!suffix || showClearableIcon && hover || showTagCount ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
209
220
|
className: prefixCls + "__suffix"
|
210
|
-
}, showTagCount ? /*#__PURE__*/
|
221
|
+
}, showTagCount ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
211
222
|
className: classname.cx(prefixCls + "__tag--total", activeExpandable && prefixCls + "__tag--active"),
|
212
223
|
onClick: onExpand
|
213
|
-
}, "" + (tagCount > 99 ? '99+' : tagCount)) : null, showClearableIcon && hover ? /*#__PURE__*/
|
224
|
+
}, "" + (tagCount > 99 ? '99+' : tagCount))) : null, showClearableIcon && hover ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
214
225
|
className: prefixCls + "__clear",
|
215
226
|
role: "button",
|
216
227
|
tabIndex: -1,
|
217
228
|
onClick: handleClear
|
218
|
-
}, /*#__PURE__*/
|
229
|
+
}, /*#__PURE__*/React__default["default"].createElement(icons.CloseCircleFilled, null))) : suffix)) : null)));
|
219
230
|
});
|
220
231
|
if (env.__DEV__) {
|
221
232
|
TagInputMock.displayName = 'TagInputMock';
|
@@ -241,7 +252,7 @@ function MockTag(_ref) {
|
|
241
252
|
hidden = _ref$hidden === void 0 ? false : _ref$hidden;
|
242
253
|
var title = typeAssertion.isFunction(displayRender) ? displayRender(option) : true;
|
243
254
|
var closeable = !option.disabled;
|
244
|
-
return /*#__PURE__*/
|
255
|
+
return /*#__PURE__*/React__default["default"].createElement(ResizeDetector__default["default"], {
|
245
256
|
skipOnMount: false,
|
246
257
|
onResize: function onResize(width) {
|
247
258
|
// 隐藏后就不允许设置 tagSize,避免无限循环触发“宽度计算响应式策略”
|
@@ -250,20 +261,20 @@ function MockTag(_ref) {
|
|
250
261
|
onTagResize(option.id, width);
|
251
262
|
}
|
252
263
|
}
|
253
|
-
}, /*#__PURE__*/
|
264
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
254
265
|
style: {
|
255
266
|
display: 'inline-block',
|
256
267
|
verticalAlign: 'middle'
|
257
268
|
}
|
258
|
-
}, /*#__PURE__*/
|
269
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
259
270
|
className: prefixCls + "__tag",
|
260
271
|
style: hidden ? hiddenStyle : {
|
261
272
|
maxWidth: maxWidth
|
262
273
|
},
|
263
274
|
key: option.id
|
264
|
-
}, /*#__PURE__*/
|
275
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
265
276
|
className: prefixCls + "__tag-content"
|
266
|
-
}, title === true ? option.title : title), closeable ? /*#__PURE__*/
|
277
|
+
}, title === true ? option.title : title), closeable ? ( /*#__PURE__*/React__default["default"].createElement("span", {
|
267
278
|
className: prefixCls + "__tag-closed",
|
268
279
|
onClick: function onClick(evt) {
|
269
280
|
if (disabled) return;
|
@@ -273,6 +284,6 @@ function MockTag(_ref) {
|
|
273
284
|
});
|
274
285
|
tryChangeValue(nextValue, [option], false);
|
275
286
|
}
|
276
|
-
}, /*#__PURE__*/
|
287
|
+
}, /*#__PURE__*/React__default["default"].createElement(icons.CloseOutlined, null))) : null)));
|
277
288
|
}
|
278
289
|
exports.TagInputMock = TagInputMock;
|
package/lib/cjs/use-tag-input.js
CHANGED
package/lib/esm/TagInput.js
CHANGED
@@ -109,7 +109,7 @@ var TagInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
109
109
|
}, rest), /*#__PURE__*/React.createElement("div", {
|
110
110
|
className: cx(prefixCls + "__container", disabled && 'disabled'),
|
111
111
|
onClick: onClick
|
112
|
-
}, value.length !== 0 ? /*#__PURE__*/React.createElement("span", {
|
112
|
+
}, value.length !== 0 ? ( /*#__PURE__*/React.createElement("span", {
|
113
113
|
className: prefixCls + "__value"
|
114
114
|
}, /*#__PURE__*/React.createElement("span", {
|
115
115
|
className: cx(prefixCls + "__tags", wrap && prefixCls + "__tags--all")
|
@@ -124,7 +124,7 @@ var TagInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
124
124
|
style: {
|
125
125
|
maxWidth: tagMaxWidth
|
126
126
|
}
|
127
|
-
}, title === true ? option.title : title), closeable ? /*#__PURE__*/React.createElement("span", {
|
127
|
+
}, title === true ? option.title : title), closeable ? ( /*#__PURE__*/React.createElement("span", {
|
128
128
|
className: prefixCls + "__tag-closed",
|
129
129
|
onClick: function onClick(evt) {
|
130
130
|
if (disabled) return;
|
@@ -134,20 +134,20 @@ var TagInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
134
134
|
});
|
135
135
|
tryChangeValue(nextValue, [option], false);
|
136
136
|
}
|
137
|
-
}, /*#__PURE__*/React.createElement(CloseOutlined, null)) : null);
|
138
|
-
}))) : /*#__PURE__*/React.createElement("span", {
|
137
|
+
}, /*#__PURE__*/React.createElement(CloseOutlined, null))) : null);
|
138
|
+
})))) : ( /*#__PURE__*/React.createElement("span", {
|
139
139
|
className: prefixCls + "__placeholder"
|
140
|
-
}, placeholder), !!suffix || showClearableIcon && hover || showTagCount ? /*#__PURE__*/React.createElement("span", {
|
140
|
+
}, placeholder)), !!suffix || showClearableIcon && hover || showTagCount ? ( /*#__PURE__*/React.createElement("span", {
|
141
141
|
className: prefixCls + "__suffix"
|
142
|
-
}, showTagCount ? /*#__PURE__*/React.createElement("span", {
|
142
|
+
}, showTagCount ? ( /*#__PURE__*/React.createElement("span", {
|
143
143
|
className: cx(prefixCls + "__tag--total"),
|
144
144
|
onClick: handleExpand
|
145
|
-
}, "" + (tagCount > 99 ? '+99' : tagCount)) : showClearableIcon && hover ? /*#__PURE__*/React.createElement("span", {
|
145
|
+
}, "" + (tagCount > 99 ? '+99' : tagCount))) : showClearableIcon && hover ? ( /*#__PURE__*/React.createElement("span", {
|
146
146
|
className: prefixCls + "__clear",
|
147
147
|
role: "button",
|
148
148
|
tabIndex: -1,
|
149
149
|
onClick: handleClear
|
150
|
-
}, /*#__PURE__*/React.createElement(CloseCircleFilled, null)) : null, suffix) : null), value.length !== 0 && expanded ? /*#__PURE__*/React.createElement("div", {
|
150
|
+
}, /*#__PURE__*/React.createElement(CloseCircleFilled, null))) : null, suffix)) : null), value.length !== 0 && expanded ? ( /*#__PURE__*/React.createElement("div", {
|
151
151
|
className: prefixCls + "__container__expand"
|
152
152
|
}, /*#__PURE__*/React.createElement("span", {
|
153
153
|
className: cx(prefixCls + "__value")
|
@@ -164,7 +164,7 @@ var TagInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
164
164
|
style: {
|
165
165
|
maxWidth: tagMaxWidth
|
166
166
|
}
|
167
|
-
}, title === true ? option.title : title), closeable ? /*#__PURE__*/React.createElement("span", {
|
167
|
+
}, title === true ? option.title : title), closeable ? ( /*#__PURE__*/React.createElement("span", {
|
168
168
|
className: prefixCls + "__tag-closed",
|
169
169
|
onClick: function onClick(evt) {
|
170
170
|
if (disabled) return;
|
@@ -174,15 +174,15 @@ var TagInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
174
174
|
});
|
175
175
|
tryChangeValue(nextValue);
|
176
176
|
}
|
177
|
-
}, /*#__PURE__*/React.createElement(CloseOutlined, null)) : null);
|
178
|
-
}))), showClearableIcon ? /*#__PURE__*/React.createElement("span", {
|
177
|
+
}, /*#__PURE__*/React.createElement(CloseOutlined, null))) : null);
|
178
|
+
}))), showClearableIcon ? ( /*#__PURE__*/React.createElement("span", {
|
179
179
|
className: prefixCls + "__suffix"
|
180
180
|
}, /*#__PURE__*/React.createElement("span", {
|
181
181
|
className: prefixCls + "__clear",
|
182
182
|
role: "button",
|
183
183
|
tabIndex: -1,
|
184
184
|
onClick: handleClear
|
185
|
-
}, /*#__PURE__*/React.createElement(CloseCircleFilled, null))) : null) : null);
|
185
|
+
}, /*#__PURE__*/React.createElement(CloseCircleFilled, null)))) : null)) : null);
|
186
186
|
});
|
187
187
|
if (__DEV__) {
|
188
188
|
TagInput.displayName = 'TagInput';
|
package/lib/esm/TagInputMock.js
CHANGED
@@ -174,7 +174,7 @@ var TagInputMock = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
174
174
|
trySetHover(false);
|
175
175
|
_onMouseLeave === null || _onMouseLeave === void 0 ? void 0 : _onMouseLeave(evt);
|
176
176
|
}
|
177
|
-
}, rest), showTags ? /*#__PURE__*/React.createElement("span", {
|
177
|
+
}, rest), showTags ? ( /*#__PURE__*/React.createElement("span", {
|
178
178
|
className: prefixCls + "__tags"
|
179
179
|
}, mergedTagList.map(function (option, index) {
|
180
180
|
return /*#__PURE__*/React.createElement(MockTag, {
|
@@ -194,26 +194,26 @@ var TagInputMock = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
194
194
|
});
|
195
195
|
}
|
196
196
|
});
|
197
|
-
})) : /*#__PURE__*/React.createElement("span", {
|
197
|
+
}))) : ( /*#__PURE__*/React.createElement("span", {
|
198
198
|
className: prefixCls + "__placeholder"
|
199
|
-
}, placeholder), /*#__PURE__*/React.createElement(ResizeDetector, {
|
199
|
+
}, placeholder)), /*#__PURE__*/React.createElement(ResizeDetector, {
|
200
200
|
skipOnMount: false,
|
201
201
|
onResize: function onResize(w) {
|
202
202
|
if (w) {
|
203
203
|
setSuffixWidth(w);
|
204
204
|
}
|
205
205
|
}
|
206
|
-
}, !!suffix || showClearableIcon && hover || showTagCount ? /*#__PURE__*/React.createElement("span", {
|
206
|
+
}, !!suffix || showClearableIcon && hover || showTagCount ? ( /*#__PURE__*/React.createElement("span", {
|
207
207
|
className: prefixCls + "__suffix"
|
208
|
-
}, showTagCount ? /*#__PURE__*/React.createElement("span", {
|
208
|
+
}, showTagCount ? ( /*#__PURE__*/React.createElement("span", {
|
209
209
|
className: cx(prefixCls + "__tag--total", activeExpandable && prefixCls + "__tag--active"),
|
210
210
|
onClick: onExpand
|
211
|
-
}, "" + (tagCount > 99 ? '99+' : tagCount)) : null, showClearableIcon && hover ? /*#__PURE__*/React.createElement("span", {
|
211
|
+
}, "" + (tagCount > 99 ? '99+' : tagCount))) : null, showClearableIcon && hover ? ( /*#__PURE__*/React.createElement("span", {
|
212
212
|
className: prefixCls + "__clear",
|
213
213
|
role: "button",
|
214
214
|
tabIndex: -1,
|
215
215
|
onClick: handleClear
|
216
|
-
}, /*#__PURE__*/React.createElement(CloseCircleFilled, null)) : suffix) : null)));
|
216
|
+
}, /*#__PURE__*/React.createElement(CloseCircleFilled, null))) : suffix)) : null)));
|
217
217
|
});
|
218
218
|
if (__DEV__) {
|
219
219
|
TagInputMock.displayName = 'TagInputMock';
|
@@ -261,7 +261,7 @@ function MockTag(_ref) {
|
|
261
261
|
key: option.id
|
262
262
|
}, /*#__PURE__*/React.createElement("span", {
|
263
263
|
className: prefixCls + "__tag-content"
|
264
|
-
}, title === true ? option.title : title), closeable ? /*#__PURE__*/React.createElement("span", {
|
264
|
+
}, title === true ? option.title : title), closeable ? ( /*#__PURE__*/React.createElement("span", {
|
265
265
|
className: prefixCls + "__tag-closed",
|
266
266
|
onClick: function onClick(evt) {
|
267
267
|
if (disabled) return;
|
@@ -271,6 +271,6 @@ function MockTag(_ref) {
|
|
271
271
|
});
|
272
272
|
tryChangeValue(nextValue, [option], false);
|
273
273
|
}
|
274
|
-
}, /*#__PURE__*/React.createElement(CloseOutlined, null)) : null)));
|
274
|
+
}, /*#__PURE__*/React.createElement(CloseOutlined, null))) : null)));
|
275
275
|
}
|
276
276
|
export { TagInputMock };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hi-ui/tag-input",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.10",
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
5
5
|
"keywords": [],
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
@@ -43,25 +43,25 @@
|
|
43
43
|
"url": "https://github.com/XiaoMi/hiui/issues"
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
|
-
"@hi-ui/classname": "^4.0.
|
47
|
-
"@hi-ui/env": "^4.0.
|
48
|
-
"@hi-ui/func-utils": "^4.0.
|
49
|
-
"@hi-ui/icons": "^4.0.
|
50
|
-
"@hi-ui/type-assertion": "^4.0.
|
51
|
-
"@hi-ui/use-latest": "^4.0.
|
52
|
-
"@hi-ui/use-merge-refs": "^4.0.
|
53
|
-
"@hi-ui/use-outside-click": "^4.0.
|
54
|
-
"@hi-ui/use-uncontrolled-state": "^4.0.
|
46
|
+
"@hi-ui/classname": "^4.0.4",
|
47
|
+
"@hi-ui/env": "^4.0.4",
|
48
|
+
"@hi-ui/func-utils": "^4.0.4",
|
49
|
+
"@hi-ui/icons": "^4.0.18",
|
50
|
+
"@hi-ui/type-assertion": "^4.0.4",
|
51
|
+
"@hi-ui/use-latest": "^4.0.4",
|
52
|
+
"@hi-ui/use-merge-refs": "^4.0.4",
|
53
|
+
"@hi-ui/use-outside-click": "^4.0.4",
|
54
|
+
"@hi-ui/use-uncontrolled-state": "^4.0.4",
|
55
55
|
"react-resize-detector": "^6.7.6"
|
56
56
|
},
|
57
57
|
"peerDependencies": {
|
58
|
-
"@hi-ui/core": ">=4.0.
|
58
|
+
"@hi-ui/core": ">=4.0.8",
|
59
59
|
"react": ">=16.8.6",
|
60
60
|
"react-dom": ">=16.8.6"
|
61
61
|
},
|
62
62
|
"devDependencies": {
|
63
|
-
"@hi-ui/core": "^4.0.
|
64
|
-
"@hi-ui/core-css": "^4.1.
|
63
|
+
"@hi-ui/core": "^4.0.8",
|
64
|
+
"@hi-ui/core-css": "^4.1.5",
|
65
65
|
"react": "^17.0.1",
|
66
66
|
"react-dom": "^17.0.1"
|
67
67
|
}
|