@payloadcms/plugin-ecommerce 3.83.0-internal.86b7bfb → 3.83.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.
|
@@ -12,13 +12,13 @@ export const PriceCell = (args)=>{
|
|
|
12
12
|
children: t('plugin-ecommerce:currencyNotSet')
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
if ((
|
|
15
|
+
if ((cellData == null || typeof cellData !== 'number') && 'enableVariants' in rowData && rowData.enableVariants) {
|
|
16
16
|
// @ts-expect-error - plugin translations are not typed yet
|
|
17
17
|
return /*#__PURE__*/ _jsx("span", {
|
|
18
18
|
children: t('plugin-ecommerce:priceSetInVariants')
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
if (
|
|
21
|
+
if (cellData == null) {
|
|
22
22
|
// @ts-expect-error - plugin translations are not typed yet
|
|
23
23
|
return /*#__PURE__*/ _jsx("span", {
|
|
24
24
|
children: t('plugin-ecommerce:priceNotSet')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/PriceCell/index.tsx"],"sourcesContent":["'use client'\nimport type { DefaultCellComponentProps, TypedCollection } from 'payload'\n\nimport { useTranslation } from '@payloadcms/ui'\n\nimport type { CurrenciesConfig, Currency } from '../../types/index.js'\n\nimport { convertFromBaseValue } from '../utilities.js'\n\ntype Props = {\n cellData?: number\n currenciesConfig: CurrenciesConfig\n currency?: Currency\n path: string\n rowData: Partial<TypedCollection['products']>\n} & DefaultCellComponentProps\n\nexport const PriceCell: React.FC<Props> = (args) => {\n const { t } = useTranslation()\n const { cellData, currenciesConfig, currency: currencyFromProps, rowData } = args\n\n const currency = currencyFromProps || currenciesConfig.supportedCurrencies[0]\n\n if (!currency) {\n // @ts-expect-error - plugin translations are not typed yet\n return <span>{t('plugin-ecommerce:currencyNotSet')}</span>\n }\n\n if (\n (
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/PriceCell/index.tsx"],"sourcesContent":["'use client'\nimport type { DefaultCellComponentProps, TypedCollection } from 'payload'\n\nimport { useTranslation } from '@payloadcms/ui'\n\nimport type { CurrenciesConfig, Currency } from '../../types/index.js'\n\nimport { convertFromBaseValue } from '../utilities.js'\n\ntype Props = {\n cellData?: number\n currenciesConfig: CurrenciesConfig\n currency?: Currency\n path: string\n rowData: Partial<TypedCollection['products']>\n} & DefaultCellComponentProps\n\nexport const PriceCell: React.FC<Props> = (args) => {\n const { t } = useTranslation()\n const { cellData, currenciesConfig, currency: currencyFromProps, rowData } = args\n\n const currency = currencyFromProps || currenciesConfig.supportedCurrencies[0]\n\n if (!currency) {\n // @ts-expect-error - plugin translations are not typed yet\n return <span>{t('plugin-ecommerce:currencyNotSet')}</span>\n }\n\n if (\n (cellData == null || typeof cellData !== 'number') &&\n 'enableVariants' in rowData &&\n rowData.enableVariants\n ) {\n // @ts-expect-error - plugin translations are not typed yet\n return <span>{t('plugin-ecommerce:priceSetInVariants')}</span>\n }\n\n if (cellData == null) {\n // @ts-expect-error - plugin translations are not typed yet\n return <span>{t('plugin-ecommerce:priceNotSet')}</span>\n }\n\n return (\n <span>\n {currency.symbol}\n {convertFromBaseValue({ baseValue: cellData, currency })}\n </span>\n )\n}\n"],"names":["useTranslation","convertFromBaseValue","PriceCell","args","t","cellData","currenciesConfig","currency","currencyFromProps","rowData","supportedCurrencies","span","enableVariants","symbol","baseValue"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,iBAAgB;AAI/C,SAASC,oBAAoB,QAAQ,kBAAiB;AAUtD,OAAO,MAAMC,YAA6B,CAACC;IACzC,MAAM,EAAEC,CAAC,EAAE,GAAGJ;IACd,MAAM,EAAEK,QAAQ,EAAEC,gBAAgB,EAAEC,UAAUC,iBAAiB,EAAEC,OAAO,EAAE,GAAGN;IAE7E,MAAMI,WAAWC,qBAAqBF,iBAAiBI,mBAAmB,CAAC,EAAE;IAE7E,IAAI,CAACH,UAAU;QACb,2DAA2D;QAC3D,qBAAO,KAACI;sBAAMP,EAAE;;IAClB;IAEA,IACE,AAACC,CAAAA,YAAY,QAAQ,OAAOA,aAAa,QAAO,KAChD,oBAAoBI,WACpBA,QAAQG,cAAc,EACtB;QACA,2DAA2D;QAC3D,qBAAO,KAACD;sBAAMP,EAAE;;IAClB;IAEA,IAAIC,YAAY,MAAM;QACpB,2DAA2D;QAC3D,qBAAO,KAACM;sBAAMP,EAAE;;IAClB;IAEA,qBACE,MAACO;;YACEJ,SAASM,MAAM;YACfZ,qBAAqB;gBAAEa,WAAWT;gBAAUE;YAAS;;;AAG5D,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-ecommerce",
|
|
3
|
-
"version": "3.83.0
|
|
3
|
+
"version": "3.83.0",
|
|
4
4
|
"description": "Ecommerce plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
],
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"qs-esm": "8.0.1",
|
|
77
|
-
"@payloadcms/translations": "3.83.0
|
|
78
|
-
"@payloadcms/ui": "3.83.0
|
|
77
|
+
"@payloadcms/translations": "3.83.0",
|
|
78
|
+
"@payloadcms/ui": "3.83.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@types/json-schema": "7.0.15",
|
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"@types/react-dom": "19.2.3",
|
|
84
84
|
"stripe": "18.3.0",
|
|
85
85
|
"@payloadcms/eslint-config": "3.28.0",
|
|
86
|
-
"@payloadcms/
|
|
87
|
-
"@payloadcms/
|
|
88
|
-
"payload": "3.83.0
|
|
86
|
+
"@payloadcms/translations": "3.83.0",
|
|
87
|
+
"@payloadcms/next": "3.83.0",
|
|
88
|
+
"payload": "3.83.0"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
92
92
|
"react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
93
|
-
"payload": "3.83.0
|
|
93
|
+
"payload": "3.83.0"
|
|
94
94
|
},
|
|
95
95
|
"publishConfig": {
|
|
96
96
|
"registry": "https://registry.npmjs.org/"
|