pds-dev-kit-web 2.2.195 → 2.2.196

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.
@@ -1,7 +1,7 @@
1
1
  import type { CurrencyCodeType, Price, TranslationType } from './types';
2
2
  export interface PricingTranslateOptions {
3
3
  friendly?: boolean;
4
- translate?: TranslationType;
4
+ translation?: TranslationType;
5
5
  }
6
6
  export declare class PricingTranslator {
7
7
  private static browserLanguage;
@@ -29,7 +29,7 @@ var PricingTranslator = /** @class */ (function () {
29
29
  PricingTranslator.currency = function (code, opts) {
30
30
  var currency = types_1.CURRENCY_MAP[code];
31
31
  if (opts === null || opts === void 0 ? void 0 : opts.friendly) {
32
- return currency.friendlyName(opts.translate);
32
+ return currency.friendlyName(opts.translation);
33
33
  }
34
34
  return currency.name;
35
35
  };
@@ -1,13 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { CurrencyCode, ExchangeRateMap, Price, TranslationType } from '../../../core/pricing';
2
+ import { CurrencyCode, ExchangeRateMap, Price } from '../../../core/pricing';
3
3
  import type { TextLabelProps } from '../TextLabel/TextLabel';
4
4
  type PriceTextLabelProps = Omit<TextLabelProps, 'text' | 'ellipsisMode' | 'lineLimit' | 'userSelectMode' | 'requirementMode' | 'bulletPointMode' | 'wordBreak'> & {
5
5
  price: Price;
6
6
  useFriendlyName?: 'none' | 'use';
7
7
  useMinus?: 'none' | 'use';
8
- translate?: TranslationType;
9
8
  };
10
- declare function PriceTextLabel({ price, useFriendlyName, useMinus, selectedCurrency, exchangeRates, userCountryCode, translate, ...args }: PriceTextLabelProps & {
9
+ declare function PriceTextLabel({ price, useFriendlyName, useMinus, selectedCurrency, exchangeRates, userCountryCode, ...args }: PriceTextLabelProps & {
11
10
  selectedCurrency?: CurrencyCode;
12
11
  exchangeRates?: ExchangeRateMap;
13
12
  userCountryCode?: string;
@@ -23,10 +23,12 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var react_i18next_1 = require("react-i18next");
26
27
  var pricing_1 = require("../../../core/pricing");
27
28
  var TextLabel_1 = require("../TextLabel");
28
29
  function PriceTextLabel(_a) {
29
- var price = _a.price, _b = _a.useFriendlyName, useFriendlyName = _b === void 0 ? 'none' : _b, _c = _a.useMinus, useMinus = _c === void 0 ? 'none' : _c, selectedCurrency = _a.selectedCurrency, exchangeRates = _a.exchangeRates, userCountryCode = _a.userCountryCode, translate = _a.translate, args = __rest(_a, ["price", "useFriendlyName", "useMinus", "selectedCurrency", "exchangeRates", "userCountryCode", "translate"]);
30
+ var price = _a.price, _b = _a.useFriendlyName, useFriendlyName = _b === void 0 ? 'none' : _b, _c = _a.useMinus, useMinus = _c === void 0 ? 'none' : _c, selectedCurrency = _a.selectedCurrency, exchangeRates = _a.exchangeRates, userCountryCode = _a.userCountryCode, args = __rest(_a, ["price", "useFriendlyName", "useMinus", "selectedCurrency", "exchangeRates", "userCountryCode"]);
31
+ var t = (0, react_i18next_1.useTranslation)('translation').t;
30
32
  var targetPrice = price;
31
33
  var formattedAmount = useMinus === 'use' ? "-".concat(targetPrice.amount) : targetPrice.amount;
32
34
  var priceText = pricing_1.PricingService.translate.priceWithCurrency(exchangeRates && selectedCurrency
@@ -38,7 +40,7 @@ function PriceTextLabel(_a) {
38
40
  : price.currency
39
41
  }, {
40
42
  friendly: useFriendlyName === 'use' ? true : false,
41
- translate: translate
43
+ translation: t
42
44
  });
43
45
  return (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, __assign({}, args, { text: priceText }));
44
46
  }
@@ -1,13 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { CurrencyCode, ExchangeRateMap, Price, TranslationType } from '../../../core/pricing';
2
+ import { CurrencyCode, ExchangeRateMap, Price } from '../../../core/pricing';
3
3
  import type { TextLabelProps } from '../TextLabel/TextLabel';
4
4
  type PriceTextLabelProps = Omit<TextLabelProps, 'text' | 'ellipsisMode' | 'lineLimit' | 'userSelectMode' | 'requirementMode' | 'bulletPointMode' | 'wordBreak'> & {
5
5
  price: Price;
6
6
  useFriendlyName?: 'none' | 'use';
7
7
  useMinus?: 'none' | 'use';
8
- translate?: TranslationType;
9
8
  };
10
- declare function PriceTextLabel({ price, useFriendlyName, useMinus, selectedCurrency, exchangeRates, userCountryCode, translate, ...args }: PriceTextLabelProps & {
9
+ declare function PriceTextLabel({ price, useFriendlyName, useMinus, selectedCurrency, exchangeRates, userCountryCode, ...args }: PriceTextLabelProps & {
11
10
  selectedCurrency?: CurrencyCode;
12
11
  exchangeRates?: ExchangeRateMap;
13
12
  userCountryCode?: string;
@@ -23,10 +23,12 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var react_i18next_1 = require("react-i18next");
26
27
  var pricing_1 = require("../../../core/pricing");
27
28
  var TextLabel_1 = require("../TextLabel");
28
29
  function PriceTextLabel(_a) {
29
- var price = _a.price, _b = _a.useFriendlyName, useFriendlyName = _b === void 0 ? 'none' : _b, _c = _a.useMinus, useMinus = _c === void 0 ? 'none' : _c, selectedCurrency = _a.selectedCurrency, exchangeRates = _a.exchangeRates, userCountryCode = _a.userCountryCode, translate = _a.translate, args = __rest(_a, ["price", "useFriendlyName", "useMinus", "selectedCurrency", "exchangeRates", "userCountryCode", "translate"]);
30
+ var price = _a.price, _b = _a.useFriendlyName, useFriendlyName = _b === void 0 ? 'none' : _b, _c = _a.useMinus, useMinus = _c === void 0 ? 'none' : _c, selectedCurrency = _a.selectedCurrency, exchangeRates = _a.exchangeRates, userCountryCode = _a.userCountryCode, args = __rest(_a, ["price", "useFriendlyName", "useMinus", "selectedCurrency", "exchangeRates", "userCountryCode"]);
31
+ var t = (0, react_i18next_1.useTranslation)('translation').t;
30
32
  var targetPrice = price;
31
33
  var formattedAmount = useMinus === 'use' ? "-".concat(targetPrice.amount) : targetPrice.amount;
32
34
  var priceText = pricing_1.PricingService.translate.priceWithCurrency(exchangeRates && selectedCurrency
@@ -38,7 +40,7 @@ function PriceTextLabel(_a) {
38
40
  : price.currency
39
41
  }, {
40
42
  friendly: useFriendlyName === 'use' ? true : false,
41
- translate: translate
43
+ translation: t
42
44
  });
43
45
  return (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, __assign({}, args, { text: priceText }));
44
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "2.2.195",
3
+ "version": "2.2.196",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.195]
2
+ ## [v2.2.196]
3
3
  ## daily|https://design.storybook.publ.biz/
4
4
 
5
5
  ### 업데이트 사항
6
- * [FIX] PriceTextLabel translate 함수 추가
6
+ * [FIX] PriceTextLabel에서 i18n 체크 수정
7
7