@epam/ai-dial-builder-form 1.1.0-dev.472 → 1.1.0-dev.474
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.
|
@@ -6,7 +6,7 @@ export interface DeploymentLocalesFieldProps {
|
|
|
6
6
|
value: DeploymentCreationFormLocaleEntry[];
|
|
7
7
|
/** Called with the full updated list when the user saves changes in the popup. */
|
|
8
8
|
onChange: (entries: DeploymentCreationFormLocaleEntry[]) => void;
|
|
9
|
-
/** Selectable language options for new/existing rows. Defaults to an empty list
|
|
9
|
+
/** Selectable language options for new/existing rows. Defaults to an empty list, in which case the whole control renders nothing. */
|
|
10
10
|
availableLocaleOptions?: DeploymentCreationFormLocaleOption[];
|
|
11
11
|
/** Pre-translated labels for the summary row and popup. */
|
|
12
12
|
labels: DeploymentCreationFormLocaleLabels;
|
|
@@ -16,9 +16,7 @@ export interface DeploymentLocalesFieldProps {
|
|
|
16
16
|
summaryClassName?: string;
|
|
17
17
|
/** Typography and color class applied to each row's heading. Defaults to `'dial-tiny-lead-text text-secondary'`, which uppercases the label itself. */
|
|
18
18
|
rowLabelClassName?: string;
|
|
19
|
-
/** Color class applied to the required-field asterisk on the per-locale name field. Defaults to `'text-error'`. */
|
|
20
|
-
requiredMarkClassName?: string;
|
|
21
19
|
}
|
|
22
|
-
/** Summary row ("Locales: [DE] Edit locales") plus the "Add locale" popup for editing additional name/description translations. Shows "Add locales" instead of "Edit locales" until at least one entry exists. */
|
|
20
|
+
/** Summary row ("Locales: [DE] Edit locales") plus the "Add locale" popup for editing additional name/description translations. Shows "Add locales" instead of "Edit locales" until at least one entry exists, and renders nothing at all when `availableLocaleOptions` is empty. */
|
|
23
21
|
export declare const DeploymentLocalesField: FC<DeploymentLocalesFieldProps>;
|
|
24
22
|
//# sourceMappingURL=DeploymentLocalesField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeploymentLocalesField.d.ts","sourceRoot":"","sources":["../../../src/components/DeploymentLocalesField/DeploymentLocalesField.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAA+B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EACnC,MAAM,uCAAuC,CAAC;AAE/C,gEAAgE;AAChE,MAAM,WAAW,2BAA2B;IAC1C,+DAA+D;IAC/D,KAAK,EAAE,iCAAiC,EAAE,CAAC;IAC3C,kFAAkF;IAClF,QAAQ,EAAE,CAAC,OAAO,EAAE,iCAAiC,EAAE,KAAK,IAAI,CAAC;IACjE,
|
|
1
|
+
{"version":3,"file":"DeploymentLocalesField.d.ts","sourceRoot":"","sources":["../../../src/components/DeploymentLocalesField/DeploymentLocalesField.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAA+B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EACnC,MAAM,uCAAuC,CAAC;AAE/C,gEAAgE;AAChE,MAAM,WAAW,2BAA2B;IAC1C,+DAA+D;IAC/D,KAAK,EAAE,iCAAiC,EAAE,CAAC;IAC3C,kFAAkF;IAClF,QAAQ,EAAE,CAAC,OAAO,EAAE,iCAAiC,EAAE,KAAK,IAAI,CAAC;IACjE,qIAAqI;IACrI,sBAAsB,CAAC,EAAE,kCAAkC,EAAE,CAAC;IAC9D,2DAA2D;IAC3D,MAAM,EAAE,kCAAkC,CAAC;IAC3C,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6GAA6G;IAC7G,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uJAAuJ;IACvJ,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAeD,sRAAsR;AACtR,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CA0OlE,CAAC"}
|
package/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { RESIZABLE_TEXTAREA_CLASS_NAME as e, TAG_INPUT_TAG_CLASS_NAME as t, buil
|
|
|
2
2
|
import { ButtonAppearance as i, ButtonVariant as a, DIAL_ICON_SIZE as o, DIAL_KIT_ICON_STROKE as s, DangerIconButton as c, ElementSize as l, GhostIconButton as u, Input as d, Label as f, LinkButton as p, NeutralButton as m, Popup as h, PrimaryButton as g, Select as _, Spinner as v, TagInput as y, Textarea as b, TextareaResize as x } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
4
4
|
import { IconArrowLeft as T, IconArrowNarrowLeft as E, IconPhoto as D, IconPlus as O, IconTrashX as ee } from "@tabler/icons-react";
|
|
5
|
-
import { Suspense as
|
|
5
|
+
import { Suspense as k, useCallback as A, useEffect as j, useId as M, useRef as N, useState as P } from "react";
|
|
6
6
|
//#region src/components/BuilderFormActions/BuilderFormActions.tsx
|
|
7
|
-
var
|
|
7
|
+
var F = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubmitDisabled: i = !1, isSubmitting: a = !1, buttonClassName: s }) => /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(m, {
|
|
8
8
|
label: e.cancelButtonLabel,
|
|
9
9
|
onClick: t,
|
|
10
10
|
disabled: r,
|
|
@@ -19,11 +19,11 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
19
19
|
"aria-hidden": !0,
|
|
20
20
|
children: /* @__PURE__ */ C(v, { size: o.SM })
|
|
21
21
|
}) : void 0
|
|
22
|
-
})] }),
|
|
22
|
+
})] }), I = "flex w-full flex-col desktop:w-[360px] desktop:shrink-0", L = ({ left: e, children: t, metadata: n }) => /* @__PURE__ */ w("div", {
|
|
23
23
|
className: "flex flex-1 flex-col desktop:flex-row",
|
|
24
24
|
children: [
|
|
25
25
|
e != null && /* @__PURE__ */ C("div", {
|
|
26
|
-
className:
|
|
26
|
+
className: I,
|
|
27
27
|
children: e
|
|
28
28
|
}),
|
|
29
29
|
/* @__PURE__ */ C("div", {
|
|
@@ -31,7 +31,7 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
31
31
|
children: t
|
|
32
32
|
}),
|
|
33
33
|
n != null && /* @__PURE__ */ C("div", {
|
|
34
|
-
className:
|
|
34
|
+
className: I,
|
|
35
35
|
children: n
|
|
36
36
|
}),
|
|
37
37
|
e != null && n == null && /* @__PURE__ */ C("div", {
|
|
@@ -39,17 +39,17 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
39
39
|
className: "hidden desktop:block desktop:w-[360px] desktop:shrink-0"
|
|
40
40
|
})
|
|
41
41
|
]
|
|
42
|
-
}),
|
|
42
|
+
}), R = {
|
|
43
43
|
header: "_header_8b0ws_4",
|
|
44
44
|
title: "_title_8b0ws_8"
|
|
45
|
-
},
|
|
45
|
+
}, z = ({ labels: e, onBack: t, onCancel: i, onSubmit: a, isCancelDisabled: c = !1, isSubmitDisabled: l = !1, isSubmitting: d = !1, styles: f }) => {
|
|
46
46
|
let { colors: p, typography: m } = f ?? {}, h = m?.fontClassName ?? "dial-h1-text", g = !!m?.fontClassName;
|
|
47
47
|
return /* @__PURE__ */ w("div", {
|
|
48
48
|
style: n({
|
|
49
49
|
"--bfh-border": p?.borderColor,
|
|
50
50
|
"--bfh-font-family": g ? void 0 : m?.fontFamily
|
|
51
51
|
}),
|
|
52
|
-
className: r("flex h-16 items-center justify-between gap-6 border-t px-4 desktop:border-b desktop:border-t-0 desktop:px-8",
|
|
52
|
+
className: r("flex h-16 items-center justify-between gap-6 border-t px-4 desktop:border-b desktop:border-t-0 desktop:px-8", R.header),
|
|
53
53
|
children: [
|
|
54
54
|
/* @__PURE__ */ w("div", {
|
|
55
55
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
@@ -63,13 +63,13 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
63
63
|
"aria-label": e.backButtonLabel,
|
|
64
64
|
onClick: t
|
|
65
65
|
}), /* @__PURE__ */ C("h1", {
|
|
66
|
-
className: r("truncate",
|
|
66
|
+
className: r("truncate", R.title, h),
|
|
67
67
|
children: e.title
|
|
68
68
|
})]
|
|
69
69
|
}),
|
|
70
70
|
/* @__PURE__ */ C("div", {
|
|
71
71
|
className: "hidden items-center gap-2 desktop:flex",
|
|
72
|
-
children: /* @__PURE__ */ C(
|
|
72
|
+
children: /* @__PURE__ */ C(F, {
|
|
73
73
|
labels: e,
|
|
74
74
|
onCancel: i,
|
|
75
75
|
onSubmit: a,
|
|
@@ -86,19 +86,19 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
86
86
|
})
|
|
87
87
|
]
|
|
88
88
|
});
|
|
89
|
-
},
|
|
89
|
+
}, B = {
|
|
90
90
|
container: "_container_d8tdv_1",
|
|
91
91
|
footer: "_footer_d8tdv_10"
|
|
92
|
-
},
|
|
92
|
+
}, V = ({ labels: e, onBack: t, onCancel: i, onSubmit: a, isCancelDisabled: o = !1, isSubmitDisabled: s = !1, isSubmitting: c = !1, left: l, children: u, metadata: d, styles: f }) => {
|
|
93
93
|
let { colors: p, header: m, cssVars: h } = f ?? {};
|
|
94
94
|
return /* @__PURE__ */ w("div", {
|
|
95
95
|
style: {
|
|
96
96
|
...n({ "--bfc-bg": p?.background }),
|
|
97
97
|
...h
|
|
98
98
|
},
|
|
99
|
-
className: r("flex h-full w-full flex-col overflow-y-auto",
|
|
99
|
+
className: r("flex h-full w-full flex-col overflow-y-auto", B.container),
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */ C(
|
|
101
|
+
/* @__PURE__ */ C(z, {
|
|
102
102
|
labels: e,
|
|
103
103
|
onBack: t,
|
|
104
104
|
onCancel: i,
|
|
@@ -108,14 +108,14 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
108
108
|
isSubmitting: c,
|
|
109
109
|
styles: m
|
|
110
110
|
}),
|
|
111
|
-
/* @__PURE__ */ C(
|
|
111
|
+
/* @__PURE__ */ C(L, {
|
|
112
112
|
left: l,
|
|
113
113
|
metadata: d,
|
|
114
114
|
children: u
|
|
115
115
|
}),
|
|
116
116
|
/* @__PURE__ */ C("div", {
|
|
117
|
-
className: r("sticky bottom-0 z-10 flex items-center gap-2 p-3 desktop:hidden",
|
|
118
|
-
children: /* @__PURE__ */ C(
|
|
117
|
+
className: r("sticky bottom-0 z-10 flex items-center gap-2 p-3 desktop:hidden", B.footer),
|
|
118
|
+
children: /* @__PURE__ */ C(F, {
|
|
119
119
|
labels: e,
|
|
120
120
|
onCancel: i,
|
|
121
121
|
onSubmit: a,
|
|
@@ -127,28 +127,28 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
127
127
|
})
|
|
128
128
|
]
|
|
129
129
|
});
|
|
130
|
-
},
|
|
130
|
+
}, H = {
|
|
131
131
|
section: "_section_l1mnx_1",
|
|
132
132
|
title: "_title_l1mnx_5"
|
|
133
|
-
},
|
|
133
|
+
}, U = ({ title: e, children: t, styles: i, className: a }) => {
|
|
134
134
|
let o = n({
|
|
135
135
|
"--es-border-color": i?.colors?.borderColor,
|
|
136
136
|
"--es-title-color": i?.colors?.titleColor
|
|
137
137
|
});
|
|
138
138
|
return /* @__PURE__ */ w("section", {
|
|
139
|
-
className: r("flex flex-col gap-4 rounded border p-6",
|
|
139
|
+
className: r("flex flex-col gap-4 rounded border p-6", H.section, a),
|
|
140
140
|
style: o,
|
|
141
141
|
children: [e != null && /* @__PURE__ */ C("h2", {
|
|
142
|
-
className: r("dial-h3-text",
|
|
142
|
+
className: r("dial-h3-text", H.title),
|
|
143
143
|
children: e
|
|
144
144
|
}), t]
|
|
145
145
|
});
|
|
146
|
-
},
|
|
146
|
+
}, W = {
|
|
147
147
|
headerBorder: "_headerBorder_1kidu_1",
|
|
148
148
|
footerBorder: "_footerBorder_1kidu_5",
|
|
149
149
|
sidebarBorder: "_sidebarBorder_1kidu_9"
|
|
150
|
-
},
|
|
151
|
-
let h =
|
|
150
|
+
}, G = ({ title: e, onBack: t, backAriaLabel: i = "Back", actions: a, leftContent: c, rightContent: l, isSaving: d = !1, labels: f, styles: p, dir: m }) => {
|
|
151
|
+
let h = M(), g = d ? f?.savingStatusLabel ?? "Saving" : "";
|
|
152
152
|
return /* @__PURE__ */ w("div", {
|
|
153
153
|
dir: m,
|
|
154
154
|
className: "flex min-h-0 flex-1 flex-col",
|
|
@@ -165,7 +165,7 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
165
165
|
children: g
|
|
166
166
|
}),
|
|
167
167
|
/* @__PURE__ */ w("div", {
|
|
168
|
-
className: r("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3",
|
|
168
|
+
className: r("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", W.headerBorder),
|
|
169
169
|
children: [/* @__PURE__ */ w("div", {
|
|
170
170
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
171
171
|
children: [/* @__PURE__ */ C(u, {
|
|
@@ -189,7 +189,7 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
189
189
|
/* @__PURE__ */ w("div", {
|
|
190
190
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
191
191
|
children: [/* @__PURE__ */ C("div", {
|
|
192
|
-
className: r(l == null ? "desktop:flex-1" : "desktop:w-[360px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", l == null ? void 0 :
|
|
192
|
+
className: r(l == null ? "desktop:flex-1" : "desktop:w-[360px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", l == null ? void 0 : W.sidebarBorder),
|
|
193
193
|
children: c
|
|
194
194
|
}), l != null && /* @__PURE__ */ C("div", {
|
|
195
195
|
className: "desktop:flex-1 desktop:overflow-y-auto",
|
|
@@ -197,16 +197,16 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
197
197
|
})]
|
|
198
198
|
}),
|
|
199
199
|
a != null && /* @__PURE__ */ C("div", {
|
|
200
|
-
className: r("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1",
|
|
200
|
+
className: r("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", W.footerBorder),
|
|
201
201
|
children: a
|
|
202
202
|
})
|
|
203
203
|
]
|
|
204
204
|
});
|
|
205
|
-
},
|
|
205
|
+
}, K = {
|
|
206
206
|
box: "_box_c9as8_1",
|
|
207
207
|
icon: "_icon_c9as8_6",
|
|
208
208
|
caption: "_caption_c9as8_10"
|
|
209
|
-
},
|
|
209
|
+
}, q = ({ label: e, avatarUrl: t, avatarAlt: i = "", addAvatarLabel: a = "Add avatar", captionText: c = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: u, styles: d, className: m }) => {
|
|
210
210
|
let h = n({
|
|
211
211
|
"--aa-box-bg": d?.colors?.boxBackgroundColor,
|
|
212
212
|
"--aa-box-border": d?.colors?.boxBorderColor,
|
|
@@ -219,7 +219,7 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
219
219
|
children: [/* @__PURE__ */ C(f, { label: e }), /* @__PURE__ */ w("div", {
|
|
220
220
|
className: "flex items-start gap-3",
|
|
221
221
|
children: [/* @__PURE__ */ C("div", {
|
|
222
|
-
className: r("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border",
|
|
222
|
+
className: r("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", K.box),
|
|
223
223
|
children: t ? /* @__PURE__ */ C("img", {
|
|
224
224
|
src: t,
|
|
225
225
|
alt: i,
|
|
@@ -228,7 +228,7 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
228
228
|
size: o.LG,
|
|
229
229
|
stroke: s,
|
|
230
230
|
"aria-hidden": !0,
|
|
231
|
-
className:
|
|
231
|
+
className: K.icon
|
|
232
232
|
})
|
|
233
233
|
}), /* @__PURE__ */ w("div", {
|
|
234
234
|
className: "flex flex-col gap-3",
|
|
@@ -243,14 +243,14 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
243
243
|
label: a,
|
|
244
244
|
onClick: u
|
|
245
245
|
}), /* @__PURE__ */ C("span", {
|
|
246
|
-
className: r("dial-tiny-text",
|
|
246
|
+
className: r("dial-tiny-text", K.caption),
|
|
247
247
|
children: c
|
|
248
248
|
})]
|
|
249
249
|
})]
|
|
250
250
|
})]
|
|
251
251
|
});
|
|
252
|
-
},
|
|
253
|
-
let c =
|
|
252
|
+
}, J = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: o, labels: s }) => {
|
|
253
|
+
let c = A((e) => e.length === 1 ? s.deleteConfirmTitleSingle : s.deleteConfirmTitleMultiple, [s.deleteConfirmTitleSingle, s.deleteConfirmTitleMultiple]), l = A((e) => /* @__PURE__ */ C("div", {
|
|
254
254
|
className: "dial-small-text px-6 py-3",
|
|
255
255
|
children: /* @__PURE__ */ C("p", {
|
|
256
256
|
className: "mb-3 text-secondary",
|
|
@@ -283,7 +283,7 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
283
283
|
s.deleteConfirmMultipleText,
|
|
284
284
|
s.deleteConfirmItemsLabel
|
|
285
285
|
]);
|
|
286
|
-
return /* @__PURE__ */ C(
|
|
286
|
+
return /* @__PURE__ */ C(k, {
|
|
287
287
|
fallback: null,
|
|
288
288
|
children: e && /* @__PURE__ */ C(i, {
|
|
289
289
|
isOpen: e,
|
|
@@ -318,67 +318,67 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
318
318
|
cancelLabel: s.cancelLabel
|
|
319
319
|
})
|
|
320
320
|
});
|
|
321
|
-
},
|
|
321
|
+
}, te = (e, t, n) => ({
|
|
322
322
|
id: e,
|
|
323
323
|
language: n.find((e) => !t.has(e.code))?.code ?? "",
|
|
324
324
|
name: "",
|
|
325
325
|
description: ""
|
|
326
|
-
}), Y = ({ value: t, onChange: n, availableLocaleOptions: u = [], labels: f, className: m, summaryClassName: g = "dial-body-text text-secondary", rowLabelClassName: v = "dial-tiny-lead-text text-secondary"
|
|
327
|
-
let { summaryLabel:
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
}), Y = ({ value: t, onChange: n, availableLocaleOptions: u = [], labels: f, className: m, summaryClassName: g = "dial-body-text text-secondary", rowLabelClassName: v = "dial-tiny-lead-text text-secondary" }) => {
|
|
327
|
+
let { summaryLabel: y, addLabel: S, editLabel: T, popupTitle: E, addLocaleLabel: D, localeRowLabel: k = "Locale", languageLabel: A, nameLabel: M, namePlaceholder: F, descriptionLabel: I, descriptionPlaceholder: L, deleteAriaLabel: R, cancelLabel: z = "Cancel", saveLabel: B = "Save" } = f, [V, H] = P(!1), [U, W] = P([]), G = N(0);
|
|
328
|
+
j(() => {
|
|
329
|
+
V && W(t.length > 0 ? t : [te(`locale-row-${++G.current}`, /* @__PURE__ */ new Set(), u)]);
|
|
330
330
|
}, [
|
|
331
|
-
|
|
331
|
+
V,
|
|
332
332
|
t,
|
|
333
333
|
u
|
|
334
334
|
]);
|
|
335
|
-
let
|
|
336
|
-
n(
|
|
337
|
-
},
|
|
338
|
-
let e = new Set(
|
|
339
|
-
|
|
340
|
-
},
|
|
341
|
-
|
|
335
|
+
let K = () => H(!0), q = () => H(!1), J = () => {
|
|
336
|
+
n(U.filter((e) => e.language && e.name)), H(!1);
|
|
337
|
+
}, Y = () => {
|
|
338
|
+
let e = new Set(U.map((e) => e.language).filter(Boolean));
|
|
339
|
+
W((t) => [...t, te(`locale-row-${++G.current}`, e, u)]);
|
|
340
|
+
}, X = (e, t) => {
|
|
341
|
+
W((n) => n.map((n) => n.id === e ? {
|
|
342
342
|
...n,
|
|
343
343
|
...t
|
|
344
344
|
} : n));
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
},
|
|
348
|
-
return /* @__PURE__ */ w("div", {
|
|
345
|
+
}, Z = (e) => {
|
|
346
|
+
W((t) => t.filter((t) => t.id !== e));
|
|
347
|
+
}, Q = (e) => u.find((t) => t.code === e)?.label ?? e.toUpperCase(), $ = U.some((e) => !e.language || !e.name);
|
|
348
|
+
return u.length === 0 ? null : /* @__PURE__ */ w("div", {
|
|
349
349
|
className: r("flex items-center gap-2", m),
|
|
350
350
|
children: [
|
|
351
351
|
t.length > 0 && /* @__PURE__ */ C("span", {
|
|
352
352
|
className: g,
|
|
353
|
-
children: `${
|
|
353
|
+
children: `${y}: ${t.map((e) => `[${Q(e.language)}]`).join(", ")}`
|
|
354
354
|
}),
|
|
355
355
|
/* @__PURE__ */ C(p, {
|
|
356
|
-
label: t.length > 0 ?
|
|
356
|
+
label: t.length > 0 ? T : S,
|
|
357
357
|
iconBefore: /* @__PURE__ */ C(O, {
|
|
358
358
|
size: o.SM,
|
|
359
359
|
"aria-hidden": !0,
|
|
360
360
|
stroke: s
|
|
361
361
|
}),
|
|
362
362
|
className: "!px-0",
|
|
363
|
-
onClick:
|
|
363
|
+
onClick: K
|
|
364
364
|
}),
|
|
365
365
|
/* @__PURE__ */ C(h, {
|
|
366
|
-
open:
|
|
367
|
-
header:
|
|
368
|
-
onClose:
|
|
366
|
+
open: V,
|
|
367
|
+
header: E,
|
|
368
|
+
onClose: q,
|
|
369
369
|
mainButtons: [{
|
|
370
|
-
label:
|
|
371
|
-
onClick:
|
|
370
|
+
label: z,
|
|
371
|
+
onClick: q
|
|
372
372
|
}, {
|
|
373
|
-
label:
|
|
373
|
+
label: B,
|
|
374
374
|
variant: a.Primary,
|
|
375
|
-
disabled:
|
|
376
|
-
onClick:
|
|
375
|
+
disabled: $,
|
|
376
|
+
onClick: J
|
|
377
377
|
}],
|
|
378
378
|
children: /* @__PURE__ */ w("div", {
|
|
379
379
|
className: "flex flex-col gap-8 px-6 py-3",
|
|
380
|
-
children: [
|
|
381
|
-
let r = new Set(
|
|
380
|
+
children: [U.map((t, n) => {
|
|
381
|
+
let r = new Set(U.filter((e) => e.id !== t.id).map((e) => e.language).filter(Boolean));
|
|
382
382
|
return /* @__PURE__ */ w("div", {
|
|
383
383
|
className: "flex flex-col gap-2",
|
|
384
384
|
children: [/* @__PURE__ */ w("div", {
|
|
@@ -386,7 +386,7 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
386
386
|
children: [/* @__PURE__ */ w("span", {
|
|
387
387
|
className: v,
|
|
388
388
|
children: [
|
|
389
|
-
|
|
389
|
+
k,
|
|
390
390
|
" ",
|
|
391
391
|
n + 1
|
|
392
392
|
]
|
|
@@ -398,68 +398,70 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
398
398
|
"aria-hidden": !0,
|
|
399
399
|
stroke: s
|
|
400
400
|
}),
|
|
401
|
-
"aria-label": `${
|
|
402
|
-
onClick: () =>
|
|
401
|
+
"aria-label": `${R} ${n + 1}`,
|
|
402
|
+
onClick: () => Z(t.id)
|
|
403
403
|
})]
|
|
404
404
|
}), /* @__PURE__ */ w("div", {
|
|
405
405
|
role: "group",
|
|
406
|
-
"aria-label": `${
|
|
406
|
+
"aria-label": `${k} ${n + 1}`,
|
|
407
407
|
className: "flex flex-col gap-5",
|
|
408
408
|
children: [/* @__PURE__ */ w("div", {
|
|
409
|
-
className: "flex
|
|
409
|
+
className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
|
|
410
410
|
children: [/* @__PURE__ */ C(_, {
|
|
411
411
|
id: `${t.id}-language`,
|
|
412
|
-
labelProps: {
|
|
413
|
-
|
|
412
|
+
labelProps: {
|
|
413
|
+
label: A,
|
|
414
|
+
required: !0
|
|
415
|
+
},
|
|
416
|
+
className: "desktop:shrink-0 desktop:basis-40",
|
|
414
417
|
options: u.map((e) => ({
|
|
415
418
|
value: e.code,
|
|
416
419
|
label: e.label,
|
|
417
420
|
disabled: r.has(e.code)
|
|
418
421
|
})),
|
|
419
422
|
value: t.language,
|
|
420
|
-
onChange: (e) =>
|
|
423
|
+
onChange: (e) => X(t.id, { language: e })
|
|
421
424
|
}), /* @__PURE__ */ C(d, {
|
|
422
425
|
id: `${t.id}-name`,
|
|
423
426
|
containerClassName: "min-w-0 flex-1",
|
|
424
427
|
required: !0,
|
|
425
428
|
value: t.name,
|
|
426
|
-
onChange: (e) =>
|
|
427
|
-
labelProps: {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
placeholder: I
|
|
429
|
+
onChange: (e) => X(t.id, { name: e ?? "" }),
|
|
430
|
+
labelProps: {
|
|
431
|
+
label: M,
|
|
432
|
+
required: !0
|
|
433
|
+
},
|
|
434
|
+
placeholder: F
|
|
433
435
|
})]
|
|
434
436
|
}), /* @__PURE__ */ C(b, {
|
|
435
437
|
id: `${t.id}-description`,
|
|
436
438
|
className: e,
|
|
437
439
|
resize: x.Vertical,
|
|
438
440
|
value: t.description,
|
|
439
|
-
onChange: (e) =>
|
|
440
|
-
labelProps: { label:
|
|
441
|
-
placeholder:
|
|
441
|
+
onChange: (e) => X(t.id, { description: e }),
|
|
442
|
+
labelProps: { label: I },
|
|
443
|
+
placeholder: L
|
|
442
444
|
})]
|
|
443
445
|
})]
|
|
444
446
|
}, t.id);
|
|
445
447
|
}), /* @__PURE__ */ C(p, {
|
|
446
|
-
label:
|
|
448
|
+
label: D,
|
|
447
449
|
iconBefore: /* @__PURE__ */ C(O, {
|
|
448
450
|
size: o.SM,
|
|
449
451
|
"aria-hidden": !0,
|
|
450
452
|
stroke: s
|
|
451
453
|
}),
|
|
452
454
|
className: "self-start",
|
|
453
|
-
onClick:
|
|
454
|
-
disabled:
|
|
455
|
+
onClick: Y,
|
|
456
|
+
disabled: U.length >= u.length
|
|
455
457
|
})]
|
|
456
458
|
})
|
|
457
459
|
})
|
|
458
460
|
]
|
|
459
461
|
});
|
|
460
462
|
}, X = ({ values: n, errors: i, onChange: a, onNameBlur: o, onVersionBlur: s, iconPreviewUrl: c, onAddAvatarClick: l, labels: u, styles: f, availableLocaleOptions: p = [] }) => {
|
|
461
|
-
let m =
|
|
462
|
-
return
|
|
463
|
+
let m = N(null), h = N(null), g = N(!1), _ = !!(i.name || i.version);
|
|
464
|
+
return j(() => {
|
|
463
465
|
_ && !g.current && (i.name ? m : h).current?.focus(), g.current = _;
|
|
464
466
|
}, [
|
|
465
467
|
_,
|
|
@@ -470,7 +472,7 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
470
472
|
"aria-label": u.ariaLabel,
|
|
471
473
|
className: r("flex flex-col gap-4", f?.root),
|
|
472
474
|
children: [
|
|
473
|
-
/* @__PURE__ */ C(
|
|
475
|
+
/* @__PURE__ */ C(q, {
|
|
474
476
|
label: u.iconUrl.label,
|
|
475
477
|
avatarUrl: c,
|
|
476
478
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
@@ -546,4 +548,4 @@ var P = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
546
548
|
return t.validateVersionPattern && i && ((t.validateVersionPattern instanceof RegExp ? t.validateVersionPattern : $).test(i) || (n.version = Z.InvalidFormat)), n;
|
|
547
549
|
};
|
|
548
550
|
//#endregion
|
|
549
|
-
export {
|
|
551
|
+
export { q as AddAvatar, J as AvatarPickerModal, V as BuilderFormContainer, Z as DeploymentCreationFieldErrorCode, X as DeploymentCreationForm, Y as DeploymentLocalesField, G as EditorLayout, U as EditorSection, Q as NAME_PATTERN, ne as SEMVER_VERSION_PATTERN, $ as VERSION_PATTERN, re as validateDeploymentCreationFields };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-builder-form",
|
|
3
3
|
"description": "Presentational builder form shells, editor layouts, and shared deployment field sets for composing and editing DIAL entities",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.474",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@tabler/icons-react": "^3.44.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
23
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.474",
|
|
24
24
|
"@epam/ai-dial-ui-kit": "^0.14.0-dev.15",
|
|
25
25
|
"react": "^19.0.0"
|
|
26
26
|
},
|