@gem-sdk/core 1.12.0-next.16 → 1.12.0-next.18

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.
@@ -117,7 +117,15 @@ function composeAdvanceStyle(data, tag) {
117
117
  }
118
118
  } else {
119
119
  if (attr === 'border') {
120
- Object.assign(styles, borders.getBorderStyle(value));
120
+ const borderStyle = value;
121
+ if (borderStyle.border === 'none') {
122
+ borderStyle.border = 'solid';
123
+ borderStyle.color = '#121212';
124
+ borderStyle.isCustom = true;
125
+ borderStyle.width = '0px';
126
+ borderStyle.position = 'all';
127
+ }
128
+ Object.assign(styles, borders.getBorderStyle(borderStyle));
121
129
  }
122
130
  if (attr === 'rounded') {
123
131
  Object.assign(styles, radius.getCornerCSSFromGlobal(value));
@@ -35,7 +35,7 @@ const useFormatMoney = (amount, withCurrency)=>{
35
35
  return 0;
36
36
  }
37
37
  // shopify làm tròn bằng cách cắt đi các số ở đằng sau chứ không sử dụng toFixed để làm tròn như toán học
38
- number = (number / 100.0).toFixed(Number(precision) + 1).slice(0, -1);
38
+ number = parseFloat(`${number}`).toFixed(Number(precision) + 1).slice(0, -1);
39
39
  const parts = number.split('.'), dollars = parts[0]?.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1' + thousands), cents = parts[1] ? decimal + parts[1] : '';
40
40
  return dollars + cents;
41
41
  }
@@ -115,7 +115,15 @@ function composeAdvanceStyle(data, tag) {
115
115
  }
116
116
  } else {
117
117
  if (attr === 'border') {
118
- Object.assign(styles, getBorderStyle(value));
118
+ const borderStyle = value;
119
+ if (borderStyle.border === 'none') {
120
+ borderStyle.border = 'solid';
121
+ borderStyle.color = '#121212';
122
+ borderStyle.isCustom = true;
123
+ borderStyle.width = '0px';
124
+ borderStyle.position = 'all';
125
+ }
126
+ Object.assign(styles, getBorderStyle(borderStyle));
119
127
  }
120
128
  if (attr === 'rounded') {
121
129
  Object.assign(styles, getCornerCSSFromGlobal(value));
@@ -33,7 +33,7 @@ const useFormatMoney = (amount, withCurrency)=>{
33
33
  return 0;
34
34
  }
35
35
  // shopify làm tròn bằng cách cắt đi các số ở đằng sau chứ không sử dụng toFixed để làm tròn như toán học
36
- number = (number / 100.0).toFixed(Number(precision) + 1).slice(0, -1);
36
+ number = parseFloat(`${number}`).toFixed(Number(precision) + 1).slice(0, -1);
37
37
  const parts = number.split('.'), dollars = parts[0]?.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1' + thousands), cents = parts[1] ? decimal + parts[1] : '';
38
38
  return dollars + cents;
39
39
  }
@@ -7076,12 +7076,16 @@ type ShadowProps = {
7076
7076
  };
7077
7077
  type Border = {
7078
7078
  borderType?: BorderTypeName;
7079
- border?: string;
7079
+ border?: BorderStyle$1;
7080
7080
  color?: ColorValueType;
7081
7081
  width?: string;
7082
7082
  isCustom?: boolean;
7083
+ position?: BorderPosition;
7084
+ borderWidth?: string;
7083
7085
  };
7084
7086
  type BorderTypeName = 'none' | 'style-1' | 'style-2' | 'style-3';
7087
+ type BorderStyle$1 = 'none' | 'solid' | 'dotted' | 'dashed';
7088
+ type BorderPosition = 'top' | 'left' | 'right' | 'bottom' | 'all';
7085
7089
  type SwatchesOptionType = 'radio_buttons' | 'dropdown' | 'color' | 'image' | 'rectangle_list' | string;
7086
7090
  declare const OptionNormalStyle: string[];
7087
7091
  declare const OptionSpecialStyle: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.12.0-next.16",
3
+ "version": "1.12.0-next.18",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@gem-sdk/adapter-shopify": "1.12.0-next.13",
28
- "@gem-sdk/styles": "1.12.0-next.16"
28
+ "@gem-sdk/styles": "1.12.0-next.18"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "4.0.3",