@happyvertical/smrt-projects 0.52.0 → 0.53.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/AGENTS.md +20 -9
- package/README.md +13 -1
- package/SERVICE_TIME_MIGRATION.md +45 -3
- package/dist/index.js +123 -586
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +3 -1484
- package/dist/models/service-evidence.d.ts +13 -92
- package/dist/models/service-evidence.d.ts.map +1 -1
- package/dist/playground.js +2 -2
- package/dist/playground.js.map +1 -1
- package/dist/services/service-evidence-service.d.ts +6 -55
- package/dist/services/service-evidence-service.d.ts.map +1 -1
- package/dist/services/subscription-commercial-resolver.d.ts +1 -1
- package/dist/services/subscription-commercial-resolver.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +10 -1068
- package/dist/svelte/components/ApprovalActions.svelte +1 -1
- package/dist/svelte/components/ApprovalActions.svelte.d.ts +1 -1
- package/dist/svelte/components/ApprovalActions.svelte.d.ts.map +1 -1
- package/dist/svelte/components/__tests__/TimesheetsReexports.test.js +18 -0
- package/dist/svelte/i18n.d.ts +0 -9
- package/dist/svelte/i18n.d.ts.map +1 -1
- package/dist/svelte/i18n.js +0 -9
- package/dist/svelte/index.d.ts +2 -8
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +3 -4
- package/dist/svelte/playground.d.ts +7 -2
- package/dist/svelte/playground.d.ts.map +1 -1
- package/dist/svelte/playground.js +7 -2
- package/dist/svelte/utils.d.ts +4 -48
- package/dist/svelte/utils.d.ts.map +1 -1
- package/dist/svelte/utils.js +4 -56
- package/dist/svelte/utils.test.js +1 -1
- package/dist/types.d.ts +1 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +18 -18
- package/dist/svelte/components/DurationDisplay.svelte +0 -81
- package/dist/svelte/components/DurationDisplay.svelte.d.ts +0 -20
- package/dist/svelte/components/DurationDisplay.svelte.d.ts.map +0 -1
- package/dist/svelte/components/TimeEntryCard.svelte +0 -304
- package/dist/svelte/components/TimeEntryCard.svelte.d.ts +0 -25
- package/dist/svelte/components/TimeEntryCard.svelte.d.ts.map +0 -1
- package/dist/svelte/components/TimeEntryList.svelte +0 -360
- package/dist/svelte/components/TimeEntryList.svelte.d.ts +0 -24
- package/dist/svelte/components/TimeEntryList.svelte.d.ts.map +0 -1
- package/dist/svelte/components/TimeSummary.svelte +0 -176
- package/dist/svelte/components/TimeSummary.svelte.d.ts +0 -30
- package/dist/svelte/components/TimeSummary.svelte.d.ts.map +0 -1
- package/dist/svelte/components/__tests__/DurationDisplay.test.js +0 -57
- package/dist/svelte/components/__tests__/TimeEntryCard.test.js +0 -45
- package/dist/svelte/components/__tests__/TimeEntryList.test.js +0 -50
- package/dist/svelte/components/__tests__/TimeSummary.test.js +0 -39
- package/dist/svelte/components/utils.d.ts +0 -51
- package/dist/svelte/components/utils.d.ts.map +0 -1
- package/dist/svelte/components/utils.js +0 -58
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
8
8
|
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
9
9
|
import { M } from '../i18n.js';
|
|
10
|
-
import type { ApprovalStatus } from '
|
|
10
|
+
import type { ApprovalStatus } from '../utils.js';
|
|
11
11
|
|
|
12
12
|
const { t } = useI18n();
|
|
13
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalActions.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ApprovalActions.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ApprovalActions.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ApprovalActions.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,0CAA0C;AAC1C,MAAM,WAAW,KAAK;IACpB,wCAAwC;IACxC,MAAM,EAAE,cAAc,CAAC;IACvB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACpC;AAkFD,QAAA,MAAM,eAAe,2CAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
/**
|
|
3
|
+
* #3288: the time-entry components moved to smrt-timesheets and stay
|
|
4
|
+
* importable from `@happyvertical/smrt-projects/svelte` under the same names.
|
|
5
|
+
*/
|
|
6
|
+
import * as timesheets from '@happyvertical/smrt-timesheets/svelte';
|
|
7
|
+
import { describe, expect, it } from 'vitest';
|
|
8
|
+
import * as projects from '../../index.js';
|
|
9
|
+
describe('smrt-projects/svelte time-entry re-exports', () => {
|
|
10
|
+
it('re-exports the moved components and helpers unchanged', () => {
|
|
11
|
+
expect(projects.TimeEntryList).toBe(timesheets.TimeEntryList);
|
|
12
|
+
expect(projects.TimeEntryCard).toBe(timesheets.TimeEntryCard);
|
|
13
|
+
expect(projects.TimeSummary).toBe(timesheets.TimeSummary);
|
|
14
|
+
expect(projects.DurationDisplay).toBe(timesheets.DurationDisplay);
|
|
15
|
+
expect(projects.formatCurrency).toBe(timesheets.formatCurrency);
|
|
16
|
+
expect(projects.formatHoursHHMM).toBe(timesheets.formatHoursHHMM);
|
|
17
|
+
});
|
|
18
|
+
});
|
package/dist/svelte/i18n.d.ts
CHANGED
|
@@ -37,14 +37,5 @@ export declare const M: {
|
|
|
37
37
|
readonly 'projects.bulk_actions.reject_all': "projects.bulk_actions.reject_all";
|
|
38
38
|
readonly 'projects.reject_dialog.reason_required': "projects.reject_dialog.reason_required";
|
|
39
39
|
readonly 'projects.reject_dialog.close_dialog': "projects.reject_dialog.close_dialog";
|
|
40
|
-
readonly 'projects.time_entry_card.mileage': "projects.time_entry_card.mileage";
|
|
41
|
-
readonly 'projects.time_entry_card.select_entry': "projects.time_entry_card.select_entry";
|
|
42
|
-
readonly 'projects.time_entry_list.select_all': "projects.time_entry_list.select_all";
|
|
43
|
-
readonly 'projects.time_entry_list.selection_count': "projects.time_entry_list.selection_count";
|
|
44
|
-
readonly 'projects.time_entry_list.select_all_aria': "projects.time_entry_list.select_all_aria";
|
|
45
|
-
readonly 'projects.time_entry_list.select_entry_aria': "projects.time_entry_list.select_entry_aria";
|
|
46
|
-
readonly 'projects.time_summary.total_hours': "projects.time_summary.total_hours";
|
|
47
|
-
readonly 'projects.time_summary.total_value': "projects.time_summary.total_value";
|
|
48
|
-
readonly 'projects.time_summary.pending_approval': "projects.time_summary.pending_approval";
|
|
49
40
|
};
|
|
50
41
|
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCZ,CAAC"}
|
package/dist/svelte/i18n.js
CHANGED
|
@@ -38,13 +38,4 @@ export const M = defineMessages({
|
|
|
38
38
|
'projects.bulk_actions.reject_all': 'Reject All',
|
|
39
39
|
'projects.reject_dialog.reason_required': 'A reason is required to reject',
|
|
40
40
|
'projects.reject_dialog.close_dialog': 'Close dialog',
|
|
41
|
-
'projects.time_entry_card.mileage': '+ {mileage} km mileage',
|
|
42
|
-
'projects.time_entry_card.select_entry': 'Select time entry for {description}',
|
|
43
|
-
'projects.time_entry_list.select_all': 'Select All',
|
|
44
|
-
'projects.time_entry_list.selection_count': '{selected} of {total} selected',
|
|
45
|
-
'projects.time_entry_list.select_all_aria': 'Select all time entries',
|
|
46
|
-
'projects.time_entry_list.select_entry_aria': 'Select entry: {description}',
|
|
47
|
-
'projects.time_summary.total_hours': 'Total Hours',
|
|
48
|
-
'projects.time_summary.total_value': 'Total Value',
|
|
49
|
-
'projects.time_summary.pending_approval': 'Pending Approval',
|
|
50
41
|
});
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -6,17 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
+
import { DurationDisplay, TimeEntryCard, TimeEntryList, TimeSummary } from '@happyvertical/smrt-timesheets/svelte';
|
|
9
10
|
import type { ComponentProps } from 'svelte';
|
|
10
11
|
import AssistanceLauncher from './AssistanceLauncher.svelte';
|
|
11
12
|
import ApprovalActions from './components/ApprovalActions.svelte';
|
|
12
13
|
import BulkActions from './components/BulkActions.svelte';
|
|
13
14
|
import DevelopmentRequestForm from './components/DevelopmentRequestForm.svelte';
|
|
14
15
|
import DevelopmentRequestList from './components/DevelopmentRequestList.svelte';
|
|
15
|
-
import DurationDisplay from './components/DurationDisplay.svelte';
|
|
16
16
|
import RejectDialog from './components/RejectDialog.svelte';
|
|
17
|
-
import TimeEntryCard from './components/TimeEntryCard.svelte';
|
|
18
|
-
import TimeEntryList from './components/TimeEntryList.svelte';
|
|
19
|
-
import TimeSummary from './components/TimeSummary.svelte';
|
|
20
17
|
import DeliveryStatus from './DeliveryStatus.svelte';
|
|
21
18
|
import DevelopmentBoard from './DevelopmentBoard.svelte';
|
|
22
19
|
import DevelopmentRequestDetail from './DevelopmentRequestDetail.svelte';
|
|
@@ -32,14 +29,11 @@ export type DevelopmentBoardProps = ComponentProps<typeof DevelopmentBoard>;
|
|
|
32
29
|
export type DevelopmentRequestFormProps = ComponentProps<typeof DevelopmentRequestForm>;
|
|
33
30
|
export type DevelopmentRequestDetailProps = ComponentProps<typeof DevelopmentRequestDetail>;
|
|
34
31
|
export type DevelopmentRequestListProps = ComponentProps<typeof DevelopmentRequestList>;
|
|
35
|
-
export type DurationDisplayProps = ComponentProps<typeof DurationDisplay>;
|
|
36
32
|
export type RejectDialogProps = ComponentProps<typeof RejectDialog>;
|
|
37
33
|
export type PreviewApprovalPanelProps = ComponentProps<typeof PreviewApprovalPanel>;
|
|
38
34
|
export type ProjectBoardProps = ComponentProps<typeof ProjectBoard>;
|
|
39
35
|
export type ServiceEvidenceListProps = ComponentProps<typeof ServiceEvidenceList>;
|
|
40
|
-
export type TimeEntryCardProps
|
|
41
|
-
export type TimeEntryListProps = ComponentProps<typeof TimeEntryList>;
|
|
42
|
-
export type TimeSummaryProps = ComponentProps<typeof TimeSummary>;
|
|
36
|
+
export type { DurationDisplayProps, TimeEntryCardProps, TimeEntryListProps, TimeSummaryProps, } from '@happyvertical/smrt-timesheets/svelte';
|
|
43
37
|
export * from './delivery-types.js';
|
|
44
38
|
export type { ProjectBoardMoveIntent } from './project-board-types.js';
|
|
45
39
|
export { type ApprovalStatus, type Currency, formatCurrency, formatDate, formatHours, formatHoursHHMM, statusColors, type TimeEntry, type TimeEntryStatus, } from './utils.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA;;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A2B,GAAG,cAAc,CACtD,OAAO,sBAAsB,CAC9B,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CACxD,OAAO,wBAAwB,CAChC,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG,cAAc,CACtD,OAAO,sBAAsB,CAC9B,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AACpE,MAAM,MAAM,yBAAyB,GAAG,cAAc,CACpD,OAAO,oBAAoB,CAC5B,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AACpE,MAAM,MAAM,wBAAwB,GAAG,cAAc,CACnD,OAAO,mBAAmB,CAC3B,CAAC;AACF,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAE/C,cAAc,qBAAqB,CAAC;AACpC,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC"}
|
package/dist/svelte/index.js
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
+
// The time-entry components moved to smrt-timesheets (#3288); they stay
|
|
10
|
+
// exported and registered here under their original names and slots.
|
|
11
|
+
import { DurationDisplay, TimeEntryCard, TimeEntryList, TimeSummary, } from '@happyvertical/smrt-timesheets/svelte';
|
|
9
12
|
import { ModuleUIRegistry } from '@happyvertical/smrt-ui/registry';
|
|
10
13
|
import { PROJECTS_MODULE_META } from '../ui.js';
|
|
11
14
|
import AssistanceLauncher from './AssistanceLauncher.svelte';
|
|
@@ -14,11 +17,7 @@ import ApprovalActions from './components/ApprovalActions.svelte';
|
|
|
14
17
|
import BulkActions from './components/BulkActions.svelte';
|
|
15
18
|
import DevelopmentRequestForm from './components/DevelopmentRequestForm.svelte';
|
|
16
19
|
import DevelopmentRequestList from './components/DevelopmentRequestList.svelte';
|
|
17
|
-
import DurationDisplay from './components/DurationDisplay.svelte';
|
|
18
20
|
import RejectDialog from './components/RejectDialog.svelte';
|
|
19
|
-
import TimeEntryCard from './components/TimeEntryCard.svelte';
|
|
20
|
-
import TimeEntryList from './components/TimeEntryList.svelte';
|
|
21
|
-
import TimeSummary from './components/TimeSummary.svelte';
|
|
22
21
|
import DeliveryStatus from './DeliveryStatus.svelte';
|
|
23
22
|
import DevelopmentBoard from './DevelopmentBoard.svelte';
|
|
24
23
|
import DevelopmentRequestDetail from './DevelopmentRequestDetail.svelte';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TimeEntryList, TimeSummary } from '@happyvertical/smrt-timesheets/svelte';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
packageName: string;
|
|
3
4
|
displayName: string;
|
|
@@ -94,7 +95,9 @@ declare const _default: {
|
|
|
94
95
|
id: string;
|
|
95
96
|
title: string;
|
|
96
97
|
description: string;
|
|
97
|
-
loadComponent: () => Promise<
|
|
98
|
+
loadComponent: () => Promise<{
|
|
99
|
+
default: typeof TimeEntryList;
|
|
100
|
+
}>;
|
|
98
101
|
order: number;
|
|
99
102
|
props: {
|
|
100
103
|
entries: ({
|
|
@@ -149,7 +152,9 @@ declare const _default: {
|
|
|
149
152
|
id: string;
|
|
150
153
|
title: string;
|
|
151
154
|
description: string;
|
|
152
|
-
loadComponent: () => Promise<
|
|
155
|
+
loadComponent: () => Promise<{
|
|
156
|
+
default: typeof TimeSummary;
|
|
157
|
+
}>;
|
|
153
158
|
order: number;
|
|
154
159
|
props: {
|
|
155
160
|
totalHours: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../src/svelte/playground.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../src/svelte/playground.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACZ,MAAM,uCAAuC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAsDjB,OAAO,CAAC;YAAE,OAAO,EAAE,OAAO,aAAa,CAAA;SAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAI5C,OAAO,CAAC;YAAE,OAAO,EAAE,OAAO,WAAW,CAAA;SAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOpE,wBA4HE"}
|
|
@@ -38,8 +38,13 @@ const totalHours = sampleTimeEntries.reduce((sum, entry) => sum + entry.hours, 0
|
|
|
38
38
|
const totalAmount = sampleTimeEntries.reduce((sum, entry) => sum + (entry.amount ?? 0), 0);
|
|
39
39
|
const pendingEntries = sampleTimeEntries.filter((entry) => entry.status === 'submitted');
|
|
40
40
|
const loadApprovalActions = () => import('./components/ApprovalActions.svelte');
|
|
41
|
-
|
|
42
|
-
const
|
|
41
|
+
// The time-entry components live in smrt-timesheets (#3288).
|
|
42
|
+
const loadTimeEntryList = () => import('@happyvertical/smrt-timesheets/svelte').then((module) => ({
|
|
43
|
+
default: module.TimeEntryList,
|
|
44
|
+
}));
|
|
45
|
+
const loadTimeSummary = () => import('@happyvertical/smrt-timesheets/svelte').then((module) => ({
|
|
46
|
+
default: module.TimeSummary,
|
|
47
|
+
}));
|
|
43
48
|
const loadDevelopmentBoard = () => import('./DevelopmentBoard.svelte');
|
|
44
49
|
const loadProjectBoard = () => import('./ProjectBoard.svelte');
|
|
45
50
|
export default {
|
package/dist/svelte/utils.d.ts
CHANGED
|
@@ -1,51 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared utilities for time tracking components
|
|
2
|
+
* Shared utilities for time tracking components. They moved to
|
|
3
|
+
* `@happyvertical/smrt-timesheets/svelte` with the components (#3288) and are
|
|
4
|
+
* re-exported here unchanged.
|
|
3
5
|
*/
|
|
4
|
-
export type Currency
|
|
5
|
-
export type TimeEntryStatus = 'draft' | 'submitted' | 'approved' | 'rejected';
|
|
6
|
-
/** Alias for TimeEntryStatus for approval workflows */
|
|
7
|
-
export type ApprovalStatus = TimeEntryStatus;
|
|
8
|
-
/**
|
|
9
|
-
* Time entry data structure
|
|
10
|
-
*/
|
|
11
|
-
export interface TimeEntry {
|
|
12
|
-
id: string;
|
|
13
|
-
date: Date | string;
|
|
14
|
-
hours: number;
|
|
15
|
-
description: string;
|
|
16
|
-
status: TimeEntryStatus;
|
|
17
|
-
/** Integer minor units of the display currency — $19.99 is 1999 (#2401). */
|
|
18
|
-
amount?: number;
|
|
19
|
-
workerName?: string;
|
|
20
|
-
mileage?: number;
|
|
21
|
-
/** Minor units per hour, so `hours * hourlyRate` is minor units (#2401). */
|
|
22
|
-
hourlyRate?: number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Status color mapping using M3 design tokens
|
|
26
|
-
*/
|
|
27
|
-
export declare const statusColors: Record<TimeEntryStatus, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Format a date for display (e.g., "Jan 5")
|
|
30
|
-
*/
|
|
31
|
-
export declare function formatDate(date: Date | string): string;
|
|
32
|
-
/**
|
|
33
|
-
* Format a minor-units amount for display.
|
|
34
|
-
*
|
|
35
|
-
* Money in this package is integer minor units (#2401) — `$19.99` is `1999` —
|
|
36
|
-
* and `Intl.NumberFormat` expects major units, so the scale is undone here.
|
|
37
|
-
* Without it a $19.99 charge renders as $1,999.00.
|
|
38
|
-
*
|
|
39
|
-
* The currency's own minor-unit exponent is used rather than a hard-coded 100,
|
|
40
|
-
* so zero-decimal currencies (JPY, KRW) are not divided by anything.
|
|
41
|
-
*/
|
|
42
|
-
export declare function formatCurrency(amount: number, currency?: Currency): string;
|
|
43
|
-
/**
|
|
44
|
-
* Format hours for display (e.g., "8.5h")
|
|
45
|
-
*/
|
|
46
|
-
export declare function formatHours(hours: number): string;
|
|
47
|
-
/**
|
|
48
|
-
* Format hours in HH:MM format (e.g., "8:30")
|
|
49
|
-
*/
|
|
50
|
-
export declare function formatHoursHHMM(hours: number): string;
|
|
6
|
+
export { type ApprovalStatus, type Currency, formatCurrency, formatDate, formatHours, formatHoursHHMM, statusColors, type TimeEntry, type TimeEntryStatus, } from '@happyvertical/smrt-timesheets/svelte';
|
|
51
7
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/svelte/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/svelte/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,uCAAuC,CAAC"}
|
package/dist/svelte/utils.js
CHANGED
|
@@ -1,58 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared utilities for time tracking components
|
|
2
|
+
* Shared utilities for time tracking components. They moved to
|
|
3
|
+
* `@happyvertical/smrt-timesheets/svelte` with the components (#3288) and are
|
|
4
|
+
* re-exported here unchanged.
|
|
3
5
|
*/
|
|
4
|
-
|
|
5
|
-
* Status color mapping using M3 design tokens
|
|
6
|
-
*/
|
|
7
|
-
export const statusColors = {
|
|
8
|
-
draft: 'var(--md-sys-color-outline)',
|
|
9
|
-
submitted: 'var(--md-sys-color-tertiary)',
|
|
10
|
-
approved: 'var(--md-sys-color-primary)',
|
|
11
|
-
rejected: 'var(--md-sys-color-error)',
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Format a date for display (e.g., "Jan 5")
|
|
15
|
-
*/
|
|
16
|
-
export function formatDate(date) {
|
|
17
|
-
const d = typeof date === 'string' ? new Date(date) : date;
|
|
18
|
-
return d.toLocaleDateString('en-CA', { month: 'short', day: 'numeric' });
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Format a minor-units amount for display.
|
|
22
|
-
*
|
|
23
|
-
* Money in this package is integer minor units (#2401) — `$19.99` is `1999` —
|
|
24
|
-
* and `Intl.NumberFormat` expects major units, so the scale is undone here.
|
|
25
|
-
* Without it a $19.99 charge renders as $1,999.00.
|
|
26
|
-
*
|
|
27
|
-
* The currency's own minor-unit exponent is used rather than a hard-coded 100,
|
|
28
|
-
* so zero-decimal currencies (JPY, KRW) are not divided by anything.
|
|
29
|
-
*/
|
|
30
|
-
export function formatCurrency(amount, currency = 'CAD') {
|
|
31
|
-
// No fraction-digit override: the currency's own exponent is both the scale
|
|
32
|
-
// to undo and the precision to print. Forcing `minimumFractionDigits: 2`
|
|
33
|
-
// (as this did before minor units) would pin `maximumFractionDigits` to 2 as
|
|
34
|
-
// well, so a zero-decimal currency like JPY would report a scale of 2 — and
|
|
35
|
-
// then render `¥1,999.00` for a currency that has no fractional part at all.
|
|
36
|
-
// For CAD/USD the resolved default is already 2, so their output is
|
|
37
|
-
// unchanged.
|
|
38
|
-
const format = new Intl.NumberFormat('en-CA', {
|
|
39
|
-
style: 'currency',
|
|
40
|
-
currency,
|
|
41
|
-
});
|
|
42
|
-
const digits = format.resolvedOptions().maximumFractionDigits ?? 2;
|
|
43
|
-
return format.format(amount / 10 ** digits);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Format hours for display (e.g., "8.5h")
|
|
47
|
-
*/
|
|
48
|
-
export function formatHours(hours) {
|
|
49
|
-
return `${hours.toFixed(1)}h`;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Format hours in HH:MM format (e.g., "8:30")
|
|
53
|
-
*/
|
|
54
|
-
export function formatHoursHHMM(hours) {
|
|
55
|
-
const h = Math.floor(hours);
|
|
56
|
-
const m = Math.round((hours - h) * 60);
|
|
57
|
-
return `${h}:${m.toString().padStart(2, '0')}`;
|
|
58
|
-
}
|
|
6
|
+
export { formatCurrency, formatDate, formatHours, formatHoursHHMM, statusColors, } from '@happyvertical/smrt-timesheets/svelte';
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* pins the resolved exponent to 2, both mis-render every currency that does not
|
|
9
9
|
* have exactly two decimal places.
|
|
10
10
|
*/
|
|
11
|
+
import { formatCurrency as formatCurrencyFromComponents } from '@happyvertical/smrt-timesheets/svelte';
|
|
11
12
|
import { describe, expect, it } from 'vitest';
|
|
12
|
-
import { formatCurrency as formatCurrencyFromComponents } from './components/utils.js';
|
|
13
13
|
import { formatCurrency } from './utils.js';
|
|
14
14
|
describe('formatCurrency (#2401)', () => {
|
|
15
15
|
it('renders a two-decimal currency by undoing the cent scale', () => {
|
package/dist/types.d.ts
CHANGED
|
@@ -113,16 +113,7 @@ export interface DevelopmentRequestTransitionInput {
|
|
|
113
113
|
export type DevelopmentTriageDecision = 'accept' | 'decline' | 'merge' | 'split';
|
|
114
114
|
export type DeliveryEventType = 'work_linked' | 'branch' | 'pull_request' | 'ci' | 'preview' | 'approval' | 'deployment' | 'completed' | 'rejected';
|
|
115
115
|
export type AssistanceClassification = 'unclassified' | 'support' | 'development' | 'both';
|
|
116
|
-
export type
|
|
117
|
-
export type ServiceTimeEntryStatus = 'draft' | 'submitted' | 'approved' | 'rejected' | 'corrected';
|
|
118
|
-
export type ServiceParticipantKind = 'human' | 'agent';
|
|
119
|
-
export interface ServiceEvidence {
|
|
120
|
-
kind: string;
|
|
121
|
-
ref?: string;
|
|
122
|
-
summary?: string;
|
|
123
|
-
capturedAt?: string;
|
|
124
|
-
[key: string]: unknown;
|
|
125
|
-
}
|
|
116
|
+
export type { ServiceEvidence, ServiceParticipantKind, ServiceTimeEntrySource, ServiceTimeEntryStatus, } from '@happyvertical/smrt-timesheets';
|
|
126
117
|
export interface ManagedAssistanceRequestInput {
|
|
127
118
|
requesterId: string;
|
|
128
119
|
subject: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,KAAK,IAAI,YAAY,EACrB,WAAW,IAAI,kBAAkB,EACjC,QAAQ,EACR,WAAW,EACX,OAAO,IAAI,UAAU,EACrB,aAAa,EACb,WAAW,EACX,MAAM,IAAI,aAAa,GACxB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,MAAM,EACN,OAAO,IAAI,UAAU,EACrB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,KAAK,IAAI,QAAQ,EACjB,KAAK,IAAI,QAAQ,EACjB,WAAW,EACX,WAAW,IAAI,cAAc,EAC7B,UAAU,IAAI,aAAa,EAC3B,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,IAAI,GACL,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,OAAO,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,EAAE,MAAM,CAAC;IACzB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WA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AAC;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,yBAAyB,GACjC,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,QAAQ,GACR,cAAc,GACd,IAAI,GACJ,SAAS,GACT,UAAU,GACV,YAAY,GACZ,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,MAAM,wBAAwB,GAChC,cAAc,GACd,SAAS,GACT,aAAa,GACb,MAAM,CAAC;AAGX,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,6BAA6B;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,0BAA0B,EAAE,CAAC;CACzC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-projects",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Provider-agnostic project management models (Issues, PRs, Repositories, Projects) for SMRT framework",
|
|
6
6
|
"type": "module",
|
|
@@ -35,20 +35,21 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@happyvertical/ai": "^0.
|
|
39
|
-
"@happyvertical/logger": "^0.
|
|
40
|
-
"@happyvertical/projects": "^0.
|
|
41
|
-
"@happyvertical/repos": "^0.
|
|
42
|
-
"@happyvertical/smrt-config": "0.
|
|
43
|
-
"@happyvertical/smrt-core": "0.
|
|
44
|
-
"@happyvertical/smrt-prompts": "0.
|
|
45
|
-
"@happyvertical/smrt-svelte": "0.
|
|
46
|
-
"@happyvertical/smrt-subscriptions": "0.
|
|
47
|
-
"@happyvertical/smrt-tenancy": "0.
|
|
48
|
-
"@happyvertical/smrt-
|
|
49
|
-
"@happyvertical/smrt-
|
|
50
|
-
"@happyvertical/
|
|
51
|
-
"@happyvertical/
|
|
38
|
+
"@happyvertical/ai": "^0.98.0",
|
|
39
|
+
"@happyvertical/logger": "^0.98.0",
|
|
40
|
+
"@happyvertical/projects": "^0.98.0",
|
|
41
|
+
"@happyvertical/repos": "^0.98.0",
|
|
42
|
+
"@happyvertical/smrt-config": "0.53.0",
|
|
43
|
+
"@happyvertical/smrt-core": "0.53.0",
|
|
44
|
+
"@happyvertical/smrt-prompts": "0.53.0",
|
|
45
|
+
"@happyvertical/smrt-svelte": "0.53.0",
|
|
46
|
+
"@happyvertical/smrt-subscriptions": "0.53.0",
|
|
47
|
+
"@happyvertical/smrt-tenancy": "0.53.0",
|
|
48
|
+
"@happyvertical/smrt-timesheets": "0.53.0",
|
|
49
|
+
"@happyvertical/smrt-types": "0.53.0",
|
|
50
|
+
"@happyvertical/smrt-ui": "0.53.0",
|
|
51
|
+
"@happyvertical/sql": "^0.98.0",
|
|
52
|
+
"@happyvertical/utils": "^0.98.0"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"svelte": "^5.57.0"
|
|
@@ -59,8 +60,8 @@
|
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@happyvertical/smrt-cli": "0.
|
|
63
|
-
"@happyvertical/smrt-vitest": "0.
|
|
63
|
+
"@happyvertical/smrt-cli": "0.53.0",
|
|
64
|
+
"@happyvertical/smrt-vitest": "0.53.0",
|
|
64
65
|
"@sveltejs/package": "^2.5.8",
|
|
65
66
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
66
67
|
"@types/node": "24.13.6",
|
|
@@ -99,7 +100,6 @@
|
|
|
99
100
|
"clean": "rm -rf dist",
|
|
100
101
|
"dev": "vite dev",
|
|
101
102
|
"test": "vitest run",
|
|
102
|
-
"test:postgres": "node ../../scripts/run-with-ci-postgres.mjs -- pnpm exec vitest run optional.test.ts",
|
|
103
103
|
"test:watch": "vitest",
|
|
104
104
|
"verify:pack": "node ../../scripts/verify-package-types-exports.js ."
|
|
105
105
|
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* DurationDisplay - Formats hours for display
|
|
4
|
-
* Supports decimal (8.5) or HH:MM (8:30) formats
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { formatHoursHHMM } from './utils.js';
|
|
8
|
-
|
|
9
|
-
/** Props for DurationDisplay component */
|
|
10
|
-
export interface Props {
|
|
11
|
-
/** Duration in hours to display. */
|
|
12
|
-
hours: number;
|
|
13
|
-
/** Format duration as decimal (8.5) or hours:minutes (8:30). */
|
|
14
|
-
format?: 'decimal' | 'hhmm';
|
|
15
|
-
/** Sets the font size of the duration display. */
|
|
16
|
-
size?: 'sm' | 'md' | 'lg';
|
|
17
|
-
/**
|
|
18
|
-
* Renders the `h` unit after a `decimal` value; set `false` for a bare
|
|
19
|
-
* number, such as in a column whose header already names the unit. An
|
|
20
|
-
* `hhmm` value spells its own unit in the `8:30` shape and never appends a
|
|
21
|
-
* separate one, so this prop does not affect that format.
|
|
22
|
-
*/
|
|
23
|
-
showLabel?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let {
|
|
27
|
-
hours,
|
|
28
|
-
format = 'decimal',
|
|
29
|
-
size = 'md',
|
|
30
|
-
showLabel = true,
|
|
31
|
-
}: Props = $props();
|
|
32
|
-
|
|
33
|
-
// $derived creates a reactive value, not a function - no wrapper or parentheses needed
|
|
34
|
-
const formattedValue = $derived(
|
|
35
|
-
format === 'hhmm' ? formatHoursHHMM(hours) : hours.toFixed(1),
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
// Only the decimal form needs a unit appended: `8:30` already reads as hours
|
|
39
|
-
// and minutes. That makes `h` the one unit `showLabel` has to gate.
|
|
40
|
-
const unit = $derived(format === 'hhmm' ? '' : 'h');
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<span class="duration" class:sm={size === 'sm'} class:lg={size === 'lg'}>
|
|
44
|
-
<span class="value">{formattedValue}</span>
|
|
45
|
-
{#if showLabel && unit}
|
|
46
|
-
<span class="unit">{unit}</span>
|
|
47
|
-
{/if}
|
|
48
|
-
</span>
|
|
49
|
-
|
|
50
|
-
<style>
|
|
51
|
-
.duration {
|
|
52
|
-
display: inline-flex;
|
|
53
|
-
align-items: baseline;
|
|
54
|
-
gap: 0.125rem;
|
|
55
|
-
font-variant-numeric: tabular-nums;
|
|
56
|
-
font-size: var(--smrt-typography-body-large-size, 1rem);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.value {
|
|
60
|
-
font-weight: var(--smrt-typography-title-medium-weight, 500);
|
|
61
|
-
color: var(--smrt-color-on-surface);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.unit {
|
|
65
|
-
font-weight: var(--smrt-typography-body-medium-weight, 400);
|
|
66
|
-
color: var(--smrt-color-on-surface-variant);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* Size variants */
|
|
70
|
-
.duration.sm {
|
|
71
|
-
font-size: var(--smrt-typography-body-medium-size, 0.875rem);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.duration.sm .value {
|
|
75
|
-
font-weight: var(--smrt-typography-body-medium-weight, 400);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.duration.lg {
|
|
79
|
-
font-size: var(--smrt-typography-headline-small-size, 1.5rem);
|
|
80
|
-
}
|
|
81
|
-
</style>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** Props for DurationDisplay component */
|
|
2
|
-
export interface Props {
|
|
3
|
-
/** Duration in hours to display. */
|
|
4
|
-
hours: number;
|
|
5
|
-
/** Format duration as decimal (8.5) or hours:minutes (8:30). */
|
|
6
|
-
format?: 'decimal' | 'hhmm';
|
|
7
|
-
/** Sets the font size of the duration display. */
|
|
8
|
-
size?: 'sm' | 'md' | 'lg';
|
|
9
|
-
/**
|
|
10
|
-
* Renders the `h` unit after a `decimal` value; set `false` for a bare
|
|
11
|
-
* number, such as in a column whose header already names the unit. An
|
|
12
|
-
* `hhmm` value spells its own unit in the `8:30` shape and never appends a
|
|
13
|
-
* separate one, so this prop does not affect that format.
|
|
14
|
-
*/
|
|
15
|
-
showLabel?: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare const DurationDisplay: import("svelte").Component<Props, {}, "">;
|
|
18
|
-
type DurationDisplay = ReturnType<typeof DurationDisplay>;
|
|
19
|
-
export default DurationDisplay;
|
|
20
|
-
//# sourceMappingURL=DurationDisplay.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DurationDisplay.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/DurationDisplay.svelte.ts"],"names":[],"mappings":"AAUA,0CAA0C;AAC1C,MAAM,WAAW,KAAK;IACpB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC5B,kDAAkD;IAClD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAmCD,QAAA,MAAM,eAAe,2CAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|