wini-web-components 2.0.2 → 2.0.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.
|
@@ -264,11 +264,11 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
264
264
|
react_1.default.createElement("div", { className: 'row', style: { flexWrap: 'wrap', flex: 1, width: '100%', gap: '0.6rem 0.4rem' } },
|
|
265
265
|
this.state.value.map(function (item) {
|
|
266
266
|
var optionItem = _this.props.options.find(function (e) { return e.id === item; });
|
|
267
|
-
return react_1.default.createElement("div", { key: item, className: "row ".concat(input_multi_select_module_css_1.default['selected-item-value']), onClick: function (ev) { return _this.onClickItem(ev, item); } },
|
|
268
|
-
react_1.default.createElement(text_1.Text, { style: { color:
|
|
267
|
+
return react_1.default.createElement("div", { key: item, className: "row ".concat(input_multi_select_module_css_1.default['selected-item-value']), onClick: (optionItem === null || optionItem === void 0 ? void 0 : optionItem.disabled) ? undefined : function (ev) { return _this.onClickItem(ev, item); } },
|
|
268
|
+
react_1.default.createElement(text_1.Text, { style: { color: "var(--neutral-text-title-color)", fontSize: '1.2rem', lineHeight: '1.4rem' } }, optionItem === null || optionItem === void 0 ? void 0 : optionItem.name),
|
|
269
269
|
react_1.default.createElement(winicon_1.Winicon, { src: "outline/user interface/e-remove", size: '1.2rem' }));
|
|
270
270
|
}),
|
|
271
|
-
(!this.state.value.length || this.state.isOpen) && react_1.default.createElement("input", { autoFocus: this.state.
|
|
271
|
+
(!this.state.value.length || this.state.isOpen) && react_1.default.createElement("input", { autoFocus: this.state.value.length > 0, onChange: this.search, placeholder: this.state.value.length ? undefined : this.props.placeholder, onBlur: function (ev) {
|
|
272
272
|
if (_this.state.onSelect)
|
|
273
273
|
ev.target.focus();
|
|
274
274
|
else
|
|
@@ -295,16 +295,16 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
295
295
|
var newValue = [];
|
|
296
296
|
if (_list.length) {
|
|
297
297
|
if (isSelectedAll) {
|
|
298
|
-
newValue = _this.state.value.filter(function (vl) { return _list.every(function (item) { return vl !== item.id; }); });
|
|
298
|
+
newValue = _this.state.value.filter(function (vl) { return _list.every(function (item) { return vl !== item.id || item.disabled; }); });
|
|
299
299
|
}
|
|
300
300
|
else {
|
|
301
|
-
newValue = __spreadArray(__spreadArray([], _this.state.value, true), _list.filter(function (item) { return _this.state.value.every(function (vl) { return vl !== item.id; }); }).map(function (e) { return e.id; }), true);
|
|
301
|
+
newValue = __spreadArray(__spreadArray([], _this.state.value, true), _list.filter(function (item) { return _this.state.value.every(function (vl) { return vl !== item.id; }) && !item.disabled; }).map(function (e) { return e.id; }), true);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
_this.setState(__assign(__assign({}, _this.state), { value: newValue }));
|
|
305
305
|
if (_this.props.onChange)
|
|
306
306
|
_this.props.onChange(newValue);
|
|
307
|
-
}, className: 'button-text-3', style: { color: _list.length ? 'var(--infor-main-color)' : '
|
|
307
|
+
}, className: 'button-text-3', style: { color: _list.length ? 'var(--infor-main-color)' : 'var(--neutral-text-title-color)' } }, _list.length && isSelectedAll ? 'Bỏ chọn tất cả' : 'Chọn tất cả');
|
|
308
308
|
})()),
|
|
309
309
|
react_1.default.createElement("div", { className: "col ".concat(input_multi_select_module_css_1.default['select-body']) },
|
|
310
310
|
((_g = this.state.search) !== null && _g !== void 0 ? _g : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) { return _this.renderOptions(item); }),
|