@metron-labs/quote-react 0.1.67 → 0.1.69
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/LICENSE +31 -31
- package/README.md +253 -253
- package/dist/app/QuickQuote.js +3 -1
- package/dist/app/stages/BasketStage.js +2 -11
- package/dist/app/stages/ScheduleResultsStage.js +18 -32
- package/dist/embed/quote.js +6970 -6970
- package/dist/styles.css +6961 -6961
- package/dist/util/exportScheduleExcel.js +3 -21
- package/dist/util/pricing.js +1 -1
- package/dist/util/types.d.ts +2 -13
- package/package.json +53 -53
|
@@ -17,12 +17,7 @@ const HEADER = [
|
|
|
17
17
|
"Installation clues",
|
|
18
18
|
"System clues",
|
|
19
19
|
"Component requirements",
|
|
20
|
-
"
|
|
21
|
-
"Include in quote",
|
|
22
|
-
"Approval required",
|
|
23
|
-
"Approval type",
|
|
24
|
-
"Missing information",
|
|
25
|
-
"Adjudicator confidence",
|
|
20
|
+
"Review required",
|
|
26
21
|
"Decision reason",
|
|
27
22
|
"Selected candidate ID",
|
|
28
23
|
"Selected candidate description",
|
|
@@ -36,15 +31,7 @@ const TOTAL_COL = HEADER.indexOf("Line total");
|
|
|
36
31
|
function verdictLabel(row) {
|
|
37
32
|
if (row.unmatchable)
|
|
38
33
|
return "Not matched (labour/plant/referential)";
|
|
39
|
-
|
|
40
|
-
return "Approval required";
|
|
41
|
-
if (row.decision?.include_in_quote === true)
|
|
42
|
-
return "Quoted";
|
|
43
|
-
if (row.decision?.technical_classification === "no_suitable_candidate")
|
|
44
|
-
return "No suitable candidate";
|
|
45
|
-
if (!row.best)
|
|
46
|
-
return "No match";
|
|
47
|
-
return "No match";
|
|
34
|
+
return row.best ? "Selected" : "Needs review";
|
|
48
35
|
}
|
|
49
36
|
/** Client-side export so on-screen overrides (candidate pick, qty) always match the download — mirrors exportExcel.ts for the BoQ path. */
|
|
50
37
|
export async function exportScheduleExcel(rows) {
|
|
@@ -74,12 +61,7 @@ export async function exportScheduleExcel(rows) {
|
|
|
74
61
|
item.installation_clues.join(", "),
|
|
75
62
|
item.system_clues.join(", "),
|
|
76
63
|
item.component_requirements.join(", "),
|
|
77
|
-
|
|
78
|
-
decision?.include_in_quote == null ? "" : decision.include_in_quote ? "yes" : "no",
|
|
79
|
-
decision?.approval_required == null ? "" : decision.approval_required ? "yes" : "no",
|
|
80
|
-
decision?.approval_type ?? "",
|
|
81
|
-
decision?.missing_information.join(", ") ?? "",
|
|
82
|
-
decision?.confidence ?? "",
|
|
64
|
+
best ? "no" : "yes",
|
|
83
65
|
decision?.reason ?? "",
|
|
84
66
|
unmatchable ? "-" : (best?.product_id ?? decision?.selected_candidate_id ?? "-"),
|
|
85
67
|
unmatchable ? "-" : (best?.description ?? "-"),
|
package/dist/util/pricing.js
CHANGED
|
@@ -155,7 +155,7 @@ export function getPricingBreakdown(item, options) {
|
|
|
155
155
|
requiredSellUnits: overriddenSellUnits,
|
|
156
156
|
unitPrice: item.price,
|
|
157
157
|
lineTotal: item.price != null && overriddenSellUnits != null ? item.price * overriddenSellUnits : null,
|
|
158
|
-
calculation: overriddenSellUnits != null ? `${reason}
|
|
158
|
+
calculation: overriddenSellUnits != null ? `${reason} Order quantity set to ${overriddenSellUnits} ${sellUnit}.` : reason,
|
|
159
159
|
costingMode: "review",
|
|
160
160
|
});
|
|
161
161
|
if (!Number.isFinite(requestedAmount) || requestedAmount <= 0)
|
package/dist/util/types.d.ts
CHANGED
|
@@ -214,25 +214,15 @@ export interface RetrievalDebugQuery {
|
|
|
214
214
|
candidates: RetrievalDebugCandidate[];
|
|
215
215
|
}
|
|
216
216
|
export interface RerankVerdict {
|
|
217
|
-
technicalClassification: "exact" | "equivalent" | "alternative" | "product_family_candidate" | "supplier_designed_item" | "component_only" | "no_suitable_candidate";
|
|
218
217
|
selectedCandidateId: string | null;
|
|
219
218
|
recommendedCandidateIds?: string[];
|
|
220
|
-
includeInQuote: boolean;
|
|
221
|
-
approvalRequired: boolean;
|
|
222
|
-
approvalType: string | null;
|
|
223
|
-
missingInformation: string[];
|
|
224
|
-
confidence: "high" | "medium" | "low";
|
|
225
219
|
reason: string;
|
|
226
220
|
}
|
|
227
221
|
export interface MatchDecision {
|
|
228
|
-
technical_classification: "exact" | "equivalent" | "alternative" | "product_family_candidate" | "supplier_designed_item" | "component_only" | "no_suitable_candidate" | null;
|
|
229
222
|
selected_candidate_id: string | null;
|
|
230
|
-
|
|
231
|
-
approval_required: boolean
|
|
232
|
-
approval_type: string | null;
|
|
233
|
-
missing_information: string[];
|
|
223
|
+
/** Derived from selection: no selected product means the line needs human review. */
|
|
224
|
+
approval_required: boolean;
|
|
234
225
|
reason: string | null;
|
|
235
|
-
confidence: "high" | "medium" | "low" | null;
|
|
236
226
|
source_list: string | null;
|
|
237
227
|
}
|
|
238
228
|
export interface MatchResult {
|
|
@@ -245,7 +235,6 @@ export interface MatchResult {
|
|
|
245
235
|
dependent_rerank_applied: boolean;
|
|
246
236
|
linked_parent_selected_candidate_id: string | null;
|
|
247
237
|
linked_parent_selected_candidate_description: string | null;
|
|
248
|
-
dimension_reason_overridden: boolean;
|
|
249
238
|
rerank_line_item_input: {
|
|
250
239
|
procurement_intent: string;
|
|
251
240
|
procurement_aliases: string[];
|
package/package.json
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@metron-labs/quote-react",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Metron Labs quote and estimating calculator components for React",
|
|
5
|
-
"license": "UNLICENSED",
|
|
6
|
-
"sideEffects": [
|
|
7
|
-
"*.css"
|
|
8
|
-
],
|
|
9
|
-
"main": "./dist/index.js",
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/index.d.ts",
|
|
14
|
-
"default": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./styles.css": "./dist/styles.css",
|
|
17
|
-
"./*": {
|
|
18
|
-
"types": "./dist/*.d.ts",
|
|
19
|
-
"default": "./dist/*.js"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"dist"
|
|
24
|
-
],
|
|
25
|
-
"publishConfig": {
|
|
26
|
-
"access": "restricted"
|
|
27
|
-
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && node scripts/copyStatic.mjs && node scripts/buildEmbed.mjs",
|
|
30
|
-
"typecheck": "tsc --noEmit",
|
|
31
|
-
"test": "vitest run",
|
|
32
|
-
"prepublishOnly": "npm run typecheck && npm run build",
|
|
33
|
-
"check:embed": "node scripts/checkEmbed.mjs"
|
|
34
|
-
},
|
|
35
|
-
"peerDependencies": {
|
|
36
|
-
"react": "^18.3.0 || ^19.0.0",
|
|
37
|
-
"react-dom": "^18.3.0 || ^19.0.0"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"xlsx": "^0.18.5"
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@types/node": "^20",
|
|
44
|
-
"@types/react": "^19",
|
|
45
|
-
"@types/react-dom": "^19",
|
|
46
|
-
"esbuild": "^0.28.2",
|
|
47
|
-
"react": "19.2.3",
|
|
48
|
-
"react-dom": "19.2.3",
|
|
49
|
-
"tsx": "^4",
|
|
50
|
-
"typescript": "^5",
|
|
51
|
-
"vitest": "^3"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@metron-labs/quote-react",
|
|
3
|
+
"version": "0.1.69",
|
|
4
|
+
"description": "Metron Labs quote and estimating calculator components for React",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.css"
|
|
8
|
+
],
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./styles.css": "./dist/styles.css",
|
|
17
|
+
"./*": {
|
|
18
|
+
"types": "./dist/*.d.ts",
|
|
19
|
+
"default": "./dist/*.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "restricted"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && node scripts/copyStatic.mjs && node scripts/buildEmbed.mjs",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"test": "vitest run",
|
|
32
|
+
"prepublishOnly": "npm run typecheck && npm run build",
|
|
33
|
+
"check:embed": "node scripts/checkEmbed.mjs"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
37
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"xlsx": "^0.18.5"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20",
|
|
44
|
+
"@types/react": "^19",
|
|
45
|
+
"@types/react-dom": "^19",
|
|
46
|
+
"esbuild": "^0.28.2",
|
|
47
|
+
"react": "19.2.3",
|
|
48
|
+
"react-dom": "19.2.3",
|
|
49
|
+
"tsx": "^4",
|
|
50
|
+
"typescript": "^5",
|
|
51
|
+
"vitest": "^3"
|
|
52
|
+
}
|
|
53
|
+
}
|