intelicoreact 1.4.71 → 1.4.73
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.
|
@@ -150,7 +150,7 @@ function RangeSlider(_ref) {
|
|
|
150
150
|
switch (type) {
|
|
151
151
|
case "from":
|
|
152
152
|
const getValidatedFromValue = value => {
|
|
153
|
-
if (value < min) {
|
|
153
|
+
if (!value || value < min) {
|
|
154
154
|
value = min;
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -182,7 +182,7 @@ function RangeSlider(_ref) {
|
|
|
182
182
|
|
|
183
183
|
case "to":
|
|
184
184
|
const getValidatedToValue = value => {
|
|
185
|
-
if (value > max) {
|
|
185
|
+
if (!value || value > max) {
|
|
186
186
|
value = max;
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -255,12 +255,6 @@ function RangeSlider(_ref) {
|
|
|
255
255
|
};
|
|
256
256
|
|
|
257
257
|
const onRangeInputBlur = (e, type) => {
|
|
258
|
-
var _e$target;
|
|
259
|
-
|
|
260
|
-
if (!(e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.value)) {
|
|
261
|
-
onRangeChange(type, type === "from" ? min : max, false, true);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
258
|
setIsInputFocused(type, false);
|
|
265
259
|
};
|
|
266
260
|
|
|
@@ -55,26 +55,22 @@ const TagList = _ref => {
|
|
|
55
55
|
onToggleRenderAll === null || onToggleRenderAll === void 0 ? void 0 : onToggleRenderAll(v);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const getStaticTagsCount =
|
|
59
|
-
var
|
|
58
|
+
const getStaticTagsCount = computedWidth => {
|
|
59
|
+
var _result$items;
|
|
60
60
|
|
|
61
61
|
if (typeof shownItemsCount === "number") return shownItemsCount;
|
|
62
|
-
const computedWidth = wrapperWidth || parseInt(wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current ? (_window$getComputedSt = window.getComputedStyle(wrapperRef.current)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.width : 0);
|
|
63
62
|
const delta = typeof onEditClick === "function" ? 60 : 32;
|
|
64
|
-
|
|
65
|
-
const result = tagList.map(_ref2 => {
|
|
63
|
+
const result = tagList.reduce((result, _ref2, index) => {
|
|
66
64
|
let {
|
|
67
65
|
itemRef
|
|
68
66
|
} = _ref2;
|
|
69
|
-
return itemRef;
|
|
70
|
-
}).reduce((result, itemRef) => {
|
|
71
67
|
const itemStyle = (itemRef === null || itemRef === void 0 ? void 0 : itemRef.current) && window.getComputedStyle(itemRef.current);
|
|
72
68
|
const itemWidth = [parseInt(itemStyle === null || itemStyle === void 0 ? void 0 : itemStyle.width, 10), parseInt(itemStyle === null || itemStyle === void 0 ? void 0 : itemStyle.marginLeft, 10), parseInt(itemStyle === null || itemStyle === void 0 ? void 0 : itemStyle.marginRight, 10)].reduce((result, item) => {
|
|
73
69
|
if (!isNaN(item)) result += item;
|
|
74
70
|
return result;
|
|
75
71
|
}, 0);
|
|
76
72
|
|
|
77
|
-
if (!isNaN(itemWidth) && itemWidth > 0 && itemWidth + result.width <
|
|
73
|
+
if (!isNaN(itemWidth) && itemWidth > 0 && itemWidth + result.width < computedWidth - delta || index === 0) {
|
|
78
74
|
result = {
|
|
79
75
|
count: result.count + 1,
|
|
80
76
|
width: result.width + itemWidth,
|
|
@@ -91,6 +87,11 @@ const TagList = _ref => {
|
|
|
91
87
|
width: 0,
|
|
92
88
|
items: []
|
|
93
89
|
});
|
|
90
|
+
|
|
91
|
+
if ((result === null || result === void 0 ? void 0 : (_result$items = result.items) === null || _result$items === void 0 ? void 0 : _result$items.length) === 1) {
|
|
92
|
+
result.items[0].r.style.maxWidth = "".concat(computedWidth - delta - 8, "px");
|
|
93
|
+
}
|
|
94
|
+
|
|
94
95
|
return result === null || result === void 0 ? void 0 : result.count;
|
|
95
96
|
};
|
|
96
97
|
|
|
@@ -102,24 +103,14 @@ const TagList = _ref => {
|
|
|
102
103
|
};
|
|
103
104
|
|
|
104
105
|
const renderTags = () => {
|
|
105
|
-
const tagsRenderOrder =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} = _ref3;
|
|
110
|
-
return value !== null && value !== void 0 ? value : id;
|
|
111
|
-
});
|
|
112
|
-
return tagsRenderOrder.map((v, i) => {
|
|
106
|
+
// const tagsRenderOrder =
|
|
107
|
+
// renderOrder ?? tagList.map(({ value, id }) => value ?? id);
|
|
108
|
+
console.log("render", [...tagList]);
|
|
109
|
+
return tagList.map((item, i) => {
|
|
113
110
|
var _item$id, _item$id2;
|
|
114
111
|
|
|
115
|
-
const item = tagList.find(
|
|
116
|
-
|
|
117
|
-
value,
|
|
118
|
-
id
|
|
119
|
-
} = _ref4;
|
|
120
|
-
return (value !== null && value !== void 0 ? value : id) === v;
|
|
121
|
-
});
|
|
122
|
-
if (!item) return null;
|
|
112
|
+
// const item = tagList.find(({ value, id }) => (value ?? id) === v);
|
|
113
|
+
// if (!item) return null;
|
|
123
114
|
const isHidden = renderItemsCount !== -1 && staticTagsCount !== -1 ? i >= renderItemsCount : false;
|
|
124
115
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
125
116
|
className: "tag-list_wrapper_item ".concat(isHidden ? "tag-list_wrapper_item--hidden" : ""),
|
|
@@ -169,13 +160,13 @@ const TagList = _ref => {
|
|
|
169
160
|
let computedWidth = wrapperWidth;
|
|
170
161
|
|
|
171
162
|
if (computedWidth === 0) {
|
|
172
|
-
var _window$
|
|
163
|
+
var _window$getComputedSt;
|
|
173
164
|
|
|
174
|
-
computedWidth = parseInt(wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current ? (_window$
|
|
165
|
+
computedWidth = parseInt(wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current ? (_window$getComputedSt = window.getComputedStyle(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.width : 0);
|
|
175
166
|
}
|
|
176
167
|
|
|
177
168
|
if (!isNaN(computedWidth)) {
|
|
178
|
-
setStaticTagsCount(getStaticTagsCount());
|
|
169
|
+
setStaticTagsCount(getStaticTagsCount(computedWidth));
|
|
179
170
|
}
|
|
180
171
|
}
|
|
181
172
|
}, [tagList, wrapperWidth, wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current]); //
|
|
@@ -23,6 +23,18 @@
|
|
|
23
23
|
|
|
24
24
|
&_item {
|
|
25
25
|
display: inline-block;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
|
|
29
|
+
.tag {
|
|
30
|
+
max-width: 100%;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
|
|
33
|
+
&__label {
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
text-overflow: ellipsis;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
26
38
|
|
|
27
39
|
&--hidden {
|
|
28
40
|
display: none;
|