linkup-lib 0.1.20 → 0.1.22
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.
|
@@ -75,9 +75,9 @@ const Menu = ({ menu, primaryColor, }) => {
|
|
|
75
75
|
const isActive = (0, react_2.useMemo)(() => {
|
|
76
76
|
if (!pathname)
|
|
77
77
|
return "";
|
|
78
|
-
return pathname.startsWith(menu.key);
|
|
78
|
+
return pathname.startsWith('/' + menu.key);
|
|
79
79
|
}, [pathname, menu.key]);
|
|
80
|
-
const [open, setOpen] = (0, react_2.useState)(
|
|
80
|
+
const [open, setOpen] = (0, react_2.useState)(isActive);
|
|
81
81
|
const router = (0, navigation_1.useRouter)();
|
|
82
82
|
return ((0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
83
83
|
height: 48,
|
|
@@ -99,7 +99,7 @@ const Menu = ({ menu, primaryColor, }) => {
|
|
|
99
99
|
router.push(`/${menu.key}`);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
}, children: [(0, jsx_runtime_1.jsx)("
|
|
102
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { color: isActive ? primaryColor : 'white', fontWeight: 'bold', fontSize: '15px', }, children: menu.label }), menu.items && menu.items.length > 0 ?
|
|
103
103
|
(0, jsx_runtime_1.jsx)(fi_1.FiChevronDown, { style: { color: '#6B7280', transition: '300ms', rotate: open ? '180deg' : '0deg' } })
|
|
104
104
|
: null] }), menu.items ?
|
|
105
105
|
(0, jsx_runtime_1.jsx)("ul", { style: {
|
|
@@ -122,7 +122,6 @@ const SubMenu = ({ menu, primaryColor }) => {
|
|
|
122
122
|
if (!pathname)
|
|
123
123
|
return "";
|
|
124
124
|
const pathArr = pathname.split('/');
|
|
125
|
-
console.log(`${pathname}`, `/${menu.key}`);
|
|
126
125
|
if (pathArr[1] === "")
|
|
127
126
|
return false;
|
|
128
127
|
else
|
|
@@ -58,6 +58,12 @@ export interface Props<T> {
|
|
|
58
58
|
selectedKeys?: React.Key[];
|
|
59
59
|
onChangeSelectedKey?: (selectedKeys: React.Key[], selectedRows: T[]) => void;
|
|
60
60
|
buttons?: React.ReactNode[];
|
|
61
|
+
virtual?: boolean;
|
|
62
|
+
pagination?: boolean;
|
|
63
|
+
scroll?: {
|
|
64
|
+
x: number | string;
|
|
65
|
+
y: number | string;
|
|
66
|
+
};
|
|
61
67
|
}
|
|
62
|
-
declare const Component: <T>({ rowKey, primaryColor, searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
declare const Component: <T>({ rowKey, primaryColor, searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons, virtual, pagination, scroll }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
63
69
|
export default Component;
|
|
@@ -13,7 +13,7 @@ const bs_1 = require("react-icons/bs");
|
|
|
13
13
|
const jotai_1 = require("jotai");
|
|
14
14
|
const util_1 = __importDefault(require("../../util"));
|
|
15
15
|
exports.hideOptionAtom = (0, jotai_1.atom)(false);
|
|
16
|
-
const Component = ({ rowKey, primaryColor = '#3875F7', searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons }) => {
|
|
16
|
+
const Component = ({ rowKey, primaryColor = '#3875F7', searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons, virtual = false, pagination = true, scroll }) => {
|
|
17
17
|
var _a, _b, _c;
|
|
18
18
|
// 상세 검색 열기/닫기
|
|
19
19
|
const [hideOption, setHideOption] = (0, jotai_1.useAtom)(exports.hideOptionAtom);
|
|
@@ -133,17 +133,17 @@ const Component = ({ rowKey, primaryColor = '#3875F7', searchParams, fetch, colu
|
|
|
133
133
|
}, children: "\uCD08\uAE30\uD654" }), (0, jsx_runtime_1.jsx)(antd_1.Button, { loading: fetch.isFetching, type: "primary", size: "middle", style: { width: 100 }, onClick: onSearch, children: "\uAC80\uC0C9" }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: 'flex', justifyContent: 'flex-end' }, children: (0, jsx_runtime_1.jsxs)(antd_1.Button, { size: "middle", onClick: () => setHideOption(!hideOption), children: [hideOption ? '상세 검색 펼치기' : '상세 검색 접기', (0, jsx_runtime_1.jsx)(bs_1.BsChevronDown, { style: { color: '#999', transform: hideOption ? 'rotate(0deg)' : 'rotate(180deg)', transition: 'transform 0.3s' } })] }) })] })] }), (0, jsx_runtime_1.jsx)("div", { style: { height: 12 } }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
134
134
|
background: 'white',
|
|
135
135
|
border: '1px solid #E3E6ED'
|
|
136
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { padding: '20px 30px 16px', borderBottom: '1px solid #E3E6ED', display: 'flex', alignItems: 'center' }, children: [(0, jsx_runtime_1.jsxs)("p", { style: { fontSize: 16 }, children: ["\uBAA9\uB85D ( \uCD1D ", (0, jsx_runtime_1.jsx)("span", { style: { color: primaryColor, fontWeight: '600' }, children: util_1.default.format.comma(((_b = fetch.data) === null || _b === void 0 ? void 0 : _b.total) || 0) }), " \uAC1C )"] }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: 'flex', justifyContent: 'flex-end', gap: 8 }, children: buttons })] }), (0, jsx_runtime_1.jsx)("div", { style: { padding: '20px 30px 16px' }, children: (0, jsx_runtime_1.jsx)(antd_1.Table, { rowSelection: onChangeSelectedKey || selectedKeys ? {
|
|
136
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { padding: '20px 30px 16px', borderBottom: '1px solid #E3E6ED', display: 'flex', alignItems: 'center' }, children: [(0, jsx_runtime_1.jsxs)("p", { style: { fontSize: 16 }, children: ["\uBAA9\uB85D ( \uCD1D ", (0, jsx_runtime_1.jsx)("span", { style: { color: primaryColor, fontWeight: '600' }, children: util_1.default.format.comma(((_b = fetch.data) === null || _b === void 0 ? void 0 : _b.total) || 0) }), " \uAC1C )"] }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: 'flex', justifyContent: 'flex-end', gap: 8 }, children: buttons })] }), (0, jsx_runtime_1.jsx)("div", { style: { padding: '20px 30px 16px' }, children: (0, jsx_runtime_1.jsx)(antd_1.Table, { virtual: virtual, rowSelection: onChangeSelectedKey || selectedKeys ? {
|
|
137
137
|
selectedRowKeys: selectedKeys,
|
|
138
138
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
139
139
|
onChangeSelectedKey && onChangeSelectedKey(selectedRowKeys, selectedRows);
|
|
140
140
|
},
|
|
141
|
-
} : undefined, rowKey: (r) => r[rowKey], bordered: true, loading: fetch.isFetching, dataSource: ((_c = fetch.data) === null || _c === void 0 ? void 0 : _c.dataSet) || [], columns: columns, scroll: { x: 1024, y: 500 }, showSorterTooltip: false, sortDirections: ['descend', 'ascend'], pagination: {
|
|
141
|
+
} : undefined, rowKey: (r) => r[rowKey], bordered: true, loading: fetch.isFetching, dataSource: ((_c = fetch.data) === null || _c === void 0 ? void 0 : _c.dataSet) || [], columns: columns, scroll: scroll ? scroll : { x: 1024, y: 500 }, showSorterTooltip: false, sortDirections: ['descend', 'ascend'], pagination: pagination ? {
|
|
142
142
|
current: parseInt(searchParams.page || '1'),
|
|
143
143
|
pageSize: parseInt(searchParams.limit || '10'),
|
|
144
144
|
total: total,
|
|
145
145
|
showSizeChanger: true,
|
|
146
146
|
pageSizeOptions: ['10', '20', '50', '100'],
|
|
147
|
-
}, onChange: onChangeGrid }) })] })] }));
|
|
147
|
+
} : false, onChange: onChangeGrid }) })] })] }));
|
|
148
148
|
};
|
|
149
149
|
exports.default = Component;
|
package/dist/index.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ declare const _default: {
|
|
|
102
102
|
PageTitle: ({ title, section1, section2 }: import("./components/ui/PageTitle").PageTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
103
103
|
LinkupProvider: ({ size, children, color, theme }: import("./components/registry/Registry").Props) => import("react/jsx-runtime").JSX.Element;
|
|
104
104
|
Checkbox: ({ label, checked, primaryColor, onChange, loading }: import("./components/ui/Checkbox").Props) => import("react/jsx-runtime").JSX.Element;
|
|
105
|
-
Grid: <T>({ rowKey, primaryColor, searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons }: import("./components/ui/Grid").Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
Grid: <T>({ rowKey, primaryColor, searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons, virtual, pagination, scroll }: import("./components/ui/Grid").Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
106
106
|
DescriptionItem: ({ title, children, required, bordered }: import("./components/ui/DescriptionItem").Props) => import("react/jsx-runtime").JSX.Element;
|
|
107
107
|
DescriptionCard: ({ title, defaultOpen, children, required }: import("./components/ui/DescriptionCard").Props) => import("react/jsx-runtime").JSX.Element;
|
|
108
108
|
Editor: ({ value, onChange, placeholder, readOnly, height, maxHeight, className }: import("./components/ui/Editor").EditorProps) => import("react/jsx-runtime").JSX.Element;
|