linkup-lib 0.1.17 → 0.1.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/components/ui/Aside.d.ts +5 -2
- package/dist/components/ui/Aside.js +23 -6
- package/dist/components/ui/Grid.d.ts +3 -2
- package/dist/components/ui/Grid.js +5 -4
- package/dist/components/ui/Logo.d.ts +2 -0
- package/dist/components/ui/Logo.js +10 -0
- package/dist/image.d.ts +2 -2
- package/dist/image.js +1 -1
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export declare const asideAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
2
3
|
init: boolean;
|
|
3
4
|
};
|
|
4
5
|
interface MenusProps {
|
|
5
6
|
key: string;
|
|
6
|
-
label:
|
|
7
|
+
label: React.ReactNode;
|
|
7
8
|
items?: MenusProps[];
|
|
9
|
+
onClick?: () => void;
|
|
8
10
|
}
|
|
9
11
|
export interface AsideProps {
|
|
10
12
|
primaryColor?: string;
|
|
11
13
|
menus: MenusProps[];
|
|
14
|
+
settingsUrl?: string;
|
|
12
15
|
}
|
|
13
|
-
declare const Component: ({ primaryColor, menus }: AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const Component: ({ primaryColor, menus, settingsUrl }: AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
export default Component;
|
|
@@ -10,8 +10,10 @@ const fi_1 = require("react-icons/fi");
|
|
|
10
10
|
const im_1 = require("react-icons/im");
|
|
11
11
|
const jotai_1 = require("jotai");
|
|
12
12
|
exports.asideAtom = (0, jotai_1.atom)(true);
|
|
13
|
-
const Component = ({ primaryColor = "#E2702F", menus }) => {
|
|
13
|
+
const Component = ({ primaryColor = "#E2702F", menus, settingsUrl }) => {
|
|
14
14
|
var _a;
|
|
15
|
+
// 라우터
|
|
16
|
+
const router = (0, navigation_1.useRouter)();
|
|
15
17
|
// 세션
|
|
16
18
|
const session = (0, react_1.useSession)();
|
|
17
19
|
const user = (_a = session.data) === null || _a === void 0 ? void 0 : _a.user;
|
|
@@ -52,14 +54,22 @@ const Component = ({ primaryColor = "#E2702F", menus }) => {
|
|
|
52
54
|
alignItems: 'flex-end',
|
|
53
55
|
justifyContent: 'center',
|
|
54
56
|
overflow: 'hidden',
|
|
55
|
-
|
|
57
|
+
cursor: settingsUrl ? 'pointer' : 'default',
|
|
58
|
+
}, onClick: () => settingsUrl && router.push(settingsUrl), children: (0, jsx_runtime_1.jsx)(im_1.ImUser, { style: { fontSize: 75, color: "#C7CAD2", transform: "translateY(6px)" } }) }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
width: '100%',
|
|
63
|
+
gap: 6,
|
|
64
|
+
cursor: settingsUrl ? 'pointer' : 'default',
|
|
65
|
+
}, onClick: () => settingsUrl && router.push(settingsUrl), children: (0, jsx_runtime_1.jsx)("p", { style: { color: 'white', fontSize: 15, fontWeight: 'bold' }, children: user ? user.name : "" }) }), (0, jsx_runtime_1.jsx)("p", { style: { color: '#bbb', fontSize: 12 }, children: user ? user.levelName : "" })] }), (0, jsx_runtime_1.jsx)("ul", { style: {
|
|
56
66
|
borderTop: '1px solid #5F6673',
|
|
57
67
|
}, children: menus.map((r, idx) => {
|
|
58
68
|
return ((0, jsx_runtime_1.jsx)(Menu, { menu: r, primaryColor: primaryColor }, `menu-${r.key}`));
|
|
59
69
|
}) })] })] }));
|
|
60
70
|
};
|
|
61
71
|
// 메뉴 컴포넌트
|
|
62
|
-
const Menu = ({ menu, primaryColor }) => {
|
|
72
|
+
const Menu = ({ menu, primaryColor, }) => {
|
|
63
73
|
// 활성 메뉴
|
|
64
74
|
const pathname = (0, navigation_1.usePathname)();
|
|
65
75
|
const isActive = (0, react_2.useMemo)(() => {
|
|
@@ -84,8 +94,14 @@ const Menu = ({ menu, primaryColor }) => {
|
|
|
84
94
|
}, onClick: () => {
|
|
85
95
|
if (menu.items && menu.items.length > 0)
|
|
86
96
|
setOpen(!open);
|
|
87
|
-
else
|
|
88
|
-
|
|
97
|
+
else {
|
|
98
|
+
if (menu.onClick) {
|
|
99
|
+
menu.onClick();
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
router.push(`/${menu.key}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
89
105
|
}, children: [(0, jsx_runtime_1.jsx)("p", { style: { color: isActive ? primaryColor : 'white', fontWeight: 'bold', fontSize: '15px', }, children: menu.label }), menu.items && menu.items.length > 0 ?
|
|
90
106
|
(0, jsx_runtime_1.jsx)(fi_1.FiChevronDown, { style: { color: '#6B7280', transition: '300ms', rotate: open ? '180deg' : '0deg' } })
|
|
91
107
|
: null] }), menu.items ?
|
|
@@ -109,10 +125,11 @@ const SubMenu = ({ menu, primaryColor }) => {
|
|
|
109
125
|
if (!pathname)
|
|
110
126
|
return "";
|
|
111
127
|
const pathArr = pathname.split('/');
|
|
128
|
+
console.log(`${pathname}`, `/${menu.key}`);
|
|
112
129
|
if (pathArr[1] === "")
|
|
113
130
|
return false;
|
|
114
131
|
else
|
|
115
|
-
return `${pathname}` === menu.key
|
|
132
|
+
return `${pathname}` === `/${menu.key}`;
|
|
116
133
|
}, [pathname, menu.key]);
|
|
117
134
|
return ((0, jsx_runtime_1.jsx)("li", { style: {
|
|
118
135
|
height: 48,
|
|
@@ -55,8 +55,9 @@ export interface Props<T> {
|
|
|
55
55
|
onSearch: () => void;
|
|
56
56
|
onInitFilter: () => void;
|
|
57
57
|
onChangeGrid: (pagination: any, filters: any, sorter: any, extra: any) => void;
|
|
58
|
-
|
|
58
|
+
selectedKeys?: React.Key[];
|
|
59
|
+
onChangeSelectedKey?: (selectedKeys: React.Key[], selectedRows: T[]) => void;
|
|
59
60
|
buttons?: React.ReactNode[];
|
|
60
61
|
}
|
|
61
|
-
declare const Component: <T>({ rowKey, primaryColor, searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, onChangeSelectedKey, buttons }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
62
63
|
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, onChangeSelectedKey, buttons }) => {
|
|
16
|
+
const Component = ({ rowKey, primaryColor = '#3875F7', searchParams, fetch, columns, searchFilter, onSearch, onInitFilter, onChangeGrid, selectedKeys, onChangeSelectedKey, buttons }) => {
|
|
17
17
|
var _a, _b, _c;
|
|
18
18
|
// 상세 검색 열기/닫기
|
|
19
19
|
const [hideOption, setHideOption] = (0, jotai_1.useAtom)(exports.hideOptionAtom);
|
|
@@ -133,9 +133,10 @@ 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 ? {
|
|
137
|
-
|
|
138
|
-
|
|
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 ? {
|
|
137
|
+
selectedRowKeys: selectedKeys,
|
|
138
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
139
|
+
onChangeSelectedKey && onChangeSelectedKey(selectedRowKeys, selectedRows);
|
|
139
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
142
|
current: parseInt(searchParams.page || '1'),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const google_1 = require("next/font/google");
|
|
6
|
+
const cairoPlay = (0, google_1.Cairo_Play)({ subsets: ['latin'], weight: ['400', '700', '900'], adjustFontFallback: false });
|
|
7
|
+
const Component = () => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h1", { className: `text-2xl font-bold text-[#EEEEEE] cursor-pointer pl-4 ${cairoPlay.className}`, children: "DRINKiT" }) }));
|
|
9
|
+
};
|
|
10
|
+
exports.default = Component;
|
package/dist/image.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare const convertWebpAndUploadBuffer: ({ buffer, path, fileName, size
|
|
|
56
56
|
}>;
|
|
57
57
|
export declare const uploadS3Object: ({ file, type, sizes }: {
|
|
58
58
|
file: File;
|
|
59
|
-
type: "00" | "01" | "02" | "03";
|
|
59
|
+
type: "00" | "01" | "02" | "03" | "04";
|
|
60
60
|
sizes: number[];
|
|
61
61
|
}) => Promise<{
|
|
62
62
|
url: string;
|
|
@@ -72,7 +72,7 @@ export declare const deleteS3Object: (key: string) => Promise<{
|
|
|
72
72
|
declare const _default: {
|
|
73
73
|
uploadS3Object: ({ file, type, sizes }: {
|
|
74
74
|
file: File;
|
|
75
|
-
type: "00" | "01" | "02" | "03";
|
|
75
|
+
type: "00" | "01" | "02" | "03" | "04";
|
|
76
76
|
sizes: number[];
|
|
77
77
|
}) => Promise<{
|
|
78
78
|
url: string;
|
package/dist/image.js
CHANGED
|
@@ -154,7 +154,7 @@ const uploadS3Object = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file
|
|
|
154
154
|
throw new Error('이미지 변환에 실패했습니다.');
|
|
155
155
|
}
|
|
156
156
|
let filename = (0, dayjs_1.default)().format('YYYYMMDDHHmmssSSS');
|
|
157
|
-
let path = type === "00" ? "bizImage" : type === "01" ? "displayImage" : type === "02" ? "storeImage" : type === "03" ? "productImage" : "";
|
|
157
|
+
let path = type === "00" ? "bizImage" : type === "01" ? "displayImage" : type === "02" ? "storeImage" : type === "03" ? "productImage" : type === "04" ? "qna" : "";
|
|
158
158
|
if (path === "") {
|
|
159
159
|
throw new Error('잘못된 이미지 타입입니다.');
|
|
160
160
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ declare const _default: {
|
|
|
81
81
|
image: {
|
|
82
82
|
uploadS3Object: ({ file, type, sizes }: {
|
|
83
83
|
file: File;
|
|
84
|
-
type: "00" | "01" | "02" | "03";
|
|
84
|
+
type: "00" | "01" | "02" | "03" | "04";
|
|
85
85
|
sizes: number[];
|
|
86
86
|
}) => Promise<{
|
|
87
87
|
url: string;
|
|
@@ -97,12 +97,12 @@ declare const _default: {
|
|
|
97
97
|
};
|
|
98
98
|
Header: ({ logo }: import("./components/ui/Header").HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
99
99
|
Header2: ({ logo }: import("./components/ui/Header2").Header2Props) => import("react/jsx-runtime").JSX.Element;
|
|
100
|
-
Aside: ({ primaryColor, menus }: import("./components/ui/Aside").AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
100
|
+
Aside: ({ primaryColor, menus, settingsUrl }: import("./components/ui/Aside").AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
101
101
|
Page: ({ children }: import("./components/ui/Page").PageProps) => import("react/jsx-runtime").JSX.Element;
|
|
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, 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 }: 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;
|