linkup-lib 0.1.21 → 0.1.23
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/components/ui/Aside.js +2 -3
- package/dist/components/ui/Grid.d.ts +12 -1
- package/dist/components/ui/Grid.js +16 -13
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -75,7 +75,7 @@ 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
80
|
const [open, setOpen] = (0, react_2.useState)(isActive);
|
|
81
81
|
const router = (0, navigation_1.useRouter)();
|
|
@@ -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,17 @@ 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
|
+
};
|
|
67
|
+
isFullScreen?: {
|
|
68
|
+
open: boolean;
|
|
69
|
+
close: () => void;
|
|
70
|
+
size: number;
|
|
71
|
+
} | undefined;
|
|
61
72
|
}
|
|
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;
|
|
73
|
+
declare const Component: <T>({ rowKey, primaryColor, searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons, virtual, pagination, scroll, isFullScreen }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
63
74
|
export default Component;
|
|
@@ -12,8 +12,9 @@ const dayjs_1 = __importDefault(require("dayjs"));
|
|
|
12
12
|
const bs_1 = require("react-icons/bs");
|
|
13
13
|
const jotai_1 = require("jotai");
|
|
14
14
|
const util_1 = __importDefault(require("../../util"));
|
|
15
|
+
const ri_1 = require("react-icons/ri");
|
|
15
16
|
exports.hideOptionAtom = (0, jotai_1.atom)(false);
|
|
16
|
-
const Component = ({ rowKey, primaryColor = '#3875F7', searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons }) => {
|
|
17
|
+
const Component = ({ rowKey, primaryColor = '#3875F7', searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons, virtual = false, pagination = true, scroll, isFullScreen = undefined }) => {
|
|
17
18
|
var _a, _b, _c;
|
|
18
19
|
// 상세 검색 열기/닫기
|
|
19
20
|
const [hideOption, setHideOption] = (0, jotai_1.useAtom)(exports.hideOptionAtom);
|
|
@@ -133,17 +134,19 @@ const Component = ({ rowKey, primaryColor = '#3875F7', searchParams, fetch, colu
|
|
|
133
134
|
}, 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
135
|
background: 'white',
|
|
135
136
|
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.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
137
|
+
}, 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.jsxs)("div", { style: (isFullScreen === null || isFullScreen === void 0 ? void 0 : isFullScreen.open) ? { position: 'fixed', top: 0, left: 0, width: '100dvw', height: '100dvh', zIndex: 999, background: '#FFF', padding: 24 } : { padding: '20px 30px 16px' }, children: [(isFullScreen === null || isFullScreen === void 0 ? void 0 : isFullScreen.open) && ((0, jsx_runtime_1.jsx)("div", { className: "pr-6 pb-6 flex items-center justify-end", children: (0, jsx_runtime_1.jsx)(antd_1.Button, { size: "middle", icon: (0, jsx_runtime_1.jsx)(ri_1.RiFullscreenExitLine, {}), onClick: () => {
|
|
138
|
+
(isFullScreen === null || isFullScreen === void 0 ? void 0 : isFullScreen.open) && isFullScreen.close();
|
|
139
|
+
}, children: "\uCC3D\uB2EB\uAE30" }) })), (0, jsx_runtime_1.jsx)(antd_1.Table, { virtual: virtual, rowSelection: onChangeSelectedKey || selectedKeys ? {
|
|
140
|
+
selectedRowKeys: selectedKeys,
|
|
141
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
142
|
+
onChangeSelectedKey && onChangeSelectedKey(selectedRowKeys, selectedRows);
|
|
143
|
+
},
|
|
144
|
+
} : 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: (isFullScreen === null || isFullScreen === void 0 ? void 0 : isFullScreen.open) ? { x: 1024, y: isFullScreen.size } : scroll ? scroll : { x: 1024, y: 500 }, showSorterTooltip: false, sortDirections: ['descend', 'ascend'], pagination: pagination ? {
|
|
145
|
+
current: parseInt(searchParams.page || '1'),
|
|
146
|
+
pageSize: parseInt(searchParams.limit || '10'),
|
|
147
|
+
total: total,
|
|
148
|
+
showSizeChanger: true,
|
|
149
|
+
pageSizeOptions: ['10', '20', '50', '100'],
|
|
150
|
+
} : false, onChange: onChangeGrid })] })] })] }));
|
|
148
151
|
};
|
|
149
152
|
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, isFullScreen }: 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;
|