@shoper/phoenix_design_system 1.10.6 → 1.10.8

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.
@@ -16,7 +16,7 @@ exports.HInputCopyButton = class HInputCopyButton extends phoenix_light_lit_elem
16
16
  this.copyValue = '';
17
17
  this._$inputToCopy = null;
18
18
  this._handleCopyToClipboard = async () => {
19
- if (!this._$inputToCopy)
19
+ if (!this._$inputToCopy || this.hasBeenCopied)
20
20
  return;
21
21
  this._$inputToCopy.select();
22
22
  this.copyValue = this._$inputToCopy.value;
@@ -33,17 +33,8 @@ exports.HSearchProductContent = class HSearchProductContent extends phoenix_ligh
33
33
  ? productName.substring(0, search_constants.SEARCH_CONFIGURATION.maxCharactersInProductName) + '...'
34
34
  : productName;
35
35
  }
36
- extractNumber(text) {
37
- const numberArray = text
38
- .split(' ')
39
- .map((word) => parseFloat(word))
40
- .filter((number) => !isNaN(number));
41
- return numberArray[0];
42
- }
43
36
  _getPercentPromotion(prices) {
44
- const regularPrice = this.extractNumber(prices.basic.text);
45
- const promotionPrice = this.extractNumber(prices.promotion.text);
46
- return `-${Math.round(((regularPrice - promotionPrice) / regularPrice) * 100)}%`;
37
+ return `-${Math.round(((prices.basic.float - prices.promotion.float) / prices.basic.float) * 100)}%`;
47
38
  }
48
39
  render() {
49
40
  return lit.html `
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -12,7 +12,7 @@ let HInputCopyButton = class HInputCopyButton extends PhoenixLightLitElement {
12
12
  this.copyValue = '';
13
13
  this._$inputToCopy = null;
14
14
  this._handleCopyToClipboard = async () => {
15
- if (!this._$inputToCopy)
15
+ if (!this._$inputToCopy || this.hasBeenCopied)
16
16
  return;
17
17
  this._$inputToCopy.select();
18
18
  this.copyValue = this._$inputToCopy.value;
@@ -26,9 +26,13 @@ export declare type TProduct = TProducer & {
26
26
  prices: {
27
27
  basic: {
28
28
  text: string;
29
+ float: number;
30
+ currency?: string;
29
31
  };
30
32
  promotion: {
31
33
  text: string;
34
+ float: number;
35
+ currency?: string;
32
36
  };
33
37
  };
34
38
  rate: number;
@@ -9,7 +9,6 @@ export declare class HSearchProductContent extends PhoenixLightLitElement {
9
9
  translations: Record<string, string>;
10
10
  getProductRateHtml: (productRate: number) => TemplateResult;
11
11
  private _getShortenProductName;
12
- private extractNumber;
13
12
  private _getPercentPromotion;
14
13
  protected render(): TemplateResult;
15
14
  }
@@ -29,17 +29,8 @@ let HSearchProductContent = class HSearchProductContent extends PhoenixLightLitE
29
29
  ? productName.substring(0, SEARCH_CONFIGURATION.maxCharactersInProductName) + '...'
30
30
  : productName;
31
31
  }
32
- extractNumber(text) {
33
- const numberArray = text
34
- .split(' ')
35
- .map((word) => parseFloat(word))
36
- .filter((number) => !isNaN(number));
37
- return numberArray[0];
38
- }
39
32
  _getPercentPromotion(prices) {
40
- const regularPrice = this.extractNumber(prices.basic.text);
41
- const promotionPrice = this.extractNumber(prices.promotion.text);
42
- return `-${Math.round(((regularPrice - promotionPrice) / regularPrice) * 100)}%`;
33
+ return `-${Math.round(((prices.basic.float - prices.promotion.float) / prices.basic.float) * 100)}%`;
43
34
  }
44
35
  render() {
45
36
  return html `
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA,0BAA0B,2EAAmF;AAC7G;AACA,4BAA4B,6EAAqF;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA,0BAA0B,2EAAmF;AAC7G;AACA,4BAA4B,6EAAqF;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "1.10.6",
5
+ "version": "1.10.8",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",