@esvndev/es-react-config-setting 1.0.18 → 1.0.19

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.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]; // Lấy component icon từ object
11432
+ const LucideIcon = Icon[name];
11433
11433
  return LucideIcon ? jsx(LucideIcon, { className: className }) : null;
11434
11434
  };
11435
- const [dataSetting, setDataSetting] = useState([{
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,31 @@ const SettingApp = (props) => {
11462
11473
  name: t('Tiện ích'),
11463
11474
  icon: "BookOpen"
11464
11475
  }]);
11465
- //Sự kiện chọn loại cài đặt
11476
+ //Sự kiện chọn nhóm cài đặt
11466
11477
  const switchSettingTab = (data) => {
11467
- const updated = dataSetting.map((item) => ({
11478
+ const updated = dataSettingGroup.map((item) => ({
11468
11479
  ...item,
11469
11480
  active: item.id === data.id
11470
11481
  }));
11471
- setDataSetting(updated);
11482
+ setDataSettingGroup(updated);
11483
+ };
11484
+ //hàm tạo các thông số cấu hình và cài đặt
11485
+ const _renderView = () => {
11486
+ return (settingData && settingData.data && settingData.data.length > 0 ? settingData.data.map((item, index) => {
11487
+ 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 ?
11488
+ jsx("div", { className: "setting-section-desc", children: jsx("div", { className: "", children: jsx("span", { children: item.desrciption }) }) })
11489
+ : null, item.data && item.data.length > 0 ? item.data.map((_item, _index) => {
11490
+ 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" })] }) }) })] }) }));
11491
+ })
11492
+ : null] });
11493
+ })
11494
+ : null);
11472
11495
  };
11473
11496
  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: dataSetting && dataSetting.length > 0 ?
11475
- dataSetting.map((item) => {
11497
+ 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 ?
11498
+ dataSettingGroup.map((item) => {
11476
11499
  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: jsx("div", { className: "setting-section" }) }) }) })] })] }) }) })
11500
+ }) : 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
11501
  : null }));
11479
11502
  };
11480
11503