@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.
- package/README.md +2 -2
- package/dist/index.css +0 -21
- package/dist/index.d.ts +31 -6
- package/dist/lib/ProductsWidget.d.ts +30 -5
- package/dist/lib/ReceivablesWidget.d.ts +27 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +99 -92
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductDelete.js +24 -21
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsWidget.js +79 -75
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/mocks/labels.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +9 -7
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index3.js +7 -9
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +103 -118
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +28 -50
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index6.js +118 -147
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index7.js +24 -27
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +16 -14
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitCreateDialogContainer.js +38 -0
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +73 -123
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/labels.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnitForm.js +83 -0
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +17 -4
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +45 -17
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index3.js +121 -123
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +36 -61
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js +26 -194
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +115 -49
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index7.js +62 -113
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index8.js +51 -0
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index9.js +117 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +14 -14
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/StatePanel/NoAccessState.js +10 -2
- package/dist/packages/shared-ui-shadcn/dist/index.js +1648 -1526
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js
CHANGED
|
@@ -1,65 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { mergeProductFormSheetLabels as
|
|
3
|
-
import { ProductFormFields as
|
|
4
|
-
import { useId as
|
|
5
|
-
import { jsx as
|
|
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
|
|
8
|
-
let
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
open:
|
|
11
|
-
onOpenChange:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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 {
|
|
40
|
+
export { a as ProductFormSheet, a as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js
CHANGED
|
@@ -1,197 +1,29 @@
|
|
|
1
|
-
import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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 {
|
|
29
|
+
export { f as ActionsMenu, f as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js
CHANGED
|
@@ -1,54 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 {
|
|
120
|
+
export { m as MeasureUnitsManager, m as default };
|