@esvndev/es-react-config-setting 1.0.18 → 1.0.20
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/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +33 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -11429,14 +11429,25 @@ const SettingApp = (props) => {
|
|
|
11429
11429
|
return l;
|
|
11430
11430
|
};
|
|
11431
11431
|
const DynamicIcon = ({ name, className }) => {
|
|
11432
|
-
const LucideIcon = Icon[name];
|
|
11432
|
+
const LucideIcon = Icon[name];
|
|
11433
11433
|
return LucideIcon ? jsx(LucideIcon, { className: className }) : null;
|
|
11434
11434
|
};
|
|
11435
|
-
|
|
11435
|
+
//#endregion
|
|
11436
|
+
const [settingData, setSettingData] = useState([]);
|
|
11437
|
+
const [dataSettingGroup, setDataSettingGroup] = useState([{
|
|
11436
11438
|
id: 1,
|
|
11437
11439
|
name: t('Cài đặt chung'),
|
|
11438
11440
|
active: true,
|
|
11439
|
-
icon: 'Settings'
|
|
11441
|
+
icon: 'Settings',
|
|
11442
|
+
data: [{
|
|
11443
|
+
name: "Danh bạ",
|
|
11444
|
+
description: "Danh sách danh sách danh sách danh sách",
|
|
11445
|
+
data: [{
|
|
11446
|
+
name: "Hiển thị trạng thái truy cập",
|
|
11447
|
+
desciption: "Ai được phép truy cập",
|
|
11448
|
+
type: "checkbox"
|
|
11449
|
+
}]
|
|
11450
|
+
}]
|
|
11440
11451
|
}, {
|
|
11441
11452
|
id: 2,
|
|
11442
11453
|
name: t('Quyền riêng tư'),
|
|
@@ -11462,19 +11473,32 @@ const SettingApp = (props) => {
|
|
|
11462
11473
|
name: t('Tiện ích'),
|
|
11463
11474
|
icon: "BookOpen"
|
|
11464
11475
|
}]);
|
|
11465
|
-
//Sự kiện chọn
|
|
11476
|
+
//Sự kiện chọn nhóm cài đặt
|
|
11466
11477
|
const switchSettingTab = (data) => {
|
|
11467
|
-
const updated =
|
|
11478
|
+
const updated = dataSettingGroup.map((item) => ({
|
|
11468
11479
|
...item,
|
|
11469
11480
|
active: item.id === data.id
|
|
11470
11481
|
}));
|
|
11471
|
-
|
|
11482
|
+
settingData(data);
|
|
11483
|
+
setDataSettingGroup(updated);
|
|
11484
|
+
};
|
|
11485
|
+
//hàm tạo các thông số cấu hình và cài đặt
|
|
11486
|
+
const _renderView = () => {
|
|
11487
|
+
return (settingData && settingData.data && settingData.data.length > 0 ? settingData.data.map((item, index) => {
|
|
11488
|
+
jsxs("div", { className: "setting-section", children: [jsx("div", { className: "setting-section-label", children: jsx("div", { className: "badge", children: jsx("span", { children: item.name }) }) }), item.desrciption ?
|
|
11489
|
+
jsx("div", { className: "setting-section-desc", children: jsx("div", { className: "", children: jsx("span", { children: item.desrciption }) }) })
|
|
11490
|
+
: null, item.data && item.data.length > 0 ? item.data.map((_item, _index) => {
|
|
11491
|
+
return (jsx("div", { className: "setting-section-content ", children: jsxs("div", { className: 'flx flx-al-c flx-sp-btw setting-section-content__item' + (_index === 0 ? 'first' : (_index === _item.data.length - 1 ? 'last' : '')), children: [jsxs("div", { className: "flx flx-col", style: { flex: "0 0 fit-content" }, children: [jsx("span", { children: _item.name }), jsx("span", { className: "setting-section-content__description", children: _item.description })] }), jsx("div", { style: { maxWidth: "50%" }, children: jsx("div", { style: { width: "100%", boxSizing: "border-box" }, children: jsxs("div", { className: "flx flx-al-c z-dropdown-preview --square --l", style: { width: "100%", boxSizing: "border-box" }, children: [jsx("div", { className: "truncate flx-1" }), jsx("i", { className: "fa fa-Chevron_Down_24_Line margin-left-24" })] }) }) })] }) }));
|
|
11492
|
+
})
|
|
11493
|
+
: null] });
|
|
11494
|
+
})
|
|
11495
|
+
: null);
|
|
11472
11496
|
};
|
|
11473
11497
|
return (jsx(Fragment, { children: isOpen ?
|
|
11474
|
-
jsx(Modal$1, { isOpen: true, toggle: handleModal, className: 'modal-dialog-centered modal-lg setting-modal', contentClassName: 'p-0', onOpened: handleFormOpened, onClosed: handleFormClosed, backdrop: backdrop, children: jsx(Form$1, { id: 'form-modal-globalzone', className: 'todo-modal', onSubmit: handleSubmit, children: jsxs("div", { className: "", children: [jsx(ModalHeader, { handleModal: handleModal, title: 'C\u00E0i \u0111\u1EB7t' }), jsxs(Row, { className: "m-0 gy-1 setting-modal-body-custom", children: [jsx(Col, { md: 4, xs: 12, className: "setting-menu", children: jsx(lib.Scrollbars, { autoHide: true, autoHeight: true, autoHeightMax: windowSize.innerHeight - 180, children: jsx(Row, { className: "m-0 gy-1 mb-2", children:
|
|
11475
|
-
|
|
11498
|
+
jsx(Modal$1, { isOpen: true, toggle: handleModal, className: 'modal-dialog-centered modal-lg setting-modal', contentClassName: 'p-0', onOpened: handleFormOpened, onClosed: handleFormClosed, backdrop: backdrop, children: jsx(Form$1, { id: 'form-modal-globalzone', className: 'todo-modal', onSubmit: handleSubmit, children: jsxs("div", { className: "", children: [jsx(ModalHeader, { handleModal: handleModal, title: 'C\u00E0i \u0111\u1EB7t' }), jsxs(Row, { className: "m-0 gy-1 setting-modal-body-custom", children: [jsx(Col, { md: 4, xs: 12, className: "setting-menu", children: jsx(lib.Scrollbars, { autoHide: true, autoHeight: true, autoHeightMax: windowSize.innerHeight - 180, children: jsx(Row, { className: "m-0 gy-1 mb-2", children: dataSettingGroup && dataSettingGroup.length > 0 ?
|
|
11499
|
+
dataSettingGroup.map((item) => {
|
|
11476
11500
|
return (jsx("div", { className: 'setting-menu__item ' + (item.active ? 'selected' : ''), onClick: () => { switchSettingTab(item); }, children: jsxs("div", { className: "setting-menu__wrapper-content truncate", children: [jsx(DynamicIcon, { name: item.icon, className: "setting-menu__icon" }), jsx("p", { className: "setting-menu__name truncate", children: jsx("span", { children: item.name }) })] }) }, item.id));
|
|
11477
|
-
}) : null }) }) }), jsx(Col, { md: 8, xs: 12, className: "stack-navigation stack-page", children: jsx(lib.Scrollbars, { autoHide: true, autoHeight: true, autoHeightMax: windowSize.innerHeight - 180, children: jsx(ModalBody, { children:
|
|
11501
|
+
}) : null }) }) }), jsx(Col, { md: 8, xs: 12, className: "stack-navigation stack-page", children: jsx(lib.Scrollbars, { autoHide: true, autoHeight: true, autoHeightMax: windowSize.innerHeight - 180, children: jsx(ModalBody, { children: _renderView() }) }) })] })] }) }) })
|
|
11478
11502
|
: null }));
|
|
11479
11503
|
};
|
|
11480
11504
|
|