@nuxt-customer-portal/timesheets 0.3.0
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/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/app/assets/timesheets.css +368 -0
- package/app/components/TimesheetsActivityForm.vue +61 -0
- package/app/components/TimesheetsAdminActivities.vue +323 -0
- package/app/components/TimesheetsAdminApprovals.vue +449 -0
- package/app/components/TimesheetsAdminEmptyState.vue +28 -0
- package/app/components/TimesheetsAdminListToolbar.vue +19 -0
- package/app/components/TimesheetsAdminPaginatedList.vue +95 -0
- package/app/components/TimesheetsAdminProjects.vue +234 -0
- package/app/components/TimesheetsAdminRates.vue +83 -0
- package/app/components/TimesheetsAdminReports.vue +123 -0
- package/app/components/TimesheetsAdminSectionPage.vue +135 -0
- package/app/components/TimesheetsAdminSettings.vue +15 -0
- package/app/components/TimesheetsAdministrationOrganizationPanel.vue +26 -0
- package/app/components/TimesheetsClientSettingsPanel.vue +52 -0
- package/app/components/TimesheetsClientTimesheetBrowser.vue +439 -0
- package/app/components/TimesheetsDashboardCard.vue +260 -0
- package/app/components/TimesheetsDashboardClientApprovals.vue +1 -0
- package/app/components/TimesheetsDashboardInternalApprovals.vue +1 -0
- package/app/components/TimesheetsDashboardMyTimesheets.vue +1 -0
- package/app/components/TimesheetsDashboardMyWeek.vue +1 -0
- package/app/components/TimesheetsDashboardSupplierTimesheets.vue +47 -0
- package/app/components/TimesheetsOrganizationFeaturesCard.vue +66 -0
- package/app/components/TimesheetsPageShell.vue +48 -0
- package/app/components/TimesheetsProjectDetail.vue +338 -0
- package/app/components/TimesheetsProjectForm.vue +215 -0
- package/app/components/TimesheetsSetupChecklist.vue +48 -0
- package/app/components/TimesheetsSubmissionMessages.vue +30 -0
- package/app/components/TimesheetsSubmissionTimeline.vue +89 -0
- package/app/components/TimesheetsWorkspaceSettingsForm.vue +80 -0
- package/app/composables/useTimesheetMenu.ts +69 -0
- package/app/composables/useTimesheetMutationError.ts +35 -0
- package/app/composables/useTimesheets.ts +248 -0
- package/app/composables/useTimesheetsAdminList.ts +165 -0
- package/app/composables/useTimesheetsDashboard.ts +8 -0
- package/app/pages/admin/timesheets/activities.vue +3 -0
- package/app/pages/admin/timesheets/approvals.vue +3 -0
- package/app/pages/admin/timesheets/index.vue +7 -0
- package/app/pages/admin/timesheets/internal-approvals.vue +131 -0
- package/app/pages/admin/timesheets/projects/[id].vue +57 -0
- package/app/pages/admin/timesheets/projects.vue +8 -0
- package/app/pages/admin/timesheets/rates.vue +3 -0
- package/app/pages/admin/timesheets/reports.vue +3 -0
- package/app/pages/admin/timesheets/settings.vue +3 -0
- package/app/pages/timesheets/approvals/reviewers.vue +96 -0
- package/app/pages/timesheets/approvals.vue +11 -0
- package/app/pages/timesheets/client-approvals.vue +108 -0
- package/app/pages/timesheets/client.vue +17 -0
- package/app/pages/timesheets/index.vue +1458 -0
- package/app/pages/timesheets/internal-approvals.vue +100 -0
- package/app/pages/timesheets/suppliers.vue +23 -0
- package/app/plugins/timesheets-feature.ts +122 -0
- package/i18n/locales/en.json +455 -0
- package/i18n/locales/nl.json +455 -0
- package/migrations/0000_baseline.sql +409 -0
- package/migrations/0001_remove_unused_legacy_invoice_schema.sql +31 -0
- package/migrations/0002_submission_batches.sql +47 -0
- package/migrations/0003_sync_provider_clients.sql +26 -0
- package/migrations/0004_client_reply.sql +1 -0
- package/migrations/0005_timer_rounding.sql +1 -0
- package/migrations/meta/0000_snapshot.json +3178 -0
- package/migrations/meta/_journal.json +13 -0
- package/nuxt.config.ts +20 -0
- package/package.json +61 -0
- package/portal.manifest.mjs +10 -0
- package/server/api/timesheets/admin/activities/[id]/deletion.get.ts +18 -0
- package/server/api/timesheets/admin/activities/[id].delete.ts +20 -0
- package/server/api/timesheets/admin/activities/[id].patch.ts +19 -0
- package/server/api/timesheets/admin/activities/index.get.ts +19 -0
- package/server/api/timesheets/admin/activities/index.post.ts +19 -0
- package/server/api/timesheets/admin/approvals/[id].post.ts +19 -0
- package/server/api/timesheets/admin/bootstrap.get.ts +73 -0
- package/server/api/timesheets/admin/client-settings/[clientId]/index.get.ts +25 -0
- package/server/api/timesheets/admin/client-settings/[clientId]/index.put.ts +28 -0
- package/server/api/timesheets/admin/clients/[id]/deletion.get.ts +18 -0
- package/server/api/timesheets/admin/clients/[id].delete.ts +20 -0
- package/server/api/timesheets/admin/clients/[id].patch.ts +14 -0
- package/server/api/timesheets/admin/clients/index.get.ts +18 -0
- package/server/api/timesheets/admin/clients/index.post.ts +25 -0
- package/server/api/timesheets/admin/internal-approvals/[userId].put.ts +11 -0
- package/server/api/timesheets/admin/internal-approvals/index.get.ts +8 -0
- package/server/api/timesheets/admin/internal-approvals/index.patch.ts +11 -0
- package/server/api/timesheets/admin/organization-capabilities/[organizationId].get.ts +19 -0
- package/server/api/timesheets/admin/organization-capabilities/[organizationId].patch.ts +23 -0
- package/server/api/timesheets/admin/projects/[id]/deletion.get.ts +18 -0
- package/server/api/timesheets/admin/projects/[id].delete.ts +20 -0
- package/server/api/timesheets/admin/projects/[id].get.ts +22 -0
- package/server/api/timesheets/admin/projects/[id].patch.ts +19 -0
- package/server/api/timesheets/admin/projects/index.get.ts +18 -0
- package/server/api/timesheets/admin/projects/index.post.ts +19 -0
- package/server/api/timesheets/admin/report.get.ts +26 -0
- package/server/api/timesheets/admin/settings.patch.ts +19 -0
- package/server/api/timesheets/admin/tariffs/index.put.ts +20 -0
- package/server/api/timesheets/admin/team/[userId].put.ts +24 -0
- package/server/api/timesheets/bootstrap.get.ts +24 -0
- package/server/api/timesheets/capabilities.get.ts +58 -0
- package/server/api/timesheets/client/[workspaceClientId]/index.get.ts +12 -0
- package/server/api/timesheets/client/[workspaceClientId]/reviewers.get.ts +10 -0
- package/server/api/timesheets/client/[workspaceClientId]/reviewers.put.ts +18 -0
- package/server/api/timesheets/client/[workspaceClientId]/reviews/[submissionId].post.ts +18 -0
- package/server/api/timesheets/client/approval-members.get.ts +11 -0
- package/server/api/timesheets/client/approval-suppliers.get.ts +8 -0
- package/server/api/timesheets/client/approvals.get.ts +14 -0
- package/server/api/timesheets/client/reviewer-suppliers.get.ts +10 -0
- package/server/api/timesheets/client/supplier-options.get.ts +14 -0
- package/server/api/timesheets/client/supplier-timesheets.get.ts +17 -0
- package/server/api/timesheets/client/workspaces.get.ts +11 -0
- package/server/api/timesheets/client-approvals.get.ts +18 -0
- package/server/api/timesheets/dashboard.get.ts +191 -0
- package/server/api/timesheets/entries/[id].delete.ts +18 -0
- package/server/api/timesheets/entries/[id].patch.ts +23 -0
- package/server/api/timesheets/entries/index.post.ts +22 -0
- package/server/api/timesheets/internal-approvals/[id].post.ts +9 -0
- package/server/api/timesheets/internal-approvals/index.get.ts +37 -0
- package/server/api/timesheets/internal-approvals/list.get.ts +12 -0
- package/server/api/timesheets/setup-status.get.ts +21 -0
- package/server/api/timesheets/submissions/[id]/client-reply.post.ts +20 -0
- package/server/api/timesheets/submissions/[id]/request-client-approval.post.ts +21 -0
- package/server/api/timesheets/submissions/[id]/resubmit.post.ts +10 -0
- package/server/api/timesheets/timer/index.delete.ts +18 -0
- package/server/api/timesheets/timer/index.post.ts +23 -0
- package/server/api/timesheets/weeks/[id]/submissions.post.ts +19 -0
- package/server/db/schema/timesheets.ts +383 -0
- package/server/plugins/client-sync.ts +30 -0
- package/server/plugins/openapi-contracts.ts +57 -0
- package/server/utils/timesheet-admin-listing.ts +281 -0
- package/server/utils/timesheet-email.ts +221 -0
- package/server/utils/timesheet-repository.ts +3096 -0
- package/server/utils/timesheet-validation.ts +231 -0
- package/shared/client-approval-dashboard.ts +17 -0
- package/shared/emails.ts +403 -0
- package/shared/feature.ts +184 -0
- package/shared/period-lock.ts +8 -0
- package/shared/submission-reply.ts +3 -0
- package/shared/timer-rounding.ts +2 -0
- package/shared/timesheet-dates.ts +23 -0
- package/shared/timesheet-errors.ts +13 -0
- package/shared/types/timesheet.ts +424 -0
- package/tokens.css +25 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @nuxt-customer-portal/timesheets
|
|
2
|
+
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- ca166fd: Extract invoices into an independent Nuxt layer and add an optional Timesheets source bridge.
|
|
8
|
+
|
|
9
|
+
This removes the legacy `/timesheets/invoices`, `/admin/timesheets/invoices`, and Timesheets invoice API routes without redirects or delegates. Use `/invoices`, `/admin/invoices`, `/api/invoices`, and `/api/invoice-timesheets` instead.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @nuxt-customer-portal/clients@0.3.0
|
|
14
|
+
- @nuxt-customer-portal/core@0.3.0
|
|
15
|
+
- @nuxt-customer-portal/organizations@0.3.0
|
|
16
|
+
- @nuxt-customer-portal/ui@0.3.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nuxt Customer Portal contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Timesheets layer
|
|
2
|
+
|
|
3
|
+
An isolated PortalNuxt feature for weekly time entry, timers, approval, project configuration, tariffs, budgets, and reporting.
|
|
4
|
+
|
|
5
|
+
All API access is scoped to the active organization through portal-core. Feature-owned database objects live in the PostgreSQL `timesheets` schema.
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4 */
|
|
2
|
+
/* Hallmark · genre: modern-minimal · macrostructure: Workbench · theme: portal-native · enrichment: none · contrast: pass (40–41) · mobile: pass (34, 49–57) */
|
|
3
|
+
@import '../../tokens.css';
|
|
4
|
+
|
|
5
|
+
html,
|
|
6
|
+
body {
|
|
7
|
+
overflow-x: clip;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.timesheet-workbench {
|
|
11
|
+
min-width: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.timesheet-workbench button,
|
|
15
|
+
.timesheet-workbench a,
|
|
16
|
+
.timesheet-admin button,
|
|
17
|
+
.timesheet-admin a {
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.timesheet-grid {
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: minmax(16rem, 2.2fr) repeat(7, minmax(3.5rem, 0.65fr)) minmax(4rem, 0.65fr);
|
|
24
|
+
min-width: 47rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.timesheet-grid__cell {
|
|
28
|
+
min-width: 0;
|
|
29
|
+
padding: var(--timesheets-space-cell);
|
|
30
|
+
border-right: 1px solid var(--timesheets-rule);
|
|
31
|
+
border-bottom: 1px solid var(--timesheets-rule);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.timesheet-grid__cell--weekend {
|
|
35
|
+
background: var(--timesheets-color-weekend);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.timesheet-grid button:not(:disabled) {
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.timesheet-grid button:disabled {
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.timesheet-grid__cell--today {
|
|
47
|
+
background: var(--ui-primary);
|
|
48
|
+
color: var(--portal-on-primary, var(--ui-bg));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.timesheet-grid__cell--today .text-muted {
|
|
52
|
+
color: var(--portal-on-primary, var(--ui-bg));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.timesheet-grid__identity {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
gap: 0.125rem;
|
|
60
|
+
overflow-wrap: anywhere;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.timesheet-grid__client,
|
|
64
|
+
.timesheet-grid__project,
|
|
65
|
+
.timesheet-grid__activity {
|
|
66
|
+
display: block;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
white-space: normal;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.timesheet-grid__client {
|
|
72
|
+
color: var(--ui-text-muted);
|
|
73
|
+
font-size: 0.75rem;
|
|
74
|
+
line-height: 1rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.timesheet-grid__project {
|
|
78
|
+
color: var(--ui-text-highlighted);
|
|
79
|
+
font-weight: 600;
|
|
80
|
+
line-height: 1.25rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.timesheet-grid__activity {
|
|
84
|
+
color: var(--ui-primary);
|
|
85
|
+
font-size: 0.75rem;
|
|
86
|
+
line-height: 1rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.timesheet-timer {
|
|
90
|
+
border-inline-start: 3px solid var(--timesheets-color-running);
|
|
91
|
+
background: var(--timesheets-color-running-soft);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.timesheet-row-action {
|
|
95
|
+
transition:
|
|
96
|
+
opacity var(--timesheets-duration-fast) var(--timesheets-ease-out),
|
|
97
|
+
transform var(--timesheets-duration-fast) var(--timesheets-ease-out);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.timesheet-row-action:active {
|
|
101
|
+
transform: translateY(1px);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.timesheet-row-action:focus-visible {
|
|
105
|
+
outline: 3px solid var(--ui-primary);
|
|
106
|
+
outline-offset: 2px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.timesheet-grid .timesheet-row-action:disabled {
|
|
110
|
+
cursor: not-allowed;
|
|
111
|
+
background: color-mix(in srgb, var(--ui-bg-accented) 35%, var(--ui-bg));
|
|
112
|
+
color: var(--ui-text-dimmed);
|
|
113
|
+
opacity: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.timesheet-grid .timesheet-row-action:disabled:hover {
|
|
117
|
+
background: color-mix(in srgb, var(--ui-bg-accented) 35%, var(--ui-bg));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.timesheet-grid .timesheet-grid__cell--locked,
|
|
121
|
+
.timesheet-grid .timesheet-grid__cell--locked:hover,
|
|
122
|
+
.timesheet-grid .timesheet-grid__cell--locked > .timesheet-row-action:hover {
|
|
123
|
+
background: color-mix(in srgb, var(--ui-bg-accented) 35%, var(--ui-bg));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.timesheet-mobile {
|
|
127
|
+
overflow: clip;
|
|
128
|
+
border: 1px solid var(--timesheets-rule);
|
|
129
|
+
border-radius: var(--timesheets-radius);
|
|
130
|
+
background: var(--ui-bg);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.timesheet-mobile__loading,
|
|
134
|
+
.timesheet-mobile__empty {
|
|
135
|
+
display: grid;
|
|
136
|
+
min-height: 9rem;
|
|
137
|
+
place-items: center;
|
|
138
|
+
padding: 1.5rem;
|
|
139
|
+
text-align: center;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.timesheet-mobile__empty {
|
|
143
|
+
align-content: center;
|
|
144
|
+
gap: 0.5rem;
|
|
145
|
+
color: var(--ui-text-muted);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.timesheet-mobile__empty span {
|
|
149
|
+
max-width: 18rem;
|
|
150
|
+
color: var(--ui-text-muted);
|
|
151
|
+
font-size: 0.8125rem;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.timesheet-mobile__days {
|
|
155
|
+
display: grid;
|
|
156
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
157
|
+
border-block-end: 1px solid var(--timesheets-rule);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.timesheet-mobile__day {
|
|
161
|
+
display: grid;
|
|
162
|
+
min-width: 0;
|
|
163
|
+
min-height: 5.25rem;
|
|
164
|
+
place-items: center;
|
|
165
|
+
align-content: center;
|
|
166
|
+
gap: 0.125rem;
|
|
167
|
+
padding: 0.5rem 0.125rem;
|
|
168
|
+
border-inline-end: 1px solid var(--timesheets-rule);
|
|
169
|
+
color: var(--ui-text-muted);
|
|
170
|
+
transition: background-color var(--timesheets-duration-fast) var(--timesheets-ease-out);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.timesheet-mobile__day:last-child {
|
|
174
|
+
border-inline-end: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.timesheet-mobile__day span,
|
|
178
|
+
.timesheet-mobile__day small {
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
max-width: 100%;
|
|
181
|
+
font-size: 0.625rem;
|
|
182
|
+
line-height: 1rem;
|
|
183
|
+
text-overflow: ellipsis;
|
|
184
|
+
white-space: nowrap;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.timesheet-mobile__day strong {
|
|
188
|
+
color: var(--ui-text-highlighted);
|
|
189
|
+
font-size: 0.875rem;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.timesheet-mobile__day small {
|
|
193
|
+
color: var(--ui-text-highlighted);
|
|
194
|
+
font-size: 0.875rem;
|
|
195
|
+
font-weight: 600;
|
|
196
|
+
line-height: 1.25rem;
|
|
197
|
+
font-variant-numeric: tabular-nums;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.timesheet-mobile__day--weekend {
|
|
201
|
+
background: var(--timesheets-color-weekend);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.timesheet-mobile__day--active {
|
|
205
|
+
background: var(--ui-primary);
|
|
206
|
+
color: var(--portal-on-primary, var(--ui-bg));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.timesheet-mobile__day--active strong,
|
|
210
|
+
.timesheet-mobile__day--active small {
|
|
211
|
+
color: var(--portal-on-primary, var(--ui-bg));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.timesheet-mobile__day:focus-visible,
|
|
215
|
+
.timesheet-mobile__entry:focus-visible {
|
|
216
|
+
position: relative;
|
|
217
|
+
z-index: 1;
|
|
218
|
+
outline: 3px solid var(--ui-primary);
|
|
219
|
+
outline-offset: -3px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.timesheet-mobile__summary {
|
|
223
|
+
display: flex;
|
|
224
|
+
min-width: 0;
|
|
225
|
+
align-items: center;
|
|
226
|
+
justify-content: space-between;
|
|
227
|
+
gap: 1rem;
|
|
228
|
+
padding: 1rem;
|
|
229
|
+
border-block-end: 1px solid var(--timesheets-rule);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.timesheet-mobile__date,
|
|
233
|
+
.timesheet-mobile__total {
|
|
234
|
+
color: var(--ui-text-highlighted);
|
|
235
|
+
font-weight: 650;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.timesheet-mobile__day-total {
|
|
239
|
+
display: grid;
|
|
240
|
+
justify-items: end;
|
|
241
|
+
gap: 0.125rem;
|
|
242
|
+
text-align: end;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.timesheet-mobile__day-total > span {
|
|
246
|
+
color: var(--ui-text-muted);
|
|
247
|
+
font-size: 0.6875rem;
|
|
248
|
+
font-weight: 500;
|
|
249
|
+
line-height: 1rem;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.timesheet-mobile__total {
|
|
253
|
+
font-size: 1.25rem;
|
|
254
|
+
line-height: 1.5rem;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.timesheet-mobile__total,
|
|
258
|
+
.timesheet-mobile__duration {
|
|
259
|
+
font-variant-numeric: tabular-nums;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.timesheet-mobile__entries {
|
|
263
|
+
display: grid;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.timesheet-mobile__entry {
|
|
267
|
+
display: grid;
|
|
268
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
269
|
+
min-width: 0;
|
|
270
|
+
min-height: 4.75rem;
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: 0.75rem;
|
|
273
|
+
padding: 0.875rem 1rem;
|
|
274
|
+
border-block-end: 1px solid var(--timesheets-rule);
|
|
275
|
+
text-align: start;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
button.timesheet-mobile__entry {
|
|
279
|
+
cursor: pointer;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.timesheet-mobile__entry-copy {
|
|
283
|
+
display: grid;
|
|
284
|
+
min-width: 0;
|
|
285
|
+
gap: 0.125rem;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.timesheet-mobile__entry-copy small,
|
|
289
|
+
.timesheet-mobile__entry-copy strong,
|
|
290
|
+
.timesheet-mobile__entry-copy span {
|
|
291
|
+
overflow: hidden;
|
|
292
|
+
text-overflow: ellipsis;
|
|
293
|
+
white-space: nowrap;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.timesheet-mobile__entry-copy small {
|
|
297
|
+
color: var(--ui-text-muted);
|
|
298
|
+
font-size: 0.75rem;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.timesheet-mobile__entry-copy strong {
|
|
302
|
+
color: var(--ui-text-highlighted);
|
|
303
|
+
font-size: 1rem;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.timesheet-mobile__entry-activity {
|
|
307
|
+
color: var(--ui-text-muted);
|
|
308
|
+
font-size: 0.875rem;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.timesheet-mobile__entry-copy .timesheet-mobile__entry-note {
|
|
312
|
+
margin-block-start: 0.125rem;
|
|
313
|
+
color: var(--ui-text-muted);
|
|
314
|
+
font-size: 0.75rem;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.timesheet-mobile__entry-meta {
|
|
318
|
+
display: flex;
|
|
319
|
+
flex-direction: column;
|
|
320
|
+
align-items: flex-end;
|
|
321
|
+
gap: 0.5rem;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.timesheet-mobile__edit-cue {
|
|
325
|
+
width: 0.875rem;
|
|
326
|
+
height: 0.875rem;
|
|
327
|
+
color: var(--ui-primary);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.timesheet-mobile__duration {
|
|
331
|
+
color: var(--ui-text-highlighted);
|
|
332
|
+
font-size: 1.125rem;
|
|
333
|
+
font-weight: 650;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.timesheet-mobile__add {
|
|
337
|
+
margin: 0.75rem 1rem;
|
|
338
|
+
justify-self: start;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.timesheet-mobile button:disabled {
|
|
342
|
+
cursor: not-allowed;
|
|
343
|
+
opacity: 0.55;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
@media (hover: hover) and (pointer: fine) {
|
|
347
|
+
.timesheet-mobile__day:hover,
|
|
348
|
+
button.timesheet-mobile__entry:hover {
|
|
349
|
+
background: var(--ui-bg-elevated);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.timesheet-mobile__day--active:hover {
|
|
353
|
+
background: var(--ui-primary);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
@media (pointer: coarse) {
|
|
358
|
+
.timesheet-mobile button {
|
|
359
|
+
min-height: 3rem;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
@media (prefers-reduced-motion: reduce) {
|
|
364
|
+
.timesheet-row-action,
|
|
365
|
+
.timesheet-mobile__day {
|
|
366
|
+
transition-duration: 0ms;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
export interface TimesheetsActivityFormModel {
|
|
5
|
+
name: string
|
|
6
|
+
billable: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
defineProps<{
|
|
10
|
+
editing: boolean
|
|
11
|
+
busy: boolean
|
|
12
|
+
showCancel: boolean
|
|
13
|
+
}>()
|
|
14
|
+
const emit = defineEmits<{
|
|
15
|
+
submit: []
|
|
16
|
+
cancel: []
|
|
17
|
+
}>()
|
|
18
|
+
const form = defineModel<TimesheetsActivityFormModel>({ required: true })
|
|
19
|
+
const { t } = useI18n()
|
|
20
|
+
const schema = computed(() =>
|
|
21
|
+
z.object({
|
|
22
|
+
name: z.string().trim().min(2, t('features.timesheets.validation.activityNameLength')).max(120),
|
|
23
|
+
billable: z.boolean()
|
|
24
|
+
})
|
|
25
|
+
)
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<UCard>
|
|
30
|
+
<template #header>
|
|
31
|
+
<div class="flex items-center justify-between gap-3">
|
|
32
|
+
<h2 class="font-semibold">
|
|
33
|
+
{{ editing ? t('features.timesheets.admin.editActivity') : t('features.timesheets.admin.newActivity') }}
|
|
34
|
+
</h2>
|
|
35
|
+
<UButton
|
|
36
|
+
v-if="editing"
|
|
37
|
+
type="button"
|
|
38
|
+
color="neutral"
|
|
39
|
+
variant="ghost"
|
|
40
|
+
icon="i-lucide-x"
|
|
41
|
+
:aria-label="t('features.timesheets.admin.close')"
|
|
42
|
+
@click="emit('cancel')"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<UForm :state="form" :schema="schema" class="space-y-4" @submit="emit('submit')">
|
|
47
|
+
<UFormField name="name" :label="t('features.timesheets.fields.activity')" required>
|
|
48
|
+
<UInput v-model="form.name" class="w-full" />
|
|
49
|
+
</UFormField>
|
|
50
|
+
<UCheckbox v-model="form.billable" :label="t('features.timesheets.billable')" />
|
|
51
|
+
<div class="flex justify-end gap-2">
|
|
52
|
+
<UButton v-if="showCancel" type="button" color="neutral" variant="outline" @click="emit('cancel')">
|
|
53
|
+
{{ t('features.timesheets.cancel') }}
|
|
54
|
+
</UButton>
|
|
55
|
+
<UButton type="submit" :loading="busy">
|
|
56
|
+
{{ editing ? t('features.timesheets.save') : t('features.timesheets.admin.createActivity') }}
|
|
57
|
+
</UButton>
|
|
58
|
+
</div>
|
|
59
|
+
</UForm>
|
|
60
|
+
</UCard>
|
|
61
|
+
</template>
|