@tesouro/embedded-components-react 0.11.54 → 0.11.58
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 +2393 -2373
- package/package.json +1 -1
|
@@ -1,81 +1,82 @@
|
|
|
1
|
-
import { Button as e, DataTable as t,
|
|
2
|
-
import { EmptyState as
|
|
3
|
-
import { ErrorState as
|
|
1
|
+
import { Button as e, DataTable as t, DataTableSortableHeader as n, FilterMenuButton as r, FilterTag as i, MultiSelectFilter as a, Popover as o, PopoverContent as s, PopoverTrigger as c, RadioGroup as l, RadioGroupItem as u, SearchInput as d, TableToolbar as f } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { EmptyState as p } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
3
|
+
import { ErrorState as m } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
4
|
+
import { NoAccessState as h } from "../../../shared/ui/dist/lib/StatePanel/NoAccessState.js";
|
|
4
5
|
import "../../../shared/ui/dist/index.js";
|
|
5
|
-
import { PRODUCTS_SCREEN_LABELS_EN as
|
|
6
|
-
import { ProductTypeBadge as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import {
|
|
6
|
+
import { PRODUCTS_SCREEN_LABELS_EN as g } from "./index2.js";
|
|
7
|
+
import { ProductTypeBadge as _ } from "./index3.js";
|
|
8
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
9
|
+
import { ListFilter as x } from "lucide-react";
|
|
9
10
|
// ../../libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js
|
|
10
|
-
var
|
|
11
|
+
var S = [
|
|
11
12
|
10,
|
|
12
13
|
25,
|
|
13
14
|
50,
|
|
14
15
|
100
|
|
15
|
-
],
|
|
16
|
-
function
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
className: "ttw:
|
|
19
|
-
|
|
16
|
+
], C = "ttw:flex ttw:w-full ttw:cursor-pointer ttw:items-center ttw:gap-2 ttw:rounded-md ttw:px-2 ttw:py-1.5 ttw:text-xs ttw:font-medium ttw:transition-colors ttw:hover:bg-accent";
|
|
17
|
+
function w({ labels: e, filters: t, action: n }) {
|
|
18
|
+
return /* @__PURE__ */ y(f, {
|
|
19
|
+
className: "ttw:px-4",
|
|
20
|
+
search: /* @__PURE__ */ y(d, {
|
|
20
21
|
value: t.searchValue,
|
|
21
22
|
onChange: (e) => t.onSearchChange(e.target.value),
|
|
22
23
|
placeholder: e.searchPlaceholder,
|
|
23
24
|
"aria-label": e.searchLabel,
|
|
24
25
|
className: "ttw:min-w-64"
|
|
25
26
|
}),
|
|
26
|
-
|
|
27
|
+
filterButton: /* @__PURE__ */ b(o, {
|
|
27
28
|
open: t.isPopoverOpen,
|
|
28
29
|
onOpenChange: (e) => {
|
|
29
30
|
e || t.onPopoverClose();
|
|
30
31
|
},
|
|
31
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ y(c, {
|
|
32
33
|
asChild: !0,
|
|
33
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ y(r, {
|
|
34
35
|
activeCount: t.activeFilterCount,
|
|
35
36
|
onClick: (e) => {
|
|
36
37
|
t.isPanelOpen && e.preventDefault(), t.onMenuToggle();
|
|
37
38
|
},
|
|
38
39
|
labels: { filters: e.filtersButton }
|
|
39
40
|
})
|
|
40
|
-
}), /* @__PURE__ */
|
|
41
|
+
}), /* @__PURE__ */ b(s, {
|
|
41
42
|
align: "start",
|
|
42
43
|
className: "ttw:w-56 ttw:p-0",
|
|
43
44
|
children: [
|
|
44
|
-
t.isMenuOpen && /* @__PURE__ */
|
|
45
|
+
t.isMenuOpen && /* @__PURE__ */ b("div", {
|
|
45
46
|
className: "ttw:p-1",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
47
|
+
children: [/* @__PURE__ */ b("button", {
|
|
47
48
|
type: "button",
|
|
48
|
-
className:
|
|
49
|
+
className: C,
|
|
49
50
|
onClick: t.onTypeFieldSelect,
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ y(x, {
|
|
51
52
|
className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
52
53
|
"aria-hidden": !0
|
|
53
54
|
}), e.filterFieldType]
|
|
54
|
-
}), /* @__PURE__ */
|
|
55
|
+
}), /* @__PURE__ */ b("button", {
|
|
55
56
|
type: "button",
|
|
56
|
-
className:
|
|
57
|
+
className: C,
|
|
57
58
|
onClick: t.onUnitFieldSelect,
|
|
58
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ y(x, {
|
|
59
60
|
className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
60
61
|
"aria-hidden": !0
|
|
61
62
|
}), e.filterFieldUnit]
|
|
62
63
|
})]
|
|
63
64
|
}),
|
|
64
|
-
t.isTypePanelOpen && /* @__PURE__ */
|
|
65
|
+
t.isTypePanelOpen && /* @__PURE__ */ y(a, {
|
|
65
66
|
options: [...t.typeOptions],
|
|
66
67
|
selectedValues: [...t.selectedTypes],
|
|
67
68
|
onSelectionChange: t.onTypeChange
|
|
68
69
|
}),
|
|
69
|
-
t.isUnitPanelOpen && /* @__PURE__ */
|
|
70
|
+
t.isUnitPanelOpen && /* @__PURE__ */ y("div", {
|
|
70
71
|
className: "ttw:max-h-64 ttw:overflow-auto ttw:p-3",
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ y(l, {
|
|
72
73
|
value: t.selectedUnit,
|
|
73
74
|
onValueChange: t.onUnitChange,
|
|
74
75
|
"aria-label": e.filterFieldUnit,
|
|
75
76
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
76
|
-
children: t.unitOptions.map((e) => /* @__PURE__ */
|
|
77
|
+
children: t.unitOptions.map((e) => /* @__PURE__ */ b("label", {
|
|
77
78
|
className: "ttw:flex ttw:cursor-pointer ttw:items-center ttw:gap-2",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ y(u, { value: e.value }), /* @__PURE__ */ y("span", {
|
|
79
80
|
className: "ttw:text-xs ttw:font-medium",
|
|
80
81
|
children: e.label
|
|
81
82
|
})]
|
|
@@ -85,12 +86,13 @@ function T({ labels: e, filters: t }) {
|
|
|
85
86
|
]
|
|
86
87
|
})]
|
|
87
88
|
}),
|
|
88
|
-
|
|
89
|
+
action: n,
|
|
90
|
+
tags: /* @__PURE__ */ b(v, { children: [t.chips.map((n) => /* @__PURE__ */ y(i, {
|
|
89
91
|
label: n.label,
|
|
90
92
|
variant: "default",
|
|
91
93
|
labels: { remove: e.filterChipRemove },
|
|
92
94
|
onDismiss: () => t.onRemoveChip(n.key)
|
|
93
|
-
}, n.key)), t.chips.length > 0 && /* @__PURE__ */
|
|
95
|
+
}, n.key)), t.chips.length > 0 && /* @__PURE__ */ y("button", {
|
|
94
96
|
type: "button",
|
|
95
97
|
className: "ttw:cursor-pointer ttw:whitespace-nowrap ttw:text-xs ttw:text-muted-foreground ttw:transition-colors ttw:hover:text-foreground",
|
|
96
98
|
onClick: t.onClearAll,
|
|
@@ -98,32 +100,24 @@ function T({ labels: e, filters: t }) {
|
|
|
98
100
|
})] })
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
|
-
function
|
|
102
|
-
let
|
|
103
|
-
...
|
|
104
|
-
...
|
|
103
|
+
function T({ products: r, isLoading: i, isError: a, sorting: o, onSortingChange: s, pageSize: c, onPageSizeChange: l, pageSizeOptions: u = S, hasNextPage: d, hasPrevPage: f, onNextPage: x, onPrevPage: C, filters: T, isFiltering: E, onCreateClick: D, onManageUnitsClick: O, onRowClick: k, onRetry: A, canCreate: j = !0, canManageUnits: M = !0, isAccessRestricted: N, labels: P, testIds: F }) {
|
|
104
|
+
let I = {
|
|
105
|
+
...g,
|
|
106
|
+
...P,
|
|
105
107
|
typeBadge: {
|
|
106
|
-
...
|
|
107
|
-
...
|
|
108
|
+
...g.typeBadge,
|
|
109
|
+
...P?.typeBadge
|
|
108
110
|
}
|
|
109
|
-
}, R = [
|
|
111
|
+
}, L = !E && j, R = !i && r.length === 0 && L, z = [
|
|
110
112
|
{
|
|
111
113
|
accessorKey: "name",
|
|
112
114
|
enableSorting: !0,
|
|
113
|
-
header: ({ column:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
children: [L.columnName, /* @__PURE__ */ _(e, {
|
|
118
|
-
variant: "ghost",
|
|
119
|
-
size: "icon-sm",
|
|
120
|
-
onClick: () => t.toggleSorting(n === "asc"),
|
|
121
|
-
children: _(n === "asc" ? x : n === "desc" ? y : b, { className: "ttw:size-4" })
|
|
122
|
-
})]
|
|
123
|
-
});
|
|
124
|
-
},
|
|
115
|
+
header: ({ column: e }) => /* @__PURE__ */ y(n, {
|
|
116
|
+
column: e,
|
|
117
|
+
title: I.columnName
|
|
118
|
+
}),
|
|
125
119
|
size: 320,
|
|
126
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
120
|
+
cell: ({ row: e }) => /* @__PURE__ */ y("span", {
|
|
127
121
|
className: "ttw:block ttw:w-74 ttw:truncate",
|
|
128
122
|
children: e.original.name
|
|
129
123
|
})
|
|
@@ -131,22 +125,19 @@ function E({ products: n, isLoading: r, isError: i, sorting: a, onSortingChange:
|
|
|
131
125
|
{
|
|
132
126
|
accessorKey: "type",
|
|
133
127
|
size: 112,
|
|
134
|
-
header:
|
|
135
|
-
cell: ({ row: e }) => /* @__PURE__ */ _
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
labels: L.typeBadge
|
|
140
|
-
})
|
|
141
|
-
})
|
|
128
|
+
header: I.columnType,
|
|
129
|
+
cell: ({ row: e }) => e.original.type ? /* @__PURE__ */ y(_, {
|
|
130
|
+
type: e.original.type,
|
|
131
|
+
labels: I.typeBadge
|
|
132
|
+
}) : null
|
|
142
133
|
},
|
|
143
134
|
{
|
|
144
135
|
accessorKey: "description",
|
|
145
|
-
header:
|
|
136
|
+
header: I.columnDescription,
|
|
146
137
|
size: 1e4,
|
|
147
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
138
|
+
cell: ({ row: e }) => /* @__PURE__ */ y("div", {
|
|
148
139
|
className: "ttw:relative ttw:h-5 ttw:min-w-40",
|
|
149
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ y("span", {
|
|
150
141
|
className: "ttw:absolute ttw:inset-0 ttw:truncate",
|
|
151
142
|
children: e.original.description
|
|
152
143
|
})
|
|
@@ -155,70 +146,64 @@ function E({ products: n, isLoading: r, isError: i, sorting: a, onSortingChange:
|
|
|
155
146
|
{
|
|
156
147
|
accessorKey: "priceLabel",
|
|
157
148
|
size: 180,
|
|
158
|
-
header: () => /* @__PURE__ */
|
|
149
|
+
header: () => /* @__PURE__ */ y("div", {
|
|
159
150
|
className: "ttw:text-right",
|
|
160
|
-
children:
|
|
151
|
+
children: I.columnPrice
|
|
161
152
|
}),
|
|
162
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
163
|
-
className: "ttw:flex ttw:w-39 ttw:justify-end ttw:
|
|
164
|
-
children: [/* @__PURE__ */
|
|
165
|
-
className: "ttw:text-muted-foreground
|
|
153
|
+
cell: ({ row: e }) => /* @__PURE__ */ b("div", {
|
|
154
|
+
className: "ttw:flex ttw:w-39 ttw:items-center ttw:justify-end ttw:gap-1 ttw:tabular-nums",
|
|
155
|
+
children: [/* @__PURE__ */ y("span", { children: e.original.priceLabel }), e.original.unitLabel && /* @__PURE__ */ y("span", {
|
|
156
|
+
className: "ttw:text-muted-foreground",
|
|
166
157
|
children: e.original.unitLabel
|
|
167
158
|
})]
|
|
168
159
|
})
|
|
169
160
|
}
|
|
170
161
|
];
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
162
|
+
return N ? /* @__PURE__ */ y(h, {
|
|
163
|
+
testId: F?.accessRestricted,
|
|
164
|
+
title: I.accessRestrictedTitle,
|
|
165
|
+
description: I.accessRestrictedDescription
|
|
166
|
+
}) : a ? /* @__PURE__ */ y(m, {
|
|
167
|
+
title: I.errorTitle,
|
|
168
|
+
description: I.errorDescription,
|
|
169
|
+
retryLabel: A ? I.errorRetry : void 0,
|
|
170
|
+
onRetry: A
|
|
171
|
+
}) : /* @__PURE__ */ y(t, {
|
|
172
|
+
columns: z,
|
|
173
|
+
data: r,
|
|
174
|
+
isLoading: i,
|
|
175
|
+
sorting: o,
|
|
176
|
+
onSortingChange: s,
|
|
177
|
+
pageSize: c,
|
|
178
|
+
onPageSizeChange: l,
|
|
179
|
+
pageSizeOptions: u,
|
|
180
|
+
hasNextPage: d,
|
|
181
|
+
hasPrevPage: f,
|
|
182
|
+
onNextPage: x,
|
|
183
|
+
onPrevPage: C,
|
|
184
|
+
onRowClick: k,
|
|
185
|
+
rowAriaLabel: (e) => I.openRow(e.name),
|
|
186
|
+
filterComponent: /* @__PURE__ */ y(w, {
|
|
187
|
+
labels: I,
|
|
188
|
+
filters: T,
|
|
189
|
+
action: /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(e, {
|
|
190
|
+
variant: "outline",
|
|
191
191
|
onClick: O,
|
|
192
192
|
disabled: !M,
|
|
193
|
-
children:
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
onPrevPage: w,
|
|
208
|
-
onRowClick: A,
|
|
209
|
-
rowAriaLabel: (e) => L.openRow(e.name),
|
|
210
|
-
filterComponent: /* @__PURE__ */ _(T, {
|
|
211
|
-
labels: L,
|
|
212
|
-
filters: E
|
|
213
|
-
}),
|
|
214
|
-
children: /* @__PURE__ */ _(f, {
|
|
215
|
-
testId: I?.empty,
|
|
216
|
-
title: D ? L.filterEmptyTitle : L.emptyTitle,
|
|
217
|
-
description: D ? L.filterEmptyDescription : L.emptyDescription,
|
|
218
|
-
actionLabel: D || !M ? void 0 : L.emptyAction,
|
|
219
|
-
onAction: D || !M ? void 0 : O
|
|
220
|
-
})
|
|
221
|
-
})] })
|
|
193
|
+
children: I.manageUnitsButton
|
|
194
|
+
}), !R && /* @__PURE__ */ y(e, {
|
|
195
|
+
onClick: D,
|
|
196
|
+
disabled: !j,
|
|
197
|
+
children: I.createButton
|
|
198
|
+
})] })
|
|
199
|
+
}),
|
|
200
|
+
children: /* @__PURE__ */ y(p, {
|
|
201
|
+
testId: F?.empty,
|
|
202
|
+
title: E ? I.filterEmptyTitle : I.emptyTitle,
|
|
203
|
+
description: E ? I.filterEmptyDescription : I.emptyDescription,
|
|
204
|
+
actionLabel: L ? I.emptyAction : void 0,
|
|
205
|
+
onAction: L ? D : void 0
|
|
206
|
+
})
|
|
222
207
|
});
|
|
223
208
|
}
|
|
224
|
-
export {
|
|
209
|
+
export { T as ProductsScreen, T as default };
|
|
@@ -1,56 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ProductFormFields as r } from "../../../shared/product-catalog/ui/dist/index3.js";
|
|
1
|
+
import { Heading as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { ProductFormFields as t } from "../../../shared/product-catalog/ui/dist/index3.js";
|
|
4
3
|
import "../../../shared/product-catalog/ui/dist/index.js";
|
|
5
|
-
import { useEffect as
|
|
6
|
-
import { jsx as
|
|
4
|
+
import { useEffect as n, useRef as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
6
|
// ../../libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
}, []), /* @__PURE__ */
|
|
13
|
-
ref:
|
|
14
|
-
|
|
7
|
+
function o({ form: o, formId: s }) {
|
|
8
|
+
let c = r(null);
|
|
9
|
+
return n(() => {
|
|
10
|
+
c.current?.querySelector("[data-autofocus]")?.focus();
|
|
11
|
+
}, []), /* @__PURE__ */ a("form", {
|
|
12
|
+
ref: c,
|
|
13
|
+
id: s,
|
|
14
|
+
noValidate: !0,
|
|
15
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
15
16
|
onSubmit: (e) => {
|
|
16
|
-
e.preventDefault(), e.stopPropagation(),
|
|
17
|
+
e.preventDefault(), e.stopPropagation(), o.onSubmit();
|
|
17
18
|
},
|
|
18
|
-
children: [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
unitOptions: l.unitOptions,
|
|
32
|
-
pricePrefix: l.pricePrefix,
|
|
33
|
-
onChange: l.onChange,
|
|
34
|
-
labels: l.labels
|
|
35
|
-
}),
|
|
36
|
-
/* @__PURE__ */ c("div", {
|
|
37
|
-
className: "ttw:flex ttw:justify-end ttw:gap-4 ttw:pt-6",
|
|
38
|
-
children: [/* @__PURE__ */ s(e, {
|
|
39
|
-
type: "button",
|
|
40
|
-
variant: "outline",
|
|
41
|
-
className: "ttw:w-fit ttw:border-border",
|
|
42
|
-
disabled: l.inProgress,
|
|
43
|
-
onClick: l.onCancel,
|
|
44
|
-
children: u.cancelButton
|
|
45
|
-
}), /* @__PURE__ */ s(e, {
|
|
46
|
-
type: "submit",
|
|
47
|
-
className: "ttw:w-fit",
|
|
48
|
-
disabled: l.inProgress || l.submitDisabled,
|
|
49
|
-
loading: l.inProgress,
|
|
50
|
-
children: u.saveButton
|
|
51
|
-
})]
|
|
52
|
-
})
|
|
53
|
-
]
|
|
19
|
+
children: [/* @__PURE__ */ i(e, {
|
|
20
|
+
variant: "subsection",
|
|
21
|
+
children: o.heading
|
|
22
|
+
}), /* @__PURE__ */ i(t, {
|
|
23
|
+
idPrefix: s,
|
|
24
|
+
values: o.values,
|
|
25
|
+
errors: o.errors,
|
|
26
|
+
unitOptions: o.unitOptions,
|
|
27
|
+
pricePrefix: o.pricePrefix,
|
|
28
|
+
onChange: o.onChange,
|
|
29
|
+
onAddUnit: o.onAddUnit,
|
|
30
|
+
labels: o.labels
|
|
31
|
+
})]
|
|
54
32
|
});
|
|
55
33
|
}
|
|
56
|
-
export {
|
|
34
|
+
export { o as ProductEditForm, o as default };
|