@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.
Files changed (27) hide show
  1. package/dist/index.css +6 -0
  2. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index10.js +3 -2
  3. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js +9 -9
  4. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js +58 -7
  5. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js +3 -98
  6. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index6.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js +8 -8
  8. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js +62 -62
  9. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js +7 -7
  10. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index.js +4 -3
  12. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index3.js +5 -9
  13. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index4.js +7 -31
  14. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index5.js +7 -8
  15. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index6.js +7 -5
  16. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index7.js +33 -0
  17. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/index.js +5 -0
  18. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/TagSelectorField.js +11 -0
  19. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/helpers.js +38 -0
  20. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/labels.js +19 -0
  21. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/permissions.js +4 -0
  22. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/useTagCreateForm.js +6 -0
  23. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index.js +1 -0
  24. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index3.js +30 -30
  25. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index4.js +4 -0
  26. package/dist/packages/shared-ui-shadcn/dist/index.js +1196 -1190
  27. 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
  }
@@ -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 "./index4.js";
6
- import { hasSelectedText as t } from "./index5.js";
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";
@@ -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 { useTagsWidget as a } from "./index10.js";
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 } = a({ messageLabels: h });
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(o, {
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(c, {
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(s, {
65
+ /* @__PURE__ */ d(c, {
66
66
  open: b.open,
67
67
  onOpenChange: b.onOpenChange,
68
68
  tagName: _?.name ?? "",
@@ -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 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."
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 { e as TAG_MESSAGE_LABELS_EN };
61
+ export { o as buildKeywordsByTagId, c as buildTagRows, s as buildUserNamesById, l as computeNextOcrAutoTagging, i as formatTagDate, a as hasSelectedText, n as sortFieldForColumn };
@@ -1,98 +1,3 @@
1
- import { TAG_MESSAGE_LABELS_EN as e } from "./index4.js";
2
- //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js
3
- var t = [
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 };
@@ -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 "./index5.js";
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";
@@ -2,15 +2,15 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { computeNextOcrAutoTagging as e } from "./index5.js";
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 = n(), d = t(), [f, p] = i(!1), m = r((e) => {
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 t = c ? await l() : void 0;
25
- if (await u.mutateAsync({ path: { tag_id: a.id } }), c && t) {
26
- let { changed: n, next: r } = e(t.payables_ocr_auto_tagging, a.id, []);
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 }
@@ -2,103 +2,103 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { extractApiErrorMessage as e } from "../../../../shared/util/dist/lib/apiErrors.js";
6
- import { EMPTY_FORM_VALUES as t } from "./index3.js";
7
- import { buildKeywordsByTagId as n, computeNextOcrAutoTagging as r, getCategoryOptions as i, hasFormErrors as a, isDuplicateTagNameError as o, validateTagForm as s } from "./index5.js";
8
- import { useUpdateEntitySettingsMutation as c } from "../../data-access/dist/index5.js";
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 { useCallback as d, useMemo as f, useState as p } from "react";
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 m({ selectedTag: m, setSelectedTag: h, settings: g, messages: _ }) {
16
- let { entityId: v, settingsData: y, refetchSettings: b, requireFreshSettings: x } = g, S = l(), C = u(), w = c(), [T, E] = p(!1), [D, O] = p("create"), [k, A] = p(t), [j, M] = p({});
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: T,
19
- mode: D,
20
- values: k,
21
- errors: j,
22
- categoryOptions: f(() => i(), []),
23
- isSubmitting: S.isPending || C.isPending || w.isPending,
24
- openCreate: d(() => {
25
- O("create"), h(void 0), A(t), M({}), E(!0);
26
- }, [h]),
27
- openEdit: d((e) => {
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 = y ?? await b(), r = n(t?.payables_ocr_auto_tagging);
30
- h(e), O("edit"), A({
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: r[e.id] ?? [],
34
+ keywords: n[e.id] ?? [],
34
35
  keywordsInput: ""
35
- }), M({}), E(!0);
36
+ }), j({}), T(!0);
36
37
  })();
37
38
  }, [
39
+ v,
38
40
  y,
39
- b,
40
- h
41
+ m
41
42
  ]),
42
- onOpenChange: d((e) => {
43
- e || E(!1);
43
+ onOpenChange: u((e) => {
44
+ e || T(!1);
44
45
  }, []),
45
- close: d(() => E(!1), []),
46
- onNameChange: d((e) => A((t) => ({
46
+ close: u(() => T(!1), []),
47
+ onNameChange: u((e) => k((t) => ({
47
48
  ...t,
48
49
  name: e
49
50
  })), []),
50
- onCategoryChange: d((e) => A((t) => ({
51
+ onCategoryChange: u((e) => k((t) => ({
51
52
  ...t,
52
53
  category: e
53
54
  })), []),
54
- onKeywordsChange: d((e) => A((t) => ({
55
+ onKeywordsChange: u((e) => k((t) => ({
55
56
  ...t,
56
57
  keywords: e
57
58
  })), []),
58
- onKeywordsInputChange: d((e) => A((t) => ({
59
+ onKeywordsInputChange: u((e) => k((t) => ({
59
60
  ...t,
60
61
  keywordsInput: e
61
62
  })), []),
62
- submit: d(async () => {
63
- let t = s(k, _);
64
- if (a(t)) {
65
- M(t);
63
+ submit: u(async () => {
64
+ let e = i(O, g);
65
+ if (n(e)) {
66
+ j(e);
66
67
  return;
67
68
  }
68
- M({});
69
- let n = k.name.trim(), i = k.category === "" ? void 0 : k.category, c = {
70
- name: n,
71
- ...i ? { category: i } : {}
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 = k.keywords.length > 0 || D === "edit", t = v && e ? await x() : void 0, n = D === "edit" && m ? await C.mutateAsync({
75
- path: { tag_id: m.id },
76
- body: c
77
- }) : await S.mutateAsync({ body: c });
78
- if (v && t) {
79
- let { changed: e, next: i } = r(t.payables_ocr_auto_tagging, n.id, k.keywords);
80
- e && await w.mutateAsync({
81
- path: { entity_id: v },
82
- body: { payables_ocr_auto_tagging: i }
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
- E(!1);
86
- } catch (t) {
87
- let n = e(t);
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
- k,
92
- D,
93
- m,
94
- v,
91
+ O,
92
+ E,
93
+ p,
94
+ _,
95
+ x,
95
96
  S,
96
97
  C,
97
- w,
98
- _,
99
- x
98
+ g,
99
+ b
100
100
  ])
101
101
  };
102
102
  }
103
103
  //#endregion
104
- export { m as useTagForm };
104
+ export { p as useTagForm };
@@ -2,21 +2,21 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { buildTagRows as e, sortFieldForColumn as t } from "./index5.js";
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 = t(c[0]?.id), h = c[0]?.desc ? "desc" : "asc", g = n({
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(() => e({
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 n = typeof e == "function" ? e(c) : e;
29
- l(n);
30
- let r = t(n[0]?.id), i = n[0]?.desc ? "desc" : "asc";
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,
@@ -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.125", n = "1c2d5f60f2fc1903e53970b963fc5bfdd4508b70", r = Object.freeze({
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
@@ -1,6 +1,7 @@
1
1
  import { useTagsQuery as e } from "./index2.js";
2
2
  import "./index3.js";
3
- import { useCreateTagMutation as t } from "./index4.js";
4
- import { useUpdateTagMutation as n } from "./index5.js";
5
- import { useDeleteTagMutation as r } from "./index6.js";
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 };
@@ -1,10 +1,6 @@
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";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
3
5
  import "../../../data-access/dist/index.js";
4
- //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index3.js
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";
@@ -1,34 +1,10 @@
1
- "use client";
2
- "use client";
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
- function o() {
14
- let { client: o, organizationId: s } = n();
15
- return a({
16
- mutationFn: async ({ body: t }) => {
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 { o as useCreateTagMutation };
10
+ export { n as tagsInvalidationKey };
@@ -2,26 +2,25 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { patchTagsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
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 "./index3.js";
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 ({ path: t, body: n }) => {
17
- let { data: i } = await e({
16
+ mutationFn: async ({ body: t }) => {
17
+ let { data: n } = await e({
18
18
  client: o,
19
19
  headers: r(s),
20
- path: t,
21
- body: n,
20
+ body: t,
22
21
  throwOnError: !0
23
22
  });
24
- return i;
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 useUpdateTagMutation };
34
+ export { o as useCreateTagMutation };