@tesouro/embedded-components-react 0.5.124 → 0.5.126
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/index.css +6 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index396.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index465.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index90.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index10.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js +58 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js +3 -98
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js +62 -62
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApproverOptions.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/widgetInitChannel.js +2 -2
- 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/feature/dist/lib/analytics/traceId.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index3.js +5 -9
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index4.js +7 -31
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index5.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index6.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index7.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/index.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/TagSelectorField.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/helpers.js +38 -0
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/labels.js +19 -0
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/permissions.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/useTagCreateForm.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index3.js +30 -30
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index4.js +4 -0
- package/dist/packages/shared-ui-shadcn/dist/index.js +1304 -1219
- package/package.json +12 -12
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import "../../../../feature/dist/index.js";
|
|
6
|
+
import "./permissions.js";
|
|
7
|
+
import "../../../data-access/dist/index.js";
|
|
8
|
+
import "./useTagCreateForm.js";
|
|
9
|
+
import "../../../ui/dist/index.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react/jsx-runtime";
|
package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/helpers.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
|
|
2
|
+
import { TAG_CATEGORY_LABELS_EN as t, TAG_MESSAGE_LABELS_EN as n } from "./labels.js";
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/helpers.js
|
|
4
|
+
var r = [
|
|
5
|
+
"document_type",
|
|
6
|
+
"department",
|
|
7
|
+
"project",
|
|
8
|
+
"cost_center",
|
|
9
|
+
"vendor_type",
|
|
10
|
+
"payment_method",
|
|
11
|
+
"approval_status"
|
|
12
|
+
];
|
|
13
|
+
function i(e, n) {
|
|
14
|
+
return e ? n?.[e] ?? t[e] ?? "" : "";
|
|
15
|
+
}
|
|
16
|
+
function a(e) {
|
|
17
|
+
return r.map((t) => ({
|
|
18
|
+
value: t,
|
|
19
|
+
label: i(t, e)
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
function o(e, t = n) {
|
|
23
|
+
let r = {}, i = e.name.trim();
|
|
24
|
+
i.length === 0 ? r.name = t.nameRequired : i.length > 255 && (r.name = t.nameTooLong);
|
|
25
|
+
let a = e.keywords.some((e) => e.length < 2), o = e.keywords.some((e) => e.length > 25);
|
|
26
|
+
return a ? r.keywords = t.keywordTooShort : o && (r.keywords = t.keywordTooLong), r;
|
|
27
|
+
}
|
|
28
|
+
function s(e) {
|
|
29
|
+
return !!(e.name || e.keywords);
|
|
30
|
+
}
|
|
31
|
+
function c(e) {
|
|
32
|
+
return e === "This tag already exists.";
|
|
33
|
+
}
|
|
34
|
+
function l(t, r = n) {
|
|
35
|
+
return c(e(t)) ? { name: r.duplicateName } : { form: r.genericError };
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { r as TAG_CATEGORIES, a as getCategoryOptions, i as getTagCategoryLabel, s as hasFormErrors, c as isDuplicateTagNameError, l as resolveTagSubmitError, o as validateTagForm };
|
package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/labels.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/labels.js
|
|
2
|
+
var e = {
|
|
3
|
+
nameRequired: "Required",
|
|
4
|
+
nameTooLong: "Value must be at most '255' characters",
|
|
5
|
+
keywordTooShort: "Keyword should be at least 2 characters long",
|
|
6
|
+
keywordTooLong: "Keyword should be at most 25 characters long",
|
|
7
|
+
genericError: "Something went wrong. Please try again.",
|
|
8
|
+
duplicateName: "A tag with this name already exists."
|
|
9
|
+
}, t = {
|
|
10
|
+
document_type: "Document Type",
|
|
11
|
+
department: "Department",
|
|
12
|
+
project: "Project",
|
|
13
|
+
cost_center: "Cost Center",
|
|
14
|
+
vendor_type: "Vendor Type",
|
|
15
|
+
payment_method: "Payment Method",
|
|
16
|
+
approval_status: "Approval Status"
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as TAG_CATEGORY_LABELS_EN, e as TAG_MESSAGE_LABELS_EN };
|
|
@@ -3,25 +3,25 @@ import { TAG_FORM_SHEET_LABELS_EN as h } from "./index2.js";
|
|
|
3
3
|
import { useId as g } from "react";
|
|
4
4
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
5
5
|
//#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index3.js
|
|
6
|
-
function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOptions: w, tagName: T, inProgress: E, showDelete: D,
|
|
7
|
-
let
|
|
6
|
+
function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOptions: w, tagName: T, inProgress: E, showDelete: D, showKeywords: O = !0, onNameChange: k, onCategoryChange: A, onKeywordsChange: j, onKeywordsInputChange: M, onSubmit: N, onCancel: P, onDelete: F, labels: I }) {
|
|
7
|
+
let L = {
|
|
8
8
|
...h,
|
|
9
|
-
...
|
|
10
|
-
},
|
|
9
|
+
...I
|
|
10
|
+
}, R = g(), z = x === "edit" ? L.editTitle.replace("{name}", T ?? "") : L.createTitle;
|
|
11
11
|
return /* @__PURE__ */ _(l, {
|
|
12
12
|
open: y,
|
|
13
13
|
onOpenChange: b,
|
|
14
14
|
children: /* @__PURE__ */ v(u, {
|
|
15
15
|
className: "ttw:w-[600px] ttw:sm:max-w-[600px]",
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */ v(p, { children: [/* @__PURE__ */ _(m, { children:
|
|
17
|
+
/* @__PURE__ */ v(p, { children: [/* @__PURE__ */ _(m, { children: z }), /* @__PURE__ */ _(d, {
|
|
18
18
|
className: "ttw:sr-only",
|
|
19
|
-
children:
|
|
19
|
+
children: z
|
|
20
20
|
})] }),
|
|
21
21
|
/* @__PURE__ */ _("form", {
|
|
22
|
-
id:
|
|
22
|
+
id: R,
|
|
23
23
|
onSubmit: (e) => {
|
|
24
|
-
e.preventDefault(), e.stopPropagation(),
|
|
24
|
+
e.preventDefault(), e.stopPropagation(), N();
|
|
25
25
|
},
|
|
26
26
|
children: /* @__PURE__ */ v("div", {
|
|
27
27
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pt-8 ttw:pb-6",
|
|
@@ -35,15 +35,15 @@ function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOp
|
|
|
35
35
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
36
36
|
children: [
|
|
37
37
|
/* @__PURE__ */ _(r, {
|
|
38
|
-
htmlFor: `${
|
|
39
|
-
children:
|
|
38
|
+
htmlFor: `${R}-name`,
|
|
39
|
+
children: L.nameLabel
|
|
40
40
|
}),
|
|
41
41
|
/* @__PURE__ */ _(t, {
|
|
42
|
-
id: `${
|
|
42
|
+
id: `${R}-name`,
|
|
43
43
|
autoFocus: !0,
|
|
44
44
|
value: S.name,
|
|
45
45
|
"aria-invalid": !!C?.name,
|
|
46
|
-
onChange: (e) =>
|
|
46
|
+
onChange: (e) => k(e.target.value)
|
|
47
47
|
}),
|
|
48
48
|
C?.name && /* @__PURE__ */ _("p", {
|
|
49
49
|
className: "ttw:text-sm ttw:text-destructive",
|
|
@@ -54,33 +54,33 @@ function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOp
|
|
|
54
54
|
/* @__PURE__ */ v("div", {
|
|
55
55
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
56
56
|
children: [/* @__PURE__ */ _(r, {
|
|
57
|
-
htmlFor: `${
|
|
58
|
-
children:
|
|
57
|
+
htmlFor: `${R}-category`,
|
|
58
|
+
children: L.categoryLabel
|
|
59
59
|
}), /* @__PURE__ */ v(i, {
|
|
60
60
|
value: S.category === "" ? void 0 : S.category,
|
|
61
|
-
onValueChange:
|
|
61
|
+
onValueChange: A,
|
|
62
62
|
children: [/* @__PURE__ */ _(s, {
|
|
63
|
-
id: `${
|
|
63
|
+
id: `${R}-category`,
|
|
64
64
|
className: "ttw:w-full",
|
|
65
|
-
children: /* @__PURE__ */ _(c, { placeholder:
|
|
65
|
+
children: /* @__PURE__ */ _(c, { placeholder: L.categoryPlaceholder })
|
|
66
66
|
}), /* @__PURE__ */ _(a, { children: w.map((e) => /* @__PURE__ */ _(o, {
|
|
67
67
|
value: e.value,
|
|
68
68
|
children: e.label
|
|
69
69
|
}, e.value)) })]
|
|
70
70
|
})]
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */ v("div", {
|
|
72
|
+
O && /* @__PURE__ */ v("div", {
|
|
73
73
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
74
74
|
children: [
|
|
75
|
-
/* @__PURE__ */ _(r, { children:
|
|
75
|
+
/* @__PURE__ */ _(r, { children: L.keywordsLabel }),
|
|
76
76
|
/* @__PURE__ */ _(n, {
|
|
77
77
|
value: S.keywords,
|
|
78
|
-
onChange:
|
|
78
|
+
onChange: j,
|
|
79
79
|
inputValue: S.keywordsInput,
|
|
80
|
-
onInputValueChange:
|
|
81
|
-
placeholder:
|
|
80
|
+
onInputValueChange: M,
|
|
81
|
+
placeholder: L.keywordsPlaceholder,
|
|
82
82
|
"aria-invalid": !!C?.keywords,
|
|
83
|
-
removeTagLabel: (e) =>
|
|
83
|
+
removeTagLabel: (e) => L.removeKeyword.replace("{keyword}", e)
|
|
84
84
|
}),
|
|
85
85
|
C?.keywords && /* @__PURE__ */ _("p", {
|
|
86
86
|
className: "ttw:text-sm ttw:text-destructive",
|
|
@@ -94,27 +94,27 @@ function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOp
|
|
|
94
94
|
/* @__PURE__ */ v(f, {
|
|
95
95
|
className: "ttw:flex ttw:flex-row ttw:justify-end ttw:gap-2",
|
|
96
96
|
children: [
|
|
97
|
-
x === "edit" && D &&
|
|
97
|
+
x === "edit" && D && F && /* @__PURE__ */ _(e, {
|
|
98
98
|
type: "button",
|
|
99
99
|
className: "ttw:mr-auto",
|
|
100
100
|
variant: "destructive",
|
|
101
101
|
size: "lg",
|
|
102
|
-
onClick:
|
|
103
|
-
children:
|
|
102
|
+
onClick: F,
|
|
103
|
+
children: L.deleteButton
|
|
104
104
|
}),
|
|
105
105
|
/* @__PURE__ */ _(e, {
|
|
106
106
|
type: "button",
|
|
107
107
|
variant: "ghost",
|
|
108
108
|
size: "lg",
|
|
109
|
-
onClick:
|
|
110
|
-
children:
|
|
109
|
+
onClick: P,
|
|
110
|
+
children: L.cancelButton
|
|
111
111
|
}),
|
|
112
112
|
/* @__PURE__ */ _(e, {
|
|
113
113
|
type: "submit",
|
|
114
|
-
form:
|
|
114
|
+
form: R,
|
|
115
115
|
size: "lg",
|
|
116
116
|
disabled: E,
|
|
117
|
-
children: x === "edit" ?
|
|
117
|
+
children: x === "edit" ? L.saveButton : L.createButton
|
|
118
118
|
})
|
|
119
119
|
]
|
|
120
120
|
})
|