triafly-ui-kit 1.0.15 → 1.0.17

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.
@@ -1,241 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { Tree as i } from "./TreeEl/Tree.js";
3
- const m = {
4
- title: "Components/Tree",
5
- component: i,
6
- parameters: {
7
- layout: "centered"
8
- },
9
- argTypes: {
10
- data: { control: "object" },
11
- onSelect: { action: "selected" },
12
- defaultExpandedKeys: { control: "object" },
13
- selectedKey: { control: "text" },
14
- autoExpandParent: { control: "boolean" },
15
- idKey: { control: "text" },
16
- nameKey: { control: "text" },
17
- typeKey: { control: "text" },
18
- childrenKey: { control: "text" }
19
- }
20
- }, o = (d) => /* @__PURE__ */ t(i, { ...d }), a = o.bind({});
21
- a.args = {
22
- data: [
23
- {
24
- id: "1",
25
- name: "Работа",
26
- type: "folder",
27
- modifiedAt: "05-02-2025 12:00",
28
- size: "-",
29
- branches: [
30
- {
31
- id: "1-1",
32
- name: "Документы",
33
- type: "folder",
34
- modifiedAt: "05-02-2025 12:10",
35
- size: "-",
36
- branches: [
37
- ...Array.from({ length: 50 }, (d, e) => ({
38
- id: `1-1-${e}`,
39
- name: `Файл ${e + 1}.docx`,
40
- type: "file",
41
- modifiedAt: "05-02-2025 13:00",
42
- size: `${(Math.random() * 2 + 0.5).toFixed(2)} MB`,
43
- fileType: "docx"
44
- })),
45
- {
46
- id: "1-1-51",
47
- name: "Проекты",
48
- type: "folder",
49
- modifiedAt: "05-02-2025 13:10",
50
- size: "-",
51
- branches: Array.from({ length: 20 }, (d, e) => ({
52
- id: `1-1-51-${e}`,
53
- name: `Проект_${e + 1}.pptx`,
54
- type: "file",
55
- modifiedAt: "05-02-2025 14:00",
56
- size: `${(Math.random() * 5 + 1).toFixed(2)} MB`,
57
- fileType: "pptx"
58
- }))
59
- },
60
- {
61
- id: "1-1-52",
62
- name: "Исследования",
63
- type: "folder",
64
- modifiedAt: "05-02-2025 14:20",
65
- size: "-",
66
- branches: [
67
- {
68
- id: "1-1-52-1",
69
- name: "2023",
70
- type: "folder",
71
- modifiedAt: "05-02-2025 14:30",
72
- size: "-",
73
- branches: Array.from({ length: 15 }, (d, e) => ({
74
- id: `1-1-52-1-${e}`,
75
- name: `Отчет_2023_${e + 1}.pdf`,
76
- type: "file",
77
- modifiedAt: "05-02-2025 15:00",
78
- size: `${(Math.random() * 3 + 1).toFixed(2)} MB`,
79
- fileType: "pdf"
80
- }))
81
- },
82
- {
83
- id: "1-1-52-2",
84
- name: "2024",
85
- type: "folder",
86
- modifiedAt: "05-02-2025 15:10",
87
- size: "-",
88
- branches: Array.from({ length: 15 }, (d, e) => ({
89
- id: `1-1-52-2-${e}`,
90
- name: `Отчет_2024_${e + 1}.pdf`,
91
- type: "file",
92
- modifiedAt: "05-02-2025 15:20",
93
- size: `${(Math.random() * 3 + 1).toFixed(2)} MB`,
94
- fileType: "pdf"
95
- }))
96
- }
97
- ]
98
- }
99
- ]
100
- },
101
- {
102
- id: "1-2",
103
- name: "Продажи",
104
- type: "folder",
105
- modifiedAt: "05-02-2025 12:20",
106
- size: "-",
107
- branches: [
108
- ...Array.from({ length: 30 }, (d, e) => ({
109
- id: `1-2-${e}`,
110
- name: `Отчет_${e + 1}.xlsx`,
111
- type: "file",
112
- modifiedAt: "05-02-2025 13:40",
113
- size: `${(Math.random() * 1.5 + 0.2).toFixed(2)} MB`,
114
- fileType: "xlsx"
115
- })),
116
- {
117
- id: "1-2-31",
118
- name: "Контракты",
119
- type: "folder",
120
- modifiedAt: "05-02-2025 14:40",
121
- size: "-",
122
- branches: Array.from({ length: 10 }, (d, e) => ({
123
- id: `1-2-31-${e}`,
124
- name: `Контракт_${e + 1}.pdf`,
125
- type: "file",
126
- modifiedAt: "05-02-2025 15:50",
127
- size: `${(Math.random() * 4 + 1).toFixed(2)} MB`,
128
- fileType: "pdf"
129
- }))
130
- }
131
- ]
132
- }
133
- ]
134
- },
135
- {
136
- id: "2",
137
- name: "Личное",
138
- type: "folder",
139
- modifiedAt: "05-02-2025 11:00",
140
- size: "-",
141
- branches: [
142
- {
143
- id: "2-1",
144
- name: "Фото",
145
- type: "folder",
146
- modifiedAt: "05-02-2025 11:20",
147
- size: "-",
148
- branches: [
149
- ...Array.from({ length: 20 }, (d, e) => ({
150
- id: `2-1-${e}`,
151
- name: `Фото_${e + 1}.jpg`,
152
- type: "file",
153
- modifiedAt: "05-02-2025 12:30",
154
- size: `${(Math.random() * 5 + 1).toFixed(2)} MB`,
155
- fileType: "jpg"
156
- })),
157
- {
158
- id: "2-1-21",
159
- name: "Путешествия",
160
- type: "folder",
161
- modifiedAt: "05-02-2025 13:50",
162
- size: "-",
163
- branches: [
164
- {
165
- id: "2-1-21-1",
166
- name: "Италия",
167
- type: "folder",
168
- modifiedAt: "05-02-2025 14:00",
169
- size: "-",
170
- branches: Array.from({ length: 10 }, (d, e) => ({
171
- id: `2-1-21-1-${e}`,
172
- name: `Италия_${e + 1}.jpg`,
173
- type: "file",
174
- modifiedAt: "05-02-2025 14:10",
175
- size: `${(Math.random() * 5 + 1).toFixed(2)} MB`,
176
- fileType: "jpg"
177
- }))
178
- },
179
- {
180
- id: "2-1-21-2",
181
- name: "Япония",
182
- type: "folder",
183
- modifiedAt: "05-02-2025 14:20",
184
- size: "-",
185
- branches: Array.from({ length: 10 }, (d, e) => ({
186
- id: `2-1-21-2-${e}`,
187
- name: `Япония_${e + 1}.jpg`,
188
- type: "file",
189
- modifiedAt: "05-02-2025 14:30",
190
- size: `${(Math.random() * 5 + 1).toFixed(2)} MB`,
191
- fileType: "jpg"
192
- }))
193
- }
194
- ]
195
- }
196
- ]
197
- },
198
- {
199
- id: "2-2",
200
- name: "Видео",
201
- type: "folder",
202
- modifiedAt: "05-02-2025 12:40",
203
- size: "-",
204
- branches: [
205
- ...Array.from({ length: 15 }, (d, e) => ({
206
- id: `2-2-${e}`,
207
- name: `Видео_${e + 1}.mp4`,
208
- type: "file",
209
- modifiedAt: "05-02-2025 14:50",
210
- size: `${(Math.random() * 100 + 10).toFixed(2)} MB`,
211
- fileType: "mp4"
212
- })),
213
- {
214
- id: "2-2-16",
215
- name: "Семейные Видео",
216
- type: "folder",
217
- modifiedAt: "05-02-2025 15:00",
218
- size: "-",
219
- branches: Array.from({ length: 10 }, (d, e) => ({
220
- id: `2-2-16-${e}`,
221
- name: `Семья_${e + 1}.mp4`,
222
- type: "file",
223
- modifiedAt: "05-02-2025 15:10",
224
- size: `${(Math.random() * 50 + 5).toFixed(2)} MB`,
225
- fileType: "mp4"
226
- }))
227
- }
228
- ]
229
- }
230
- ]
231
- }
232
- ],
233
- idKey: "id",
234
- nameKey: "name",
235
- typeKey: "type",
236
- childrenKey: "branches"
237
- };
238
- export {
239
- a as WithCustomKeys,
240
- m as default
241
- };
@@ -1,76 +0,0 @@
1
- import { jsx as I } from "react/jsx-runtime";
2
- import { useState as T, useEffect as _, useCallback as x } from "react";
3
- import { T as H } from "../../../../TreeList-Z1F3eQH6.js";
4
- import { c as J } from "../../../../index-2QXL0WYc.js";
5
- import '../../../../assets/Tree.css';const M = {
6
- "tree-wrapper": "_tree-wrapper_1yvw0_1"
7
- }, U = ({
8
- data: n = [],
9
- childrenKey: p = "children",
10
- idKey: t = "id",
11
- // ключ по умолчанию
12
- nameKey: i = "name",
13
- // ключ по умолчанию
14
- typeKey: f = "type",
15
- // ключ по умолчанию
16
- onSelect: r,
17
- defaultExpandedKeys: N = [],
18
- // открытые элементы
19
- autoExpandParent: b = !1,
20
- // Автоматически раскрывать родительские элементы
21
- expandedKeys: o,
22
- // Управление извне
23
- onExpandedKeysChange: u,
24
- // Колбэк для изменения expandedKeys
25
- selectedKey: a,
26
- isFetching: j,
27
- isAllExpanded: w = !1,
28
- wrapperTreeClassName: l = "",
29
- TreeItemClassName: D = "",
30
- TreeItemContentClassName: L = ""
31
- }) => {
32
- const [q, c] = T(N), [z, e] = T(null), m = o !== void 0 ? o : q, B = a !== void 0 ? a : z;
33
- _(() => {
34
- a !== void 0 && e(a);
35
- }, [a]), _(() => {
36
- if (!w) return;
37
- const s = A(n, t, f, p);
38
- u ? u(s) : c(s);
39
- }, [w]);
40
- const E = x(
41
- (s) => {
42
- const v = m.includes(s) ? m.filter((G) => G !== s) : [...m, s];
43
- u ? u(v) : c(v);
44
- },
45
- [m, u]
46
- ), F = x(
47
- (s) => {
48
- const v = s[t];
49
- a === void 0 && e(v), r == null || r(s);
50
- },
51
- [a, r, t]
52
- );
53
- return /* @__PURE__ */ I("div", { className: J(M["tree-wrapper"], l), children: n.map((s) => /* @__PURE__ */ I(
54
- H,
55
- {
56
- node: s,
57
- level: 0,
58
- isFetching: j,
59
- onSelect: F,
60
- selectedKey: B,
61
- childrenKey: p,
62
- idKey: t,
63
- nameKey: i,
64
- typeKey: f,
65
- expandedKeys: m,
66
- onExpand: E,
67
- autoExpandParent: b,
68
- TreeItemClassName: D,
69
- TreeItemContentClassName: L
70
- },
71
- s[t]
72
- )) });
73
- }, A = (n, p, t, i) => n.reduce((f, r) => (r[t] === "directory" && (f.push(r[p]), r[i] && Array.isArray(r[i]) && f.push(...A(r[i], p, t, i))), f), []);
74
- export {
75
- U as Tree
76
- };
@@ -1,4 +0,0 @@
1
- import { Tree as o } from "./Tree.js";
2
- export {
3
- o as Tree
4
- };
@@ -1,9 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import "../../Icons/Icons.js";
4
- import { a as e } from "../../../../TreeList-Z1F3eQH6.js";
5
- import "../../Loader/Loader.js";
6
- import "../../../../index-2QXL0WYc.js";
7
- export {
8
- e as default
9
- };
@@ -1,5 +0,0 @@
1
- import "react/jsx-runtime";
2
- import { T as a } from "../../../../TreeList-Z1F3eQH6.js";
3
- export {
4
- a as default
5
- };
@@ -1,4 +0,0 @@
1
- import { Tree as o } from "./TreeEl/Tree.js";
2
- export {
3
- o as Tree
4
- };
@@ -1 +0,0 @@
1
-