@argusoft/medplat-product-management 1.0.0 → 1.0.2

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 (77) hide show
  1. package/dist/BrandsPage-CSA3meke.js +385 -0
  2. package/dist/BrandsPage-CSA3meke.js.map +1 -0
  3. package/dist/CategoriesPage-BrspzkJL.js +340 -0
  4. package/dist/CategoriesPage-BrspzkJL.js.map +1 -0
  5. package/dist/{DashboardPage-BNKUQj46.js → DashboardPage-CqaquOs2.js} +21 -22
  6. package/dist/{DashboardPage-BNKUQj46.js.map → DashboardPage-CqaquOs2.js.map} +1 -1
  7. package/dist/{FacilityPicker-Coi8I3yE.js → FacilityPicker-Dv_H95WW.js} +13 -13
  8. package/dist/{FacilityPicker-Coi8I3yE.js.map → FacilityPicker-Dv_H95WW.js.map} +1 -1
  9. package/dist/{InventoryPage-BR6jOzg2.js → InventoryPage-CPbzfDMR.js} +12 -12
  10. package/dist/{InventoryPage-BR6jOzg2.js.map → InventoryPage-CPbzfDMR.js.map} +1 -1
  11. package/dist/{MemberProfileCard-DbHZCS5n.js → MemberProfileCard-0vjO3Gzd.js} +2 -2
  12. package/dist/{MemberProfileCard-DbHZCS5n.js.map → MemberProfileCard-0vjO3Gzd.js.map} +1 -1
  13. package/dist/{PaymentCreatePage-Ci3ERnby.js → PaymentCreatePage-BYmDZAIB.js} +9 -10
  14. package/dist/{PaymentCreatePage-Ci3ERnby.js.map → PaymentCreatePage-BYmDZAIB.js.map} +1 -1
  15. package/dist/{PaymentsPage-sdg902zX.js → PaymentsPage-BXPvKon-.js} +16 -16
  16. package/dist/{PaymentsPage-sdg902zX.js.map → PaymentsPage-BXPvKon-.js.map} +1 -1
  17. package/dist/PickupCreatePage-CMGwoAXj.js +426 -0
  18. package/dist/PickupCreatePage-CMGwoAXj.js.map +1 -0
  19. package/dist/{PickupsPage-Ci2Ll0Kn.js → PickupsPage-D66_Wta4.js} +84 -39
  20. package/dist/PickupsPage-D66_Wta4.js.map +1 -0
  21. package/dist/PmTable-B9970kPY.js +375 -0
  22. package/dist/PmTable-B9970kPY.js.map +1 -0
  23. package/dist/{ProductEditPage-DL8gy85Y.js → ProductEditPage-B8qFTCW9.js} +226 -243
  24. package/dist/ProductEditPage-B8qFTCW9.js.map +1 -0
  25. package/dist/ProductsPage-C7_r9cKn.js +254 -0
  26. package/dist/ProductsPage-C7_r9cKn.js.map +1 -0
  27. package/dist/{PurchaseCreatePage-C3KMfBxJ.js → PurchaseCreatePage-CDfNDcKG.js} +150 -149
  28. package/dist/PurchaseCreatePage-CDfNDcKG.js.map +1 -0
  29. package/dist/{PurchaseRequestDetailPage-C0GYFJDl.js → PurchaseRequestDetailPage-C7aAwEqw.js} +15 -15
  30. package/dist/{PurchaseRequestDetailPage-C0GYFJDl.js.map → PurchaseRequestDetailPage-C7aAwEqw.js.map} +1 -1
  31. package/dist/{PurchaseRequestsPage-DvFH_tWe.js → PurchaseRequestsPage-BwCkbpaX.js} +14 -14
  32. package/dist/{PurchaseRequestsPage-DvFH_tWe.js.map → PurchaseRequestsPage-BwCkbpaX.js.map} +1 -1
  33. package/dist/{PurchasesPage-BCvLvSp4.js → PurchasesPage-CvaZouVy.js} +11 -12
  34. package/dist/{PurchasesPage-BCvLvSp4.js.map → PurchasesPage-CvaZouVy.js.map} +1 -1
  35. package/dist/{SaleCreatePage-DpkQMoTq.js → SaleCreatePage-DP1Qmltu.js} +30 -31
  36. package/dist/{SaleCreatePage-DpkQMoTq.js.map → SaleCreatePage-DP1Qmltu.js.map} +1 -1
  37. package/dist/{SalesPage-DUwgkEO-.js → SalesPage-CO3cdYX5.js} +18 -19
  38. package/dist/{SalesPage-DUwgkEO-.js.map → SalesPage-CO3cdYX5.js.map} +1 -1
  39. package/dist/{SettingsPage-CusC0jqJ.js → SettingsPage-DvVRwSFw.js} +104 -103
  40. package/dist/SettingsPage-DvVRwSFw.js.map +1 -0
  41. package/dist/StorageUnitsPage-B9Hr_RkW.js +470 -0
  42. package/dist/StorageUnitsPage-B9Hr_RkW.js.map +1 -0
  43. package/dist/{TransactionsPage-DDaK4VyY.js → TransactionsPage-HKIGwEZN.js} +127 -123
  44. package/dist/TransactionsPage-HKIGwEZN.js.map +1 -0
  45. package/dist/{TransferCreatePage-BxudLfhS.js → TransferCreatePage-DMuZqQ3c.js} +9 -9
  46. package/dist/{TransferCreatePage-BxudLfhS.js.map → TransferCreatePage-DMuZqQ3c.js.map} +1 -1
  47. package/dist/{TransfersPage-zgmt7teZ.js → TransfersPage-COIyouL4.js} +16 -16
  48. package/dist/{TransfersPage-zgmt7teZ.js.map → TransfersPage-COIyouL4.js.map} +1 -1
  49. package/dist/{VialsPage-CjqPfgpV.js → VialsPage-BNPUwGCU.js} +291 -224
  50. package/dist/VialsPage-BNPUwGCU.js.map +1 -0
  51. package/dist/{constants-BrA_hfAI.js → constants-5ZCZo-Zm.js} +5 -2
  52. package/dist/{constants-BrA_hfAI.js.map → constants-5ZCZo-Zm.js.map} +1 -1
  53. package/dist/{PmGuard-CjJBisaN.js → currency-ClRLIEg2.js} +186 -9
  54. package/dist/currency-ClRLIEg2.js.map +1 -0
  55. package/dist/index.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/BrandsPage-DCMCVvDY.js +0 -334
  58. package/dist/BrandsPage-DCMCVvDY.js.map +0 -1
  59. package/dist/CategoriesPage-BpRhwfrc.js +0 -284
  60. package/dist/CategoriesPage-BpRhwfrc.js.map +0 -1
  61. package/dist/PickupCreatePage-CieMsgWV.js +0 -310
  62. package/dist/PickupCreatePage-CieMsgWV.js.map +0 -1
  63. package/dist/PickupsPage-Ci2Ll0Kn.js.map +0 -1
  64. package/dist/PmGuard-CjJBisaN.js.map +0 -1
  65. package/dist/PmTable-BuXZQZCU.js +0 -302
  66. package/dist/PmTable-BuXZQZCU.js.map +0 -1
  67. package/dist/ProductEditPage-DL8gy85Y.js.map +0 -1
  68. package/dist/ProductsPage-BANTKxLb.js +0 -221
  69. package/dist/ProductsPage-BANTKxLb.js.map +0 -1
  70. package/dist/PurchaseCreatePage-C3KMfBxJ.js.map +0 -1
  71. package/dist/SettingsPage-CusC0jqJ.js.map +0 -1
  72. package/dist/StorageUnitsPage-BlC2AgrJ.js +0 -469
  73. package/dist/StorageUnitsPage-BlC2AgrJ.js.map +0 -1
  74. package/dist/TransactionsPage-DDaK4VyY.js.map +0 -1
  75. package/dist/VialsPage-CjqPfgpV.js.map +0 -1
  76. package/dist/currency-BDDCDgeE.js +0 -169
  77. package/dist/currency-BDDCDgeE.js.map +0 -1
@@ -0,0 +1,375 @@
1
+ import { l as e, t } from "./currency-ClRLIEg2.js";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import { Autocomplete as i, Box as a, Card as o, CardContent as s, Stack as c, Table as l, TableCell as u, TableContainer as d, TableRow as f, TextField as p, Typography as m } from "@mui/material";
4
+ import h from "prop-types";
5
+ import { alpha as g, useTheme as _ } from "@mui/material/styles";
6
+ //#region src/components/PmTable.jsx
7
+ function v({ children: e, dense: t = !1, sx: r = {}, ...i }) {
8
+ let a = _();
9
+ return /* @__PURE__ */ n(d, {
10
+ sx: {
11
+ borderRadius: 2.5,
12
+ border: `1px solid ${g(a.palette.divider, .55)}`,
13
+ backgroundColor: a.palette.background.paper,
14
+ overflow: "auto",
15
+ ...r
16
+ },
17
+ children: /* @__PURE__ */ n(l, {
18
+ size: t ? "small" : "medium",
19
+ ...i,
20
+ sx: {
21
+ "& thead .MuiTableRow-root": { background: `linear-gradient(180deg, ${g(a.palette.grey[50], 1)} 0%, ${g(a.palette.grey[100], 1)} 100%)` },
22
+ "& thead .MuiTableCell-root": {
23
+ fontWeight: 800,
24
+ fontSize: "0.7rem",
25
+ textTransform: "uppercase",
26
+ letterSpacing: "0.65px",
27
+ color: a.palette.text.secondary,
28
+ borderBottom: `1px solid ${a.palette.divider}`,
29
+ py: 1.25,
30
+ whiteSpace: "nowrap",
31
+ position: "sticky",
32
+ top: 0,
33
+ zIndex: 1
34
+ },
35
+ "& tbody .MuiTableRow-root": { transition: "background-color 140ms ease" },
36
+ "& tbody .MuiTableRow-root:hover": { backgroundColor: g(a.palette.primary.main, .04) },
37
+ "& tbody .MuiTableCell-root": {
38
+ py: 1.4,
39
+ borderBottom: `1px solid ${g(a.palette.divider, .5)}`,
40
+ verticalAlign: "middle"
41
+ },
42
+ "& tbody .MuiTableRow-root:last-of-type .MuiTableCell-root": { borderBottom: "none" }
43
+ },
44
+ children: e
45
+ })
46
+ });
47
+ }
48
+ v.propTypes = {
49
+ children: h.node,
50
+ dense: h.bool,
51
+ sx: h.object
52
+ };
53
+ function y({ eyebrow: e, title: t, subtitle: i, actions: l, toolbar: u, children: d, sx: f = {} }) {
54
+ return /* @__PURE__ */ n(o, {
55
+ sx: {
56
+ borderRadius: 4,
57
+ border: "1px solid",
58
+ borderColor: "divider",
59
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)",
60
+ overflow: "hidden",
61
+ ...f
62
+ },
63
+ children: /* @__PURE__ */ r(s, {
64
+ sx: {
65
+ p: 0,
66
+ "&:last-child": { pb: 0 }
67
+ },
68
+ children: [
69
+ t || l ? /* @__PURE__ */ n(a, {
70
+ sx: {
71
+ px: 2.5,
72
+ pt: 2,
73
+ pb: 1.5
74
+ },
75
+ children: /* @__PURE__ */ r(c, {
76
+ direction: {
77
+ xs: "column",
78
+ md: "row"
79
+ },
80
+ justifyContent: "space-between",
81
+ alignItems: {
82
+ xs: "flex-start",
83
+ md: "center"
84
+ },
85
+ spacing: 1.5,
86
+ children: [/* @__PURE__ */ r(a, {
87
+ sx: { minWidth: 0 },
88
+ children: [
89
+ e ? /* @__PURE__ */ n(m, {
90
+ variant: "overline",
91
+ sx: {
92
+ color: "text.secondary",
93
+ fontWeight: 800,
94
+ letterSpacing: 1,
95
+ lineHeight: 1
96
+ },
97
+ children: e
98
+ }) : null,
99
+ t ? /* @__PURE__ */ n(m, {
100
+ variant: "h6",
101
+ sx: {
102
+ fontWeight: 800,
103
+ lineHeight: 1.2
104
+ },
105
+ children: t
106
+ }) : null,
107
+ i ? /* @__PURE__ */ n(m, {
108
+ variant: "caption",
109
+ color: "text.secondary",
110
+ children: i
111
+ }) : null
112
+ ]
113
+ }), l ? /* @__PURE__ */ n(a, { children: l }) : null]
114
+ })
115
+ }) : null,
116
+ u ? /* @__PURE__ */ n(a, {
117
+ sx: {
118
+ px: 2.5,
119
+ pb: 1.5
120
+ },
121
+ children: u
122
+ }) : null,
123
+ /* @__PURE__ */ n(a, {
124
+ sx: {
125
+ p: 2.5,
126
+ pt: t || u ? 0 : 2.5
127
+ },
128
+ children: d
129
+ })
130
+ ]
131
+ })
132
+ });
133
+ }
134
+ y.propTypes = {
135
+ eyebrow: h.node,
136
+ title: h.node,
137
+ subtitle: h.node,
138
+ actions: h.node,
139
+ toolbar: h.node,
140
+ children: h.node,
141
+ sx: h.object
142
+ };
143
+ function b({ colSpan: e, title: t, hint: i, icon: o, action: s }) {
144
+ return /* @__PURE__ */ n(f, {
145
+ hover: !1,
146
+ children: /* @__PURE__ */ n(u, {
147
+ colSpan: e,
148
+ sx: {
149
+ py: 5,
150
+ textAlign: "center",
151
+ borderBottom: "none !important"
152
+ },
153
+ children: /* @__PURE__ */ r(c, {
154
+ alignItems: "center",
155
+ spacing: 1.25,
156
+ children: [
157
+ o ? /* @__PURE__ */ n(o, { sx: {
158
+ fontSize: 44,
159
+ color: "text.disabled",
160
+ opacity: .7
161
+ } }) : null,
162
+ /* @__PURE__ */ n(m, {
163
+ variant: "body2",
164
+ sx: { fontWeight: 700 },
165
+ children: t
166
+ }),
167
+ i ? /* @__PURE__ */ n(m, {
168
+ variant: "caption",
169
+ color: "text.secondary",
170
+ sx: { maxWidth: 360 },
171
+ children: i
172
+ }) : null,
173
+ s ? /* @__PURE__ */ n(a, { children: s }) : null
174
+ ]
175
+ })
176
+ })
177
+ });
178
+ }
179
+ b.propTypes = {
180
+ colSpan: h.number.isRequired,
181
+ title: h.node,
182
+ hint: h.node,
183
+ icon: h.elementType,
184
+ action: h.node
185
+ };
186
+ function x({ value: i, fallback: o = "—", size: s = "normal", tone: c, bold: l = !0, prefix: u, sx: d = {} }) {
187
+ let f = _(), p = e(), m = u ?? t(p?.currencyCode);
188
+ if (i == null || i === "") return /* @__PURE__ */ n(a, {
189
+ component: "span",
190
+ sx: {
191
+ color: "text.disabled",
192
+ fontVariantNumeric: "tabular-nums"
193
+ },
194
+ children: o
195
+ });
196
+ let h = Number(i);
197
+ if (Number.isNaN(h)) return /* @__PURE__ */ n(a, {
198
+ component: "span",
199
+ sx: {
200
+ color: "text.disabled",
201
+ fontVariantNumeric: "tabular-nums"
202
+ },
203
+ children: o
204
+ });
205
+ let g = c === "warning" ? f.palette.warning.dark : c === "success" ? f.palette.success.dark : c === "error" ? f.palette.error.dark : c === "muted" ? f.palette.text.secondary : "inherit";
206
+ return /* @__PURE__ */ r(a, {
207
+ component: "span",
208
+ sx: {
209
+ fontWeight: l ? s === "big" ? 800 : 700 : 500,
210
+ fontSize: s === "big" ? "1.05rem" : "inherit",
211
+ fontVariantNumeric: "tabular-nums",
212
+ color: g,
213
+ ...d
214
+ },
215
+ children: [m, h.toFixed(2)]
216
+ });
217
+ }
218
+ x.propTypes = {
219
+ value: h.oneOfType([h.string, h.number]),
220
+ fallback: h.node,
221
+ size: h.oneOf(["normal", "big"]),
222
+ tone: h.oneOf([
223
+ "warning",
224
+ "success",
225
+ "error",
226
+ "muted"
227
+ ]),
228
+ bold: h.bool,
229
+ prefix: h.string,
230
+ sx: h.object
231
+ };
232
+ function S({ id: e }) {
233
+ return /* @__PURE__ */ r(a, {
234
+ component: "span",
235
+ sx: {
236
+ display: "inline-flex",
237
+ alignItems: "center",
238
+ px: .85,
239
+ py: .25,
240
+ borderRadius: 1,
241
+ backgroundColor: "grey.100",
242
+ color: "text.secondary",
243
+ fontFamily: "monospace",
244
+ fontSize: "0.72rem",
245
+ fontWeight: 700,
246
+ letterSpacing: .4,
247
+ lineHeight: 1.5
248
+ },
249
+ children: ["#", e]
250
+ });
251
+ }
252
+ S.propTypes = { id: h.oneOfType([h.string, h.number]) };
253
+ function C({ message: e, value: t, max: i }) {
254
+ let o = (t ?? "").length, s = Math.max(0, i - o);
255
+ return /* @__PURE__ */ r(a, {
256
+ component: "span",
257
+ sx: {
258
+ display: "flex",
259
+ width: "100%",
260
+ gap: 1
261
+ },
262
+ children: [/* @__PURE__ */ n(a, {
263
+ component: "span",
264
+ sx: { flexGrow: 1 },
265
+ children: e || ""
266
+ }), /* @__PURE__ */ r(a, {
267
+ component: "span",
268
+ sx: {
269
+ flexShrink: 0,
270
+ fontVariantNumeric: "tabular-nums",
271
+ color: "text.secondary"
272
+ },
273
+ children: [
274
+ s,
275
+ "/",
276
+ i
277
+ ]
278
+ })]
279
+ });
280
+ }
281
+ C.propTypes = {
282
+ message: h.node,
283
+ value: h.string,
284
+ max: h.number.isRequired
285
+ };
286
+ function w({ label: e, value: t, onChange: r, onBlur: a, options: o, required: s = !1, disabled: c = !1, error: l = !1, helperText: u = "", fullWidth: d = !0, size: f = "small", noOptionsText: m, sx: h = {} }) {
287
+ return /* @__PURE__ */ n(i, {
288
+ size: f,
289
+ fullWidth: d,
290
+ disabled: c,
291
+ options: o,
292
+ value: o.find((e) => e.value === t) ?? null,
293
+ onChange: (e, t) => r(t ? t.value : ""),
294
+ getOptionLabel: (e) => e?.label ?? "",
295
+ isOptionEqualToValue: (e, t) => e?.value === t?.value,
296
+ disableClearable: s,
297
+ noOptionsText: m,
298
+ sx: h,
299
+ renderInput: (t) => /* @__PURE__ */ n(p, {
300
+ ...t,
301
+ label: e,
302
+ required: s,
303
+ error: l,
304
+ helperText: u,
305
+ onBlur: a
306
+ })
307
+ });
308
+ }
309
+ w.propTypes = {
310
+ label: h.node,
311
+ value: h.any,
312
+ onChange: h.func.isRequired,
313
+ onBlur: h.func,
314
+ options: h.arrayOf(h.shape({
315
+ value: h.any,
316
+ label: h.node
317
+ })).isRequired,
318
+ required: h.bool,
319
+ disabled: h.bool,
320
+ error: h.bool,
321
+ helperText: h.node,
322
+ fullWidth: h.bool,
323
+ size: h.string,
324
+ noOptionsText: h.node,
325
+ sx: h.object
326
+ };
327
+ function T({ eyebrow: e, title: t, hint: i, children: o, sx: s = {} }) {
328
+ return /* @__PURE__ */ r(a, {
329
+ sx: s,
330
+ children: [e || t || i ? /* @__PURE__ */ r(a, {
331
+ sx: { mb: 1.75 },
332
+ children: [
333
+ e ? /* @__PURE__ */ n(m, {
334
+ variant: "overline",
335
+ sx: {
336
+ color: "text.secondary",
337
+ fontWeight: 800,
338
+ letterSpacing: 1,
339
+ lineHeight: 1,
340
+ display: "block"
341
+ },
342
+ children: e
343
+ }) : null,
344
+ t ? /* @__PURE__ */ n(m, {
345
+ variant: "h6",
346
+ sx: {
347
+ fontWeight: 800,
348
+ lineHeight: 1.25
349
+ },
350
+ children: t
351
+ }) : null,
352
+ i ? /* @__PURE__ */ n(m, {
353
+ variant: "caption",
354
+ color: "text.secondary",
355
+ sx: {
356
+ display: "block",
357
+ mt: .5
358
+ },
359
+ children: i
360
+ }) : null
361
+ ]
362
+ }) : null, o]
363
+ });
364
+ }
365
+ T.propTypes = {
366
+ eyebrow: h.node,
367
+ title: h.node,
368
+ hint: h.node,
369
+ children: h.node,
370
+ sx: h.object
371
+ };
372
+ //#endregion
373
+ export { S as a, y as c, x as i, C as n, w as o, T as r, v as s, b as t };
374
+
375
+ //# sourceMappingURL=PmTable-B9970kPY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PmTable-B9970kPY.js","names":[],"sources":["../src/components/PmTable.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {\n Autocomplete,\n Box,\n Card,\n CardContent,\n Stack,\n Table,\n TableCell,\n TableContainer,\n TableRow,\n TextField,\n Typography,\n} from '@mui/material';\nimport { alpha, useTheme } from '@mui/material/styles';\nimport { currencySymbol } from '@pm/utils/currency';\nimport { usePmSettings } from '@pm/utils/settingsStore';\n\n// Shared building blocks for the data-heavy PM tables. The goal is one\n// consistent look: gradient-headed table, soft hover, eyebrow + title card\n// chrome, semantic empty state, tabular-figure money cell. Every list page\n// is built from these so the visual rhythm is identical everywhere.\n\n// -------- Table -----------------------------------------------------------\n\nexport function PmTable({ children, dense = false, sx = {}, ...props }) {\n const theme = useTheme();\n return (\n <TableContainer\n sx={{\n borderRadius: 2.5,\n border: `1px solid ${alpha(theme.palette.divider, 0.55)}`,\n backgroundColor: theme.palette.background.paper,\n overflow: 'auto',\n ...sx,\n }}\n >\n <Table\n size={dense ? 'small' : 'medium'}\n {...props}\n sx={{\n '& thead .MuiTableRow-root': {\n background: `linear-gradient(180deg, ${alpha(theme.palette.grey[50], 1)} 0%, ${alpha(theme.palette.grey[100], 1)} 100%)`,\n },\n '& thead .MuiTableCell-root': {\n fontWeight: 800,\n fontSize: '0.7rem',\n textTransform: 'uppercase',\n letterSpacing: '0.65px',\n color: theme.palette.text.secondary,\n borderBottom: `1px solid ${theme.palette.divider}`,\n py: 1.25,\n whiteSpace: 'nowrap',\n position: 'sticky',\n top: 0,\n zIndex: 1,\n },\n '& tbody .MuiTableRow-root': {\n transition: 'background-color 140ms ease',\n },\n '& tbody .MuiTableRow-root:hover': {\n backgroundColor: alpha(theme.palette.primary.main, 0.04),\n },\n '& tbody .MuiTableCell-root': {\n py: 1.4,\n borderBottom: `1px solid ${alpha(theme.palette.divider, 0.5)}`,\n verticalAlign: 'middle',\n },\n '& tbody .MuiTableRow-root:last-of-type .MuiTableCell-root': {\n borderBottom: 'none',\n },\n }}\n >\n {children}\n </Table>\n </TableContainer>\n );\n}\nPmTable.propTypes = {\n children: PropTypes.node,\n dense: PropTypes.bool,\n sx: PropTypes.object,\n};\n\n// -------- Section card chrome --------------------------------------------\n\n/**\n * Card with a consistent eyebrow + title + actions header, ready to hold a\n * PmTable (or any other content). The table renders flush against the card\n * because the container handles borders/radius. Toolbar slot is for filters\n * or search inputs that sit between the title and the table.\n */\nexport function PmTableCard({\n eyebrow,\n title,\n subtitle,\n actions,\n toolbar,\n children,\n sx = {},\n}) {\n return (\n <Card\n sx={{\n borderRadius: 4,\n border: '1px solid',\n borderColor: 'divider',\n boxShadow: '0 12px 32px rgba(15, 23, 42, 0.045)',\n overflow: 'hidden',\n ...sx,\n }}\n >\n <CardContent sx={{ p: 0, '&:last-child': { pb: 0 } }}>\n {(title || actions) ? (\n <Box sx={{ px: 2.5, pt: 2, pb: 1.5 }}>\n <Stack\n direction={{ xs: 'column', md: 'row' }}\n justifyContent=\"space-between\"\n alignItems={{ xs: 'flex-start', md: 'center' }}\n spacing={1.5}\n >\n <Box sx={{ minWidth: 0 }}>\n {eyebrow ? (\n <Typography\n variant=\"overline\"\n sx={{ color: 'text.secondary', fontWeight: 800, letterSpacing: 1, lineHeight: 1 }}\n >\n {eyebrow}\n </Typography>\n ) : null}\n {title ? (\n <Typography variant=\"h6\" sx={{ fontWeight: 800, lineHeight: 1.2 }}>\n {title}\n </Typography>\n ) : null}\n {subtitle ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {subtitle}\n </Typography>\n ) : null}\n </Box>\n {actions ? <Box>{actions}</Box> : null}\n </Stack>\n </Box>\n ) : null}\n {toolbar ? <Box sx={{ px: 2.5, pb: 1.5 }}>{toolbar}</Box> : null}\n <Box sx={{ p: 2.5, pt: title || toolbar ? 0 : 2.5 }}>{children}</Box>\n </CardContent>\n </Card>\n );\n}\nPmTableCard.propTypes = {\n eyebrow: PropTypes.node,\n title: PropTypes.node,\n subtitle: PropTypes.node,\n actions: PropTypes.node,\n toolbar: PropTypes.node,\n children: PropTypes.node,\n sx: PropTypes.object,\n};\n\n// -------- Empty state row -------------------------------------------------\n\nexport function PmEmptyRow({ colSpan, title, hint, icon: Icon, action }) {\n return (\n <TableRow hover={false}>\n <TableCell colSpan={colSpan} sx={{ py: 5, textAlign: 'center', borderBottom: 'none !important' }}>\n <Stack alignItems=\"center\" spacing={1.25}>\n {Icon ? <Icon sx={{ fontSize: 44, color: 'text.disabled', opacity: 0.7 }} /> : null}\n <Typography variant=\"body2\" sx={{ fontWeight: 700 }}>{title}</Typography>\n {hint ? (\n <Typography variant=\"caption\" color=\"text.secondary\" sx={{ maxWidth: 360 }}>{hint}</Typography>\n ) : null}\n {action ? <Box>{action}</Box> : null}\n </Stack>\n </TableCell>\n </TableRow>\n );\n}\nPmEmptyRow.propTypes = {\n colSpan: PropTypes.number.isRequired,\n title: PropTypes.node,\n hint: PropTypes.node,\n icon: PropTypes.elementType,\n action: PropTypes.node,\n};\n\n// -------- Money cell ------------------------------------------------------\n\n/**\n * Currency display with tabular figures so numbers don't shift between\n * rows. {@code tone} can semantically colour the value — useful for\n * paid/due splits in the Sales table.\n */\nexport function PmMoney({ value, fallback = '—', size = 'normal', tone, bold = true, prefix, sx = {} }) {\n const theme = useTheme();\n const settings = usePmSettings();\n // When the caller doesn't override the prefix, pull the symbol from the\n // module settings — every PmMoney across the module then renders with the\n // currency configured for the deployment.\n const effectivePrefix = prefix ?? currencySymbol(settings?.currencyCode);\n if (value == null || value === '') {\n return <Box component=\"span\" sx={{ color: 'text.disabled', fontVariantNumeric: 'tabular-nums' }}>{fallback}</Box>;\n }\n const n = Number(value);\n if (Number.isNaN(n)) {\n return <Box component=\"span\" sx={{ color: 'text.disabled', fontVariantNumeric: 'tabular-nums' }}>{fallback}</Box>;\n }\n const color = tone === 'warning' ? theme.palette.warning.dark\n : tone === 'success' ? theme.palette.success.dark\n : tone === 'error' ? theme.palette.error.dark\n : tone === 'muted' ? theme.palette.text.secondary\n : 'inherit';\n return (\n <Box\n component=\"span\"\n sx={{\n fontWeight: bold ? (size === 'big' ? 800 : 700) : 500,\n fontSize: size === 'big' ? '1.05rem' : 'inherit',\n fontVariantNumeric: 'tabular-nums',\n color,\n ...sx,\n }}\n >\n {effectivePrefix}{n.toFixed(2)}\n </Box>\n );\n}\nPmMoney.propTypes = {\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n fallback: PropTypes.node,\n size: PropTypes.oneOf(['normal', 'big']),\n tone: PropTypes.oneOf(['warning', 'success', 'error', 'muted']),\n bold: PropTypes.bool,\n prefix: PropTypes.string,\n sx: PropTypes.object,\n};\n\n// -------- Reference chip --------------------------------------------------\n\n/** Monospace `#1234` chip used in left-most \"Ref\" columns. */\nexport function PmRef({ id }) {\n return (\n <Box\n component=\"span\"\n sx={{\n display: 'inline-flex',\n alignItems: 'center',\n px: 0.85,\n py: 0.25,\n borderRadius: 1,\n backgroundColor: 'grey.100',\n color: 'text.secondary',\n fontFamily: 'monospace',\n fontSize: '0.72rem',\n fontWeight: 700,\n letterSpacing: 0.4,\n lineHeight: 1.5,\n }}\n >\n #{id}\n </Box>\n );\n}\nPmRef.propTypes = {\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n};\n\n// -------- Field helper text with character counter -----------------------\n\n/**\n * Helper-text content that pairs a message (validation error or hint) on the\n * left with a live \"remaining/allowed\" character counter on the right. Pass\n * as a TextField's `helperText`. Renders only spans so it's valid inside the\n * FormHelperText <p>.\n */\nexport function PmFieldHelp({ message, value, max }) {\n const used = (value ?? '').length;\n const remaining = Math.max(0, max - used);\n return (\n <Box component=\"span\" sx={{ display: 'flex', width: '100%', gap: 1 }}>\n <Box component=\"span\" sx={{ flexGrow: 1 }}>{message || ''}</Box>\n <Box\n component=\"span\"\n sx={{ flexShrink: 0, fontVariantNumeric: 'tabular-nums', color: 'text.secondary' }}\n >\n {remaining}/{max}\n </Box>\n </Box>\n );\n}\nPmFieldHelp.propTypes = {\n message: PropTypes.node,\n value: PropTypes.string,\n max: PropTypes.number.isRequired,\n};\n\n// -------- Select (dropdown) ----------------------------------------------\n\n/**\n * Standard PM dropdown. Wraps MUI Autocomplete (the app-wide dropdown\n * pattern, same as FacilityPicker / CustomDropdown) so every select in the\n * module looks and behaves identically and sizes like the themed text\n * fields. Options are plain `{ value, label }`; `value`/`onChange` work with\n * the raw value so callers don't deal with option objects.\n */\nexport function PmSelect({\n label,\n value,\n onChange,\n onBlur,\n options,\n required = false,\n disabled = false,\n error = false,\n helperText = '',\n fullWidth = true,\n size = 'small',\n noOptionsText,\n sx = {},\n}) {\n const selected = options.find((o) => o.value === value) ?? null;\n return (\n <Autocomplete\n size={size}\n fullWidth={fullWidth}\n disabled={disabled}\n options={options}\n value={selected}\n onChange={(_, opt) => onChange(opt ? opt.value : '')}\n getOptionLabel={(o) => o?.label ?? ''}\n isOptionEqualToValue={(o, v) => o?.value === v?.value}\n disableClearable={required}\n noOptionsText={noOptionsText}\n sx={sx}\n renderInput={(params) => (\n <TextField\n {...params}\n label={label}\n required={required}\n error={error}\n helperText={helperText}\n onBlur={onBlur}\n />\n )}\n />\n );\n}\nPmSelect.propTypes = {\n label: PropTypes.node,\n value: PropTypes.any,\n onChange: PropTypes.func.isRequired,\n onBlur: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.any,\n label: PropTypes.node,\n })).isRequired,\n required: PropTypes.bool,\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n helperText: PropTypes.node,\n fullWidth: PropTypes.bool,\n size: PropTypes.string,\n noOptionsText: PropTypes.node,\n sx: PropTypes.object,\n};\n\n// -------- Form section helper --------------------------------------------\n\n/**\n * Wraps a chunk of form fields with a consistent eyebrow + title + hint\n * header. Used inside create/edit pages so every section has the same\n * vertical rhythm.\n */\nexport function PmFormSection({ eyebrow, title, hint, children, sx = {} }) {\n return (\n <Box sx={sx}>\n {(eyebrow || title || hint) ? (\n <Box sx={{ mb: 1.75 }}>\n {eyebrow ? (\n <Typography\n variant=\"overline\"\n sx={{ color: 'text.secondary', fontWeight: 800, letterSpacing: 1, lineHeight: 1, display: 'block' }}\n >\n {eyebrow}\n </Typography>\n ) : null}\n {title ? (\n <Typography variant=\"h6\" sx={{ fontWeight: 800, lineHeight: 1.25 }}>{title}</Typography>\n ) : null}\n {hint ? (\n <Typography variant=\"caption\" color=\"text.secondary\" sx={{ display: 'block', mt: 0.5 }}>\n {hint}\n </Typography>\n ) : null}\n </Box>\n ) : null}\n {children}\n </Box>\n );\n}\nPmFormSection.propTypes = {\n eyebrow: PropTypes.node,\n title: PropTypes.node,\n hint: PropTypes.node,\n children: PropTypes.node,\n sx: PropTypes.object,\n};\n"],"mappings":";;;;;;AAyBA,SAAgB,EAAQ,EAAE,aAAU,WAAQ,IAAO,QAAK,CAAC,GAAG,GAAG,KAAS;CACtE,IAAM,IAAQ,EAAS;CACvB,OACE,kBAAC,GAAD;EACE,IAAI;GACF,cAAc;GACd,QAAQ,aAAa,EAAM,EAAM,QAAQ,SAAS,GAAI;GACtD,iBAAiB,EAAM,QAAQ,WAAW;GAC1C,UAAU;GACV,GAAG;EACL;YAEA,kBAAC,GAAD;GACE,MAAM,IAAQ,UAAU;GACxB,GAAI;GACJ,IAAI;IACF,6BAA6B,EAC3B,YAAY,2BAA2B,EAAM,EAAM,QAAQ,KAAK,KAAK,CAAC,EAAE,OAAO,EAAM,EAAM,QAAQ,KAAK,MAAM,CAAC,EAAE,QACnH;IACA,8BAA8B;KAC5B,YAAY;KACZ,UAAU;KACV,eAAe;KACf,eAAe;KACf,OAAO,EAAM,QAAQ,KAAK;KAC1B,cAAc,aAAa,EAAM,QAAQ;KACzC,IAAI;KACJ,YAAY;KACZ,UAAU;KACV,KAAK;KACL,QAAQ;IACV;IACA,6BAA6B,EAC3B,YAAY,8BACd;IACA,mCAAmC,EACjC,iBAAiB,EAAM,EAAM,QAAQ,QAAQ,MAAM,GAAI,EACzD;IACA,8BAA8B;KAC5B,IAAI;KACJ,cAAc,aAAa,EAAM,EAAM,QAAQ,SAAS,EAAG;KAC3D,eAAe;IACjB;IACA,6DAA6D,EAC3D,cAAc,OAChB;GACF;GAEC;EACI,CAAA;CACO,CAAA;AAEpB;AACA,EAAQ,YAAY;CAClB,UAAU,EAAU;CACpB,OAAO,EAAU;CACjB,IAAI,EAAU;AAChB;AAUA,SAAgB,EAAY,EAC1B,YACA,UACA,aACA,YACA,YACA,aACA,QAAK,CAAC,KACL;CACD,OACE,kBAAC,GAAD;EACE,IAAI;GACF,cA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