@t3q-ui/design-system 1.66.3 → 1.67.0
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/CHANGELOG.md +8 -0
- package/LICENSE.md +4 -2
- package/dist/components/fileTree/index.cjs +99 -0
- package/dist/components/fileTree/index.cjs.map +1 -0
- package/dist/components/fileTree/index.js +99 -0
- package/dist/components/fileTree/index.js.map +1 -0
- package/dist/design-system.css +149 -0
- package/dist/index.cjs +39 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/styles.css +149 -0
- package/mcp/manifests/components.json +191 -0
- package/package.json +3 -2
- package/skills/tds/reference/components.md +26 -2
package/CHANGELOG.md
CHANGED
package/LICENSE.md
CHANGED
|
@@ -26,7 +26,8 @@ Copyright (c) 2025-present 티쓰리큐 주식회사 (T3Q Inc.)
|
|
|
26
26
|
|
|
27
27
|
5. 제3자 구성요소
|
|
28
28
|
본 소프트웨어가 의존하는 제3자 구성요소는 각자의 라이선스를 따릅니다. Pretendard 글꼴은 SIL Open Font
|
|
29
|
-
License 1.1, lucide 아이콘은 ISC
|
|
29
|
+
License 1.1, lucide 아이콘은 ISC 라이선스, FileTree 기본 파일·폴더 아이콘의 Material Symbols는 Apache
|
|
30
|
+
License 2.0입니다. 이 라이선스는 그 조건을 바꾸지 않습니다.
|
|
30
31
|
|
|
31
32
|
6. 보증의 부인과 책임의 제한
|
|
32
33
|
본 소프트웨어는 "있는 그대로" 제공되며, 상품성, 특정 목적 적합성, 권리 비침해를 포함한 어떠한 명시적·묵시적
|
|
@@ -71,7 +72,8 @@ You must include the above copyright notice and this license in all copies or di
|
|
|
71
72
|
|
|
72
73
|
5. Third-Party Components
|
|
73
74
|
Third-party components the Software depends on remain under their own licenses, including the Pretendard font
|
|
74
|
-
(SIL Open Font License 1.1)
|
|
75
|
+
(SIL Open Font License 1.1), lucide icons (ISC License) and the Material Symbols icons used as the FileTree default
|
|
76
|
+
file and folder icons (Apache License 2.0). This license does not change those terms.
|
|
75
77
|
|
|
76
78
|
6. Disclaimer and Limitation of Liability
|
|
77
79
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING MERCHANTABILITY,
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const lucide = require("lucide-react");
|
|
7
|
+
const TreeImport = require("rc-tree");
|
|
8
|
+
const index = require("../spinner/index.cjs");
|
|
9
|
+
;/* empty css */
|
|
10
|
+
const Tree = TreeImport.default ?? TreeImport;
|
|
11
|
+
const PREFIX_CLS = "t3q-file-tree";
|
|
12
|
+
const FILE_PATH = "M6 22q-.824 0-1.412-.587A1.93 1.93 0 0 1 4 20V4q0-.824.588-1.412A1.93 1.93 0 0 1 6 2h7.175a1.98 1.98 0 0 1 1.4.575l4.85 4.85q.275.275.425.638.15.361.15.762V20q0 .824-.587 1.413A1.93 1.93 0 0 1 18 22zm7-14q0 .424.287.713Q13.576 9 14 9h4l-5-5z";
|
|
13
|
+
const FOLDER_PATH = "M4 20q-.824 0-1.412-.587A1.93 1.93 0 0 1 2 18V6q0-.824.587-1.412A1.93 1.93 0 0 1 4 4h5.175a1.98 1.98 0 0 1 1.4.575L12 6h8q.824 0 1.413.588Q22 7.175 22 8v10q0 .824-.587 1.413A1.93 1.93 0 0 1 20 20z";
|
|
14
|
+
function NodeIcon({ d, className }) {
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16
|
+
"svg",
|
|
17
|
+
{
|
|
18
|
+
width: 24,
|
|
19
|
+
height: 24,
|
|
20
|
+
viewBox: "0 0 24 24",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
focusable: "false",
|
|
23
|
+
className,
|
|
24
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d, fill: "currentColor" })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function renderSwitcher(node) {
|
|
29
|
+
if (node.isLeaf) return null;
|
|
30
|
+
return node.expanded ? /* @__PURE__ */ jsxRuntime.jsx(lucide.ChevronDown, { size: 16 }) : /* @__PURE__ */ jsxRuntime.jsx(lucide.ChevronRight, { size: 16 });
|
|
31
|
+
}
|
|
32
|
+
function renderDropIndicator({ dropPosition, dropLevelOffset, indent }) {
|
|
33
|
+
const style = {};
|
|
34
|
+
switch (dropPosition) {
|
|
35
|
+
case -1:
|
|
36
|
+
style.top = 0;
|
|
37
|
+
style.left = -dropLevelOffset * indent;
|
|
38
|
+
break;
|
|
39
|
+
case 1:
|
|
40
|
+
style.bottom = 0;
|
|
41
|
+
style.left = -dropLevelOffset * indent;
|
|
42
|
+
break;
|
|
43
|
+
case 0:
|
|
44
|
+
style.bottom = 0;
|
|
45
|
+
style.left = indent;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${PREFIX_CLS}-drop-indicator`, style });
|
|
49
|
+
}
|
|
50
|
+
function markDisabledLeaves(nodes, childrenKey, treeDisabled, hasLoadData) {
|
|
51
|
+
let changed = false;
|
|
52
|
+
const next = nodes.map((node) => {
|
|
53
|
+
const children = node[childrenKey];
|
|
54
|
+
const nextChildren = children && markDisabledLeaves(children, childrenKey, treeDisabled, hasLoadData);
|
|
55
|
+
const isLeaf = node.isLeaf !== false && !children?.length && (node.isLeaf === true || !hasLoadData);
|
|
56
|
+
const mark = isLeaf && (treeDisabled || node.disabled);
|
|
57
|
+
if (nextChildren === children && !mark) return node;
|
|
58
|
+
changed = true;
|
|
59
|
+
return {
|
|
60
|
+
...node,
|
|
61
|
+
...nextChildren !== children && { [childrenKey]: nextChildren },
|
|
62
|
+
...mark && { "aria-disabled": true }
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
return changed ? next : nodes;
|
|
66
|
+
}
|
|
67
|
+
function FileTree({
|
|
68
|
+
icon,
|
|
69
|
+
treeData,
|
|
70
|
+
...rest
|
|
71
|
+
}) {
|
|
72
|
+
const childrenKey = rest.fieldNames?.children ?? "children";
|
|
73
|
+
const treeDisabled = !!rest.disabled;
|
|
74
|
+
const hasLoadData = !!rest.loadData;
|
|
75
|
+
const markedData = React.useMemo(
|
|
76
|
+
() => treeData && markDisabledLeaves(treeData, childrenKey, treeDisabled, hasLoadData),
|
|
77
|
+
[treeData, childrenKey, treeDisabled, hasLoadData]
|
|
78
|
+
);
|
|
79
|
+
const renderIcon = (node) => {
|
|
80
|
+
if (node.loading) return /* @__PURE__ */ jsxRuntime.jsx(index.Spinner, { size: "small" });
|
|
81
|
+
const custom = typeof icon === "function" ? icon(node) : icon;
|
|
82
|
+
return custom ?? (node.isLeaf ? /* @__PURE__ */ jsxRuntime.jsx(NodeIcon, { d: FILE_PATH, className: `${PREFIX_CLS}-icon-file` }) : /* @__PURE__ */ jsxRuntime.jsx(NodeIcon, { d: FOLDER_PATH, className: `${PREFIX_CLS}-icon-folder` }));
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
+
Tree,
|
|
86
|
+
{
|
|
87
|
+
...rest,
|
|
88
|
+
treeData: markedData,
|
|
89
|
+
prefixCls: PREFIX_CLS,
|
|
90
|
+
showLine: false,
|
|
91
|
+
itemHeight: 28,
|
|
92
|
+
icon: renderIcon,
|
|
93
|
+
switcherIcon: renderSwitcher,
|
|
94
|
+
dropIndicatorRender: renderDropIndicator
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
exports.FileTree = FileTree;
|
|
99
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/fileTree/index.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useMemo } from 'react'\nimport { ChevronDown, ChevronRight } from 'lucide-react'\nimport TreeImport, { type BasicDataNode, type TreeNodeProps, type TreeProps } from 'rc-tree'\nimport type { DataNode, EventDataNode } from 'rc-tree/lib/interface'\n\nimport { Spinner } from '../spinner'\n\nimport './fileTree.css'\n\n// rc-tree 는 CJS(`exports.default = Tree`, package.json 에 exports·type 없음). 이 DS 는 ESM 으로 배포되므로\n// 소비처가 패키지를 트랜스파일하지 않으면 default 로 module.exports 전체(객체)가 넘어와 <Tree/> 가 크래시한다.\n// Spinner 와 같이 런타임에 .default 를 풀어 둔다.\nconst Tree = ((TreeImport as any).default ?? TreeImport) as typeof TreeImport\n\nconst PREFIX_CLS = 't3q-file-tree'\n\n/**\n * 트리 노드 데이터. `key`(필수)·`title`·`children`·`isLeaf`·`disabled` 등.\n *\n * `disabled: true` 는 선택·드래그를 막는다. 폴더는 계속 펼칠 수 있고, 펼칠 것이 없는 노드는 FileTree 가 `aria-disabled` 를 붙인다.\n * 비활성 노드에는 우클릭 메뉴를 열지 않는다 — rc-tree 는 우클릭을 막지 않는다.\n */\nexport type FileTreeNode = DataNode\n\n/** 이벤트 핸들러(`onSelect`·`onExpand`·`loadData` 등)가 받는 노드. 노드 데이터에 `expanded`·`selected`·`loaded` 같은 상태가 붙는다 */\nexport type FileTreeEventNode<T extends BasicDataNode = DataNode> = EventDataNode<T>\n\ntype DropIndicatorProps = Parameters<NonNullable<TreeProps['dropIndicatorRender']>>[0]\n\n/** FileTree 가 외형을 정해 두어 받지 않는 rc-tree props — 접두사·연결선·행 높이·펼침 아이콘·체크박스·드롭 표시선 */\ntype FixedTreeProps =\n | 'prefixCls'\n | 'showLine'\n | 'itemHeight'\n | 'switcherIcon'\n | 'checkable'\n | 'dropIndicatorRender'\n\nexport interface FileTreeProps<T extends BasicDataNode = DataNode> extends Omit<\n TreeProps<T>,\n FixedTreeProps\n> {\n /** 트리 데이터. 노드마다 `key`·`title`·`children` 을 두고, 폴더를 펼칠 때 불러오는 노드는 `isLeaf: false`, 파일은 `isLeaf: true`. 비활성 잎이 있으면 그 노드와 상위 노드는 복사본이 콜백으로 온다 — 노드는 `key` 로 비교한다 */\n treeData?: TreeProps<T>['treeData']\n /** 아이콘 칸에 그릴 내용(노드 또는 노드를 받는 함수). 없으면 폴더·파일 기본 아이콘이고, 불러오는 중에는 이 값과 상관없이 Spinner. 노드 데이터의 `icon` 은 이 값과 불러오는 중 표시를 덮는다 */\n icon?: TreeProps<T>['icon']\n /** 폴더를 펼칠 때 하위 노드를 불러오는 함수. 반환한 Promise 가 끝나면 펼쳐진다 — 그동안 아이콘 칸에 Spinner */\n loadData?: TreeProps<T>['loadData']\n /** 목록 높이(px). 주면 보이는 만큼만 그리는 가상 스크롤이 켜진다. 노드가 많을 때 준다 */\n height?: TreeProps<T>['height']\n /** 노드를 눌러 선택이 바뀔 때 호출된다 */\n onSelect?: TreeProps<T>['onSelect']\n /** 노드를 우클릭할 때 호출된다. 메뉴는 앱이 DropdownMenu 등으로 그린다 */\n onRightClick?: TreeProps<T>['onRightClick']\n /** 노드 제목을 직접 그린다. 노드 데이터를 받아 제목 자리에 들어갈 내용을 돌려준다 */\n titleRender?: TreeProps<T>['titleRender']\n}\n\n// Material Symbols Rounded draft·folder(채움, Apache-2.0) — dl-ui-v3 파일 트리가 @tpl/icons 3.6.0 note·folder 로 그리는 것과 같은 path.\n// 원본의 전체 덮개 mask·고정 id 는 그림에 영향이 없어 뺐다.\nconst FILE_PATH =\n 'M6 22q-.824 0-1.412-.587A1.93 1.93 0 0 1 4 20V4q0-.824.588-1.412A1.93 1.93 0 0 1 6 2h7.175a1.98 1.98 0 0 1 1.4.575l4.85 4.85q.275.275.425.638.15.361.15.762V20q0 .824-.587 1.413A1.93 1.93 0 0 1 18 22zm7-14q0 .424.287.713Q13.576 9 14 9h4l-5-5z'\nconst FOLDER_PATH =\n 'M4 20q-.824 0-1.412-.587A1.93 1.93 0 0 1 2 18V6q0-.824.587-1.412A1.93 1.93 0 0 1 4 4h5.175a1.98 1.98 0 0 1 1.4.575L12 6h8q.824 0 1.413.588Q22 7.175 22 8v10q0 .824-.587 1.413A1.93 1.93 0 0 1 20 20z'\n\nfunction NodeIcon({ d, className }: { d: string; className: string }) {\n return (\n <svg\n width={24}\n height={24}\n viewBox='0 0 24 24'\n aria-hidden='true'\n focusable='false'\n className={className}\n >\n <path d={d} fill='currentColor' />\n </svg>\n )\n}\n\nfunction renderSwitcher(node: TreeNodeProps): ReactNode {\n if (node.isLeaf) return null\n return node.expanded ? <ChevronDown size={16} /> : <ChevronRight size={16} />\n}\n\n// rc-tree 기본 표시선과 같은 위치 계산(dropPosition -1 위 · 0 안 · 1 아래). 색·두께는 CSS.\nfunction renderDropIndicator({ dropPosition, dropLevelOffset, indent }: DropIndicatorProps) {\n const style: CSSProperties = {}\n switch (dropPosition) {\n case -1:\n style.top = 0\n style.left = -dropLevelOffset * indent\n break\n case 1:\n style.bottom = 0\n style.left = -dropLevelOffset * indent\n break\n case 0:\n style.bottom = 0\n style.left = indent\n break\n }\n return <div className={`${PREFIX_CLS}-drop-indicator`} style={style} />\n}\n\n// rc-tree 는 비활성 노드를 클래스로만 흐리게 그리고 treeitem 에 `aria-disabled` 를 붙이지 않는다. 접근성 검사는\n// `aria-disabled` 가 있어야 비활성 글자를 대비 검사에서 뺀다. 그런데 rc-tree 의 비활성 폴더는 펼침 화살표·←/→·\n// `expandAction` 으로 여전히 펼쳐지므로 \"조작 불가\"가 사실인 노드, 곧 펼칠 것이 없는 비활성 잎에만 붙인다\n// (폴더는 속성 없이 CSS 의 대비 색으로 그린다). 잎 판정은 rc-tree 의 펼침 경로(화살표 TreeNode.js·키보드 Tree.js)가\n// 모두 못 펴는 조건과 같다. 바뀐 것이 없는 배열·노드는 받은 것 그대로 돌려줘 넘긴 객체를 변이하지 않는다.\nfunction markDisabledLeaves<N extends BasicDataNode>(\n nodes: N[],\n childrenKey: string,\n treeDisabled: boolean,\n hasLoadData: boolean,\n): N[] {\n let changed = false\n const next = nodes.map((node) => {\n const children = (node as Record<string, unknown>)[childrenKey] as N[] | undefined\n const nextChildren =\n children && markDisabledLeaves(children, childrenKey, treeDisabled, hasLoadData)\n const isLeaf =\n node.isLeaf !== false && !children?.length && (node.isLeaf === true || !hasLoadData)\n const mark = isLeaf && (treeDisabled || node.disabled)\n if (nextChildren === children && !mark) return node\n changed = true\n return {\n ...node,\n ...(nextChildren !== children && { [childrenKey]: nextChildren }),\n ...(mark && { 'aria-disabled': true }),\n }\n })\n return (changed ? next : nodes) as N[]\n}\n\n/**\n * 파일·폴더 계층을 펼치고 접으며 고르는 트리.\n *\n * 언제 쓰나: 파일·폴더 계층 탐색, 폴더를 펼칠 때 하위 항목을 그때그때 불러오는 목록(`loadData`), 노드가 많은 목록(`height` 를 주면 가상 스크롤).\n * 언제 안 쓰나: 평면 목록(→ Table·AgGridTable), 화면 이동 메뉴(→ Sidebar).\n * 대신/함께: 우클릭 메뉴는 `onRightClick` 과 DropdownMenu 를 앱이 이어 붙인다. \"더 보기\" 같은 앱 고유 노드·실행 모듈 표시는 `treeData`·`icon`·`titleRender` 로, 검색어 강조는 `filterTreeNode` 로 그린다.\n */\nexport function FileTree<T extends BasicDataNode = DataNode>({\n icon,\n treeData,\n ...rest\n}: FileTreeProps<T>) {\n const childrenKey = rest.fieldNames?.children ?? 'children'\n const treeDisabled = !!rest.disabled\n const hasLoadData = !!rest.loadData\n const markedData = useMemo(\n () => treeData && markDisabledLeaves(treeData, childrenKey, treeDisabled, hasLoadData),\n [treeData, childrenKey, treeDisabled, hasLoadData],\n )\n\n const renderIcon = (node: TreeNodeProps): ReactNode => {\n if (node.loading) return <Spinner size='small' />\n const custom = typeof icon === 'function' ? icon(node) : icon\n return (\n custom ??\n (node.isLeaf ? (\n <NodeIcon d={FILE_PATH} className={`${PREFIX_CLS}-icon-file`} />\n ) : (\n <NodeIcon d={FOLDER_PATH} className={`${PREFIX_CLS}-icon-folder`} />\n ))\n )\n }\n\n return (\n <Tree<T>\n {...rest}\n treeData={markedData}\n prefixCls={PREFIX_CLS}\n showLine={false}\n itemHeight={28}\n icon={renderIcon}\n switcherIcon={renderSwitcher}\n dropIndicatorRender={renderDropIndicator}\n />\n )\n}\n"],"names":["jsx","ChevronDown","ChevronRight","useMemo","Spinner"],"mappings":";;;;;;;;;AAYA,MAAM,OAAS,WAAmB,WAAW;AAE7C,MAAM,aAAa;AA8CnB,MAAM,YACJ;AACF,MAAM,cACJ;AAEF,SAAS,SAAS,EAAE,GAAG,aAA+C;AACpE,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAQ;AAAA,MACR,eAAY;AAAA,MACZ,WAAU;AAAA,MACV;AAAA,MAEA,UAAAA,2BAAAA,IAAC,QAAA,EAAK,GAAM,MAAK,eAAA,CAAe;AAAA,IAAA;AAAA,EAAA;AAGtC;AAEA,SAAS,eAAe,MAAgC;AACtD,MAAI,KAAK,OAAQ,QAAO;AACxB,SAAO,KAAK,WAAWA,+BAACC,OAAAA,aAAA,EAAY,MAAM,IAAI,IAAKD,2BAAAA,IAACE,OAAAA,cAAA,EAAa,MAAM,GAAA,CAAI;AAC7E;AAGA,SAAS,oBAAoB,EAAE,cAAc,iBAAiB,UAA8B;AAC1F,QAAM,QAAuB,CAAA;AAC7B,UAAQ,cAAA;AAAA,IACN,KAAK;AACH,YAAM,MAAM;AACZ,YAAM,OAAO,CAAC,kBAAkB;AAChC;AAAA,IACF,KAAK;AACH,YAAM,SAAS;AACf,YAAM,OAAO,CAAC,kBAAkB;AAChC;AAAA,IACF,KAAK;AACH,YAAM,SAAS;AACf,YAAM,OAAO;AACb;AAAA,EAAA;AAEJ,wCAAQ,OAAA,EAAI,WAAW,GAAG,UAAU,mBAAmB,OAAc;AACvE;AAOA,SAAS,mBACP,OACA,aACA,cACA,aACK;AACL,MAAI,UAAU;AACd,QAAM,OAAO,MAAM,IAAI,CAAC,SAAS;AAC/B,UAAM,WAAY,KAAiC,WAAW;AAC9D,UAAM,eACJ,YAAY,mBAAmB,UAAU,aAAa,cAAc,WAAW;AACjF,UAAM,SACJ,KAAK,WAAW,SAAS,CAAC,UAAU,WAAW,KAAK,WAAW,QAAQ,CAAC;AAC1E,UAAM,OAAO,WAAW,gBAAgB,KAAK;AAC7C,QAAI,iBAAiB,YAAY,CAAC,KAAM,QAAO;AAC/C,cAAU;AACV,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAI,iBAAiB,YAAY,EAAE,CAAC,WAAW,GAAG,aAAA;AAAA,MAClD,GAAI,QAAQ,EAAE,iBAAiB,KAAA;AAAA,IAAK;AAAA,EAExC,CAAC;AACD,SAAQ,UAAU,OAAO;AAC3B;AASO,SAAS,SAA6C;AAAA,EAC3D;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAqB;AACnB,QAAM,cAAc,KAAK,YAAY,YAAY;AACjD,QAAM,eAAe,CAAC,CAAC,KAAK;AAC5B,QAAM,cAAc,CAAC,CAAC,KAAK;AAC3B,QAAM,aAAaC,MAAAA;AAAAA,IACjB,MAAM,YAAY,mBAAmB,UAAU,aAAa,cAAc,WAAW;AAAA,IACrF,CAAC,UAAU,aAAa,cAAc,WAAW;AAAA,EAAA;AAGnD,QAAM,aAAa,CAAC,SAAmC;AACrD,QAAI,KAAK,QAAS,QAAOH,2BAAAA,IAACI,MAAAA,SAAA,EAAQ,MAAK,SAAQ;AAC/C,UAAM,SAAS,OAAO,SAAS,aAAa,KAAK,IAAI,IAAI;AACzD,WACE,WACC,KAAK,wCACH,UAAA,EAAS,GAAG,WAAW,WAAW,GAAG,UAAU,aAAA,CAAc,mCAE7D,UAAA,EAAS,GAAG,aAAa,WAAW,GAAG,UAAU,eAAA,CAAgB;AAAA,EAGxE;AAEA,SACEJ,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,cAAc;AAAA,MACd,qBAAqB;AAAA,IAAA;AAAA,EAAA;AAG3B;;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
5
|
+
import TreeImport from "rc-tree";
|
|
6
|
+
import { Spinner } from "../spinner/index.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
const Tree = TreeImport.default ?? TreeImport;
|
|
9
|
+
const PREFIX_CLS = "t3q-file-tree";
|
|
10
|
+
const FILE_PATH = "M6 22q-.824 0-1.412-.587A1.93 1.93 0 0 1 4 20V4q0-.824.588-1.412A1.93 1.93 0 0 1 6 2h7.175a1.98 1.98 0 0 1 1.4.575l4.85 4.85q.275.275.425.638.15.361.15.762V20q0 .824-.587 1.413A1.93 1.93 0 0 1 18 22zm7-14q0 .424.287.713Q13.576 9 14 9h4l-5-5z";
|
|
11
|
+
const FOLDER_PATH = "M4 20q-.824 0-1.412-.587A1.93 1.93 0 0 1 2 18V6q0-.824.587-1.412A1.93 1.93 0 0 1 4 4h5.175a1.98 1.98 0 0 1 1.4.575L12 6h8q.824 0 1.413.588Q22 7.175 22 8v10q0 .824-.587 1.413A1.93 1.93 0 0 1 20 20z";
|
|
12
|
+
function NodeIcon({ d, className }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"svg",
|
|
15
|
+
{
|
|
16
|
+
width: 24,
|
|
17
|
+
height: 24,
|
|
18
|
+
viewBox: "0 0 24 24",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
focusable: "false",
|
|
21
|
+
className,
|
|
22
|
+
children: /* @__PURE__ */ jsx("path", { d, fill: "currentColor" })
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function renderSwitcher(node) {
|
|
27
|
+
if (node.isLeaf) return null;
|
|
28
|
+
return node.expanded ? /* @__PURE__ */ jsx(ChevronDown, { size: 16 }) : /* @__PURE__ */ jsx(ChevronRight, { size: 16 });
|
|
29
|
+
}
|
|
30
|
+
function renderDropIndicator({ dropPosition, dropLevelOffset, indent }) {
|
|
31
|
+
const style = {};
|
|
32
|
+
switch (dropPosition) {
|
|
33
|
+
case -1:
|
|
34
|
+
style.top = 0;
|
|
35
|
+
style.left = -dropLevelOffset * indent;
|
|
36
|
+
break;
|
|
37
|
+
case 1:
|
|
38
|
+
style.bottom = 0;
|
|
39
|
+
style.left = -dropLevelOffset * indent;
|
|
40
|
+
break;
|
|
41
|
+
case 0:
|
|
42
|
+
style.bottom = 0;
|
|
43
|
+
style.left = indent;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
return /* @__PURE__ */ jsx("div", { className: `${PREFIX_CLS}-drop-indicator`, style });
|
|
47
|
+
}
|
|
48
|
+
function markDisabledLeaves(nodes, childrenKey, treeDisabled, hasLoadData) {
|
|
49
|
+
let changed = false;
|
|
50
|
+
const next = nodes.map((node) => {
|
|
51
|
+
const children = node[childrenKey];
|
|
52
|
+
const nextChildren = children && markDisabledLeaves(children, childrenKey, treeDisabled, hasLoadData);
|
|
53
|
+
const isLeaf = node.isLeaf !== false && !children?.length && (node.isLeaf === true || !hasLoadData);
|
|
54
|
+
const mark = isLeaf && (treeDisabled || node.disabled);
|
|
55
|
+
if (nextChildren === children && !mark) return node;
|
|
56
|
+
changed = true;
|
|
57
|
+
return {
|
|
58
|
+
...node,
|
|
59
|
+
...nextChildren !== children && { [childrenKey]: nextChildren },
|
|
60
|
+
...mark && { "aria-disabled": true }
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
return changed ? next : nodes;
|
|
64
|
+
}
|
|
65
|
+
function FileTree({
|
|
66
|
+
icon,
|
|
67
|
+
treeData,
|
|
68
|
+
...rest
|
|
69
|
+
}) {
|
|
70
|
+
const childrenKey = rest.fieldNames?.children ?? "children";
|
|
71
|
+
const treeDisabled = !!rest.disabled;
|
|
72
|
+
const hasLoadData = !!rest.loadData;
|
|
73
|
+
const markedData = useMemo(
|
|
74
|
+
() => treeData && markDisabledLeaves(treeData, childrenKey, treeDisabled, hasLoadData),
|
|
75
|
+
[treeData, childrenKey, treeDisabled, hasLoadData]
|
|
76
|
+
);
|
|
77
|
+
const renderIcon = (node) => {
|
|
78
|
+
if (node.loading) return /* @__PURE__ */ jsx(Spinner, { size: "small" });
|
|
79
|
+
const custom = typeof icon === "function" ? icon(node) : icon;
|
|
80
|
+
return custom ?? (node.isLeaf ? /* @__PURE__ */ jsx(NodeIcon, { d: FILE_PATH, className: `${PREFIX_CLS}-icon-file` }) : /* @__PURE__ */ jsx(NodeIcon, { d: FOLDER_PATH, className: `${PREFIX_CLS}-icon-folder` }));
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
Tree,
|
|
84
|
+
{
|
|
85
|
+
...rest,
|
|
86
|
+
treeData: markedData,
|
|
87
|
+
prefixCls: PREFIX_CLS,
|
|
88
|
+
showLine: false,
|
|
89
|
+
itemHeight: 28,
|
|
90
|
+
icon: renderIcon,
|
|
91
|
+
switcherIcon: renderSwitcher,
|
|
92
|
+
dropIndicatorRender: renderDropIndicator
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
FileTree
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/fileTree/index.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useMemo } from 'react'\nimport { ChevronDown, ChevronRight } from 'lucide-react'\nimport TreeImport, { type BasicDataNode, type TreeNodeProps, type TreeProps } from 'rc-tree'\nimport type { DataNode, EventDataNode } from 'rc-tree/lib/interface'\n\nimport { Spinner } from '../spinner'\n\nimport './fileTree.css'\n\n// rc-tree 는 CJS(`exports.default = Tree`, package.json 에 exports·type 없음). 이 DS 는 ESM 으로 배포되므로\n// 소비처가 패키지를 트랜스파일하지 않으면 default 로 module.exports 전체(객체)가 넘어와 <Tree/> 가 크래시한다.\n// Spinner 와 같이 런타임에 .default 를 풀어 둔다.\nconst Tree = ((TreeImport as any).default ?? TreeImport) as typeof TreeImport\n\nconst PREFIX_CLS = 't3q-file-tree'\n\n/**\n * 트리 노드 데이터. `key`(필수)·`title`·`children`·`isLeaf`·`disabled` 등.\n *\n * `disabled: true` 는 선택·드래그를 막는다. 폴더는 계속 펼칠 수 있고, 펼칠 것이 없는 노드는 FileTree 가 `aria-disabled` 를 붙인다.\n * 비활성 노드에는 우클릭 메뉴를 열지 않는다 — rc-tree 는 우클릭을 막지 않는다.\n */\nexport type FileTreeNode = DataNode\n\n/** 이벤트 핸들러(`onSelect`·`onExpand`·`loadData` 등)가 받는 노드. 노드 데이터에 `expanded`·`selected`·`loaded` 같은 상태가 붙는다 */\nexport type FileTreeEventNode<T extends BasicDataNode = DataNode> = EventDataNode<T>\n\ntype DropIndicatorProps = Parameters<NonNullable<TreeProps['dropIndicatorRender']>>[0]\n\n/** FileTree 가 외형을 정해 두어 받지 않는 rc-tree props — 접두사·연결선·행 높이·펼침 아이콘·체크박스·드롭 표시선 */\ntype FixedTreeProps =\n | 'prefixCls'\n | 'showLine'\n | 'itemHeight'\n | 'switcherIcon'\n | 'checkable'\n | 'dropIndicatorRender'\n\nexport interface FileTreeProps<T extends BasicDataNode = DataNode> extends Omit<\n TreeProps<T>,\n FixedTreeProps\n> {\n /** 트리 데이터. 노드마다 `key`·`title`·`children` 을 두고, 폴더를 펼칠 때 불러오는 노드는 `isLeaf: false`, 파일은 `isLeaf: true`. 비활성 잎이 있으면 그 노드와 상위 노드는 복사본이 콜백으로 온다 — 노드는 `key` 로 비교한다 */\n treeData?: TreeProps<T>['treeData']\n /** 아이콘 칸에 그릴 내용(노드 또는 노드를 받는 함수). 없으면 폴더·파일 기본 아이콘이고, 불러오는 중에는 이 값과 상관없이 Spinner. 노드 데이터의 `icon` 은 이 값과 불러오는 중 표시를 덮는다 */\n icon?: TreeProps<T>['icon']\n /** 폴더를 펼칠 때 하위 노드를 불러오는 함수. 반환한 Promise 가 끝나면 펼쳐진다 — 그동안 아이콘 칸에 Spinner */\n loadData?: TreeProps<T>['loadData']\n /** 목록 높이(px). 주면 보이는 만큼만 그리는 가상 스크롤이 켜진다. 노드가 많을 때 준다 */\n height?: TreeProps<T>['height']\n /** 노드를 눌러 선택이 바뀔 때 호출된다 */\n onSelect?: TreeProps<T>['onSelect']\n /** 노드를 우클릭할 때 호출된다. 메뉴는 앱이 DropdownMenu 등으로 그린다 */\n onRightClick?: TreeProps<T>['onRightClick']\n /** 노드 제목을 직접 그린다. 노드 데이터를 받아 제목 자리에 들어갈 내용을 돌려준다 */\n titleRender?: TreeProps<T>['titleRender']\n}\n\n// Material Symbols Rounded draft·folder(채움, Apache-2.0) — dl-ui-v3 파일 트리가 @tpl/icons 3.6.0 note·folder 로 그리는 것과 같은 path.\n// 원본의 전체 덮개 mask·고정 id 는 그림에 영향이 없어 뺐다.\nconst FILE_PATH =\n 'M6 22q-.824 0-1.412-.587A1.93 1.93 0 0 1 4 20V4q0-.824.588-1.412A1.93 1.93 0 0 1 6 2h7.175a1.98 1.98 0 0 1 1.4.575l4.85 4.85q.275.275.425.638.15.361.15.762V20q0 .824-.587 1.413A1.93 1.93 0 0 1 18 22zm7-14q0 .424.287.713Q13.576 9 14 9h4l-5-5z'\nconst FOLDER_PATH =\n 'M4 20q-.824 0-1.412-.587A1.93 1.93 0 0 1 2 18V6q0-.824.587-1.412A1.93 1.93 0 0 1 4 4h5.175a1.98 1.98 0 0 1 1.4.575L12 6h8q.824 0 1.413.588Q22 7.175 22 8v10q0 .824-.587 1.413A1.93 1.93 0 0 1 20 20z'\n\nfunction NodeIcon({ d, className }: { d: string; className: string }) {\n return (\n <svg\n width={24}\n height={24}\n viewBox='0 0 24 24'\n aria-hidden='true'\n focusable='false'\n className={className}\n >\n <path d={d} fill='currentColor' />\n </svg>\n )\n}\n\nfunction renderSwitcher(node: TreeNodeProps): ReactNode {\n if (node.isLeaf) return null\n return node.expanded ? <ChevronDown size={16} /> : <ChevronRight size={16} />\n}\n\n// rc-tree 기본 표시선과 같은 위치 계산(dropPosition -1 위 · 0 안 · 1 아래). 색·두께는 CSS.\nfunction renderDropIndicator({ dropPosition, dropLevelOffset, indent }: DropIndicatorProps) {\n const style: CSSProperties = {}\n switch (dropPosition) {\n case -1:\n style.top = 0\n style.left = -dropLevelOffset * indent\n break\n case 1:\n style.bottom = 0\n style.left = -dropLevelOffset * indent\n break\n case 0:\n style.bottom = 0\n style.left = indent\n break\n }\n return <div className={`${PREFIX_CLS}-drop-indicator`} style={style} />\n}\n\n// rc-tree 는 비활성 노드를 클래스로만 흐리게 그리고 treeitem 에 `aria-disabled` 를 붙이지 않는다. 접근성 검사는\n// `aria-disabled` 가 있어야 비활성 글자를 대비 검사에서 뺀다. 그런데 rc-tree 의 비활성 폴더는 펼침 화살표·←/→·\n// `expandAction` 으로 여전히 펼쳐지므로 \"조작 불가\"가 사실인 노드, 곧 펼칠 것이 없는 비활성 잎에만 붙인다\n// (폴더는 속성 없이 CSS 의 대비 색으로 그린다). 잎 판정은 rc-tree 의 펼침 경로(화살표 TreeNode.js·키보드 Tree.js)가\n// 모두 못 펴는 조건과 같다. 바뀐 것이 없는 배열·노드는 받은 것 그대로 돌려줘 넘긴 객체를 변이하지 않는다.\nfunction markDisabledLeaves<N extends BasicDataNode>(\n nodes: N[],\n childrenKey: string,\n treeDisabled: boolean,\n hasLoadData: boolean,\n): N[] {\n let changed = false\n const next = nodes.map((node) => {\n const children = (node as Record<string, unknown>)[childrenKey] as N[] | undefined\n const nextChildren =\n children && markDisabledLeaves(children, childrenKey, treeDisabled, hasLoadData)\n const isLeaf =\n node.isLeaf !== false && !children?.length && (node.isLeaf === true || !hasLoadData)\n const mark = isLeaf && (treeDisabled || node.disabled)\n if (nextChildren === children && !mark) return node\n changed = true\n return {\n ...node,\n ...(nextChildren !== children && { [childrenKey]: nextChildren }),\n ...(mark && { 'aria-disabled': true }),\n }\n })\n return (changed ? next : nodes) as N[]\n}\n\n/**\n * 파일·폴더 계층을 펼치고 접으며 고르는 트리.\n *\n * 언제 쓰나: 파일·폴더 계층 탐색, 폴더를 펼칠 때 하위 항목을 그때그때 불러오는 목록(`loadData`), 노드가 많은 목록(`height` 를 주면 가상 스크롤).\n * 언제 안 쓰나: 평면 목록(→ Table·AgGridTable), 화면 이동 메뉴(→ Sidebar).\n * 대신/함께: 우클릭 메뉴는 `onRightClick` 과 DropdownMenu 를 앱이 이어 붙인다. \"더 보기\" 같은 앱 고유 노드·실행 모듈 표시는 `treeData`·`icon`·`titleRender` 로, 검색어 강조는 `filterTreeNode` 로 그린다.\n */\nexport function FileTree<T extends BasicDataNode = DataNode>({\n icon,\n treeData,\n ...rest\n}: FileTreeProps<T>) {\n const childrenKey = rest.fieldNames?.children ?? 'children'\n const treeDisabled = !!rest.disabled\n const hasLoadData = !!rest.loadData\n const markedData = useMemo(\n () => treeData && markDisabledLeaves(treeData, childrenKey, treeDisabled, hasLoadData),\n [treeData, childrenKey, treeDisabled, hasLoadData],\n )\n\n const renderIcon = (node: TreeNodeProps): ReactNode => {\n if (node.loading) return <Spinner size='small' />\n const custom = typeof icon === 'function' ? icon(node) : icon\n return (\n custom ??\n (node.isLeaf ? (\n <NodeIcon d={FILE_PATH} className={`${PREFIX_CLS}-icon-file`} />\n ) : (\n <NodeIcon d={FOLDER_PATH} className={`${PREFIX_CLS}-icon-folder`} />\n ))\n )\n }\n\n return (\n <Tree<T>\n {...rest}\n treeData={markedData}\n prefixCls={PREFIX_CLS}\n showLine={false}\n itemHeight={28}\n icon={renderIcon}\n switcherIcon={renderSwitcher}\n dropIndicatorRender={renderDropIndicator}\n />\n )\n}\n"],"names":[],"mappings":";;;;;;;AAYA,MAAM,OAAS,WAAmB,WAAW;AAE7C,MAAM,aAAa;AA8CnB,MAAM,YACJ;AACF,MAAM,cACJ;AAEF,SAAS,SAAS,EAAE,GAAG,aAA+C;AACpE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAQ;AAAA,MACR,eAAY;AAAA,MACZ,WAAU;AAAA,MACV;AAAA,MAEA,UAAA,oBAAC,QAAA,EAAK,GAAM,MAAK,eAAA,CAAe;AAAA,IAAA;AAAA,EAAA;AAGtC;AAEA,SAAS,eAAe,MAAgC;AACtD,MAAI,KAAK,OAAQ,QAAO;AACxB,SAAO,KAAK,WAAW,oBAAC,aAAA,EAAY,MAAM,IAAI,IAAK,oBAAC,cAAA,EAAa,MAAM,GAAA,CAAI;AAC7E;AAGA,SAAS,oBAAoB,EAAE,cAAc,iBAAiB,UAA8B;AAC1F,QAAM,QAAuB,CAAA;AAC7B,UAAQ,cAAA;AAAA,IACN,KAAK;AACH,YAAM,MAAM;AACZ,YAAM,OAAO,CAAC,kBAAkB;AAChC;AAAA,IACF,KAAK;AACH,YAAM,SAAS;AACf,YAAM,OAAO,CAAC,kBAAkB;AAChC;AAAA,IACF,KAAK;AACH,YAAM,SAAS;AACf,YAAM,OAAO;AACb;AAAA,EAAA;AAEJ,6BAAQ,OAAA,EAAI,WAAW,GAAG,UAAU,mBAAmB,OAAc;AACvE;AAOA,SAAS,mBACP,OACA,aACA,cACA,aACK;AACL,MAAI,UAAU;AACd,QAAM,OAAO,MAAM,IAAI,CAAC,SAAS;AAC/B,UAAM,WAAY,KAAiC,WAAW;AAC9D,UAAM,eACJ,YAAY,mBAAmB,UAAU,aAAa,cAAc,WAAW;AACjF,UAAM,SACJ,KAAK,WAAW,SAAS,CAAC,UAAU,WAAW,KAAK,WAAW,QAAQ,CAAC;AAC1E,UAAM,OAAO,WAAW,gBAAgB,KAAK;AAC7C,QAAI,iBAAiB,YAAY,CAAC,KAAM,QAAO;AAC/C,cAAU;AACV,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAI,iBAAiB,YAAY,EAAE,CAAC,WAAW,GAAG,aAAA;AAAA,MAClD,GAAI,QAAQ,EAAE,iBAAiB,KAAA;AAAA,IAAK;AAAA,EAExC,CAAC;AACD,SAAQ,UAAU,OAAO;AAC3B;AASO,SAAS,SAA6C;AAAA,EAC3D;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAqB;AACnB,QAAM,cAAc,KAAK,YAAY,YAAY;AACjD,QAAM,eAAe,CAAC,CAAC,KAAK;AAC5B,QAAM,cAAc,CAAC,CAAC,KAAK;AAC3B,QAAM,aAAa;AAAA,IACjB,MAAM,YAAY,mBAAmB,UAAU,aAAa,cAAc,WAAW;AAAA,IACrF,CAAC,UAAU,aAAa,cAAc,WAAW;AAAA,EAAA;AAGnD,QAAM,aAAa,CAAC,SAAmC;AACrD,QAAI,KAAK,QAAS,QAAO,oBAAC,SAAA,EAAQ,MAAK,SAAQ;AAC/C,UAAM,SAAS,OAAO,SAAS,aAAa,KAAK,IAAI,IAAI;AACzD,WACE,WACC,KAAK,6BACH,UAAA,EAAS,GAAG,WAAW,WAAW,GAAG,UAAU,aAAA,CAAc,wBAE7D,UAAA,EAAS,GAAG,aAAa,WAAW,GAAG,UAAU,eAAA,CAAgB;AAAA,EAGxE;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,cAAc;AAAA,MACd,qBAAqB;AAAA,IAAA;AAAA,EAAA;AAG3B;"}
|
package/dist/design-system.css
CHANGED
|
@@ -1,3 +1,152 @@
|
|
|
1
|
+
/* FileTree — rc-tree 를 접두사 `t3q-file-tree` 로 그린다.
|
|
2
|
+
rc-tree 기본 CSS(rc-tree/assets/index.css)는 쓰지 않는다. 기본 CSS 가 하던 일 중 필요한 것
|
|
3
|
+
(내용 칸 위치 기준·검색어 강조·말줄임)만 아래에서 대신하고, 색은 전부 DS 토큰이다.
|
|
4
|
+
행 높이 28 = 위아래 padding 2 + 내용 칸 24 (index.tsx 의 itemHeight 와 같은 값). */
|
|
5
|
+
|
|
6
|
+
/* ==================== 행 ==================== */
|
|
7
|
+
|
|
8
|
+
.t3q-file-tree-treenode {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 2px;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 2px 0;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* 들여쓰기 — 단계마다 12px. rc-tree 가 이 폭을 재서 드롭 표시선 위치에 쓴다 */
|
|
18
|
+
.t3q-file-tree-indent {
|
|
19
|
+
display: inline-block;
|
|
20
|
+
height: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.t3q-file-tree-indent-unit {
|
|
24
|
+
display: inline-block;
|
|
25
|
+
width: 12px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* 펼침 칸(16×16). 잎은 안이 비어 있어 칸만 차지한다 */
|
|
29
|
+
.t3q-file-tree-switcher {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
width: 16px;
|
|
35
|
+
height: 16px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.t3q-file-tree-switcher-noop {
|
|
40
|
+
cursor: auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* 내용 칸(아이콘 + 제목). position: relative 는 드롭 표시선(내용 칸 안에 그려짐)의 위치 기준 —
|
|
44
|
+
없으면 표시선이 대상 행이 아니라 목록 가장자리에 찍힌다 */
|
|
45
|
+
.t3q-file-tree-node-content-wrapper {
|
|
46
|
+
position: relative;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
flex: 1;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: 4px;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* 아이콘 칸 24×24 */
|
|
56
|
+
.t3q-file-tree-iconEle {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
width: 24px;
|
|
62
|
+
height: 24px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.t3q-file-tree-icon-folder {
|
|
66
|
+
color: var(--color-primary20);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.t3q-file-tree-icon-file {
|
|
70
|
+
color: var(--color-secondary50);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.t3q-file-tree-title {
|
|
74
|
+
flex: 1;
|
|
75
|
+
min-width: 0;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
font-size: var(--text-base-regular);
|
|
78
|
+
line-height: var(--text-base-regular--line-height);
|
|
79
|
+
color: var(--color-sys-text-main);
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* ==================== 상태 ==================== */
|
|
85
|
+
/* 같은 특이도라 아래 규칙이 위 규칙을 이긴다(hover < 누름 < 선택 < 끌리는 중 < 놓을 곳) */
|
|
86
|
+
|
|
87
|
+
.t3q-file-tree-treenode:hover {
|
|
88
|
+
background-color: var(--color-secondary-o10);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.t3q-file-tree-treenode:active {
|
|
92
|
+
background-color: var(--color-secondary-o20);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.t3q-file-tree-treenode.t3q-file-tree-treenode-selected {
|
|
96
|
+
background-color: var(--color-primary-o10);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.t3q-file-tree-treenode.dragging {
|
|
100
|
+
background-color: var(--color-primary30);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.t3q-file-tree-treenode.dragging .t3q-file-tree-title,
|
|
104
|
+
.t3q-file-tree-treenode.dragging .t3q-file-tree-iconEle,
|
|
105
|
+
.t3q-file-tree-treenode.dragging .t3q-file-tree-iconEle > svg {
|
|
106
|
+
color: var(--color-sys-background);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.t3q-file-tree-treenode.drop-target {
|
|
110
|
+
background-color: var(--color-primary-o10);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* 검색어 일치(`filterTreeNode` 가 true 인 노드) — rc-tree 는 클래스만 붙이므로 여기서 보이게 한다 */
|
|
114
|
+
.t3q-file-tree-treenode.filter-node .t3q-file-tree-title {
|
|
115
|
+
font-weight: var(--font-weight-bold);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* 키보드로 움직인 행의 링. 행은 포커스를 받지 않고(포커스는 트리 밖 숨은 입력란) rc-tree 가
|
|
119
|
+
활성 행에 `-treenode-active` 를 붙인다. 안쪽 offset 이라 가상 스크롤 목록(overflow hidden)에서도 안 잘린다 */
|
|
120
|
+
.t3q-file-tree-focused .t3q-file-tree-treenode-active {
|
|
121
|
+
outline: 2px solid var(--color-sys-focus-ring-main);
|
|
122
|
+
outline-offset: -2px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* 비활성 — 선택·드래그만 막힌다. 폴더는 계속 펼쳐지는 조작 가능한 노드라 `aria-disabled` 가 없고,
|
|
126
|
+
대비 4.5:1 을 지키는 subtler 로 그린다. 펼칠 것이 없는 비활성 잎만 index.tsx 가 `aria-disabled` 를 붙이므로
|
|
127
|
+
(속성 선택자라 위 규칙보다 특이도가 높다) 그 행만 DS 비활성 색과 반투명 아이콘으로 그린다 */
|
|
128
|
+
.t3q-file-tree-treenode-disabled .t3q-file-tree-title {
|
|
129
|
+
color: var(--color-sys-text-subtler);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.t3q-file-tree-treenode-disabled[aria-disabled='true'] .t3q-file-tree-title {
|
|
133
|
+
color: var(--color-sys-text-disabled);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.t3q-file-tree-treenode-disabled[aria-disabled='true'] .t3q-file-tree-iconEle {
|
|
137
|
+
opacity: 0.5;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ==================== 드래그 드롭 표시선 ==================== */
|
|
141
|
+
/* 위치(top/bottom/left)는 index.tsx 가 인라인으로 준다 */
|
|
142
|
+
|
|
143
|
+
.t3q-file-tree-drop-indicator {
|
|
144
|
+
position: absolute;
|
|
145
|
+
right: 0;
|
|
146
|
+
height: 2px;
|
|
147
|
+
background-color: var(--color-primary30);
|
|
148
|
+
pointer-events: none;
|
|
149
|
+
}
|
|
1
150
|
.ag-grid-container {
|
|
2
151
|
width: 100%;
|
|
3
152
|
height: 100%;
|
package/dist/index.cjs
CHANGED
|
@@ -22,9 +22,10 @@ const datePresets = require("./components/datePresets.cjs");
|
|
|
22
22
|
const dialog = require("./components/dialog.cjs");
|
|
23
23
|
const drawer = require("./components/drawer.cjs");
|
|
24
24
|
const dropdownMenu = require("./components/dropdownMenu.cjs");
|
|
25
|
+
const index = require("./components/fileTree/index.cjs");
|
|
25
26
|
const form = require("./components/form.cjs");
|
|
26
27
|
const iconButton = require("./components/iconButton.cjs");
|
|
27
|
-
const index = require("./components/iconSelect/index.cjs");
|
|
28
|
+
const index$1 = require("./components/iconSelect/index.cjs");
|
|
28
29
|
const textField = require("./components/textField.cjs");
|
|
29
30
|
const label = require("./components/label.cjs");
|
|
30
31
|
const metaItem = require("./components/metaItem.cjs");
|
|
@@ -41,10 +42,10 @@ const radio = require("./components/radio.cjs");
|
|
|
41
42
|
const radioGroup = require("./components/radioGroup.cjs");
|
|
42
43
|
const radioSection = require("./components/radioSection.cjs");
|
|
43
44
|
const separator = require("./components/separator.cjs");
|
|
44
|
-
const index$
|
|
45
|
-
const index$
|
|
46
|
-
const index$
|
|
47
|
-
const index$
|
|
45
|
+
const index$2 = require("./components/sidebar/index.cjs");
|
|
46
|
+
const index$3 = require("./components/skeleton/index.cjs");
|
|
47
|
+
const index$4 = require("./components/spinner/index.cjs");
|
|
48
|
+
const index$5 = require("./components/stack/index.cjs");
|
|
48
49
|
const _switch = require("./components/switch.cjs");
|
|
49
50
|
const switchSection = require("./components/switchSection.cjs");
|
|
50
51
|
const table$1 = require("./components/table.cjs");
|
|
@@ -56,7 +57,7 @@ const timePicker = require("./components/timePicker.cjs");
|
|
|
56
57
|
const toast = require("./components/toast.cjs");
|
|
57
58
|
const themeProvider = require("./components/themeProvider.cjs");
|
|
58
59
|
const tooltip = require("./components/tooltip.cjs");
|
|
59
|
-
const index$
|
|
60
|
+
const index$6 = require("./components/agGridTable/index.cjs");
|
|
60
61
|
const cn = require("./utils/cn.cjs");
|
|
61
62
|
const sanitizeUserText = require("./utils/sanitizeUserText.cjs");
|
|
62
63
|
const table = require("./components/skeleton/table.cjs");
|
|
@@ -189,6 +190,7 @@ exports.DropdownMenuSub = dropdownMenu.DropdownMenuSub;
|
|
|
189
190
|
exports.DropdownMenuSubContent = dropdownMenu.DropdownMenuSubContent;
|
|
190
191
|
exports.DropdownMenuSubTrigger = dropdownMenu.DropdownMenuSubTrigger;
|
|
191
192
|
exports.DropdownMenuTrigger = dropdownMenu.DropdownMenuTrigger;
|
|
193
|
+
exports.FileTree = index.FileTree;
|
|
192
194
|
exports.Form = form.Form;
|
|
193
195
|
exports.FormControl = form.FormControl;
|
|
194
196
|
exports.FormDescription = form.FormDescription;
|
|
@@ -204,7 +206,7 @@ exports.FormValidMessage = form.FormValidMessage;
|
|
|
204
206
|
exports.useFormControlContext = form.useFormControlContext;
|
|
205
207
|
exports.useFormField = form.useFormField;
|
|
206
208
|
exports.IconButton = iconButton.IconButton;
|
|
207
|
-
exports.IconSelect = index.IconSelect;
|
|
209
|
+
exports.IconSelect = index$1.IconSelect;
|
|
208
210
|
exports.TextField = textField.TextField;
|
|
209
211
|
exports.Label = label.Label;
|
|
210
212
|
exports.MetaGroup = metaItem.MetaGroup;
|
|
@@ -240,18 +242,18 @@ exports.RadioGroupItem = radioGroup.RadioGroupItem;
|
|
|
240
242
|
exports.RadioSection = radioSection.RadioSection;
|
|
241
243
|
exports.RadioSectionGroup = radioSection.RadioSectionGroup;
|
|
242
244
|
exports.Separator = separator.Separator;
|
|
243
|
-
exports.Sidebar = index$
|
|
244
|
-
exports.SidebarContent = index$
|
|
245
|
-
exports.SidebarFooter = index$
|
|
246
|
-
exports.SidebarHeader = index$
|
|
247
|
-
exports.SidebarMenuItem = index$
|
|
248
|
-
exports.SidebarProvider = index$
|
|
249
|
-
exports.SidebarSection = index$
|
|
250
|
-
exports.SidebarToggle = index$
|
|
251
|
-
exports.useSidebar = index$
|
|
252
|
-
exports.Skeleton = index$
|
|
253
|
-
exports.Spinner = index$
|
|
254
|
-
exports.Stack = index$
|
|
245
|
+
exports.Sidebar = index$2.Sidebar;
|
|
246
|
+
exports.SidebarContent = index$2.SidebarContent;
|
|
247
|
+
exports.SidebarFooter = index$2.SidebarFooter;
|
|
248
|
+
exports.SidebarHeader = index$2.SidebarHeader;
|
|
249
|
+
exports.SidebarMenuItem = index$2.SidebarMenuItem;
|
|
250
|
+
exports.SidebarProvider = index$2.SidebarProvider;
|
|
251
|
+
exports.SidebarSection = index$2.SidebarSection;
|
|
252
|
+
exports.SidebarToggle = index$2.SidebarToggle;
|
|
253
|
+
exports.useSidebar = index$2.useSidebar;
|
|
254
|
+
exports.Skeleton = index$3.Skeleton;
|
|
255
|
+
exports.Spinner = index$4.Spinner;
|
|
256
|
+
exports.Stack = index$5.Stack;
|
|
255
257
|
exports.Switch = _switch.Switch;
|
|
256
258
|
exports.SwitchSection = switchSection.SwitchSection;
|
|
257
259
|
exports.NUMBER_COLUMN_CLASS = table$1.NUMBER_COLUMN_CLASS;
|
|
@@ -289,24 +291,24 @@ exports.Tooltip = tooltip.Tooltip;
|
|
|
289
291
|
exports.TooltipContent = tooltip.TooltipContent;
|
|
290
292
|
exports.TooltipProvider = tooltip.TooltipProvider;
|
|
291
293
|
exports.TooltipTrigger = tooltip.TooltipTrigger;
|
|
292
|
-
exports.AgGridTable = index$
|
|
293
|
-
exports.BALANCED_FILL_MIN_WIDTH = index$
|
|
294
|
-
exports.HeaderCheckboxRenderer = index$
|
|
295
|
-
exports.NUMBER_COLUMN_WIDTH = index$
|
|
296
|
-
exports.RowCheckboxRenderer = index$
|
|
297
|
-
exports.SORT_ICON_OFFSET_CLASS = index$
|
|
298
|
-
exports.TwoLineCellRenderer = index$
|
|
299
|
-
exports.estimateHeaderTextWidth = index$
|
|
300
|
-
exports.fitColumnsToContent = index$
|
|
301
|
-
exports.growColumnIds = index$
|
|
302
|
-
exports.withBalancedFill = index$
|
|
303
|
-
exports.withExplicitSortIcons = index$
|
|
304
|
-
exports.withFlexFill = index$
|
|
305
|
-
exports.withHeaderMinWidth = index$
|
|
306
|
-
exports.withNumberColumnWidth = index$
|
|
307
|
-
exports.withSortIconOffset = index$
|
|
308
|
-
exports.withTypeClasses = index$
|
|
309
|
-
exports.withWidthFloor = index$
|
|
294
|
+
exports.AgGridTable = index$6.AgGridTable;
|
|
295
|
+
exports.BALANCED_FILL_MIN_WIDTH = index$6.BALANCED_FILL_MIN_WIDTH;
|
|
296
|
+
exports.HeaderCheckboxRenderer = index$6.HeaderCheckboxRenderer;
|
|
297
|
+
exports.NUMBER_COLUMN_WIDTH = index$6.NUMBER_COLUMN_WIDTH;
|
|
298
|
+
exports.RowCheckboxRenderer = index$6.RowCheckboxRenderer;
|
|
299
|
+
exports.SORT_ICON_OFFSET_CLASS = index$6.SORT_ICON_OFFSET_CLASS;
|
|
300
|
+
exports.TwoLineCellRenderer = index$6.TwoLineCellRenderer;
|
|
301
|
+
exports.estimateHeaderTextWidth = index$6.estimateHeaderTextWidth;
|
|
302
|
+
exports.fitColumnsToContent = index$6.fitColumnsToContent;
|
|
303
|
+
exports.growColumnIds = index$6.growColumnIds;
|
|
304
|
+
exports.withBalancedFill = index$6.withBalancedFill;
|
|
305
|
+
exports.withExplicitSortIcons = index$6.withExplicitSortIcons;
|
|
306
|
+
exports.withFlexFill = index$6.withFlexFill;
|
|
307
|
+
exports.withHeaderMinWidth = index$6.withHeaderMinWidth;
|
|
308
|
+
exports.withNumberColumnWidth = index$6.withNumberColumnWidth;
|
|
309
|
+
exports.withSortIconOffset = index$6.withSortIconOffset;
|
|
310
|
+
exports.withTypeClasses = index$6.withTypeClasses;
|
|
311
|
+
exports.withWidthFloor = index$6.withWidthFloor;
|
|
310
312
|
exports.cn = cn.cn;
|
|
311
313
|
exports.sanitizeUserText = sanitizeUserText.sanitizeUserText;
|
|
312
314
|
exports.TableSkeleton = table.default;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.cts
CHANGED
|
@@ -15,6 +15,8 @@ import { DayPicker, SelectSingleEventHandler, DateRange, SelectRangeEventHandler
|
|
|
15
15
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
16
16
|
import { DialogProps } from '@radix-ui/react-dialog';
|
|
17
17
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
18
|
+
import { BasicDataNode, TreeProps } from 'rc-tree';
|
|
19
|
+
import { DataNode, EventDataNode } from 'rc-tree/lib/interface';
|
|
18
20
|
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
19
21
|
import * as react_hook_form from 'react-hook-form';
|
|
20
22
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
@@ -706,6 +708,42 @@ declare function DropdownMenuSub({ ...props }: React$1.ComponentProps<typeof Dro
|
|
|
706
708
|
declare function DropdownMenuSubTrigger({ className, children, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>): react_jsx_runtime.JSX.Element;
|
|
707
709
|
declare function DropdownMenuSubContent({ className, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): react_jsx_runtime.JSX.Element;
|
|
708
710
|
|
|
711
|
+
/**
|
|
712
|
+
* 트리 노드 데이터. `key`(필수)·`title`·`children`·`isLeaf`·`disabled` 등.
|
|
713
|
+
*
|
|
714
|
+
* `disabled: true` 는 선택·드래그를 막는다. 폴더는 계속 펼칠 수 있고, 펼칠 것이 없는 노드는 FileTree 가 `aria-disabled` 를 붙인다.
|
|
715
|
+
* 비활성 노드에는 우클릭 메뉴를 열지 않는다 — rc-tree 는 우클릭을 막지 않는다.
|
|
716
|
+
*/
|
|
717
|
+
type FileTreeNode = DataNode;
|
|
718
|
+
/** 이벤트 핸들러(`onSelect`·`onExpand`·`loadData` 등)가 받는 노드. 노드 데이터에 `expanded`·`selected`·`loaded` 같은 상태가 붙는다 */
|
|
719
|
+
type FileTreeEventNode<T extends BasicDataNode = DataNode> = EventDataNode<T>;
|
|
720
|
+
/** FileTree 가 외형을 정해 두어 받지 않는 rc-tree props — 접두사·연결선·행 높이·펼침 아이콘·체크박스·드롭 표시선 */
|
|
721
|
+
type FixedTreeProps = 'prefixCls' | 'showLine' | 'itemHeight' | 'switcherIcon' | 'checkable' | 'dropIndicatorRender';
|
|
722
|
+
interface FileTreeProps<T extends BasicDataNode = DataNode> extends Omit<TreeProps<T>, FixedTreeProps> {
|
|
723
|
+
/** 트리 데이터. 노드마다 `key`·`title`·`children` 을 두고, 폴더를 펼칠 때 불러오는 노드는 `isLeaf: false`, 파일은 `isLeaf: true`. 비활성 잎이 있으면 그 노드와 상위 노드는 복사본이 콜백으로 온다 — 노드는 `key` 로 비교한다 */
|
|
724
|
+
treeData?: TreeProps<T>['treeData'];
|
|
725
|
+
/** 아이콘 칸에 그릴 내용(노드 또는 노드를 받는 함수). 없으면 폴더·파일 기본 아이콘이고, 불러오는 중에는 이 값과 상관없이 Spinner. 노드 데이터의 `icon` 은 이 값과 불러오는 중 표시를 덮는다 */
|
|
726
|
+
icon?: TreeProps<T>['icon'];
|
|
727
|
+
/** 폴더를 펼칠 때 하위 노드를 불러오는 함수. 반환한 Promise 가 끝나면 펼쳐진다 — 그동안 아이콘 칸에 Spinner */
|
|
728
|
+
loadData?: TreeProps<T>['loadData'];
|
|
729
|
+
/** 목록 높이(px). 주면 보이는 만큼만 그리는 가상 스크롤이 켜진다. 노드가 많을 때 준다 */
|
|
730
|
+
height?: TreeProps<T>['height'];
|
|
731
|
+
/** 노드를 눌러 선택이 바뀔 때 호출된다 */
|
|
732
|
+
onSelect?: TreeProps<T>['onSelect'];
|
|
733
|
+
/** 노드를 우클릭할 때 호출된다. 메뉴는 앱이 DropdownMenu 등으로 그린다 */
|
|
734
|
+
onRightClick?: TreeProps<T>['onRightClick'];
|
|
735
|
+
/** 노드 제목을 직접 그린다. 노드 데이터를 받아 제목 자리에 들어갈 내용을 돌려준다 */
|
|
736
|
+
titleRender?: TreeProps<T>['titleRender'];
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* 파일·폴더 계층을 펼치고 접으며 고르는 트리.
|
|
740
|
+
*
|
|
741
|
+
* 언제 쓰나: 파일·폴더 계층 탐색, 폴더를 펼칠 때 하위 항목을 그때그때 불러오는 목록(`loadData`), 노드가 많은 목록(`height` 를 주면 가상 스크롤).
|
|
742
|
+
* 언제 안 쓰나: 평면 목록(→ Table·AgGridTable), 화면 이동 메뉴(→ Sidebar).
|
|
743
|
+
* 대신/함께: 우클릭 메뉴는 `onRightClick` 과 DropdownMenu 를 앱이 이어 붙인다. "더 보기" 같은 앱 고유 노드·실행 모듈 표시는 `treeData`·`icon`·`titleRender` 로, 검색어 강조는 `filterTreeNode` 로 그린다.
|
|
744
|
+
*/
|
|
745
|
+
declare function FileTree<T extends BasicDataNode = DataNode>({ icon, treeData, ...rest }: FileTreeProps<T>): react_jsx_runtime.JSX.Element;
|
|
746
|
+
|
|
709
747
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
|
|
710
748
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
711
749
|
declare const useFormField: () => {
|
|
@@ -2749,4 +2787,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
2749
2787
|
*/
|
|
2750
2788
|
declare function sanitizeUserText(node: React$1.ReactNode): React$1.ReactNode;
|
|
2751
2789
|
|
|
2752
|
-
export { AG_GRID_LOCALE_KR, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgGridContext, type AgGridContextType, Alert, AlertActions, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, BadgeProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardThumbnail, CardTitle, Checkbox, type CheckboxProps, CheckboxSection, CheckboxSectionGroup, type CheckboxSectionGroupProps, type CheckboxSectionProps, type ColumnDefinition, ColumnFilter, type ColumnFilterContextType, ColumnFilterInput, type ColumnFilterInputProps, ColumnFilterPopover, type ColumnFilterPopoverProps, type ColumnFilterProps, ColumnFilterTag, type ColumnFilterTagProps, type ColumnType, ColumnVisibilityFilter, type ColumnVisibilityFilterProps, type ColumnVisibilityOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_PARAMETER_TABLE_COLUMNS, DatePicker, type DatePickerProps, DatePickerRange, type DatePickerRangeProps, DatePresets, type DatePresetsProps, DateRangePresets, type DateRangePresetsProps, DateRangeSelect, DateSelect, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type EditingFilter, EmptyBoxIllustration, type EventLevel, EventList, type EventListItem, type EventListProps, type FilterCondition, Form, FormControl, FormDescription, type FormDescriptionProps, FormField, FormFooter, FormHeader, FormItem, FormLabel, FormMessage, FormSection, FormSectionLevelContext, FormValidMessage, type HourType, IconButton, type IconButtonProps, IconSelect, type IconSelectProps, Label, LucideIcon, type LucideIconProps, MetaGroup, MetaItem, type MetaItemProps, MetaList, type MetaListProps, MetaRow, type MetaRowProps, MultiSelect$1 as MultiSelect, MultiSelectContent, type MultiSelectContentProps, MultiSelectEmpty, type MultiSelectEmptyProps, MultiSelectGroup, type MultiSelectGroupProps, MultiSelectInput, type MultiSelectInputProps, MultiSelectItem, type MultiSelectItemProps, MultiSelectLoading, type MultiSelectLoadingProps, type MultiSelectProps$1 as MultiSelectProps, MultiSelectSeparator, type MultiSelectSeparatorProps, MultiSelectTrigger, type MultiSelectTriggerProps, NUMBER_COLUMN_CLASS, type NumberOperator, OPERATORS_BY_TYPE, OPERATOR_LABELS, type Operator, type OperatorOverridesByColumn, type OperatorOverridesByType, type Option, PageHeaderRefreshButton, type PageHeaderRefreshButtonProps, Pagination, PaginationContent, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, type PaginationPropsType, PaginationWrapper, Panel, type PanelProps, ParameterTable, type ParameterTableActiveCell, type ParameterTableCanDeleteRow, type ParameterTableCanEditCell, type ParameterTableCellErrors, type ParameterTableColumn, type ParameterTableExtraColumn, type ParameterTableProps, type ParameterTableRow, type ParameterTableSpacing, Popover, PopoverAnchor, PopoverContent, type PopoverPosition, PopoverTrigger, type PopoverType, Progress, type ProgressProps, Radio, RadioGroup, RadioGroupItem, RadioSection, RadioSectionGroup, type RadioSectionGroupProps, type RadioSectionProps, Range, type RangeBounds, type RangeMark, type RangeProps, RangeSlider, type RangeSliderProps, type ResolvedTheme, Select, SelectContent, type SelectContentProps, SelectEmpty, type SelectEmptyProps, SelectGroup, type SelectGroupProps, SelectInput, type SelectInputProps, SelectItem, type SelectItemProps, SelectLoading, type SelectLoadingProps, type SelectProps, SelectRadioGroup, SelectRadioItem, type SelectRadioItemProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenuItem, SidebarProvider, SidebarSection, SidebarToggle, SingleSelect, Skeleton, SortIcon, Spinner, type SpinnerProps, Stack, type StringOperator, Switch, SwitchSection, type SwitchSectionProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFilterDateRangeSelect, TableFilterDateSelect, MultiSelect as TableFilterMultiSelect, TableFilterSingleSelect, FilterTitle as TableFilterTitle, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TablePagination, TableRow, TableSkeleton, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TextField, type TextFieldProps, Textarea, type TextareaProps, type Theme, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerProps, type TimeValue12, type TimeValue24, Toaster, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupProps, type ToggleGroupSingleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseFloatingLabelOptions, type UseFloatingLabelReturn, type UseRangeValueOptions, type UseRangeValueReturn, type ValueSuggestion, alignFromClassName, clamp, cn, fixPrecision, getDecimals, getPaginationRange, getSortedColumnState, normalize, sanitizeUserText, snap, tagVariants, toast, useColumnFilter, useFloatingLabel, useFormControlContext, useFormField, useMultiSelectContext, useOptionalTheme, useRangeValue, useSelectContext, useSidebar, useTheme };
|
|
2790
|
+
export { AG_GRID_LOCALE_KR, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgGridContext, type AgGridContextType, Alert, AlertActions, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, BadgeProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardThumbnail, CardTitle, Checkbox, type CheckboxProps, CheckboxSection, CheckboxSectionGroup, type CheckboxSectionGroupProps, type CheckboxSectionProps, type ColumnDefinition, ColumnFilter, type ColumnFilterContextType, ColumnFilterInput, type ColumnFilterInputProps, ColumnFilterPopover, type ColumnFilterPopoverProps, type ColumnFilterProps, ColumnFilterTag, type ColumnFilterTagProps, type ColumnType, ColumnVisibilityFilter, type ColumnVisibilityFilterProps, type ColumnVisibilityOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_PARAMETER_TABLE_COLUMNS, DatePicker, type DatePickerProps, DatePickerRange, type DatePickerRangeProps, DatePresets, type DatePresetsProps, DateRangePresets, type DateRangePresetsProps, DateRangeSelect, DateSelect, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type EditingFilter, EmptyBoxIllustration, type EventLevel, EventList, type EventListItem, type EventListProps, FileTree, type FileTreeEventNode, type FileTreeNode, type FileTreeProps, type FilterCondition, Form, FormControl, FormDescription, type FormDescriptionProps, FormField, FormFooter, FormHeader, FormItem, FormLabel, FormMessage, FormSection, FormSectionLevelContext, FormValidMessage, type HourType, IconButton, type IconButtonProps, IconSelect, type IconSelectProps, Label, LucideIcon, type LucideIconProps, MetaGroup, MetaItem, type MetaItemProps, MetaList, type MetaListProps, MetaRow, type MetaRowProps, MultiSelect$1 as MultiSelect, MultiSelectContent, type MultiSelectContentProps, MultiSelectEmpty, type MultiSelectEmptyProps, MultiSelectGroup, type MultiSelectGroupProps, MultiSelectInput, type MultiSelectInputProps, MultiSelectItem, type MultiSelectItemProps, MultiSelectLoading, type MultiSelectLoadingProps, type MultiSelectProps$1 as MultiSelectProps, MultiSelectSeparator, type MultiSelectSeparatorProps, MultiSelectTrigger, type MultiSelectTriggerProps, NUMBER_COLUMN_CLASS, type NumberOperator, OPERATORS_BY_TYPE, OPERATOR_LABELS, type Operator, type OperatorOverridesByColumn, type OperatorOverridesByType, type Option, PageHeaderRefreshButton, type PageHeaderRefreshButtonProps, Pagination, PaginationContent, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, type PaginationPropsType, PaginationWrapper, Panel, type PanelProps, ParameterTable, type ParameterTableActiveCell, type ParameterTableCanDeleteRow, type ParameterTableCanEditCell, type ParameterTableCellErrors, type ParameterTableColumn, type ParameterTableExtraColumn, type ParameterTableProps, type ParameterTableRow, type ParameterTableSpacing, Popover, PopoverAnchor, PopoverContent, type PopoverPosition, PopoverTrigger, type PopoverType, Progress, type ProgressProps, Radio, RadioGroup, RadioGroupItem, RadioSection, RadioSectionGroup, type RadioSectionGroupProps, type RadioSectionProps, Range, type RangeBounds, type RangeMark, type RangeProps, RangeSlider, type RangeSliderProps, type ResolvedTheme, Select, SelectContent, type SelectContentProps, SelectEmpty, type SelectEmptyProps, SelectGroup, type SelectGroupProps, SelectInput, type SelectInputProps, SelectItem, type SelectItemProps, SelectLoading, type SelectLoadingProps, type SelectProps, SelectRadioGroup, SelectRadioItem, type SelectRadioItemProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenuItem, SidebarProvider, SidebarSection, SidebarToggle, SingleSelect, Skeleton, SortIcon, Spinner, type SpinnerProps, Stack, type StringOperator, Switch, SwitchSection, type SwitchSectionProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFilterDateRangeSelect, TableFilterDateSelect, MultiSelect as TableFilterMultiSelect, TableFilterSingleSelect, FilterTitle as TableFilterTitle, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TablePagination, TableRow, TableSkeleton, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TextField, type TextFieldProps, Textarea, type TextareaProps, type Theme, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerProps, type TimeValue12, type TimeValue24, Toaster, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupProps, type ToggleGroupSingleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseFloatingLabelOptions, type UseFloatingLabelReturn, type UseRangeValueOptions, type UseRangeValueReturn, type ValueSuggestion, alignFromClassName, clamp, cn, fixPrecision, getDecimals, getPaginationRange, getSortedColumnState, normalize, sanitizeUserText, snap, tagVariants, toast, useColumnFilter, useFloatingLabel, useFormControlContext, useFormField, useMultiSelectContext, useOptionalTheme, useRangeValue, useSelectContext, useSidebar, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ import { DayPicker, SelectSingleEventHandler, DateRange, SelectRangeEventHandler
|
|
|
15
15
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
16
16
|
import { DialogProps } from '@radix-ui/react-dialog';
|
|
17
17
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
18
|
+
import { BasicDataNode, TreeProps } from 'rc-tree';
|
|
19
|
+
import { DataNode, EventDataNode } from 'rc-tree/lib/interface';
|
|
18
20
|
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
19
21
|
import * as react_hook_form from 'react-hook-form';
|
|
20
22
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
@@ -706,6 +708,42 @@ declare function DropdownMenuSub({ ...props }: React$1.ComponentProps<typeof Dro
|
|
|
706
708
|
declare function DropdownMenuSubTrigger({ className, children, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>): react_jsx_runtime.JSX.Element;
|
|
707
709
|
declare function DropdownMenuSubContent({ className, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): react_jsx_runtime.JSX.Element;
|
|
708
710
|
|
|
711
|
+
/**
|
|
712
|
+
* 트리 노드 데이터. `key`(필수)·`title`·`children`·`isLeaf`·`disabled` 등.
|
|
713
|
+
*
|
|
714
|
+
* `disabled: true` 는 선택·드래그를 막는다. 폴더는 계속 펼칠 수 있고, 펼칠 것이 없는 노드는 FileTree 가 `aria-disabled` 를 붙인다.
|
|
715
|
+
* 비활성 노드에는 우클릭 메뉴를 열지 않는다 — rc-tree 는 우클릭을 막지 않는다.
|
|
716
|
+
*/
|
|
717
|
+
type FileTreeNode = DataNode;
|
|
718
|
+
/** 이벤트 핸들러(`onSelect`·`onExpand`·`loadData` 등)가 받는 노드. 노드 데이터에 `expanded`·`selected`·`loaded` 같은 상태가 붙는다 */
|
|
719
|
+
type FileTreeEventNode<T extends BasicDataNode = DataNode> = EventDataNode<T>;
|
|
720
|
+
/** FileTree 가 외형을 정해 두어 받지 않는 rc-tree props — 접두사·연결선·행 높이·펼침 아이콘·체크박스·드롭 표시선 */
|
|
721
|
+
type FixedTreeProps = 'prefixCls' | 'showLine' | 'itemHeight' | 'switcherIcon' | 'checkable' | 'dropIndicatorRender';
|
|
722
|
+
interface FileTreeProps<T extends BasicDataNode = DataNode> extends Omit<TreeProps<T>, FixedTreeProps> {
|
|
723
|
+
/** 트리 데이터. 노드마다 `key`·`title`·`children` 을 두고, 폴더를 펼칠 때 불러오는 노드는 `isLeaf: false`, 파일은 `isLeaf: true`. 비활성 잎이 있으면 그 노드와 상위 노드는 복사본이 콜백으로 온다 — 노드는 `key` 로 비교한다 */
|
|
724
|
+
treeData?: TreeProps<T>['treeData'];
|
|
725
|
+
/** 아이콘 칸에 그릴 내용(노드 또는 노드를 받는 함수). 없으면 폴더·파일 기본 아이콘이고, 불러오는 중에는 이 값과 상관없이 Spinner. 노드 데이터의 `icon` 은 이 값과 불러오는 중 표시를 덮는다 */
|
|
726
|
+
icon?: TreeProps<T>['icon'];
|
|
727
|
+
/** 폴더를 펼칠 때 하위 노드를 불러오는 함수. 반환한 Promise 가 끝나면 펼쳐진다 — 그동안 아이콘 칸에 Spinner */
|
|
728
|
+
loadData?: TreeProps<T>['loadData'];
|
|
729
|
+
/** 목록 높이(px). 주면 보이는 만큼만 그리는 가상 스크롤이 켜진다. 노드가 많을 때 준다 */
|
|
730
|
+
height?: TreeProps<T>['height'];
|
|
731
|
+
/** 노드를 눌러 선택이 바뀔 때 호출된다 */
|
|
732
|
+
onSelect?: TreeProps<T>['onSelect'];
|
|
733
|
+
/** 노드를 우클릭할 때 호출된다. 메뉴는 앱이 DropdownMenu 등으로 그린다 */
|
|
734
|
+
onRightClick?: TreeProps<T>['onRightClick'];
|
|
735
|
+
/** 노드 제목을 직접 그린다. 노드 데이터를 받아 제목 자리에 들어갈 내용을 돌려준다 */
|
|
736
|
+
titleRender?: TreeProps<T>['titleRender'];
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* 파일·폴더 계층을 펼치고 접으며 고르는 트리.
|
|
740
|
+
*
|
|
741
|
+
* 언제 쓰나: 파일·폴더 계층 탐색, 폴더를 펼칠 때 하위 항목을 그때그때 불러오는 목록(`loadData`), 노드가 많은 목록(`height` 를 주면 가상 스크롤).
|
|
742
|
+
* 언제 안 쓰나: 평면 목록(→ Table·AgGridTable), 화면 이동 메뉴(→ Sidebar).
|
|
743
|
+
* 대신/함께: 우클릭 메뉴는 `onRightClick` 과 DropdownMenu 를 앱이 이어 붙인다. "더 보기" 같은 앱 고유 노드·실행 모듈 표시는 `treeData`·`icon`·`titleRender` 로, 검색어 강조는 `filterTreeNode` 로 그린다.
|
|
744
|
+
*/
|
|
745
|
+
declare function FileTree<T extends BasicDataNode = DataNode>({ icon, treeData, ...rest }: FileTreeProps<T>): react_jsx_runtime.JSX.Element;
|
|
746
|
+
|
|
709
747
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
|
|
710
748
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
711
749
|
declare const useFormField: () => {
|
|
@@ -2749,4 +2787,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
2749
2787
|
*/
|
|
2750
2788
|
declare function sanitizeUserText(node: React$1.ReactNode): React$1.ReactNode;
|
|
2751
2789
|
|
|
2752
|
-
export { AG_GRID_LOCALE_KR, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgGridContext, type AgGridContextType, Alert, AlertActions, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, BadgeProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardThumbnail, CardTitle, Checkbox, type CheckboxProps, CheckboxSection, CheckboxSectionGroup, type CheckboxSectionGroupProps, type CheckboxSectionProps, type ColumnDefinition, ColumnFilter, type ColumnFilterContextType, ColumnFilterInput, type ColumnFilterInputProps, ColumnFilterPopover, type ColumnFilterPopoverProps, type ColumnFilterProps, ColumnFilterTag, type ColumnFilterTagProps, type ColumnType, ColumnVisibilityFilter, type ColumnVisibilityFilterProps, type ColumnVisibilityOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_PARAMETER_TABLE_COLUMNS, DatePicker, type DatePickerProps, DatePickerRange, type DatePickerRangeProps, DatePresets, type DatePresetsProps, DateRangePresets, type DateRangePresetsProps, DateRangeSelect, DateSelect, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type EditingFilter, EmptyBoxIllustration, type EventLevel, EventList, type EventListItem, type EventListProps, type FilterCondition, Form, FormControl, FormDescription, type FormDescriptionProps, FormField, FormFooter, FormHeader, FormItem, FormLabel, FormMessage, FormSection, FormSectionLevelContext, FormValidMessage, type HourType, IconButton, type IconButtonProps, IconSelect, type IconSelectProps, Label, LucideIcon, type LucideIconProps, MetaGroup, MetaItem, type MetaItemProps, MetaList, type MetaListProps, MetaRow, type MetaRowProps, MultiSelect$1 as MultiSelect, MultiSelectContent, type MultiSelectContentProps, MultiSelectEmpty, type MultiSelectEmptyProps, MultiSelectGroup, type MultiSelectGroupProps, MultiSelectInput, type MultiSelectInputProps, MultiSelectItem, type MultiSelectItemProps, MultiSelectLoading, type MultiSelectLoadingProps, type MultiSelectProps$1 as MultiSelectProps, MultiSelectSeparator, type MultiSelectSeparatorProps, MultiSelectTrigger, type MultiSelectTriggerProps, NUMBER_COLUMN_CLASS, type NumberOperator, OPERATORS_BY_TYPE, OPERATOR_LABELS, type Operator, type OperatorOverridesByColumn, type OperatorOverridesByType, type Option, PageHeaderRefreshButton, type PageHeaderRefreshButtonProps, Pagination, PaginationContent, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, type PaginationPropsType, PaginationWrapper, Panel, type PanelProps, ParameterTable, type ParameterTableActiveCell, type ParameterTableCanDeleteRow, type ParameterTableCanEditCell, type ParameterTableCellErrors, type ParameterTableColumn, type ParameterTableExtraColumn, type ParameterTableProps, type ParameterTableRow, type ParameterTableSpacing, Popover, PopoverAnchor, PopoverContent, type PopoverPosition, PopoverTrigger, type PopoverType, Progress, type ProgressProps, Radio, RadioGroup, RadioGroupItem, RadioSection, RadioSectionGroup, type RadioSectionGroupProps, type RadioSectionProps, Range, type RangeBounds, type RangeMark, type RangeProps, RangeSlider, type RangeSliderProps, type ResolvedTheme, Select, SelectContent, type SelectContentProps, SelectEmpty, type SelectEmptyProps, SelectGroup, type SelectGroupProps, SelectInput, type SelectInputProps, SelectItem, type SelectItemProps, SelectLoading, type SelectLoadingProps, type SelectProps, SelectRadioGroup, SelectRadioItem, type SelectRadioItemProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenuItem, SidebarProvider, SidebarSection, SidebarToggle, SingleSelect, Skeleton, SortIcon, Spinner, type SpinnerProps, Stack, type StringOperator, Switch, SwitchSection, type SwitchSectionProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFilterDateRangeSelect, TableFilterDateSelect, MultiSelect as TableFilterMultiSelect, TableFilterSingleSelect, FilterTitle as TableFilterTitle, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TablePagination, TableRow, TableSkeleton, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TextField, type TextFieldProps, Textarea, type TextareaProps, type Theme, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerProps, type TimeValue12, type TimeValue24, Toaster, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupProps, type ToggleGroupSingleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseFloatingLabelOptions, type UseFloatingLabelReturn, type UseRangeValueOptions, type UseRangeValueReturn, type ValueSuggestion, alignFromClassName, clamp, cn, fixPrecision, getDecimals, getPaginationRange, getSortedColumnState, normalize, sanitizeUserText, snap, tagVariants, toast, useColumnFilter, useFloatingLabel, useFormControlContext, useFormField, useMultiSelectContext, useOptionalTheme, useRangeValue, useSelectContext, useSidebar, useTheme };
|
|
2790
|
+
export { AG_GRID_LOCALE_KR, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgGridContext, type AgGridContextType, Alert, AlertActions, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, BadgeProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardThumbnail, CardTitle, Checkbox, type CheckboxProps, CheckboxSection, CheckboxSectionGroup, type CheckboxSectionGroupProps, type CheckboxSectionProps, type ColumnDefinition, ColumnFilter, type ColumnFilterContextType, ColumnFilterInput, type ColumnFilterInputProps, ColumnFilterPopover, type ColumnFilterPopoverProps, type ColumnFilterProps, ColumnFilterTag, type ColumnFilterTagProps, type ColumnType, ColumnVisibilityFilter, type ColumnVisibilityFilterProps, type ColumnVisibilityOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_PARAMETER_TABLE_COLUMNS, DatePicker, type DatePickerProps, DatePickerRange, type DatePickerRangeProps, DatePresets, type DatePresetsProps, DateRangePresets, type DateRangePresetsProps, DateRangeSelect, DateSelect, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type EditingFilter, EmptyBoxIllustration, type EventLevel, EventList, type EventListItem, type EventListProps, FileTree, type FileTreeEventNode, type FileTreeNode, type FileTreeProps, type FilterCondition, Form, FormControl, FormDescription, type FormDescriptionProps, FormField, FormFooter, FormHeader, FormItem, FormLabel, FormMessage, FormSection, FormSectionLevelContext, FormValidMessage, type HourType, IconButton, type IconButtonProps, IconSelect, type IconSelectProps, Label, LucideIcon, type LucideIconProps, MetaGroup, MetaItem, type MetaItemProps, MetaList, type MetaListProps, MetaRow, type MetaRowProps, MultiSelect$1 as MultiSelect, MultiSelectContent, type MultiSelectContentProps, MultiSelectEmpty, type MultiSelectEmptyProps, MultiSelectGroup, type MultiSelectGroupProps, MultiSelectInput, type MultiSelectInputProps, MultiSelectItem, type MultiSelectItemProps, MultiSelectLoading, type MultiSelectLoadingProps, type MultiSelectProps$1 as MultiSelectProps, MultiSelectSeparator, type MultiSelectSeparatorProps, MultiSelectTrigger, type MultiSelectTriggerProps, NUMBER_COLUMN_CLASS, type NumberOperator, OPERATORS_BY_TYPE, OPERATOR_LABELS, type Operator, type OperatorOverridesByColumn, type OperatorOverridesByType, type Option, PageHeaderRefreshButton, type PageHeaderRefreshButtonProps, Pagination, PaginationContent, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, type PaginationPropsType, PaginationWrapper, Panel, type PanelProps, ParameterTable, type ParameterTableActiveCell, type ParameterTableCanDeleteRow, type ParameterTableCanEditCell, type ParameterTableCellErrors, type ParameterTableColumn, type ParameterTableExtraColumn, type ParameterTableProps, type ParameterTableRow, type ParameterTableSpacing, Popover, PopoverAnchor, PopoverContent, type PopoverPosition, PopoverTrigger, type PopoverType, Progress, type ProgressProps, Radio, RadioGroup, RadioGroupItem, RadioSection, RadioSectionGroup, type RadioSectionGroupProps, type RadioSectionProps, Range, type RangeBounds, type RangeMark, type RangeProps, RangeSlider, type RangeSliderProps, type ResolvedTheme, Select, SelectContent, type SelectContentProps, SelectEmpty, type SelectEmptyProps, SelectGroup, type SelectGroupProps, SelectInput, type SelectInputProps, SelectItem, type SelectItemProps, SelectLoading, type SelectLoadingProps, type SelectProps, SelectRadioGroup, SelectRadioItem, type SelectRadioItemProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenuItem, SidebarProvider, SidebarSection, SidebarToggle, SingleSelect, Skeleton, SortIcon, Spinner, type SpinnerProps, Stack, type StringOperator, Switch, SwitchSection, type SwitchSectionProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFilterDateRangeSelect, TableFilterDateSelect, MultiSelect as TableFilterMultiSelect, TableFilterSingleSelect, FilterTitle as TableFilterTitle, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TablePagination, TableRow, TableSkeleton, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TextField, type TextFieldProps, Textarea, type TextareaProps, type Theme, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerProps, type TimeValue12, type TimeValue24, Toaster, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupProps, type ToggleGroupSingleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseFloatingLabelOptions, type UseFloatingLabelReturn, type UseRangeValueOptions, type UseRangeValueReturn, type ValueSuggestion, alignFromClassName, clamp, cn, fixPrecision, getDecimals, getPaginationRange, getSortedColumnState, normalize, sanitizeUserText, snap, tagVariants, toast, useColumnFilter, useFloatingLabel, useFormControlContext, useFormField, useMultiSelectContext, useOptionalTheme, useRangeValue, useSelectContext, useSidebar, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { DatePresets, DateRangePresets } from "./components/datePresets.js";
|
|
|
20
20
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog.js";
|
|
21
21
|
import { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from "./components/drawer.js";
|
|
22
22
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/dropdownMenu.js";
|
|
23
|
+
import { FileTree } from "./components/fileTree/index.js";
|
|
23
24
|
import { Form, FormControl, FormDescription, FormField, FormFooter, FormHeader, FormItem, FormLabel, FormMessage, FormSection, FormSectionLevelContext, FormValidMessage, useFormControlContext, useFormField } from "./components/form.js";
|
|
24
25
|
import { IconButton } from "./components/iconButton.js";
|
|
25
26
|
import { IconSelect } from "./components/iconSelect/index.js";
|
|
@@ -196,6 +197,7 @@ export {
|
|
|
196
197
|
DropdownMenuTrigger,
|
|
197
198
|
EmptyBoxIllustration,
|
|
198
199
|
EventList,
|
|
200
|
+
FileTree,
|
|
199
201
|
Form,
|
|
200
202
|
FormControl,
|
|
201
203
|
FormDescription,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/styles.css
CHANGED
|
@@ -2072,3 +2072,152 @@ tr:last-child > .t3q-pt-cell {
|
|
|
2072
2072
|
opacity: 1;
|
|
2073
2073
|
pointer-events: auto;
|
|
2074
2074
|
}
|
|
2075
|
+
/* FileTree — rc-tree 를 접두사 `t3q-file-tree` 로 그린다.
|
|
2076
|
+
rc-tree 기본 CSS(rc-tree/assets/index.css)는 쓰지 않는다. 기본 CSS 가 하던 일 중 필요한 것
|
|
2077
|
+
(내용 칸 위치 기준·검색어 강조·말줄임)만 아래에서 대신하고, 색은 전부 DS 토큰이다.
|
|
2078
|
+
행 높이 28 = 위아래 padding 2 + 내용 칸 24 (index.tsx 의 itemHeight 와 같은 값). */
|
|
2079
|
+
|
|
2080
|
+
/* ==================== 행 ==================== */
|
|
2081
|
+
|
|
2082
|
+
.t3q-file-tree-treenode {
|
|
2083
|
+
display: flex;
|
|
2084
|
+
align-items: center;
|
|
2085
|
+
gap: 2px;
|
|
2086
|
+
margin: 0;
|
|
2087
|
+
padding: 2px 0;
|
|
2088
|
+
white-space: nowrap;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
/* 들여쓰기 — 단계마다 12px. rc-tree 가 이 폭을 재서 드롭 표시선 위치에 쓴다 */
|
|
2092
|
+
.t3q-file-tree-indent {
|
|
2093
|
+
display: inline-block;
|
|
2094
|
+
height: 0;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
.t3q-file-tree-indent-unit {
|
|
2098
|
+
display: inline-block;
|
|
2099
|
+
width: 12px;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
/* 펼침 칸(16×16). 잎은 안이 비어 있어 칸만 차지한다 */
|
|
2103
|
+
.t3q-file-tree-switcher {
|
|
2104
|
+
display: inline-flex;
|
|
2105
|
+
flex-shrink: 0;
|
|
2106
|
+
align-items: center;
|
|
2107
|
+
justify-content: center;
|
|
2108
|
+
width: 16px;
|
|
2109
|
+
height: 16px;
|
|
2110
|
+
cursor: pointer;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
.t3q-file-tree-switcher-noop {
|
|
2114
|
+
cursor: auto;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
/* 내용 칸(아이콘 + 제목). position: relative 는 드롭 표시선(내용 칸 안에 그려짐)의 위치 기준 —
|
|
2118
|
+
없으면 표시선이 대상 행이 아니라 목록 가장자리에 찍힌다 */
|
|
2119
|
+
.t3q-file-tree-node-content-wrapper {
|
|
2120
|
+
position: relative;
|
|
2121
|
+
display: inline-flex;
|
|
2122
|
+
flex: 1;
|
|
2123
|
+
align-items: center;
|
|
2124
|
+
gap: 4px;
|
|
2125
|
+
min-width: 0;
|
|
2126
|
+
cursor: pointer;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
/* 아이콘 칸 24×24 */
|
|
2130
|
+
.t3q-file-tree-iconEle {
|
|
2131
|
+
display: inline-flex;
|
|
2132
|
+
flex-shrink: 0;
|
|
2133
|
+
align-items: center;
|
|
2134
|
+
justify-content: center;
|
|
2135
|
+
width: 24px;
|
|
2136
|
+
height: 24px;
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
.t3q-file-tree-icon-folder {
|
|
2140
|
+
color: var(--color-primary20);
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
.t3q-file-tree-icon-file {
|
|
2144
|
+
color: var(--color-secondary50);
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
.t3q-file-tree-title {
|
|
2148
|
+
flex: 1;
|
|
2149
|
+
min-width: 0;
|
|
2150
|
+
overflow: hidden;
|
|
2151
|
+
font-size: var(--text-base-regular);
|
|
2152
|
+
line-height: var(--text-base-regular--line-height);
|
|
2153
|
+
color: var(--color-sys-text-main);
|
|
2154
|
+
text-overflow: ellipsis;
|
|
2155
|
+
white-space: nowrap;
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
/* ==================== 상태 ==================== */
|
|
2159
|
+
/* 같은 특이도라 아래 규칙이 위 규칙을 이긴다(hover < 누름 < 선택 < 끌리는 중 < 놓을 곳) */
|
|
2160
|
+
|
|
2161
|
+
.t3q-file-tree-treenode:hover {
|
|
2162
|
+
background-color: var(--color-secondary-o10);
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
.t3q-file-tree-treenode:active {
|
|
2166
|
+
background-color: var(--color-secondary-o20);
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
.t3q-file-tree-treenode.t3q-file-tree-treenode-selected {
|
|
2170
|
+
background-color: var(--color-primary-o10);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
.t3q-file-tree-treenode.dragging {
|
|
2174
|
+
background-color: var(--color-primary30);
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
.t3q-file-tree-treenode.dragging .t3q-file-tree-title,
|
|
2178
|
+
.t3q-file-tree-treenode.dragging .t3q-file-tree-iconEle,
|
|
2179
|
+
.t3q-file-tree-treenode.dragging .t3q-file-tree-iconEle > svg {
|
|
2180
|
+
color: var(--color-sys-background);
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
.t3q-file-tree-treenode.drop-target {
|
|
2184
|
+
background-color: var(--color-primary-o10);
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
/* 검색어 일치(`filterTreeNode` 가 true 인 노드) — rc-tree 는 클래스만 붙이므로 여기서 보이게 한다 */
|
|
2188
|
+
.t3q-file-tree-treenode.filter-node .t3q-file-tree-title {
|
|
2189
|
+
font-weight: var(--font-weight-bold);
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
/* 키보드로 움직인 행의 링. 행은 포커스를 받지 않고(포커스는 트리 밖 숨은 입력란) rc-tree 가
|
|
2193
|
+
활성 행에 `-treenode-active` 를 붙인다. 안쪽 offset 이라 가상 스크롤 목록(overflow hidden)에서도 안 잘린다 */
|
|
2194
|
+
.t3q-file-tree-focused .t3q-file-tree-treenode-active {
|
|
2195
|
+
outline: 2px solid var(--color-sys-focus-ring-main);
|
|
2196
|
+
outline-offset: -2px;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
/* 비활성 — 선택·드래그만 막힌다. 폴더는 계속 펼쳐지는 조작 가능한 노드라 `aria-disabled` 가 없고,
|
|
2200
|
+
대비 4.5:1 을 지키는 subtler 로 그린다. 펼칠 것이 없는 비활성 잎만 index.tsx 가 `aria-disabled` 를 붙이므로
|
|
2201
|
+
(속성 선택자라 위 규칙보다 특이도가 높다) 그 행만 DS 비활성 색과 반투명 아이콘으로 그린다 */
|
|
2202
|
+
.t3q-file-tree-treenode-disabled .t3q-file-tree-title {
|
|
2203
|
+
color: var(--color-sys-text-subtler);
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
.t3q-file-tree-treenode-disabled[aria-disabled='true'] .t3q-file-tree-title {
|
|
2207
|
+
color: var(--color-sys-text-disabled);
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
.t3q-file-tree-treenode-disabled[aria-disabled='true'] .t3q-file-tree-iconEle {
|
|
2211
|
+
opacity: 0.5;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
/* ==================== 드래그 드롭 표시선 ==================== */
|
|
2215
|
+
/* 위치(top/bottom/left)는 index.tsx 가 인라인으로 준다 */
|
|
2216
|
+
|
|
2217
|
+
.t3q-file-tree-drop-indicator {
|
|
2218
|
+
position: absolute;
|
|
2219
|
+
right: 0;
|
|
2220
|
+
height: 2px;
|
|
2221
|
+
background-color: var(--color-primary30);
|
|
2222
|
+
pointer-events: none;
|
|
2223
|
+
}
|
|
@@ -7028,6 +7028,197 @@
|
|
|
7028
7028
|
],
|
|
7029
7029
|
"import": "import { EventList } from '@t3q-ui/design-system';"
|
|
7030
7030
|
},
|
|
7031
|
+
"components-navigation-filetree": {
|
|
7032
|
+
"id": "components-navigation-filetree",
|
|
7033
|
+
"name": "FileTree",
|
|
7034
|
+
"path": "./src/stories/FileTree/FileTree.stories.tsx",
|
|
7035
|
+
"jsDocTags": {},
|
|
7036
|
+
"description": "파일·폴더 계층을 펼치고 접으며 고르는 트리.\n\n언제 쓰나: 파일·폴더 계층 탐색, 폴더를 펼칠 때 하위 항목을 그때그때 불러오는 목록(`loadData`), 노드가 많은 목록(`height` 를 주면 가상 스크롤).\n언제 안 쓰나: 평면 목록(→ Table·AgGridTable), 화면 이동 메뉴(→ Sidebar).\n대신/함께: 우클릭 메뉴는 `onRightClick` 과 DropdownMenu 를 앱이 이어 붙인다. \"더 보기\" 같은 앱 고유 노드·실행 모듈 표시는 `treeData`·`icon`·`titleRender` 로, 검색어 강조는 `filterTreeNode` 로 그린다.",
|
|
7037
|
+
"reactDocgenTypescript": {
|
|
7038
|
+
"tags": {},
|
|
7039
|
+
"filePath": "src/components/fileTree/index.tsx",
|
|
7040
|
+
"description": "파일·폴더 계층을 펼치고 접으며 고르는 트리.\n\n언제 쓰나: 파일·폴더 계층 탐색, 폴더를 펼칠 때 하위 항목을 그때그때 불러오는 목록(`loadData`), 노드가 많은 목록(`height` 를 주면 가상 스크롤).\n언제 안 쓰나: 평면 목록(→ Table·AgGridTable), 화면 이동 메뉴(→ Sidebar).\n대신/함께: 우클릭 메뉴는 `onRightClick` 과 DropdownMenu 를 앱이 이어 붙인다. \"더 보기\" 같은 앱 고유 노드·실행 모듈 표시는 `treeData`·`icon`·`titleRender` 로, 검색어 강조는 `filterTreeNode` 로 그린다.",
|
|
7041
|
+
"displayName": "FileTree",
|
|
7042
|
+
"methods": [],
|
|
7043
|
+
"props": {
|
|
7044
|
+
"treeData": {
|
|
7045
|
+
"defaultValue": null,
|
|
7046
|
+
"description": "트리 데이터. 노드마다 `key`·`title`·`children` 을 두고, 폴더를 펼칠 때 불러오는 노드는 `isLeaf: false`, 파일은 `isLeaf: true`. 비활성 잎이 있으면 그 노드와 상위 노드는 복사본이 콜백으로 온다 — 노드는 `key` 로 비교한다",
|
|
7047
|
+
"name": "treeData",
|
|
7048
|
+
"parent": {
|
|
7049
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7050
|
+
"name": "FileTreeProps"
|
|
7051
|
+
},
|
|
7052
|
+
"declarations": [
|
|
7053
|
+
{
|
|
7054
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7055
|
+
"name": "FileTreeProps"
|
|
7056
|
+
}
|
|
7057
|
+
],
|
|
7058
|
+
"required": false,
|
|
7059
|
+
"type": {
|
|
7060
|
+
"name": "T[]"
|
|
7061
|
+
}
|
|
7062
|
+
},
|
|
7063
|
+
"icon": {
|
|
7064
|
+
"defaultValue": null,
|
|
7065
|
+
"description": "아이콘 칸에 그릴 내용(노드 또는 노드를 받는 함수). 없으면 폴더·파일 기본 아이콘이고, 불러오는 중에는 이 값과 상관없이 Spinner. 노드 데이터의 `icon` 은 이 값과 불러오는 중 표시를 덮는다",
|
|
7066
|
+
"name": "icon",
|
|
7067
|
+
"parent": {
|
|
7068
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7069
|
+
"name": "FileTreeProps"
|
|
7070
|
+
},
|
|
7071
|
+
"declarations": [
|
|
7072
|
+
{
|
|
7073
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7074
|
+
"name": "FileTreeProps"
|
|
7075
|
+
}
|
|
7076
|
+
],
|
|
7077
|
+
"required": false,
|
|
7078
|
+
"type": {
|
|
7079
|
+
"name": "IconType"
|
|
7080
|
+
}
|
|
7081
|
+
},
|
|
7082
|
+
"loadData": {
|
|
7083
|
+
"defaultValue": null,
|
|
7084
|
+
"description": "폴더를 펼칠 때 하위 노드를 불러오는 함수. 반환한 Promise 가 끝나면 펼쳐진다 — 그동안 아이콘 칸에 Spinner",
|
|
7085
|
+
"name": "loadData",
|
|
7086
|
+
"parent": {
|
|
7087
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7088
|
+
"name": "FileTreeProps"
|
|
7089
|
+
},
|
|
7090
|
+
"declarations": [
|
|
7091
|
+
{
|
|
7092
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7093
|
+
"name": "FileTreeProps"
|
|
7094
|
+
}
|
|
7095
|
+
],
|
|
7096
|
+
"required": false,
|
|
7097
|
+
"type": {
|
|
7098
|
+
"name": "((treeNode: EventDataNode<T>) => Promise<any>)"
|
|
7099
|
+
}
|
|
7100
|
+
},
|
|
7101
|
+
"height": {
|
|
7102
|
+
"defaultValue": null,
|
|
7103
|
+
"description": "목록 높이(px). 주면 보이는 만큼만 그리는 가상 스크롤이 켜진다. 노드가 많을 때 준다",
|
|
7104
|
+
"name": "height",
|
|
7105
|
+
"parent": {
|
|
7106
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7107
|
+
"name": "FileTreeProps"
|
|
7108
|
+
},
|
|
7109
|
+
"declarations": [
|
|
7110
|
+
{
|
|
7111
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7112
|
+
"name": "FileTreeProps"
|
|
7113
|
+
}
|
|
7114
|
+
],
|
|
7115
|
+
"required": false,
|
|
7116
|
+
"type": {
|
|
7117
|
+
"name": "number"
|
|
7118
|
+
}
|
|
7119
|
+
},
|
|
7120
|
+
"onSelect": {
|
|
7121
|
+
"defaultValue": null,
|
|
7122
|
+
"description": "노드를 눌러 선택이 바뀔 때 호출된다",
|
|
7123
|
+
"name": "onSelect",
|
|
7124
|
+
"parent": {
|
|
7125
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7126
|
+
"name": "FileTreeProps"
|
|
7127
|
+
},
|
|
7128
|
+
"declarations": [
|
|
7129
|
+
{
|
|
7130
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7131
|
+
"name": "FileTreeProps"
|
|
7132
|
+
}
|
|
7133
|
+
],
|
|
7134
|
+
"required": false,
|
|
7135
|
+
"type": {
|
|
7136
|
+
"name": "((selectedKeys: Key[], info: { event: \"select\"; selected: boolean; node: EventDataNode<T>; selectedNodes: T[]; nativeEvent: MouseEvent; }) => void)"
|
|
7137
|
+
}
|
|
7138
|
+
},
|
|
7139
|
+
"onRightClick": {
|
|
7140
|
+
"defaultValue": null,
|
|
7141
|
+
"description": "노드를 우클릭할 때 호출된다. 메뉴는 앱이 DropdownMenu 등으로 그린다",
|
|
7142
|
+
"name": "onRightClick",
|
|
7143
|
+
"parent": {
|
|
7144
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7145
|
+
"name": "FileTreeProps"
|
|
7146
|
+
},
|
|
7147
|
+
"declarations": [
|
|
7148
|
+
{
|
|
7149
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7150
|
+
"name": "FileTreeProps"
|
|
7151
|
+
}
|
|
7152
|
+
],
|
|
7153
|
+
"required": false,
|
|
7154
|
+
"type": {
|
|
7155
|
+
"name": "((info: { event: MouseEvent<Element, MouseEvent>; node: EventDataNode<T>; }) => void)"
|
|
7156
|
+
}
|
|
7157
|
+
},
|
|
7158
|
+
"titleRender": {
|
|
7159
|
+
"defaultValue": null,
|
|
7160
|
+
"description": "노드 제목을 직접 그린다. 노드 데이터를 받아 제목 자리에 들어갈 내용을 돌려준다",
|
|
7161
|
+
"name": "titleRender",
|
|
7162
|
+
"parent": {
|
|
7163
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7164
|
+
"name": "FileTreeProps"
|
|
7165
|
+
},
|
|
7166
|
+
"declarations": [
|
|
7167
|
+
{
|
|
7168
|
+
"fileName": "src/components/fileTree/index.tsx",
|
|
7169
|
+
"name": "FileTreeProps"
|
|
7170
|
+
}
|
|
7171
|
+
],
|
|
7172
|
+
"required": false,
|
|
7173
|
+
"type": {
|
|
7174
|
+
"name": "((node: T) => ReactNode)"
|
|
7175
|
+
}
|
|
7176
|
+
}
|
|
7177
|
+
},
|
|
7178
|
+
"exportName": "FileTree"
|
|
7179
|
+
},
|
|
7180
|
+
"stories": [
|
|
7181
|
+
{
|
|
7182
|
+
"id": "components-navigation-filetree--default",
|
|
7183
|
+
"name": "Default",
|
|
7184
|
+
"snippet": "const Default = () => <FileTree treeData={sampleData} defaultExpandedKeys={['src']} />;"
|
|
7185
|
+
},
|
|
7186
|
+
{
|
|
7187
|
+
"id": "components-navigation-filetree--filter",
|
|
7188
|
+
"name": "Filter",
|
|
7189
|
+
"snippet": "const Filter = () => <FilterExample />;"
|
|
7190
|
+
},
|
|
7191
|
+
{
|
|
7192
|
+
"id": "components-navigation-filetree--lazy-load",
|
|
7193
|
+
"name": "Lazy Load",
|
|
7194
|
+
"snippet": "const LazyLoad = () => <LazyLoadExample />;"
|
|
7195
|
+
},
|
|
7196
|
+
{
|
|
7197
|
+
"id": "components-navigation-filetree--virtual",
|
|
7198
|
+
"name": "Virtual",
|
|
7199
|
+
"snippet": "const Virtual = () => <FileTree treeData={manyNodes} defaultExpandAll height={320} />;",
|
|
7200
|
+
"description": "노드 1,000개 — `height` 를 주면 보이는 만큼만 그린다"
|
|
7201
|
+
},
|
|
7202
|
+
{
|
|
7203
|
+
"id": "components-navigation-filetree--draggable",
|
|
7204
|
+
"name": "Draggable",
|
|
7205
|
+
"snippet": "const Draggable = () => <DraggableExample />;"
|
|
7206
|
+
},
|
|
7207
|
+
{
|
|
7208
|
+
"id": "components-navigation-filetree--custom-icon",
|
|
7209
|
+
"name": "Custom Icon",
|
|
7210
|
+
"snippet": "const CustomIcon = () => (\n <FileTree\n treeData={sampleData}\n defaultExpandAll\n icon={(node) => iconOf(typeof node.title === 'string' ? node.title : '')}\n />\n);",
|
|
7211
|
+
"description": "`icon` 으로 노드마다 아이콘을 바꾼다. 아무것도 돌려주지 않으면 기본 아이콘"
|
|
7212
|
+
},
|
|
7213
|
+
{
|
|
7214
|
+
"id": "components-navigation-filetree--disabled",
|
|
7215
|
+
"name": "Disabled",
|
|
7216
|
+
"snippet": "const Disabled = () => <FileTree treeData={disabledData} defaultExpandAll />;",
|
|
7217
|
+
"description": "`disabled: true` 노드는 선택·드래그가 막힌다 — 폴더는 펼쳐지고 제목만 흐리게, 파일은 비활성으로 보인다"
|
|
7218
|
+
}
|
|
7219
|
+
],
|
|
7220
|
+
"import": "import { FileCode, FileText, Image } from 'lucide-react';\nimport { FileTree, TextField } from '@t3q-ui/design-system';"
|
|
7221
|
+
},
|
|
7031
7222
|
"components-inputs-form": {
|
|
7032
7223
|
"id": "components-inputs-form",
|
|
7033
7224
|
"name": "FormItem",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t3q-ui/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.67.0",
|
|
4
4
|
"description": "T3Q Design System - React Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "rm -rf dist && vite build --config vite.config.lib.ts && tsup && node scripts/fix-dts.mjs && node scripts/release/check-entries.mjs && npm run build:css",
|
|
69
69
|
"check": "pnpm lint && pnpm typecheck && pnpm build",
|
|
70
|
-
"build:css": "cp src/styles/fonts.css dist/fonts.css && echo '@source \"./**/*.js\";' > dist/styles.css && cat src/styles/tokens.css >> dist/styles.css && cat src/styles/utilities.css >> dist/styles.css && cat src/components/agGridTable/style.css >> dist/styles.css && cat src/components/parameterTable/parameterTable.css >> dist/styles.css",
|
|
70
|
+
"build:css": "cp src/styles/fonts.css dist/fonts.css && echo '@source \"./**/*.js\";' > dist/styles.css && cat src/styles/tokens.css >> dist/styles.css && cat src/styles/utilities.css >> dist/styles.css && cat src/components/agGridTable/style.css >> dist/styles.css && cat src/components/parameterTable/parameterTable.css >> dist/styles.css && cat src/components/fileTree/fileTree.css >> dist/styles.css",
|
|
71
71
|
"build:dev": "vite build --config vite.config.dev.ts",
|
|
72
72
|
"dev": "vite --config vite.config.dev.ts",
|
|
73
73
|
"dev:site": "vite --config vite.config.site.ts",
|
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
"es-toolkit": "^1.0.0",
|
|
142
142
|
"lucide-react": "^0.468.0",
|
|
143
143
|
"pretendard": "^1.3.9",
|
|
144
|
+
"rc-tree": "^5.13.1",
|
|
144
145
|
"react-day-picker": "^8.10.1",
|
|
145
146
|
"react-lottie": "^1.2.10",
|
|
146
147
|
"react-markdown": "^10.1.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TDS 컴포넌트·패턴 참조 (생성물)
|
|
2
2
|
|
|
3
|
-
`scripts/mcp/build-skill-reference.mjs` 가 Storybook 매니페스트에서 만든다 — **손으로 고치지 않는다**.
|
|
3
|
+
`scripts/mcp/build-skill-reference.mjs` 가 Storybook 매니페스트에서 만든다 — **손으로 고치지 않는다**. 71개(패턴 9 · 컴포넌트 62).
|
|
4
4
|
MCP `docs-list` / `docs-show <id>` / `docs-show-story` 와 같은 내용이다. 패턴은 `@t3q-ui/design-system/patterns`, 컴포넌트는 `@t3q-ui/design-system`, `Markdown` 만 `@t3q-ui/design-system/markdown` 에서 import 한다. props 표에는 설명이 있는 prop 만 있다 — 전체 타입은 `node_modules/@t3q-ui/design-system/dist/*.d.ts`.
|
|
5
5
|
|
|
6
6
|
## 목차
|
|
@@ -10,7 +10,7 @@ MCP `docs-list` / `docs-show <id>` / `docs-show-story` 와 같은 내용이다.
|
|
|
10
10
|
- **data-display**: Accordion `components-data-display-accordion` · Alert `components-data-display-alert` · Badge `components-data-display-badge` · ChatMessage `components-data-display-chatmessage` · EmptyBoxIllustration `components-data-display-emptyboxillustration` · EventList `components-data-display-eventlist` · LucideIcon `components-data-display-lucideicon` · Markdown `components-data-display-markdown` · MetaItem `components-data-display-metaitem` · Progress `components-data-display-progress` · Skeleton `components-data-display-skeleton` · Spinner `components-data-display-spinner` · Tag `components-data-display-tag`
|
|
11
11
|
- **inputs**: Calendar `components-inputs-calendar` · ChatComposer `components-inputs-chatcomposer` · Checkbox `components-inputs-checkbox` · CheckboxSection `components-inputs-checkboxsection` · DatePicker `components-inputs-datepicker` · FormItem `components-inputs-form` · IconSelect `components-inputs-iconselect` · Label `components-inputs-label` · MultiSelect `components-inputs-multiselect` · Radio `components-inputs-radio` · RadioGroup `components-inputs-radiogroup` · RadioSection `components-inputs-radiosection` · Range `components-inputs-range` · RangeSlider `components-inputs-rangeslider` · Select `components-inputs-select` · Switch `components-inputs-switch` · SwitchSection `components-inputs-switchsection` · Textarea `components-inputs-textarea` · TextField `components-inputs-textfield` · TimePicker `components-inputs-timepicker`
|
|
12
12
|
- **layout**: Card `components-layout-card` · Panel `components-layout-panel` · Separator `components-layout-separator` · Stack `components-layout-stack`
|
|
13
|
-
- **navigation**: Breadcrumb `components-navigation-breadcrumb` · ChatHistory `components-navigation-chathistory` · PageHeader `components-navigation-pageheader` · PageHeaderRefreshButton `components-navigation-pageheaderrefreshbutton` · Pagination `components-navigation-pagination` · Sidebar `components-navigation-sidebar` · Tabs `components-navigation-tabs`
|
|
13
|
+
- **navigation**: Breadcrumb `components-navigation-breadcrumb` · ChatHistory `components-navigation-chathistory` · FileTree `components-navigation-filetree` · PageHeader `components-navigation-pageheader` · PageHeaderRefreshButton `components-navigation-pageheaderrefreshbutton` · Pagination `components-navigation-pagination` · Sidebar `components-navigation-sidebar` · Tabs `components-navigation-tabs`
|
|
14
14
|
- **overlay**: AlertDialogContent `components-overlay-alertdialog` · Command `components-overlay-command` · DialogContent `components-overlay-dialog` · DrawerContent `components-overlay-drawer` · PopoverContent `components-overlay-popover` · Toaster `components-overlay-toast` · Tooltip `components-overlay-tooltip`
|
|
15
15
|
- **table**: AgGridTable `components-table-aggridtable` · ColumnFilter `components-table-columnfilter` · ColumnVisibilityFilter `components-table-columnvisibilityfilter` · ParameterTable `components-table-parametertable` · Table `components-table-table` · TableFilterMultiSelect `components-table-tablefilter`
|
|
16
16
|
|
|
@@ -1307,6 +1307,30 @@ const Basic = () => (
|
|
|
1307
1307
|
const Default = () => <Demo />;
|
|
1308
1308
|
```
|
|
1309
1309
|
|
|
1310
|
+
## FileTree (`components-navigation-filetree`)
|
|
1311
|
+
|
|
1312
|
+
파일·폴더 계층을 펼치고 접으며 고르는 트리.
|
|
1313
|
+
|
|
1314
|
+
언제 쓰나: 파일·폴더 계층 탐색, 폴더를 펼칠 때 하위 항목을 그때그때 불러오는 목록(`loadData`), 노드가 많은 목록(`height` 를 주면 가상 스크롤).
|
|
1315
|
+
언제 안 쓰나: 평면 목록(→ Table·AgGridTable), 화면 이동 메뉴(→ Sidebar).
|
|
1316
|
+
대신/함께: 우클릭 메뉴는 `onRightClick` 과 DropdownMenu 를 앱이 이어 붙인다. "더 보기" 같은 앱 고유 노드·실행 모듈 표시는 `treeData`·`icon`·`titleRender` 로, 검색어 강조는 `filterTreeNode` 로 그린다.
|
|
1317
|
+
|
|
1318
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
1319
|
+
|---|---|---|---|
|
|
1320
|
+
| `treeData` | `T[]` | | 트리 데이터. 노드마다 `key`·`title`·`children` 을 두고, 폴더를 펼칠 때 불러오는 노드는 `isLeaf: false`, 파일은 `isLeaf: true`. 비활성 잎이 있으면 그 노드와 상위 노드는 복사본이 콜백으로 온다 — 노드는 `key` 로 비교한다 |
|
|
1321
|
+
| `icon` | `IconType` | | 아이콘 칸에 그릴 내용(노드 또는 노드를 받는 함수). 없으면 폴더·파일 기본 아이콘이고, 불러오는 중에는 이 값과 상관없이 Spinner. 노드 데이터의 `icon` 은 이 값과 불러오는 중 표시를 덮는다 |
|
|
1322
|
+
| `loadData` | `((treeNode: EventDataNode<T>) => Promise<any>)` | | 폴더를 펼칠 때 하위 노드를 불러오는 함수. 반환한 Promise 가 끝나면 펼쳐진다 — 그동안 아이콘 칸에 Spinner |
|
|
1323
|
+
| `height` | `number` | | 목록 높이(px). 주면 보이는 만큼만 그리는 가상 스크롤이 켜진다. 노드가 많을 때 준다 |
|
|
1324
|
+
| `onSelect` | `((selectedKeys: Key[], info: { event: "select"; selected: boolean; node: EventD…` | | 노드를 눌러 선택이 바뀔 때 호출된다 |
|
|
1325
|
+
| `onRightClick` | `((info: { event: MouseEvent<Element, MouseEvent>; node: EventDataNode<T>; }) =>…` | | 노드를 우클릭할 때 호출된다. 메뉴는 앱이 DropdownMenu 등으로 그린다 |
|
|
1326
|
+
| `titleRender` | `((node: T) => ReactNode)` | | 노드 제목을 직접 그린다. 노드 데이터를 받아 제목 자리에 들어갈 내용을 돌려준다 |
|
|
1327
|
+
|
|
1328
|
+
예시 — story "Filter":
|
|
1329
|
+
|
|
1330
|
+
```tsx
|
|
1331
|
+
const Filter = () => <FilterExample />;
|
|
1332
|
+
```
|
|
1333
|
+
|
|
1310
1334
|
## PageHeader (`components-navigation-pageheader`)
|
|
1311
1335
|
|
|
1312
1336
|
페이지 최상단 헤더. 제목·설명·상태·메타·주요 행동·필터 줄·탭을 한 곳에 둔다.
|