@mx-cartographer/experiences 7.6.21 → 7.6.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/CategorySelectorDrawer-cQKX5dZb.mjs +418 -0
  3. package/dist/{ManageIncome-1FRPmZFq.mjs → ManageIncome-DMVbsehr.mjs} +2 -2
  4. package/dist/{RecurringSettings-z0XUW9qx.mjs → RecurringSettings-C_9BmZvv.mjs} +2 -2
  5. package/dist/{SpendingLegend-BLAhLb1w.mjs → SpendingLegend-BZsjOYfi.mjs} +1 -1
  6. package/dist/{TransactionDetails-BKoBKUNp.mjs → TransactionDetails-CTc7ilRf.mjs} +151 -148
  7. package/dist/{WidgetContainer-COyiIVSd.mjs → WidgetContainer-CpuFZNTe.mjs} +164 -192
  8. package/dist/accounts/index.es.js +2 -2
  9. package/dist/budgets/index.es.js +4 -4
  10. package/dist/cashflow/index.es.js +4 -4
  11. package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
  12. package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
  13. package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
  14. package/dist/categories/components/SubcategoryRow.d.ts +1 -0
  15. package/dist/categories/index.es.js +1 -1
  16. package/dist/common/index.es.js +1 -1
  17. package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
  18. package/dist/debts/index.es.js +1 -1
  19. package/dist/finstrong/index.es.js +5 -5
  20. package/dist/goals/index.es.js +159 -158
  21. package/dist/help/index.es.js +1 -1
  22. package/dist/investments/index.es.js +1 -1
  23. package/dist/networth/index.es.js +1 -1
  24. package/dist/recurringtransactions/index.es.js +5 -5
  25. package/dist/settings/index.es.js +2 -2
  26. package/dist/spending/index.es.js +22 -22
  27. package/dist/transactions/index.es.js +67 -66
  28. package/dist/trends/index.es.js +2 -2
  29. package/dist/useAriaLive-B3_pRUio.mjs +35 -0
  30. package/package.json +1 -1
  31. package/dist/CategorySelectorDrawer-DywvMfPe.mjs +0 -399
@@ -1,399 +0,0 @@
1
- import { jsx as t, jsxs as E } from "react/jsx-runtime";
2
- import { observer as g } from "mobx-react-lite";
3
- import C from "react";
4
- import $ from "@mui/material/Stack";
5
- import { G as K, m as y, u as b, g as D, b as U } from "./hooks-ZMp65DFz.mjs";
6
- import Y from "@mui/material/List";
7
- import V from "@mui/material/Paper";
8
- import v from "@mui/material/Divider";
9
- import x from "@mui/material/ListItem";
10
- import W from "@mui/material/ListItemAvatar";
11
- import N from "@mui/material/ListItemButton";
12
- import F from "@mui/material/ListItemIcon";
13
- import G from "@mui/material/ListItemText";
14
- import { CheckCircle as M, Edit as j, Delete as X, ExpandMore as z } from "@mxenabled/mx-icons";
15
- import { Text as B, TextField as q, CategoryIcon as H } from "@mxenabled/mxui";
16
- import J from "@mui/material/Collapse";
17
- import Q from "@mui/material/DialogContent";
18
- import { b as S } from "./Localization-2MODESHW.mjs";
19
- import { a as Z } from "./Dialog-B4PI-_bL.mjs";
20
- import ee from "@mui/material/Box";
21
- import te from "@mui/material/Chip";
22
- import I from "@mui/material/IconButton";
23
- import { S as oe } from "./SearchBox-B2_zLv8-.mjs";
24
- import { L as k } from "./Loader-DUaFpDGv.mjs";
25
- import { D as ae } from "./Drawer-DV4NTsFg.mjs";
26
- const p = () => {
27
- if (!C.useContext(K))
28
- throw new Error("useCategoryUiStore() must be used within the GlobalDataContext");
29
- return y().uiStore;
30
- }, m = {
31
- ON_CATEGORY_EXPANDED: "onCategoryExpanded",
32
- ON_CATEGORY_COLLAPSED: "onCategoryCollapsed",
33
- ON_CATEGORY_SELECTED: "onCategorySelected",
34
- ON_SUBCATEGORY_ADD_CLICK: "onSubcategoryAddClick",
35
- ON_SUBCATEGORY_ADD_CANCEL_CLICK: "onSubcategoryAddCancelClick",
36
- ON_SUBCATEGORY_ADDED: "onSubcategoryAdded",
37
- ON_SUBCATEGORY_EDIT_CLICK: "onSubcategoryEditClick",
38
- ON_SUBCATEGORY_EDIT_CANCEL_CLICK: "onSubcategoryEditCancelClick",
39
- ON_SUBCATEGORY_DELETE_CLICK: "onSubcategoryDeleteClick",
40
- ON_SUBCATEGORY_DELETED: "onSubcategoryDeleted",
41
- ON_SUBCATEGORY_SAVED: "onSubcategorySaved"
42
- };
43
- var L = /* @__PURE__ */ ((e) => (e.ADD = "add", e.EDIT = "edit", e.DELETE = "delete", e))(L || {});
44
- const re = ({
45
- categoryName: e = "",
46
- onClose: o,
47
- onSave: r,
48
- isOpen: c,
49
- type: s
50
- }) => {
51
- const [a, i] = C.useState(e), { categories: n } = b(), { setShouldDisableDrawerScroll: l } = p();
52
- let u = "", d = [];
53
- const _ = s === "delete";
54
- switch (s) {
55
- case "add":
56
- u = n.add_subcategory_title;
57
- break;
58
- case "edit":
59
- u = S(n.edit_subcategory_title, e);
60
- break;
61
- case "delete":
62
- u = n.delete_subcategory_heading, d = S(
63
- n.all_transactions_in_this_subcategory,
64
- /* @__PURE__ */ t(B, { bold: !0, children: S(n.all_parent_category, e) })
65
- );
66
- break;
67
- }
68
- return /* @__PURE__ */ t(
69
- Z,
70
- {
71
- copy: {
72
- title: u
73
- },
74
- disablePrimaryButton: !a,
75
- isOpen: c,
76
- onClose: () => {
77
- l(!1), o();
78
- },
79
- onPrimaryAction: () => {
80
- l(!1), r(a);
81
- },
82
- children: /* @__PURE__ */ t(Q, { children: _ ? /* @__PURE__ */ t(B, { children: d }) : /* @__PURE__ */ t(
83
- q,
84
- {
85
- inputProps: {
86
- "aria-label": s === "edit" ? n.edit_subcategory_aria : n.add_subcategory_aria
87
- },
88
- name: "modify-subcategory",
89
- onChange: (h) => i(h.target.value),
90
- placeholder: n.input_placeholder,
91
- sx: { width: "100%" },
92
- value: a
93
- }
94
- ) })
95
- }
96
- );
97
- }, R = g(re), ne = ({ parentCategory: e }) => {
98
- const [o, r] = C.useState(!1), { addCategory: c } = y(), { categories: s } = b(), { onEvent: a } = D(), { setShouldDisableDrawerScroll: i } = p(), n = async (d) => {
99
- await c(d.trim(), e.guid), a(m.ON_SUBCATEGORY_ADDED), r(!1);
100
- }, l = async () => {
101
- a(m.ON_SUBCATEGORY_ADD_CLICK), i(!0), r(!0);
102
- }, u = () => {
103
- r(!1), a(m.ON_SUBCATEGORY_ADD_CANCEL_CLICK);
104
- };
105
- return /* @__PURE__ */ E(x, { disableGutters: !0, disablePadding: !0, children: [
106
- /* @__PURE__ */ t(N, { onClick: l, sx: { ml: 60 }, children: /* @__PURE__ */ t(
107
- G,
108
- {
109
- primary: s.add_subcategory_button,
110
- primaryTypographyProps: { color: "primary", fontWeight: "normal", variant: "Body" }
111
- }
112
- ) }),
113
- o && /* @__PURE__ */ t(
114
- R,
115
- {
116
- isOpen: o,
117
- onClose: u,
118
- onSave: n,
119
- type: L.ADD
120
- }
121
- )
122
- ] });
123
- }, se = g(ne), ie = ({
124
- setShowRename: e,
125
- subCategory: o,
126
- showRename: r
127
- }) => {
128
- const { updateCategory: c } = y(), { onEvent: s } = D(), a = async (n) => {
129
- await c({ ...o, name: n }), s(m.ON_SUBCATEGORY_SAVED), e(!1);
130
- }, i = () => {
131
- e(!1), s(m.ON_SUBCATEGORY_EDIT_CANCEL_CLICK);
132
- };
133
- return /* @__PURE__ */ t(
134
- R,
135
- {
136
- categoryName: o.name,
137
- isOpen: r,
138
- onClose: i,
139
- onSave: a,
140
- type: L.EDIT
141
- }
142
- );
143
- }, ce = g(ie), le = ({
144
- parentCategory: e,
145
- showDelete: o,
146
- setShowDelete: r,
147
- subCategory: c
148
- }) => {
149
- const { onEvent: s } = D(), { removeCategory: a } = y(), i = () => {
150
- r(!1), s(m.ON_SUBCATEGORY_DELETE_CLICK);
151
- }, n = async () => {
152
- s(m.ON_SUBCATEGORY_DELETED), await a(c.guid), r(!1);
153
- };
154
- return /* @__PURE__ */ t(
155
- R,
156
- {
157
- categoryName: e.name,
158
- isOpen: o,
159
- onClose: i,
160
- onSave: n,
161
- type: L.DELETE
162
- }
163
- );
164
- }, de = g(le), ue = ({ parentCategory: e, subCategory: o }) => {
165
- const {
166
- onSelect: r,
167
- selectedGuid: c,
168
- setSelectedGuid: s,
169
- setShouldDisableDrawerScroll: a,
170
- showSelected: i,
171
- unselectable: n,
172
- unselectableText: l
173
- } = p(), { categories: u } = b(), { onEvent: d } = D(), [_, h] = C.useState(!1), [f, O] = C.useState(!1), T = !!o.revision, A = o.guid === c, w = !n.some((P) => P === o.guid);
174
- return /* @__PURE__ */ E(
175
- x,
176
- {
177
- className: "mx-cat-subcategory-row",
178
- disableGutters: !0,
179
- disablePadding: !0,
180
- sx: { pl: 58 },
181
- children: [
182
- /* @__PURE__ */ E(
183
- N,
184
- {
185
- "aria-pressed": A,
186
- color: "secondary",
187
- onClick: () => {
188
- w && (s(o.guid), r(o.guid), d(m.ON_CATEGORY_SELECTED));
189
- },
190
- sx: { height: 44 },
191
- children: [
192
- /* @__PURE__ */ t(
193
- G,
194
- {
195
- primary: o.name,
196
- primaryTypographyProps: { fontWeight: "normal", variant: "Body" }
197
- }
198
- ),
199
- i && A && /* @__PURE__ */ t(M, { fontSize: "small" }),
200
- !w && /* @__PURE__ */ t(te, { label: l })
201
- ]
202
- }
203
- ),
204
- T && /* @__PURE__ */ E(ee, { className: "mx-cat-subcategory-edit-container", sx: { marginRight: 24 }, children: [
205
- /* @__PURE__ */ t(
206
- I,
207
- {
208
- "aria-label": S(u.edit_subcategory_aria, o.name),
209
- onClick: () => {
210
- h(!0), a(!0), d(m.ON_SUBCATEGORY_EDIT_CLICK);
211
- },
212
- children: /* @__PURE__ */ t(j, { color: "secondary" })
213
- }
214
- ),
215
- /* @__PURE__ */ t(
216
- I,
217
- {
218
- "aria-label": S(u.delete_subcategory_aria, o.name),
219
- edge: "end",
220
- onClick: () => {
221
- O(!0), a(!0), d(m.ON_SUBCATEGORY_DELETE_CLICK);
222
- },
223
- children: /* @__PURE__ */ t(X, { color: "secondary" })
224
- }
225
- )
226
- ] }),
227
- f && /* @__PURE__ */ t(
228
- de,
229
- {
230
- parentCategory: e,
231
- setShowDelete: O,
232
- showDelete: f,
233
- subCategory: o
234
- }
235
- ),
236
- _ && /* @__PURE__ */ t(
237
- ce,
238
- {
239
- setShowRename: h,
240
- showRename: _,
241
- subCategory: o
242
- }
243
- )
244
- ]
245
- }
246
- );
247
- }, me = g(ue), Ce = ({ categories: e, parentCategory: o }) => {
248
- const { expandedGuid: r, searchValue: c } = p(), s = o.guid === r, a = !!c;
249
- return /* @__PURE__ */ t(
250
- J,
251
- {
252
- in: s || a,
253
- sx: { backgroundColor: "background.default" },
254
- timeout: "auto",
255
- unmountOnExit: !0,
256
- children: /* @__PURE__ */ E(
257
- Y,
258
- {
259
- "aria-labelledby": `category-${o.guid}`,
260
- className: "mx-cat-subcategory-list",
261
- id: `subcategories-${o.guid}`,
262
- children: [
263
- e.map((i) => /* @__PURE__ */ E(C.Fragment, { children: [
264
- /* @__PURE__ */ t(me, { parentCategory: o, subCategory: i }),
265
- /* @__PURE__ */ t(v, { sx: { ml: 58 } })
266
- ] }, i.guid)),
267
- !a && /* @__PURE__ */ t(se, { parentCategory: o })
268
- ]
269
- }
270
- )
271
- }
272
- );
273
- }, ge = g(Ce), _e = ({ category: e, subCategories: o }) => {
274
- const { expandedGuid: r, searchValue: c, setExpandedGuid: s } = p(), { onEvent: a } = D(), i = e.guid === r, n = () => {
275
- const l = e.guid !== r ? e.guid : null;
276
- s(l), a(l ? m.ON_CATEGORY_EXPANDED : m.ON_CATEGORY_COLLAPSED);
277
- };
278
- return /* @__PURE__ */ E(C.Fragment, { children: [
279
- /* @__PURE__ */ t(x, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ E(
280
- N,
281
- {
282
- "aria-controls": `subcategories-${e.guid}`,
283
- "aria-expanded": e.guid === r,
284
- "aria-label": e.name,
285
- id: `category-${e.guid}`,
286
- onClick: n,
287
- children: [
288
- /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(H, { categoryGuid: e.guid }) }),
289
- /* @__PURE__ */ t(
290
- G,
291
- {
292
- primary: e.name,
293
- primaryTypographyProps: { fontWeight: "normal", variant: "Body" }
294
- }
295
- ),
296
- /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(
297
- z,
298
- {
299
- sx: {
300
- transition: "transform 0.3s ease-in-out",
301
- transform: i || c ? "rotate(180deg)" : "rotate(0deg)"
302
- }
303
- }
304
- ) })
305
- ]
306
- },
307
- e.guid
308
- ) }),
309
- /* @__PURE__ */ t(v, { sx: { ml: 58 } }),
310
- /* @__PURE__ */ t(ge, { categories: o, parentCategory: e })
311
- ] });
312
- }, Ee = g(_e), pe = () => {
313
- const { categories: e } = y(), { searchValue: o } = p(), { categories: r } = b(), s = ((a, i = "") => a.reduce((n, l) => {
314
- if (l.parent_guid === null) {
315
- const d = [
316
- {
317
- ...l,
318
- name: S(r.all_parent_category, l.name),
319
- parent_guid: l.guid
320
- },
321
- ...a
322
- ].filter(
323
- (_) => _.parent_guid === l.guid && _.name.toLowerCase().includes(i.toLowerCase())
324
- );
325
- if (l.name.toLowerCase().includes(i.toLowerCase()) || d.length > 0)
326
- return [...n, { category: { ...l }, children: d }];
327
- }
328
- return n;
329
- }, []))(e, o);
330
- return /* @__PURE__ */ t(V, { className: "mx-cat-category-list", sx: { boxShadow: "none" }, children: /* @__PURE__ */ t(Y, { children: s.map((a) => /* @__PURE__ */ t(
331
- Ee,
332
- {
333
- category: a.category,
334
- subCategories: a.children
335
- },
336
- a.category.guid
337
- )) }) });
338
- }, he = g(pe), Se = ({
339
- initialSelected: e,
340
- onSelect: o = void 0,
341
- showSelected: r = !0,
342
- unselectable: c = [],
343
- unselectableText: s = "Unselectable"
344
- }) => {
345
- const { categories: a, loadCategories: i } = y(), { common: n } = b(), { isCopyLoaded: l } = U(), {
346
- searchValue: u,
347
- setOnSelect: d,
348
- setSearchValue: _,
349
- setSelectedGuid: h,
350
- setShowSelected: f,
351
- setUnselectable: O,
352
- setUnselectableText: T
353
- } = p();
354
- return C.useEffect(() => {
355
- o && d(o);
356
- }), C.useEffect(() => {
357
- a.length || i();
358
- }, []), C.useEffect(() => {
359
- e && h(e), f(r), O(c), T(s);
360
- }, [e, r, c, s]), l ? /* @__PURE__ */ E($, { className: "mx-cat-category-selector", sx: { width: "100%" }, children: [
361
- /* @__PURE__ */ t(
362
- oe,
363
- {
364
- ariaLabel: n.search_aria,
365
- cancelAriaLabel: n.cancel_search_aria,
366
- onChange: (A) => _(A),
367
- placeholder: n.search_placeholder,
368
- searchValue: u
369
- }
370
- ),
371
- /* @__PURE__ */ t(he, {})
372
- ] }) : /* @__PURE__ */ t(k, {});
373
- }, ye = g(Se), be = ({
374
- id: e,
375
- onClose: o,
376
- title: r,
377
- showDrawer: c,
378
- ...s
379
- }) => {
380
- const { common: a } = b(), { isCopyLoaded: i } = U();
381
- return i ? /* @__PURE__ */ t(
382
- ae,
383
- {
384
- ariaLabelClose: a.close_aria,
385
- className: "mx-cat-category-selector-drawer",
386
- id: e,
387
- isOpen: c,
388
- onClose: o,
389
- title: r,
390
- children: /* @__PURE__ */ t(ye, { ...s })
391
- }
392
- ) : /* @__PURE__ */ t(k, {});
393
- }, ze = g(be);
394
- export {
395
- ye as C,
396
- ze as a,
397
- Ee as b,
398
- p as u
399
- };