@lotte-innovate/ui-component-test 0.2.70 → 0.2.72
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +225 -226
- package/dist/globals.css +4 -4
- package/dist/lib/color/constants.js +1 -1
- package/dist/lib/color/constants.mjs +1 -1
- package/dist/lib/color/constants.mjs.map +1 -1
- package/dist/lib/components/Avatar/index.js +1 -0
- package/dist/lib/components/Avatar/index.mjs +1 -1
- package/dist/lib/components/Badge/index.js +3 -3
- package/dist/lib/components/Badge/index.mjs +1 -1
- package/dist/lib/components/Box/index.js +2 -2
- package/dist/lib/components/Box/index.mjs +1 -1
- package/dist/lib/components/Box/index.mjs.map +1 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbLink.js +2 -2
- package/dist/lib/components/Breadcrumb/BreadcrumbLink.mjs +1 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbLink.mjs.map +1 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbPage.js +3 -3
- package/dist/lib/components/Breadcrumb/BreadcrumbPage.mjs +1 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbPage.mjs.map +1 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbRoot.js +2 -2
- package/dist/lib/components/Breadcrumb/BreadcrumbRoot.mjs +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +1 -1
- package/dist/lib/components/CheckboxGroup/index.d.ts +1 -1
- package/dist/lib/components/Container/index.js +2 -2
- package/dist/lib/components/Container/index.mjs +1 -1
- package/dist/lib/components/Container/index.mjs.map +1 -1
- package/dist/lib/components/Datepicker/index.d.ts +2 -1
- package/dist/lib/components/Datepicker/index.js +2 -2
- package/dist/lib/components/Datepicker/index.mjs +1 -1
- package/dist/lib/components/Dialog/DialogRoot.d.ts +4 -3
- package/dist/lib/components/Dialog/index.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.js +3 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.mjs +1 -1
- package/dist/lib/components/Editor/index.d.ts +0 -1
- package/dist/lib/components/Editor/index.js +11 -2
- package/dist/lib/components/Editor/index.mjs +1 -1
- package/dist/lib/components/Flex/index.js +2 -2
- package/dist/lib/components/Flex/index.mjs +1 -1
- package/dist/lib/components/Flex/index.mjs.map +1 -1
- package/dist/lib/components/Gnb/GnbInfo.js +2 -2
- package/dist/lib/components/Gnb/GnbInfo.mjs +1 -1
- package/dist/lib/components/Gnb/GnbLogo.js +1 -1
- package/dist/lib/components/Gnb/GnbLogo.mjs +1 -1
- package/dist/lib/components/Gnb/GnbLogo.mjs.map +1 -1
- package/dist/lib/components/Gnb/GnbMenuItem.js +1 -1
- package/dist/lib/components/Gnb/GnbMenuItem.mjs +1 -1
- package/dist/lib/components/Grid/NumberingPagination.js +64 -22
- package/dist/lib/components/Grid/NumberingPagination.mjs +1 -1
- package/dist/lib/components/Grid/NumberingPagination.mjs.map +1 -1
- package/dist/lib/components/Grid/index.d.ts +1 -0
- package/dist/lib/components/Grid/index.js +56 -38
- package/dist/lib/components/Grid/index.mjs +1 -1
- package/dist/lib/components/Grid/useGrid.js +30 -14
- package/dist/lib/components/Grid/useGrid.mjs +1 -1
- package/dist/lib/components/IconButton/index.js +10 -10
- package/dist/lib/components/IconButton/index.mjs +1 -1
- package/dist/lib/components/Modal/ModalRoot.d.ts +2 -2
- package/dist/lib/components/Radio/index.js +2 -2
- package/dist/lib/components/Radio/index.mjs +1 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +3 -1
- package/dist/lib/components/RadioCards/index.d.ts +1 -1
- package/dist/lib/components/SearchBar/index.js +2 -2
- package/dist/lib/components/SearchBar/index.mjs +1 -1
- package/dist/lib/components/Select/index.d.ts +4 -4
- package/dist/lib/components/Select/index.js +2 -2
- package/dist/lib/components/Select/index.mjs +1 -1
- package/dist/lib/components/Separator/index.d.ts +1 -1
- package/dist/lib/components/SideBar/index.d.ts +27 -0
- package/dist/lib/components/SideBar/index.js +20 -5
- package/dist/lib/components/SideBar/index.mjs +1 -1
- package/dist/lib/components/Slider/index.d.ts +1 -1
- package/dist/lib/components/Table/index.d.ts +1 -1
- package/dist/lib/components/Table/index.js +17 -10
- package/dist/lib/components/Table/index.mjs +1 -1
- package/dist/lib/components/Tabs/DynamicTabs.d.ts +4 -2
- package/dist/lib/components/Tabs/DynamicTabs.js +21 -16
- package/dist/lib/components/Tabs/DynamicTabs.mjs +1 -1
- package/dist/lib/components/TextField/index.js +2 -0
- package/dist/lib/components/TextField/index.mjs +1 -1
- package/dist/lib/components/Tree/index.d.ts +1 -2
- package/dist/lib/components/Tree/index.js +3 -2
- package/dist/lib/components/Tree/index.mjs +1 -1
- package/dist/lib/components/Tree/index.mjs.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/lib/utils/useLoadTinyMCE.d.ts +1 -37
- package/dist/lib/utils/useLoadTinyMCE.js +151 -36
- package/dist/lib/utils/useLoadTinyMCE.mjs +2 -0
- package/dist/lib/utils/useLoadTinyMCE.mjs.map +1 -0
- package/dist/lib/utils/useWindowSize.d.ts +1 -0
- package/dist/lib/utils/useWindowSize.js +17 -18
- package/dist/lib/utils/useWindowSize.mjs +2 -0
- package/dist/lib/utils/useWindowSize.mjs.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +150 -150
- package/dist/lib/node_modules/react-complex-tree/lib/style-modern.mjs +0 -2
- package/dist/lib/node_modules/react-complex-tree/lib/style-modern.mjs.map +0 -1
- package/dist/lib/node_modules/style-inject/dist/style-inject.es.mjs +0 -2
- package/dist/lib/node_modules/style-inject/dist/style-inject.es.mjs.map +0 -1
@@ -28,6 +28,8 @@ import { cn } from '../../../lib/utils/utils';
|
|
28
28
|
import { bgColorStyle, scalingVariants } from '../../../lib/constants';
|
29
29
|
import { useTheme } from '../../../lib/theme';
|
30
30
|
import * as ReactProSidebar from 'react-pro-sidebar';
|
31
|
+
import { menuClasses, sidebarClasses } from 'react-pro-sidebar';
|
32
|
+
import { useWindowSize } from '../../../lib/utils/useWindowSize';
|
31
33
|
import * as alphaColors from '../../../lib/color/alpha';
|
32
34
|
var sidebarVariants = cva('', {
|
33
35
|
variants: {
|
@@ -39,17 +41,19 @@ export var Root = React.forwardRef(function (_a, forwardedRef) {
|
|
39
41
|
var _b;
|
40
42
|
var scaling = _a.scaling, size = _a.size, color = _a.color, className = _a.className, children = _a.children, props = __rest(_a, ["scaling", "size", "color", "className", "children"]);
|
41
43
|
var theme = useTheme().theme;
|
44
|
+
var windowSize = useWindowSize();
|
42
45
|
var sidebarStyle = {
|
43
46
|
scaling: scaling !== null && scaling !== void 0 ? scaling : theme.themeScaling,
|
44
47
|
color: (_b = color !== null && color !== void 0 ? color : theme.themeColor) !== null && _b !== void 0 ? _b : 'slate',
|
45
48
|
};
|
46
|
-
return (_jsx(ReactProSidebar.Sidebar, __assign({ className: cn("bg-".concat(sidebarStyle.color, "A-6 dark:bg-").concat(sidebarStyle.color, "DarkA-6"), sidebarVariants({ scaling: sidebarStyle.scaling }), className) }, props, { collapsed: props.collapsed, children: children })));
|
49
|
+
return (_jsx(ReactProSidebar.Sidebar, __assign({ className: cn("bg-".concat(sidebarStyle.color, "A-6 dark:bg-").concat(sidebarStyle.color, "DarkA-6"), sidebarVariants({ scaling: sidebarStyle.scaling }), className) }, props, { collapsed: props.collapsed === undefined ? windowSize <= 250 : props.collapsed, children: children })));
|
47
50
|
});
|
48
51
|
Root.displayName = 'Sidebar.Root';
|
49
52
|
export var Menu = React.forwardRef(function (_a, forwardedRef) {
|
50
53
|
var _b;
|
51
|
-
var scaling = _a.scaling, size = _a.size, color = _a.color, className = _a.className, menuItemStyles = _a.menuItemStyles, children = _a.children, props = __rest(_a, ["scaling", "size", "color", "className", "menuItemStyles", "children"]);
|
54
|
+
var scaling = _a.scaling, size = _a.size, color = _a.color, radius = _a.radius, className = _a.className, menuItemStyles = _a.menuItemStyles, children = _a.children, props = __rest(_a, ["scaling", "size", "color", "radius", "className", "menuItemStyles", "children"]);
|
52
55
|
var heigthSize = '50px';
|
56
|
+
var radiusSize = '0px';
|
53
57
|
var fontSize = '16px';
|
54
58
|
if (size == 'small') {
|
55
59
|
heigthSize = '40px';
|
@@ -59,6 +63,14 @@ export var Menu = React.forwardRef(function (_a, forwardedRef) {
|
|
59
63
|
heigthSize = '60px';
|
60
64
|
fontSize = '18px';
|
61
65
|
}
|
66
|
+
if (radius == 'small')
|
67
|
+
radiusSize = '3px';
|
68
|
+
if (radius == 'medium')
|
69
|
+
radiusSize = '4px';
|
70
|
+
if (radius == 'large')
|
71
|
+
radiusSize = '6px';
|
72
|
+
if (radius == 'full')
|
73
|
+
radiusSize = '9999px';
|
62
74
|
var theme = useTheme().theme;
|
63
75
|
var sidebarStyle = {
|
64
76
|
scaling: scaling !== null && scaling !== void 0 ? scaling : theme.themeScaling,
|
@@ -66,11 +78,12 @@ export var Menu = React.forwardRef(function (_a, forwardedRef) {
|
|
66
78
|
};
|
67
79
|
var colorKey = "".concat(sidebarStyle.color, "A");
|
68
80
|
var colorValue = alphaColors[colorKey];
|
69
|
-
return (_jsx(ReactProSidebar.Menu, __assign({ menuItemStyles: __assign({ button: function (_a) {
|
81
|
+
return (_jsx(ReactProSidebar.Menu, __assign({ className: className, menuItemStyles: __assign({ button: function (_a) {
|
70
82
|
var level = _a.level, active = _a.active, disabled = _a.disabled, open = _a.open;
|
71
83
|
return {
|
72
84
|
height: heigthSize,
|
73
85
|
fontSize: fontSize,
|
86
|
+
borderRadius: radiusSize,
|
74
87
|
backgroundColor: active ? colorValue[5] : '',
|
75
88
|
'&:hover': {
|
76
89
|
backgroundColor: colorValue[3],
|
@@ -81,12 +94,12 @@ export var Menu = React.forwardRef(function (_a, forwardedRef) {
|
|
81
94
|
Menu.displayName = 'Sidebar.Menu';
|
82
95
|
export var Item = React.forwardRef(function (_a, forwardedRef) {
|
83
96
|
var scaling = _a.scaling, size = _a.size, color = _a.color, className = _a.className, children = _a.children, props = __rest(_a, ["scaling", "size", "color", "className", "children"]);
|
84
|
-
return _jsx(ReactProSidebar.MenuItem, __assign({}, props, { children: children }));
|
97
|
+
return (_jsx(ReactProSidebar.MenuItem, __assign({ className: className }, props, { children: children })));
|
85
98
|
});
|
86
99
|
Item.displayName = 'Sidebar.Item';
|
87
100
|
export var SubMenu = React.forwardRef(function (_a, forwardedRef) {
|
88
101
|
var scaling = _a.scaling, size = _a.size, color = _a.color, className = _a.className, children = _a.children, props = __rest(_a, ["scaling", "size", "color", "className", "children"]);
|
89
|
-
return _jsx(ReactProSidebar.SubMenu, __assign({}, props, { children: children }));
|
102
|
+
return (_jsx(ReactProSidebar.SubMenu, __assign({ className: className }, props, { children: children })));
|
90
103
|
});
|
91
104
|
SubMenu.displayName = 'Sidebar.SubMenu';
|
92
105
|
var Sidebar = {
|
@@ -94,5 +107,7 @@ var Sidebar = {
|
|
94
107
|
Menu: Menu,
|
95
108
|
Item: Item,
|
96
109
|
SubMenu: SubMenu,
|
110
|
+
menuClasses: menuClasses,
|
111
|
+
sidebarClasses: sidebarClasses,
|
97
112
|
};
|
98
113
|
export default Sidebar;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{jsx as e}from"react/jsx-runtime";import r from"react";import{cva as a}from"class-variance-authority";import{cn as
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import r from"react";import{cva as a}from"class-variance-authority";import{cn as l}from"../../utils/utils.mjs";import{scalingVariants as o,bgColorStyle as s}from"../../constants.mjs";import{useTheme as n}from"../../theme/ThemeProvider.mjs";import*as i from"react-pro-sidebar";import{menuClasses as t,sidebarClasses as c}from"react-pro-sidebar";import{useWindowSize as m}from"../../utils/useWindowSize.mjs";import*as u from"../../color/alpha.mjs";var d=function(){return d=Object.assign||function(e){for(var r,a=1,l=arguments.length;a<l;a++)for(var o in r=arguments[a])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},d.apply(this,arguments)},p=function(e,r){var a={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&r.indexOf(l)<0&&(a[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)r.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(a[l[o]]=e[l[o]])}return a},f=a("",{variants:{scaling:d({},o),color:s()}}),h=r.forwardRef((function(r,a){var o,s=r.scaling;r.size;var t=r.color,c=r.className,u=r.children,h=p(r,["scaling","size","color","className","children"]),b=n().theme,g=m(),v={scaling:null!=s?s:b.themeScaling,color:null!==(o=null!=t?t:b.themeColor)&&void 0!==o?o:"slate"};return e(i.Sidebar,d({className:l("bg-".concat(v.color,"A-6 dark:bg-").concat(v.color,"DarkA-6"),f({scaling:v.scaling}),c)},h,{collapsed:void 0===h.collapsed?g<=250:h.collapsed,children:u}))}));h.displayName="Sidebar.Root";var b=r.forwardRef((function(r,a){var l,o=r.scaling,s=r.size,t=r.color,c=r.radius,m=r.className,f=r.menuItemStyles,h=r.children,b=p(r,["scaling","size","color","radius","className","menuItemStyles","children"]),g="50px",v="0px",y="16px";"small"==s&&(g="40px",y="14px"),"large"==s&&(g="60px",y="18px"),"small"==c&&(v="3px"),"medium"==c&&(v="4px"),"large"==c&&(v="6px"),"full"==c&&(v="9999px");var S=n().theme,N={scaling:null!=o?o:S.themeScaling,color:null!==(l=null!=t?t:S.themeColor)&&void 0!==l?l:"slate"},x="".concat(N.color,"A"),j=u[x];return e(i.Menu,d({className:m,menuItemStyles:d({button:function(e){e.level;var r=e.active;return e.disabled,e.open,{height:g,fontSize:y,borderRadius:v,backgroundColor:r?j[5]:"","&:hover":{backgroundColor:j[3]}}}},f)},b,{children:h}))}));b.displayName="Sidebar.Menu";var g=r.forwardRef((function(r,a){r.scaling,r.size,r.color;var l=r.className,o=r.children,s=p(r,["scaling","size","color","className","children"]);return e(i.MenuItem,d({className:l},s,{children:o}))}));g.displayName="Sidebar.Item";var v=r.forwardRef((function(r,a){r.scaling,r.size,r.color;var l=r.className,o=r.children,s=p(r,["scaling","size","color","className","children"]);return e(i.SubMenu,d({className:l},s,{children:o}))}));v.displayName="Sidebar.SubMenu";var y={Root:h,Menu:b,Item:g,SubMenu:v,menuClasses:t,sidebarClasses:c};export{g as Item,b as Menu,h as Root,v as SubMenu,y as default};
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
@@ -11,5 +11,5 @@ export interface SliderProps extends VariantProps<typeof sliderVariants> {
|
|
11
11
|
declare const sliderVariants: (props?: ({
|
12
12
|
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
13
13
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
14
|
-
export declare const Slider: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/themes").SliderProps & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & SliderProps & React.RefAttributes<HTMLSpanElement>>;
|
14
|
+
export declare const Slider: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/themes").SliderProps & React.RefAttributes<HTMLSpanElement>, "ref">, "color" | "size"> & SliderProps & React.RefAttributes<HTMLSpanElement>>;
|
15
15
|
export default Slider;
|
@@ -5,7 +5,7 @@ import { Table as TableTheme } from '@radix-ui/themes';
|
|
5
5
|
export interface TableProps extends VariantProps<typeof tableVariants> {
|
6
6
|
color?: IColor;
|
7
7
|
appearance?: 'ghost' | 'surface';
|
8
|
-
size?: 'small' | 'medium' | 'large';
|
8
|
+
size?: 'x-small' | 'small' | 'medium' | 'large';
|
9
9
|
}
|
10
10
|
declare const tableVariants: (props?: ({
|
11
11
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
@@ -28,6 +28,7 @@ import { Table as TableTheme, Theme } from '@radix-ui/themes';
|
|
28
28
|
import { cn } from '../../../lib/utils/utils';
|
29
29
|
import { radiusVariants, scalingVariants } from '../../../lib/constants';
|
30
30
|
import { useTheme } from '../../../lib/theme';
|
31
|
+
var rootSize = 'medium';
|
31
32
|
var tableVariants = cva('', {
|
32
33
|
variants: {
|
33
34
|
scaling: __assign({}, scalingVariants),
|
@@ -40,15 +41,21 @@ var tableVariants = cva('', {
|
|
40
41
|
var tableRowVariants = cva('', {
|
41
42
|
variants: {
|
42
43
|
size: {
|
43
|
-
small: 'h-[
|
44
|
-
|
45
|
-
|
44
|
+
'x-small': 'h-[32px] text-[12px] p-[8px]',
|
45
|
+
small: 'h-[36px] text-[14px] p-[8px]',
|
46
|
+
medium: 'h-[44px] text-[14px] p-[8px]',
|
47
|
+
large: 'h-[48px] text-[14px] p-[12px]',
|
46
48
|
},
|
47
49
|
},
|
50
|
+
defaultVariants: {
|
51
|
+
size: 'medium',
|
52
|
+
},
|
48
53
|
});
|
49
54
|
export var Root = React.forwardRef(function (_a, ref) {
|
50
55
|
var className = _a.className, children = _a.children, appearance = _a.appearance, scaling = _a.scaling, size = _a.size, radius = _a.radius, tableProps = __rest(_a, ["className", "children", "appearance", "scaling", "size", "radius"]);
|
51
56
|
var theme = useTheme().theme;
|
57
|
+
if (size)
|
58
|
+
rootSize = size;
|
52
59
|
var sizeTheme = '2';
|
53
60
|
if (size === 'small')
|
54
61
|
sizeTheme = '1';
|
@@ -63,7 +70,7 @@ export var Root = React.forwardRef(function (_a, ref) {
|
|
63
70
|
});
|
64
71
|
Root.displayName = 'Table.Root';
|
65
72
|
export var Header = React.forwardRef(function (_a, forwardedRef) {
|
66
|
-
var className = _a.className, children = _a.children, scaling = _a.scaling, props = __rest(_a, ["className", "children", "scaling"]);
|
73
|
+
var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, props = __rest(_a, ["className", "children", "scaling", "size"]);
|
67
74
|
return (_jsx(TableTheme.Header, __assign({ ref: forwardedRef, className: cn('', tableVariants({ scaling: scaling }), className) }, props, { children: children })));
|
68
75
|
});
|
69
76
|
Header.displayName = 'Table.Header';
|
@@ -73,23 +80,23 @@ export var Body = React.forwardRef(function (_a, forwardedRef) {
|
|
73
80
|
});
|
74
81
|
Body.displayName = 'Table.Body';
|
75
82
|
export var Row = React.forwardRef(function (_a, forwardedRef) {
|
76
|
-
var className = _a.className, children = _a.children, scaling = _a.scaling, props = __rest(_a, ["className", "children", "scaling"]);
|
83
|
+
var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, props = __rest(_a, ["className", "children", "scaling", "size"]);
|
77
84
|
return (_jsx(TableTheme.Row, __assign({ ref: forwardedRef, className: cn('', tableVariants({ scaling: scaling }), className) }, props, { children: children })));
|
78
85
|
});
|
79
86
|
Row.displayName = 'Table.Row';
|
80
87
|
export var Cell = React.forwardRef(function (_a, forwardedRef) {
|
81
|
-
var className = _a.className, children = _a.children, scaling = _a.scaling, cellProps = __rest(_a, ["className", "children", "scaling"]);
|
82
|
-
return (_jsx(TableTheme.Cell, __assign({ className: cn(
|
88
|
+
var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, cellProps = __rest(_a, ["className", "children", "scaling", "size"]);
|
89
|
+
return (_jsx(TableTheme.Cell, __assign({ className: cn(tableRowVariants({ size: rootSize }), tableVariants({ scaling: scaling }), className) }, cellProps, { ref: forwardedRef, children: children })));
|
83
90
|
});
|
84
91
|
Cell.displayName = 'Table.Cell';
|
85
92
|
export var ColumnHeaderCell = React.forwardRef(function (_a, forwardedRef) {
|
86
93
|
var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, props = __rest(_a, ["className", "children", "scaling", "size"]);
|
87
|
-
return (_jsx(TableTheme.ColumnHeaderCell, __assign({ ref: forwardedRef, className: cn('', tableVariants({ scaling: scaling }), tableRowVariants({ size:
|
94
|
+
return (_jsx(TableTheme.ColumnHeaderCell, __assign({ ref: forwardedRef, className: cn('', tableVariants({ scaling: scaling }), tableRowVariants({ size: rootSize }), className) }, props, { children: children })));
|
88
95
|
});
|
89
96
|
ColumnHeaderCell.displayName = 'Table.ColumnHeaderCell';
|
90
97
|
export var RowHeaderCell = React.forwardRef(function (_a, forwardedRef) {
|
91
|
-
var className = _a.className, children = _a.children, scaling = _a.scaling, props = __rest(_a, ["className", "children", "scaling"]);
|
92
|
-
return (_jsx(TableTheme.RowHeaderCell, __assign({ ref: forwardedRef, className: cn('', tableVariants({ scaling: scaling }), className) }, props, { children: children })));
|
98
|
+
var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, props = __rest(_a, ["className", "children", "scaling", "size"]);
|
99
|
+
return (_jsx(TableTheme.RowHeaderCell, __assign({ ref: forwardedRef, className: cn('', tableVariants({ scaling: scaling }), tableRowVariants({ size: rootSize }), className) }, props, { children: children })));
|
93
100
|
});
|
94
101
|
RowHeaderCell.displayName = 'Table.RowHeaderCell';
|
95
102
|
var Table = {
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{jsx as
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import a from"react";import{cva as r}from"class-variance-authority";import{Theme as l,Table as s}from"@radix-ui/themes";import{cn as i}from"../../utils/utils.mjs";import{scalingVariants as n,radiusVariants as c}from"../../constants.mjs";import{useTheme as t}from"../../theme/ThemeProvider.mjs";var o=function(){return o=Object.assign||function(e){for(var a,r=1,l=arguments.length;r<l;r++)for(var s in a=arguments[r])Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s]);return e},o.apply(this,arguments)},m=function(e,a){var r={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&a.indexOf(l)<0&&(r[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(l=Object.getOwnPropertySymbols(e);s<l.length;s++)a.indexOf(l[s])<0&&Object.prototype.propertyIsEnumerable.call(e,l[s])&&(r[l[s]]=e[l[s]])}return r},d="medium",f=r("",{variants:{scaling:o({},n),radius:o({},c.base)},defaultVariants:{scaling:"100%"}}),p=r("",{variants:{size:{"x-small":"h-[32px] text-[12px] p-[8px]",small:"h-[36px] text-[14px] p-[8px]",medium:"h-[44px] text-[14px] p-[8px]",large:"h-[48px] text-[14px] p-[12px]"}},defaultVariants:{size:"medium"}}),u=a.forwardRef((function(a,r){var n=a.className,c=a.children,p=a.appearance,u=a.scaling,h=a.size,g=a.radius,v=m(a,["className","children","appearance","scaling","size","radius"]),N=t().theme;h&&(d=h);var y="2";"small"===h&&(y="1"),"large"===h&&(y="3");var x=null!=g?g:N.themeRadius,b={scaling:null!=u?u:N.themeScaling,radius:"full"===x?"large":x};return e(l,{hasBackground:!1,children:e(s.Root,o({ref:r,className:i(f(b),n),variant:p,size:y},v,{children:c}))})}));u.displayName="Table.Root";var h=a.forwardRef((function(a,r){var l=a.className,n=a.children,c=a.scaling;a.size;var t=m(a,["className","children","scaling","size"]);return e(s.Header,o({ref:r,className:i("",f({scaling:c}),l)},t,{children:n}))}));h.displayName="Table.Header";var g=a.forwardRef((function(a,r){var l=a.className,n=a.children,c=a.scaling,t=m(a,["className","children","scaling"]);return e(s.Body,o({ref:r,className:i("",f({scaling:c}),l)},t,{children:n}))}));g.displayName="Table.Body";var v=a.forwardRef((function(a,r){var l=a.className,n=a.children,c=a.scaling;a.size;var t=m(a,["className","children","scaling","size"]);return e(s.Row,o({ref:r,className:i("",f({scaling:c}),l)},t,{children:n}))}));v.displayName="Table.Row";var N=a.forwardRef((function(a,r){var l=a.className,n=a.children,c=a.scaling;a.size;var t=m(a,["className","children","scaling","size"]);return e(s.Cell,o({className:i(p({size:d}),f({scaling:c}),l)},t,{ref:r,children:n}))}));N.displayName="Table.Cell";var y=a.forwardRef((function(a,r){var l=a.className,n=a.children,c=a.scaling;a.size;var t=m(a,["className","children","scaling","size"]);return e(s.ColumnHeaderCell,o({ref:r,className:i("",f({scaling:c}),p({size:d}),l)},t,{children:n}))}));y.displayName="Table.ColumnHeaderCell";var x=a.forwardRef((function(a,r){var l=a.className,n=a.children,c=a.scaling;a.size;var t=m(a,["className","children","scaling","size"]);return e(s.RowHeaderCell,o({ref:r,className:i("",f({scaling:c}),p({size:d}),l)},t,{children:n}))}));x.displayName="Table.RowHeaderCell";var b={Root:u,Header:h,Body:g,Row:v,Cell:N,ColumnHeaderCell:y,RowHeaderCell:x};export{g as Body,N as Cell,y as ColumnHeaderCell,h as Header,u as Root,v as Row,x as RowHeaderCell,b as default};
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
@@ -15,8 +15,9 @@ export interface TabsProps extends VariantProps<typeof dynamivTabsVariants> {
|
|
15
15
|
defaultValue?: string;
|
16
16
|
color?: IColor;
|
17
17
|
tabData: TabProp[];
|
18
|
-
|
19
|
-
|
18
|
+
focusedInx: number;
|
19
|
+
onChangeFocusedInx: (inx: number) => void;
|
20
|
+
onChangeTabs: (tabs: TabProp[]) => void;
|
20
21
|
onDeleteTab?: (tab: any) => void;
|
21
22
|
onDeleteAllTabs?: () => void;
|
22
23
|
maxCount?: number;
|
@@ -24,6 +25,7 @@ export interface TabsProps extends VariantProps<typeof dynamivTabsVariants> {
|
|
24
25
|
declare const dynamivTabsVariants: (props?: ({
|
25
26
|
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
26
27
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
28
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
27
29
|
color?: string | null | undefined;
|
28
30
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
29
31
|
declare const DynamicTabs: React.ForwardRefExoticComponent<import("react-tabs").TabsProps & TabsProps & React.RefAttributes<never>>;
|
@@ -25,7 +25,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
25
|
import { ChevronLeftIcon, ChevronRightIcon, Cross1Icon, TrashIcon } from '@radix-ui/react-icons';
|
26
26
|
import { cva } from 'class-variance-authority';
|
27
27
|
import { bgColorStyle, scalingVariants, weightVariants } from '../../../lib/constants';
|
28
|
-
import React, { useEffect
|
28
|
+
import React, { useEffect } from 'react';
|
29
29
|
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
|
30
30
|
import IconButton from '../IconButton';
|
31
31
|
import { cn } from '../../../lib/utils/utils';
|
@@ -34,13 +34,19 @@ var dynamivTabsVariants = cva('', {
|
|
34
34
|
variants: {
|
35
35
|
weight: __assign({}, weightVariants),
|
36
36
|
scaling: __assign({}, scalingVariants),
|
37
|
+
radius: {
|
38
|
+
none: 'rounded-t-none',
|
39
|
+
small: 'rounded-t-[3px]',
|
40
|
+
medium: 'rounded-t',
|
41
|
+
large: 'rounded-t-md',
|
42
|
+
full: 'rounded-t-lg',
|
43
|
+
},
|
37
44
|
color: bgColorStyle(),
|
38
45
|
},
|
39
46
|
});
|
40
47
|
var DynamicTabs = React.forwardRef(function (_a, ref) {
|
41
48
|
var _b;
|
42
|
-
var tabData = _a.tabData, scaling = _a.scaling, color = _a.color,
|
43
|
-
var _c = useState(0), selectedInx = _c[0], setselectedInx = _c[1];
|
49
|
+
var tabData = _a.tabData, scaling = _a.scaling, color = _a.color, _c = _a.radius, radius = _c === void 0 ? 'none' : _c, focusedInx = _a.focusedInx, onChangeFocusedInx = _a.onChangeFocusedInx, onChangeTabs = _a.onChangeTabs, onDeleteTab = _a.onDeleteTab, onDeleteAllTabs = _a.onDeleteAllTabs, onSelect = _a.onSelect, maxCount = _a.maxCount, className = _a.className, rootProps = __rest(_a, ["tabData", "scaling", "color", "radius", "focusedInx", "onChangeFocusedInx", "onChangeTabs", "onDeleteTab", "onDeleteAllTabs", "onSelect", "maxCount", "className"]);
|
44
50
|
var theme = useTheme().theme;
|
45
51
|
var dynamicTabsStyle = {
|
46
52
|
scaling: scaling !== null && scaling !== void 0 ? scaling : theme.themeScaling,
|
@@ -48,26 +54,25 @@ var DynamicTabs = React.forwardRef(function (_a, ref) {
|
|
48
54
|
};
|
49
55
|
useEffect(function () {
|
50
56
|
if (tabData.length > 20)
|
51
|
-
|
57
|
+
onChangeTabs(tabData.slice(0, 20));
|
52
58
|
}, [tabData]);
|
53
|
-
return (_jsxs(Tabs, __assign({ selectedIndex:
|
54
|
-
setselectedInx(index);
|
59
|
+
return (_jsxs(Tabs, __assign({ selectedIndex: focusedInx, className: cn('flex w-full text-slate-11', dynamivTabsVariants({ scaling: dynamicTabsStyle.scaling }), className), onSelect: function (index, last, event) {
|
55
60
|
onSelect && onSelect(index, last, event);
|
56
|
-
} }, rootProps, { children: [_jsx(TabList, { className: "
|
61
|
+
} }, rootProps, { children: [_jsx(TabList, { className: "flex h-[32px] flex-1 overflow-x-auto overflow-y-hidden border-b border-slateA-7 p-0", children: tabData.map(function (tab, index) { return (_jsx(Tab, { className: cn('relative bottom-[-1px] inline-block w-[50px] max-w-[150px] flex-1 cursor-pointer list-none border-y border-r border-slateA-7 bg-slate-2 text-slate-11 aria-selected:border-b-0 aria-selected:border-slateA-8 aria-selected:bg-slate-1 aria-selected:text-slate-12', dynamivTabsVariants({ radius: radius })), onClick: function (e) { var _a, _b; return ((_a = tab.title) === null || _a === void 0 ? void 0 : _a.onClick) && ((_b = tab.title) === null || _b === void 0 ? void 0 : _b.onClick(tab)); }, children: _jsxs("div", { className: cn('mx-[3px] my-[2px] flex items-center justify-between rounded-lg px-[5px]', "hover:bg-".concat(dynamicTabsStyle.color, "A-6 hover:dark:bg-").concat(dynamicTabsStyle.color, "DarkA-6")), children: [_jsx("div", { className: "flex-1 overflow-hidden truncate text-ellipsis", onClick: function () { return onChangeFocusedInx(index); }, children: tab.title.children() }), ((tabData === null || tabData === void 0 ? void 0 : tabData.length) < 15 || focusedInx == index) && (_jsx(IconButton, { appearance: "ghost", size: "small", color: dynamicTabsStyle.color, scaling: dynamicTabsStyle.scaling, onClick: function () {
|
57
62
|
var filtered = tabData.filter(function (el) { return el.key !== tab.key; });
|
58
|
-
|
59
|
-
filtered.length
|
60
|
-
|
61
|
-
|
62
|
-
onDeleteTab && onDeleteTab(tab);
|
63
|
+
onChangeTabs(filtered);
|
64
|
+
focusedInx === filtered.length &&
|
65
|
+
focusedInx > 0 &&
|
66
|
+
onChangeFocusedInx(focusedInx - 1);
|
67
|
+
onDeleteTab && onDeleteTab({ deleteTab: tab });
|
63
68
|
}, children: _jsx(Cross1Icon, {}) }))] }) }, index)); }) }), tabData.map(function (tab, index) {
|
64
69
|
var _a;
|
65
70
|
return (_jsx(TabPanel, { children: (_a = tab === null || tab === void 0 ? void 0 : tab.content) === null || _a === void 0 ? void 0 : _a.children() }, index));
|
66
|
-
}), _jsxs("div", { className: "right-5
|
67
|
-
|
68
|
-
|
71
|
+
}), _jsxs("div", { className: "right-5 flex justify-end border-b border-slateA-7 p-0", children: [_jsx(IconButton, { appearance: "ghost", size: "small", onClick: function () { return focusedInx - 1 >= 0 && onChangeFocusedInx(focusedInx - 1); }, children: _jsx(ChevronLeftIcon, {}) }), _jsx(IconButton, { appearance: "ghost", size: "small", onClick: function () { return focusedInx + 1 < tabData.length && onChangeFocusedInx(focusedInx + 1); }, children: _jsx(ChevronRightIcon, {}) }), _jsx(IconButton, { appearance: "ghost", size: "small", onClick: function () {
|
72
|
+
onChangeFocusedInx(0);
|
73
|
+
onChangeTabs([]);
|
69
74
|
onDeleteAllTabs && onDeleteAllTabs();
|
70
|
-
}, children: _jsx(TrashIcon, {}) })
|
75
|
+
}, children: _jsx(TrashIcon, {}) })] })] })));
|
71
76
|
});
|
72
77
|
DynamicTabs.displayName = 'DynamicTabs';
|
73
78
|
export default DynamicTabs;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{jsxs as e,jsx as
|
2
|
+
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{Cross1Icon as r,ChevronLeftIcon as t,ChevronRightIcon as o,TrashIcon as l}from"@radix-ui/react-icons";import{cva as a}from"class-variance-authority";import{weightVariants as i,scalingVariants as c,bgColorStyle as s}from"../../constants.mjs";import d,{useEffect as u}from"react";import{Tabs as m,TabList as f,Tab as p,TabPanel as h}from"react-tabs";import{IconButton as b}from"../IconButton/index.mjs";import{cn as x}from"../../utils/utils.mjs";import{useTheme as g}from"../../theme/ThemeProvider.mjs";var v=function(){return v=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},v.apply(this,arguments)},y=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r},C=a("",{variants:{weight:v({},i),scaling:v({},c),radius:{none:"rounded-t-none",small:"rounded-t-[3px]",medium:"rounded-t",large:"rounded-t-md",full:"rounded-t-lg"},color:s()}}),j=d.forwardRef((function(a,i){var c,s=a.tabData,d=a.scaling,j=a.color,k=a.radius,w=void 0===k?"none":k,O=a.focusedInx,N=a.onChangeFocusedInx,T=a.onChangeTabs,A=a.onDeleteTab,D=a.onDeleteAllTabs,I=a.onSelect;a.maxCount;var S=a.className,P=y(a,["tabData","scaling","color","radius","focusedInx","onChangeFocusedInx","onChangeTabs","onDeleteTab","onDeleteAllTabs","onSelect","maxCount","className"]),z=g().theme,F={scaling:null!=d?d:z.themeScaling,color:null!==(c=null!=j?j:z.themeColor)&&void 0!==c?c:"slate"};return u((function(){s.length>20&&T(s.slice(0,20))}),[s]),e(m,v({selectedIndex:O,className:x("flex w-full text-slate-11",C({scaling:F.scaling}),S),onSelect:function(e,n,r){I&&I(e,n,r)}},P,{children:[n(f,{className:"flex h-[32px] flex-1 overflow-x-auto overflow-y-hidden border-b border-slateA-7 p-0",children:s.map((function(t,o){return n(p,{className:x("relative bottom-[-1px] inline-block w-[50px] max-w-[150px] flex-1 cursor-pointer list-none border-y border-r border-slateA-7 bg-slate-2 text-slate-11 aria-selected:border-b-0 aria-selected:border-slateA-8 aria-selected:bg-slate-1 aria-selected:text-slate-12",C({radius:w})),onClick:function(e){var n,r;return(null===(n=t.title)||void 0===n?void 0:n.onClick)&&(null===(r=t.title)||void 0===r?void 0:r.onClick(t))},children:e("div",{className:x("mx-[3px] my-[2px] flex items-center justify-between rounded-lg px-[5px]","hover:bg-".concat(F.color,"A-6 hover:dark:bg-").concat(F.color,"DarkA-6")),children:[n("div",{className:"flex-1 overflow-hidden truncate text-ellipsis",onClick:function(){return N(o)},children:t.title.children()}),((null==s?void 0:s.length)<15||O==o)&&n(b,{appearance:"ghost",size:"small",color:F.color,scaling:F.scaling,onClick:function(){var e=s.filter((function(e){return e.key!==t.key}));T(e),O===e.length&&O>0&&N(O-1),A&&A({deleteTab:t})},children:n(r,{})})]})},o)}))}),s.map((function(e,r){var t;return n(h,{children:null===(t=null==e?void 0:e.content)||void 0===t?void 0:t.children()},r)})),e("div",{className:"right-5 flex justify-end border-b border-slateA-7 p-0",children:[n(b,{appearance:"ghost",size:"small",onClick:function(){return O-1>=0&&N(O-1)},children:n(t,{})}),n(b,{appearance:"ghost",size:"small",onClick:function(){return O+1<s.length&&N(O+1)},children:n(o,{})}),n(b,{appearance:"ghost",size:"small",onClick:function(){N(0),T([]),D&&D()},children:n(l,{})})]})]}))}));j.displayName="DynamicTabs";export{j as default};
|
3
3
|
//# sourceMappingURL=DynamicTabs.mjs.map
|
@@ -62,6 +62,8 @@ export var Root = React.forwardRef(function (_a, forwardedRef) {
|
|
62
62
|
message = '숫자만 입력 가능합니다.';
|
63
63
|
if (validationType == 'email')
|
64
64
|
message = '이메일 형식에 어긋납니다.';
|
65
|
+
if ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.type) == 'password')
|
66
|
+
delete textFieldProps['type'];
|
65
67
|
return (_jsxs("div", { children: [_jsx(Theme, { scaling: contextValue.scaling, accentColor: contextValue.color, hasBackground: false, children: _jsxs(TextFieldTheme.Root, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, type: validationType !== 'password' || isMouseDown ? 'text' : 'password', radius: contextValue.radius, color: contextValue.color, className: cn(textFieldVariants({ radius: contextValue.radius }), className), onChange: function (e) {
|
66
68
|
if (e.target.value && regex) {
|
67
69
|
setShowMessage(true);
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import
|
2
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import o,{useState as a}from"react";import{cva as t}from"class-variance-authority";import{cn as n}from"../../utils/utils.mjs";import{radiusVariants as i,bgColorStyle as l}from"../../constants.mjs";import{Theme as s,TextField as c}from"@radix-ui/themes";import{useTheme as u}from"../../theme/ThemeProvider.mjs";import{MAIN_COLOR as d}from"../../color/constants.mjs";import m from"../../Typography/Text/index.mjs";import{IconButton as p}from"../IconButton/index.mjs";import{EyeOpenIcon as f,EyeClosedIcon as h}from"@radix-ui/react-icons";var g=function(){return g=Object.assign||function(r){for(var e,o=1,a=arguments.length;o<a;o++)for(var t in e=arguments[o])Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r},g.apply(this,arguments)},v=function(r,e){var o={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(o[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(a=Object.getOwnPropertySymbols(r);t<a.length;t++)e.indexOf(a[t])<0&&Object.prototype.propertyIsEnumerable.call(r,a[t])&&(o[a[t]]=r[a[t]])}return o},y=t("",{variants:{radius:g({},i.base),color:l()}}),x=o.forwardRef((function(o,t){var i,l,x,w=o.className,b=o.color,O=o.size,N=o.appearance,T=o.scaling,z=o.radius,S=o.children,R=o.validationType,B=o.regex,C=o.warningMessage,P=o.onChange,M=o.onBlur,F=v(o,["className","color","size","appearance","scaling","radius","children","validationType","regex","warningMessage","onChange","onBlur"]),I=u().theme,$=a(!1),k=$[0],D=$[1],E=a(null!==(i=F.defaultValue)&&void 0!==i?i:""),U=E[0],V=E[1],_=a(!1),q=_[0],A=_[1],G="2";"small"===O&&(G="1"),"large"===O&&(G="3");var H={scaling:null!==(l=null!=T?T:I.themeScaling)&&void 0!==l?l:"100%",radius:null!=z?z:I.themeRadius,color:null!==(x=null!=b?b:I.themeColor)&&void 0!==x?x:d},J=/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/,K=/^[0-9]+$/,L="";return"number"==R&&(L="숫자만 입력 가능합니다."),"email"==R&&(L="이메일 형식에 어긋납니다."),"password"==(null==F?void 0:F.type)&&delete F.type,r("div",{children:[e(s,{scaling:H.scaling,accentColor:H.color,hasBackground:!1,children:r(c.Root,g({ref:t,variant:N,size:G,type:"password"!==R||q?"text":"password",radius:H.radius,color:H.color,className:n(y({radius:H.radius}),w),onChange:function(r){r.target.value&&B?D(!0):"number"!=R||!r.target.value||B||K.test(r.target.value)?(D(!1),V(r.target.value),P&&P(r)):D(!0)},value:U,onBlur:function(r){M&&M(r),"email"!=R||!r.target.value||J.test(r.target.value)?D(!1):D(!0)}},F,{children:[S,"password"==R&&e(j.Slot,{side:"right",children:e(p,{appearance:"ghost",color:"slate",onMouseDown:function(r){return A(!0)},onMouseUp:function(r){return A(!1)},children:e(q?f:h,{height:"14",width:"14"})})})]}))}),k&&e(m,{size:"1",color:H.color,children:C||L})]})}));x.displayName="TextField.Root";var w=o.forwardRef((function(r,o){var a=r.className,t=r.color,i=r.side,l=r.radius,s=r.children,u=v(r,["className","color","side","radius","children"]);return e(c.Slot,g({ref:o,color:t,side:i,className:n(y({radius:l}),a)},u,{children:s}))}));w.displayName="TextField.Slot";var j={Root:x,Slot:w};export{x as Root,w as Slot,j as default};
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
@@ -2,7 +2,6 @@ import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { IColor } from '../../../lib/types';
|
3
3
|
import React from 'react';
|
4
4
|
import { StaticTreeDataProvider } from 'react-complex-tree';
|
5
|
-
import 'react-complex-tree/lib/style-modern.css';
|
6
5
|
export interface TreeProps extends React.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof treeVariants> {
|
7
6
|
color?: IColor;
|
8
7
|
items: any;
|
@@ -15,5 +14,5 @@ declare const treeVariants: (props?: ({
|
|
15
14
|
declare let treeProvider: StaticTreeDataProvider | null;
|
16
15
|
declare const Tree: React.ForwardRefExoticComponent<Omit<Omit<import("react-complex-tree").UncontrolledTreeEnvironmentProps<unknown, string> & {
|
17
16
|
ref?: React.Ref<import("react-complex-tree").TreeEnvironmentRef<unknown, string>> | undefined;
|
18
|
-
}, "ref">, "children" | "viewState" | "canSearch" | "dataProvider"> & TreeProps & React.RefAttributes<import("react-complex-tree").TreeEnvironmentRef<unknown, string>>>;
|
17
|
+
}, "ref">, "children" | "viewState" | "getItemTitle" | "canSearch" | "dataProvider"> & TreeProps & React.RefAttributes<import("react-complex-tree").TreeEnvironmentRef<unknown, string>>>;
|
19
18
|
export { Tree, treeProvider };
|
@@ -70,7 +70,6 @@ import { cva } from 'class-variance-authority';
|
|
70
70
|
import { primaryColorStyle } from '../../../lib/constants';
|
71
71
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
72
72
|
import { StaticTreeDataProvider, Tree as ComplexTree, UncontrolledTreeEnvironment, } from 'react-complex-tree';
|
73
|
-
import 'react-complex-tree/lib/style-modern.css';
|
74
73
|
import TextField from '../TextField';
|
75
74
|
import Button from '../Button';
|
76
75
|
import { MAIN_COLOR } from '../../../lib/color/constants';
|
@@ -178,7 +177,9 @@ var Tree = React.forwardRef(function (_a, ref) {
|
|
178
177
|
setTreeData(t_1);
|
179
178
|
}
|
180
179
|
}, [items]);
|
181
|
-
return (_jsxs("div", { className: "text-slate-12", children: [isSearch && (_jsxs("div", { className: "flex", children: [_jsx(TextField.Root, { color: contextValue.color, value: search, onChange: function (e) { return setSearch(e.target.value); }, placeholder: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD558\uC138\uC694", className: "mr-2" }), _jsx(Button, { color: contextValue.color, onClick: find, children: "\uAC80\uC0C9" })] })), _jsx(UncontrolledTreeEnvironment, __assign({ ref: ref, dataProvider: treeProvider,
|
180
|
+
return (_jsxs("div", { className: "text-slate-12", children: [isSearch && (_jsxs("div", { className: "flex", children: [_jsx(TextField.Root, { color: contextValue.color, value: search, onChange: function (e) { return setSearch(e.target.value); }, placeholder: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD558\uC138\uC694", className: "mr-2" }), _jsx(Button, { color: contextValue.color, onClick: find, children: "\uAC80\uC0C9" })] })), _jsx(UncontrolledTreeEnvironment, __assign({ ref: ref, dataProvider: treeProvider, getItemTitle: function (item) {
|
181
|
+
return item.data;
|
182
|
+
}, viewState: (_b = {},
|
182
183
|
_b[treeId] = {
|
183
184
|
focusedItem: (_d = focusedItem[0]) !== null && _d !== void 0 ? _d : '',
|
184
185
|
expandedItems: expandedItems,
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsxs as e,jsx as
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";import{primaryColorStyle as n}from"../../constants.mjs";import o,{useState as a,useRef as i,useCallback as l,useEffect as c}from"react";import{StaticTreeDataProvider as u,UncontrolledTreeEnvironment as s,Tree as f}from"react-complex-tree";import d from"../TextField/index.mjs";import{Button as m}from"../Button/index.mjs";import{MAIN_COLOR as p}from"../../color/constants.mjs";import{useTheme as h}from"../../theme/ThemeProvider.mjs";var v=function(){return v=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)},y=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function l(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}c((n=n.apply(e,t||[])).next())}))},b=function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}},x=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},g=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};function w(e,t){var r=[];return Object.values(e).forEach((function(e){e[t]&&r.push(e.index)})),r}r("",{variants:{color:n()}});var I=null,j=o.forwardRef((function(r,n){var o,j,O,S=r.items,P=r.treeId;r.className;var T=r.color,k=r.isSearch,E=x(r,["items","treeId","className","color","isSearch"]),N=a(""),C=N[0],F=N[1],R=i(null),B=a({}),L=B[0],A=B[1],q=w(S,"isFocusd"),z=w(S,"isExpanded"),D=w(S,"isSelected");I=new u(L,(function(e,t){return v(v({},e),{data:t})}));var G=h().theme,H={color:null!==(j=null!=T?T:G.themeColor)&&void 0!==j?j:p},J=l((function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return y(void 0,g([e],t,!0),void 0,(function(e,t){var r,n,o,a,i;return void 0===t&&(t="root"),b(this,(function(l){switch(l.label){case 0:return I?[4,I.getTreeItem(t)]:[2];case 1:return(r=l.sent()).data.toLowerCase().includes(e.toLowerCase())?[2,[r.index]]:[4,Promise.all(null!==(i=null===(a=r.children)||void 0===a?void 0:a.map((function(t){return J(e,t)})))&&void 0!==i?i:[])];case 2:return n=l.sent(),o=n.find((function(e){return null!==e})),o?[2,g([r.index],o,!0)]:[2,null]}}))}))}),[I]),K=l((function(e){e.preventDefault(),C&&J(C).then((function(e){var t;e&&(null===(t=R.current)||void 0===t||t.expandSubsequently(e).then((function(){var t,r;null===(t=R.current)||void 0===t||t.selectItems([e[e.length-1]]),null===(r=R.current)||void 0===r||r.focusItem(e[e.length-1])})))}))}),[J,C]);return c((function(){if(S){var e=[],t=[];S.map((function(e){t.push.apply(t,e.children)})),S.forEach((function(r){t.includes(r.index)||e.push(r.index)}));var r={};r.root={index:"root",isFolder:!0,children:e,data:"Root item"},S.map((function(e){r[e.index]=v(v({},e),{isFolder:e.children.length>0})})),A(r)}}),[S]),e("div",{className:"text-slate-12",children:[k&&e("div",{className:"flex",children:[t(d.Root,{color:H.color,value:C,onChange:function(e){return F(e.target.value)},placeholder:"검색어를 입력하세요",className:"mr-2"}),t(m,{color:H.color,onClick:K,children:"검색"})]}),t(s,v({ref:n,dataProvider:I,getItemTitle:function(e){return e.data},viewState:(o={},o[P]={focusedItem:null!==(O=q[0])&&void 0!==O?O:"",expandedItems:z,selectedItems:D},o),keyboardBindings:v({renameItem:["enter"],abortRenameItem:["control+z"]},E.keyboardBindings)},E,{canSearch:!1,children:t(f,{ref:R,treeId:P,rootItem:"root",treeLabel:"Tree Example"})}))]})}));j.displayName="Tree";export{j as Tree,I as treeProvider};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Tree/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { cva } from 'class-variance-authority';\nimport { primaryColorStyle } from '../../../lib/constants';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { StaticTreeDataProvider, Tree as ComplexTree, UncontrolledTreeEnvironment, } from 'react-complex-tree';\nimport 'react-complex-tree/lib/style-modern.css';\nimport TextField from '../TextField';\nimport Button from '../Button';\nimport { MAIN_COLOR } from '../../../lib/color/constants';\nimport { useTheme } from '../../../lib/theme';\nvar treeVariants = cva('', {\n variants: {\n color: primaryColorStyle(),\n },\n});\nfunction findItems(arr, key) {\n var results = [];\n Object.values(arr).forEach(function (item) {\n if (item[key]) {\n results.push(item.index);\n }\n });\n return results;\n}\nvar treeProvider = null;\nvar Tree = React.forwardRef(function (_a, ref) {\n var _b;\n var _c, _d;\n var items = _a.items, treeId = _a.treeId, className = _a.className, color = _a.color, isSearch = _a.isSearch, props = __rest(_a, [\"items\", \"treeId\", \"className\", \"color\", \"isSearch\"]);\n var _e = useState(''), search = _e[0], setSearch = _e[1];\n var tree = useRef(null);\n var _f = useState({}), treeData = _f[0], setTreeData = _f[1];\n var focusedItem = findItems(items, 'isFocusd');\n var expandedItems = findItems(items, 'isExpanded');\n var selectedItems = findItems(items, 'isSelected');\n treeProvider = new StaticTreeDataProvider(treeData, function (item, data) { return (__assign(__assign({}, item), { data: data })); });\n var theme = useTheme().theme;\n var contextValue = {\n color: (_c = color !== null && color !== void 0 ? color : theme.themeColor) !== null && _c !== void 0 ? _c : MAIN_COLOR,\n };\n var findItemPath = useCallback(function (search_1) {\n var args_1 = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args_1[_i - 1] = arguments[_i];\n }\n return __awaiter(void 0, __spreadArray([search_1], args_1, true), void 0, function (search, searchRoot) {\n var item, searchedItems, result;\n var _a, _b;\n if (searchRoot === void 0) { searchRoot = 'root'; }\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (!treeProvider)\n return [2 /*return*/];\n return [4 /*yield*/, treeProvider.getTreeItem(searchRoot)];\n case 1:\n item = _c.sent();\n if (item.data.toLowerCase().includes(search.toLowerCase())) {\n return [2 /*return*/, [item.index]];\n }\n return [4 /*yield*/, Promise.all((_b = (_a = item.children) === null || _a === void 0 ? void 0 : _a.map(function (child) { return findItemPath(search, child); })) !== null && _b !== void 0 ? _b : [])];\n case 2:\n searchedItems = _c.sent();\n result = searchedItems.find(function (item) { return item !== null; });\n if (!result) {\n return [2 /*return*/, null];\n }\n return [2 /*return*/, __spreadArray([item.index], result, true)];\n }\n });\n });\n }, [treeProvider]);\n var find = useCallback(function (e) {\n e.preventDefault();\n if (search) {\n findItemPath(search).then(function (path) {\n var _a;\n if (path) {\n // wait for full path including leaf, to make sure it loaded in\n (_a = tree.current) === null || _a === void 0 ? void 0 : _a.expandSubsequently(path).then(function () {\n var _a, _b;\n (_a = tree.current) === null || _a === void 0 ? void 0 : _a.selectItems([path[path.length - 1]]);\n (_b = tree.current) === null || _b === void 0 ? void 0 : _b.focusItem(path[path.length - 1]);\n });\n }\n });\n }\n }, [findItemPath, search]);\n useEffect(function () {\n if (items) {\n var results_1 = [];\n var children_1 = [];\n items.map(function (item) {\n children_1.push.apply(children_1, item.children);\n });\n items.forEach(function (item) {\n if (!children_1.includes(item.index)) {\n results_1.push(item.index);\n }\n });\n var t_1 = {};\n t_1['root'] = {\n index: 'root',\n isFolder: true,\n children: results_1,\n data: 'Root item',\n };\n items.map(function (item) {\n t_1[item.index] = __assign(__assign({}, item), { isFolder: item.children.length > 0 });\n });\n setTreeData(t_1);\n }\n }, [items]);\n return (_jsxs(\"div\", { className: \"text-slate-12\", children: [isSearch && (_jsxs(\"div\", { className: \"flex\", children: [_jsx(TextField.Root, { color: contextValue.color, value: search, onChange: function (e) { return setSearch(e.target.value); }, placeholder: \"\\uAC80\\uC0C9\\uC5B4\\uB97C \\uC785\\uB825\\uD558\\uC138\\uC694\", className: \"mr-2\" }), _jsx(Button, { color: contextValue.color, onClick: find, children: \"\\uAC80\\uC0C9\" })] })), _jsx(UncontrolledTreeEnvironment, __assign({ ref: ref, dataProvider: treeProvider, viewState: (_b = {},\n _b[treeId] = {\n focusedItem: (_d = focusedItem[0]) !== null && _d !== void 0 ? _d : '',\n expandedItems: expandedItems,\n selectedItems: selectedItems,\n },\n _b), keyboardBindings: __assign({ renameItem: ['enter'], abortRenameItem: ['control+z'] }, props.keyboardBindings) }, props, { canSearch: false, children: _jsx(ComplexTree, { ref: tree, treeId: treeId, rootItem: \"root\", treeLabel: \"Tree Example\" }) }))] }));\n});\nTree.displayName = 'Tree';\nexport { Tree, treeProvider };\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__rest","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__spreadArray","to","from","pack","ar","l","Array","slice","concat","findItems","arr","key","results","values","forEach","item","index","cva","variants","color","primaryColorStyle","treeProvider","Tree","React","forwardRef","_a","ref","_b","_c","_d","items","treeId","className","isSearch","props","_e","useState","search","setSearch","tree","useRef","_f","treeData","setTreeData","focusedItem","expandedItems","selectedItems","StaticTreeDataProvider","data","theme","useTheme","contextValue","themeColor","MAIN_COLOR","findItemPath","useCallback","search_1","args_1","_i","searchRoot","searchedItems","getTreeItem","toLowerCase","includes","all","children","map","child","find","preventDefault","path","current","expandSubsequently","selectItems","focusItem","useEffect","results_1","children_1","t_1","isFolder","_jsxs","_jsx","TextField","Root","onChange","target","placeholder","Button","onClick","UncontrolledTreeEnvironment","dataProvider","viewState","keyboardBindings","renameItem","abortRenameItem","canSearch","ComplexTree","rootItem","treeLabel","displayName"],"mappings":"slBAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,GAE1E,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,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AO,CAAChD,IACIkD,EAAM,MAAO,CAAEhD,UAAW,gBAAiBiC,SAAU,CAAChC,GAAa+C,EAAM,MAAO,CAAEhD,UAAW,OAAQiC,SAAU,CAACgB,EAAKC,EAAUC,KAAM,CAAEhE,MAAOgC,EAAahC,MAAOnD,MAAOqE,EAAQ+C,SAAU,SAAUjH,GAAK,OAAOmE,EAAUnE,EAAEkH,OAAOrH,MAAO,EAAIsH,YAAa,aAA2DtD,UAAW,SAAWiD,EAAKM,EAAQ,CAAEpE,MAAOgC,EAAahC,MAAOqE,QAASpB,EAAMH,SAAU,UAAwBgB,EAAKQ,EAA6BjJ,EAAS,CAAEkF,IAAKA,EAAKgE,aAAcrE,EAAcsE,WAAYhE,EAAK,CAAE,EACtgBA,EAAGI,GAAU,CACTa,YAAuC,QAAzBf,EAAKe,EAAY,UAAuB,IAAPf,EAAgBA,EAAK,GACpEgB,cAAeA,EACfC,cAAeA,GAEnBnB,GAAKiE,iBAAkBpJ,EAAS,CAAEqJ,WAAY,CAAC,SAAUC,gBAAiB,CAAC,cAAgB5D,EAAM0D,mBAAqB1D,EAAO,CAAE6D,WAAW,EAAO9B,SAAUgB,EAAKe,EAAa,CAAEtE,IAAKa,EAAMR,OAAQA,EAAQkE,SAAU,OAAQC,UAAW,sBAC3P,IACA5E,EAAK6E,YAAc"}
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Tree/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { cva } from 'class-variance-authority';\nimport { primaryColorStyle } from '../../../lib/constants';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { StaticTreeDataProvider, Tree as ComplexTree, UncontrolledTreeEnvironment, } from 'react-complex-tree';\nimport TextField from '../TextField';\nimport Button from '../Button';\nimport { MAIN_COLOR } from '../../../lib/color/constants';\nimport { useTheme } from '../../../lib/theme';\nvar treeVariants = cva('', {\n variants: {\n color: primaryColorStyle(),\n },\n});\nfunction findItems(arr, key) {\n var results = [];\n Object.values(arr).forEach(function (item) {\n if (item[key]) {\n results.push(item.index);\n }\n });\n return results;\n}\nvar treeProvider = null;\nvar Tree = React.forwardRef(function (_a, ref) {\n var _b;\n var _c, _d;\n var items = _a.items, treeId = _a.treeId, className = _a.className, color = _a.color, isSearch = _a.isSearch, props = __rest(_a, [\"items\", \"treeId\", \"className\", \"color\", \"isSearch\"]);\n var _e = useState(''), search = _e[0], setSearch = _e[1];\n var tree = useRef(null);\n var _f = useState({}), treeData = _f[0], setTreeData = _f[1];\n var focusedItem = findItems(items, 'isFocusd');\n var expandedItems = findItems(items, 'isExpanded');\n var selectedItems = findItems(items, 'isSelected');\n treeProvider = new StaticTreeDataProvider(treeData, function (item, data) { return (__assign(__assign({}, item), { data: data })); });\n var theme = useTheme().theme;\n var contextValue = {\n color: (_c = color !== null && color !== void 0 ? color : theme.themeColor) !== null && _c !== void 0 ? _c : MAIN_COLOR,\n };\n var findItemPath = useCallback(function (search_1) {\n var args_1 = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args_1[_i - 1] = arguments[_i];\n }\n return __awaiter(void 0, __spreadArray([search_1], args_1, true), void 0, function (search, searchRoot) {\n var item, searchedItems, result;\n var _a, _b;\n if (searchRoot === void 0) { searchRoot = 'root'; }\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (!treeProvider)\n return [2 /*return*/];\n return [4 /*yield*/, treeProvider.getTreeItem(searchRoot)];\n case 1:\n item = _c.sent();\n if (item.data.toLowerCase().includes(search.toLowerCase())) {\n return [2 /*return*/, [item.index]];\n }\n return [4 /*yield*/, Promise.all((_b = (_a = item.children) === null || _a === void 0 ? void 0 : _a.map(function (child) { return findItemPath(search, child); })) !== null && _b !== void 0 ? _b : [])];\n case 2:\n searchedItems = _c.sent();\n result = searchedItems.find(function (item) { return item !== null; });\n if (!result) {\n return [2 /*return*/, null];\n }\n return [2 /*return*/, __spreadArray([item.index], result, true)];\n }\n });\n });\n }, [treeProvider]);\n var find = useCallback(function (e) {\n e.preventDefault();\n if (search) {\n findItemPath(search).then(function (path) {\n var _a;\n if (path) {\n // wait for full path including leaf, to make sure it loaded in\n (_a = tree.current) === null || _a === void 0 ? void 0 : _a.expandSubsequently(path).then(function () {\n var _a, _b;\n (_a = tree.current) === null || _a === void 0 ? void 0 : _a.selectItems([path[path.length - 1]]);\n (_b = tree.current) === null || _b === void 0 ? void 0 : _b.focusItem(path[path.length - 1]);\n });\n }\n });\n }\n }, [findItemPath, search]);\n useEffect(function () {\n if (items) {\n var results_1 = [];\n var children_1 = [];\n items.map(function (item) {\n children_1.push.apply(children_1, item.children);\n });\n items.forEach(function (item) {\n if (!children_1.includes(item.index)) {\n results_1.push(item.index);\n }\n });\n var t_1 = {};\n t_1['root'] = {\n index: 'root',\n isFolder: true,\n children: results_1,\n data: 'Root item',\n };\n items.map(function (item) {\n t_1[item.index] = __assign(__assign({}, item), { isFolder: item.children.length > 0 });\n });\n setTreeData(t_1);\n }\n }, [items]);\n return (_jsxs(\"div\", { className: \"text-slate-12\", children: [isSearch && (_jsxs(\"div\", { className: \"flex\", children: [_jsx(TextField.Root, { color: contextValue.color, value: search, onChange: function (e) { return setSearch(e.target.value); }, placeholder: \"\\uAC80\\uC0C9\\uC5B4\\uB97C \\uC785\\uB825\\uD558\\uC138\\uC694\", className: \"mr-2\" }), _jsx(Button, { color: contextValue.color, onClick: find, children: \"\\uAC80\\uC0C9\" })] })), _jsx(UncontrolledTreeEnvironment, __assign({ ref: ref, dataProvider: treeProvider, getItemTitle: function (item) {\n return item.data;\n }, viewState: (_b = {},\n _b[treeId] = {\n focusedItem: (_d = focusedItem[0]) !== null && _d !== void 0 ? _d : '',\n expandedItems: expandedItems,\n selectedItems: selectedItems,\n },\n _b), keyboardBindings: __assign({ renameItem: ['enter'], abortRenameItem: ['control+z'] }, props.keyboardBindings) }, props, { canSearch: false, children: _jsx(ComplexTree, { ref: tree, treeId: treeId, rootItem: \"root\", treeLabel: \"Tree Example\" }) }))] }));\n});\nTree.displayName = 'Tree';\nexport { Tree, treeProvider };\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__rest","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__spreadArray","to","from","pack","ar","l","Array","slice","concat","findItems","arr","key","results","values","forEach","item","index","cva","variants","color","primaryColorStyle","treeProvider","Tree","React","forwardRef","_a","ref","_b","_c","_d","items","treeId","className","isSearch","props","_e","useState","search","setSearch","tree","useRef","_f","treeData","setTreeData","focusedItem","expandedItems","selectedItems","StaticTreeDataProvider","data","theme","useTheme","contextValue","themeColor","MAIN_COLOR","findItemPath","useCallback","search_1","args_1","_i","searchRoot","searchedItems","getTreeItem","toLowerCase","includes","all","children","map","child","find","preventDefault","path","current","expandSubsequently","selectItems","focusItem","useEffect","results_1","children_1","t_1","isFolder","_jsxs","_jsx","TextField","Root","onChange","target","placeholder","Button","onClick","UncontrolledTreeEnvironment","dataProvider","getItemTitle","viewState","keyboardBindings","renameItem","abortRenameItem","canSearch","ComplexTree","rootItem","treeLabel","displayName"],"mappings":"mhBAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,GAE1E,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,EAAO,KAIhBO,KAAKR,EAAWK,EAAY,CAC9GH,GAAMN,EAAYA,EAAUN,MAAMG,EAASC,GAAc,KAAKS,OACtE,GACA,EACIM,EAA4C,SAAUhB,EAASiB,GAC/D,IAAsGC,EAAGC,EAAGhC,EAAGiC,EAA3GC,EAA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