@tesouro/embedded-components-react 0.5.125 → 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/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/shared/feature/dist/lib/analytics/build-info.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 +1196 -1190
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1179,6 +1179,9 @@
|
|
|
1179
1179
|
.ttw\:w-96 {
|
|
1180
1180
|
width: calc(var(--ttw-spacing) * 96);
|
|
1181
1181
|
}
|
|
1182
|
+
.ttw\:w-105 {
|
|
1183
|
+
width: calc(var(--ttw-spacing) * 105);
|
|
1184
|
+
}
|
|
1182
1185
|
.ttw\:w-110 {
|
|
1183
1186
|
width: calc(var(--ttw-spacing) * 110);
|
|
1184
1187
|
}
|
|
@@ -1260,6 +1263,9 @@
|
|
|
1260
1263
|
.ttw\:w-\[400px\] {
|
|
1261
1264
|
width: 400px;
|
|
1262
1265
|
}
|
|
1266
|
+
.ttw\:w-\[420px\] {
|
|
1267
|
+
width: 420px;
|
|
1268
|
+
}
|
|
1263
1269
|
.ttw\:w-\[423px\] {
|
|
1264
1270
|
width: 423px;
|
|
1265
1271
|
}
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index10.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { TAG_MESSAGE_LABELS_EN as e } from "
|
|
6
|
-
import { hasSelectedText as t } from "./
|
|
5
|
+
import { TAG_MESSAGE_LABELS_EN as e } from "../../../../shared/tag-selection/feature/dist/lib/labels.js";
|
|
6
|
+
import { hasSelectedText as t } from "./index4.js";
|
|
7
|
+
import "./index5.js";
|
|
7
8
|
import { useEntitySettings as n } from "./index6.js";
|
|
8
9
|
import { useTagDelete as r } from "./index7.js";
|
|
9
10
|
import { useTagForm as i } from "./index8.js";
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js
CHANGED
|
@@ -7,12 +7,12 @@ import { WidgetProvider as t } from "../../../../shared/feature/dist/lib/WidgetP
|
|
|
7
7
|
import "../../../../shared/feature/dist/index.js";
|
|
8
8
|
import { TagsWidgetAnalyticsEvent as n, WIDGET_NAME as r } from "./index2.js";
|
|
9
9
|
import { PAGE_SIZE_OPTIONS as i } from "./index3.js";
|
|
10
|
-
import {
|
|
11
|
-
import { TagsScreen as o } from "../../ui/dist/index3.js";
|
|
12
|
-
import { TagDeleteDialog as s } from "../../ui/dist/index4.js";
|
|
13
|
-
import "../../ui/dist/index.js";
|
|
14
|
-
import { TagFormSheet as c } from "../../../../shared/tag-selection/ui/dist/index3.js";
|
|
10
|
+
import { TagFormSheet as a } from "../../../../shared/tag-selection/ui/dist/index3.js";
|
|
15
11
|
import "../../../../shared/tag-selection/ui/dist/index.js";
|
|
12
|
+
import { useTagsWidget as o } from "./index10.js";
|
|
13
|
+
import { TagsScreen as s } from "../../ui/dist/index3.js";
|
|
14
|
+
import { TagDeleteDialog as c } from "../../ui/dist/index4.js";
|
|
15
|
+
import "../../ui/dist/index.js";
|
|
16
16
|
import { useEffect as l } from "react";
|
|
17
17
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
18
18
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js
|
|
@@ -21,9 +21,9 @@ function p({ pageSizeOptions: t = i, screenLabels: r, formLabels: p, deleteLabel
|
|
|
21
21
|
l(() => {
|
|
22
22
|
g(n.Mounted);
|
|
23
23
|
}, [g]);
|
|
24
|
-
let { selectedTag: _, table: v, form: y, del: b, handleRowClick: x, handleDeleteClick: S, handleFormDelete: C } =
|
|
24
|
+
let { selectedTag: _, table: v, form: y, del: b, handleRowClick: x, handleDeleteClick: S, handleFormDelete: C } = o({ messageLabels: h });
|
|
25
25
|
return /* @__PURE__ */ f(u, { children: [
|
|
26
|
-
/* @__PURE__ */ d(
|
|
26
|
+
/* @__PURE__ */ d(s, {
|
|
27
27
|
tags: v.rows,
|
|
28
28
|
isLoading: v.isLoading,
|
|
29
29
|
isError: v.isError,
|
|
@@ -43,7 +43,7 @@ function p({ pageSizeOptions: t = i, screenLabels: r, formLabels: p, deleteLabel
|
|
|
43
43
|
labels: r,
|
|
44
44
|
emptyStateTestId: "tags-widget-empty-state"
|
|
45
45
|
}),
|
|
46
|
-
/* @__PURE__ */ d(
|
|
46
|
+
/* @__PURE__ */ d(a, {
|
|
47
47
|
open: y.open,
|
|
48
48
|
onOpenChange: y.onOpenChange,
|
|
49
49
|
mode: y.mode,
|
|
@@ -62,7 +62,7 @@ function p({ pageSizeOptions: t = i, screenLabels: r, formLabels: p, deleteLabel
|
|
|
62
62
|
onDelete: C,
|
|
63
63
|
labels: p
|
|
64
64
|
}),
|
|
65
|
-
/* @__PURE__ */ d(
|
|
65
|
+
/* @__PURE__ */ d(c, {
|
|
66
66
|
open: b.open,
|
|
67
67
|
onOpenChange: b.onOpenChange,
|
|
68
68
|
tagName: _?.name ?? "",
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js
CHANGED
|
@@ -1,10 +1,61 @@
|
|
|
1
|
+
import { getTagCategoryLabel as e } from "../../../../shared/tag-selection/feature/dist/lib/helpers.js";
|
|
2
|
+
import "../../../../shared/tag-selection/feature/dist/index.js";
|
|
1
3
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
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."
|
|
4
|
+
var t = {
|
|
5
|
+
createdAtLabel: "created_at",
|
|
6
|
+
updatedAtLabel: "updated_at"
|
|
8
7
|
};
|
|
8
|
+
function n(e) {
|
|
9
|
+
return e && t[e] || "created_at";
|
|
10
|
+
}
|
|
11
|
+
var r = new Intl.DateTimeFormat(void 0, {
|
|
12
|
+
year: "numeric",
|
|
13
|
+
month: "short",
|
|
14
|
+
day: "numeric"
|
|
15
|
+
});
|
|
16
|
+
function i(e) {
|
|
17
|
+
if (!e) return "";
|
|
18
|
+
let t = new Date(e);
|
|
19
|
+
return Number.isNaN(t.getTime()) ? "" : r.format(t);
|
|
20
|
+
}
|
|
21
|
+
function a() {
|
|
22
|
+
let e = globalThis.getSelection?.();
|
|
23
|
+
return !!(e && e.toString().length > 0);
|
|
24
|
+
}
|
|
25
|
+
function o(e) {
|
|
26
|
+
let t = {};
|
|
27
|
+
for (let n of e ?? []) t[n.tag_id] = n.keywords;
|
|
28
|
+
return t;
|
|
29
|
+
}
|
|
30
|
+
function s(e) {
|
|
31
|
+
let t = {};
|
|
32
|
+
for (let n of e ?? []) t[n.id] = `${n.first_name ?? ""} ${n.last_name ?? ""}`.trim();
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
function c({ tags: t, keywordsByTagId: n, userNamesById: r }) {
|
|
36
|
+
return t.map((t) => ({
|
|
37
|
+
id: t.id,
|
|
38
|
+
name: t.name,
|
|
39
|
+
categoryLabel: e(t.category),
|
|
40
|
+
keywords: (n[t.id] ?? []).join(", "),
|
|
41
|
+
createdAtLabel: i(t.created_at),
|
|
42
|
+
updatedAtLabel: i(t.updated_at),
|
|
43
|
+
createdByLabel: t.created_by_entity_user_id ? r[t.created_by_entity_user_id] ?? "" : ""
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
function l(e, t, n) {
|
|
47
|
+
let r = e ?? [], i = r.filter((e) => e.tag_id !== t), a = Array.from(new Set(n));
|
|
48
|
+
return i.length === r.length && a.length === 0 ? {
|
|
49
|
+
changed: !1,
|
|
50
|
+
next: r
|
|
51
|
+
} : {
|
|
52
|
+
changed: !0,
|
|
53
|
+
next: a.length ? [...i, {
|
|
54
|
+
tag_id: t,
|
|
55
|
+
keywords: a,
|
|
56
|
+
enabled: !0
|
|
57
|
+
}] : i
|
|
58
|
+
};
|
|
59
|
+
}
|
|
9
60
|
//#endregion
|
|
10
|
-
export {
|
|
61
|
+
export { o as buildKeywordsByTagId, c as buildTagRows, s as buildUserNamesById, l as computeNextOcrAutoTagging, i as formatTagDate, a as hasSelectedText, n as sortFieldForColumn };
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js
CHANGED
|
@@ -1,98 +1,3 @@
|
|
|
1
|
-
import { TAG_MESSAGE_LABELS_EN as e } from "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"document_type",
|
|
5
|
-
"department",
|
|
6
|
-
"project",
|
|
7
|
-
"cost_center",
|
|
8
|
-
"vendor_type",
|
|
9
|
-
"payment_method",
|
|
10
|
-
"approval_status"
|
|
11
|
-
], n = {
|
|
12
|
-
document_type: "Document Type",
|
|
13
|
-
department: "Department",
|
|
14
|
-
project: "Project",
|
|
15
|
-
cost_center: "Cost Center",
|
|
16
|
-
vendor_type: "Vendor Type",
|
|
17
|
-
payment_method: "Payment Method",
|
|
18
|
-
approval_status: "Approval Status"
|
|
19
|
-
};
|
|
20
|
-
function r(e) {
|
|
21
|
-
return e ? n[e] ?? "" : "";
|
|
22
|
-
}
|
|
23
|
-
function i() {
|
|
24
|
-
return t.map((e) => ({
|
|
25
|
-
value: e,
|
|
26
|
-
label: n[e]
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
var a = {
|
|
30
|
-
createdAtLabel: "created_at",
|
|
31
|
-
updatedAtLabel: "updated_at"
|
|
32
|
-
};
|
|
33
|
-
function o(e) {
|
|
34
|
-
return e && a[e] || "created_at";
|
|
35
|
-
}
|
|
36
|
-
var s = new Intl.DateTimeFormat(void 0, {
|
|
37
|
-
year: "numeric",
|
|
38
|
-
month: "short",
|
|
39
|
-
day: "numeric"
|
|
40
|
-
});
|
|
41
|
-
function c(e) {
|
|
42
|
-
if (!e) return "";
|
|
43
|
-
let t = new Date(e);
|
|
44
|
-
return Number.isNaN(t.getTime()) ? "" : s.format(t);
|
|
45
|
-
}
|
|
46
|
-
function l() {
|
|
47
|
-
let e = globalThis.getSelection?.();
|
|
48
|
-
return !!(e && e.toString().length > 0);
|
|
49
|
-
}
|
|
50
|
-
function u(e) {
|
|
51
|
-
let t = {};
|
|
52
|
-
for (let n of e ?? []) t[n.tag_id] = n.keywords;
|
|
53
|
-
return t;
|
|
54
|
-
}
|
|
55
|
-
function d(e) {
|
|
56
|
-
let t = {};
|
|
57
|
-
for (let n of e ?? []) t[n.id] = `${n.first_name ?? ""} ${n.last_name ?? ""}`.trim();
|
|
58
|
-
return t;
|
|
59
|
-
}
|
|
60
|
-
function f({ tags: e, keywordsByTagId: t, userNamesById: n }) {
|
|
61
|
-
return e.map((e) => ({
|
|
62
|
-
id: e.id,
|
|
63
|
-
name: e.name,
|
|
64
|
-
categoryLabel: r(e.category),
|
|
65
|
-
keywords: (t[e.id] ?? []).join(", "),
|
|
66
|
-
createdAtLabel: c(e.created_at),
|
|
67
|
-
updatedAtLabel: c(e.updated_at),
|
|
68
|
-
createdByLabel: e.created_by_entity_user_id ? n[e.created_by_entity_user_id] ?? "" : ""
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
function p(t, n = e) {
|
|
72
|
-
let r = {}, i = t.name.trim();
|
|
73
|
-
i.length === 0 ? r.name = n.nameRequired : i.length > 255 && (r.name = n.nameTooLong);
|
|
74
|
-
let a = t.keywords.some((e) => e.length < 2), o = t.keywords.some((e) => e.length > 25);
|
|
75
|
-
return a ? r.keywords = n.keywordTooShort : o && (r.keywords = n.keywordTooLong), r;
|
|
76
|
-
}
|
|
77
|
-
function m(e) {
|
|
78
|
-
return !!(e.name || e.keywords);
|
|
79
|
-
}
|
|
80
|
-
function h(e, t, n) {
|
|
81
|
-
let r = e ?? [], i = r.filter((e) => e.tag_id !== t), a = Array.from(new Set(n));
|
|
82
|
-
return i.length === r.length && a.length === 0 ? {
|
|
83
|
-
changed: !1,
|
|
84
|
-
next: r
|
|
85
|
-
} : {
|
|
86
|
-
changed: !0,
|
|
87
|
-
next: a.length ? [...i, {
|
|
88
|
-
tag_id: t,
|
|
89
|
-
keywords: a,
|
|
90
|
-
enabled: !0
|
|
91
|
-
}] : i
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function g(e) {
|
|
95
|
-
return e === "This tag already exists.";
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { t as TAG_CATEGORIES, u as buildKeywordsByTagId, f as buildTagRows, d as buildUserNamesById, h as computeNextOcrAutoTagging, c as formatTagDate, i as getCategoryOptions, r as getTagCategoryLabel, m as hasFormErrors, l as hasSelectedText, g as isDuplicateTagNameError, o as sortFieldForColumn, p as validateTagForm };
|
|
1
|
+
import { TAG_MESSAGE_LABELS_EN as e } from "../../../../shared/tag-selection/feature/dist/lib/labels.js";
|
|
2
|
+
import "../../../../shared/tag-selection/feature/dist/index.js";
|
|
3
|
+
export { e as TAG_MESSAGE_LABELS_EN };
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index6.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { buildKeywordsByTagId as e, buildUserNamesById as t } from "./
|
|
5
|
+
import { buildKeywordsByTagId as e, buildUserNamesById as t } from "./index4.js";
|
|
6
6
|
import { useMyEntityQuery as n } from "../../data-access/dist/index2.js";
|
|
7
7
|
import { useEntitySettingsQuery as r } from "../../data-access/dist/index3.js";
|
|
8
8
|
import { useEntityUsersQuery as i } from "../../data-access/dist/index6.js";
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { useUpdateEntitySettingsMutation as t } from "../../data-access/dist/index5.js";
|
|
7
|
-
import "../../data-access/dist/index.js";
|
|
8
|
-
import { useDeleteTagMutation as n } from "../../../../shared/tag-selection/data-access/dist/index6.js";
|
|
5
|
+
import { useDeleteTagMutation as e } from "../../../../shared/tag-selection/data-access/dist/index7.js";
|
|
9
6
|
import "../../../../shared/tag-selection/data-access/dist/index.js";
|
|
7
|
+
import { computeNextOcrAutoTagging as t } from "./index4.js";
|
|
8
|
+
import { useUpdateEntitySettingsMutation as n } from "../../data-access/dist/index5.js";
|
|
9
|
+
import "../../data-access/dist/index.js";
|
|
10
10
|
import { useCallback as r, useState as i } from "react";
|
|
11
11
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js
|
|
12
12
|
function a({ selectedTag: a, setSelectedTag: o, settings: s }) {
|
|
13
|
-
let { entityId: c, requireFreshSettings: l } = s, u =
|
|
13
|
+
let { entityId: c, requireFreshSettings: l } = s, u = e(), d = n(), [f, p] = i(!1), m = r((e) => {
|
|
14
14
|
o(e), p(!0);
|
|
15
15
|
}, [o]), h = r((e) => {
|
|
16
16
|
e || p(!1);
|
|
@@ -21,9 +21,9 @@ function a({ selectedTag: a, setSelectedTag: o, settings: s }) {
|
|
|
21
21
|
onOpenChange: h,
|
|
22
22
|
confirm: r(async () => {
|
|
23
23
|
if (a) try {
|
|
24
|
-
let
|
|
25
|
-
if (await u.mutateAsync({ path: { tag_id: a.id } }), c &&
|
|
26
|
-
let { changed: n, next: r } = e
|
|
24
|
+
let e = c ? await l() : void 0;
|
|
25
|
+
if (await u.mutateAsync({ path: { tag_id: a.id } }), c && e) {
|
|
26
|
+
let { changed: n, next: r } = t(e.payables_ocr_auto_tagging, a.id, []);
|
|
27
27
|
n && await d.mutateAsync({
|
|
28
28
|
path: { entity_id: c },
|
|
29
29
|
body: { payables_ocr_auto_tagging: r }
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js
CHANGED
|
@@ -2,103 +2,103 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../../data-access/dist/index.js";
|
|
10
|
-
import { useCreateTagMutation as l } from "../../../../shared/tag-selection/data-access/dist/index4.js";
|
|
11
|
-
import { useUpdateTagMutation as u } from "../../../../shared/tag-selection/data-access/dist/index5.js";
|
|
5
|
+
import { EMPTY_FORM_VALUES as e } from "./index3.js";
|
|
6
|
+
import { getCategoryOptions as t, hasFormErrors as n, resolveTagSubmitError as r, validateTagForm as i } from "../../../../shared/tag-selection/feature/dist/lib/helpers.js";
|
|
7
|
+
import { useCreateTagMutation as a } from "../../../../shared/tag-selection/data-access/dist/index5.js";
|
|
8
|
+
import { useUpdateTagMutation as o } from "../../../../shared/tag-selection/data-access/dist/index6.js";
|
|
12
9
|
import "../../../../shared/tag-selection/data-access/dist/index.js";
|
|
13
|
-
import
|
|
10
|
+
import "../../../../shared/tag-selection/feature/dist/index.js";
|
|
11
|
+
import { buildKeywordsByTagId as s, computeNextOcrAutoTagging as c } from "./index4.js";
|
|
12
|
+
import { useUpdateEntitySettingsMutation as l } from "../../data-access/dist/index5.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { useCallback as u, useMemo as d, useState as f } from "react";
|
|
14
15
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js
|
|
15
|
-
function
|
|
16
|
-
let { entityId:
|
|
16
|
+
function p({ selectedTag: p, setSelectedTag: m, settings: h, messages: g }) {
|
|
17
|
+
let { entityId: _, settingsData: v, refetchSettings: y, requireFreshSettings: b } = h, x = a(), S = o(), C = l(), [w, T] = f(!1), [E, D] = f("create"), [O, k] = f(e), [A, j] = f({});
|
|
17
18
|
return {
|
|
18
|
-
open:
|
|
19
|
-
mode:
|
|
20
|
-
values:
|
|
21
|
-
errors:
|
|
22
|
-
categoryOptions:
|
|
23
|
-
isSubmitting:
|
|
24
|
-
openCreate:
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
openEdit:
|
|
19
|
+
open: w,
|
|
20
|
+
mode: E,
|
|
21
|
+
values: O,
|
|
22
|
+
errors: A,
|
|
23
|
+
categoryOptions: d(() => t(), []),
|
|
24
|
+
isSubmitting: x.isPending || S.isPending || C.isPending,
|
|
25
|
+
openCreate: u(() => {
|
|
26
|
+
D("create"), m(void 0), k(e), j({}), T(!0);
|
|
27
|
+
}, [m]),
|
|
28
|
+
openEdit: u((e) => {
|
|
28
29
|
(async () => {
|
|
29
|
-
let t =
|
|
30
|
-
|
|
30
|
+
let t = v ?? await y(), n = s(t?.payables_ocr_auto_tagging);
|
|
31
|
+
m(e), D("edit"), k({
|
|
31
32
|
name: e.name,
|
|
32
33
|
category: e.category ?? "",
|
|
33
|
-
keywords:
|
|
34
|
+
keywords: n[e.id] ?? [],
|
|
34
35
|
keywordsInput: ""
|
|
35
|
-
}),
|
|
36
|
+
}), j({}), T(!0);
|
|
36
37
|
})();
|
|
37
38
|
}, [
|
|
39
|
+
v,
|
|
38
40
|
y,
|
|
39
|
-
|
|
40
|
-
h
|
|
41
|
+
m
|
|
41
42
|
]),
|
|
42
|
-
onOpenChange:
|
|
43
|
-
e ||
|
|
43
|
+
onOpenChange: u((e) => {
|
|
44
|
+
e || T(!1);
|
|
44
45
|
}, []),
|
|
45
|
-
close:
|
|
46
|
-
onNameChange:
|
|
46
|
+
close: u(() => T(!1), []),
|
|
47
|
+
onNameChange: u((e) => k((t) => ({
|
|
47
48
|
...t,
|
|
48
49
|
name: e
|
|
49
50
|
})), []),
|
|
50
|
-
onCategoryChange:
|
|
51
|
+
onCategoryChange: u((e) => k((t) => ({
|
|
51
52
|
...t,
|
|
52
53
|
category: e
|
|
53
54
|
})), []),
|
|
54
|
-
onKeywordsChange:
|
|
55
|
+
onKeywordsChange: u((e) => k((t) => ({
|
|
55
56
|
...t,
|
|
56
57
|
keywords: e
|
|
57
58
|
})), []),
|
|
58
|
-
onKeywordsInputChange:
|
|
59
|
+
onKeywordsInputChange: u((e) => k((t) => ({
|
|
59
60
|
...t,
|
|
60
61
|
keywordsInput: e
|
|
61
62
|
})), []),
|
|
62
|
-
submit:
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
65
|
-
|
|
63
|
+
submit: u(async () => {
|
|
64
|
+
let e = i(O, g);
|
|
65
|
+
if (n(e)) {
|
|
66
|
+
j(e);
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
let
|
|
70
|
-
name:
|
|
71
|
-
...
|
|
69
|
+
j({});
|
|
70
|
+
let t = O.name.trim(), a = O.category === "" ? void 0 : O.category, o = {
|
|
71
|
+
name: t,
|
|
72
|
+
...a ? { category: a } : {}
|
|
72
73
|
};
|
|
73
74
|
try {
|
|
74
|
-
let e =
|
|
75
|
-
path: { tag_id:
|
|
76
|
-
body:
|
|
77
|
-
}) : await
|
|
78
|
-
if (
|
|
79
|
-
let { changed: e, next:
|
|
80
|
-
e && await
|
|
81
|
-
path: { entity_id:
|
|
82
|
-
body: { payables_ocr_auto_tagging:
|
|
75
|
+
let e = O.keywords.length > 0 || E === "edit", t = _ && e ? await b() : void 0, n = E === "edit" && p ? await S.mutateAsync({
|
|
76
|
+
path: { tag_id: p.id },
|
|
77
|
+
body: o
|
|
78
|
+
}) : await x.mutateAsync({ body: o });
|
|
79
|
+
if (_ && t) {
|
|
80
|
+
let { changed: e, next: r } = c(t.payables_ocr_auto_tagging, n.id, O.keywords);
|
|
81
|
+
e && await C.mutateAsync({
|
|
82
|
+
path: { entity_id: _ },
|
|
83
|
+
body: { payables_ocr_auto_tagging: r }
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
-
} catch (
|
|
87
|
-
|
|
88
|
-
o(n) ? M({ name: n }) : M({ form: n ?? _.genericError });
|
|
86
|
+
T(!1);
|
|
87
|
+
} catch (e) {
|
|
88
|
+
j(r(e, g));
|
|
89
89
|
}
|
|
90
90
|
}, [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
O,
|
|
92
|
+
E,
|
|
93
|
+
p,
|
|
94
|
+
_,
|
|
95
|
+
x,
|
|
95
96
|
S,
|
|
96
97
|
C,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
x
|
|
98
|
+
g,
|
|
99
|
+
b
|
|
100
100
|
])
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
|
-
export {
|
|
104
|
+
export { p as useTagForm };
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { useTagsQuery as n } from "../../../../shared/tag-selection/data-access/dist/index2.js";
|
|
5
|
+
import { useTagsQuery as e } from "../../../../shared/tag-selection/data-access/dist/index2.js";
|
|
7
6
|
import "../../../../shared/tag-selection/data-access/dist/index.js";
|
|
7
|
+
import { buildTagRows as t, sortFieldForColumn as n } from "./index4.js";
|
|
8
8
|
import { useCallback as r, useMemo as i, useState as a } from "react";
|
|
9
9
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js
|
|
10
10
|
function o({ keywordsByTagId: o, userNamesById: s }) {
|
|
11
11
|
let [c, l] = a([{
|
|
12
12
|
id: "createdAtLabel",
|
|
13
13
|
desc: !0
|
|
14
|
-
}]), [u, d] = a(10), [f, p] = a(), m =
|
|
14
|
+
}]), [u, d] = a(10), [f, p] = a(), m = n(c[0]?.id), h = c[0]?.desc ? "desc" : "asc", g = e({
|
|
15
15
|
sort: m,
|
|
16
16
|
order: h,
|
|
17
17
|
limit: u,
|
|
18
18
|
pagination_token: f
|
|
19
|
-
}), _ = i(() =>
|
|
19
|
+
}), _ = i(() => t({
|
|
20
20
|
tags: g.data?.data ?? [],
|
|
21
21
|
keywordsByTagId: o,
|
|
22
22
|
userNamesById: s
|
|
@@ -25,9 +25,9 @@ function o({ keywordsByTagId: o, userNamesById: s }) {
|
|
|
25
25
|
o,
|
|
26
26
|
s
|
|
27
27
|
]), v = r((e) => (g.data?.data ?? []).find((t) => t.id === e), [g.data]), y = r((e) => {
|
|
28
|
-
let
|
|
29
|
-
l(
|
|
30
|
-
let r = t
|
|
28
|
+
let t = typeof e == "function" ? e(c) : e;
|
|
29
|
+
l(t);
|
|
30
|
+
let r = n(t[0]?.id), i = t[0]?.desc ? "desc" : "asc";
|
|
31
31
|
(r !== m || i !== h) && p(void 0);
|
|
32
32
|
}, [
|
|
33
33
|
c,
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.126", n = "351a9209eea8cd0856a6804bb3f29134109e3b42", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useTagsQuery as e } from "./index2.js";
|
|
2
2
|
import "./index3.js";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import "./index4.js";
|
|
4
|
+
import { useCreateTagMutation as t } from "./index5.js";
|
|
5
|
+
import { useUpdateTagMutation as n } from "./index6.js";
|
|
6
|
+
import { useDeleteTagMutation as r } from "./index7.js";
|
|
6
7
|
export { t as useCreateTagMutation, r as useDeleteTagMutation, e as useTagsQuery, n as useUpdateTagMutation };
|
package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index3.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
3
5
|
import "../../../data-access/dist/index.js";
|
|
4
|
-
|
|
5
|
-
var n = ({ client: n, organizationId: r }) => e({
|
|
6
|
-
client: n,
|
|
7
|
-
headers: t(r)
|
|
8
|
-
});
|
|
9
|
-
//#endregion
|
|
10
|
-
export { n as tagsInvalidationKey };
|
|
6
|
+
import "@tanstack/react-query";
|
package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index4.js
CHANGED
|
@@ -1,34 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { postTags as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
-
import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
|
|
7
|
-
import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
-
import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
|
|
1
|
+
import { getTagsQueryKey as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
2
|
+
import { organizationHeaders as t } from "../../../data-access/dist/lib/organizationHeaders.js";
|
|
9
3
|
import "../../../data-access/dist/index.js";
|
|
10
|
-
import { tagsInvalidationKey as i } from "./index3.js";
|
|
11
|
-
import { useMutation as a } from "@tanstack/react-query";
|
|
12
4
|
//#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index4.js
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let { data: n } = await e({
|
|
18
|
-
client: o,
|
|
19
|
-
headers: r(s),
|
|
20
|
-
body: t,
|
|
21
|
-
throwOnError: !0
|
|
22
|
-
});
|
|
23
|
-
return n;
|
|
24
|
-
},
|
|
25
|
-
onSuccess: async () => {
|
|
26
|
-
await t(i({
|
|
27
|
-
client: o,
|
|
28
|
-
organizationId: s
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
5
|
+
var n = ({ client: n, organizationId: r }) => e({
|
|
6
|
+
client: n,
|
|
7
|
+
headers: t(r)
|
|
8
|
+
});
|
|
33
9
|
//#endregion
|
|
34
|
-
export {
|
|
10
|
+
export { n as tagsInvalidationKey };
|
package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index5.js
CHANGED
|
@@ -2,26 +2,25 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { postTags as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
|
|
6
6
|
import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
|
|
7
7
|
import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
8
|
import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
|
|
9
9
|
import "../../../data-access/dist/index.js";
|
|
10
|
-
import { tagsInvalidationKey as i } from "./
|
|
10
|
+
import { tagsInvalidationKey as i } from "./index4.js";
|
|
11
11
|
import { useMutation as a } from "@tanstack/react-query";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index5.js
|
|
13
13
|
function o() {
|
|
14
14
|
let { client: o, organizationId: s } = n();
|
|
15
15
|
return a({
|
|
16
|
-
mutationFn: async ({
|
|
17
|
-
let { data:
|
|
16
|
+
mutationFn: async ({ body: t }) => {
|
|
17
|
+
let { data: n } = await e({
|
|
18
18
|
client: o,
|
|
19
19
|
headers: r(s),
|
|
20
|
-
|
|
21
|
-
body: n,
|
|
20
|
+
body: t,
|
|
22
21
|
throwOnError: !0
|
|
23
22
|
});
|
|
24
|
-
return
|
|
23
|
+
return n;
|
|
25
24
|
},
|
|
26
25
|
onSuccess: async () => {
|
|
27
26
|
await t(i({
|
|
@@ -32,4 +31,4 @@ function o() {
|
|
|
32
31
|
});
|
|
33
32
|
}
|
|
34
33
|
//#endregion
|
|
35
|
-
export { o as
|
|
34
|
+
export { o as useCreateTagMutation };
|