@activecollab/components 2.0.483 → 2.0.485
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/cjs/components/Select/Select.js +34 -5
- package/dist/cjs/components/Select/Select.js.map +1 -1
- package/dist/cjs/presentation/reports/allReports.js +223 -0
- package/dist/cjs/presentation/reports/allReports.js.map +1 -0
- package/dist/cjs/presentation/reports/availability.js +685 -0
- package/dist/cjs/presentation/reports/availability.js.map +1 -0
- package/dist/cjs/presentation/reports/availabilityExport.js +117 -0
- package/dist/cjs/presentation/reports/availabilityExport.js.map +1 -0
- package/dist/cjs/presentation/reports/controls.js +236 -0
- package/dist/cjs/presentation/reports/controls.js.map +1 -0
- package/dist/cjs/presentation/reports/dashboards.js +434 -0
- package/dist/cjs/presentation/reports/dashboards.js.map +1 -0
- package/dist/cjs/presentation/reports/data.js +2309 -0
- package/dist/cjs/presentation/reports/data.js.map +1 -0
- package/dist/cjs/presentation/reports/payments.js +294 -0
- package/dist/cjs/presentation/reports/payments.js.map +1 -0
- package/dist/cjs/presentation/reports/uninvoiced.js +223 -0
- package/dist/cjs/presentation/reports/uninvoiced.js.map +1 -0
- package/dist/cjs/presentation/shared/PageStickyHeader.js +76 -0
- package/dist/cjs/presentation/shared/PageStickyHeader.js.map +1 -0
- package/dist/cjs/presentation/shared/PresentationShell.js +22 -14
- package/dist/cjs/presentation/shared/PresentationShell.js.map +1 -1
- package/dist/cjs/presentation/shared/UserDetailsDialog.js +18 -5
- package/dist/cjs/presentation/shared/UserDetailsDialog.js.map +1 -1
- package/dist/cjs/presentation/shared/dashboardWidgets.js +116 -71
- package/dist/cjs/presentation/shared/dashboardWidgets.js.map +1 -1
- package/dist/cjs/presentation/shared/headers.js +7 -2
- package/dist/cjs/presentation/shared/headers.js.map +1 -1
- package/dist/cjs/presentation/shared/index.js +22 -0
- package/dist/cjs/presentation/shared/index.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +32 -5
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/presentation/reports/allReports.d.ts +3 -0
- package/dist/esm/presentation/reports/allReports.d.ts.map +1 -0
- package/dist/esm/presentation/reports/allReports.js +210 -0
- package/dist/esm/presentation/reports/allReports.js.map +1 -0
- package/dist/esm/presentation/reports/availability.d.ts +9 -0
- package/dist/esm/presentation/reports/availability.d.ts.map +1 -0
- package/dist/esm/presentation/reports/availability.js +532 -0
- package/dist/esm/presentation/reports/availability.js.map +1 -0
- package/dist/esm/presentation/reports/availabilityExport.d.ts +17 -0
- package/dist/esm/presentation/reports/availabilityExport.d.ts.map +1 -0
- package/dist/esm/presentation/reports/availabilityExport.js +97 -0
- package/dist/esm/presentation/reports/availabilityExport.js.map +1 -0
- package/dist/esm/presentation/reports/controls.d.ts +50 -0
- package/dist/esm/presentation/reports/controls.d.ts.map +1 -0
- package/dist/esm/presentation/reports/controls.js +205 -0
- package/dist/esm/presentation/reports/controls.js.map +1 -0
- package/dist/esm/presentation/reports/dashboards.d.ts +4 -0
- package/dist/esm/presentation/reports/dashboards.d.ts.map +1 -0
- package/dist/esm/presentation/reports/dashboards.js +390 -0
- package/dist/esm/presentation/reports/dashboards.js.map +1 -0
- package/dist/esm/presentation/reports/data.d.ts +171 -0
- package/dist/esm/presentation/reports/data.d.ts.map +1 -0
- package/dist/esm/presentation/reports/data.js +2303 -0
- package/dist/esm/presentation/reports/data.js.map +1 -0
- package/dist/esm/presentation/reports/payments.d.ts +3 -0
- package/dist/esm/presentation/reports/payments.d.ts.map +1 -0
- package/dist/esm/presentation/reports/payments.js +235 -0
- package/dist/esm/presentation/reports/payments.js.map +1 -0
- package/dist/esm/presentation/reports/uninvoiced.d.ts +3 -0
- package/dist/esm/presentation/reports/uninvoiced.d.ts.map +1 -0
- package/dist/esm/presentation/reports/uninvoiced.js +208 -0
- package/dist/esm/presentation/reports/uninvoiced.js.map +1 -0
- package/dist/esm/presentation/shared/PageStickyHeader.d.ts +10 -0
- package/dist/esm/presentation/shared/PageStickyHeader.d.ts.map +1 -0
- package/dist/esm/presentation/shared/PageStickyHeader.js +70 -0
- package/dist/esm/presentation/shared/PageStickyHeader.js.map +1 -0
- package/dist/esm/presentation/shared/PresentationShell.d.ts +2 -1
- package/dist/esm/presentation/shared/PresentationShell.d.ts.map +1 -1
- package/dist/esm/presentation/shared/PresentationShell.js +22 -14
- package/dist/esm/presentation/shared/PresentationShell.js.map +1 -1
- package/dist/esm/presentation/shared/UserDetailsDialog.d.ts +4 -1
- package/dist/esm/presentation/shared/UserDetailsDialog.d.ts.map +1 -1
- package/dist/esm/presentation/shared/UserDetailsDialog.js +18 -5
- package/dist/esm/presentation/shared/UserDetailsDialog.js.map +1 -1
- package/dist/esm/presentation/shared/dashboardWidgets.d.ts +14 -1
- package/dist/esm/presentation/shared/dashboardWidgets.d.ts.map +1 -1
- package/dist/esm/presentation/shared/dashboardWidgets.js +107 -68
- package/dist/esm/presentation/shared/dashboardWidgets.js.map +1 -1
- package/dist/esm/presentation/shared/headers.d.ts +2 -1
- package/dist/esm/presentation/shared/headers.d.ts.map +1 -1
- package/dist/esm/presentation/shared/headers.js +7 -2
- package/dist/esm/presentation/shared/headers.js.map +1 -1
- package/dist/esm/presentation/shared/index.d.ts +4 -2
- package/dist/esm/presentation/shared/index.d.ts.map +1 -1
- package/dist/esm/presentation/shared/index.js +2 -1
- package/dist/esm/presentation/shared/index.js.map +1 -1
- package/dist/index.js +34 -5
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UninvoicedPage = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _controls = require("./controls");
|
|
10
|
+
var _data = require("./data");
|
|
11
|
+
var _Chip = require("../../components/Chip");
|
|
12
|
+
var _Display = require("../../components/Display");
|
|
13
|
+
var _IconButton = require("../../components/IconButton");
|
|
14
|
+
var _Icons = require("../../components/Icons");
|
|
15
|
+
var _Paper = require("../../components/Paper");
|
|
16
|
+
var _Tooltip = require("../../components/Tooltip");
|
|
17
|
+
var _Typography = require("../../components/Typography");
|
|
18
|
+
var _utils = require("../../utils");
|
|
19
|
+
var _shared = require("../shared");
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
var UNINVOICED_FILTER_DATA = [(0, _controls.toFilterData)("status", "Status", "status", [{
|
|
22
|
+
id: 1,
|
|
23
|
+
name: "Active Projects"
|
|
24
|
+
}, {
|
|
25
|
+
id: 2,
|
|
26
|
+
name: "Recently Completed"
|
|
27
|
+
}]), (0, _controls.toFilterData)("budget_type", "Budget Type", "budget type", [{
|
|
28
|
+
id: 1,
|
|
29
|
+
name: "Fixed Budget"
|
|
30
|
+
}, {
|
|
31
|
+
id: 2,
|
|
32
|
+
name: "Time and Expenses"
|
|
33
|
+
}])];
|
|
34
|
+
var BUDGET_TYPE_NAMES = {
|
|
35
|
+
fixed: "Fixed Price",
|
|
36
|
+
pay_as_you_go: "Time and Expenses"
|
|
37
|
+
};
|
|
38
|
+
var StyledUninvoiced = (0, _styledComponents.default)(_Paper.Paper).withConfig({
|
|
39
|
+
displayName: "uninvoiced__StyledUninvoiced",
|
|
40
|
+
componentId: "sc-1u36mr3-0"
|
|
41
|
+
})(["display:flex;flex-direction:column;height:100%;margin-bottom:32px;padding:0 8px;.company{margin-bottom:16px;}.company:first-child{padding-top:8px;}.company-header,.company-footer{display:flex;align-items:center;justify-content:space-between;height:40px;padding:8px;box-sizing:border-box;overflow:hidden;}.company-name{display:flex;align-items:center;gap:8px;min-width:0;}.company-chip{flex-shrink:0;}.row{display:flex;align-items:center;justify-content:space-between;gap:16px;height:40px;padding:0 8px;border-radius:8px;box-sizing:border-box;}.row.striped{background-color:var(--color-theme-200);}.row-name{display:flex;align-items:center;width:100%;min-width:0;overflow:hidden;text-decoration:none;cursor:pointer;}.cells{display:flex;align-items:center;gap:8px;}.cell{display:none;align-items:center;justify-content:flex-end;flex-shrink:0;@media (min-width:", "){display:flex;}}.cell.always{display:flex;}.w-type{width:140px;}.w-budget,.w-expenses{width:112px;}.w-hours{width:80px;}.w-uninvoiced{width:120px;}.w-action{display:flex;width:96px;}.action-button{color:var(--color-theme-600);}.action-button.spaced{margin-right:4px;}"], _shared.LG);
|
|
42
|
+
var UninvoicedActions = function UninvoicedActions(_ref) {
|
|
43
|
+
var markAsPaid = _ref.markAsPaid;
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
45
|
+
className: "cell always w-action"
|
|
46
|
+
}, markAsPaid ? /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
|
|
47
|
+
title: "Mark as Paid"
|
|
48
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
|
|
49
|
+
variant: "text gray",
|
|
50
|
+
className: "action-button spaced"
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_Icons.DollarCheckmarkIcon, null))) : null, /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
|
|
52
|
+
title: "Create Invoice"
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
|
|
54
|
+
variant: "text gray",
|
|
55
|
+
className: "action-button"
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_Icons.DollarDocumentPlusIcon, null))));
|
|
57
|
+
};
|
|
58
|
+
var UninvoicedRow = function UninvoicedRow(_ref2) {
|
|
59
|
+
var project = _ref2.project,
|
|
60
|
+
striped = _ref2.striped;
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
className: striped ? "row striped" : "row"
|
|
63
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
64
|
+
className: "row-name"
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
|
|
66
|
+
overflow: "truncate",
|
|
67
|
+
whitespace: "no-wrap",
|
|
68
|
+
color: "theme-primary"
|
|
69
|
+
}, project.name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: "cells"
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
72
|
+
className: "cell w-type"
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.Body2, null, BUDGET_TYPE_NAMES[project.type])), /*#__PURE__*/_react.default.createElement("span", {
|
|
74
|
+
className: "cell w-budget"
|
|
75
|
+
}, project.budget > 0 ? /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
|
|
76
|
+
title: "".concat((0, _utils.formatNumber)(project.budget, ",", ".", false, 2), " per month"),
|
|
77
|
+
disable: project.interval === "whole_project"
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
79
|
+
className: "cell always"
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_Display.DisplayNumber, {
|
|
81
|
+
variant: "Body 2",
|
|
82
|
+
format: "short",
|
|
83
|
+
disableTooltip: project.interval !== "whole_project",
|
|
84
|
+
value: project.budget
|
|
85
|
+
}), project.type === "pay_as_you_go" && project.interval !== "whole_project" ? /*#__PURE__*/_react.default.createElement(_Typography.Body2, null, "/", project.interval[0]) : null)) : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
86
|
+
className: "cell w-hours"
|
|
87
|
+
}, project.hours > 0 ? /*#__PURE__*/_react.default.createElement(_Display.DisplayHours, {
|
|
88
|
+
variant: "Body 2",
|
|
89
|
+
trimZeroMinutes: true,
|
|
90
|
+
value: project.hours
|
|
91
|
+
}) : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
92
|
+
className: "cell w-expenses"
|
|
93
|
+
}, project.expenses > 0 ? /*#__PURE__*/_react.default.createElement(_Display.DisplayNumber, {
|
|
94
|
+
variant: "Body 2",
|
|
95
|
+
format: "short",
|
|
96
|
+
value: project.expenses
|
|
97
|
+
}) : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
98
|
+
className: "cell always w-uninvoiced"
|
|
99
|
+
}, project.uninvoiced > 0 ? /*#__PURE__*/_react.default.createElement(_Display.DisplayNumber, {
|
|
100
|
+
variant: "Body 2",
|
|
101
|
+
format: "short",
|
|
102
|
+
value: project.uninvoiced
|
|
103
|
+
}) : null), /*#__PURE__*/_react.default.createElement(UninvoicedActions, {
|
|
104
|
+
markAsPaid: project.type === "pay_as_you_go"
|
|
105
|
+
})));
|
|
106
|
+
};
|
|
107
|
+
var UninvoicedGroup = function UninvoicedGroup(_ref3) {
|
|
108
|
+
var company = _ref3.company;
|
|
109
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
+
className: "company"
|
|
111
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
+
className: "company-header"
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
114
|
+
className: "company-name"
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
|
|
116
|
+
weight: "bold",
|
|
117
|
+
overflow: "truncate",
|
|
118
|
+
whitespace: "no-wrap"
|
|
119
|
+
}, company.name), /*#__PURE__*/_react.default.createElement(_Chip.Chip, {
|
|
120
|
+
label: String(company.total.count),
|
|
121
|
+
size: "small",
|
|
122
|
+
backgroundColor: "var(--color-theme-300)",
|
|
123
|
+
className: "company-chip",
|
|
124
|
+
typographyProps: {
|
|
125
|
+
variant: "Caption 1"
|
|
126
|
+
}
|
|
127
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
128
|
+
className: "cells"
|
|
129
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
|
|
130
|
+
weight: "bold",
|
|
131
|
+
className: "cell w-type"
|
|
132
|
+
}, "Budget Type"), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
|
|
133
|
+
weight: "bold",
|
|
134
|
+
className: "cell w-budget"
|
|
135
|
+
}, "Budget"), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
|
|
136
|
+
weight: "bold",
|
|
137
|
+
className: "cell w-hours"
|
|
138
|
+
}, "Hours"), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
|
|
139
|
+
weight: "bold",
|
|
140
|
+
className: "cell w-expenses"
|
|
141
|
+
}, "Expenses"), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
|
|
142
|
+
weight: "bold",
|
|
143
|
+
className: "cell always w-uninvoiced"
|
|
144
|
+
}, "Uninvoiced"), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
|
|
145
|
+
weight: "bold",
|
|
146
|
+
className: "cell always w-action"
|
|
147
|
+
}, "Action"))), company.projects.map(function (project, index) {
|
|
148
|
+
return /*#__PURE__*/_react.default.createElement(UninvoicedRow, {
|
|
149
|
+
key: project.id,
|
|
150
|
+
project: project,
|
|
151
|
+
striped: index % 2 === 0
|
|
152
|
+
});
|
|
153
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
154
|
+
className: "company-footer"
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
|
|
156
|
+
weight: "bold",
|
|
157
|
+
overflow: "truncate",
|
|
158
|
+
whitespace: "no-wrap"
|
|
159
|
+
}, "Total:"), /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
+
className: "cells"
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
162
|
+
className: "cell w-budget"
|
|
163
|
+
}, company.total.budget ? /*#__PURE__*/_react.default.createElement(_Display.DisplayNumber, {
|
|
164
|
+
variant: "Body 2",
|
|
165
|
+
weight: "bold",
|
|
166
|
+
format: "short",
|
|
167
|
+
value: company.total.budget
|
|
168
|
+
}) : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
169
|
+
className: "cell w-hours"
|
|
170
|
+
}, company.total.hours ? /*#__PURE__*/_react.default.createElement(_Display.DisplayHours, {
|
|
171
|
+
variant: "Body 2",
|
|
172
|
+
weight: "bold",
|
|
173
|
+
trimZeroMinutes: true,
|
|
174
|
+
value: company.total.hours
|
|
175
|
+
}) : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
176
|
+
className: "cell w-expenses"
|
|
177
|
+
}, company.total.expenses ? /*#__PURE__*/_react.default.createElement(_Display.DisplayNumber, {
|
|
178
|
+
variant: "Body 2",
|
|
179
|
+
weight: "bold",
|
|
180
|
+
format: "short",
|
|
181
|
+
value: company.total.expenses
|
|
182
|
+
}) : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
183
|
+
className: "cell always w-uninvoiced"
|
|
184
|
+
}, /*#__PURE__*/_react.default.createElement(_Display.DisplayNumber, {
|
|
185
|
+
variant: "Body 2",
|
|
186
|
+
weight: "bold",
|
|
187
|
+
format: "short",
|
|
188
|
+
value: company.total.uninvoiced
|
|
189
|
+
})), /*#__PURE__*/_react.default.createElement(UninvoicedActions, {
|
|
190
|
+
markAsPaid: company.projects.some(function (project) {
|
|
191
|
+
return project.type === "pay_as_you_go";
|
|
192
|
+
})
|
|
193
|
+
}))));
|
|
194
|
+
};
|
|
195
|
+
var UninvoicedPage = exports.UninvoicedPage = function UninvoicedPage() {
|
|
196
|
+
return /*#__PURE__*/_react.default.createElement(_shared.PresentationShell, {
|
|
197
|
+
activeMenuItem: "Reports",
|
|
198
|
+
header: /*#__PURE__*/_react.default.createElement(_shared.PageHeader, {
|
|
199
|
+
title: "Uninvoiced",
|
|
200
|
+
back: true
|
|
201
|
+
}),
|
|
202
|
+
floating: /*#__PURE__*/_react.default.createElement(_shared.FloatingControls, null)
|
|
203
|
+
}, /*#__PURE__*/_react.default.createElement(_controls.StyledReportToolbar, null, /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
|
|
204
|
+
weight: "bold",
|
|
205
|
+
className: "toolbar-total"
|
|
206
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, "Total:"), /*#__PURE__*/_react.default.createElement(_Display.DisplayCurrency, {
|
|
207
|
+
variant: "Body 2",
|
|
208
|
+
weight: "bold",
|
|
209
|
+
format: "short",
|
|
210
|
+
value: _data.UNINVOICED_EUR.total,
|
|
211
|
+
currencyCode: "EUR"
|
|
212
|
+
})), /*#__PURE__*/_react.default.createElement(_controls.ControlGroup, null, /*#__PURE__*/_react.default.createElement(_controls.ControlGroup, {
|
|
213
|
+
divided: true
|
|
214
|
+
}, /*#__PURE__*/_react.default.createElement(_controls.ExportButton, null)), /*#__PURE__*/_react.default.createElement(_controls.ControlGroup, null, /*#__PURE__*/_react.default.createElement(_controls.ReportFilter, {
|
|
215
|
+
data: UNINVOICED_FILTER_DATA
|
|
216
|
+
})))), /*#__PURE__*/_react.default.createElement(StyledUninvoiced, null, _data.UNINVOICED_EUR.companies.map(function (company) {
|
|
217
|
+
return /*#__PURE__*/_react.default.createElement(UninvoicedGroup, {
|
|
218
|
+
key: company.id,
|
|
219
|
+
company: company
|
|
220
|
+
});
|
|
221
|
+
})));
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=uninvoiced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninvoiced.js","names":["_react","_interopRequireDefault","require","_styledComponents","_controls","_data","_Chip","_Display","_IconButton","_Icons","_Paper","_Tooltip","_Typography","_utils","_shared","e","__esModule","default","UNINVOICED_FILTER_DATA","toFilterData","id","name","BUDGET_TYPE_NAMES","fixed","pay_as_you_go","StyledUninvoiced","styled","Paper","withConfig","displayName","componentId","LG","UninvoicedActions","_ref","markAsPaid","createElement","className","Tooltip","title","IconButton","variant","DollarCheckmarkIcon","DollarDocumentPlusIcon","UninvoicedRow","_ref2","project","striped","Body2","overflow","whitespace","color","type","budget","concat","formatNumber","disable","interval","DisplayNumber","format","disableTooltip","value","hours","DisplayHours","trimZeroMinutes","expenses","uninvoiced","UninvoicedGroup","_ref3","company","Caption1","weight","Chip","label","String","total","count","size","backgroundColor","typographyProps","projects","map","index","key","some","UninvoicedPage","exports","PresentationShell","activeMenuItem","header","PageHeader","back","floating","FloatingControls","StyledReportToolbar","DisplayCurrency","UNINVOICED_EUR","currencyCode","ControlGroup","divided","ExportButton","ReportFilter","data","companies"],"sources":["../../../../src/presentation/reports/uninvoiced.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport {\n toFilterData,\n StyledReportToolbar,\n ControlGroup,\n ReportFilter,\n ExportButton,\n} from \"./controls\";\nimport { UninvoicedCompany, UninvoicedProject, UNINVOICED_EUR } from \"./data\";\nimport { Chip } from \"../../components/Chip\";\nimport {\n DisplayCurrency,\n DisplayHours,\n DisplayNumber,\n} from \"../../components/Display\";\nimport { DataType } from \"../../components/Filter\";\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n DollarCheckmarkIcon,\n DollarDocumentPlusIcon,\n} from \"../../components/Icons\";\nimport { Paper } from \"../../components/Paper\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { Body2, Caption1 } from \"../../components/Typography\";\nimport { formatNumber } from \"../../utils\";\nimport { FloatingControls, LG, PageHeader, PresentationShell } from \"../shared\";\n\nconst UNINVOICED_FILTER_DATA: DataType[] = [\n toFilterData(\"status\", \"Status\", \"status\", [\n { id: 1, name: \"Active Projects\" },\n { id: 2, name: \"Recently Completed\" },\n ]),\n toFilterData(\"budget_type\", \"Budget Type\", \"budget type\", [\n { id: 1, name: \"Fixed Budget\" },\n { id: 2, name: \"Time and Expenses\" },\n ]),\n];\n\nconst BUDGET_TYPE_NAMES: Record<UninvoicedProject[\"type\"], string> = {\n fixed: \"Fixed Price\",\n pay_as_you_go: \"Time and Expenses\",\n};\n\nconst StyledUninvoiced = styled(Paper)`\n display: flex;\n flex-direction: column;\n height: 100%;\n margin-bottom: 32px;\n padding: 0 8px;\n\n .company {\n margin-bottom: 16px;\n }\n\n .company:first-child {\n padding-top: 8px;\n }\n\n .company-header,\n .company-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 40px;\n padding: 8px;\n box-sizing: border-box;\n overflow: hidden;\n }\n\n .company-name {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n }\n\n .company-chip {\n flex-shrink: 0;\n }\n\n .row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n height: 40px;\n padding: 0 8px;\n border-radius: 8px;\n box-sizing: border-box;\n }\n\n .row.striped {\n background-color: var(--color-theme-200);\n }\n\n .row-name {\n display: flex;\n align-items: center;\n width: 100%;\n min-width: 0;\n overflow: hidden;\n text-decoration: none;\n cursor: pointer;\n }\n\n .cells {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .cell {\n display: none;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n\n @media (min-width: ${LG}) {\n display: flex;\n }\n }\n\n .cell.always {\n display: flex;\n }\n\n .w-type {\n width: 140px;\n }\n\n .w-budget,\n .w-expenses {\n width: 112px;\n }\n\n .w-hours {\n width: 80px;\n }\n\n .w-uninvoiced {\n width: 120px;\n }\n\n .w-action {\n display: flex;\n width: 96px;\n }\n\n .action-button {\n color: var(--color-theme-600);\n }\n\n .action-button.spaced {\n margin-right: 4px;\n }\n`;\n\nconst UninvoicedActions = ({\n markAsPaid,\n}: {\n markAsPaid: boolean;\n}): ReactElement => (\n <span className=\"cell always w-action\">\n {markAsPaid ? (\n <Tooltip title=\"Mark as Paid\">\n <IconButton variant=\"text gray\" className=\"action-button spaced\">\n <DollarCheckmarkIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n <Tooltip title=\"Create Invoice\">\n <IconButton variant=\"text gray\" className=\"action-button\">\n <DollarDocumentPlusIcon />\n </IconButton>\n </Tooltip>\n </span>\n);\n\nconst UninvoicedRow = ({\n project,\n striped,\n}: {\n project: UninvoicedProject;\n striped: boolean;\n}): ReactElement => (\n <div className={striped ? \"row striped\" : \"row\"}>\n <a className=\"row-name\">\n <Body2 overflow=\"truncate\" whitespace=\"no-wrap\" color=\"theme-primary\">\n {project.name}\n </Body2>\n </a>\n <div className=\"cells\">\n <span className=\"cell w-type\">\n <Body2>{BUDGET_TYPE_NAMES[project.type]}</Body2>\n </span>\n <span className=\"cell w-budget\">\n {project.budget > 0 ? (\n <Tooltip\n title={`${formatNumber(\n project.budget,\n \",\",\n \".\",\n false,\n 2\n )} per month`}\n disable={project.interval === \"whole_project\"}\n >\n <span className=\"cell always\">\n <DisplayNumber\n variant=\"Body 2\"\n format=\"short\"\n disableTooltip={project.interval !== \"whole_project\"}\n value={project.budget}\n />\n {project.type === \"pay_as_you_go\" &&\n project.interval !== \"whole_project\" ? (\n <Body2>/{project.interval[0]}</Body2>\n ) : null}\n </span>\n </Tooltip>\n ) : null}\n </span>\n <span className=\"cell w-hours\">\n {project.hours > 0 ? (\n <DisplayHours\n variant=\"Body 2\"\n trimZeroMinutes\n value={project.hours}\n />\n ) : null}\n </span>\n <span className=\"cell w-expenses\">\n {project.expenses > 0 ? (\n <DisplayNumber\n variant=\"Body 2\"\n format=\"short\"\n value={project.expenses}\n />\n ) : null}\n </span>\n <span className=\"cell always w-uninvoiced\">\n {project.uninvoiced > 0 ? (\n <DisplayNumber\n variant=\"Body 2\"\n format=\"short\"\n value={project.uninvoiced}\n />\n ) : null}\n </span>\n <UninvoicedActions markAsPaid={project.type === \"pay_as_you_go\"} />\n </div>\n </div>\n);\n\nconst UninvoicedGroup = ({\n company,\n}: {\n company: UninvoicedCompany;\n}): ReactElement => (\n <div className=\"company\">\n <div className=\"company-header\">\n <div className=\"company-name\">\n <Caption1 weight=\"bold\" overflow=\"truncate\" whitespace=\"no-wrap\">\n {company.name}\n </Caption1>\n <Chip\n label={String(company.total.count)}\n size=\"small\"\n backgroundColor=\"var(--color-theme-300)\"\n className=\"company-chip\"\n typographyProps={{ variant: \"Caption 1\" }}\n />\n </div>\n <div className=\"cells\">\n <Caption1 weight=\"bold\" className=\"cell w-type\">\n Budget Type\n </Caption1>\n <Caption1 weight=\"bold\" className=\"cell w-budget\">\n Budget\n </Caption1>\n <Caption1 weight=\"bold\" className=\"cell w-hours\">\n Hours\n </Caption1>\n <Caption1 weight=\"bold\" className=\"cell w-expenses\">\n Expenses\n </Caption1>\n <Caption1 weight=\"bold\" className=\"cell always w-uninvoiced\">\n Uninvoiced\n </Caption1>\n <Caption1 weight=\"bold\" className=\"cell always w-action\">\n Action\n </Caption1>\n </div>\n </div>\n {company.projects.map((project, index) => (\n <UninvoicedRow\n key={project.id}\n project={project}\n striped={index % 2 === 0}\n />\n ))}\n <div className=\"company-footer\">\n <Body2 weight=\"bold\" overflow=\"truncate\" whitespace=\"no-wrap\">\n Total:\n </Body2>\n <div className=\"cells\">\n <span className=\"cell w-budget\">\n {company.total.budget ? (\n <DisplayNumber\n variant=\"Body 2\"\n weight=\"bold\"\n format=\"short\"\n value={company.total.budget}\n />\n ) : null}\n </span>\n <span className=\"cell w-hours\">\n {company.total.hours ? (\n <DisplayHours\n variant=\"Body 2\"\n weight=\"bold\"\n trimZeroMinutes\n value={company.total.hours}\n />\n ) : null}\n </span>\n <span className=\"cell w-expenses\">\n {company.total.expenses ? (\n <DisplayNumber\n variant=\"Body 2\"\n weight=\"bold\"\n format=\"short\"\n value={company.total.expenses}\n />\n ) : null}\n </span>\n <span className=\"cell always w-uninvoiced\">\n <DisplayNumber\n variant=\"Body 2\"\n weight=\"bold\"\n format=\"short\"\n value={company.total.uninvoiced}\n />\n </span>\n <UninvoicedActions\n markAsPaid={company.projects.some(\n (project) => project.type === \"pay_as_you_go\"\n )}\n />\n </div>\n </div>\n </div>\n);\n\nexport const UninvoicedPage = (): ReactElement => (\n <PresentationShell\n activeMenuItem=\"Reports\"\n header={<PageHeader title=\"Uninvoiced\" back />}\n floating={<FloatingControls />}\n >\n <StyledReportToolbar>\n <Body2 weight=\"bold\" className=\"toolbar-total\">\n <span>Total:</span>\n <DisplayCurrency\n variant=\"Body 2\"\n weight=\"bold\"\n format=\"short\"\n value={UNINVOICED_EUR.total}\n currencyCode=\"EUR\"\n />\n </Body2>\n <ControlGroup>\n <ControlGroup divided>\n <ExportButton />\n </ControlGroup>\n <ControlGroup>\n <ReportFilter data={UNINVOICED_FILTER_DATA} />\n </ControlGroup>\n </ControlGroup>\n </StyledReportToolbar>\n <StyledUninvoiced>\n {UNINVOICED_EUR.companies.map((company) => (\n <UninvoicedGroup key={company.id} company={company} />\n ))}\n </StyledUninvoiced>\n </PresentationShell>\n);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAIA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AAAgF,SAAAD,uBAAAc,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhF,IAAMG,sBAAkC,GAAG,CACzC,IAAAC,sBAAY,EAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CACzC;EAAEC,EAAE,EAAE,CAAC;EAAEC,IAAI,EAAE;AAAkB,CAAC,EAClC;EAAED,EAAE,EAAE,CAAC;EAAEC,IAAI,EAAE;AAAqB,CAAC,CACtC,CAAC,EACF,IAAAF,sBAAY,EAAC,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,CACxD;EAAEC,EAAE,EAAE,CAAC;EAAEC,IAAI,EAAE;AAAe,CAAC,EAC/B;EAAED,EAAE,EAAE,CAAC;EAAEC,IAA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,MAAA,CAAAiB,OAAA,CAAAkB,aAAA,CAAC/B,SAAA,CAAA6F,YAAY;IAACC,OAAO;EAAA,gBACnBlG,MAAA,CAAAiB,OAAA,CAAAkB,aAAA,CAAC/B,SAAA,CAAA+F,YAAY,MAAE,CACH,CAAC,eACfnG,MAAA,CAAAiB,OAAA,CAAAkB,aAAA,CAAC/B,SAAA,CAAA6F,YAAY,qBACXjG,MAAA,CAAAiB,OAAA,CAAAkB,aAAA,CAAC/B,SAAA,CAAAgG,YAAY;IAACC,IAAI,EAAEnF;EAAuB,CAAE,CACjC,CACF,CACK,CAAC,eACtBlB,MAAA,CAAAiB,OAAA,CAAAkB,aAAA,CAACV,gBAAgB,QACdsE,oBAAc,CAACO,SAAS,CAACtB,GAAG,CAAC,UAACZ,OAAO;IAAA,oBACpCpE,MAAA,CAAAiB,OAAA,CAAAkB,aAAA,CAAC+B,eAAe;MAACgB,GAAG,EAAEd,OAAO,CAAChD,EAAG;MAACgD,OAAO,EAAEA;IAAQ,CAAE,CAAC;EAAA,CACvD,CACe,CACD,CAAC;AAAA,CACrB","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePageStickyCover = exports.PageStickyHeader = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _tokens = require("./tokens");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
var HEIGHT_PROPERTY = "--page-sticky-header-height";
|
|
14
|
+
var COVER_PROPERTY = "--page-sticky-cover-below";
|
|
15
|
+
var FADE_PROPERTY = "--page-sticky-fade";
|
|
16
|
+
var StyledPageStickyHeader = _styledComponents.default.div.withConfig({
|
|
17
|
+
displayName: "PageStickyHeader__StyledPageStickyHeader",
|
|
18
|
+
componentId: "sc-1cdgym5-0"
|
|
19
|
+
})(["position:sticky;top:0;z-index:10;margin:0 -16px;padding:0 16px 16px;background:linear-gradient( to top,var(--body-bg-main-transparent),var(--body-bg-main) var(", ",1rem) );@media (min-width:", "){margin-right:-32px;padding-right:32px;}&::after{content:\"\";position:absolute;top:100%;left:0;right:0;height:var(", ",0px);pointer-events:none;background:linear-gradient( to bottom,var(--body-bg-main),var(--body-bg-main-transparent) );}> :last-child{margin-bottom:0;}"], FADE_PROPERTY, _tokens.SM, COVER_PROPERTY);
|
|
20
|
+
var PageStickyHeader = exports.PageStickyHeader = function PageStickyHeader(_ref) {
|
|
21
|
+
var children = _ref.children;
|
|
22
|
+
var ref = (0, _react.useRef)(null);
|
|
23
|
+
(0, _react.useLayoutEffect)(function () {
|
|
24
|
+
var header = ref.current;
|
|
25
|
+
var page = header === null || header === void 0 ? void 0 : header.parentElement;
|
|
26
|
+
if (!header || !page) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
var scroller = page.closest("#right-window");
|
|
30
|
+
var publishHeight = function publishHeight() {
|
|
31
|
+
var height = "".concat(header.getBoundingClientRect().height, "px");
|
|
32
|
+
page.style.setProperty(HEIGHT_PROPERTY, height);
|
|
33
|
+
scroller === null || scroller === void 0 || scroller.style.setProperty(HEIGHT_PROPERTY, height);
|
|
34
|
+
};
|
|
35
|
+
publishHeight();
|
|
36
|
+
var observer = new _resizeObserverPolyfill.default(publishHeight);
|
|
37
|
+
observer.observe(header);
|
|
38
|
+
return function () {
|
|
39
|
+
observer.disconnect();
|
|
40
|
+
page.style.removeProperty(HEIGHT_PROPERTY);
|
|
41
|
+
scroller === null || scroller === void 0 || scroller.style.removeProperty(HEIGHT_PROPERTY);
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(StyledPageStickyHeader, {
|
|
45
|
+
ref: ref,
|
|
46
|
+
"data-page-sticky-header": true
|
|
47
|
+
}, children);
|
|
48
|
+
};
|
|
49
|
+
PageStickyHeader.displayName = "PageStickyHeader";
|
|
50
|
+
var usePageStickyCover = exports.usePageStickyCover = function usePageStickyCover(ref) {
|
|
51
|
+
var enabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
52
|
+
(0, _react.useLayoutEffect)(function () {
|
|
53
|
+
var _scroller$querySelect;
|
|
54
|
+
var contentHeader = ref.current;
|
|
55
|
+
var scroller = contentHeader === null || contentHeader === void 0 ? void 0 : contentHeader.closest("#right-window");
|
|
56
|
+
var page = scroller === null || scroller === void 0 || (_scroller$querySelect = scroller.querySelector("[data-page-sticky-header]")) === null || _scroller$querySelect === void 0 ? void 0 : _scroller$querySelect.parentElement;
|
|
57
|
+
if (!enabled || !contentHeader || !page) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
var publishCover = function publishCover() {
|
|
61
|
+
var _contentHeader$getBou = contentHeader.getBoundingClientRect(),
|
|
62
|
+
height = _contentHeader$getBou.height;
|
|
63
|
+
page.style.setProperty(COVER_PROPERTY, "".concat(height / 2, "px"));
|
|
64
|
+
};
|
|
65
|
+
publishCover();
|
|
66
|
+
page.style.setProperty(FADE_PROPERTY, "0px");
|
|
67
|
+
var observer = new _resizeObserverPolyfill.default(publishCover);
|
|
68
|
+
observer.observe(contentHeader);
|
|
69
|
+
return function () {
|
|
70
|
+
observer.disconnect();
|
|
71
|
+
page.style.removeProperty(COVER_PROPERTY);
|
|
72
|
+
page.style.removeProperty(FADE_PROPERTY);
|
|
73
|
+
};
|
|
74
|
+
}, [enabled, ref]);
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=PageStickyHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageStickyHeader.js","names":["_react","_interopRequireWildcard","require","_resizeObserverPolyfill","_interopRequireDefault","_styledComponents","_tokens","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","HEIGHT_PROPERTY","COVER_PROPERTY","FADE_PROPERTY","StyledPageStickyHeader","styled","div","withConfig","displayName","componentId","SM","PageStickyHeader","exports","_ref","children","ref","useRef","useLayoutEffect","header","current","page","parentElement","undefined","scroller","closest","publishHeight","height","concat","getBoundingClientRect","style","setProperty","observer","ResizeObserver","observe","disconnect","removeProperty","createElement","usePageStickyCover","enabled","arguments","length","_scroller$querySelect","contentHeader","querySelector","publishCover","_contentHeader$getBou"],"sources":["../../../../src/presentation/shared/PageStickyHeader.tsx"],"sourcesContent":["import React, {\n ReactElement,\n ReactNode,\n RefObject,\n useLayoutEffect,\n useRef,\n} from \"react\";\n\nimport ResizeObserver from \"resize-observer-polyfill\";\nimport styled from \"styled-components\";\n\nimport { SM } from \"./tokens\";\n\nconst HEIGHT_PROPERTY = \"--page-sticky-header-height\";\nconst COVER_PROPERTY = \"--page-sticky-cover-below\";\nconst FADE_PROPERTY = \"--page-sticky-fade\";\n\nconst StyledPageStickyHeader = styled.div`\n position: sticky;\n top: 0;\n z-index: 10;\n margin: 0 -16px;\n padding: 0 16px 16px;\n background: linear-gradient(\n to top,\n var(--body-bg-main-transparent),\n var(--body-bg-main) var(${FADE_PROPERTY}, 1rem)\n );\n\n @media (min-width: ${SM}) {\n margin-right: -32px;\n padding-right: 32px;\n }\n\n &::after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: var(${COVER_PROPERTY}, 0px);\n pointer-events: none;\n background: linear-gradient(\n to bottom,\n var(--body-bg-main),\n var(--body-bg-main-transparent)\n );\n }\n\n > :last-child {\n margin-bottom: 0;\n }\n`;\n\nexport interface PageStickyHeaderProps {\n children: ReactNode;\n}\n\nexport const PageStickyHeader = ({\n children,\n}: PageStickyHeaderProps): ReactElement => {\n const ref = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n const header = ref.current;\n const page = header?.parentElement;\n if (!header || !page) {\n return undefined;\n }\n const scroller = page.closest<HTMLElement>(\"#right-window\");\n const publishHeight = (): void => {\n const height = `${header.getBoundingClientRect().height}px`;\n page.style.setProperty(HEIGHT_PROPERTY, height);\n scroller?.style.setProperty(HEIGHT_PROPERTY, height);\n };\n publishHeight();\n const observer = new ResizeObserver(publishHeight);\n observer.observe(header);\n return () => {\n observer.disconnect();\n page.style.removeProperty(HEIGHT_PROPERTY);\n scroller?.style.removeProperty(HEIGHT_PROPERTY);\n };\n }, []);\n\n return (\n <StyledPageStickyHeader ref={ref} data-page-sticky-header>\n {children}\n </StyledPageStickyHeader>\n );\n};\n\nPageStickyHeader.displayName = \"PageStickyHeader\";\n\nexport const usePageStickyCover = (\n ref: RefObject<HTMLElement>,\n enabled = true\n): void => {\n useLayoutEffect(() => {\n const contentHeader = ref.current;\n const scroller = contentHeader?.closest<HTMLElement>(\"#right-window\");\n const page = scroller?.querySelector<HTMLElement>(\n \"[data-page-sticky-header]\"\n )?.parentElement;\n if (!enabled || !contentHeader || !page) {\n return undefined;\n }\n const publishCover = (): void => {\n const { height } = contentHeader.getBoundingClientRect();\n page.style.setProperty(COVER_PROPERTY, `${height / 2}px`);\n };\n publishCover();\n page.style.setProperty(FADE_PROPERTY, \"0px\");\n const observer = new ResizeObserver(publishCover);\n observer.observe(content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,qBAAqB,CAAC,CAAC;QAAhDF,MAAM,GAAAmB,qBAAA,CAANnB,MAAM;MACdN,IAAI,CAACS,KAAK,CAACC,WAAW,CAAC5B,cAAc,KAAAyB,MAAA,CAAKD,MAAM,GAAG,CAAC,OAAI,CAAC;IAC3D,CAAC;IACDkB,YAAY,CAAC,CAAC;IACdxB,IAAI,CAACS,KAAK,CAACC,WAAW,CAAC3B,aAAa,EAAE,KAAK,CAAC;IAC5C,IAAM4B,QAAQ,GAAG,IAAIC,+BAAc,CAACY,YAAY,CAAC;IACjDb,QAAQ,CAACE,OAAO,CAACS,aAAa,CAAC;IAC/B,OAAO,YAAM;MACXX,QAAQ,CAACG,UAAU,CAAC,CAAC;MACrBd,IAAI,CAACS,KAAK,CAACM,cAAc,CAACjC,cAAc,CAAC;MACzCkB,IAAI,CAACS,KAAK,CAACM,cAAc,CAAChC,aAAa,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,CAACmC,OAAO,EAAEvB,GAAG,CAAC,CAAC;AACpB,CAAC","ignoreList":[]}
|
|
@@ -28,8 +28,7 @@ var MENU_ITEMS = [{
|
|
|
28
28
|
text: "Getting Started"
|
|
29
29
|
}, {
|
|
30
30
|
icon: _Icons.ProjectsIcon,
|
|
31
|
-
text: "Projects"
|
|
32
|
-
active: true
|
|
31
|
+
text: "Projects"
|
|
33
32
|
}, {
|
|
34
33
|
icon: _Icons.MyWorkIcon,
|
|
35
34
|
text: "My Work"
|
|
@@ -117,7 +116,7 @@ var StyledIconRow = _styledComponents.default.div.withConfig({
|
|
|
117
116
|
var StyledTopRightControls = _styledComponents.default.div.withConfig({
|
|
118
117
|
displayName: "PresentationShell__StyledTopRightControls",
|
|
119
118
|
componentId: "sc-12j90o1-11"
|
|
120
|
-
})(["position:absolute;top:0;right:0;display:none;align-items:center;justify-content:flex-end;padding:12px 32px 12px 0;@media (min-width:", "){display:flex;}"], _tokens.SM);
|
|
119
|
+
})(["position:absolute;top:0;right:0;z-index:11;display:none;align-items:center;justify-content:flex-end;padding:12px 32px 12px 0;@media (min-width:", "){display:flex;}"], _tokens.SM);
|
|
121
120
|
var StyledHeaderAvatar = _styledComponents.default.div.withConfig({
|
|
122
121
|
displayName: "PresentationShell__StyledHeaderAvatar",
|
|
123
122
|
componentId: "sc-12j90o1-12"
|
|
@@ -148,7 +147,8 @@ var StyledPagePaper = exports.StyledPagePaper = (0, _styledComponents.default)(_
|
|
|
148
147
|
|
|
149
148
|
var MenuItemsMock = function MenuItemsMock(_ref) {
|
|
150
149
|
var _ref$mobile = _ref.mobile,
|
|
151
|
-
mobile = _ref$mobile === void 0 ? false : _ref$mobile
|
|
150
|
+
mobile = _ref$mobile === void 0 ? false : _ref$mobile,
|
|
151
|
+
activeItem = _ref.activeItem;
|
|
152
152
|
return /*#__PURE__*/_react.default.createElement(StyledMenuScroll, null, /*#__PURE__*/_react.default.createElement(StyledMenuSection, {
|
|
153
153
|
className: "menu-section"
|
|
154
154
|
}, /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
|
|
@@ -156,15 +156,14 @@ var MenuItemsMock = function MenuItemsMock(_ref) {
|
|
|
156
156
|
color: "tertiary"
|
|
157
157
|
}, "MENU")), MENU_ITEMS.map(function (_ref2) {
|
|
158
158
|
var Icon = _ref2.icon,
|
|
159
|
-
text = _ref2.text
|
|
160
|
-
active = _ref2.active;
|
|
159
|
+
text = _ref2.text;
|
|
161
160
|
return /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
|
|
162
161
|
key: text,
|
|
163
162
|
title: text,
|
|
164
163
|
placement: "right",
|
|
165
164
|
disable: mobile
|
|
166
165
|
}, /*#__PURE__*/_react.default.createElement(StyledMenuItem, {
|
|
167
|
-
className:
|
|
166
|
+
className: text === activeItem ? "active" : undefined
|
|
168
167
|
}, /*#__PURE__*/_react.default.createElement(Icon, null), /*#__PURE__*/_react.default.createElement(_Typography.Body2, {
|
|
169
168
|
weight: "medium",
|
|
170
169
|
color: "secondary",
|
|
@@ -176,7 +175,8 @@ var MenuItemsMock = function MenuItemsMock(_ref) {
|
|
|
176
175
|
var MainMenuMock = function MainMenuMock(_ref3) {
|
|
177
176
|
var collapsed = _ref3.collapsed,
|
|
178
177
|
onToggleCollapsed = _ref3.onToggleCollapsed,
|
|
179
|
-
footer = _ref3.footer
|
|
178
|
+
footer = _ref3.footer,
|
|
179
|
+
activeItem = _ref3.activeItem;
|
|
180
180
|
return /*#__PURE__*/_react.default.createElement(StyledMainMenu, {
|
|
181
181
|
className: collapsed ? "collapsed" : undefined,
|
|
182
182
|
"data-testid": "main-menu"
|
|
@@ -188,12 +188,15 @@ var MainMenuMock = function MainMenuMock(_ref3) {
|
|
|
188
188
|
variant: "text gray",
|
|
189
189
|
size: "small",
|
|
190
190
|
onClick: onToggleCollapsed
|
|
191
|
-
}, /*#__PURE__*/_react.default.createElement(_Icons.CollapsIcon, null)))), /*#__PURE__*/_react.default.createElement(MenuItemsMock,
|
|
191
|
+
}, /*#__PURE__*/_react.default.createElement(_Icons.CollapsIcon, null)))), /*#__PURE__*/_react.default.createElement(MenuItemsMock, {
|
|
192
|
+
activeItem: activeItem
|
|
193
|
+
}), footer);
|
|
192
194
|
};
|
|
193
195
|
var MainMenuMobileMock = function MainMenuMobileMock(_ref4) {
|
|
194
196
|
var open = _ref4.open,
|
|
195
197
|
close = _ref4.close,
|
|
196
|
-
footer = _ref4.footer
|
|
198
|
+
footer = _ref4.footer,
|
|
199
|
+
activeItem = _ref4.activeItem;
|
|
197
200
|
return open ? /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
198
201
|
open: open,
|
|
199
202
|
onClose: close
|
|
@@ -206,7 +209,8 @@ var MainMenuMobileMock = function MainMenuMobileMock(_ref4) {
|
|
|
206
209
|
onClick: close,
|
|
207
210
|
variant: "text gray"
|
|
208
211
|
}, /*#__PURE__*/_react.default.createElement(_Icons.CloseIcon, null))), /*#__PURE__*/_react.default.createElement(MenuItemsMock, {
|
|
209
|
-
mobile: true
|
|
212
|
+
mobile: true,
|
|
213
|
+
activeItem: activeItem
|
|
210
214
|
}), footer)) : null;
|
|
211
215
|
};
|
|
212
216
|
var MobileMenuHeaderMock = function MobileMenuHeaderMock(_ref5) {
|
|
@@ -247,7 +251,9 @@ var PresentationShell = exports.PresentationShell = function PresentationShell(_
|
|
|
247
251
|
var header = _ref6.header,
|
|
248
252
|
children = _ref6.children,
|
|
249
253
|
floating = _ref6.floating,
|
|
250
|
-
menuFooter = _ref6.menuFooter
|
|
254
|
+
menuFooter = _ref6.menuFooter,
|
|
255
|
+
_ref6$activeMenuItem = _ref6.activeMenuItem,
|
|
256
|
+
activeMenuItem = _ref6$activeMenuItem === void 0 ? "Projects" : _ref6$activeMenuItem;
|
|
251
257
|
var _useState = (0, _react.useState)(false),
|
|
252
258
|
_useState2 = _slicedToArray(_useState, 2),
|
|
253
259
|
mobileMenuOpen = _useState2[0],
|
|
@@ -293,11 +299,13 @@ var PresentationShell = exports.PresentationShell = function PresentationShell(_
|
|
|
293
299
|
}, /*#__PURE__*/_react.default.createElement(StyledPage, null, header, /*#__PURE__*/_react.default.createElement(StyledPageBody, null, children)), isMobileView === false ? /*#__PURE__*/_react.default.createElement(TopRightControlsMock, null) : null), isMobileView ? /*#__PURE__*/_react.default.createElement(MainMenuMobileMock, {
|
|
294
300
|
open: mobileMenuOpen,
|
|
295
301
|
close: handleCloseMobileMenu,
|
|
296
|
-
footer: menuFooter
|
|
302
|
+
footer: menuFooter,
|
|
303
|
+
activeItem: activeMenuItem
|
|
297
304
|
}) : /*#__PURE__*/_react.default.createElement(MainMenuMock, {
|
|
298
305
|
collapsed: collapsed,
|
|
299
306
|
onToggleCollapsed: handleToggleCollapsed,
|
|
300
|
-
footer: menuFooter
|
|
307
|
+
footer: menuFooter,
|
|
308
|
+
activeItem: activeMenuItem
|
|
301
309
|
})), floating);
|
|
302
310
|
};
|
|
303
311
|
PresentationShell.displayName = "PresentationShell";
|