@activecollab/components 2.0.576 → 2.0.577

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.
@@ -0,0 +1,946 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExpensesPage = exports.EXPENSE_PROJECTS = exports.EXPENSE_PEOPLE = exports.EXPENSE_GROUP_BY_OPTIONS = exports.EXPENSE_CATEGORIES = exports.EXPENSES_FILTER_DATA = exports.EXPENSES_2026 = exports.BILLABLE_STATUS_LABELS = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
10
+ var _controls = require("./controls");
11
+ var _data = require("./data");
12
+ var _Chip = require("../../components/Chip");
13
+ var _Filter = require("../../components/Filter");
14
+ var _HeaderControls = require("../../components/HeaderControls");
15
+ var _IconButton = require("../../components/IconButton");
16
+ var _Icons = require("../../components/Icons");
17
+ var _NoResultsSlate = require("../../components/NoResultsSlate");
18
+ var _Paper = require("../../components/Paper");
19
+ var _Select = require("../../components/Select");
20
+ var _Tooltip = require("../../components/Tooltip");
21
+ var _Typography = require("../../components/Typography");
22
+ var _ValueButton = require("../../components/ValueButton");
23
+ var _utils = require("../../utils");
24
+ var _shared = require("../shared");
25
+ var _excluded = ["active", "label", "value", "icon", "open"];
26
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
27
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
28
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
29
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
30
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
31
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
32
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
33
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
34
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
35
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
36
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
37
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
38
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
39
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
40
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
41
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
42
+ /* ------------------------------------------------------------------ */
43
+ /* Mock data */
44
+ /* ------------------------------------------------------------------ */
45
+
46
+ /**
47
+ * mirrors: `/reports/run?type=TrackingFilter&type_filter=expenses` records
48
+ * (TrackingFilter::run): `group_id`/`group_name` carry the expense category,
49
+ * `value` is in the project currency, `billable_status` 0..3.
50
+ */
51
+
52
+ var BILLABLE_STATUS_LABELS = exports.BILLABLE_STATUS_LABELS = {
53
+ 0: "Non-Billable",
54
+ 1: "Billable",
55
+ 2: "Pending Payment",
56
+ 3: "Paid"
57
+ };
58
+ var EXPENSE_CATEGORIES = exports.EXPENSE_CATEGORIES = [{
59
+ id: 1,
60
+ name: "General"
61
+ }, {
62
+ id: 2,
63
+ name: "Travel"
64
+ }, {
65
+ id: 3,
66
+ name: "Software"
67
+ }, {
68
+ id: 4,
69
+ name: "Equipment"
70
+ }, {
71
+ id: 5,
72
+ name: "Meals"
73
+ }];
74
+ var EXPENSE_PEOPLE = exports.EXPENSE_PEOPLE = [{
75
+ id: 5,
76
+ name: "Daniel Osei",
77
+ initials: "DO",
78
+ color: _shared.AVATAR_COLORS.blue
79
+ }, {
80
+ id: 6,
81
+ name: "Sofia Marchetti",
82
+ initials: "SM",
83
+ color: _shared.AVATAR_COLORS.purple
84
+ }, {
85
+ id: 3,
86
+ name: "Joshua Reyes",
87
+ initials: "JR",
88
+ color: _shared.AVATAR_COLORS.green
89
+ }, {
90
+ id: 4,
91
+ name: "Priya Anand",
92
+ initials: "PA",
93
+ color: _shared.AVATAR_COLORS.orange
94
+ }];
95
+ var EXPENSE_PROJECTS = exports.EXPENSE_PROJECTS = [{
96
+ id: 131,
97
+ name: "Website Redesign",
98
+ client_id: 3,
99
+ client_name: "Lumière Coffee",
100
+ currency_id: 1
101
+ }, {
102
+ id: 140,
103
+ name: "Brand Refresh 2026",
104
+ client_id: 4,
105
+ client_name: "Verdano",
106
+ currency_id: 1
107
+ }, {
108
+ id: 152,
109
+ name: "Spring Campaign",
110
+ client_id: 14,
111
+ client_name: "Northwind Outfitters",
112
+ currency_id: 2
113
+ }, {
114
+ id: 160,
115
+ name: "Office & Operations",
116
+ client_id: 1,
117
+ client_name: "Internal",
118
+ currency_id: 1
119
+ }];
120
+ var EXPENSES_2026 = exports.EXPENSES_2026 = [{
121
+ id: 1,
122
+ value: 49,
123
+ category_id: 3,
124
+ user_id: 5,
125
+ project_id: 131,
126
+ parent_type: "Task",
127
+ parent_name: "Design the icon set",
128
+ task_number: 48,
129
+ summary: "Icon font license for one year",
130
+ billable_status: 1,
131
+ record_date: "2026-09-28",
132
+ attachments_count: 1
133
+ }, {
134
+ id: 2,
135
+ value: 420,
136
+ category_id: 2,
137
+ user_id: 6,
138
+ project_id: 131,
139
+ parent_type: "Task",
140
+ parent_name: "On-site workshop with the client",
141
+ task_number: 51,
142
+ summary: "Train tickets Milan – Paris, return",
143
+ billable_status: 1,
144
+ record_date: "2026-09-24",
145
+ attachments_count: 2
146
+ }, {
147
+ id: 3,
148
+ value: 86.4,
149
+ category_id: 5,
150
+ user_id: 6,
151
+ project_id: 131,
152
+ parent_type: "Task",
153
+ parent_name: "On-site workshop with the client",
154
+ task_number: 51,
155
+ summary: "Lunch with the client team",
156
+ billable_status: 0,
157
+ record_date: "2026-09-24",
158
+ attachments_count: 1
159
+ }, {
160
+ id: 4,
161
+ value: 1250,
162
+ category_id: 1,
163
+ user_id: 5,
164
+ project_id: 131,
165
+ parent_type: "Project",
166
+ parent_name: "Website Redesign",
167
+ summary: "Stock photography bundle",
168
+ billable_status: 2,
169
+ record_date: "2026-09-10",
170
+ attachments_count: 1,
171
+ invoice_number: "27-2026"
172
+ }, {
173
+ id: 5,
174
+ value: 2400,
175
+ category_id: 1,
176
+ user_id: 3,
177
+ project_id: 140,
178
+ parent_type: "Task",
179
+ parent_name: "Print the brand book",
180
+ task_number: 12,
181
+ summary: "Print run, 200 copies",
182
+ billable_status: 3,
183
+ record_date: "2026-09-16",
184
+ attachments_count: 1,
185
+ invoice_number: "25-2026"
186
+ }, {
187
+ id: 6,
188
+ value: 180,
189
+ category_id: 3,
190
+ user_id: 3,
191
+ project_id: 140,
192
+ parent_type: "Task",
193
+ parent_name: "Typeface selection",
194
+ task_number: 7,
195
+ summary: "Font family license, desktop + web",
196
+ billable_status: 1,
197
+ record_date: "2026-09-21",
198
+ attachments_count: 0
199
+ }, {
200
+ id: 7,
201
+ value: 64,
202
+ category_id: 2,
203
+ user_id: 4,
204
+ project_id: 140,
205
+ parent_type: "Project",
206
+ parent_name: "Brand Refresh 2026",
207
+ summary: "Taxi to the photo shoot",
208
+ billable_status: 1,
209
+ record_date: "2026-09-22",
210
+ attachments_count: 1
211
+ }, {
212
+ id: 8,
213
+ value: 3200,
214
+ category_id: 4,
215
+ user_id: 4,
216
+ project_id: 152,
217
+ parent_type: "Task",
218
+ parent_name: "Product photo shoot",
219
+ task_number: 23,
220
+ summary: "Camera and lighting rental, 2 days",
221
+ billable_status: 1,
222
+ record_date: "2026-09-25",
223
+ attachments_count: 3
224
+ }, {
225
+ id: 9,
226
+ value: 540,
227
+ category_id: 2,
228
+ user_id: 4,
229
+ project_id: 152,
230
+ parent_type: "Task",
231
+ parent_name: "Product photo shoot",
232
+ task_number: 23,
233
+ summary: "Flight to Portland",
234
+ billable_status: 2,
235
+ record_date: "2026-09-12",
236
+ attachments_count: 1,
237
+ invoice_number: "26-2026"
238
+ }, {
239
+ id: 10,
240
+ value: 29,
241
+ category_id: 3,
242
+ user_id: 5,
243
+ project_id: 160,
244
+ parent_type: "Project",
245
+ parent_name: "Office & Operations",
246
+ summary: "Team password manager, monthly",
247
+ billable_status: 0,
248
+ record_date: "2026-09-01",
249
+ attachments_count: 0
250
+ }, {
251
+ id: 11,
252
+ value: 312.5,
253
+ category_id: 4,
254
+ user_id: 6,
255
+ project_id: 160,
256
+ parent_type: "Project",
257
+ parent_name: "Office & Operations",
258
+ summary: "Second monitor for the design desk",
259
+ billable_status: 0,
260
+ record_date: "2026-09-08",
261
+ attachments_count: 1
262
+ }];
263
+
264
+ /* ------------------------------------------------------------------ */
265
+ /* Lookups & grouping */
266
+ /* ------------------------------------------------------------------ */
267
+
268
+ /* mirrors: TrackingFilter group_by values that apply to expenses ("dont" = DataFilter::DONT_GROUP) */
269
+ var EXPENSE_GROUP_BY_OPTIONS = exports.EXPENSE_GROUP_BY_OPTIONS = [{
270
+ id: "dont",
271
+ name: "No Grouping"
272
+ }, {
273
+ id: "project",
274
+ name: "Project"
275
+ }, {
276
+ id: "project_client",
277
+ name: "Client"
278
+ }, {
279
+ id: "expense_category",
280
+ name: "Category"
281
+ }, {
282
+ id: "user",
283
+ name: "Person"
284
+ }, {
285
+ id: "billable_status",
286
+ name: "Status"
287
+ }];
288
+ var EXPENSE_INTERVAL_OPTIONS = [{
289
+ id: "monthly",
290
+ name: "Monthly"
291
+ }, {
292
+ id: "quarterly",
293
+ name: "Quarterly"
294
+ }, {
295
+ id: "yearly",
296
+ name: "Yearly"
297
+ }, {
298
+ id: "custom",
299
+ name: "Custom"
300
+ }];
301
+ var EXPENSES_FILTER_DATA = exports.EXPENSES_FILTER_DATA = [(0, _controls.toFilterData)("project", "Project", "projects", EXPENSE_PROJECTS.map(function (_ref) {
302
+ var id = _ref.id,
303
+ name = _ref.name;
304
+ return {
305
+ id,
306
+ name
307
+ };
308
+ })), (0, _controls.toFilterData)("client", "Client", "clients", _data.PROJECT_FILTER_OPTIONS.client), (0, _controls.toFilterData)("category", "Category", "categories", EXPENSE_CATEGORIES), (0, _controls.toFilterData)("user", "Person", "people", EXPENSE_PEOPLE.map(function (_ref2) {
309
+ var id = _ref2.id,
310
+ name = _ref2.name;
311
+ return {
312
+ id,
313
+ name
314
+ };
315
+ })), (0, _controls.toFilterData)("status", "Status", "status", Object.keys(BILLABLE_STATUS_LABELS).map(function (id) {
316
+ return {
317
+ id: Number(id),
318
+ name: BILLABLE_STATUS_LABELS[id]
319
+ };
320
+ }))];
321
+ var projectOf = function projectOf(id) {
322
+ var _EXPENSE_PROJECTS$fin;
323
+ return (_EXPENSE_PROJECTS$fin = EXPENSE_PROJECTS.find(function (project) {
324
+ return project.id === id;
325
+ })) !== null && _EXPENSE_PROJECTS$fin !== void 0 ? _EXPENSE_PROJECTS$fin : EXPENSE_PROJECTS[0];
326
+ };
327
+ var personOf = function personOf(id) {
328
+ var _EXPENSE_PEOPLE$find;
329
+ return (_EXPENSE_PEOPLE$find = EXPENSE_PEOPLE.find(function (person) {
330
+ return person.id === id;
331
+ })) !== null && _EXPENSE_PEOPLE$find !== void 0 ? _EXPENSE_PEOPLE$find : EXPENSE_PEOPLE[0];
332
+ };
333
+ var categoryOf = function categoryOf(id) {
334
+ var _EXPENSE_CATEGORIES$f, _EXPENSE_CATEGORIES$f2;
335
+ return (_EXPENSE_CATEGORIES$f = (_EXPENSE_CATEGORIES$f2 = EXPENSE_CATEGORIES.find(function (category) {
336
+ return category.id === id;
337
+ })) === null || _EXPENSE_CATEGORIES$f2 === void 0 ? void 0 : _EXPENSE_CATEGORIES$f2.name) !== null && _EXPENSE_CATEGORIES$f !== void 0 ? _EXPENSE_CATEGORIES$f : "";
338
+ };
339
+
340
+ /* The DS Filter keeps the selected option ids as strings per filter id. */
341
+ var selectedIds = function selectedIds(filter, key) {
342
+ var _filter$key;
343
+ return ((_filter$key = filter[key]) !== null && _filter$key !== void 0 ? _filter$key : []).map(Number);
344
+ };
345
+ var matchesFilter = function matchesFilter(row, project, filter) {
346
+ var checks = [["project", row.project_id], ["client", project.client_id], ["category", row.category_id], ["user", row.user_id], ["status", row.billable_status]];
347
+ return checks.every(function (_ref3) {
348
+ var _ref4 = _slicedToArray(_ref3, 2),
349
+ key = _ref4[0],
350
+ value = _ref4[1];
351
+ var ids = selectedIds(filter, key);
352
+ return ids.length === 0 || ids.includes(value);
353
+ });
354
+ };
355
+ var money = function money(value, currencyId) {
356
+ return "".concat(_data.CURRENCIES[currencyId].code, " ").concat((0, _utils.formatNumber)(value, ",", ".", false, _data.CURRENCIES[currencyId].decimal_spaces, "short", 10000));
357
+ };
358
+ var sumByCurrency = function sumByCurrency(rows) {
359
+ return rows.reduce(function (totals, row) {
360
+ var _totals$currencyId;
361
+ var currencyId = projectOf(row.project_id).currency_id;
362
+ totals[currencyId] = ((_totals$currencyId = totals[currencyId]) !== null && _totals$currencyId !== void 0 ? _totals$currencyId : 0) + row.value;
363
+ return totals;
364
+ }, {});
365
+ };
366
+ var totalsText = function totalsText(totals) {
367
+ return Object.entries(totals).map(function (_ref5) {
368
+ var _ref6 = _slicedToArray(_ref5, 2),
369
+ currencyId = _ref6[0],
370
+ value = _ref6[1];
371
+ return money(value, Number(currencyId));
372
+ }).join(" + ");
373
+ };
374
+ var groupKeyAndLabel = function groupKeyAndLabel(row, groupBy) {
375
+ var project = projectOf(row.project_id);
376
+ switch (groupBy) {
377
+ case "dont":
378
+ return ["all", "All Expenses"];
379
+ case "project":
380
+ return ["project-".concat(project.id), project.name];
381
+ case "project_client":
382
+ return ["client-".concat(project.client_id), project.client_name];
383
+ case "expense_category":
384
+ return ["expense-category-".concat(row.category_id), categoryOf(row.category_id)];
385
+ case "user":
386
+ return ["user-".concat(row.user_id), personOf(row.user_id).name];
387
+ case "billable_status":
388
+ default:
389
+ return ["billable-status-".concat(row.billable_status), BILLABLE_STATUS_LABELS[row.billable_status]];
390
+ }
391
+ };
392
+ /* mirrors: client-side sortReportData of the Time/Payments reports */
393
+ var sortExpenses = function sortExpenses(rows, sortBy, direction) {
394
+ var sign = direction === "asc" ? 1 : -1;
395
+ var text = function text(row) {
396
+ var _row$invoice_number;
397
+ var project = projectOf(row.project_id);
398
+ switch (sortBy) {
399
+ case "category":
400
+ return categoryOf(row.category_id);
401
+ case "summary":
402
+ return row.summary;
403
+ case "client":
404
+ return project.client_name;
405
+ case "project":
406
+ return project.name;
407
+ case "task":
408
+ return row.parent_type === "Task" ? row.parent_name : "";
409
+ case "invoice":
410
+ return (_row$invoice_number = row.invoice_number) !== null && _row$invoice_number !== void 0 ? _row$invoice_number : "";
411
+ case "record_date":
412
+ default:
413
+ return row.record_date;
414
+ }
415
+ };
416
+ return [...rows].sort(function (a, b) {
417
+ if (sortBy === "value") {
418
+ return sign * (a.value - b.value);
419
+ }
420
+ if (sortBy === "status") {
421
+ return sign * (a.billable_status - b.billable_status);
422
+ }
423
+ var result = text(a).localeCompare(text(b));
424
+ return result !== 0 ? sign * result : b.record_date.localeCompare(a.record_date);
425
+ });
426
+ };
427
+ var groupExpenses = function groupExpenses(rows, groupBy, sortBy, direction) {
428
+ var groups = new Map();
429
+ rows.forEach(function (row) {
430
+ var _groups$get;
431
+ var _groupKeyAndLabel = groupKeyAndLabel(row, groupBy),
432
+ _groupKeyAndLabel2 = _slicedToArray(_groupKeyAndLabel, 2),
433
+ key = _groupKeyAndLabel2[0],
434
+ label = _groupKeyAndLabel2[1];
435
+ var group = (_groups$get = groups.get(key)) !== null && _groups$get !== void 0 ? _groups$get : {
436
+ key,
437
+ label,
438
+ records: [],
439
+ totals: {}
440
+ };
441
+ group.records.push(row);
442
+ groups.set(key, group);
443
+ });
444
+ var list = Array.from(groups.values()).map(function (group) {
445
+ return _objectSpread(_objectSpread({}, group), {}, {
446
+ records: sortExpenses(group.records, sortBy, direction),
447
+ totals: sumByCurrency(group.records)
448
+ });
449
+ });
450
+ if (groupBy === "billable_status") {
451
+ return list.sort(function (a, b) {
452
+ return a.key.localeCompare(b.key);
453
+ });
454
+ }
455
+ return list.sort(function (a, b) {
456
+ return a.label.localeCompare(b.label);
457
+ });
458
+ };
459
+
460
+ /* ------------------------------------------------------------------ */
461
+ /* Styles */
462
+ /* ------------------------------------------------------------------ */
463
+
464
+ var StyledExpenses = (0, _styledComponents.default)(_Paper.Paper).withConfig({
465
+ displayName: "expenses__StyledExpenses",
466
+ componentId: "sc-e8k2o8-0"
467
+ })(["display:flex;flex-direction:column;height:100%;margin-bottom:32px;.results-toolbar{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;height:40px;margin:8px 8px 0;padding:0 8px;box-sizing:border-box;border-bottom:1px solid var(--border-primary);background-color:var(--page-paper-main);}.results-toolbar-left{display:flex;align-items:center;gap:8px;min-width:0;}.expand-all{margin-left:calc(var(--c-btn-inset) * -1);}.scroll{position:relative;display:grid;grid-template-columns:minmax(max-content,1fr);align-content:start;max-height:100%;margin:4px 8px;overflow:auto;}.group{width:max-content;min-width:100%;margin-bottom:8px;}.head,.row,.group-total{display:flex;align-items:center;gap:8px;height:40px;box-sizing:border-box;}.row{border-radius:8px;background-color:var(--page-paper-main);}.row.striped{background-color:var(--color-theme-200);}.first{position:sticky;left:0;z-index:1;display:flex;align-items:center;gap:8px;width:168px;flex-shrink:0;height:40px;padding:0 8px;box-sizing:border-box;border-radius:8px;background-color:inherit;}.head .first{background-color:var(--page-paper-main);cursor:pointer;}.head .first.static{cursor:default;}.head .first.collapsed{flex:1;width:auto;min-width:168px;}.head .first.collapsed .group-label .c-typography{max-width:none;}.head .first:hover .expander{fill:var(--color-primary);}.expander{width:24px;height:24px;flex-shrink:0;fill:var(--color-theme-600);transition:transform 200ms;}.expander.collapsed{transform:rotate(180deg);}.group-label{display:flex;align-items:center;gap:8px;min-width:0;}.count-chip{flex-shrink:0;}.cols{display:flex;align-items:center;gap:8px;height:40px;padding-right:8px;}.link{overflow:hidden;text-decoration:none;cursor:pointer;}.amount{display:flex;justify-content:flex-end;width:96px;flex-shrink:0;}.avatar{flex-shrink:0;}.w-category{width:120px;flex-shrink:0;}.w-description{display:flex;align-items:center;gap:4px;width:240px;flex:1;min-width:0;}.w-date{width:88px;flex-shrink:0;}.w-client,.w-project{width:144px;flex-shrink:0;}.w-task{width:184px;flex-shrink:0;}.w-invoice{width:96px;flex-shrink:0;}.w-status{display:flex;justify-content:flex-end;width:128px;flex-shrink:0;margin-left:auto;}.group-total{padding:0 8px;border-radius:8px;background-color:var(--page-paper-main);}.group-total.striped{background-color:var(--color-theme-200);}.group-total-label{position:sticky;left:8px;}.group-sum{position:sticky;right:8px;margin-left:auto;padding-right:8px;}.grand-total{display:flex;align-items:center;justify-content:space-between;padding:12px 8px;border-top:1px solid var(--border-primary);}.grand-total-label{position:sticky;left:8px;}.totals{display:flex;align-items:center;gap:16px;}"]);
468
+
469
+ /* ------------------------------------------------------------------ */
470
+ /* Pieces */
471
+ /* ------------------------------------------------------------------ */
472
+
473
+ /* UserProfileProjectsSortByPicker.js: a ValueButton that gives way to an icon button on narrow screens.
474
+ It collapses at MD, where the Filter CounterButton drops its label too. */
475
+ var StyledCollapsingValueButton = _styledComponents.default.div.withConfig({
476
+ displayName: "expenses__StyledCollapsingValueButton",
477
+ componentId: "sc-e8k2o8-1"
478
+ })(["display:flex;flex-shrink:0;.collapsed-trigger{display:none;}@media (max-width:", "){.c-value-button{display:none;}.collapsed-trigger{display:flex;}}"], _shared.MD);
479
+ var CollapsingValueButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref7, ref) {
480
+ var active = _ref7.active,
481
+ label = _ref7.label,
482
+ value = _ref7.value,
483
+ icon = _ref7.icon,
484
+ _ref7$open = _ref7.open,
485
+ open = _ref7$open === void 0 ? false : _ref7$open,
486
+ rest = _objectWithoutProperties(_ref7, _excluded);
487
+ return /*#__PURE__*/_react.default.createElement(StyledCollapsingValueButton, _extends({
488
+ ref: ref
489
+ }, rest), /*#__PURE__*/_react.default.createElement(_ValueButton.ValueButton, {
490
+ active: active || open,
491
+ label: label,
492
+ value: value
493
+ }), /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
494
+ className: "collapsed-trigger",
495
+ variant: "text gray",
496
+ active: active || open,
497
+ title: label,
498
+ "aria-label": "".concat(label, ": ").concat(value)
499
+ }, icon));
500
+ });
501
+ CollapsingValueButton.displayName = "CollapsingValueButton";
502
+ var ExpenseRow = function ExpenseRow(_ref8) {
503
+ var row = _ref8.row,
504
+ striped = _ref8.striped,
505
+ columns = _ref8.columns;
506
+ var project = projectOf(row.project_id);
507
+ var person = personOf(row.user_id);
508
+ return /*#__PURE__*/_react.default.createElement("div", {
509
+ className: striped ? "row striped" : "row"
510
+ }, /*#__PURE__*/_react.default.createElement("div", {
511
+ className: "first"
512
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
513
+ weight: "bold",
514
+ color: "secondary",
515
+ align: "right",
516
+ className: "amount",
517
+ title: (0, _utils.formatNumber)(row.value, ",", ".", false, 2)
518
+ }, money(row.value, project.currency_id)), /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
519
+ title: person.name
520
+ }, /*#__PURE__*/_react.default.createElement(_shared.RoundAvatar, {
521
+ $bg: person.color,
522
+ $size: 24,
523
+ className: "avatar"
524
+ }, person.initials))), /*#__PURE__*/_react.default.createElement("div", {
525
+ className: "cols"
526
+ }, columns.category ? /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
527
+ overflow: "truncate",
528
+ whitespace: "no-wrap",
529
+ className: "w-category"
530
+ }, categoryOf(row.category_id)) : null, /*#__PURE__*/_react.default.createElement("span", {
531
+ className: "w-description"
532
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
533
+ overflow: "truncate",
534
+ whitespace: "no-wrap"
535
+ }, row.summary)), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
536
+ align: "right",
537
+ overflow: "truncate",
538
+ whitespace: "no-wrap",
539
+ className: "w-date"
540
+ }, _momentTimezone.default.utc(row.record_date).format("MMM D.")), columns.client ? /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
541
+ overflow: "truncate",
542
+ whitespace: "no-wrap",
543
+ className: "w-client"
544
+ }, project.client_name) : null, columns.project ? /*#__PURE__*/_react.default.createElement("a", {
545
+ className: "link w-project"
546
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
547
+ color: "theme-primary",
548
+ overflow: "truncate",
549
+ whitespace: "no-wrap"
550
+ }, project.name)) : null, columns.task ? row.parent_type === "Task" ? /*#__PURE__*/_react.default.createElement("a", {
551
+ className: "link w-task"
552
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
553
+ color: "theme-primary",
554
+ overflow: "truncate",
555
+ whitespace: "no-wrap"
556
+ }, "#".concat(row.task_number, " ").concat(row.parent_name))) : /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
557
+ color: "tertiary",
558
+ className: "w-task"
559
+ }, "Project") : null, columns.invoice ? row.invoice_number ? /*#__PURE__*/_react.default.createElement("a", {
560
+ className: "link w-invoice"
561
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
562
+ color: "theme-primary",
563
+ overflow: "truncate",
564
+ whitespace: "no-wrap"
565
+ }, row.invoice_number)) : /*#__PURE__*/_react.default.createElement("span", {
566
+ className: "w-invoice"
567
+ }) : null, /*#__PURE__*/_react.default.createElement("span", {
568
+ className: "w-status"
569
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
570
+ align: "right",
571
+ overflow: "truncate",
572
+ whitespace: "no-wrap"
573
+ }, BILLABLE_STATUS_LABELS[row.billable_status]))));
574
+ };
575
+ var GroupBlock = function GroupBlock(_ref9) {
576
+ var group = _ref9.group,
577
+ expanded = _ref9.expanded,
578
+ onToggle = _ref9.onToggle,
579
+ columns = _ref9.columns,
580
+ sortBy = _ref9.sortBy,
581
+ direction = _ref9.direction,
582
+ onSort = _ref9.onSort,
583
+ _ref9$flat = _ref9.flat,
584
+ flat = _ref9$flat === void 0 ? false : _ref9$flat;
585
+ return /*#__PURE__*/_react.default.createElement("div", {
586
+ className: "group"
587
+ }, /*#__PURE__*/_react.default.createElement("div", {
588
+ className: "head"
589
+ }, /*#__PURE__*/_react.default.createElement("div", {
590
+ className: ["first", flat ? "static" : "", !flat && !expanded ? "collapsed" : ""].join(" "),
591
+ onClick: flat ? undefined : onToggle
592
+ }, flat ? null : /*#__PURE__*/_react.default.createElement(_Icons.CollapseExpandSingleIcon, {
593
+ className: expanded ? "expander" : "expander collapsed"
594
+ }), /*#__PURE__*/_react.default.createElement("span", {
595
+ className: "group-label"
596
+ }, flat ? /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
597
+ id: "value",
598
+ title: "Amount",
599
+ sortBy: sortBy,
600
+ direction: direction,
601
+ onSort: onSort
602
+ }) : /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
603
+ weight: "bold",
604
+ overflow: "truncate",
605
+ whitespace: "no-wrap"
606
+ }, group.label), /*#__PURE__*/_react.default.createElement(_Chip.Chip, {
607
+ label: String(group.records.length),
608
+ size: "small",
609
+ backgroundColor: "var(--color-theme-300)",
610
+ className: "count-chip",
611
+ typographyProps: {
612
+ variant: "Caption 1",
613
+ weight: "medium",
614
+ color: "secondary"
615
+ }
616
+ }))), !expanded && !flat ? /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
617
+ weight: "bold",
618
+ whitespace: "no-wrap",
619
+ className: "group-sum"
620
+ }, totalsText(group.totals)) : /*#__PURE__*/_react.default.createElement("div", {
621
+ className: "cols"
622
+ }, columns.category ? /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
623
+ id: "category",
624
+ title: "Category",
625
+ sortBy: sortBy,
626
+ direction: direction,
627
+ onSort: onSort,
628
+ className: "w-category"
629
+ }) : null, /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
630
+ id: "summary",
631
+ title: "Description",
632
+ sortBy: sortBy,
633
+ direction: direction,
634
+ onSort: onSort,
635
+ className: "w-description"
636
+ }), /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
637
+ id: "record_date",
638
+ title: "Date",
639
+ sortBy: sortBy,
640
+ direction: direction,
641
+ onSort: onSort,
642
+ position: "left",
643
+ className: "w-date"
644
+ }), columns.client ? /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
645
+ id: "client",
646
+ title: "Client",
647
+ sortBy: sortBy,
648
+ direction: direction,
649
+ onSort: onSort,
650
+ className: "w-client"
651
+ }) : null, columns.project ? /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
652
+ id: "project",
653
+ title: "Project",
654
+ sortBy: sortBy,
655
+ direction: direction,
656
+ onSort: onSort,
657
+ className: "w-project"
658
+ }) : null, columns.task ? /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
659
+ id: "task",
660
+ title: "Task",
661
+ sortBy: sortBy,
662
+ direction: direction,
663
+ onSort: onSort,
664
+ className: "w-task"
665
+ }) : null, columns.invoice ? /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
666
+ id: "invoice",
667
+ title: "Invoice #",
668
+ sortBy: sortBy,
669
+ direction: direction,
670
+ onSort: onSort,
671
+ className: "w-invoice"
672
+ }) : null, /*#__PURE__*/_react.default.createElement(_controls.SortableColumnHeader, {
673
+ id: "status",
674
+ title: "Status",
675
+ sortBy: sortBy,
676
+ direction: direction,
677
+ onSort: onSort,
678
+ position: "left",
679
+ className: "w-status"
680
+ }))), expanded || flat ? group.records.map(function (row, index) {
681
+ return /*#__PURE__*/_react.default.createElement(ExpenseRow, {
682
+ key: row.id,
683
+ row: row,
684
+ striped: index % 2 === 0,
685
+ columns: columns
686
+ });
687
+ }) : null, flat || !expanded ? null : /*#__PURE__*/_react.default.createElement("div", {
688
+ className: group.records.length % 2 === 0 ? "group-total striped" : "group-total"
689
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
690
+ weight: "bold",
691
+ className: "group-total-label",
692
+ overflow: "truncate",
693
+ whitespace: "no-wrap"
694
+ }, "Total: ".concat(totalsText(group.totals)))));
695
+ };
696
+
697
+ /* ------------------------------------------------------------------ */
698
+ /* Page */
699
+ /* ------------------------------------------------------------------ */
700
+
701
+ var ExpensesPage = exports.ExpensesPage = function ExpensesPage(_ref0) {
702
+ var _EXPENSE_GROUP_BY_OPT, _EXPENSE_GROUP_BY_OPT2, _currencyOptions$find, _currencyOptions$find2;
703
+ var look = _ref0.look,
704
+ _ref0$initialGroupBy = _ref0.initialGroupBy,
705
+ initialGroupBy = _ref0$initialGroupBy === void 0 ? "dont" : _ref0$initialGroupBy,
706
+ initialExpanded = _ref0.initialExpanded,
707
+ _ref0$records = _ref0.records,
708
+ records = _ref0$records === void 0 ? EXPENSES_2026 : _ref0$records;
709
+ var _useState = (0, _react.useState)(initialGroupBy),
710
+ _useState2 = _slicedToArray(_useState, 2),
711
+ groupBy = _useState2[0],
712
+ setGroupBy = _useState2[1];
713
+ var _useState3 = (0, _react.useState)(false),
714
+ _useState4 = _slicedToArray(_useState3, 2),
715
+ groupByOpen = _useState4[0],
716
+ setGroupByOpen = _useState4[1];
717
+ var _useState5 = (0, _react.useState)(0),
718
+ _useState6 = _slicedToArray(_useState5, 2),
719
+ currency = _useState6[0],
720
+ setCurrency = _useState6[1];
721
+ var _useState7 = (0, _react.useState)(false),
722
+ _useState8 = _slicedToArray(_useState7, 2),
723
+ currencyOpen = _useState8[0],
724
+ setCurrencyOpen = _useState8[1];
725
+ var _useState9 = (0, _react.useState)({}),
726
+ _useState0 = _slicedToArray(_useState9, 2),
727
+ filter = _useState0[0],
728
+ setFilter = _useState0[1];
729
+ var _useState1 = (0, _react.useState)("record_date"),
730
+ _useState10 = _slicedToArray(_useState1, 2),
731
+ sortBy = _useState10[0],
732
+ setSortBy = _useState10[1];
733
+ var _useState11 = (0, _react.useState)("desc"),
734
+ _useState12 = _slicedToArray(_useState11, 2),
735
+ direction = _useState12[0],
736
+ setDirection = _useState12[1];
737
+ var _useState13 = (0, _react.useState)([]),
738
+ _useState14 = _slicedToArray(_useState13, 2),
739
+ collapsed = _useState14[0],
740
+ setCollapsed = _useState14[1];
741
+ var _useState15 = (0, _react.useState)(false),
742
+ _useState16 = _slicedToArray(_useState15, 2),
743
+ initialised = _useState16[0],
744
+ setInitialised = _useState16[1];
745
+ var visible = (0, _react.useMemo)(function () {
746
+ return records.filter(function (row) {
747
+ var project = projectOf(row.project_id);
748
+ if (currency && project.currency_id !== currency) {
749
+ return false;
750
+ }
751
+ return matchesFilter(row, project, filter);
752
+ });
753
+ }, [records, currency, filter]);
754
+ var groups = (0, _react.useMemo)(function () {
755
+ return groupExpenses(visible, groupBy, sortBy, direction);
756
+ }, [visible, groupBy, sortBy, direction]);
757
+ if (!initialised && initialExpanded) {
758
+ setCollapsed(groups.map(function (group) {
759
+ return group.key;
760
+ }).filter(function (key) {
761
+ return !initialExpanded.includes(key);
762
+ }));
763
+ setInitialised(true);
764
+ }
765
+ var byStatus = function byStatus(statuses) {
766
+ return visible.filter(function (row) {
767
+ return statuses.includes(row.billable_status);
768
+ });
769
+ };
770
+ var nonBillable = byStatus([0]);
771
+ var grandTotals = sumByCurrency(visible);
772
+ var hasFilter = currency !== 0 || Object.values(filter).some(function (ids) {
773
+ return ids.length > 0;
774
+ });
775
+ var flat = groupBy === "dont";
776
+ var columns = {
777
+ category: groupBy !== "expense_category",
778
+ client: groupBy !== "project_client",
779
+ project: groupBy !== "project",
780
+ task: true,
781
+ invoice: true
782
+ };
783
+ var allExpanded = collapsed.length === 0;
784
+ var toggleAll = function toggleAll() {
785
+ return setCollapsed(allExpanded ? groups.map(function (group) {
786
+ return group.key;
787
+ }) : []);
788
+ };
789
+ var toggleGroup = function toggleGroup(key) {
790
+ return setCollapsed(collapsed.includes(key) ? collapsed.filter(function (item) {
791
+ return item !== key;
792
+ }) : [...collapsed, key]);
793
+ };
794
+ var handleSort = function handleSort(id) {
795
+ if (id === sortBy) {
796
+ setDirection(direction === "asc" ? "desc" : "asc");
797
+ return;
798
+ }
799
+ setSortBy(id);
800
+ setDirection(id === "record_date" || id === "value" ? "desc" : "asc");
801
+ };
802
+ var currencyOptions = [{
803
+ id: 0,
804
+ name: "Any"
805
+ }, ...Object.entries(_data.CURRENCIES).map(function (_ref1) {
806
+ var _ref10 = _slicedToArray(_ref1, 2),
807
+ id = _ref10[0],
808
+ value = _ref10[1];
809
+ return {
810
+ id: Number(id),
811
+ name: value.code
812
+ };
813
+ })];
814
+ return /*#__PURE__*/_react.default.createElement(_shared.PresentationShell, {
815
+ look: look,
816
+ activeMenuItem: "Reports",
817
+ header: /*#__PURE__*/_react.default.createElement(_shared.PageHeader, {
818
+ title: "Expenses",
819
+ back: true
820
+ }),
821
+ floating: /*#__PURE__*/_react.default.createElement(_shared.FloatingControls, null)
822
+ }, /*#__PURE__*/_react.default.createElement(_controls.StyledReportToolbar, null, /*#__PURE__*/_react.default.createElement(_controls.StyledControlGroup, {
823
+ className: "toolbar-left"
824
+ }, /*#__PURE__*/_react.default.createElement(_controls.IntervalStepper, {
825
+ options: EXPENSE_INTERVAL_OPTIONS,
826
+ pill: true
827
+ })), /*#__PURE__*/_react.default.createElement(_HeaderControls.HeaderControls, null, /*#__PURE__*/_react.default.createElement(_HeaderControls.HeaderControls, null, /*#__PURE__*/_react.default.createElement(_controls.ExportButton, null)), /*#__PURE__*/_react.default.createElement(_HeaderControls.HeaderControls, null, /*#__PURE__*/_react.default.createElement(_Select.Select, {
828
+ options: EXPENSE_GROUP_BY_OPTIONS,
829
+ selected: groupBy,
830
+ onChange: function onChange(value) {
831
+ return setGroupBy(String(value));
832
+ },
833
+ onSelectOpen: function onSelectOpen() {
834
+ return setGroupByOpen(true);
835
+ },
836
+ onSelectClose: function onSelectClose() {
837
+ return setGroupByOpen(false);
838
+ },
839
+ forceCloseMenu: true,
840
+ disableSearch: true,
841
+ keepSameOptionsOrder: true,
842
+ disabledInternalSort: true,
843
+ target: /*#__PURE__*/_react.default.createElement(CollapsingValueButton, {
844
+ active: groupByOpen,
845
+ icon: /*#__PURE__*/_react.default.createElement(_Icons.GroupByIcon, null),
846
+ label: "Group by",
847
+ value: (_EXPENSE_GROUP_BY_OPT = (_EXPENSE_GROUP_BY_OPT2 = EXPENSE_GROUP_BY_OPTIONS.find(function (option) {
848
+ return option.id === groupBy;
849
+ })) === null || _EXPENSE_GROUP_BY_OPT2 === void 0 ? void 0 : _EXPENSE_GROUP_BY_OPT2.name) !== null && _EXPENSE_GROUP_BY_OPT !== void 0 ? _EXPENSE_GROUP_BY_OPT : "No Grouping"
850
+ })
851
+ }), /*#__PURE__*/_react.default.createElement(_Filter.Filter, {
852
+ data: EXPENSES_FILTER_DATA,
853
+ selected: filter,
854
+ label: "Filter",
855
+ clearAllText: "Clear All",
856
+ resetLabel: "Reset",
857
+ noResultText: "No results",
858
+ onChange: setFilter
859
+ }), /*#__PURE__*/_react.default.createElement(_Select.Select, {
860
+ options: currencyOptions,
861
+ selected: currency,
862
+ onChange: function onChange(value) {
863
+ return setCurrency(Number(value));
864
+ },
865
+ onSelectOpen: function onSelectOpen() {
866
+ return setCurrencyOpen(true);
867
+ },
868
+ onSelectClose: function onSelectClose() {
869
+ return setCurrencyOpen(false);
870
+ },
871
+ forceCloseMenu: true,
872
+ disableSearch: true,
873
+ keepSameOptionsOrder: true,
874
+ disabledInternalSort: true,
875
+ target: /*#__PURE__*/_react.default.createElement(CollapsingValueButton, {
876
+ active: currencyOpen,
877
+ icon: /*#__PURE__*/_react.default.createElement(_Icons.DollarIcon, null),
878
+ label: "Currency",
879
+ value: (_currencyOptions$find = (_currencyOptions$find2 = currencyOptions.find(function (option) {
880
+ return option.id === currency;
881
+ })) === null || _currencyOptions$find2 === void 0 ? void 0 : _currencyOptions$find2.name) !== null && _currencyOptions$find !== void 0 ? _currencyOptions$find : "Any"
882
+ })
883
+ })))), /*#__PURE__*/_react.default.createElement(StyledExpenses, null, visible.length === 0 ? /*#__PURE__*/_react.default.createElement(_NoResultsSlate.NoResultsSlate, {
884
+ title: "No Expenses",
885
+ description: hasFilter ? "No expenses match the filter." : "No expenses were recorded in this period.",
886
+ clearLabel: hasFilter ? "Clear Filter" : undefined,
887
+ onClear: hasFilter ? function () {
888
+ setFilter({});
889
+ setCurrency(0);
890
+ } : undefined,
891
+ style: {
892
+ margin: "auto"
893
+ }
894
+ }) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
895
+ className: "results-toolbar"
896
+ }, /*#__PURE__*/_react.default.createElement("div", {
897
+ className: "results-toolbar-left"
898
+ }, flat ? null : /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
899
+ title: allExpanded ? "Collapse all" : "Expand all"
900
+ }, /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
901
+ variant: "text gray",
902
+ className: "expand-all",
903
+ onClick: toggleAll
904
+ }, allExpanded ? /*#__PURE__*/_react.default.createElement(_Icons.ArrowCollapseMultipleIcon, null) : /*#__PURE__*/_react.default.createElement(_Icons.ArrowExpandeMultipleIcon, null))), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
905
+ weight: "bold",
906
+ overflow: "truncate",
907
+ whitespace: "no-wrap"
908
+ }, "Total: ".concat(totalsText(grandTotals))), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
909
+ color: "secondary",
910
+ overflow: "truncate",
911
+ whitespace: "no-wrap"
912
+ }, "(".concat(totalsText(sumByCurrency(byStatus([1, 2, 3]))), " Billable / ").concat(totalsText(sumByCurrency(nonBillable)) || "0", " Non-Billable)")))), /*#__PURE__*/_react.default.createElement("div", {
913
+ className: "scroll"
914
+ }, groups.map(function (group) {
915
+ return /*#__PURE__*/_react.default.createElement(GroupBlock, {
916
+ key: group.key,
917
+ group: group,
918
+ expanded: !collapsed.includes(group.key),
919
+ onToggle: function onToggle() {
920
+ return toggleGroup(group.key);
921
+ },
922
+ columns: columns,
923
+ sortBy: sortBy,
924
+ direction: direction,
925
+ onSort: handleSort,
926
+ flat: flat
927
+ });
928
+ }), /*#__PURE__*/_react.default.createElement("div", {
929
+ className: "grand-total"
930
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
931
+ weight: "bold",
932
+ className: "grand-total-label"
933
+ }, "Total:"), /*#__PURE__*/_react.default.createElement("div", {
934
+ className: "totals"
935
+ }, Object.entries(grandTotals).map(function (_ref11) {
936
+ var _ref12 = _slicedToArray(_ref11, 2),
937
+ currencyId = _ref12[0],
938
+ value = _ref12[1];
939
+ return /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
940
+ key: currencyId,
941
+ weight: "bold",
942
+ align: "right"
943
+ }, money(value, Number(currencyId)));
944
+ })))))));
945
+ };
946
+ //# sourceMappingURL=expenses.js.map