@tesouro/embedded-components-react 0.9.54 → 0.9.56
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/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index24.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +30 -27
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index8.js +111 -109
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js +37 -37
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +189 -181
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index3.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +2283 -2182
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index24.js
CHANGED
|
@@ -28,6 +28,7 @@ function T({ query: T, onQueryChange: E, results: D, isLoading: O, onAddVendor:
|
|
|
28
28
|
id: R,
|
|
29
29
|
role: "combobox",
|
|
30
30
|
"aria-expanded": B,
|
|
31
|
+
"aria-controls": B ? `${R}-options` : void 0,
|
|
31
32
|
"aria-required": !0,
|
|
32
33
|
"aria-describedby": M ? z : void 0,
|
|
33
34
|
className: "ttw:flex ttw:h-10 ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2 ttw:rounded-md ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:text-left ttw:text-sm ttw:shadow-xs ttw:outline-none ttw:focus-visible:border-ring ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50",
|
|
@@ -47,6 +48,7 @@ function T({ query: T, onQueryChange: E, results: D, isLoading: O, onAddVendor:
|
|
|
47
48
|
]
|
|
48
49
|
})
|
|
49
50
|
}), /* @__PURE__ */ y(d, {
|
|
51
|
+
id: `${R}-options`,
|
|
50
52
|
align: "start",
|
|
51
53
|
className: "ttw:w-[var(--radix-popover-trigger-width)] ttw:p-0",
|
|
52
54
|
children: /* @__PURE__ */ b(t, {
|
|
@@ -2,53 +2,56 @@ import { Button as e, Typography as t } from "../../../../../packages/shared-ui-
|
|
|
2
2
|
import { mergeProductFormSheetLabels as n } from "../../../shared/product-catalog/ui/dist/index2.js";
|
|
3
3
|
import { ProductFormFields as r } from "../../../shared/product-catalog/ui/dist/index3.js";
|
|
4
4
|
import "../../../shared/product-catalog/ui/dist/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as
|
|
5
|
+
import { useEffect as i, useId as a, useRef as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return
|
|
8
|
+
function l({ form: l }) {
|
|
9
|
+
let u = n(l.labels), d = a(), f = o(null);
|
|
10
|
+
return i(() => {
|
|
11
|
+
f.current?.querySelector("[data-autofocus]")?.focus();
|
|
12
|
+
}, []), /* @__PURE__ */ c("form", {
|
|
13
|
+
ref: f,
|
|
11
14
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-muted ttw:p-4",
|
|
12
15
|
onSubmit: (e) => {
|
|
13
|
-
e.preventDefault(), e.stopPropagation(),
|
|
16
|
+
e.preventDefault(), e.stopPropagation(), l.onSubmit();
|
|
14
17
|
},
|
|
15
18
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ s("div", {
|
|
17
20
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:border-b ttw:border-border ttw:pt-6 ttw:pb-7",
|
|
18
|
-
children: /* @__PURE__ */
|
|
21
|
+
children: /* @__PURE__ */ s(t, {
|
|
19
22
|
variant: "body1",
|
|
20
23
|
className: "ttw:font-medium",
|
|
21
|
-
children:
|
|
24
|
+
children: l.heading
|
|
22
25
|
})
|
|
23
26
|
}),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
idPrefix:
|
|
26
|
-
values:
|
|
27
|
-
errors:
|
|
28
|
-
unitOptions:
|
|
29
|
-
pricePrefix:
|
|
30
|
-
onChange:
|
|
31
|
-
labels:
|
|
27
|
+
/* @__PURE__ */ s(r, {
|
|
28
|
+
idPrefix: d,
|
|
29
|
+
values: l.values,
|
|
30
|
+
errors: l.errors,
|
|
31
|
+
unitOptions: l.unitOptions,
|
|
32
|
+
pricePrefix: l.pricePrefix,
|
|
33
|
+
onChange: l.onChange,
|
|
34
|
+
labels: l.labels
|
|
32
35
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ c("div", {
|
|
34
37
|
className: "ttw:flex ttw:justify-end ttw:gap-4 ttw:pt-6",
|
|
35
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ s(e, {
|
|
36
39
|
type: "button",
|
|
37
40
|
variant: "outline",
|
|
38
41
|
className: "ttw:w-fit ttw:border-border",
|
|
39
|
-
disabled:
|
|
40
|
-
onClick:
|
|
41
|
-
children:
|
|
42
|
-
}), /* @__PURE__ */
|
|
42
|
+
disabled: l.inProgress,
|
|
43
|
+
onClick: l.onCancel,
|
|
44
|
+
children: u.cancelButton
|
|
45
|
+
}), /* @__PURE__ */ s(e, {
|
|
43
46
|
type: "submit",
|
|
44
47
|
className: "ttw:w-fit",
|
|
45
|
-
disabled:
|
|
46
|
-
loading:
|
|
47
|
-
children:
|
|
48
|
+
disabled: l.inProgress || l.submitDisabled,
|
|
49
|
+
loading: l.inProgress,
|
|
50
|
+
children: u.saveButton
|
|
48
51
|
})]
|
|
49
52
|
})
|
|
50
53
|
]
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
//#endregion
|
|
54
|
-
export {
|
|
57
|
+
export { l as ProductEditForm, l as default };
|
|
@@ -76,7 +76,7 @@ function E({ open: E, onOpenChange: D, title: O, description: k, values: A, erro
|
|
|
76
76
|
}),
|
|
77
77
|
/* @__PURE__ */ x(a, {
|
|
78
78
|
id: `${U}-gl-code`,
|
|
79
|
-
|
|
79
|
+
"data-autofocus": !0,
|
|
80
80
|
maxLength: 20,
|
|
81
81
|
value: A.nominal_code,
|
|
82
82
|
placeholder: H.glCodePlaceholder,
|
|
@@ -8,83 +8,85 @@ import "../../../../shared/ui/dist/index.js";
|
|
|
8
8
|
import { AccountAccessTable as v } from "./index4.js";
|
|
9
9
|
import { DEFAULT_LABELS as y } from "./index6.js";
|
|
10
10
|
import { RoleCardGroup as b } from "./index7.js";
|
|
11
|
-
import { useEffect as x,
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { ArrowLeftIcon as
|
|
11
|
+
import { useEffect as x, useId as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
12
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
13
|
+
import { ArrowLeftIcon as O, CheckIcon as k, ChevronDownIcon as A, SendIcon as j } from "lucide-react";
|
|
14
14
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index8.js
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
15
|
+
function M({ id: e, message: t }) {
|
|
16
|
+
return /* @__PURE__ */ E("p", {
|
|
17
17
|
id: e,
|
|
18
18
|
className: "ttw:text-sm ttw:text-destructive",
|
|
19
19
|
children: t
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
let [v, y] =
|
|
22
|
+
var N = "__none__";
|
|
23
|
+
function P({ id: e, value: o, options: s, placeholder: d, searchPlaceholder: f, noResultsLabel: p, noneLabel: m, disabled: h, onValueChange: _ }) {
|
|
24
|
+
let [v, y] = T(!1), b = S(), x = s.find((e) => e.value === o), C = (e) => {
|
|
25
25
|
_(e), y(!1);
|
|
26
26
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ D(c, {
|
|
28
28
|
open: v,
|
|
29
29
|
onOpenChange: y,
|
|
30
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ E(u, {
|
|
31
31
|
asChild: !0,
|
|
32
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ D("button", {
|
|
33
33
|
type: "button",
|
|
34
34
|
id: e,
|
|
35
35
|
role: "combobox",
|
|
36
36
|
"aria-expanded": v,
|
|
37
|
+
"aria-controls": v ? b : void 0,
|
|
37
38
|
disabled: h,
|
|
38
39
|
className: "ttw:flex ttw:h-9 ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2 ttw:rounded-md ttw:border ttw:border-input ttw:bg-transparent ttw:px-3 ttw:py-2 ttw:text-sm ttw:shadow-xs ttw:outline-none ttw:focus-visible:border-ring ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50 ttw:disabled:cursor-not-allowed ttw:disabled:opacity-50",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
-
className: g("ttw:truncate", !
|
|
41
|
-
children:
|
|
42
|
-
}), /* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ E("span", {
|
|
41
|
+
className: g("ttw:truncate", !x && "ttw:text-muted-foreground"),
|
|
42
|
+
children: x ? x.label : d
|
|
43
|
+
}), /* @__PURE__ */ E(A, { className: "ttw:size-4 ttw:shrink-0 ttw:opacity-50" })]
|
|
43
44
|
})
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
+
}), /* @__PURE__ */ E(l, {
|
|
46
|
+
id: b,
|
|
45
47
|
align: "start",
|
|
46
48
|
className: "ttw:w-[var(--radix-popover-trigger-width)] ttw:p-0",
|
|
47
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ D(t, {
|
|
48
50
|
filter: (e, t) => +!!e.toLowerCase().includes(t.toLowerCase()),
|
|
49
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ E(r, {
|
|
50
52
|
placeholder: f,
|
|
51
53
|
"aria-label": f
|
|
52
|
-
}), /* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
o ? /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ D(a, { children: [
|
|
55
|
+
/* @__PURE__ */ E(n, { children: p }),
|
|
56
|
+
o ? /* @__PURE__ */ E(i, {
|
|
55
57
|
value: m,
|
|
56
|
-
onSelect: () =>
|
|
58
|
+
onSelect: () => C(""),
|
|
57
59
|
children: m
|
|
58
60
|
}) : null,
|
|
59
|
-
s.map((e) => /* @__PURE__ */
|
|
61
|
+
s.map((e) => /* @__PURE__ */ D(i, {
|
|
60
62
|
value: `${e.label} ${e.sublabel ?? ""} ${e.value}`,
|
|
61
|
-
onSelect: () =>
|
|
62
|
-
children: [/* @__PURE__ */
|
|
63
|
+
onSelect: () => C(e.value),
|
|
64
|
+
children: [/* @__PURE__ */ D("span", {
|
|
63
65
|
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-0.5",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ E("span", {
|
|
65
67
|
className: "ttw:truncate",
|
|
66
68
|
children: e.label
|
|
67
|
-
}), e.sublabel ? /* @__PURE__ */
|
|
69
|
+
}), e.sublabel ? /* @__PURE__ */ E("span", {
|
|
68
70
|
className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
|
|
69
71
|
children: e.sublabel
|
|
70
72
|
}) : null]
|
|
71
|
-
}), e.value === o ? /* @__PURE__ */
|
|
73
|
+
}), e.value === o ? /* @__PURE__ */ E(k, { className: "ttw:ml-auto ttw:size-4 ttw:shrink-0" }) : null]
|
|
72
74
|
}, e.value))
|
|
73
75
|
] })]
|
|
74
76
|
})
|
|
75
77
|
})]
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
|
-
function
|
|
79
|
-
let
|
|
80
|
-
return /* @__PURE__ */
|
|
80
|
+
function F({ id: e, label: t, value: n, options: r, placeholder: i, emptyMessage: a, loadingMessage: o, noneLabel: c, isLoading: l = !1, isError: u = !1, errorMessage: g, errorHelper: _, emptyHelper: v, readyHelper: y, disabled: b, searchable: x = !1, searchPlaceholder: S, noResultsLabel: C, onValueChange: w }) {
|
|
81
|
+
let T = r.length > 0, O = u ? g ?? a : l ? o : T ? i : a, k = u ? _ : !l && !T ? v : T ? y : void 0;
|
|
82
|
+
return /* @__PURE__ */ D("div", {
|
|
81
83
|
className: "ttw:space-y-2",
|
|
82
84
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ E(s, {
|
|
84
86
|
htmlFor: e,
|
|
85
87
|
children: t
|
|
86
88
|
}),
|
|
87
|
-
x ? /* @__PURE__ */
|
|
89
|
+
x ? /* @__PURE__ */ E(P, {
|
|
88
90
|
id: e,
|
|
89
91
|
value: n,
|
|
90
92
|
options: r,
|
|
@@ -92,138 +94,138 @@ function P({ id: e, label: t, value: n, options: r, placeholder: i, emptyMessage
|
|
|
92
94
|
searchPlaceholder: S ?? "",
|
|
93
95
|
noResultsLabel: C ?? "",
|
|
94
96
|
noneLabel: c,
|
|
95
|
-
disabled: b || l || !
|
|
97
|
+
disabled: b || l || !T,
|
|
96
98
|
onValueChange: w
|
|
97
|
-
}) : /* @__PURE__ */
|
|
99
|
+
}) : /* @__PURE__ */ D(d, {
|
|
98
100
|
value: n || void 0,
|
|
99
|
-
disabled: b || l || !
|
|
100
|
-
onValueChange: (e) => w(e ===
|
|
101
|
-
children: [/* @__PURE__ */
|
|
101
|
+
disabled: b || l || !T,
|
|
102
|
+
onValueChange: (e) => w(e === N ? "" : e),
|
|
103
|
+
children: [/* @__PURE__ */ E(m, {
|
|
102
104
|
id: e,
|
|
103
105
|
className: "ttw:w-full",
|
|
104
|
-
children: /* @__PURE__ */
|
|
105
|
-
}), /* @__PURE__ */
|
|
106
|
-
value:
|
|
106
|
+
children: /* @__PURE__ */ E(h, { placeholder: O })
|
|
107
|
+
}), /* @__PURE__ */ D(f, { children: [n ? /* @__PURE__ */ E(p, {
|
|
108
|
+
value: N,
|
|
107
109
|
children: c
|
|
108
|
-
}) : null, r.map((e) => /* @__PURE__ */
|
|
110
|
+
}) : null, r.map((e) => /* @__PURE__ */ E(p, {
|
|
109
111
|
value: e.value,
|
|
110
112
|
description: e.sublabel,
|
|
111
113
|
children: e.label
|
|
112
114
|
}, e.value))] })]
|
|
113
115
|
}),
|
|
114
|
-
k ? /* @__PURE__ */
|
|
116
|
+
k ? /* @__PURE__ */ E("p", {
|
|
115
117
|
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
116
118
|
children: k
|
|
117
119
|
}) : null
|
|
118
120
|
]
|
|
119
121
|
});
|
|
120
122
|
}
|
|
121
|
-
function
|
|
123
|
+
function I({ form: t, roleOptions: n, departmentOptions: r, locationOptions: i, reportingManagerOptions: a, accountAccessOptions: c, departmentsLoading: l = !1, locationsLoading: u = !1, reportingManagersLoading: d = !1, departmentsError: f = !1, locationsError: p = !1, reportingManagersError: m = !1, accountAccessLoading: h = !1, accountAccessError: g = !1, accountAccessMode: S = "hidden", errors: T, submitErrorMessage: k, isSubmitting: A = !1, isSubmitBlocked: N = !1, onFormChange: P, onBackClick: I, onCancel: L, onSubmit: R, labels: z }) {
|
|
122
124
|
let B = {
|
|
123
125
|
...y,
|
|
124
126
|
...z
|
|
125
|
-
}, V =
|
|
127
|
+
}, V = w(null), H = C(() => c.map((e) => ({
|
|
126
128
|
...e,
|
|
127
|
-
checked:
|
|
129
|
+
checked: S === "admin" || t.accountAccess.includes(e.value)
|
|
128
130
|
})), [
|
|
129
131
|
c,
|
|
130
|
-
|
|
132
|
+
S,
|
|
131
133
|
t.accountAccess
|
|
132
134
|
]);
|
|
133
135
|
return x(() => {
|
|
134
136
|
V.current?.focus();
|
|
135
|
-
}, []), /* @__PURE__ */
|
|
137
|
+
}, []), /* @__PURE__ */ D("section", {
|
|
136
138
|
"aria-label": B.inviteTitle,
|
|
137
139
|
className: "ttw:rounded-md ttw:border ttw:border-border ttw:bg-card ttw:p-4",
|
|
138
140
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ D(e, {
|
|
140
142
|
ref: V,
|
|
141
143
|
variant: "ghost",
|
|
142
144
|
size: "sm",
|
|
143
|
-
disabled:
|
|
145
|
+
disabled: A,
|
|
144
146
|
onClick: I,
|
|
145
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ E(O, {
|
|
146
148
|
"aria-hidden": !0,
|
|
147
149
|
className: "ttw:size-4"
|
|
148
150
|
}), B.inviteBackToTeamButton]
|
|
149
151
|
}),
|
|
150
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ E("h3", {
|
|
151
153
|
className: "ttw:mt-4 ttw:text-lg ttw:font-semibold ttw:text-foreground",
|
|
152
154
|
children: B.inviteTitle
|
|
153
155
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ E("form", {
|
|
155
157
|
noValidate: !0,
|
|
156
158
|
className: "ttw:mt-4",
|
|
157
159
|
onSubmit: (e) => {
|
|
158
160
|
e.preventDefault(), R();
|
|
159
161
|
},
|
|
160
|
-
children: /* @__PURE__ */
|
|
162
|
+
children: /* @__PURE__ */ D("fieldset", {
|
|
161
163
|
className: "ttw:space-y-6",
|
|
162
|
-
disabled:
|
|
164
|
+
disabled: A,
|
|
163
165
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ D("div", {
|
|
165
167
|
className: "ttw:space-y-4",
|
|
166
168
|
children: [
|
|
167
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ E("h4", {
|
|
168
170
|
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
169
171
|
children: B.inviteDetailsSectionHeading
|
|
170
172
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ D("div", {
|
|
172
174
|
className: "ttw:space-y-2",
|
|
173
175
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ E(s, {
|
|
175
177
|
htmlFor: "team-invite-name",
|
|
176
178
|
children: B.inviteNameLabel
|
|
177
179
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ E(o, {
|
|
179
181
|
id: "team-invite-name",
|
|
180
182
|
name: "name",
|
|
181
183
|
autoComplete: "name",
|
|
182
184
|
required: !0,
|
|
183
185
|
value: t.name,
|
|
184
|
-
"aria-invalid":
|
|
185
|
-
"aria-describedby":
|
|
186
|
-
onChange: (e) =>
|
|
186
|
+
"aria-invalid": T?.name ? !0 : void 0,
|
|
187
|
+
"aria-describedby": T?.name ? "team-invite-name-error" : void 0,
|
|
188
|
+
onChange: (e) => P({
|
|
187
189
|
...t,
|
|
188
190
|
name: e.target.value
|
|
189
191
|
})
|
|
190
192
|
}),
|
|
191
|
-
|
|
193
|
+
T?.name && /* @__PURE__ */ E(M, {
|
|
192
194
|
id: "team-invite-name-error",
|
|
193
|
-
message:
|
|
195
|
+
message: T.name
|
|
194
196
|
})
|
|
195
197
|
]
|
|
196
198
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ D("div", {
|
|
198
200
|
className: "ttw:space-y-2",
|
|
199
201
|
children: [
|
|
200
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ E(s, {
|
|
201
203
|
htmlFor: "team-invite-email",
|
|
202
204
|
children: B.inviteWorkEmailLabel
|
|
203
205
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ E(o, {
|
|
205
207
|
id: "team-invite-email",
|
|
206
208
|
name: "email",
|
|
207
209
|
type: "email",
|
|
208
210
|
autoComplete: "email",
|
|
209
211
|
required: !0,
|
|
210
212
|
value: t.email,
|
|
211
|
-
"aria-invalid":
|
|
212
|
-
"aria-describedby":
|
|
213
|
-
onChange: (e) =>
|
|
213
|
+
"aria-invalid": T?.email ? !0 : void 0,
|
|
214
|
+
"aria-describedby": T?.email ? "team-invite-email-error" : void 0,
|
|
215
|
+
onChange: (e) => P({
|
|
214
216
|
...t,
|
|
215
217
|
email: e.target.value
|
|
216
218
|
})
|
|
217
219
|
}),
|
|
218
|
-
|
|
220
|
+
T?.email && /* @__PURE__ */ E(M, {
|
|
219
221
|
id: "team-invite-email-error",
|
|
220
|
-
message:
|
|
222
|
+
message: T.email
|
|
221
223
|
})
|
|
222
224
|
]
|
|
223
225
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ D("div", {
|
|
225
227
|
className: "ttw:grid ttw:grid-cols-1 ttw:gap-4 ttw:sm:grid-cols-2",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ E(F, {
|
|
227
229
|
id: "team-invite-department",
|
|
228
230
|
label: B.inviteDepartmentLabel,
|
|
229
231
|
value: t.department,
|
|
@@ -237,11 +239,11 @@ function F({ form: t, roleOptions: n, departmentOptions: r, locationOptions: i,
|
|
|
237
239
|
errorMessage: B.inviteDepartmentLoadError,
|
|
238
240
|
errorHelper: B.inviteDepartmentLoadErrorHelper,
|
|
239
241
|
emptyHelper: B.inviteDepartmentEmptyHelper,
|
|
240
|
-
onValueChange: (e) =>
|
|
242
|
+
onValueChange: (e) => P({
|
|
241
243
|
...t,
|
|
242
244
|
department: e
|
|
243
245
|
})
|
|
244
|
-
}), /* @__PURE__ */
|
|
246
|
+
}), /* @__PURE__ */ E(F, {
|
|
245
247
|
id: "team-invite-location",
|
|
246
248
|
label: B.inviteLocationLabel,
|
|
247
249
|
value: t.location,
|
|
@@ -255,13 +257,13 @@ function F({ form: t, roleOptions: n, departmentOptions: r, locationOptions: i,
|
|
|
255
257
|
errorMessage: B.inviteLocationLoadError,
|
|
256
258
|
errorHelper: B.inviteLocationLoadErrorHelper,
|
|
257
259
|
emptyHelper: B.inviteLocationEmptyHelper,
|
|
258
|
-
onValueChange: (e) =>
|
|
260
|
+
onValueChange: (e) => P({
|
|
259
261
|
...t,
|
|
260
262
|
location: e
|
|
261
263
|
})
|
|
262
264
|
})]
|
|
263
265
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ E(F, {
|
|
265
267
|
id: "team-invite-reporting-manager",
|
|
266
268
|
label: B.inviteReportingManagerLabel,
|
|
267
269
|
value: t.reportingManager,
|
|
@@ -279,82 +281,82 @@ function F({ form: t, roleOptions: n, departmentOptions: r, locationOptions: i,
|
|
|
279
281
|
searchable: !0,
|
|
280
282
|
searchPlaceholder: B.inviteReportingManagerSearchPlaceholder,
|
|
281
283
|
noResultsLabel: B.inviteReportingManagerNoResults,
|
|
282
|
-
onValueChange: (e) =>
|
|
284
|
+
onValueChange: (e) => P({
|
|
283
285
|
...t,
|
|
284
286
|
reportingManager: e
|
|
285
287
|
})
|
|
286
288
|
})
|
|
287
289
|
]
|
|
288
290
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ D("div", {
|
|
290
292
|
className: "ttw:space-y-1",
|
|
291
293
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ E("div", {
|
|
293
295
|
id: "team-invite-role-heading",
|
|
294
296
|
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
295
297
|
children: B.inviteRoleSectionHeading
|
|
296
298
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ E("p", {
|
|
298
300
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
299
301
|
children: B.inviteRoleSectionDescription
|
|
300
302
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ E("div", {
|
|
302
304
|
className: "ttw:mt-3",
|
|
303
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ E(b, {
|
|
304
306
|
idPrefix: "team-invite-role",
|
|
305
307
|
options: n,
|
|
306
308
|
value: t.role,
|
|
307
|
-
onValueChange: (e) =>
|
|
309
|
+
onValueChange: (e) => P({
|
|
308
310
|
...t,
|
|
309
311
|
role: e
|
|
310
312
|
}),
|
|
311
313
|
ariaLabelledBy: "team-invite-role-heading",
|
|
312
|
-
ariaInvalid: !!
|
|
313
|
-
ariaDescribedBy:
|
|
314
|
+
ariaInvalid: !!T?.role,
|
|
315
|
+
ariaDescribedBy: T?.role ? "team-invite-role-error" : void 0
|
|
314
316
|
})
|
|
315
317
|
}),
|
|
316
|
-
|
|
318
|
+
T?.role && /* @__PURE__ */ E(M, {
|
|
317
319
|
id: "team-invite-role-error",
|
|
318
|
-
message:
|
|
320
|
+
message: T.role
|
|
319
321
|
})
|
|
320
322
|
]
|
|
321
323
|
}),
|
|
322
|
-
|
|
324
|
+
S === "employee" && /* @__PURE__ */ D("div", {
|
|
323
325
|
className: "ttw:space-y-2",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ E("div", {
|
|
325
327
|
id: "team-invite-account-access-heading",
|
|
326
328
|
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
327
329
|
children: B.inviteAccountAccessSectionHeading
|
|
328
|
-
}), /* @__PURE__ */
|
|
330
|
+
}), /* @__PURE__ */ E("p", {
|
|
329
331
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
330
332
|
children: B.manageAccessEmployeeNote
|
|
331
333
|
})]
|
|
332
334
|
}),
|
|
333
|
-
(
|
|
335
|
+
(S === "picker" || S === "admin") && /* @__PURE__ */ D("div", {
|
|
334
336
|
className: "ttw:space-y-2",
|
|
335
337
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ E("div", {
|
|
337
339
|
id: "team-invite-account-access-heading",
|
|
338
340
|
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
339
341
|
children: B.inviteAccountAccessSectionHeading
|
|
340
342
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ E("p", {
|
|
342
344
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
343
345
|
children: B.inviteAccountAccessSectionDescription
|
|
344
346
|
}),
|
|
345
|
-
g ? /* @__PURE__ */
|
|
347
|
+
g ? /* @__PURE__ */ E(_, { children: B.inviteAccountAccessLoadError }) : h ? /* @__PURE__ */ E("p", {
|
|
346
348
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
347
349
|
children: B.inviteOptionsLoading
|
|
348
|
-
}) : /* @__PURE__ */
|
|
350
|
+
}) : /* @__PURE__ */ E(v, {
|
|
349
351
|
rows: H,
|
|
350
352
|
onToggle: (e, n) => {
|
|
351
|
-
|
|
353
|
+
P({
|
|
352
354
|
...t,
|
|
353
355
|
accountAccess: n ? [...t.accountAccess, e] : t.accountAccess.filter((t) => t !== e)
|
|
354
356
|
});
|
|
355
357
|
},
|
|
356
|
-
disabled:
|
|
357
|
-
note:
|
|
358
|
+
disabled: S === "admin",
|
|
359
|
+
note: S === "admin" ? B.inviteAccountAccessAdminNote : void 0,
|
|
358
360
|
emptyMessage: B.inviteAccountAccessEmpty,
|
|
359
361
|
labels: {
|
|
360
362
|
accountNameColumn: B.accountAccessNameColumn,
|
|
@@ -364,19 +366,19 @@ function F({ form: t, roleOptions: n, departmentOptions: r, locationOptions: i,
|
|
|
364
366
|
})
|
|
365
367
|
]
|
|
366
368
|
}),
|
|
367
|
-
k && /* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
+
k && /* @__PURE__ */ E(_, { children: k }),
|
|
370
|
+
/* @__PURE__ */ D("div", {
|
|
369
371
|
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ E(e, {
|
|
371
373
|
type: "button",
|
|
372
374
|
variant: "ghost",
|
|
373
375
|
onClick: L,
|
|
374
376
|
children: B.inviteCancelButton
|
|
375
|
-
}), /* @__PURE__ */
|
|
377
|
+
}), /* @__PURE__ */ D(e, {
|
|
376
378
|
type: "submit",
|
|
377
|
-
loading:
|
|
378
|
-
disabled: N || l || u || d || (
|
|
379
|
-
children: [B.inviteSubmitButton, /* @__PURE__ */
|
|
379
|
+
loading: A,
|
|
380
|
+
disabled: N || l || u || d || (S === "picker" || S === "admin") && (h || g),
|
|
381
|
+
children: [B.inviteSubmitButton, /* @__PURE__ */ E(j, {
|
|
380
382
|
"aria-hidden": !0,
|
|
381
383
|
className: "ttw:size-4"
|
|
382
384
|
})]
|
|
@@ -389,4 +391,4 @@ function F({ form: t, roleOptions: n, departmentOptions: r, locationOptions: i,
|
|
|
389
391
|
});
|
|
390
392
|
}
|
|
391
393
|
//#endregion
|
|
392
|
-
export {
|
|
394
|
+
export { I as InviteTeamMemberForm, I as default, F as OptionalSelect };
|