@alphakits/ui 2.4.4 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/component.js +32 -31
- package/dist/confirm-popup/component.js +71 -52
- package/dist/confirm-popup/index.css +1 -1
- package/dist/confirm-popup/index.module.css.js +14 -8
- package/dist/form/templates/rest-form/form.d.ts +1 -1
- package/dist/form/templates/rest-form/form.js +65 -66
- package/dist/form/templates/rest-form/index.d.ts +1 -0
- package/dist/index.js +45 -44
- package/dist/modal/components/modals/modal.js +19 -12
- package/dist/modal/hooks/use-modal.js +11 -11
- package/dist/modal/types.d.ts +2 -1
- package/dist/select/components/base-select/component.js +73 -73
- package/dist/select/utils.js +23 -23
- package/dist/toast-plate/component.js +47 -46
- package/dist/toast-plate/index.css +1 -1
- package/dist/toast-plate/index.module.css.js +26 -24
- package/dist/utils/index.js +26 -25
- package/dist/utils/show-toast/index.d.ts +1 -0
- package/dist/utils/show-toast/index.js +17 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as P, jsx as
|
|
1
|
+
import { jsxs as P, jsx as M } from "react/jsx-runtime";
|
|
2
2
|
import se from "classnames";
|
|
3
3
|
import { forwardRef as ae, useState as S, useMemo as o, useCallback as a } from "react";
|
|
4
4
|
import { startOfMonth as D, isSameDay as le } from "../utils/date/index.js";
|
|
@@ -14,48 +14,48 @@ const me = ce, Pe = ae(
|
|
|
14
14
|
className: b,
|
|
15
15
|
defaultView: Y = "days",
|
|
16
16
|
value: n,
|
|
17
|
-
month:
|
|
17
|
+
month: d,
|
|
18
18
|
defaultMonth: p = Date.now(),
|
|
19
|
-
minDate:
|
|
20
|
-
maxDate:
|
|
19
|
+
minDate: h,
|
|
20
|
+
maxDate: f,
|
|
21
21
|
selectedFrom: l,
|
|
22
22
|
selectedTo: V,
|
|
23
23
|
offDays: j,
|
|
24
24
|
events: R,
|
|
25
|
-
onChange:
|
|
25
|
+
onChange: w,
|
|
26
26
|
onMonthChange: B,
|
|
27
27
|
onYearChange: E,
|
|
28
28
|
locale: H = "en",
|
|
29
29
|
shortNames: L = !0,
|
|
30
30
|
dataTestId: O
|
|
31
31
|
}, T) => {
|
|
32
|
-
const [e,
|
|
32
|
+
const [e, c] = S(Y), [U, W] = S(!1), m = me[H], r = o(() => n ? new Date(n) : void 0, [n]), q = o(
|
|
33
33
|
() => D(
|
|
34
34
|
r ?? (l != null ? new Date(l) : new Date(p))
|
|
35
35
|
),
|
|
36
36
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
37
|
[p, l, r]
|
|
38
38
|
), z = o(
|
|
39
|
-
() => i ? new Date(i) : void 0,
|
|
40
|
-
[i]
|
|
41
|
-
), G = o(
|
|
42
39
|
() => d ? new Date(d) : void 0,
|
|
43
40
|
[d]
|
|
44
|
-
),
|
|
41
|
+
), G = o(
|
|
45
42
|
() => h ? new Date(h) : void 0,
|
|
46
43
|
[h]
|
|
44
|
+
), I = o(
|
|
45
|
+
() => f ? new Date(f) : void 0,
|
|
46
|
+
[f]
|
|
47
47
|
), {
|
|
48
|
-
activeMonth:
|
|
48
|
+
activeMonth: i,
|
|
49
49
|
activeYear: J,
|
|
50
50
|
weeks: k,
|
|
51
51
|
months: K,
|
|
52
52
|
canSetPrevMonth: Q,
|
|
53
53
|
canSetNextMonth: X,
|
|
54
|
-
setMonthByDate:
|
|
54
|
+
setMonthByDate: y,
|
|
55
55
|
setPrevMonth: v,
|
|
56
56
|
setNextMonth: x,
|
|
57
|
-
setNextYear:
|
|
58
|
-
setPrevYear:
|
|
57
|
+
setNextYear: u,
|
|
58
|
+
setPrevYear: C,
|
|
59
59
|
highlighted: Z,
|
|
60
60
|
getDayProps: _,
|
|
61
61
|
getMonthProps: $,
|
|
@@ -69,13 +69,13 @@ const me = ce, Pe = ae(
|
|
|
69
69
|
selected: r,
|
|
70
70
|
offDays: j,
|
|
71
71
|
events: R,
|
|
72
|
-
onChange:
|
|
72
|
+
onChange: w,
|
|
73
73
|
onMonthChange: B,
|
|
74
74
|
onYearChange: E,
|
|
75
|
-
setView:
|
|
75
|
+
setView: c
|
|
76
76
|
}), N = a(
|
|
77
77
|
(t) => {
|
|
78
|
-
|
|
78
|
+
c(e === t ? "days" : t);
|
|
79
79
|
},
|
|
80
80
|
[e]
|
|
81
81
|
), s = o(() => {
|
|
@@ -85,19 +85,20 @@ const me = ce, Pe = ae(
|
|
|
85
85
|
() => !r || !le(r, s),
|
|
86
86
|
[r, s]
|
|
87
87
|
), te = a(() => {
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
e === "days" ? v() :
|
|
91
|
-
}, [v, e,
|
|
92
|
-
e === "days" ? x() :
|
|
93
|
-
}, [x, e,
|
|
88
|
+
c("days"), y(D(s)), w?.(s.getTime());
|
|
89
|
+
}, [w, y, s]), oe = a(() => {
|
|
90
|
+
e === "days" ? v() : C();
|
|
91
|
+
}, [v, e, C]), ne = a(() => {
|
|
92
|
+
e === "days" ? x() : u();
|
|
93
|
+
}, [x, e, u]), re = a(() => {
|
|
94
94
|
N("months");
|
|
95
95
|
}, [N]);
|
|
96
96
|
return A(() => {
|
|
97
97
|
W(!1);
|
|
98
98
|
}, [e]), A(() => {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
if (n == null) return;
|
|
100
|
+
const t = D(new Date(n));
|
|
101
|
+
t.getTime() !== i.getTime() && y(t), e !== "days" && c("days");
|
|
101
102
|
}, [n]), /* @__PURE__ */ P(
|
|
102
103
|
"div",
|
|
103
104
|
{
|
|
@@ -107,10 +108,10 @@ const me = ce, Pe = ae(
|
|
|
107
108
|
}),
|
|
108
109
|
"data-test-id": O,
|
|
109
110
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ M(
|
|
111
112
|
de,
|
|
112
113
|
{
|
|
113
|
-
month: we(
|
|
114
|
+
month: we(i, m, !1),
|
|
114
115
|
onTodayClick: te,
|
|
115
116
|
showToday: ee,
|
|
116
117
|
year: J.getFullYear().toString(),
|
|
@@ -124,22 +125,22 @@ const me = ce, Pe = ae(
|
|
|
124
125
|
}
|
|
125
126
|
),
|
|
126
127
|
/* @__PURE__ */ P("div", { className: g.container, children: [
|
|
127
|
-
e === "days" && /* @__PURE__ */
|
|
128
|
+
e === "days" && /* @__PURE__ */ M(
|
|
128
129
|
ie,
|
|
129
130
|
{
|
|
130
131
|
locale: m,
|
|
131
132
|
weeks: k,
|
|
132
|
-
activeMonth:
|
|
133
|
+
activeMonth: i,
|
|
133
134
|
selectedFrom: l,
|
|
134
135
|
selectedTo: V,
|
|
135
136
|
getDayProps: _,
|
|
136
137
|
highlighted: Z
|
|
137
138
|
}
|
|
138
139
|
),
|
|
139
|
-
e === "months" && /* @__PURE__ */
|
|
140
|
+
e === "months" && /* @__PURE__ */ M(
|
|
140
141
|
he,
|
|
141
142
|
{
|
|
142
|
-
selectedMonth:
|
|
143
|
+
selectedMonth: i,
|
|
143
144
|
selectedLocale: m,
|
|
144
145
|
shortNames: L,
|
|
145
146
|
months: K,
|
|
@@ -1,54 +1,73 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { createRoot as
|
|
5
|
-
import { Button as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
const T = ({
|
|
1
|
+
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as b, useEffect as x } from "react";
|
|
3
|
+
import { createPortal as N } from "react-dom";
|
|
4
|
+
import { createRoot as P } from "react-dom/client";
|
|
5
|
+
import { Button as v } from "../button/component.js";
|
|
6
|
+
import { Typography as y } from "../typography/component.js";
|
|
7
|
+
import n from "./index.module.css.js";
|
|
8
|
+
const g = ({
|
|
10
9
|
title: e,
|
|
11
10
|
description: t,
|
|
12
11
|
confirmText: r,
|
|
13
|
-
cancelText:
|
|
14
|
-
confirmView:
|
|
15
|
-
mode:
|
|
16
|
-
onConfirm:
|
|
12
|
+
cancelText: l,
|
|
13
|
+
confirmView: d = "primary",
|
|
14
|
+
mode: m = "confirm",
|
|
15
|
+
onConfirm: c,
|
|
17
16
|
onCancel: o
|
|
18
17
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
(
|
|
21
|
-
|
|
18
|
+
const s = m === "alert", C = b(
|
|
19
|
+
(a) => {
|
|
20
|
+
a.target === a.currentTarget && o();
|
|
22
21
|
},
|
|
23
22
|
[o]
|
|
24
23
|
);
|
|
25
|
-
return
|
|
26
|
-
const
|
|
27
|
-
|
|
24
|
+
return x(() => {
|
|
25
|
+
const a = (w) => {
|
|
26
|
+
w.key === "Escape" && o(), w.key === "Enter" && (s ? o : c)();
|
|
28
27
|
};
|
|
29
|
-
return window.addEventListener("keydown",
|
|
30
|
-
}, [o,
|
|
31
|
-
/* @__PURE__ */
|
|
28
|
+
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
29
|
+
}, [o, c, s]), N(
|
|
30
|
+
/* @__PURE__ */ i(
|
|
32
31
|
"div",
|
|
33
32
|
{
|
|
34
|
-
className:
|
|
35
|
-
onClick:
|
|
33
|
+
className: n.backdrop,
|
|
34
|
+
onClick: C,
|
|
36
35
|
role: "dialog",
|
|
37
36
|
"aria-modal": "true",
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
!c && /* @__PURE__ */ n(y, { size: "xs", view: "outlined", block: !0, onClick: o, children: i }),
|
|
43
|
-
/* @__PURE__ */ n(
|
|
44
|
-
y,
|
|
37
|
+
children: /* @__PURE__ */ p("div", { className: n.card, children: [
|
|
38
|
+
/* @__PURE__ */ p("div", { className: n.content, children: [
|
|
39
|
+
/* @__PURE__ */ i(
|
|
40
|
+
y.Title,
|
|
45
41
|
{
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
tag: "h3",
|
|
43
|
+
view: "xsmall",
|
|
44
|
+
color: "primary",
|
|
45
|
+
className: n.title,
|
|
46
|
+
children: e
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
t && /* @__PURE__ */ i(
|
|
50
|
+
y.Text,
|
|
51
|
+
{
|
|
52
|
+
tag: "p",
|
|
53
|
+
color: "secondary",
|
|
54
|
+
view: "primary-medium",
|
|
55
|
+
className: n.description,
|
|
56
|
+
children: t
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ p("div", { className: n.actions, children: [
|
|
61
|
+
!s && /* @__PURE__ */ i(v, { size: "s", view: "outlined", block: !0, onClick: o, children: l }),
|
|
62
|
+
/* @__PURE__ */ i(
|
|
63
|
+
v,
|
|
64
|
+
{
|
|
65
|
+
size: "s",
|
|
66
|
+
className: n[d],
|
|
48
67
|
view: "primary",
|
|
49
68
|
block: !0,
|
|
50
|
-
onClick:
|
|
51
|
-
children:
|
|
69
|
+
onClick: s ? o : c,
|
|
70
|
+
children: s ? l : r
|
|
52
71
|
}
|
|
53
72
|
)
|
|
54
73
|
] })
|
|
@@ -58,30 +77,30 @@ const T = ({
|
|
|
58
77
|
document.body
|
|
59
78
|
);
|
|
60
79
|
};
|
|
61
|
-
let
|
|
80
|
+
let u = null, f = null;
|
|
62
81
|
const h = () => {
|
|
63
|
-
|
|
82
|
+
u && (u.unmount(), u = null), f && (f.remove(), f = null);
|
|
64
83
|
}, k = (e, t) => {
|
|
65
84
|
h();
|
|
66
85
|
const r = document.createElement("div");
|
|
67
86
|
r.setAttribute("data-confirm-popup", ""), document.body.appendChild(r);
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
let
|
|
71
|
-
const
|
|
72
|
-
|
|
87
|
+
const l = P(r);
|
|
88
|
+
u = l, f = r;
|
|
89
|
+
let d = !1;
|
|
90
|
+
const m = (c) => () => {
|
|
91
|
+
d || (d = !0, h(), c(), t());
|
|
73
92
|
};
|
|
74
|
-
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
93
|
+
l.render(
|
|
94
|
+
/* @__PURE__ */ i(
|
|
95
|
+
g,
|
|
77
96
|
{
|
|
78
97
|
...e,
|
|
79
|
-
onConfirm:
|
|
80
|
-
onCancel:
|
|
98
|
+
onConfirm: m(e.onConfirm),
|
|
99
|
+
onCancel: m(e.onCancel)
|
|
81
100
|
}
|
|
82
101
|
)
|
|
83
102
|
);
|
|
84
|
-
},
|
|
103
|
+
}, R = (e) => typeof window > "u" ? Promise.resolve(!1) : new Promise((t) => {
|
|
85
104
|
let r = !1;
|
|
86
105
|
k(
|
|
87
106
|
{
|
|
@@ -96,7 +115,7 @@ const h = () => {
|
|
|
96
115
|
},
|
|
97
116
|
() => t(r)
|
|
98
117
|
);
|
|
99
|
-
}),
|
|
118
|
+
}), K = (e) => typeof window > "u" ? Promise.resolve() : new Promise((t) => {
|
|
100
119
|
k(
|
|
101
120
|
{
|
|
102
121
|
title: e.title,
|
|
@@ -113,7 +132,7 @@ const h = () => {
|
|
|
113
132
|
);
|
|
114
133
|
});
|
|
115
134
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
135
|
+
g as ConfirmPopup,
|
|
136
|
+
K as showAlert,
|
|
137
|
+
R as showConfirm
|
|
119
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.backdrop_bTWm{position:fixed;inset:0;z-index:99999990;background:#00000073;display:flex;align-items:center;justify-content:center;padding:16px;animation:backdrop-in_2Gfp .15s ease-out}.card_QdKQ{background:var(--color-bg-primary);border-radius:
|
|
1
|
+
.backdrop_bTWm{position:fixed;inset:0;z-index:99999990;background:#00000073;display:flex;align-items:center;justify-content:center;padding:16px;animation:backdrop-in_2Gfp .15s ease-out}.card_QdKQ{background:var(--color-bg-primary);border-radius:16px;box-shadow:0 16px 48px #00000047;width:100%;max-width:380px;padding:24px;display:flex;flex-direction:column;gap:20px;animation:card-in_kaZX .18s ease-out}.content_qypP{display:flex;flex-direction:column;gap:6px}.title_Ax6t,.description_pjZB{margin:0}.actions_MbU4{display:flex;gap:8px}.actions_MbU4>*{flex:1 1 0;min-width:0}.negative_htRp{background:var(--color-bg-negative);border:1px solid var(--color-border-secondary)}@keyframes backdrop-in_2Gfp{0%{opacity:0}to{opacity:1}}@keyframes card-in_kaZX{0%{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import * as __css from './index.css';
|
|
2
2
|
export const __cssModule = __css;
|
|
3
|
-
const
|
|
4
|
-
backdrop:
|
|
3
|
+
const t = "backdrop_bTWm", c = "card_QdKQ", n = "content_qypP", o = "title_Ax6t", a = "description_pjZB", i = "actions_MbU4", e = "negative_htRp", s = {
|
|
4
|
+
backdrop: t,
|
|
5
5
|
"backdrop-in": "backdrop-in_2Gfp",
|
|
6
6
|
card: c,
|
|
7
7
|
"card-in": "card-in_kaZX",
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
content: n,
|
|
9
|
+
title: o,
|
|
10
|
+
description: a,
|
|
11
|
+
actions: i,
|
|
12
|
+
negative: e
|
|
10
13
|
};
|
|
11
14
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
i as actions,
|
|
16
|
+
t as backdrop,
|
|
14
17
|
c as card,
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
n as content,
|
|
19
|
+
s as default,
|
|
20
|
+
a as description,
|
|
21
|
+
e as negative,
|
|
22
|
+
o as title
|
|
17
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormikProps, FormikValues } from 'formik';
|
|
2
2
|
import { Props } from '.';
|
|
3
3
|
type FormProps<T extends FormikValues> = Props<T> & FormikProps<T>;
|
|
4
|
-
export declare function Form<T extends FormikValues>({ recordId, title, subtitle, headerBottomAddons, initialValues, submitButtonText, customFooter, loading, updating, removing, customValidationFields, validate, save, remove, close, back, t, children, headerAddon, error, softError, ...formProps }: FormProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function Form<T extends FormikValues>({ recordId, title, subtitle, headerBottomAddons, initialValues, submitButtonText, customFooter, loading, updating, removing, customValidationFields, validate, save, remove, close, back, t, children, headerAddon, error, softError, modalId, ...formProps }: FormProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import A from "@alphakits/icons/dist/TrashM";
|
|
3
|
-
import D, { useContext as H,
|
|
4
|
-
import { Button as
|
|
5
|
-
import { showConfirm as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { FlexColumns as
|
|
8
|
-
import { IconButton as
|
|
9
|
-
import { ModalContext as
|
|
10
|
-
import { Sidepanel as
|
|
11
|
-
import { ToastPlate as
|
|
12
|
-
function
|
|
13
|
-
recordId:
|
|
14
|
-
title:
|
|
15
|
-
subtitle:
|
|
16
|
-
headerBottomAddons:
|
|
3
|
+
import D, { useContext as H, useCallback as C, useEffect as q } from "react";
|
|
4
|
+
import { Button as k } from "../../../button/component.js";
|
|
5
|
+
import { showConfirm as G } from "../../../confirm-popup/component.js";
|
|
6
|
+
import { Flex as J } from "../../../flex/component.js";
|
|
7
|
+
import { FlexColumns as K } from "../../../flex-columns/component.js";
|
|
8
|
+
import { IconButton as L } from "../../../icon-button/component.js";
|
|
9
|
+
import { ModalContext as N } from "../../../modal/context.js";
|
|
10
|
+
import { Sidepanel as O } from "../../../sidepanel/component.js";
|
|
11
|
+
import { ToastPlate as x } from "../../../toast-plate/component.js";
|
|
12
|
+
function ce({
|
|
13
|
+
recordId: w,
|
|
14
|
+
title: T,
|
|
15
|
+
subtitle: F,
|
|
16
|
+
headerBottomAddons: u,
|
|
17
17
|
initialValues: y,
|
|
18
|
-
submitButtonText:
|
|
19
|
-
customFooter:
|
|
20
|
-
loading:
|
|
18
|
+
submitButtonText: I,
|
|
19
|
+
customFooter: M,
|
|
20
|
+
loading: r,
|
|
21
21
|
updating: i,
|
|
22
22
|
removing: m,
|
|
23
|
-
customValidationFields:
|
|
24
|
-
validate:
|
|
25
|
-
save:
|
|
23
|
+
customValidationFields: Q,
|
|
24
|
+
validate: U,
|
|
25
|
+
save: W,
|
|
26
26
|
remove: c,
|
|
27
|
-
close:
|
|
28
|
-
back:
|
|
27
|
+
close: R,
|
|
28
|
+
back: B,
|
|
29
29
|
t: e,
|
|
30
|
-
children:
|
|
31
|
-
headerAddon:
|
|
32
|
-
error:
|
|
30
|
+
children: S,
|
|
31
|
+
headerAddon: h,
|
|
32
|
+
error: X,
|
|
33
33
|
softError: s,
|
|
34
|
-
|
|
34
|
+
modalId: g,
|
|
35
|
+
...z
|
|
35
36
|
}) {
|
|
36
|
-
const { setModalDirty: o, currentModalId:
|
|
37
|
-
!l.current && a && (l.current = a);
|
|
38
|
-
const t = l.current || a, { submitCount: d, handleSubmit: v, isValid: f, ...u } = P, C = !!F && !!c, k = x(
|
|
37
|
+
const { setModalDirty: o, currentModalId: P } = H(N), t = g || P, { submitCount: a, handleSubmit: p, isValid: l, ...d } = z, b = !!w && !!c, v = C(
|
|
39
38
|
() => {
|
|
40
|
-
o(t, !1),
|
|
39
|
+
o(t, !1), p();
|
|
41
40
|
},
|
|
42
41
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
|
-
[t, o,
|
|
44
|
-
), V =
|
|
45
|
-
o(t, !1), await
|
|
42
|
+
[t, o, p]
|
|
43
|
+
), V = C(async () => {
|
|
44
|
+
o(t, !1), await G({
|
|
46
45
|
title: e("common:deleteConfirm"),
|
|
47
46
|
confirmText: e("common:remove"),
|
|
48
47
|
cancelText: e("common:cancel"),
|
|
49
48
|
confirmView: "negative"
|
|
50
49
|
}) && c?.();
|
|
51
50
|
}, [t, e, o, c]);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
const j =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
q(() => {
|
|
52
|
+
r || o(t, d.dirty);
|
|
53
|
+
}, [d.dirty, r, t, o]);
|
|
54
|
+
const j = b || h ? /* @__PURE__ */ f(D.Fragment, { children: [
|
|
55
|
+
h,
|
|
56
|
+
b && /* @__PURE__ */ n(
|
|
57
|
+
L,
|
|
59
58
|
{
|
|
60
59
|
dataTestId: "removeTariffBtn",
|
|
61
60
|
size: "m",
|
|
@@ -66,56 +65,56 @@ function se({
|
|
|
66
65
|
}
|
|
67
66
|
)
|
|
68
67
|
] }) : null;
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
|
|
68
|
+
return /* @__PURE__ */ n(
|
|
69
|
+
O,
|
|
71
70
|
{
|
|
72
71
|
headerRightAddons: j,
|
|
73
|
-
title:
|
|
74
|
-
subtitle:
|
|
75
|
-
loading: i || m ||
|
|
76
|
-
headerBottomAddons: (
|
|
77
|
-
|
|
78
|
-
!!s && /* @__PURE__ */
|
|
79
|
-
!
|
|
72
|
+
title: T,
|
|
73
|
+
subtitle: F,
|
|
74
|
+
loading: i || m || r,
|
|
75
|
+
headerBottomAddons: (u || !!s || !l && !!a) && /* @__PURE__ */ f(K, { columns: 1, gr: 8, children: [
|
|
76
|
+
u,
|
|
77
|
+
!!s && /* @__PURE__ */ n(x, { view: "negative", children: s }),
|
|
78
|
+
!l && !!a && /* @__PURE__ */ n(x, { view: "negative", children: "Please correct errors before submitting form." })
|
|
80
79
|
] }),
|
|
81
|
-
back:
|
|
80
|
+
back: B,
|
|
82
81
|
t: e,
|
|
83
|
-
bottomAddons:
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
82
|
+
bottomAddons: M || /* @__PURE__ */ f(J, { gap: "md", children: [
|
|
83
|
+
/* @__PURE__ */ n(
|
|
84
|
+
k,
|
|
86
85
|
{
|
|
87
86
|
view: "primary",
|
|
88
87
|
size: "s",
|
|
89
88
|
block: !0,
|
|
90
|
-
loading:
|
|
89
|
+
loading: r,
|
|
91
90
|
disabled: i || m,
|
|
92
91
|
dataTestId: "buttonSave",
|
|
93
|
-
onClick: () =>
|
|
94
|
-
children: e(
|
|
92
|
+
onClick: () => v(),
|
|
93
|
+
children: e(I || "common:save")
|
|
95
94
|
}
|
|
96
95
|
),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
96
|
+
/* @__PURE__ */ n(
|
|
97
|
+
k,
|
|
99
98
|
{
|
|
100
99
|
block: !0,
|
|
101
100
|
view: "secondary",
|
|
102
101
|
size: "s",
|
|
103
102
|
dataTestId: "buttonCancel",
|
|
104
|
-
onClick:
|
|
103
|
+
onClick: R,
|
|
105
104
|
children: e("common:cancel")
|
|
106
105
|
}
|
|
107
106
|
)
|
|
108
107
|
] }),
|
|
109
|
-
children:
|
|
110
|
-
submitCount:
|
|
111
|
-
isValid:
|
|
112
|
-
handleSubmit:
|
|
108
|
+
children: S({
|
|
109
|
+
submitCount: a,
|
|
110
|
+
isValid: l,
|
|
111
|
+
handleSubmit: v,
|
|
113
112
|
initialValues: y,
|
|
114
|
-
...
|
|
113
|
+
...d
|
|
115
114
|
})
|
|
116
115
|
}
|
|
117
116
|
);
|
|
118
117
|
}
|
|
119
118
|
export {
|
|
120
|
-
|
|
119
|
+
ce as Form
|
|
121
120
|
};
|