@tesouro/embedded-components-react 0.5.125 → 0.5.128

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 (28) hide show
  1. package/dist/index.css +6 -0
  2. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index8.js +91 -91
  3. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index10.js +3 -2
  4. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js +9 -9
  5. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js +58 -7
  6. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js +3 -98
  7. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index6.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js +8 -8
  9. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js +62 -62
  10. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js +7 -7
  11. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index.js +4 -3
  13. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index3.js +5 -9
  14. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index4.js +7 -31
  15. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index5.js +7 -8
  16. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index6.js +7 -5
  17. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index7.js +33 -0
  18. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/index.js +5 -0
  19. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/TagSelectorField.js +11 -0
  20. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/helpers.js +38 -0
  21. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/labels.js +19 -0
  22. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/permissions.js +4 -0
  23. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/useTagCreateForm.js +6 -0
  24. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index.js +1 -0
  25. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index3.js +30 -30
  26. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index4.js +4 -0
  27. package/dist/packages/shared-ui-shadcn/dist/index.js +1196 -1190
  28. 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
  }
@@ -11,96 +11,96 @@ import { AccountDetailsWidgetAnalyticsEvent as i } from "./index2.js";
11
11
  import { formatDateParam as a, getDefaultExportDateRange as te, isExportRangeValid as o, startOfLocalDay as s, triggerCsvDownload as c, yesterdayLocal as l } from "./index3.js";
12
12
  import { copyTextToClipboard as ne, formatAmountLabel as u, formatSignedTransactionAmountLabel as re, formatTransactionDateLabel as ie, maskAccountNumber as ae } from "./index4.js";
13
13
  import { DEFAULT_FEATURE_LABELS as oe } from "./index5.js";
14
- import { getBankAccountsPermissions as d } from "./index6.js";
15
- import { interpolateLabel as f } from "./index7.js";
16
- import { useBankAccountDetailsQuery as p } from "../../data-access/dist/index2.js";
17
- import { useBankAccountTransactionsQuery as m } from "../../data-access/dist/index3.js";
18
- import { useDownloadBankAccountTransactionsMutation as h } from "../../data-access/dist/index4.js";
19
- import { useUpdateBankAccountMutation as g } from "../../data-access/dist/index5.js";
14
+ import { getBankAccountsPermissions as se } from "./index6.js";
15
+ import { interpolateLabel as d } from "./index7.js";
16
+ import { useBankAccountDetailsQuery as f } from "../../data-access/dist/index2.js";
17
+ import { useBankAccountTransactionsQuery as p } from "../../data-access/dist/index3.js";
18
+ import { useDownloadBankAccountTransactionsMutation as m } from "../../data-access/dist/index4.js";
19
+ import { useUpdateBankAccountMutation as h } from "../../data-access/dist/index5.js";
20
20
  import "../../data-access/dist/index.js";
21
- import { DEFAULT_LABELS as se } from "../../ui/dist/index7.js";
22
- import { AccountDetailsWidgetUi as ce } from "../../ui/dist/index8.js";
21
+ import { DEFAULT_LABELS as ce } from "../../ui/dist/index7.js";
22
+ import { AccountDetailsWidgetUi as le } from "../../ui/dist/index8.js";
23
23
  import "../../ui/dist/index.js";
24
- import { useCallback as _, useEffect as le, useMemo as v, useState as y } from "react";
25
- import { jsx as ue } from "react/jsx-runtime";
24
+ import { useCallback as g, useEffect as ue, useMemo as _, useState as v } from "react";
25
+ import { jsx as de } from "react/jsx-runtime";
26
26
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index8.js
27
- var de = 3e3, fe = 5e3, pe = { nickname: "" };
28
- function b({ accountId: b, onBack: me, labels: he, featureLabels: ge, isBankingTaglineVisible: _e = !0, bankLogoSrc: ve, bankLogoAlt: ye, bankAddress: be, supportTeamUrl: xe }) {
29
- let x = {
30
- ...se,
31
- ...he
32
- }, S = {
33
- ...oe,
27
+ var fe = 3e3, pe = 5e3, me = { nickname: "" };
28
+ function y({ accountId: y, onBack: he, labels: ge, featureLabels: _e, isBankingTaglineVisible: ve = !0, bankLogoSrc: ye, bankLogoAlt: be, bankAddress: xe, supportTeamUrl: Se }) {
29
+ let b = {
30
+ ...ce,
34
31
  ...ge
35
- }, C = t(), { organizationId: Se, widgetToken: Ce, initResponse: w } = n(), T = ee(), E = !!r(), D = !!(Se && Ce), O = v(() => d(w?.scopes), [w?.scopes]), k = D && O.canRead && !!w, [A, we] = y("transactions"), [Te, j] = y(!1), [M, N] = y(pe), [Ee, De] = y(!1), [Oe, P] = y(!1), [ke, F] = y(!1), [Ae, je] = y(!1), [Me, I] = y(!1), [L, R] = y(), [z, B] = y();
36
- le(() => {
37
- C(i.Mounted);
38
- }, [C]);
39
- let V = p({
40
- id: b,
32
+ }, x = {
33
+ ...oe,
34
+ ..._e
35
+ }, S = t(), { organizationId: Ce, widgetToken: we, initResponse: C } = n(), w = ee(), T = !!r(), E = !!(Ce && we), D = _(() => se(C?.scopes), [C?.scopes]), O = D.canRead && !!C, k = E && O, [A, Te] = v("transactions"), [Ee, j] = v(!1), [M, N] = v(me), [De, Oe] = v(!1), [ke, P] = v(!1), [Ae, F] = v(!1), [je, Me] = v(!1), [Ne, I] = v(!1), [L, R] = v(), [z, B] = v();
36
+ ue(() => {
37
+ S(i.Mounted);
38
+ }, [S]);
39
+ let V = f({
40
+ id: y,
41
41
  enabled: k
42
- }), H = m({
43
- id: b,
42
+ }), H = p({
43
+ id: y,
44
44
  enabled: k && A === "transactions",
45
45
  limit: 25,
46
46
  sortBy: "DATE",
47
47
  sortOrder: "DESC"
48
- }), Ne = g(), Pe = h(), { mutate: Fe, isPending: Ie, isError: U, reset: W } = Ne, { mutateAsync: G, isPending: Le } = Pe, K = k ? V.data : void 0, q = w?.bankName?.trim() ?? "", J = be?.trim() || void 0, Y = { bankName: q }, Re = v(() => f(x.domesticWireIntro, Y), [x.domesticWireIntro, q]), ze = v(() => f(x.domesticWireNote, Y), [x.domesticWireNote, q]), Be = v(() => f(x.thingsToKnowBody, Y), [x.thingsToKnowBody, q]), X = K?.nickname?.trim() || S.accountFallback, Ve = u(K?.balance), Z = v(() => (H.data?.data ?? []).map((e, t) => ({
48
+ }), Pe = h(), Fe = m(), { mutate: Ie, isPending: Le, isError: U, reset: W } = Pe, { mutateAsync: G, isPending: Re } = Fe, K = O ? V.data : void 0, q = C?.bankName?.trim() ?? "", J = xe?.trim() || void 0, Y = { bankName: q }, ze = _(() => d(b.domesticWireIntro, Y), [b.domesticWireIntro, q]), Be = _(() => d(b.domesticWireNote, Y), [b.domesticWireNote, q]), X = _(() => d(b.thingsToKnowBody, Y), [b.thingsToKnowBody, q]), Ve = K?.nickname?.trim() || x.accountFallback, He = u(K?.balance), Z = _(() => (H.data?.data ?? []).map((e, t) => ({
49
49
  key: `${e.date}-${t}`,
50
50
  descriptionLabel: e.description,
51
51
  dateLabel: ie(e.date),
52
52
  amountLabel: re(e.amount, e.direction),
53
53
  amountVariant: e.direction === "CREDIT" ? "positive" : "default",
54
54
  balanceLabel: u(e.runningBalance)
55
- })), [H.data?.data]), He = O.canRead && Z.length > 0, Ue = !o(L, z), We = v(() => {
55
+ })), [H.data?.data]), Ue = D.canRead && Z.length > 0, We = !o(L, z), Ge = _(() => {
56
56
  let e = [{ after: l() }];
57
57
  return z && e.push({ after: s(z) }), e;
58
- }, [z]), Ge = v(() => {
58
+ }, [z]), Ke = _(() => {
59
59
  let e = [{ after: l() }];
60
60
  return L && e.push({ before: s(L) }), e;
61
- }, [L]), Ke = _((e) => {
61
+ }, [L]), qe = g((e) => {
62
62
  if (e) {
63
63
  let { startDate: e, endDate: t } = te();
64
64
  R(e), B(t);
65
65
  }
66
66
  I(e);
67
- }, []), qe = _(async () => {
68
- if (!D || !O.canRead || !L || !z || !o(L, z)) return;
67
+ }, []), Je = g(async () => {
68
+ if (!E || !D.canRead || !L || !z || !o(L, z)) return;
69
69
  I(!1);
70
- let t = e.loading(S.exportLoadingToast);
70
+ let t = e.loading(x.exportLoadingToast);
71
71
  try {
72
72
  let n = await G({
73
- id: b,
73
+ id: y,
74
74
  startDate: a(L),
75
75
  endDate: a(z)
76
76
  });
77
- c(n.csv, n.filename), e.success(S.exportSuccessToast, {
77
+ c(n.csv, n.filename), e.success(x.exportSuccessToast, {
78
78
  id: t,
79
- duration: de
79
+ duration: fe
80
80
  });
81
81
  } catch {
82
- e.error(S.exportErrorToast, {
82
+ e.error(x.exportErrorToast, {
83
83
  id: t,
84
- duration: fe
84
+ duration: pe
85
85
  });
86
86
  }
87
87
  }, [
88
- b,
88
+ y,
89
89
  G,
90
90
  z,
91
91
  L,
92
- S.exportErrorToast,
93
- S.exportLoadingToast,
94
- S.exportSuccessToast,
95
- D,
96
- O.canRead
97
- ]), Q = _(async (t, n) => {
92
+ x.exportErrorToast,
93
+ x.exportLoadingToast,
94
+ x.exportSuccessToast,
95
+ E,
96
+ D.canRead
97
+ ]), Q = g(async (t, n) => {
98
98
  if (!await ne(t)) return;
99
99
  let r = {
100
- account: S.copyAccountNumberToast,
101
- routing: S.copyRoutingNumberToast,
102
- bankName: S.copyBankNameToast,
103
- bankAddress: S.copyBankAddressToast
100
+ account: x.copyAccountNumberToast,
101
+ routing: x.copyRoutingNumberToast,
102
+ bankName: x.copyBankNameToast,
103
+ bankAddress: x.copyBankAddressToast
104
104
  };
105
105
  if (e.success(r[n]), n === "account") {
106
106
  P(!0), window.setTimeout(() => P(!1), 2e3);
@@ -108,89 +108,89 @@ function b({ accountId: b, onBack: me, labels: he, featureLabels: ge, isBankingT
108
108
  }
109
109
  n === "routing" && (F(!0), window.setTimeout(() => F(!1), 2e3));
110
110
  }, [
111
- S.copyAccountNumberToast,
112
- S.copyBankAddressToast,
113
- S.copyBankNameToast,
114
- S.copyRoutingNumberToast
111
+ x.copyAccountNumberToast,
112
+ x.copyBankAddressToast,
113
+ x.copyBankNameToast,
114
+ x.copyRoutingNumberToast
115
115
  ]), $ = (e) => {
116
116
  e && (N({ nickname: K?.nickname?.trim() ?? "" }), W()), j(e);
117
117
  };
118
- return /* @__PURE__ */ ue(ce, {
119
- labels: x,
120
- title: X,
118
+ return /* @__PURE__ */ de(le, {
119
+ labels: b,
120
+ title: Ve,
121
121
  bankDisplayName: q,
122
- bankLogoSrc: ve,
123
- bankLogoAlt: ye,
124
- balanceLabel: Ve,
122
+ bankLogoSrc: ye,
123
+ bankLogoAlt: be,
124
+ balanceLabel: He,
125
125
  balanceTestId: "bank-accounts-widget-detail-balance",
126
- isBankingTaglineVisible: _e,
126
+ isBankingTaglineVisible: ve,
127
127
  activeTab: A,
128
128
  transactionRows: Z,
129
- showExport: He,
130
- isExportOpen: Me,
129
+ showExport: Ue,
130
+ isExportOpen: Ne,
131
131
  exportStartDate: L,
132
132
  exportEndDate: z,
133
- isExportDownloading: Le,
134
- isExportDownloadDisabled: Ue,
135
- disabledExportStartDates: We,
136
- disabledExportEndDates: Ge,
133
+ isExportDownloading: Re,
134
+ isExportDownloadDisabled: We,
135
+ disabledExportStartDates: Ge,
136
+ disabledExportEndDates: Ke,
137
137
  accountNumberLabel: K?.accountNumber ?? "",
138
138
  maskedAccountNumberLabel: ae(K?.accountNumber ?? ""),
139
139
  accountNumberTestId: "bank-accounts-widget-detail-account-number",
140
140
  wireAccountNumberLabel: K?.accountNumber ?? "",
141
141
  routingNumberLabel: K?.routingNumber ?? "",
142
142
  bankAddressLabel: J,
143
- domesticWireIntroLabel: Re,
144
- domesticWireNoteLabel: ze,
145
- thingsToKnowBodyLabel: Be,
146
- supportTeamHref: xe,
147
- isAccountNumberVisible: Ee,
148
- isAccountNumberCopied: Oe,
149
- isRoutingNumberCopied: ke,
150
- isDomesticWireExpanded: Ae,
151
- isLoading: !E && (!D || T && !w || k && (V.isLoading || A === "transactions" && H.isLoading)),
152
- isError: E || k && (V.isError || A === "transactions" && H.isError),
153
- isEditOpen: Te,
154
- isEditDisabled: !O.canWrite,
143
+ domesticWireIntroLabel: ze,
144
+ domesticWireNoteLabel: Be,
145
+ thingsToKnowBodyLabel: X,
146
+ supportTeamHref: Se,
147
+ isAccountNumberVisible: De,
148
+ isAccountNumberCopied: ke,
149
+ isRoutingNumberCopied: Ae,
150
+ isDomesticWireExpanded: je,
151
+ isLoading: !T && (!E && !(C && K) || w && !C || k && (V.isLoading || A === "transactions" && H.isLoading)),
152
+ isError: T || k && (V.isError || A === "transactions" && H.isError),
153
+ isEditOpen: Ee,
154
+ isEditDisabled: !D.canWrite,
155
155
  isEditError: U,
156
- isSubmitting: Ie,
156
+ isSubmitting: Le,
157
157
  editForm: M,
158
- canEdit: O.canWrite,
159
- onBack: me,
160
- onTabChange: we,
161
- onToggleAccountNumberVisibility: () => De((e) => !e),
158
+ canEdit: D.canWrite,
159
+ onBack: he,
160
+ onTabChange: Te,
161
+ onToggleAccountNumberVisibility: () => Oe((e) => !e),
162
162
  onCopyAccountNumber: () => void Q(K?.accountNumber ?? "", "account"),
163
163
  onCopyRoutingNumber: () => void Q(K?.routingNumber ?? "", "routing"),
164
164
  onCopyBankName: () => void Q(q, "bankName"),
165
165
  onCopyBankAddress: () => void Q(J ?? "", "bankAddress"),
166
- onDomesticWireExpandedChange: je,
166
+ onDomesticWireExpandedChange: Me,
167
167
  onEditOpenChange: $,
168
168
  onEditFormChange: (e) => {
169
169
  U && W(), N(e);
170
170
  },
171
171
  onEditSubmit: () => {
172
- if (!D || !O.canWrite) return;
172
+ if (!E || !D.canWrite) return;
173
173
  let t = M.nickname.trim();
174
- t && Fe({
175
- path: { id: b },
174
+ t && Ie({
175
+ path: { id: y },
176
176
  body: { nickname: t }
177
177
  }, {
178
178
  onSuccess: () => {
179
- C(i.AccountUpdated, { accountId: b }), e.success(S.editSuccessToast), j(!1);
179
+ S(i.AccountUpdated, { accountId: y }), e.success(x.editSuccessToast), j(!1);
180
180
  },
181
181
  onError: () => {
182
- e.error(S.editErrorToast);
182
+ e.error(x.editErrorToast);
183
183
  }
184
184
  });
185
185
  },
186
186
  onEditNicknameClick: () => $(!0),
187
- onExportOpenChange: Ke,
187
+ onExportOpenChange: qe,
188
188
  onExportStartDateChange: R,
189
189
  onExportEndDateChange: B,
190
190
  onExportDownload: () => {
191
- qe();
191
+ Je();
192
192
  }
193
193
  });
194
194
  }
195
195
  //#endregion
196
- export { b as AccountDetailsWidget };
196
+ export { y as AccountDetailsWidget };
@@ -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 }