@tesouro/embedded-components-react 0.11.55 → 0.11.59

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 (38) hide show
  1. package/README.md +2 -2
  2. package/dist/index.css +0 -21
  3. package/dist/index.d.ts +31 -6
  4. package/dist/lib/ProductsWidget.d.ts +30 -5
  5. package/dist/lib/ReceivablesWidget.d.ts +27 -5
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +99 -92
  8. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductDelete.js +24 -21
  9. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsWidget.js +79 -75
  10. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/mocks/labels.js +5 -5
  11. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +9 -7
  12. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index3.js +7 -9
  13. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +103 -118
  14. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +28 -50
  15. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index6.js +118 -147
  16. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index7.js +24 -27
  17. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +16 -14
  19. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitCreateDialogContainer.js +38 -0
  20. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +73 -123
  21. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +6 -2
  23. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/labels.js +7 -7
  24. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnitForm.js +83 -0
  25. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +17 -4
  26. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +6 -4
  27. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +45 -17
  28. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index3.js +121 -123
  29. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +36 -61
  30. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js +26 -194
  31. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +115 -49
  32. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index7.js +62 -113
  33. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index8.js +51 -0
  34. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index9.js +117 -0
  35. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +14 -14
  36. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/StatePanel/NoAccessState.js +10 -2
  37. package/dist/packages/shared-ui-shadcn/dist/index.js +1648 -1526
  38. package/package.json +1 -1
@@ -1,65 +1,40 @@
1
- import { Button as e, Sheet as t, SheetContent as n, SheetDescription as r, SheetFooter as i, SheetHeader as a, SheetTitle as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { mergeProductFormSheetLabels as s } from "./index2.js";
3
- import { ProductFormFields as c } from "./index3.js";
4
- import { useId as l } from "react";
5
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
1
+ import { FormSheet as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { mergeProductFormSheetLabels as t } from "./index2.js";
3
+ import { ProductFormFields as n } from "./index3.js";
4
+ import { useId as r } from "react";
5
+ import { jsx as i } from "react/jsx-runtime";
6
6
  // ../../libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js
7
- function f({ open: f, onOpenChange: p, values: m, errors: h, unitOptions: g, pricePrefix: _, inProgress: v, onChange: y, onSubmit: b, onCancel: x, labels: S }) {
8
- let C = s(S), w = l(), T = m.type === "service" ? C.typeService.toLowerCase() : C.typeProduct.toLowerCase();
9
- return /* @__PURE__ */ u(t, {
10
- open: f,
11
- onOpenChange: p,
12
- children: /* @__PURE__ */ d(n, {
13
- className: "ttw:w-150 ttw:sm:max-w-150 ttw:gap-0",
14
- labels: { close: C.close },
15
- children: [
16
- /* @__PURE__ */ d(a, {
17
- className: "ttw:border-b ttw:border-border",
18
- children: [/* @__PURE__ */ u(o, {
19
- className: "ttw:text-2xl",
20
- children: C.createTitle
21
- }), /* @__PURE__ */ u(r, {
22
- className: "ttw:max-w-130",
23
- children: C.headerDescription
24
- })]
25
- }),
26
- /* @__PURE__ */ u("form", {
27
- id: w,
28
- onSubmit: (e) => {
29
- e.preventDefault(), e.stopPropagation(), b();
30
- },
31
- children: /* @__PURE__ */ u("div", {
32
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:py-8 ttw:overflow-auto",
33
- children: /* @__PURE__ */ u(c, {
34
- idPrefix: w,
35
- values: m,
36
- errors: h,
37
- unitOptions: g,
38
- pricePrefix: _,
39
- onChange: y,
40
- labels: S
41
- })
42
- })
43
- }),
44
- /* @__PURE__ */ d(i, {
45
- className: "ttw:border-t ttw:border-border ttw:flex-row ttw:justify-end",
46
- children: [/* @__PURE__ */ u(e, {
47
- type: "button",
48
- variant: "outline",
49
- className: "ttw:w-fit ttw:border-border",
50
- onClick: x,
51
- children: C.cancelButton
52
- }), /* @__PURE__ */ u(e, {
53
- type: "submit",
54
- form: w,
55
- className: "ttw:w-fit",
56
- disabled: v,
57
- loading: v,
58
- children: C.createButton.replace("{type}", T)
59
- })]
60
- })
61
- ]
7
+ function a({ open: a, onOpenChange: o, values: s, errors: c, unitOptions: l, pricePrefix: u, inProgress: d, onChange: f, onSubmit: p, onCancel: m, onAddUnit: h, labels: g }) {
8
+ let _ = t(g), v = r(), y = s.type === "service" ? _.typeService.toLowerCase() : _.typeProduct.toLowerCase();
9
+ return /* @__PURE__ */ i(e, {
10
+ open: a,
11
+ onOpenChange: (e) => {
12
+ o(e), e || m();
13
+ },
14
+ title: _.createTitle,
15
+ description: _.headerDescription,
16
+ onSubmit: (e) => {
17
+ e.stopPropagation(), p();
18
+ },
19
+ submitting: d,
20
+ labels: {
21
+ submit: _.createButton.replace("{type}", y),
22
+ cancel: _.cancelButton,
23
+ close: _.close
24
+ },
25
+ children: /* @__PURE__ */ i("div", {
26
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:py-4",
27
+ children: /* @__PURE__ */ i(n, {
28
+ idPrefix: v,
29
+ values: s,
30
+ errors: c,
31
+ unitOptions: l,
32
+ pricePrefix: u,
33
+ onChange: f,
34
+ onAddUnit: h,
35
+ labels: g
36
+ })
62
37
  })
63
38
  });
64
39
  }
65
- export { f as ProductFormSheet, f as default };
40
+ export { a as ProductFormSheet, a as default };
@@ -1,197 +1,29 @@
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, Trash2Icon as E, XIcon as D } from "lucide-react";
1
+ import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i, Tooltip as a, TooltipContent as o, TooltipProvider as s, TooltipTrigger as c } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
3
+ import { MoreVerticalIcon as d } from "lucide-react";
5
4
  // ../../libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js
6
- var O = "—";
7
- function k({ open: k, onOpenChange: A, units: j, isLoading: M, searchValue: N, onSearchChange: P, createValues: F, createError: I, onCreateChange: L, onCreateSubmit: R, isCreating: z, editingUnitId: B, editValues: V, editError: H, onEditStart: U, onEditChange: W, onEditSubmit: G, onEditCancel: K, isUpdating: q, onDeleteClick: J, onDone: Y, labels: X }) {
8
- let Z = {
9
- ...b,
10
- ...X
11
- };
12
- return /* @__PURE__ */ x(c, {
13
- open: k,
14
- onOpenChange: A,
15
- children: /* @__PURE__ */ S(l, {
16
- className: "ttw:w-150 ttw:sm:max-w-150 ttw:gap-0 ttw:p-0",
17
- labels: { close: Z.close },
18
- children: [
19
- /* @__PURE__ */ S(f, {
20
- className: "ttw:border-b ttw:border-border",
21
- children: [/* @__PURE__ */ x(p, { children: Z.title }), /* @__PURE__ */ x(u, {
22
- className: "ttw:sr-only",
23
- children: Z.hiddenDescription
24
- })]
25
- }),
26
- /* @__PURE__ */ S("div", {
27
- className: "ttw:flex-1 ttw:flex ttw:flex-col ttw:gap-4 ttw:overflow-y-auto ttw:px-6 ttw:py-4",
28
- children: [/* @__PURE__ */ x(o, { children: /* @__PURE__ */ x(s, {
29
- placeholder: Z.searchPlaceholder,
30
- value: N,
31
- onChange: (e) => P(e.target.value)
32
- }) }), /* @__PURE__ */ S(m, {
33
- className: "ttw:table-fixed ttw:border ttw:border-border ttw:rounded-md",
34
- children: [/* @__PURE__ */ x(v, { children: /* @__PURE__ */ S(y, {
35
- className: "ttw:hover:bg-transparent ttw:border-border",
36
- children: [
37
- /* @__PURE__ */ x(_, {
38
- className: "ttw:w-[30%]",
39
- children: Z.columnLabel
40
- }),
41
- /* @__PURE__ */ x(_, {
42
- className: "ttw:w-[50%]",
43
- children: Z.columnDescription
44
- }),
45
- /* @__PURE__ */ x(_, { className: "ttw:w-[20%]" })
46
- ]
47
- }) }), /* @__PURE__ */ S(h, { children: [
48
- /* @__PURE__ */ S(y, {
49
- className: "ttw:hover:bg-transparent ttw:border-border",
50
- children: [
51
- /* @__PURE__ */ S(g, {
52
- className: "ttw:align-top",
53
- children: [/* @__PURE__ */ x(a, {
54
- placeholder: Z.namePlaceholder,
55
- "aria-label": Z.columnLabel,
56
- value: F.name,
57
- "aria-invalid": !!I,
58
- disabled: z,
59
- className: "ttw:h-8",
60
- onChange: (e) => L({ name: e.target.value })
61
- }), I && /* @__PURE__ */ x("p", {
62
- className: "ttw:mt-1 ttw:text-sm ttw:text-destructive",
63
- children: I
64
- })]
65
- }),
66
- /* @__PURE__ */ x(g, {
67
- className: "ttw:align-top",
68
- children: /* @__PURE__ */ x(a, {
69
- placeholder: Z.descriptionPlaceholder,
70
- "aria-label": Z.columnDescription,
71
- value: F.description,
72
- disabled: z,
73
- className: "ttw:h-8",
74
- onChange: (e) => L({ description: e.target.value })
75
- })
76
- }),
77
- /* @__PURE__ */ x(g, {
78
- className: "ttw:align-top ttw:text-right",
79
- children: /* @__PURE__ */ x(e, {
80
- variant: "secondary",
81
- size: "sm",
82
- onClick: R,
83
- disabled: z,
84
- children: Z.addButton
85
- })
86
- })
87
- ]
88
- }),
89
- M ? null : j.map((o) => B === o.id ? /* @__PURE__ */ S(y, {
90
- className: "ttw:hover:bg-transparent ttw:border-border",
91
- children: [
92
- /* @__PURE__ */ S(g, {
93
- className: "ttw:align-top",
94
- children: [/* @__PURE__ */ x(a, {
95
- "aria-label": Z.columnLabel,
96
- value: V.name,
97
- "aria-invalid": !!H,
98
- disabled: q,
99
- className: "ttw:h-8",
100
- onChange: (e) => W({ name: e.target.value })
101
- }), H && /* @__PURE__ */ x("p", {
102
- className: "ttw:mt-1 ttw:text-sm ttw:text-destructive",
103
- children: H
104
- })]
105
- }),
106
- /* @__PURE__ */ x(g, {
107
- className: "ttw:align-top",
108
- children: /* @__PURE__ */ x(a, {
109
- "aria-label": Z.columnDescription,
110
- value: V.description,
111
- disabled: q,
112
- className: "ttw:h-8",
113
- onChange: (e) => W({ description: e.target.value })
114
- })
115
- }),
116
- /* @__PURE__ */ x(g, {
117
- className: "ttw:align-top",
118
- children: /* @__PURE__ */ S("div", {
119
- className: "ttw:flex ttw:justify-end ttw:gap-1",
120
- children: [/* @__PURE__ */ x(e, {
121
- variant: "outline",
122
- size: "icon",
123
- "aria-label": Z.saveAction,
124
- onClick: G,
125
- disabled: q,
126
- className: "ttw:size-8 ttw:border-border",
127
- children: /* @__PURE__ */ x(C, { className: "ttw:size-4" })
128
- }), /* @__PURE__ */ x(e, {
129
- variant: "outline",
130
- size: "icon",
131
- "aria-label": Z.cancelAction,
132
- onClick: K,
133
- disabled: q,
134
- className: "ttw:size-8 ttw:border-border",
135
- children: /* @__PURE__ */ x(D, { className: "ttw:size-4" })
136
- })]
137
- })
138
- })
139
- ]
140
- }, o.id) : /* @__PURE__ */ S(y, {
141
- className: "ttw:hover:bg-transparent ttw:border-border",
142
- children: [
143
- /* @__PURE__ */ x(g, {
144
- className: "ttw:text-sm ttw:truncate",
145
- children: o.name
146
- }),
147
- /* @__PURE__ */ x(g, {
148
- className: "ttw:text-sm ttw:text-muted-foreground ttw:truncate",
149
- children: o.description || O
150
- }),
151
- /* @__PURE__ */ x(g, {
152
- className: "ttw:text-right",
153
- children: /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ x(i, {
154
- asChild: !0,
155
- children: /* @__PURE__ */ x(e, {
156
- variant: "ghost",
157
- size: "icon-sm",
158
- "aria-label": Z.moreActionsLabel,
159
- children: /* @__PURE__ */ x(w, { className: "ttw:size-4" })
160
- })
161
- }), /* @__PURE__ */ S(n, {
162
- align: "end",
163
- children: [/* @__PURE__ */ S(r, {
164
- onClick: () => U(o),
165
- children: [/* @__PURE__ */ x(T, { className: "ttw:size-4" }), Z.editAction]
166
- }), /* @__PURE__ */ S(r, {
167
- onClick: () => J(o),
168
- variant: "destructive",
169
- children: [/* @__PURE__ */ x(E, { className: "ttw:size-4" }), Z.deleteAction]
170
- })]
171
- })] })
172
- })
173
- ]
174
- }, o.id)),
175
- !M && j.length === 0 && /* @__PURE__ */ x(y, {
176
- className: "ttw:hover:bg-transparent",
177
- children: /* @__PURE__ */ x(g, {
178
- colSpan: 3,
179
- className: "ttw:text-center ttw:text-muted-foreground",
180
- children: Z.emptyText
181
- })
182
- })
183
- ] })]
184
- })]
185
- }),
186
- /* @__PURE__ */ x(d, {
187
- className: "ttw:border-t ttw:border-border ttw:flex-row ttw:justify-end",
188
- children: /* @__PURE__ */ x(e, {
189
- onClick: Y,
190
- children: Z.doneButton
191
- })
192
- })
193
- ]
5
+ function f({ label: f, items: p, disabled: m, size: h = "icon-sm" }) {
6
+ return /* @__PURE__ */ l(s, { children: /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ u(a, { children: [/* @__PURE__ */ l(c, {
7
+ asChild: !0,
8
+ onFocus: (e) => e.preventDefault(),
9
+ children: /* @__PURE__ */ l(i, {
10
+ asChild: !0,
11
+ children: /* @__PURE__ */ l(e, {
12
+ type: "button",
13
+ variant: "ghost",
14
+ size: h,
15
+ "aria-label": f,
16
+ disabled: m,
17
+ children: /* @__PURE__ */ l(d, { "aria-hidden": !0 })
18
+ })
194
19
  })
195
- });
20
+ }), /* @__PURE__ */ l(o, { children: f })] }), /* @__PURE__ */ l(n, {
21
+ align: "end",
22
+ children: p.map((e) => /* @__PURE__ */ l(r, {
23
+ variant: e.destructive ? "destructive" : "default",
24
+ onClick: e.onSelect,
25
+ children: e.label
26
+ }, e.key))
27
+ })] }) });
196
28
  }
197
- export { k as MeasureUnitsManager, k as default };
29
+ export { f as ActionsMenu, f as default };
@@ -1,54 +1,120 @@
1
- import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o, Spinner as s, Table as c, TableBody as l, TableCell as u, TableRow as d } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MEASURE_UNIT_DELETE_DIALOG_LABELS_EN as f } from "./index2.js";
3
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
1
+ import { Button as e, DataTable as t, FormSheet as n, SearchInput as r, TableToolbar as i } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { StatePanel as a } from "../../../ui/dist/lib/StatePanel/StatePanel.js";
3
+ import { EmptyState as o } from "../../../ui/dist/lib/EmptyState/EmptyState.js";
4
+ import { ErrorState as s } from "../../../ui/dist/lib/ErrorState/ErrorState.js";
5
+ import "../../../ui/dist/index.js";
6
+ import { mergeMeasureUnitsManagerLabels as c } from "./index2.js";
7
+ import { ActionsMenu as l } from "./index5.js";
8
+ import { jsx as u } from "react/jsx-runtime";
4
9
  // ../../libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js
5
- function h({ open: h, onOpenChange: g, unitName: _, affectedProducts: v, isLoadingProducts: y, isDeleting: b, onConfirm: x, onCancel: S, labels: C }) {
6
- let w = {
7
- ...f,
8
- ...C
9
- }, T = v.length > 0;
10
- return /* @__PURE__ */ p(e, {
11
- open: h,
12
- onOpenChange: g,
13
- children: /* @__PURE__ */ m(t, {
14
- closeDisabled: b,
15
- labels: { close: w.close },
16
- children: [
17
- /* @__PURE__ */ m(i, { children: [/* @__PURE__ */ p(a, { children: w.title.replace("{name}", _) }), /* @__PURE__ */ p(n, { children: T ? w.messageWithItems : w.messageNoItems })] }),
18
- /* @__PURE__ */ p("p", {
19
- className: "ttw:text-sm ttw:text-muted-foreground",
20
- children: T ? w.messageWithItemsHint : w.messageNoItemsHint
10
+ var d = 5, f = [], p = () => void 0;
11
+ function m({ open: m, onOpenChange: h, units: g, isLoading: _, isError: v, onRetry: y, searchValue: b, onSearchChange: x, onAddClick: S, actionsDisabled: C, onEditClick: w, onDeleteClick: T, onDone: E, labels: D }) {
12
+ let O = c(D), k = b.trim().length > 0, A = !(!_ && g.length === 0 && !k) && !v, j = [
13
+ {
14
+ accessorKey: "name",
15
+ header: O.columnLabel,
16
+ size: 200,
17
+ cell: ({ row: e }) => /* @__PURE__ */ u("span", {
18
+ className: "ttw:block ttw:truncate",
19
+ children: e.original.name
20
+ })
21
+ },
22
+ {
23
+ accessorKey: "description",
24
+ header: O.columnDescription,
25
+ cell: ({ row: e }) => /* @__PURE__ */ u("span", {
26
+ className: "ttw:block ttw:truncate ttw:text-muted-foreground",
27
+ children: e.original.description || O.noDescription
28
+ })
29
+ },
30
+ {
31
+ id: "actions",
32
+ size: 48,
33
+ header: () => /* @__PURE__ */ u("span", {
34
+ className: "ttw:sr-only",
35
+ children: O.moreActionsLabel
36
+ }),
37
+ cell: ({ row: e }) => /* @__PURE__ */ u("div", {
38
+ className: "ttw:flex ttw:justify-end",
39
+ children: /* @__PURE__ */ u(l, {
40
+ disabled: C,
41
+ label: O.moreActionsLabel,
42
+ items: [{
43
+ key: "edit",
44
+ label: O.editAction,
45
+ onSelect: () => w(e.original)
46
+ }, {
47
+ key: "delete",
48
+ label: O.deleteAction,
49
+ onSelect: () => T(e.original),
50
+ destructive: !0
51
+ }]
52
+ })
53
+ })
54
+ }
55
+ ];
56
+ return /* @__PURE__ */ u(n, {
57
+ open: m,
58
+ onOpenChange: h,
59
+ title: O.title,
60
+ description: O.hiddenDescription,
61
+ primaryAction: /* @__PURE__ */ u(e, {
62
+ type: "button",
63
+ onClick: E,
64
+ children: O.doneButton
65
+ }),
66
+ labels: { close: O.close },
67
+ children: /* @__PURE__ */ u("div", {
68
+ className: "ttw:py-4",
69
+ children: /* @__PURE__ */ u(t, {
70
+ columns: j,
71
+ data: g,
72
+ isLoading: _,
73
+ sorting: f,
74
+ onSortingChange: p,
75
+ pageSize: Math.max(g.length, d),
76
+ onPageSizeChange: p,
77
+ pageSizeOptions: [],
78
+ onNextPage: p,
79
+ onPrevPage: p,
80
+ showPagination: !1,
81
+ labels: { loading: O.loadingLabel },
82
+ filterComponent: /* @__PURE__ */ u(i, {
83
+ className: "ttw:px-4",
84
+ search: /* @__PURE__ */ u(r, {
85
+ value: b,
86
+ onChange: (e) => x(e.target.value),
87
+ placeholder: O.searchPlaceholder,
88
+ "aria-label": O.searchLabel
89
+ }),
90
+ action: A ? /* @__PURE__ */ u(e, {
91
+ type: "button",
92
+ disabled: C,
93
+ onClick: S,
94
+ children: O.addButton
95
+ }) : null
21
96
  }),
22
- y ? /* @__PURE__ */ p("div", {
23
- className: "ttw:flex ttw:justify-center ttw:py-4",
24
- children: /* @__PURE__ */ p(s, {})
25
- }) : T ? /* @__PURE__ */ p("div", {
26
- className: "ttw:max-h-60 ttw:overflow-auto ttw:rounded-md ttw:border",
27
- children: /* @__PURE__ */ p(c, { children: /* @__PURE__ */ p(l, { children: v.map((e) => /* @__PURE__ */ m(d, {
28
- className: "ttw:border-border ttw:hover:bg-transparent",
29
- children: [/* @__PURE__ */ p(u, {
30
- className: "ttw:pl-4 ttw:whitespace-normal ttw:text-text ttw:font-medium",
31
- children: e.name
32
- }), /* @__PURE__ */ p(u, {
33
- className: "ttw:pr-4 ttw:text-right ttw:text-text ttw:font-medium",
34
- children: e.priceLabel
35
- })]
36
- }, e.id)) }) })
37
- }) : null,
38
- /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ p(o, {
39
- variant: "ghost",
40
- onClick: S,
41
- disabled: b,
42
- children: w.cancelButton
43
- }), /* @__PURE__ */ p(o, {
44
- variant: "destructive",
45
- onClick: x,
46
- disabled: b || y,
47
- loading: b,
48
- children: w.confirmButton
49
- })] })
50
- ]
97
+ children: v ? /* @__PURE__ */ u(s, {
98
+ title: O.errorTitle,
99
+ description: O.errorDescription,
100
+ retryLabel: O.errorRetry,
101
+ onRetry: y
102
+ }) : k ? /* @__PURE__ */ u(o, {
103
+ title: O.searchEmptyTitle,
104
+ description: O.searchEmptyDescription
105
+ }) : /* @__PURE__ */ u(a, {
106
+ kind: "empty",
107
+ title: O.emptyTitle,
108
+ description: O.emptyDescription,
109
+ action: /* @__PURE__ */ u(e, {
110
+ type: "button",
111
+ disabled: C,
112
+ onClick: S,
113
+ children: O.addButton
114
+ })
115
+ })
116
+ })
51
117
  })
52
118
  });
53
119
  }
54
- export { h as MeasureUnitDeleteDialog, h as default };
120
+ export { m as MeasureUnitsManager, m as default };