wini-web-components 1.2.4 → 1.2.6
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.
|
@@ -195,7 +195,7 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
195
195
|
children = ((_a = this.state.search) !== null && _a !== void 0 ? _a : this.state.options).filter(function (e) { return e.parentId === item.id; });
|
|
196
196
|
//
|
|
197
197
|
return react_1.default.createElement("div", { key: item.id, className: 'col', style: { width: '100%' } },
|
|
198
|
-
react_1.default.createElement("div", { className:
|
|
198
|
+
react_1.default.createElement("div", { className: "select-tile row ".concat(item.disabled ? "disabled" : ""), style: { paddingLeft: item.parentId ? '4.4rem' : undefined }, onClick: children.length ? function () {
|
|
199
199
|
if (_this.state.search) {
|
|
200
200
|
_this.setState(__assign(__assign({}, _this.state), { search: _this.state.search.map(function (e) {
|
|
201
201
|
if (e.id === item.id)
|
|
@@ -214,7 +214,7 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
214
214
|
}
|
|
215
215
|
} : undefined },
|
|
216
216
|
((_b = this.state.search) !== null && _b !== void 0 ? _b : this.state.options).some(function (e) { return e.parentId; }) && react_1.default.createElement("div", { className: 'row', style: { width: '1.4rem', height: '1.4rem' } }, children.length ? react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: item.isOpen ? free_solid_svg_icons_1.faCaretDown : free_solid_svg_icons_1.faCaretRight, style: { fontSize: '1.2rem', color: '#161C2499' } }) : null),
|
|
217
|
-
react_1.default.createElement(checkbox_1.Checkbox, { value: children.length ? (children.every(function (e) { return _this.state.value.includes(e.id); }) ? true : children.some(function (e) { return _this.state.value.includes(e.id); }) ? undefined : false) : this.state.value.includes(item.id), onChange: function (v) { _this.onCheck(v, __spreadArray([item], children, true)); }, size: '2rem' }),
|
|
217
|
+
react_1.default.createElement(checkbox_1.Checkbox, { disabled: item.disabled, value: children.length ? (children.every(function (e) { return _this.state.value.includes(e.id); }) ? true : children.some(function (e) { return _this.state.value.includes(e.id); }) ? undefined : false) : this.state.value.includes(item.id), onChange: function (v) { _this.onCheck(v, __spreadArray([item], children, true)); }, size: '2rem' }),
|
|
218
218
|
react_1.default.createElement(text_1.Text, { className: 'body-3' }, item.name)),
|
|
219
219
|
react_1.default.createElement("div", { className: 'col', style: { display: item.isOpen ? "flex" : "none", width: '100%' } }, children.map(function (e) { return _this.renderOptions(e); })));
|
|
220
220
|
};
|
|
@@ -187,9 +187,15 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
187
187
|
});
|
|
188
188
|
};
|
|
189
189
|
Select1.prototype.onSelect = function (item) {
|
|
190
|
-
var _a;
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
var _a, _b;
|
|
191
|
+
if (item.disabled) {
|
|
192
|
+
this.setState(__assign(__assign({}, this.state), { isOpen: false, onSelect: undefined, selected: undefined }));
|
|
193
|
+
(_a = this.inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this.setState(__assign(__assign({}, this.state), { isOpen: false, value: item.id, onSelect: undefined, selected: undefined }));
|
|
197
|
+
(_b = this.inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
198
|
+
}
|
|
193
199
|
if (this.props.onChange)
|
|
194
200
|
this.props.onChange(item);
|
|
195
201
|
};
|
|
@@ -201,7 +207,7 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
201
207
|
children = ((_a = this.state.search) !== null && _a !== void 0 ? _a : this.state.options).filter(function (e) { return e.parentId === item.id; });
|
|
202
208
|
//
|
|
203
209
|
return react_1.default.createElement("div", { key: item.id, className: 'col', style: { width: '100%' } },
|
|
204
|
-
react_1.default.createElement("div", { className:
|
|
210
|
+
react_1.default.createElement("div", { className: "select-tile row ".concat(item.disabled ? "disabled" : ""), style: { paddingLeft: item.parentId ? '4.4rem' : undefined, backgroundColor: this.state.selected === item.id ? "var(--selected-background)" : undefined }, onClick: children.length ? function () {
|
|
205
211
|
if (_this.state.search) {
|
|
206
212
|
_this.setState(__assign(__assign({}, _this.state), { search: _this.state.search.map(function (e) {
|
|
207
213
|
if (e.id === item.id)
|