Skip to content

Commit

Permalink
feat(tab): dynamic add icon and delete icon and handle callBack for a…
Browse files Browse the repository at this point in the history
…dd tabs and ehance UI
  • Loading branch information
mrbadri committed May 3, 2024
1 parent 928aa9a commit b3fa74d
Show file tree
Hide file tree
Showing 238 changed files with 275 additions and 30 deletions.
4 changes: 2 additions & 2 deletions apps/docs/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ export function App() {
];

const [tabs, setTabs] = useState<TabData[]>([
{ label: 'Tab 1', content: 'Content for Tab 1' },
{ label: 'Tab 1', chidlren: <>test</> },
]);

return (
<div>
<div role="navigation">
----
<Tabs tabs={tabs} setTabs={setTabs} />
<Tabs tabs={tabs} setTabs={setTabs} addable />
---
<ul>
<li>
Expand Down
2 changes: 1 addition & 1 deletion packages/tab/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@mui-builder/tab",
"version": "0.0.2"
"version": "0.0.3"
}
22 changes: 9 additions & 13 deletions packages/tab/src/components/tabs/tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { Stack, Tab } from '@mui/material';
import { Tab } from '@mui/material';
import IconButton from '@mui/material/IconButton';
import TabsMui from '@mui/material/Tabs';

Expand All @@ -11,33 +11,29 @@ import useTabs from './useTabs';

const Tabs: React.FC<TabsProps> = (props) => {
const {
AddIcon,
addable,
tabs,
getTabsProps,
getTabProps,
getDeleteTabProps,
showDeleteIcon,
getAddTabProps,
getTabPanelProps,
} = useTabs(props);

return (
<div>
<TabsMui {...getTabsProps()}>
{/* Show List Tabs */}
{tabs.map((tab, index) => (
<Tab
{...getTabProps(tab, index)}
icon={
<div {...getDeleteTabProps(index)}>
{showDeleteIcon(index) && 'x'}
</div>
}
/>
<Tab {...getTabProps(tab, index)} />
))}
<IconButton {...getAddTabProps()}>+</IconButton>
{/* Add New Tab */}
{addable && <IconButton {...getAddTabProps()}>{AddIcon}</IconButton>}
</TabsMui>

{/* Content of Tabs */}
{tabs.map((tab, index) => (
<TabPanel {...getTabPanelProps(index)}>{tab.content}</TabPanel>
<TabPanel {...getTabPanelProps(index)}>{tab.chidlren}</TabPanel>
))}
</div>
);
Expand Down
8 changes: 7 additions & 1 deletion packages/tab/src/components/tabs/tabs.types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { ReactNode } from 'react';

import { TabProps as TabPropsMui } from '@mui/material';

export type TabData = {
label: string;
content: string;
chidlren: ReactNode;
};

export type TabProps = TabPropsMui & {
Expand All @@ -17,4 +19,8 @@ export type TabProps = TabPropsMui & {
export type TabsProps = {
tabs: TabData[];
setTabs: React.Dispatch<React.SetStateAction<TabData[]>>;
onAdd?: () => void;
addable?: boolean;
AddIcon?: ReactNode;
DeleteIcon?: ReactNode;
};
38 changes: 25 additions & 13 deletions packages/tab/src/components/tabs/useTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import { TabProps as TabPropsMui } from '@mui/material';
import { TabData, TabsProps } from './tabs.types';

const useTabs = (props: TabsProps) => {
const { tabs, setTabs } = props;
const {
tabs,
setTabs,
onAdd,
addable = false,
AddIcon = '+',
DeleteIcon = 'x',
} = props;
const [value, setValue] = useState<number | null>(0);
const [deleteIndex, setDeleteIndex] = useState<number | null>(null);

Expand All @@ -18,15 +25,10 @@ const useTabs = (props: TabsProps) => {
};

const handleAddTab = () => {
const newTabs = [
...tabs,
{
label: `Tab ${tabs.length + 1}`,
content: `Content for Tab ${tabs.length + 1}`,
},
];
setTabs(newTabs);
setValue(newTabs.length - 1);
if (addable) {
onAdd?.();
setValue(tabs.length - 1);
}
};

const handleDeleteTab = (index: number) => {
Expand All @@ -47,7 +49,14 @@ const useTabs = (props: TabsProps) => {

const getTabProps = (tab: TabData, index: number): TabPropsMui => ({
key: index,
label: tab.label,
label: (
<>
{tab.label}
<div {...getDeleteTabProps(index)}>
{showDeleteIcon(index) && DeleteIcon}
</div>
</>
),
onMouseEnter: () => setDeleteIndex(index), // Set deleteIndex on hover
onMouseLeave: () => setDeleteIndex(null), // Reset deleteIndex when mouse leaves
iconPosition: 'end',
Expand All @@ -56,12 +65,12 @@ const useTabs = (props: TabsProps) => {

const getDeleteTabProps = (index: number) => ({
onClick: () => handleDeleteTab(index),
style: { fontSize: '14px' },
style: { fontSize: '14px', marginLeft: '8px' },
});

const getAddTabProps = () => ({
onClick: handleAddTab,
sx: { width: '72px' },
sx: { width: '48px', height: '48px' },
});

const getTabPanelProps = (index: number) => ({
Expand All @@ -71,8 +80,11 @@ const useTabs = (props: TabsProps) => {
});

return {
DeleteIcon,
AddIcon,
tabs,
showDeleteIcon,
addable,
getTabsProps,
getTabProps,
getDeleteTabProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"import { jsx as _jsx } from \"react/jsx-runtime\";\nimport useTabPanel from './useTabPanel';\nconst TabPanel = (props) => {\n const { show, children, getContainerProps } = useTabPanel(props);\n return _jsx(\"div\", Object.assign({}, getContainerProps, { children: show && children }));\n};\nexport default TabPanel;\n//# sourceMappingURL=tabPanel.js.map","references":["/home/mrbadri/code/startup/mui-builder/node_modules/@types/react/index.d.ts","/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabPanel/tabPanel.types.ts","/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabPanel/useTabPanel.ts"],"map":"{\"version\":3,\"file\":\"tabPanel.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../packages/tab/src/components/tabPanel/tabPanel.tsx\"],\"names\":[],\"mappings\":\";AAIA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,QAAQ,GAA4B,CAAC,KAAK,EAAE,EAAE;IAClD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAEjE,OAAO,8BAAS,iBAAiB,cAAG,IAAI,IAAI,QAAQ,IAAO,CAAC;AAC9D,CAAC,CAAC;AACF,eAAe,QAAQ,CAAC\"}","dts":{"name":"undefined/placeholder/src/components/tabPanel/tabPanel.d.ts","writeByteOrderMark":false,"text":"import React from 'react';\nimport { TabPanelProps } from './tabPanel.types';\ndeclare const TabPanel: React.FC<TabPanelProps>;\nexport default TabPanel;\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"export {};\n//# sourceMappingURL=tabPanel.types.js.map","references":[],"map":"{\"version\":3,\"file\":\"tabPanel.types.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../packages/tab/src/components/tabPanel/tabPanel.types.ts\"],\"names\":[],\"mappings\":\"\"}","dts":{"name":"undefined/placeholder/src/components/tabPanel/tabPanel.types.d.ts","writeByteOrderMark":false,"text":"/// <reference types=\"react\" />\nexport type TabPanelProps = {\n children?: React.ReactNode;\n index: number;\n value: number | null;\n};\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"import TabPanel from './components/tabPanel/tabPanel';\nimport Tabs from './components/tabs/tabs';\nexport { TabPanel };\nexport default Tabs;\n//# sourceMappingURL=index.js.map","references":["/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabs/tabs.types.ts","/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabPanel/tabPanel.tsx","/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabs/tabs.tsx"],"map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../packages/tab/src/index.ts\"],\"names\":[],\"mappings\":\"AAEA,OAAO,QAAQ,MAAM,gCAAgC,CAAC;AACtD,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,CAAC;AAIpB,eAAe,IAAI,CAAC\"}","dts":{"name":"undefined/placeholder/src/index.d.ts","writeByteOrderMark":false,"text":"import { TabData } from './components/tabs/tabs.types';\nimport TabPanel from './components/tabPanel/tabPanel';\nimport Tabs from './components/tabs/tabs';\nexport { TabPanel };\nexport type { TabData };\nexport default Tabs;\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"import { useState } from 'react';\nconst useTabs = (props) => {\n const { tabs, setTabs, onAdd, addable = false, AddIcon = '+', DeleteIcon = 'x', } = props;\n const [value, setValue] = useState(0);\n const [deleteIndex, setDeleteIndex] = useState(null);\n const handleChange = (event, newValue) => {\n setValue(newValue);\n };\n const handleAddTab = () => {\n if (addable) {\n onAdd === null || onAdd === void 0 ? void 0 : onAdd();\n setValue(tabs.length - 1);\n }\n };\n const handleDeleteTab = (index) => {\n const newTabs = tabs.filter((_, i) => i !== index);\n setTabs(newTabs);\n setValue(Math.min(value, newTabs.length - 1));\n setDeleteIndex(null);\n };\n const showDeleteIcon = (index) => deleteIndex === index;\n // Props\n const getTabsProps = () => ({\n value,\n onChange: handleChange,\n 'aria-label': 'dynamic tabs example',\n });\n const getTabProps = (tab, index) => ({\n key: index,\n label: tab.label,\n onMouseEnter: () => setDeleteIndex(index), // Set deleteIndex on hover\n onMouseLeave: () => setDeleteIndex(null), // Reset deleteIndex when mouse leaves\n iconPosition: 'end',\n onClick: () => setValue(index),\n });\n const getDeleteTabProps = (index) => ({\n onClick: () => handleDeleteTab(index),\n style: { fontSize: '14px' },\n });\n const getAddTabProps = () => ({\n onClick: handleAddTab,\n sx: { width: '72px' },\n });\n const getTabPanelProps = (index) => ({\n key: index,\n value: value,\n index: index,\n });\n return {\n DeleteIcon,\n AddIcon,\n tabs,\n showDeleteIcon,\n addable,\n getTabsProps,\n getTabProps,\n getDeleteTabProps,\n getAddTabProps,\n getTabPanelProps,\n };\n};\nexport default useTabs;\n//# sourceMappingURL=useTabs.js.map","references":["/home/mrbadri/code/startup/mui-builder/node_modules/@types/react/index.d.ts","/home/mrbadri/code/startup/mui-builder/node_modules/@mui/material/index.d.ts","/home/mrbadri/code/startup/mui-builder/node_modules/@mui/material/index.d.ts","/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabs/tabs.types.ts"],"map":"{\"version\":3,\"file\":\"useTabs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efined/placeholder/src/components/tabs/useTabs.d.ts","writeByteOrderMark":false,"text":"import React from 'react';\nimport { TabsProps as TabsPropsMui } from '@mui/material';\nimport { TabProps as TabPropsMui } from '@mui/material';\nimport { TabData, TabsProps } from './tabs.types';\ndeclare const useTabs: (props: TabsProps) => {\n DeleteIcon: string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null;\n AddIcon: string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null;\n tabs: TabData[];\n showDeleteIcon: (index: number) => boolean;\n addable: boolean;\n getTabsProps: () => TabsPropsMui;\n getTabProps: (tab: TabData, index: number) => TabPropsMui;\n getDeleteTabProps: (index: number) => {\n onClick: () => void;\n style: {\n fontSize: string;\n };\n };\n getAddTabProps: () => {\n onClick: () => void;\n sx: {\n width: string;\n };\n };\n getTabPanelProps: (index: number) => {\n key: number;\n value: number | null;\n index: number;\n };\n};\nexport default useTabs;\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Tab } from '@mui/material';\nimport IconButton from '@mui/material/IconButton';\nimport TabsMui from '@mui/material/Tabs';\nimport TabPanel from '../tabPanel/tabPanel';\nimport useTabs from './useTabs';\nconst Tabs = (props) => {\n const { AddIcon, DeleteIcon, addable, tabs, getTabsProps, getTabProps, getDeleteTabProps, showDeleteIcon, getAddTabProps, getTabPanelProps, } = useTabs(props);\n return (_jsxs(\"div\", { children: [_jsxs(TabsMui, Object.assign({}, getTabsProps(), { children: [tabs.map((tab, index) => (_jsx(Tab, Object.assign({}, getTabProps(tab, index), { icon: _jsx(\"span\", Object.assign({}, getDeleteTabProps(index), { children: showDeleteIcon(index) && DeleteIcon })) })))), addable && _jsx(IconButton, Object.assign({}, getAddTabProps(), { children: \"AddIcon\" }))] })), tabs.map((tab, index) => (_jsx(TabPanel, Object.assign({}, getTabPanelProps(index), { children: tab.chidlren }))))] }));\n};\nexport default Tabs;\n//# sourceMappingURL=tabs.js.map","references":["/home/mrbadri/code/startup/mui-builder/node_modules/@types/react/index.d.ts","/home/mrbadri/code/startup/mui-builder/node_modules/@mui/material/index.d.ts","/home/mrbadri/code/startup/mui-builder/node_modules/@mui/material/IconButton/index.d.ts","/home/mrbadri/code/startup/mui-builder/node_modules/@mui/material/Tabs/index.d.ts","/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabs/tabs.types.ts","/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabPanel/tabPanel.tsx","/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabs/useTabs.tsx"],"map":"{\"version\":3,\"file\":\"tabs.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../packages/tab/src/components/tabs/tabs.tsx\"],\"names\":[],\"mappings\":\";AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAIzC,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,MAAM,IAAI,GAAwB,CAAC,KAAK,EAAE,EAAE;IAC1C,MAAM,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEnB,OAAO,CACL,0BACE,MAAC,OAAO,oBAAK,YAAY,EAAE,eAExB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,KAAC,GAAG,oBACE,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,IAC3B,IAAI,EACF,+BAAU,iBAAiB,CAAC,KAAK,CAAC,cAC/B,cAAc,CAAC,KAAK,CAAC,IAAI,UAAU,IAC/B,IAET,CACH,CAAC,EAED,OAAO,IAAI,KAAC,UAAU,oBAAK,cAAc,EAAE,2BAAsB,KAC1D,EAGT,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,KAAC,QAAQ,oBAAK,gBAAgB,CAAC,KAAK,CAAC,cAAG,GAAG,CAAC,QAAQ,IAAY,CACjE,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC\"}","dts":{"name":"undefined/placeholder/src/components/tabs/tabs.d.ts","writeByteOrderMark":false,"text":"import React from 'react';\nimport { TabsProps } from './tabs.types';\ndeclare const Tabs: React.FC<TabsProps>;\nexport default Tabs;\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"const useTabPanel = (props) => {\n const { children, value, index } = props;\n const show = value === index;\n const getContainerProps = () => ({\n role: 'tabpanel',\n hidden: value !== index,\n id: `tabpanel-${index}`,\n 'aria-labelledby': `tab-${index}`,\n });\n return {\n show,\n children,\n getContainerProps,\n };\n};\nexport default useTabPanel;\n//# sourceMappingURL=useTabPanel.js.map","references":["/home/mrbadri/code/startup/mui-builder/packages/tab/src/components/tabPanel/tabPanel.types.ts"],"map":"{\"version\":3,\"file\":\"useTabPanel.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../packages/tab/src/components/tabPanel/useTabPanel.ts\"],\"names\":[],\"mappings\":\"AAEA,MAAM,WAAW,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC3C,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEzC,MAAM,IAAI,GAAG,KAAK,KAAK,KAAK,CAAC;IAE7B,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CAAC;QAC/B,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,KAAK,KAAK,KAAK;QACvB,EAAE,EAAE,YAAY,KAAK,EAAE;QACvB,iBAAiB,EAAE,OAAO,KAAK,EAAE;KAClC,CAAC,CAAC;IAEH,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,iBAAiB;KAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC\"}","dts":{"name":"undefined/placeholder/src/components/tabPanel/useTabPanel.d.ts","writeByteOrderMark":false,"text":"/// <reference types=\"react\" />\nimport { TabPanelProps } from './tabPanel.types';\ndeclare const useTabPanel: (props: TabPanelProps) => {\n show: boolean;\n children: import(\"react\").ReactNode;\n getContainerProps: () => {\n role: string;\n hidden: boolean;\n id: string;\n 'aria-labelledby': string;\n };\n};\nexport default useTabPanel;\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"export {};\n//# sourceMappingURL=tabs.types.js.map","references":["/home/mrbadri/code/startup/mui-builder/node_modules/@types/react/index.d.ts","/home/mrbadri/code/startup/mui-builder/node_modules/@mui/material/index.d.ts"],"map":"{\"version\":3,\"file\":\"tabs.types.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../packages/tab/src/components/tabs/tabs.types.ts\"],\"names\":[],\"mappings\":\"\"}","dts":{"name":"undefined/placeholder/src/components/tabs/tabs.types.d.ts","writeByteOrderMark":false,"text":"import { ReactNode } from 'react';\nimport { TabProps as TabPropsMui } from '@mui/material';\nexport type TabData = {\n label: string;\n chidlren: ReactNode;\n};\nexport type TabProps = TabPropsMui & {\n tab: TabData;\n index: number;\n setTabs: React.Dispatch<React.SetStateAction<TabData[]>>;\n tabs: TabData[];\n value: number | null;\n setValue: React.Dispatch<React.SetStateAction<number | null>>;\n};\nexport type TabsProps = {\n tabs: TabData[];\n setTabs: React.Dispatch<React.SetStateAction<TabData[]>>;\n onAdd?: () => void;\n addable?: boolean;\n AddIcon?: ReactNode;\n DeleteIcon?: ReactNode;\n};\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"export {};\n//# sourceMappingURL=validation.types.js.map","references":["/home/mrbadri/code/startup/mui-builder/node_modules/react-hook-form/dist/index.d.ts"],"map":"{\"version\":3,\"file\":\"validation.types.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../../packages/core/src/modules/form/src/types/validation.types.ts\"],\"names\":[],\"mappings\":\"\"}","dts":{"name":"undefined/placeholder/src/modules/form/src/types/validation.types.d.ts","writeByteOrderMark":false,"text":"import { FieldPath, FieldPathValue, FieldValues, RegisterOptions, ValidateResult } from 'react-hook-form';\nexport type Validate = (value: FieldPathValue<FieldValues, FieldPath<FieldValues>>, formValues: FieldValues) => ValidateResult | Promise<ValidateResult>;\nexport type MainRule = Omit<RegisterOptions<FieldValues, string>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled'> | undefined;\nexport type Rule = Omit<MainRule, 'validate'> & {\n validate?: string | Validate;\n};\n"}}
Loading

0 comments on commit b3fa74d

Please sign in to comment.