wini-web-components 1.9.0 → 1.9.2
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/dist/component/input-multi-select/input-multi-select.d.ts +0 -1
- package/dist/component/input-multi-select/input-multi-select.js +8 -8
- package/dist/component/select1/select1.js +1 -1
- package/dist/component/wini-icon/winicon.d.ts +3 -2
- package/dist/component/wini-icon/winicon.js +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -100,7 +100,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
100
100
|
exports.SelectMultiple = void 0;
|
|
101
101
|
var react_1 = __importStar(require("react"));
|
|
102
102
|
var react_dom_1 = __importDefault(require("react-dom"));
|
|
103
|
-
require("./input-multi-select.css");
|
|
103
|
+
var input_multi_select_module_css_1 = __importDefault(require("./input-multi-select.module.css"));
|
|
104
104
|
var checkbox_1 = require("../checkbox/checkbox");
|
|
105
105
|
var text_1 = require("../text/text");
|
|
106
106
|
var winicon_1 = require("../wini-icon/winicon");
|
|
@@ -194,7 +194,7 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
194
194
|
children = ((_a = this.state.search) !== null && _a !== void 0 ? _a : this.state.options).filter(function (e) { return e.parentId === item.id; });
|
|
195
195
|
//
|
|
196
196
|
return react_1.default.createElement("div", { key: item.id, className: 'col', style: { width: '100%' } },
|
|
197
|
-
react_1.default.createElement("div", { className: "select-tile row ".concat(item.disabled ? "disabled" : ""), style: { paddingLeft: item.parentId ? '4.4rem' : undefined }, onClick: children.length ? function () {
|
|
197
|
+
react_1.default.createElement("div", { className: "".concat(input_multi_select_module_css_1.default['select-tile'], " row ").concat(item.disabled ? input_multi_select_module_css_1.default["disabled"] : ""), style: { paddingLeft: item.parentId ? '4.4rem' : undefined }, onClick: children.length ? function () {
|
|
198
198
|
if (_this.state.search) {
|
|
199
199
|
_this.setState(__assign(__assign({}, _this.state), { search: _this.state.search.map(function (e) {
|
|
200
200
|
if (e.id === item.id)
|
|
@@ -225,7 +225,7 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
225
225
|
this.setState(__assign(__assign({}, this.state), { value: (_a = this.props.value) !== null && _a !== void 0 ? _a : [] }));
|
|
226
226
|
//
|
|
227
227
|
if (this.state.isOpen && (prevState.isOpen !== this.state.isOpen || prevState.value.length !== this.state.value.length)) {
|
|
228
|
-
var thisPopupRect = (_b = document.body.querySelector('
|
|
228
|
+
var thisPopupRect = (_b = document.body.querySelector(".".concat(input_multi_select_module_css_1.default['select-multi-popup']))) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
229
229
|
if (thisPopupRect) {
|
|
230
230
|
var style = void 0;
|
|
231
231
|
if (prevState.isOpen !== this.state.isOpen && thisPopupRect.right > document.body.offsetWidth) {
|
|
@@ -256,7 +256,7 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
256
256
|
SelectMultiple.prototype.render = function () {
|
|
257
257
|
var _this = this;
|
|
258
258
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
259
|
-
return react_1.default.createElement("div", { id: this.props.id, ref: this.containerRef, className: "select-multi-container row ".concat(this.props.disabled ? 'disabled' : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && 'helper-text', " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : 'body-3'), "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' }, onClick: function () {
|
|
259
|
+
return react_1.default.createElement("div", { id: this.props.id, ref: this.containerRef, className: "".concat(input_multi_select_module_css_1.default['select-multi-container'], " row ").concat(this.props.disabled ? input_multi_select_module_css_1.default['disabled'] : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && input_multi_select_module_css_1.default['helper-text'], " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : 'body-3'), "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' }, onClick: function () {
|
|
260
260
|
var _a, _b;
|
|
261
261
|
if (!_this.state.isOpen)
|
|
262
262
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: true, style: undefined, offset: (_b = (_a = _this.containerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect() }));
|
|
@@ -264,7 +264,7 @@ 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: 'selected-item-value
|
|
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
268
|
react_1.default.createElement(text_1.Text, { style: { color: '#161D24E5', 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
|
}),
|
|
@@ -282,7 +282,7 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
282
282
|
react_1.default.createElement(winicon_1.Winicon, { src: "outline/user interface/c-remove", size: '1.6rem' })) : react_1.default.createElement("div", { className: 'row', style: { display: (this.containerRef.current && this.containerRef.current.getBoundingClientRect().width >= 120) ? "flex" : "none" } },
|
|
283
283
|
react_1.default.createElement(winicon_1.Winicon, { src: this.state.isOpen ? "fill/arrows/up-arrow" : "fill/arrows/down-arrow", size: '1.2rem' })),
|
|
284
284
|
this.state.isOpen &&
|
|
285
|
-
react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "select-multi-popup col ".concat((_e = this.props.popupClassName) !== null && _e !== void 0 ? _e : ""), style: (_f = this.state.style) !== null && _f !== void 0 ? _f : {
|
|
285
|
+
react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "".concat(input_multi_select_module_css_1.default['select-multi-popup'], " col ").concat((_e = this.props.popupClassName) !== null && _e !== void 0 ? _e : ""), style: (_f = this.state.style) !== null && _f !== void 0 ? _f : {
|
|
286
286
|
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
287
287
|
left: this.state.offset.x + 'px',
|
|
288
288
|
width: this.state.offset.width,
|
|
@@ -306,9 +306,9 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
306
306
|
_this.props.onChange(newValue);
|
|
307
307
|
}, className: 'button-text-3', style: { color: _list.length ? 'var(--infor-main-color)' : '#00204D99', } }, _list.length && isSelectedAll ? 'Bỏ chọn tất cả' : 'Chọn tất cả');
|
|
308
308
|
})()),
|
|
309
|
-
react_1.default.createElement("div", { className:
|
|
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); }),
|
|
311
|
-
(((_h = this.state.search) === null || _h === void 0 ? void 0 : _h.length) === 0 || ((_j = this.props.options) === null || _j === void 0 ? void 0 : _j.length) === 0) && (react_1.default.createElement("div", { className: 'no-results-found' }, "No result found")))), document.body));
|
|
311
|
+
(((_h = this.state.search) === null || _h === void 0 ? void 0 : _h.length) === 0 || ((_j = this.props.options) === null || _j === void 0 ? void 0 : _j.length) === 0) && (react_1.default.createElement("div", { className: input_multi_select_module_css_1.default['no-results-found'] }, "No result found")))), document.body));
|
|
312
312
|
};
|
|
313
313
|
return SelectMultiple;
|
|
314
314
|
}(react_1.default.Component));
|
|
@@ -244,7 +244,7 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
244
244
|
this.inputRef.current.value = "".concat((_d = (_c = this.state.options.find(function (e) { return e.id === _this.state.value; })) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : "");
|
|
245
245
|
//
|
|
246
246
|
if (this.state.isOpen && prevState.isOpen !== this.state.isOpen) {
|
|
247
|
-
var thisPopupRect = (_e = document.body.querySelector(
|
|
247
|
+
var thisPopupRect = (_e = document.body.querySelector(":scope > .".concat(select1_module_css_1.default['select1-popup']))) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect();
|
|
248
248
|
if (thisPopupRect) {
|
|
249
249
|
var style = void 0;
|
|
250
250
|
if (thisPopupRect.right > document.body.offsetWidth) {
|