triafly-ui-kit 1.0.49 → 1.0.52
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.
@@ -4,18 +4,18 @@ import { useMemo as l } from "react";
|
|
4
4
|
import { FormContext as f } from "../FormContext/FormContext.js";
|
5
5
|
import { FormItem as i } from "../FormItem/FormItem.js";
|
6
6
|
import { useForm as p } from "../useForm/useForm.js";
|
7
|
-
const v = ({ form: m, children: c, onFinish:
|
7
|
+
const v = ({ form: m, children: c, onFinish: t, disabled: e = !1 }) => {
|
8
8
|
const n = p()[0], s = l(() => {
|
9
9
|
const r = m || n;
|
10
|
-
return r.disabled =
|
11
|
-
}, [m, n,
|
10
|
+
return r.disabled = e, r;
|
11
|
+
}, [m, n, e]), u = async (r) => {
|
12
12
|
r.preventDefault();
|
13
13
|
try {
|
14
|
-
if (
|
15
|
-
const
|
16
|
-
|
17
|
-
} catch (
|
18
|
-
console.error("Form submission error:",
|
14
|
+
if (e) return;
|
15
|
+
const o = await s.validateFields();
|
16
|
+
t == null || t(o);
|
17
|
+
} catch (o) {
|
18
|
+
throw console.error("Form submission error:", o), o;
|
19
19
|
}
|
20
20
|
};
|
21
21
|
return /* @__PURE__ */ a(f.Provider, { value: s || null, children: /* @__PURE__ */ a("form", { onSubmit: u, children: c }) });
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -11,7 +11,7 @@ const L = {
|
|
11
11
|
desc: /* @__PURE__ */ n(ae, { viewBox: "0 -4 24 24", "aria-hidden": "true" }),
|
12
12
|
default: /* @__PURE__ */ n(z, { viewBox: "0 -6 24 24", "aria-hidden": "true" })
|
13
13
|
}, le = ({
|
14
|
-
columns:
|
14
|
+
columns: p,
|
15
15
|
dataSource: l,
|
16
16
|
rowKey: f,
|
17
17
|
tableClassName: $,
|
@@ -23,7 +23,7 @@ const L = {
|
|
23
23
|
borderBottom: y = !1,
|
24
24
|
stickyHeader: H = !1,
|
25
25
|
stickyLeft: b = !1,
|
26
|
-
bordered:
|
26
|
+
bordered: m = !1,
|
27
27
|
rowClassName: x,
|
28
28
|
defaultSort: J,
|
29
29
|
onClickTr: d,
|
@@ -39,7 +39,7 @@ const L = {
|
|
39
39
|
}, W) => {
|
40
40
|
const T = K.useRef(null), o = !!c && !!u, [A, X] = j(l || []), [s, E] = j(
|
41
41
|
J || null
|
42
|
-
),
|
42
|
+
), w = te(() => {
|
43
43
|
if (!o)
|
44
44
|
return D ? l : A;
|
45
45
|
}, [o, l, A, D]), I = k(
|
@@ -54,7 +54,7 @@ const L = {
|
|
54
54
|
})), E({ key: e, order: t });
|
55
55
|
},
|
56
56
|
[o]
|
57
|
-
),
|
57
|
+
), N = k(
|
58
58
|
(e) => typeof f == "function" ? f(e) : String(e[f]),
|
59
59
|
[f]
|
60
60
|
), Y = k(
|
@@ -68,26 +68,26 @@ const L = {
|
|
68
68
|
const e = T.current;
|
69
69
|
if (!e) return;
|
70
70
|
const t = (_) => {
|
71
|
-
const
|
72
|
-
if (!h ||
|
71
|
+
const v = _.target, h = v.closest("tr");
|
72
|
+
if (!h || v.closest("[data-no-bubble]")) return;
|
73
73
|
const r = h.dataset.id;
|
74
74
|
if (!(!r || !d))
|
75
75
|
if (o && c) {
|
76
76
|
const a = c[r];
|
77
77
|
a && d(a);
|
78
78
|
} else {
|
79
|
-
const a = l == null ? void 0 : l.find((Z) =>
|
79
|
+
const a = l == null ? void 0 : l.find((Z) => N(Z) === r);
|
80
80
|
a && d(a);
|
81
81
|
}
|
82
82
|
};
|
83
83
|
return e.addEventListener("click", t), () => e.removeEventListener("click", t);
|
84
|
-
}, [l, d,
|
84
|
+
}, [l, d, N, o, c]), /* @__PURE__ */ n("div", { className: i("table-component", G), children: /* @__PURE__ */ n(
|
85
85
|
"div",
|
86
86
|
{
|
87
87
|
className: i(
|
88
88
|
"table-component__wrapper",
|
89
89
|
{
|
90
|
-
bordered:
|
90
|
+
bordered: m,
|
91
91
|
borderBottom: y
|
92
92
|
},
|
93
93
|
$
|
@@ -97,7 +97,7 @@ const L = {
|
|
97
97
|
"table",
|
98
98
|
{
|
99
99
|
className: i("table-component__wrapper__table", {
|
100
|
-
bordered:
|
100
|
+
bordered: m,
|
101
101
|
borderBottom: y
|
102
102
|
}),
|
103
103
|
ref: W,
|
@@ -120,13 +120,13 @@ const L = {
|
|
120
120
|
U
|
121
121
|
),
|
122
122
|
onClick: P,
|
123
|
-
children:
|
123
|
+
children: p.map((e, t) => /* @__PURE__ */ n(
|
124
124
|
"th",
|
125
125
|
{
|
126
126
|
className: i(
|
127
127
|
"table-component__wrapper__table__thead__th",
|
128
128
|
{
|
129
|
-
bordered:
|
129
|
+
bordered: m,
|
130
130
|
stickyLeft: b && t === 0
|
131
131
|
},
|
132
132
|
q
|
@@ -159,39 +159,40 @@ const L = {
|
|
159
159
|
C,
|
160
160
|
{
|
161
161
|
record: t,
|
162
|
-
columns:
|
162
|
+
columns: p,
|
163
163
|
rowKey: f,
|
164
164
|
rowClassName: x,
|
165
165
|
index: u.indexOf(e),
|
166
166
|
stickyLeft: b,
|
167
|
-
bordered:
|
167
|
+
bordered: m,
|
168
168
|
id: e
|
169
169
|
},
|
170
170
|
e
|
171
171
|
) : null;
|
172
|
-
}) :
|
172
|
+
}) : w == null ? void 0 : w.map((e, t) => /* @__PURE__ */ n(
|
173
173
|
C,
|
174
174
|
{
|
175
175
|
record: e,
|
176
|
-
columns:
|
176
|
+
columns: p,
|
177
177
|
rowKey: f,
|
178
178
|
rowClassName: x,
|
179
179
|
index: t,
|
180
180
|
stickyLeft: b,
|
181
|
-
bordered:
|
181
|
+
bordered: m
|
182
182
|
},
|
183
|
-
|
183
|
+
N(e)
|
184
184
|
)),
|
185
185
|
R ? /* @__PURE__ */ n("div", { className: "loading_table_init", children: /* @__PURE__ */ n(re, { className: "centered" }) }) : null,
|
186
|
-
!R && Q && B && /* @__PURE__ */ n("tr", { ref: B, children: /* @__PURE__ */ n("td", { colSpan:
|
186
|
+
!R && Q && B && /* @__PURE__ */ n("tr", { ref: B, children: /* @__PURE__ */ n("td", { colSpan: p.length, children: S || /* @__PURE__ */ n(se, { colSpan: p.length }) }) })
|
187
187
|
]
|
188
188
|
}
|
189
189
|
)
|
190
190
|
]
|
191
191
|
}
|
192
192
|
)
|
193
|
-
}
|
194
|
-
|
193
|
+
},
|
194
|
+
"wrapper"
|
195
|
+
) }, "table-component");
|
195
196
|
}, ue = ee(le);
|
196
197
|
export {
|
197
198
|
ue as Table
|
package/dist/main.d.ts
CHANGED
@@ -1081,7 +1081,7 @@ declare type RadioProps = {
|
|
1081
1081
|
|
1082
1082
|
declare type RositionModal = "center" | "right" | "left" | "top" | "bottom";
|
1083
1083
|
|
1084
|
-
declare type Rule = {
|
1084
|
+
export declare type Rule = {
|
1085
1085
|
required?: boolean;
|
1086
1086
|
message?: string;
|
1087
1087
|
pattern?: RegExp;
|
@@ -1233,6 +1233,10 @@ declare type TextInputProps = {
|
|
1233
1233
|
|
1234
1234
|
declare type Theme = "light" | "dark";
|
1235
1235
|
|
1236
|
+
declare interface ToastContextType {
|
1237
|
+
addToast: (message: string) => void;
|
1238
|
+
}
|
1239
|
+
|
1236
1240
|
export declare const ToastProvider: ({ children }: {
|
1237
1241
|
children: ReactNode;
|
1238
1242
|
}) => JSX.Element;
|
@@ -1280,6 +1284,8 @@ export declare const useThemeLogic: () => {
|
|
1280
1284
|
toggleTheme: () => void;
|
1281
1285
|
};
|
1282
1286
|
|
1287
|
+
export declare const useToast: () => ToastContextType;
|
1288
|
+
|
1283
1289
|
export declare const useTriafly: () => TriaflyContextType;
|
1284
1290
|
|
1285
1291
|
export { }
|
package/dist/main.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
import { Accordeon as e } from "./components/Ui/Accordeon/Accordeon.js";
|
2
2
|
import { Alert as t } from "./components/Ui/Alert/Alert.js";
|
3
|
-
import { Avatar as
|
3
|
+
import { Avatar as a } from "./components/Ui/Avatar/Avatar.js";
|
4
4
|
import { ModalWindow as p } from "./components/Ui/ModalWindow/ModalWindow.js";
|
5
5
|
import { Badge as f } from "./components/Ui/Badge/Badge.js";
|
6
6
|
import { DatePicker as x } from "./components/Ui/DatePicker/DatePicker.js";
|
7
7
|
import { DateRangePicker as u } from "./components/Ui/DateRangePicker/DateRangePicker.js";
|
8
8
|
import { Button as d } from "./components/Ui/Button/Button.js";
|
9
9
|
import { ButtonsArray as w } from "./components/Ui/ButtonsArray/ButtonsArray.js";
|
10
|
-
import { Checkbox as
|
11
|
-
import { CliTextareaInput as
|
10
|
+
import { Checkbox as g } from "./components/Ui/Checkbox/Checkbox.js";
|
11
|
+
import { CliTextareaInput as S } from "./components/Ui/CliTextareaInput/CliTextareaInput.js";
|
12
12
|
import "react";
|
13
13
|
import { CustomLink as D } from "./components/Ui/CustomLink/CustomLink.js";
|
14
14
|
import { DropdownInput as P } from "./components/Ui/DropdownInput/DropdownInput.js";
|
@@ -27,21 +27,21 @@ import { TextInput as Z } from "./components/Ui/TextInput/TextInput.js";
|
|
27
27
|
import { TextareaInput as $ } from "./components/Ui/TextareaInput/TextareaInput.js";
|
28
28
|
import { Tooltip as no } from "./components/Ui/Tooltip/Tooltip.js";
|
29
29
|
import { Tabs as eo } from "./components/Ui/Tabs/Tabs.js";
|
30
|
-
import { IconArrowBendUpRight as to, IconArrowClockwise as Io, IconArrowDown as
|
31
|
-
import { ToastProvider as Kn } from "./context/ToastContext/ToastContext.js";
|
32
|
-
import { TriaflyContext as
|
33
|
-
import { useBreakpointValueTriafly as
|
34
|
-
import { useThemeLogic as
|
35
|
-
import { useModalState as
|
30
|
+
import { IconArrowBendUpRight as to, IconArrowClockwise as Io, IconArrowDown as ao, IconArrowLeft as io, IconArrowLineDown as po, IconArrowLineLeft as lo, IconArrowLineRight as fo, IconArrowLineUp as mo, IconArrowRight as xo, IconArrowUp as so, IconArrowsOut as uo, IconArticle as Co, IconAt as ho, IconBellSimple as wo, IconBookOpenText as To, IconCalendarBlank as go, IconCaretDown as ko, IconCaretLeft as So, IconCaretRight as Ao, IconCaretUp as Do, IconCaretUpDown as Lo, IconChartPieSlice as Po, IconChatText as yo, IconCheck as Bo, IconCheckCircle as Uo, IconChecks as Fo, IconCircleNotch as Mo, IconClickHouse as Ro, IconCopy as vo, IconCornersOut as Xo, IconCsv as bo, IconCube as Ho, IconDatabase as Go, IconDotsNine as No, IconDotsThreeVertical as Oo, IconExport as Qo, IconEye as Eo, IconEyeSlash as Wo, IconFile as Vo, IconFiles as zo, IconFloppyDisk as Jo, IconFolderSimple as Yo, IconFolderSimpleX as jo, IconFunnel as qo, IconGauge as Ko, IconGear as Zo, IconGitBranchX as _o, IconGoogleDrive as $o, IconHand as on, IconHeadCircuit as nn, IconHouse as rn, IconIcon as en, IconInfo as cn, IconJoin as tn, IconLanguage as In, IconLink as an, IconList as pn, IconLock as ln, IconLockOpen as fn, IconMariaDB as mn, IconMinus as xn, IconMongoDB as sn, IconMoon as un, IconMySQL as Cn, IconNavigationArrow as dn, IconNotePencil as hn, IconPassword as wn, IconPen as Tn, IconPlay as gn, IconPlugsX as kn, IconPlus as Sn, IconPorsgteSQL as An, IconPresentationChart as Dn, IconQuestion as Ln, IconQuestionFullfilled as Pn, IconRedo as yn, IconRoleX as Bn, IconSearch as Un, IconSearchX as Fn, IconSelection as Mn, IconServer as Rn, IconSlidersHorizontal as vn, IconSticker as Xn, IconSun as bn, IconThreeDot as Hn, IconTrash as Gn, IconTriangleDown as Nn, IconTriangleUp as On, IconUndo as Qn, IconUploadSimple as En, IconUser as Wn, IconUserX as Vn, IconWarningCircle as zn, IconWrench as Jn, IconX as Yn, IconYandexDisk as jn } from "./components/Ui/Icons/Icons.js";
|
31
|
+
import { ToastProvider as Kn, useToast as Zn } from "./context/ToastContext/ToastContext.js";
|
32
|
+
import { TriaflyContext as $n, TriaflyProvider as or, useTriafly as nr } from "./context/TriaflyContext/TriaflyProvider.js";
|
33
|
+
import { useBreakpointValueTriafly as er } from "./context/TriaflyContext/hooks/useBreakpointValue/useBreakpointValue.js";
|
34
|
+
import { useThemeLogic as tr } from "./context/TriaflyContext/hooks/useTheme/useTheme.js";
|
35
|
+
import { useModalState as ar } from "./context/TriaflyContext/hooks/useModal/useModal.js";
|
36
36
|
export {
|
37
37
|
e as Accordeon,
|
38
38
|
t as Alert,
|
39
|
-
|
39
|
+
a as Avatar,
|
40
40
|
f as Badge,
|
41
41
|
d as Button,
|
42
42
|
w as ButtonsArray,
|
43
|
-
|
44
|
-
|
43
|
+
g as Checkbox,
|
44
|
+
S as CliTextareaInput,
|
45
45
|
D as CustomLink,
|
46
46
|
x as DatePicker,
|
47
47
|
u as DateRangePicker,
|
@@ -51,8 +51,8 @@ export {
|
|
51
51
|
R as Form,
|
52
52
|
to as IconArrowBendUpRight,
|
53
53
|
Io as IconArrowClockwise,
|
54
|
-
|
55
|
-
|
54
|
+
ao as IconArrowDown,
|
55
|
+
io as IconArrowLeft,
|
56
56
|
po as IconArrowLineDown,
|
57
57
|
lo as IconArrowLineLeft,
|
58
58
|
fo as IconArrowLineRight,
|
@@ -63,10 +63,10 @@ export {
|
|
63
63
|
Co as IconArticle,
|
64
64
|
ho as IconAt,
|
65
65
|
wo as IconBellSimple,
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
66
|
+
To as IconBookOpenText,
|
67
|
+
go as IconCalendarBlank,
|
68
|
+
ko as IconCaretDown,
|
69
|
+
So as IconCaretLeft,
|
70
70
|
Ao as IconCaretRight,
|
71
71
|
Do as IconCaretUp,
|
72
72
|
Lo as IconCaretUpDown,
|
@@ -116,10 +116,10 @@ export {
|
|
116
116
|
dn as IconNavigationArrow,
|
117
117
|
hn as IconNotePencil,
|
118
118
|
wn as IconPassword,
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
119
|
+
Tn as IconPen,
|
120
|
+
gn as IconPlay,
|
121
|
+
kn as IconPlugsX,
|
122
|
+
Sn as IconPlus,
|
123
123
|
An as IconPorsgteSQL,
|
124
124
|
Dn as IconPresentationChart,
|
125
125
|
Ln as IconQuestion,
|
@@ -158,11 +158,12 @@ export {
|
|
158
158
|
$ as TextareaInput,
|
159
159
|
Kn as ToastProvider,
|
160
160
|
no as Tooltip,
|
161
|
-
|
162
|
-
|
163
|
-
|
161
|
+
$n as TriaflyContext,
|
162
|
+
or as TriaflyProvider,
|
163
|
+
er as useBreakpointValueTriafly,
|
164
164
|
X as useForm,
|
165
|
-
|
166
|
-
|
167
|
-
|
165
|
+
ar as useModalState,
|
166
|
+
tr as useThemeLogic,
|
167
|
+
Zn as useToast,
|
168
|
+
nr as useTriafly
|
168
169
|
};
|