@metron-labs/quote-react 0.1.43 → 0.1.44
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/app/QuickQuote.js +9 -2
- package/dist/app/stages/BasketStage.js +11 -6
- package/dist/embed/quote.js +19 -12
- package/dist/lib/boq/inputLimits.d.ts +2 -0
- package/dist/lib/boq/inputLimits.js +2 -0
- package/dist/lib/config.js +2 -1
- package/dist/styles.css +7 -0
- package/dist/util/pricing.js +3 -2
- package/package.json +1 -1
|
@@ -3,6 +3,8 @@ export declare const MAX_LINES = 500;
|
|
|
3
3
|
export declare const MAX_CHARS = 50000;
|
|
4
4
|
/** Longer than this and it's usually a pasted paragraph, not a line item. */
|
|
5
5
|
export declare const MAX_LINE_CHARS = 500;
|
|
6
|
+
/** Most of one product a basket line can ask for. Under the quote-request API's own 1,000,000 cap. */
|
|
7
|
+
export declare const MAX_ORDER_QTY = 100000;
|
|
6
8
|
export declare const FILE_EXTENSIONS: {
|
|
7
9
|
schedule: string[];
|
|
8
10
|
photo: string[];
|
|
@@ -9,6 +9,8 @@ export const MAX_LINES = 500;
|
|
|
9
9
|
export const MAX_CHARS = 50000;
|
|
10
10
|
/** Longer than this and it's usually a pasted paragraph, not a line item. */
|
|
11
11
|
export const MAX_LINE_CHARS = 500;
|
|
12
|
+
/** Most of one product a basket line can ask for. Under the quote-request API's own 1,000,000 cap. */
|
|
13
|
+
export const MAX_ORDER_QTY = 100000;
|
|
12
14
|
/** Photos are scaled down to this before upload - plenty for reading a list. */
|
|
13
15
|
const PHOTO_MAX_EDGE_PX = 2000;
|
|
14
16
|
export const FILE_EXTENSIONS = {
|
package/dist/lib/config.js
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
let moduleConfig = {};
|
|
9
9
|
/** Called by QuoteProvider. Not part of the public API. */
|
|
10
10
|
export function setModuleConfig(config) {
|
|
11
|
-
|
|
11
|
+
// Codes are issued upper-case; a host that types or lower-cases one still gets its client.
|
|
12
|
+
moduleConfig = { ...config, client: config.client?.trim().toUpperCase() || undefined };
|
|
12
13
|
}
|
|
13
14
|
/** The active config, for code outside the React tree. */
|
|
14
15
|
export function getQuoteConfig() {
|
package/dist/styles.css
CHANGED
|
@@ -1125,11 +1125,18 @@
|
|
|
1125
1125
|
:where(.app-wrapper) .basket-sidebar-row {
|
|
1126
1126
|
display: flex;
|
|
1127
1127
|
justify-content: space-between;
|
|
1128
|
+
align-items: baseline;
|
|
1129
|
+
/* A long label in the narrow sidebar wraps rather than running into the amount. */
|
|
1130
|
+
gap: 12px;
|
|
1128
1131
|
padding: 7px 0;
|
|
1129
1132
|
font-size: 14px;
|
|
1130
1133
|
color: var(--text-mid);
|
|
1131
1134
|
}
|
|
1132
1135
|
|
|
1136
|
+
:where(.app-wrapper) .basket-sidebar-row > :last-child {
|
|
1137
|
+
white-space: nowrap;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1133
1140
|
:where(.app-wrapper) .basket-sidebar-row--total {
|
|
1134
1141
|
border-top: 1px solid var(--border);
|
|
1135
1142
|
margin-top: 6px;
|
package/dist/util/pricing.js
CHANGED
|
@@ -123,7 +123,8 @@ export function getPricingBreakdown(item, options) {
|
|
|
123
123
|
const salesUnitSize = item.saleUnitQuantity ?? item.salesUnitSize ?? item.uoiCount ?? 1;
|
|
124
124
|
const wasteFactor = options?.wasteFactorEnabled === false ? 0 : (options?.wasteFactorOverride ?? item.wasteFactorOverride ?? item.wasteFactorDefault ?? 0);
|
|
125
125
|
const hasOverride = item.sellUnitsOverride != null && Number.isFinite(item.sellUnitsOverride) && item.sellUnitsOverride > 0;
|
|
126
|
-
|
|
126
|
+
// A typed quantity follows the same rule as a calculated one: no part sheets or bags.
|
|
127
|
+
const overriddenSellUnits = hasOverride ? (discreteSellUnits.has(sellUnit) ? Math.ceil(item.sellUnitsOverride) : item.sellUnitsOverride) : null;
|
|
127
128
|
const review = (reason) => ({
|
|
128
129
|
requestedAmount,
|
|
129
130
|
requestedUnit,
|
|
@@ -267,7 +268,7 @@ export function getPricingBreakdown(item, options) {
|
|
|
267
268
|
return review(`Quantity review required, initial request needed ${requestedAmount} ${requestedUnit}.`);
|
|
268
269
|
}
|
|
269
270
|
const calculatedSellUnits = roundQuantity(rawSellUnits, roundingRule);
|
|
270
|
-
const requiredSellUnits = hasOverride ?
|
|
271
|
+
const requiredSellUnits = hasOverride ? overriddenSellUnits : calculatedSellUnits;
|
|
271
272
|
return {
|
|
272
273
|
requestedAmount,
|
|
273
274
|
requestedUnit,
|