@tesouro/embedded-components-react 0.5.203 → 0.5.205

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 (65) hide show
  1. package/README.md +15 -14
  2. package/dist/index.css +9 -0
  3. package/dist/index.d.ts +42 -0
  4. package/dist/index.js +2 -2
  5. package/dist/lib/ProductsWidget.d.ts +4 -0
  6. package/dist/lib/ProductsWidget.js +1 -1
  7. package/dist/lib/ReceivablesWidget.d.ts +40 -0
  8. package/dist/lib/ReceivablesWidget.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +7 -7
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +26 -23
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +79 -2
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +53 -42
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +81 -283
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +47 -70
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +303 -99
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +68 -230
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +115 -0
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +253 -0
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +34 -19
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +14 -0
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +10 -9
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +18 -1
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +0 -3
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +0 -7
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +10 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +1 -264
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +259 -67
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +61 -412
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +407 -89
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +73 -60
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +80 -331
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +20 -0
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +344 -0
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +183 -137
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +157 -20
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +24 -1
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +1 -3
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +3 -18
  42. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index10.js +136 -0
  44. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index4.js +5 -30
  45. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index5.js +9 -19
  46. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index6.js +22 -54
  47. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index7.js +14 -40
  48. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +57 -118
  49. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index9.js +72 -0
  50. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +2 -0
  51. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +97 -93
  52. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +35 -32
  53. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +38 -38
  54. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +213 -202
  55. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +136 -116
  56. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  57. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +8 -8
  58. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +8 -8
  59. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +8 -8
  60. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +79 -70
  61. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnits.js +4 -4
  62. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +1 -0
  63. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +109 -107
  64. package/dist/packages/shared-ui-shadcn/dist/index.js +1763 -1749
  65. package/package.json +1 -1
@@ -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.203", n = "7cc1039fb78f2b28e512c642c10fad2272d186ff", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.205", n = "a3f0bb078bb0c8ef13f80eee919cd10143ad5af4", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -9,18 +9,18 @@ import { organizationHeaders as r } from "../../../data-access/dist/lib/organiza
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js
12
- function a(a) {
13
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && a), f = e({
12
+ function a(a, { enabled: o = !0 } = {}) {
13
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = !!(c && l && a) && o, p = e({
14
14
  query: { measure_unit_id: a ?? "" },
15
- client: o,
16
- headers: r(s)
15
+ client: s,
16
+ headers: r(c)
17
17
  });
18
18
  return i({
19
- ...t(f, {
20
- authEpoch: l,
21
- organizationPending: u
19
+ ...t(p, {
20
+ authEpoch: u,
21
+ organizationPending: d
22
22
  }),
23
- enabled: d
23
+ enabled: f
24
24
  });
25
25
  }
26
26
  //#endregion
@@ -9,18 +9,18 @@ import { organizationHeaders as r } from "../../../data-access/dist/lib/organiza
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js
12
- function a(a) {
13
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && a), f = e({
14
- client: o,
15
- headers: r(s),
12
+ function a(a, { enabled: o = !0 } = {}) {
13
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = !!(c && l && a) && o, p = e({
14
+ client: s,
15
+ headers: r(c),
16
16
  path: { product_id: a ?? "" }
17
17
  });
18
18
  return i({
19
- ...t(f, {
20
- authEpoch: l,
21
- organizationPending: u
19
+ ...t(p, {
20
+ authEpoch: u,
21
+ organizationPending: d
22
22
  }),
23
- enabled: d
23
+ enabled: f
24
24
  });
25
25
  }
26
26
  //#endregion
@@ -9,17 +9,17 @@ import { organizationHeaders as r } from "../../../data-access/dist/lib/organiza
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js
12
- function a() {
13
- let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationPending: l } = n(), u = !!(o && s), d = e({
14
- client: a,
15
- headers: r(o)
12
+ function a({ enabled: a = !0 } = {}) {
13
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c) && a, f = e({
14
+ client: o,
15
+ headers: r(s)
16
16
  });
17
17
  return i({
18
- ...t(d, {
19
- authEpoch: c,
20
- organizationPending: l
18
+ ...t(f, {
19
+ authEpoch: l,
20
+ organizationPending: u
21
21
  }),
22
- enabled: u
22
+ enabled: d
23
23
  });
24
24
  }
25
25
  //#endregion
@@ -21,117 +21,126 @@ var _ = {
21
21
  name: "",
22
22
  description: ""
23
23
  };
24
- function v({ open: v, onClose: y, managerLabels: b, deleteLabels: x, messageLabels: S }) {
25
- let C = f(() => ({
24
+ function v({ open: v, onClose: y, suspended: b = !1, managerLabels: x, deleteLabels: S, messageLabels: C }) {
25
+ let w = f(() => ({
26
26
  ...t,
27
- ...S
28
- }), [S]), w = o(), T = c(), E = l(), D = u(), [O, k] = p(""), [A, j] = p(_), [M, N] = p(), [P, F] = p(), [I, L] = p(_), [R, z] = p(), [B, V] = p(), H = f(() => (w.data?.data ?? []).map((e) => ({
27
+ ...C
28
+ }), [C]), T = o({ enabled: v && !b }), E = c(), D = l(), O = u(), [k, A] = p(""), [j, M] = p(_), [N, P] = p(), [F, I] = p(), [L, R] = p(_), [z, B] = p(), [V, H] = p(), [U, W] = p(v);
29
+ v !== U && (W(v), v || H(void 0));
30
+ let G = f(() => (T.data?.data ?? []).map((e) => ({
29
31
  id: e.id,
30
32
  name: e.name,
31
33
  description: e.description ?? ""
32
- })), [w.data]), U = f(() => {
33
- let e = O.trim().toLowerCase();
34
- return e ? H.filter((t) => t.name.toLowerCase().includes(e) || t.description.toLowerCase().includes(e)) : H;
35
- }, [H, O]), W = s(B?.id), G = f(() => (W.data?.data ?? []).map((e) => ({
34
+ })), [T.data]), K = f(() => {
35
+ let e = k.trim().toLowerCase();
36
+ return e ? G.filter((t) => t.name.toLowerCase().includes(e) || t.description.toLowerCase().includes(e)) : G;
37
+ }, [G, k]), q = s(V?.id, { enabled: v && !b }), J = f(() => (q.data?.data ?? []).map((e) => ({
36
38
  id: e.id,
37
39
  name: e.name,
38
40
  priceLabel: n(e.price)
39
- })), [W.data]), K = d(async () => {
40
- let t = r(A, C);
41
+ })), [q.data]), Y = d(async () => {
42
+ if (b) return;
43
+ let t = r(j, w);
41
44
  if (t) {
42
- N(t);
45
+ P(t);
43
46
  return;
44
47
  }
45
- N(void 0);
48
+ P(void 0);
46
49
  try {
47
- await T.mutateAsync({ body: {
48
- name: A.name.trim(),
49
- description: A.description.trim() || void 0
50
- } }), j(_);
50
+ await E.mutateAsync({ body: {
51
+ name: j.name.trim(),
52
+ description: j.description.trim() || void 0
53
+ } }), M(_);
51
54
  } catch (t) {
52
- N(e(t) ?? C.createMeasureUnitError);
55
+ P(e(t) ?? w.createMeasureUnitError);
53
56
  }
54
57
  }, [
55
- A,
56
- T,
57
- C
58
- ]), q = d((e) => {
59
- F(e.id), L({
58
+ b,
59
+ j,
60
+ E,
61
+ w
62
+ ]), X = d((e) => {
63
+ I(e.id), R({
60
64
  name: e.name,
61
65
  description: e.description
62
- }), z(void 0);
63
- }, []), J = d(async () => {
64
- if (!P) return;
65
- let t = r(I, C);
66
+ }), B(void 0);
67
+ }, []), Z = d(async () => {
68
+ if (b || !F) return;
69
+ let t = r(L, w);
66
70
  if (t) {
67
- z(t);
71
+ B(t);
68
72
  return;
69
73
  }
70
- z(void 0);
74
+ B(void 0);
71
75
  try {
72
- await E.mutateAsync({
73
- path: { unit_id: P },
76
+ await D.mutateAsync({
77
+ path: { unit_id: F },
74
78
  body: {
75
- name: I.name.trim(),
76
- description: I.description.trim() || void 0
79
+ name: L.name.trim(),
80
+ description: L.description.trim() || void 0
77
81
  }
78
- }), F(void 0);
82
+ }), I(void 0);
79
83
  } catch (t) {
80
- z(e(t) ?? C.updateMeasureUnitError);
84
+ B(e(t) ?? w.updateMeasureUnitError);
81
85
  }
82
86
  }, [
83
- P,
84
- I,
85
- E,
86
- C
87
- ]), Y = d(async () => {
88
- if (B) try {
89
- await D.mutateAsync({ path: { unit_id: B.id } }), V(void 0);
87
+ b,
88
+ F,
89
+ L,
90
+ D,
91
+ w
92
+ ]), Q = d(async () => {
93
+ if (!b && V) try {
94
+ await O.mutateAsync({ path: { unit_id: V.id } }), H(void 0);
90
95
  } catch {}
91
- }, [B, D]);
96
+ }, [
97
+ b,
98
+ V,
99
+ O
100
+ ]);
92
101
  return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(i, {
93
102
  open: v,
94
103
  onOpenChange: (e) => {
95
104
  e || y();
96
105
  },
97
- units: U,
98
- isLoading: w.isLoading,
99
- searchValue: O,
100
- onSearchChange: k,
101
- createValues: A,
102
- createError: M,
103
- onCreateChange: (e) => j((t) => ({
106
+ units: K,
107
+ isLoading: T.isLoading,
108
+ searchValue: k,
109
+ onSearchChange: A,
110
+ createValues: j,
111
+ createError: N,
112
+ onCreateChange: (e) => M((t) => ({
104
113
  ...t,
105
114
  ...e
106
115
  })),
107
- onCreateSubmit: K,
108
- isCreating: T.isPending,
109
- editingUnitId: P,
110
- editValues: I,
111
- editError: R,
112
- onEditStart: q,
113
- onEditChange: (e) => L((t) => ({
116
+ onCreateSubmit: Y,
117
+ isCreating: E.isPending || b,
118
+ editingUnitId: F,
119
+ editValues: L,
120
+ editError: z,
121
+ onEditStart: X,
122
+ onEditChange: (e) => R((t) => ({
114
123
  ...t,
115
124
  ...e
116
125
  })),
117
- onEditSubmit: J,
118
- onEditCancel: () => F(void 0),
119
- isUpdating: E.isPending,
120
- onDeleteClick: V,
126
+ onEditSubmit: Z,
127
+ onEditCancel: () => I(void 0),
128
+ isUpdating: D.isPending || b,
129
+ onDeleteClick: H,
121
130
  onDone: y,
122
- labels: b
131
+ labels: x
123
132
  }), /* @__PURE__ */ h(a, {
124
- open: !!B,
133
+ open: !!V,
125
134
  onOpenChange: (e) => {
126
- e || V(void 0);
135
+ e || H(void 0);
127
136
  },
128
- unitName: B?.name ?? "",
129
- affectedProducts: G,
130
- isLoadingProducts: W.isLoading,
131
- isDeleting: D.isPending,
132
- onConfirm: Y,
133
- onCancel: () => V(void 0),
134
- labels: x
137
+ unitName: V?.name ?? "",
138
+ affectedProducts: J,
139
+ isLoadingProducts: q.isLoading,
140
+ isDeleting: O.isPending || b,
141
+ onConfirm: Q,
142
+ onCancel: () => H(void 0),
143
+ labels: S
135
144
  })] });
136
145
  }
137
146
  //#endregion
@@ -7,11 +7,11 @@ import { useMeasureUnitsQuery as n } from "../../../data-access/dist/index9.js";
7
7
  import "../../../data-access/dist/index.js";
8
8
  import { useMemo as r } from "react";
9
9
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnits.js
10
- function i() {
11
- let i = n();
10
+ function i({ enabled: i = !0 } = {}) {
11
+ let a = n({ enabled: i });
12
12
  return {
13
- unitNamesById: r(() => e(i.data?.data), [i.data]),
14
- unitOptions: r(() => t(i.data?.data), [i.data])
13
+ unitNamesById: r(() => e(a.data?.data), [a.data]),
14
+ unitOptions: r(() => t(a.data?.data), [a.data])
15
15
  };
16
16
  }
17
17
  //#endregion
@@ -37,6 +37,7 @@ var e = {
37
37
  doneButton: "Done",
38
38
  editAction: "Edit unit",
39
39
  deleteAction: "Delete unit",
40
+ moreActionsLabel: "More actions",
40
41
  saveAction: "Save unit",
41
42
  cancelAction: "Cancel edit",
42
43
  emptyText: "No measure units yet."
@@ -1,169 +1,171 @@
1
- import { Button as e, Input as t, InputGroup as n, InputGroupAddon as r, InputGroupInput as i, Sheet as a, SheetContent as o, SheetDescription as s, SheetFooter as c, SheetHeader as l, SheetTitle as u, Table as d, TableBody as f, TableCell as p, TableHead as m, TableHeader as h, TableRow as g } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MEASURE_UNITS_MANAGER_LABELS_EN as _ } from "./index2.js";
3
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
4
- import { CheckIcon as b, PencilIcon as x, PlusIcon as S, Search as C, Trash2Icon as w, XIcon as T } from "lucide-react";
1
+ import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i, Input as a, InputGroup as o, InputGroupInput as s, Sheet as c, SheetContent as l, SheetDescription as u, SheetFooter as d, SheetHeader as f, SheetTitle as p, Table as m, TableBody as h, TableCell as g, TableHead as _, TableHeader as v, TableRow as y } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { MEASURE_UNITS_MANAGER_LABELS_EN as b } from "./index2.js";
3
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
4
+ import { CheckIcon as C, MoreVerticalIcon as w, PencilIcon as T, PlusIcon as E, Trash2Icon as D, XIcon as O } from "lucide-react";
5
5
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js
6
- var E = "—";
7
- function D({ open: D, onOpenChange: O, units: k, isLoading: A, searchValue: j, onSearchChange: M, createValues: N, createError: P, onCreateChange: F, onCreateSubmit: I, isCreating: L, editingUnitId: R, editValues: z, editError: B, onEditStart: V, onEditChange: H, onEditSubmit: U, onEditCancel: W, isUpdating: G, onDeleteClick: K, onDone: q, labels: J }) {
8
- let Y = {
9
- ..._,
10
- ...J
6
+ var k = "—";
7
+ function A({ open: A, onOpenChange: j, units: M, isLoading: N, searchValue: P, onSearchChange: F, createValues: I, createError: L, onCreateChange: R, onCreateSubmit: z, isCreating: B, editingUnitId: V, editValues: H, editError: U, onEditStart: W, onEditChange: G, onEditSubmit: K, onEditCancel: q, isUpdating: J, onDeleteClick: Y, onDone: X, labels: Z }) {
8
+ let Q = {
9
+ ...b,
10
+ ...Z
11
11
  };
12
- return /* @__PURE__ */ v(a, {
13
- open: D,
14
- onOpenChange: O,
15
- children: /* @__PURE__ */ y(o, {
16
- className: "ttw:gap-0 ttw:p-0",
12
+ return /* @__PURE__ */ x(c, {
13
+ open: A,
14
+ onOpenChange: j,
15
+ children: /* @__PURE__ */ S(l, {
16
+ className: "ttw:w-150 ttw:sm:max-w-150 ttw:gap-0 ttw:p-0",
17
17
  children: [
18
- /* @__PURE__ */ y(l, {
18
+ /* @__PURE__ */ S(f, {
19
19
  className: "ttw:border-b ttw:border-border",
20
- children: [/* @__PURE__ */ v(u, { children: Y.title }), /* @__PURE__ */ v(s, {
20
+ children: [/* @__PURE__ */ x(p, { children: Q.title }), /* @__PURE__ */ x(u, {
21
21
  className: "ttw:sr-only",
22
- children: Y.hiddenDescription
22
+ children: Q.hiddenDescription
23
23
  })]
24
24
  }),
25
- /* @__PURE__ */ y("div", {
25
+ /* @__PURE__ */ S("div", {
26
26
  className: "ttw:flex-1 ttw:flex ttw:flex-col ttw:gap-4 ttw:overflow-y-auto ttw:px-6 ttw:py-4",
27
- children: [/* @__PURE__ */ y(n, { children: [/* @__PURE__ */ v(r, {
28
- align: "inline-start",
29
- children: /* @__PURE__ */ v(C, {})
30
- }), /* @__PURE__ */ v(i, {
31
- "data-has-start-addon": !0,
32
- placeholder: Y.searchPlaceholder,
33
- value: j,
34
- onChange: (e) => M(e.target.value)
35
- })] }), /* @__PURE__ */ y(d, {
27
+ children: [/* @__PURE__ */ x(o, { children: /* @__PURE__ */ x(s, {
28
+ placeholder: Q.searchPlaceholder,
29
+ value: P,
30
+ onChange: (e) => F(e.target.value)
31
+ }) }), /* @__PURE__ */ S(m, {
36
32
  className: "ttw:table-fixed ttw:border ttw:border-border ttw:rounded-md",
37
- children: [/* @__PURE__ */ v(h, { children: /* @__PURE__ */ y(g, {
33
+ children: [/* @__PURE__ */ x(v, { children: /* @__PURE__ */ S(y, {
38
34
  className: "ttw:hover:bg-transparent ttw:border-border",
39
35
  children: [
40
- /* @__PURE__ */ v(m, {
41
- className: "ttw:w-[35%]",
42
- children: Y.columnLabel
36
+ /* @__PURE__ */ x(_, {
37
+ className: "ttw:w-[30%]",
38
+ children: Q.columnLabel
43
39
  }),
44
- /* @__PURE__ */ v(m, {
45
- className: "ttw:w-[55%]",
46
- children: Y.columnDescription
40
+ /* @__PURE__ */ x(_, {
41
+ className: "ttw:w-[50%]",
42
+ children: Q.columnDescription
47
43
  }),
48
- /* @__PURE__ */ v(m, { className: "ttw:w-[10%]" })
44
+ /* @__PURE__ */ x(_, { className: "ttw:w-[20%]" })
49
45
  ]
50
- }) }), /* @__PURE__ */ y(f, { children: [
51
- /* @__PURE__ */ y(g, {
46
+ }) }), /* @__PURE__ */ S(h, { children: [
47
+ /* @__PURE__ */ S(y, {
52
48
  className: "ttw:border-border",
53
49
  children: [
54
- /* @__PURE__ */ y(p, { children: [/* @__PURE__ */ v(t, {
55
- placeholder: Y.namePlaceholder,
56
- value: N.name,
57
- "aria-invalid": !!P,
58
- disabled: L,
50
+ /* @__PURE__ */ S(g, { children: [/* @__PURE__ */ x(a, {
51
+ placeholder: Q.namePlaceholder,
52
+ value: I.name,
53
+ "aria-invalid": !!L,
54
+ disabled: B,
59
55
  className: "ttw:h-8",
60
- onChange: (e) => F({ name: e.target.value })
61
- }), P && /* @__PURE__ */ v("p", {
56
+ onChange: (e) => R({ name: e.target.value })
57
+ }), L && /* @__PURE__ */ x("p", {
62
58
  className: "ttw:mt-1 ttw:text-sm ttw:text-destructive",
63
- children: P
59
+ children: L
64
60
  })] }),
65
- /* @__PURE__ */ v(p, { children: /* @__PURE__ */ v(t, {
66
- placeholder: Y.descriptionPlaceholder,
67
- value: N.description,
68
- disabled: L,
61
+ /* @__PURE__ */ x(g, { children: /* @__PURE__ */ x(a, {
62
+ placeholder: Q.descriptionPlaceholder,
63
+ value: I.description,
64
+ disabled: B,
69
65
  className: "ttw:h-8",
70
- onChange: (e) => F({ description: e.target.value })
66
+ onChange: (e) => R({ description: e.target.value })
71
67
  }) }),
72
- /* @__PURE__ */ v(p, {
68
+ /* @__PURE__ */ x(g, {
73
69
  className: "ttw:text-right",
74
- children: /* @__PURE__ */ y(e, {
70
+ children: /* @__PURE__ */ S(e, {
75
71
  variant: "outline",
76
72
  size: "sm",
77
- onClick: I,
78
- disabled: L,
73
+ onClick: z,
74
+ disabled: B,
79
75
  className: "ttw:h-8 ttw:bg-primary-foreground ttw:text-primary ttw:hover:text-primary ttw:hover:bg-primary-foreground/80 ttw:border-0",
80
- children: [/* @__PURE__ */ v(S, { className: "ttw:size-4" }), Y.addButton]
76
+ children: [/* @__PURE__ */ x(E, { className: "ttw:size-4" }), Q.addButton]
81
77
  })
82
78
  })
83
79
  ]
84
80
  }),
85
- A ? null : k.map((n) => R === n.id ? /* @__PURE__ */ y(g, {
81
+ N ? null : M.map((o) => V === o.id ? /* @__PURE__ */ S(y, {
86
82
  className: "ttw:border-border",
87
83
  children: [
88
- /* @__PURE__ */ y(p, { children: [/* @__PURE__ */ v(t, {
89
- value: z.name,
90
- "aria-invalid": !!B,
91
- disabled: G,
84
+ /* @__PURE__ */ S(g, { children: [/* @__PURE__ */ x(a, {
85
+ value: H.name,
86
+ "aria-invalid": !!U,
87
+ disabled: J,
92
88
  className: "ttw:h-8",
93
- onChange: (e) => H({ name: e.target.value })
94
- }), B && /* @__PURE__ */ v("p", {
89
+ onChange: (e) => G({ name: e.target.value })
90
+ }), U && /* @__PURE__ */ x("p", {
95
91
  className: "ttw:mt-1 ttw:text-sm ttw:text-destructive",
96
- children: B
92
+ children: U
97
93
  })] }),
98
- /* @__PURE__ */ v(p, { children: /* @__PURE__ */ v(t, {
99
- value: z.description,
100
- disabled: G,
94
+ /* @__PURE__ */ x(g, { children: /* @__PURE__ */ x(a, {
95
+ value: H.description,
96
+ disabled: J,
101
97
  className: "ttw:h-8",
102
- onChange: (e) => H({ description: e.target.value })
98
+ onChange: (e) => G({ description: e.target.value })
103
99
  }) }),
104
- /* @__PURE__ */ v(p, { children: /* @__PURE__ */ y("div", {
100
+ /* @__PURE__ */ x(g, { children: /* @__PURE__ */ S("div", {
105
101
  className: "ttw:flex ttw:justify-end ttw:gap-1",
106
- children: [/* @__PURE__ */ v(e, {
102
+ children: [/* @__PURE__ */ x(e, {
107
103
  variant: "outline",
108
104
  size: "icon",
109
- "aria-label": Y.saveAction,
110
- onClick: U,
111
- disabled: G,
105
+ "aria-label": Q.saveAction,
106
+ onClick: K,
107
+ disabled: J,
112
108
  className: "ttw:size-8 ttw:bg-primary-foreground ttw:text-primary ttw:hover:text-primary ttw:hover:bg-primary-foreground/80 ttw:border-0",
113
- children: /* @__PURE__ */ v(b, { className: "ttw:size-4" })
114
- }), /* @__PURE__ */ v(e, {
109
+ children: /* @__PURE__ */ x(C, { className: "ttw:size-4" })
110
+ }), /* @__PURE__ */ x(e, {
115
111
  variant: "outline",
116
112
  size: "icon",
117
- "aria-label": Y.cancelAction,
118
- onClick: W,
119
- disabled: G,
113
+ "aria-label": Q.cancelAction,
114
+ onClick: q,
115
+ disabled: J,
120
116
  className: "ttw:size-8 ttw:bg-primary-foreground ttw:text-primary ttw:hover:text-primary ttw:hover:bg-primary-foreground/80 ttw:border-0",
121
- children: /* @__PURE__ */ v(T, { className: "ttw:size-4" })
117
+ children: /* @__PURE__ */ x(O, { className: "ttw:size-4" })
122
118
  })]
123
119
  }) })
124
120
  ]
125
- }, n.id) : /* @__PURE__ */ y(g, {
121
+ }, o.id) : /* @__PURE__ */ S(y, {
126
122
  className: "ttw:border-border",
127
123
  children: [
128
- /* @__PURE__ */ v(p, {
124
+ /* @__PURE__ */ x(g, {
129
125
  className: "ttw:text-sm ttw:truncate",
130
- children: n.name
126
+ children: o.name
131
127
  }),
132
- /* @__PURE__ */ v(p, {
128
+ /* @__PURE__ */ x(g, {
133
129
  className: "ttw:text-sm ttw:text-muted-foreground ttw:truncate",
134
- children: n.description || E
130
+ children: o.description || k
135
131
  }),
136
- /* @__PURE__ */ v(p, { children: /* @__PURE__ */ y("div", {
137
- className: "ttw:flex ttw:justify-end ttw:gap-1",
138
- children: [/* @__PURE__ */ v(e, {
139
- variant: "ghost",
140
- size: "icon-sm",
141
- "aria-label": Y.editAction,
142
- onClick: () => V(n),
143
- children: /* @__PURE__ */ v(x, { className: "ttw:size-4" })
144
- }), /* @__PURE__ */ v(e, {
145
- variant: "ghost",
146
- size: "icon-sm",
147
- "aria-label": Y.deleteAction,
148
- onClick: () => K(n),
149
- children: /* @__PURE__ */ v(w, { className: "ttw:size-4 ttw:text-destructive" })
150
- })]
151
- }) })
132
+ /* @__PURE__ */ x(g, {
133
+ className: "ttw:text-right",
134
+ children: /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ x(i, {
135
+ asChild: !0,
136
+ children: /* @__PURE__ */ x(e, {
137
+ variant: "ghost",
138
+ size: "icon-sm",
139
+ "aria-label": Q.moreActionsLabel,
140
+ children: /* @__PURE__ */ x(w, { className: "ttw:size-4" })
141
+ })
142
+ }), /* @__PURE__ */ S(n, {
143
+ align: "end",
144
+ children: [/* @__PURE__ */ S(r, {
145
+ onClick: () => W(o),
146
+ children: [/* @__PURE__ */ x(T, { className: "ttw:size-4" }), Q.editAction]
147
+ }), /* @__PURE__ */ S(r, {
148
+ onClick: () => Y(o),
149
+ variant: "destructive",
150
+ children: [/* @__PURE__ */ x(D, { className: "ttw:size-4" }), Q.deleteAction]
151
+ })]
152
+ })] })
153
+ })
152
154
  ]
153
- }, n.id)),
154
- !A && k.length === 0 && /* @__PURE__ */ v(g, { children: /* @__PURE__ */ v(p, {
155
+ }, o.id)),
156
+ !N && M.length === 0 && /* @__PURE__ */ x(y, { children: /* @__PURE__ */ x(g, {
155
157
  colSpan: 3,
156
158
  className: "ttw:text-center ttw:text-muted-foreground",
157
- children: Y.emptyText
159
+ children: Q.emptyText
158
160
  }) })
159
161
  ] })]
160
162
  })]
161
163
  }),
162
- /* @__PURE__ */ v(c, {
164
+ /* @__PURE__ */ x(d, {
163
165
  className: "ttw:border-t ttw:border-border ttw:flex-row ttw:justify-end",
164
- children: /* @__PURE__ */ v(e, {
165
- onClick: q,
166
- children: Y.doneButton
166
+ children: /* @__PURE__ */ x(e, {
167
+ onClick: X,
168
+ children: Q.doneButton
167
169
  })
168
170
  })
169
171
  ]
@@ -171,4 +173,4 @@ function D({ open: D, onOpenChange: O, units: k, isLoading: A, searchValue: j, o
171
173
  });
172
174
  }
173
175
  //#endregion
174
- export { D as MeasureUnitsManager, D as default };
176
+ export { A as MeasureUnitsManager, A as default };