@tesouro/embedded-components-react 0.3.20 → 0.3.22
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/dist/index.css +9 -0
- package/dist/lib/monite-sdk.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index422.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index479.js +16 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index480.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index481.js +19 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index482.js +98 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index483.js +43 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index484.js +30 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index485.js +1 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index486.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index487.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index488.js +4 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index489.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index490.js +18 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index491.js +8 -105
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index492.js +102 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index493.js +36 -45
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index494.js +44 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +72 -100
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index496.js +99 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index497.js +35 -178
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index498.js +171 -125
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index499.js +134 -123
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index500.js +125 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index501.js +63 -232
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index502.js +248 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index504.js +5 -456
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index505.js +455 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +17 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +13 -49
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index508.js +51 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +46 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index510.js +13 -41
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index511.js +39 -144
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index512.js +143 -112
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index513.js +114 -39
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index514.js +33 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index515.js +32 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index516.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index517.js +19 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index518.js +20 -72
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index519.js +73 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index520.js +18 -172
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index521.js +149 -116
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index522.js +136 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js +31 -115
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index524.js +116 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index525.js +10 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index526.js +46 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index527.js +13 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index528.js +21 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index529.js +26 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index530.js +36 -77
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index531.js +77 -50
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index532.js +50 -33
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index533.js +34 -89
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index534.js +86 -48
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index535.js +54 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index536.js +1 -40
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index537.js +40 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index538.js +0 -135
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index539.js +129 -102
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index540.js +105 -50
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index541.js +48 -779
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index542.js +780 -87
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index543.js +84 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index544.js +105 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index545.js +6 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index546.js +23 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +13 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index548.js +2 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index549.js +25 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index550.js +14 -171
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index551.js +163 -200
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js +204 -78
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +82 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js +17 -158
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js +146 -85
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js +95 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js +46 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js +4 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index559.js +13 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index560.js +27 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index561.js +0 -186
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index562.js +186 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index563.js +0 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index564.js +41 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js +5 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js +20 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js +74 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js +16 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js +19 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js +11 -131
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js +129 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js +8 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index576.js +4 -221
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index577.js +219 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index578.js +12 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js +32 -181
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js +168 -189
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index581.js +192 -88
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index582.js +97 -61
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index583.js +63 -54
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index584.js +46 -83
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +91 -40
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +39 -75
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index587.js +63 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index588.js +85 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index589.js +12 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index590.js +25 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index591.js +14 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index592.js +4 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index593.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index594.js +1 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index595.js +24 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index596.js +4 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +9 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index598.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index599.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index602.js +6 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index603.js +17 -68
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index604.js +66 -113
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index605.js +104 -64
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index606.js +72 -138
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index607.js +144 -28
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index608.js +28 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index609.js +14 -87
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index610.js +91 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index611.js +3 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index612.js +22 -67
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index613.js +71 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index614.js +0 -65
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +66 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index617.js +2 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index618.js +33 -15
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index619.js +14 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index620.js +29 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index621.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index622.js +2 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index623.js +97 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +1 -1
- 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/monite-wrapper/feature/dist/lib/MoniteWrapper.js +1 -1
- package/package.json +1 -1
|
@@ -1,210 +1,173 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Scope as e } from "../../shared/data-access/dist/lib/scopes.js";
|
|
2
|
+
import "../../shared/data-access/dist/index.js";
|
|
3
|
+
import { useMoniteContext as t } from "./index47.js";
|
|
4
|
+
import { useCurrencies as n } from "./index63.js";
|
|
5
|
+
import { Button as r } from "./index56.js";
|
|
5
6
|
import "./index217.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import "./
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
7
|
+
import { MoniteScopedProviders as i } from "./index237.js";
|
|
8
|
+
import { useUserPermissions as a } from "./index116.js";
|
|
9
|
+
import { GetNoRowsOverlay as o } from "./index246.js";
|
|
10
|
+
import { AccessRestriction as s } from "./index247.js";
|
|
11
|
+
import "./index249.js";
|
|
12
|
+
import { DataTable as c } from "./index251.js";
|
|
13
|
+
import { hasSelectedText as l } from "./index252.js";
|
|
14
|
+
import { useGetProducts as u } from "./index387.js";
|
|
15
|
+
import "./index491.js";
|
|
16
|
+
import { ManageMeasureUnits as d } from "./index493.js";
|
|
17
|
+
import { ProductDeleteModal as f } from "./index546.js";
|
|
18
|
+
import { ProductType as p } from "./index547.js";
|
|
19
|
+
import { FILTER_TYPE_SEARCH as m } from "./index548.js";
|
|
20
|
+
import { Filters as ee } from "./index549.js";
|
|
21
|
+
import { MeasureUnit as h } from "./index550.js";
|
|
22
|
+
import { useCallback as g, useMemo as _, useState as v } from "react";
|
|
23
|
+
import { ArrowDown as y, ArrowUp as b, ArrowUpDown as x, Plus as S } from "lucide-react";
|
|
24
|
+
import { Fragment as C, jsx as w, jsxs as T } from "@emotion/react/jsx-runtime";
|
|
25
|
+
import { useLingui as E } from "@lingui/react";
|
|
17
26
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index551.js
|
|
18
|
-
var
|
|
19
|
-
let { i18n:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
var D = (e) => /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(O, { ...e }) }), O = ({ onFilterChanged: i, onSortChanged: D, onRowClick: O, onDeleted: k, openCreateModal: A }) => {
|
|
28
|
+
let { i18n: j } = E(), { componentSettings: M } = t(), { formatCurrencyToDisplay: N } = n(), [P, F] = v(!1), [I, L] = v(void 0), [R, z] = v(M.products.pageSizeOptions[0]), [B, te] = v({}), [V, H] = v(), [U, W] = v({
|
|
29
|
+
open: !1,
|
|
30
|
+
id: null
|
|
31
|
+
}), G = a(), K = G.has(e.InvoiceWriteOrg), q = G.has(e.InvoiceReadOrg), { data: J, isLoading: Y, isError: X, refetch: Z } = u({
|
|
32
|
+
sort: V?.field,
|
|
33
|
+
order: V?.sort,
|
|
34
|
+
limit: R,
|
|
35
|
+
pagination_token: I,
|
|
36
|
+
name__icontains: B.search || void 0
|
|
37
|
+
}), Q = (e, t) => {
|
|
38
|
+
L(void 0), te((n) => ({
|
|
39
|
+
...n,
|
|
40
|
+
[e]: t === "all" ? null : t
|
|
41
|
+
})), i?.({
|
|
42
|
+
field: e,
|
|
43
|
+
value: t
|
|
44
|
+
});
|
|
45
|
+
}, $ = _(() => V ? [{
|
|
46
|
+
id: V.field,
|
|
47
|
+
desc: V.sort === "desc"
|
|
48
|
+
}] : [], [V]), ne = g((e) => {
|
|
49
|
+
let t = typeof e == "function" ? e($) : e;
|
|
50
|
+
if (t.length > 0) {
|
|
51
|
+
let e = {
|
|
52
|
+
field: t[0].id,
|
|
53
|
+
sort: t[0].desc ? "desc" : "asc"
|
|
54
|
+
};
|
|
55
|
+
H(e), D?.(e);
|
|
56
|
+
} else H(void 0);
|
|
57
|
+
L(void 0);
|
|
58
|
+
}, [$, D]), re = _(() => [
|
|
59
|
+
{
|
|
60
|
+
accessorKey: "name",
|
|
61
|
+
header: ({ column: e }) => {
|
|
62
|
+
let t = e.getIsSorted();
|
|
63
|
+
return /* @__PURE__ */ T("div", {
|
|
64
|
+
className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
|
|
65
|
+
children: [j._("Name"), /* @__PURE__ */ w(r, {
|
|
66
|
+
variant: "ghost",
|
|
67
|
+
onClick: () => e.toggleSorting(t === "asc"),
|
|
68
|
+
children: w(t === "asc" ? b : t === "desc" ? y : x, { className: "ttw:size-4" })
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
cell: ({ row: e }) => /* @__PURE__ */ w("span", { children: e.original.name })
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
accessorKey: "type",
|
|
76
|
+
header: j._("Type"),
|
|
77
|
+
cell: ({ row: e }) => e.original.type ? /* @__PURE__ */ w(p, { type: e.original.type }) : null
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
accessorKey: "description",
|
|
81
|
+
header: j._("Description"),
|
|
82
|
+
cell: ({ row: e }) => /* @__PURE__ */ w("div", {
|
|
83
|
+
className: "ttw:w-120",
|
|
84
|
+
children: /* @__PURE__ */ w("span", {
|
|
85
|
+
className: "ttw:w-full ttw:inline-block ttw:truncate",
|
|
86
|
+
children: e.original?.description
|
|
29
87
|
})
|
|
88
|
+
})
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
accessorKey: "price",
|
|
92
|
+
header: () => /* @__PURE__ */ w("div", {
|
|
93
|
+
className: "ttw:text-right",
|
|
94
|
+
children: j._("Price per unit")
|
|
30
95
|
}),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
className:
|
|
64
|
-
children:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}), /* @__PURE__ */ E(m, {
|
|
71
|
-
htmlFor: "type-service",
|
|
72
|
-
className: "ttw:flex ttw:flex-col ttw:items-start ttw:gap-1.5",
|
|
73
|
-
children: [/* @__PURE__ */ T(p, {
|
|
74
|
-
variant: "body2",
|
|
75
|
-
className: "ttw:leading-3.5",
|
|
76
|
-
children: P._("Service")
|
|
77
|
-
}), /* @__PURE__ */ T(p, {
|
|
78
|
-
variant: "caption",
|
|
79
|
-
color: "muted",
|
|
80
|
-
children: P._("Work or labor you provide")
|
|
81
|
-
})]
|
|
82
|
-
})]
|
|
96
|
+
cell: ({ row: e }) => {
|
|
97
|
+
let t = e.original.price;
|
|
98
|
+
return /* @__PURE__ */ T("div", {
|
|
99
|
+
className: "ttw:justify-end ttw:flex ttw:gap-1 ttw:items-center",
|
|
100
|
+
children: [t ? N(t.value, t.currency) : "", /* @__PURE__ */ w(h, { unitId: e.original.measure_unit_id ?? "" })]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
], [j, N]), ie = Object.keys(B).some((e) => B[e] !== null && B[e] !== void 0), ae = !!B[m];
|
|
105
|
+
return q ? /* @__PURE__ */ T(C, { children: [
|
|
106
|
+
/* @__PURE__ */ w("div", {
|
|
107
|
+
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:min-h-125",
|
|
108
|
+
children: /* @__PURE__ */ w(c, {
|
|
109
|
+
columns: re,
|
|
110
|
+
data: J?.data ?? [],
|
|
111
|
+
sorting: $,
|
|
112
|
+
onSortingChange: ne,
|
|
113
|
+
pageSize: R,
|
|
114
|
+
onPageSizeChange: z,
|
|
115
|
+
nextPaginationToken: J?.next_pagination_token ?? void 0,
|
|
116
|
+
prevPaginationToken: J?.prev_pagination_token ?? void 0,
|
|
117
|
+
onPaginationTokenChange: L,
|
|
118
|
+
onRowClick: (e) => {
|
|
119
|
+
l() || O?.(e.id);
|
|
120
|
+
},
|
|
121
|
+
filterComponent: /* @__PURE__ */ T("div", {
|
|
122
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:px-4",
|
|
123
|
+
children: [/* @__PURE__ */ w(ee, { onChangeFilter: Q }), /* @__PURE__ */ T("div", {
|
|
124
|
+
className: "ttw:flex ttw:gap-2",
|
|
125
|
+
children: [/* @__PURE__ */ w(r, {
|
|
126
|
+
variant: "ghost",
|
|
127
|
+
onClick: () => F(!0),
|
|
128
|
+
className: "ttw:py-0 ttw:text-primary ttw:hover:text-primary",
|
|
129
|
+
children: j._("Manage units of measure")
|
|
130
|
+
}), /* @__PURE__ */ T(r, {
|
|
131
|
+
disabled: !K,
|
|
132
|
+
onClick: A,
|
|
133
|
+
className: "ttw:py-0",
|
|
134
|
+
children: [/* @__PURE__ */ w(S, {}), j._("Add product or service")]
|
|
83
135
|
})]
|
|
84
136
|
})]
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}),
|
|
103
|
-
/* @__PURE__ */ T(_, { errors: [n] })
|
|
104
|
-
] }) })
|
|
105
|
-
}),
|
|
106
|
-
/* @__PURE__ */ E("div", {
|
|
107
|
-
className: "ttw:w-1/2 ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ T(v, { children: P._("Price per unit") }),
|
|
110
|
-
/* @__PURE__ */ E("div", {
|
|
111
|
-
className: O("ttw:flex ttw:overflow-hidden ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs ttw:transition-[color,box-shadow]", "ttw:focus-within:border-ring ttw:focus-within:ring-[3px] ttw:focus-within:ring-ring/50", "ttw:has-[[data-slot][aria-invalid=true]]:border-destructive ttw:has-[[data-slot][aria-invalid=true]]:ring-[3px] ttw:has-[[data-slot][aria-invalid=true]]:ring-destructive/20", M && "ttw:bg-white"),
|
|
112
|
-
ref: I,
|
|
113
|
-
children: [
|
|
114
|
-
/* @__PURE__ */ T(k, {
|
|
115
|
-
name: "pricePerUnit",
|
|
116
|
-
control: z,
|
|
117
|
-
render: ({ field: e, fieldState: { error: t } }) => /* @__PURE__ */ E(n, {
|
|
118
|
-
className: "ttw:flex-1 ttw:border-0 ttw:shadow-none ttw:rounded-none ttw:has-[[data-slot=input-group-control]:focus-visible]:border-transparent ttw:has-[[data-slot=input-group-control]:focus-visible]:ring-0",
|
|
119
|
-
children: [/* @__PURE__ */ T(r, {
|
|
120
|
-
align: "inline-start",
|
|
121
|
-
children: F("USD")
|
|
122
|
-
}), /* @__PURE__ */ T(i, {
|
|
123
|
-
type: "number",
|
|
124
|
-
name: e.name,
|
|
125
|
-
ref: e.ref,
|
|
126
|
-
value: e.value ?? "",
|
|
127
|
-
onChange: (t) => e.onChange(t.target.value === "" ? void 0 : Number(t.target.value)),
|
|
128
|
-
className: "ttw:text-end",
|
|
129
|
-
onBlur: e.onBlur,
|
|
130
|
-
placeholder: "0.00",
|
|
131
|
-
"aria-invalid": !!t || void 0,
|
|
132
|
-
disabled: j
|
|
133
|
-
})]
|
|
134
|
-
})
|
|
135
|
-
}),
|
|
136
|
-
/* @__PURE__ */ T("div", { className: "ttw:w-px ttw:shrink-0 ttw:bg-border" }),
|
|
137
|
-
/* @__PURE__ */ T(k, {
|
|
138
|
-
name: "measureUnitId",
|
|
139
|
-
control: z,
|
|
140
|
-
render: ({ field: e }) => /* @__PURE__ */ E(o, {
|
|
141
|
-
value: e.value ?? null,
|
|
142
|
-
onValueChange: (t) => e.onChange(t ?? void 0),
|
|
143
|
-
items: V,
|
|
144
|
-
itemToStringLabel: U,
|
|
145
|
-
disabled: j,
|
|
146
|
-
children: [/* @__PURE__ */ T(u, {
|
|
147
|
-
showClear: !!e.value,
|
|
148
|
-
placeholder: "-",
|
|
149
|
-
disabled: j,
|
|
150
|
-
className: "ttw:w-28 ttw:border-0 ttw:shadow-none ttw:rounded-none ttw:has-[[data-slot=input-group-control]:focus-visible]:border-transparent ttw:has-[[data-slot=input-group-control]:focus-visible]:ring-0"
|
|
151
|
-
}), /* @__PURE__ */ T(c, {
|
|
152
|
-
container: I.current,
|
|
153
|
-
children: /* @__PURE__ */ E(f, { children: [/* @__PURE__ */ T(l, { children: P._("No units found") }), /* @__PURE__ */ T(s, { children: (e) => /* @__PURE__ */ T(d, {
|
|
154
|
-
value: e,
|
|
155
|
-
children: U(e)
|
|
156
|
-
}, e) })] })
|
|
157
|
-
})]
|
|
158
|
-
})
|
|
159
|
-
})
|
|
160
|
-
]
|
|
161
|
-
}),
|
|
162
|
-
/* @__PURE__ */ T(_, { errors: [B.pricePerUnit] })
|
|
163
|
-
]
|
|
164
|
-
}),
|
|
165
|
-
/* @__PURE__ */ T(k, {
|
|
166
|
-
name: "description",
|
|
167
|
-
control: z,
|
|
168
|
-
render: ({ field: e, fieldState: { error: t } }) => /* @__PURE__ */ T(h, {
|
|
169
|
-
className: "ttw:block",
|
|
170
|
-
children: /* @__PURE__ */ E(g, { children: [
|
|
171
|
-
/* @__PURE__ */ E(v, {
|
|
172
|
-
htmlFor: e.name,
|
|
173
|
-
className: "ttw:gap-1",
|
|
174
|
-
children: [P._("Description"), /* @__PURE__ */ T(p, {
|
|
175
|
-
variant: "body2",
|
|
176
|
-
color: "muted",
|
|
177
|
-
className: "ttw:leading-snug",
|
|
178
|
-
children: P._("(optional)")
|
|
179
|
-
})]
|
|
180
|
-
}),
|
|
181
|
-
/* @__PURE__ */ E(n, {
|
|
182
|
-
className: O(M && "ttw:bg-white"),
|
|
183
|
-
children: [/* @__PURE__ */ T(a, {
|
|
184
|
-
...e,
|
|
185
|
-
id: e.name,
|
|
186
|
-
placeholder: P._("e.g. 16oz whole bean, medium-dark roast, ground to order"),
|
|
187
|
-
rows: 4,
|
|
188
|
-
maxLength: 280,
|
|
189
|
-
disabled: j,
|
|
190
|
-
"aria-invalid": !!t || void 0
|
|
191
|
-
}), /* @__PURE__ */ T(r, {
|
|
192
|
-
align: "block-end",
|
|
193
|
-
className: "ttw:cursor-default",
|
|
194
|
-
children: /* @__PURE__ */ T(p, {
|
|
195
|
-
variant: "caption",
|
|
196
|
-
color: "muted",
|
|
197
|
-
className: "ttw:leading-none",
|
|
198
|
-
children: P._("{count}/280 characters", { count: (e.value ?? "").length })
|
|
199
|
-
})
|
|
200
|
-
})]
|
|
201
|
-
}),
|
|
202
|
-
/* @__PURE__ */ T(_, { errors: [t] })
|
|
203
|
-
] })
|
|
137
|
+
}),
|
|
138
|
+
children: /* @__PURE__ */ w(o, {
|
|
139
|
+
isLoading: Y,
|
|
140
|
+
dataLength: J?.data.length || 0,
|
|
141
|
+
isFiltering: ie,
|
|
142
|
+
isSearching: ae,
|
|
143
|
+
isError: X,
|
|
144
|
+
onCreate: A,
|
|
145
|
+
refetch: Z,
|
|
146
|
+
filterTitle: j._("No product or service found"),
|
|
147
|
+
filterDescription1: j._("Try adjusting your search or filter criteria"),
|
|
148
|
+
entityName: j._("products or services"),
|
|
149
|
+
actionButtonLabel: j._("Add your first product or service"),
|
|
150
|
+
actionOptions: [j._("Product")],
|
|
151
|
+
noDataTitle: j._("Build your products & services list."),
|
|
152
|
+
noDataDescription1: j._("Save the products and services you sell so you can quickly add them as line items on invoices."),
|
|
153
|
+
type: "no-data"
|
|
204
154
|
})
|
|
205
155
|
})
|
|
206
|
-
|
|
207
|
-
|
|
156
|
+
}),
|
|
157
|
+
U.id && /* @__PURE__ */ w(f, {
|
|
158
|
+
id: U.id,
|
|
159
|
+
open: U.open,
|
|
160
|
+
onDeleted: k,
|
|
161
|
+
onClose: () => W((e) => ({
|
|
162
|
+
...e,
|
|
163
|
+
open: !1
|
|
164
|
+
}))
|
|
165
|
+
}),
|
|
166
|
+
P && /* @__PURE__ */ w(d, {
|
|
167
|
+
open: P,
|
|
168
|
+
handleClose: () => F(!1)
|
|
169
|
+
})
|
|
170
|
+
] }) : /* @__PURE__ */ w(s, {});
|
|
208
171
|
};
|
|
209
172
|
//#endregion
|
|
210
|
-
export {
|
|
173
|
+
export { D as ProductsTable };
|