@metron-labs/quote-react 0.1.20 → 0.1.22
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 -222
- package/dist/app/EstimatingTools.js +23 -7
- package/dist/app/QuickQuote.js +21 -3
- package/dist/app/stages/BasketStage.js +9 -1
- package/dist/app/stages/EntryStage.js +6 -1
- package/dist/app/stages/ScheduleResultsStage.js +3 -0
- package/dist/embed/quote.js +6760 -6760
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/lib/analytics.d.ts +16 -0
- package/dist/lib/analytics.js +37 -0
- package/dist/lib/config.d.ts +9 -0
- package/dist/lib/productImage.js +19 -19
- package/dist/styles.css +6748 -6748
- package/dist/util/pricing.js +3 -4
- package/package.json +53 -53
package/dist/util/pricing.js
CHANGED
|
@@ -194,11 +194,10 @@ export function getPricingBreakdown(item, options) {
|
|
|
194
194
|
calculation = `${requestedAmount} m2 x ${wasteMultiplier} / ${descriptionCoverage} m2 per ${sellUnit} (from product description)`;
|
|
195
195
|
}
|
|
196
196
|
else if (item.conversionType === "basket_line_unit") {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
rawSellUnits = (requestedAmount * wasteMultiplier) / coverage;
|
|
197
|
+
if (salesUnitSize > 0) {
|
|
198
|
+
rawSellUnits = (requestedAmount * wasteMultiplier) / salesUnitSize;
|
|
200
199
|
costingMode = "derived";
|
|
201
|
-
calculation = `${requestedAmount} ${requestedUnit} x ${wasteMultiplier} / ${
|
|
200
|
+
calculation = `${requestedAmount} ${requestedUnit}${wasteFactor > 0 ? ` x ${wasteMultiplier}` : ""} / ${salesUnitSize} ${requestedUnit} per ${sellUnit}`;
|
|
202
201
|
}
|
|
203
202
|
}
|
|
204
203
|
else if (item.conversionType === "count_only") {
|
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.22",
|
|
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
|
+
}
|