@propeller-commerce/propeller-v2-react-ui 0.29.0 → 0.30.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 +19 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/shared.cjs +12 -5
- package/dist/shared.cjs.map +1 -1
- package/dist/shared.d.cts +27 -1
- package/dist/shared.d.ts +27 -1
- package/dist/shared.js +10 -0
- package/dist/shared.js.map +1 -1
- package/package.json +1 -1
package/dist/shared.cjs
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var propellerV2CoreUi = require('@propeller-commerce/propeller-v2-core-ui');
|
|
4
|
+
var propellerSdkV2 = require('@propeller-commerce/propeller-sdk-v2');
|
|
4
5
|
|
|
6
|
+
// src/shared.ts
|
|
7
|
+
function isPriceOnRequest(product) {
|
|
8
|
+
if (!product) return false;
|
|
9
|
+
const display = product.priceData?.display ?? product.defaultProduct?.priceData?.display;
|
|
10
|
+
return display === propellerSdkV2.PriceDisplay.ON_REQUEST;
|
|
11
|
+
}
|
|
5
12
|
|
|
6
|
-
|
|
13
|
+
exports.isPriceOnRequest = isPriceOnRequest;
|
|
7
14
|
Object.keys(propellerV2CoreUi).forEach(function (k) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return propellerV2CoreUi[k]; }
|
|
18
|
+
});
|
|
12
19
|
});
|
|
13
20
|
//# sourceMappingURL=shared.cjs.map
|
|
14
21
|
//# sourceMappingURL=shared.cjs.map
|
package/dist/shared.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"shared.cjs","sourcesContent":[]}
|
|
1
|
+
{"version":3,"sources":["../src/composables/shared/utils/priceOnRequest.ts"],"names":["PriceDisplay"],"mappings":";;;;;;AAuBO,SAAS,iBAAiB,OAAA,EAA0D;AACzF,EAAA,IAAI,CAAC,SAAS,OAAO,KAAA;AACrB,EAAA,MAAM,UAAU,OAAA,CAAQ,SAAA,EAAW,OAAA,IAAW,OAAA,CAAQ,gBAAgB,SAAA,EAAW,OAAA;AACjF,EAAA,OAAO,YAAYA,2BAAA,CAAa,UAAA;AAClC","file":"shared.cjs","sourcesContent":["/**\n * Does this product carry a price the shopper cannot see?\n *\n * `priceData.display === 'ON_REQUEST'` means the catalogue holds no price the\n * customer may be quoted: `price.gross`/`price.net` are still populated, almost\n * always with 0, so anything that renders them unguarded shows \"€ 0,00\" next to\n * a working add-to-cart button.\n *\n * Kept separate from the components because both packages test pure logic in\n * `node` and cannot mount an SFC.\n */\nimport { PriceDisplay } from '@propeller-commerce/propeller-sdk-v2';\n\n/** A product-ish record carrying the price metadata this reads. */\nexport interface PriceOnRequestInput {\n priceData?: { display?: PriceDisplay | string | null } | null;\n defaultProduct?: PriceOnRequestInput | null;\n}\n\n/**\n * Clusters answer for their default product: the card shows that product's\n * price, so it is that product's display mode that decides.\n */\nexport function isPriceOnRequest(product: PriceOnRequestInput | null | undefined): boolean {\n if (!product) return false;\n const display = product.priceData?.display ?? product.defaultProduct?.priceData?.display;\n return display === PriceDisplay.ON_REQUEST;\n}\n"]}
|
package/dist/shared.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from '@propeller-commerce/propeller-v2-core-ui';
|
|
2
|
+
import { PriceDisplay } from '@propeller-commerce/propeller-sdk-v2';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* useMenu (React) — Category tree fetch with depth-configurable recursive GraphQL query.
|
|
@@ -21,4 +22,29 @@ interface MenuCategory {
|
|
|
21
22
|
children: MenuCategory[];
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Does this product carry a price the shopper cannot see?
|
|
27
|
+
*
|
|
28
|
+
* `priceData.display === 'ON_REQUEST'` means the catalogue holds no price the
|
|
29
|
+
* customer may be quoted: `price.gross`/`price.net` are still populated, almost
|
|
30
|
+
* always with 0, so anything that renders them unguarded shows "€ 0,00" next to
|
|
31
|
+
* a working add-to-cart button.
|
|
32
|
+
*
|
|
33
|
+
* Kept separate from the components because both packages test pure logic in
|
|
34
|
+
* `node` and cannot mount an SFC.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** A product-ish record carrying the price metadata this reads. */
|
|
38
|
+
interface PriceOnRequestInput {
|
|
39
|
+
priceData?: {
|
|
40
|
+
display?: PriceDisplay | string | null;
|
|
41
|
+
} | null;
|
|
42
|
+
defaultProduct?: PriceOnRequestInput | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Clusters answer for their default product: the card shows that product's
|
|
46
|
+
* price, so it is that product's display mode that decides.
|
|
47
|
+
*/
|
|
48
|
+
declare function isPriceOnRequest(product: PriceOnRequestInput | null | undefined): boolean;
|
|
49
|
+
|
|
50
|
+
export { type MenuCategory, isPriceOnRequest };
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from '@propeller-commerce/propeller-v2-core-ui';
|
|
2
|
+
import { PriceDisplay } from '@propeller-commerce/propeller-sdk-v2';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* useMenu (React) — Category tree fetch with depth-configurable recursive GraphQL query.
|
|
@@ -21,4 +22,29 @@ interface MenuCategory {
|
|
|
21
22
|
children: MenuCategory[];
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Does this product carry a price the shopper cannot see?
|
|
27
|
+
*
|
|
28
|
+
* `priceData.display === 'ON_REQUEST'` means the catalogue holds no price the
|
|
29
|
+
* customer may be quoted: `price.gross`/`price.net` are still populated, almost
|
|
30
|
+
* always with 0, so anything that renders them unguarded shows "€ 0,00" next to
|
|
31
|
+
* a working add-to-cart button.
|
|
32
|
+
*
|
|
33
|
+
* Kept separate from the components because both packages test pure logic in
|
|
34
|
+
* `node` and cannot mount an SFC.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** A product-ish record carrying the price metadata this reads. */
|
|
38
|
+
interface PriceOnRequestInput {
|
|
39
|
+
priceData?: {
|
|
40
|
+
display?: PriceDisplay | string | null;
|
|
41
|
+
} | null;
|
|
42
|
+
defaultProduct?: PriceOnRequestInput | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Clusters answer for their default product: the card shows that product's
|
|
46
|
+
* price, so it is that product's display mode that decides.
|
|
47
|
+
*/
|
|
48
|
+
declare function isPriceOnRequest(product: PriceOnRequestInput | null | undefined): boolean;
|
|
49
|
+
|
|
50
|
+
export { type MenuCategory, isPriceOnRequest };
|
package/dist/shared.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
export * from '@propeller-commerce/propeller-v2-core-ui';
|
|
2
|
+
import { PriceDisplay } from '@propeller-commerce/propeller-sdk-v2';
|
|
3
|
+
|
|
4
|
+
// src/shared.ts
|
|
5
|
+
function isPriceOnRequest(product) {
|
|
6
|
+
if (!product) return false;
|
|
7
|
+
const display = product.priceData?.display ?? product.defaultProduct?.priceData?.display;
|
|
8
|
+
return display === PriceDisplay.ON_REQUEST;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { isPriceOnRequest };
|
|
2
12
|
//# sourceMappingURL=shared.js.map
|
|
3
13
|
//# sourceMappingURL=shared.js.map
|
package/dist/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"shared.js","sourcesContent":[]}
|
|
1
|
+
{"version":3,"sources":["../src/composables/shared/utils/priceOnRequest.ts"],"names":[],"mappings":";;;;AAuBO,SAAS,iBAAiB,OAAA,EAA0D;AACzF,EAAA,IAAI,CAAC,SAAS,OAAO,KAAA;AACrB,EAAA,MAAM,UAAU,OAAA,CAAQ,SAAA,EAAW,OAAA,IAAW,OAAA,CAAQ,gBAAgB,SAAA,EAAW,OAAA;AACjF,EAAA,OAAO,YAAY,YAAA,CAAa,UAAA;AAClC","file":"shared.js","sourcesContent":["/**\n * Does this product carry a price the shopper cannot see?\n *\n * `priceData.display === 'ON_REQUEST'` means the catalogue holds no price the\n * customer may be quoted: `price.gross`/`price.net` are still populated, almost\n * always with 0, so anything that renders them unguarded shows \"€ 0,00\" next to\n * a working add-to-cart button.\n *\n * Kept separate from the components because both packages test pure logic in\n * `node` and cannot mount an SFC.\n */\nimport { PriceDisplay } from '@propeller-commerce/propeller-sdk-v2';\n\n/** A product-ish record carrying the price metadata this reads. */\nexport interface PriceOnRequestInput {\n priceData?: { display?: PriceDisplay | string | null } | null;\n defaultProduct?: PriceOnRequestInput | null;\n}\n\n/**\n * Clusters answer for their default product: the card shows that product's\n * price, so it is that product's display mode that decides.\n */\nexport function isPriceOnRequest(product: PriceOnRequestInput | null | undefined): boolean {\n if (!product) return false;\n const display = product.priceData?.display ?? product.defaultProduct?.priceData?.display;\n return display === PriceDisplay.ON_REQUEST;\n}\n"]}
|