@true-engineering/true-react-common-ui-kit 3.45.1 → 3.45.3

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/README.md CHANGED
@@ -11,7 +11,13 @@
11
11
 
12
12
  # Release Notes
13
13
 
14
- ## 3.45.1
14
+ ## 3.45.3
15
+
16
+ - **Flag**: Добавлены флаги для Абхазии и Южной Осетии
17
+ - **PhoneInput**: Добавлены PhoneInfo для Абхазии и Южной осетии.
18
+ - **PhoneInput**: Исправлен баг с невозможностью выбора стран с одинаковыми dialCode
19
+
20
+ ## 3.45.2
15
21
 
16
22
  ### Changes
17
23
 
@@ -0,0 +1,10 @@
1
+ export declare const customFlags: {
2
+ /**
3
+ * Абхазия
4
+ */
5
+ AB: string;
6
+ /**
7
+ * Южная осетия
8
+ */
9
+ OS: string;
10
+ };
@@ -0,0 +1 @@
1
+ export * from './customFlags';
@@ -1997,6 +1997,21 @@ var minWidthModifier = {
1997
1997
  }
1998
1998
  };
1999
1999
  var phoneInfo = [
2000
+ {
2001
+ countryEn: "Abkhazia",
2002
+ countryRu: "Абхазия",
2003
+ countryCode: "AB",
2004
+ phoneMask: "999 999-99-99",
2005
+ dialCode: "7",
2006
+ areaCodes: [
2007
+ "840",
2008
+ "940"
2009
+ ],
2010
+ fullCodes: [
2011
+ "7840",
2012
+ "7940"
2013
+ ]
2014
+ },
2000
2015
  {
2001
2016
  countryEn: "Afghanistan",
2002
2017
  countryRu: "Афганистан",
@@ -3794,6 +3809,16 @@ var phoneInfo = [
3794
3809
  "82"
3795
3810
  ]
3796
3811
  },
3812
+ {
3813
+ countryCode: "OS",
3814
+ countryEn: "South Ossetia",
3815
+ countryRu: "Южная Осетия",
3816
+ phoneMask: "999 999-99-99",
3817
+ dialCode: "7",
3818
+ fullCodes: [
3819
+ "7"
3820
+ ]
3821
+ },
3797
3822
  {
3798
3823
  countryEn: "South Sudan",
3799
3824
  countryRu: "Южный Судан",
@@ -25719,8 +25744,24 @@ const Flags = {
25719
25744
  ZM,
25720
25745
  ZW
25721
25746
  };
25747
+ const AB = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 341.3"><path fill="#FFF" d="M0 0h512v341.3H0z"/><g fill="#6DA544"><path d="M0 0h512v48.8H0zM0 97.5h512v48.8H0zM0 195h512v48.8H0zM0 292.6h512v48.8H0z"/></g><path fill="#D80027" d="M0 0h256v146.3H0z"/><path fill="#FFF" d="m116.9 114.4-7.5-14.8V69.9L128 59l18.6 10.9v22.3l7.4-7.4 4.2 3-4.2 11.8-14.9 14.8z"/><circle fill="#FFF" cx="82" cy="82.8" r="5.4"/><circle fill="#FFF" cx="90.8" cy="61.7" r="5.4"/><circle fill="#FFF" cx="106.6" cy="46.2" r="5.4"/><circle fill="#FFF" cx="128" cy="40.8" r="5.4"/><circle fill="#FFF" cx="149.4" cy="46.2" r="5.4"/><circle fill="#FFF" cx="165.2" cy="61.7" r="5.4"/><circle fill="#FFF" cx="174" cy="82.8" r="5.4"/></svg>';
25748
+ const OS = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 450 300"><path fill="#FFF" d="M0 0h450v300H0z"/><path fill="red" d="M0 100h450v200H0z"/><path fill="#FFDF00" d="M0 200h450v100H0z"/></svg>';
25749
+ var customFlags = {
25750
+ /**
25751
+ * Абхазия
25752
+ */
25753
+ AB,
25754
+ /**
25755
+ * Южная осетия
25756
+ */
25757
+ OS
25758
+ };
25722
25759
  var useStyles$l = createThemedStyles("Flag", {
25723
25760
  root: {
25761
+ display: "flex",
25762
+ width: "100%",
25763
+ height: "100%",
25764
+ boxSizing: "border-box",
25724
25765
  // приходится хардкодить в компоненте, тк либа Flags выдает флаги с 2-3 пиксельным отступом снизу
25725
25766
  // если будет нужно, то можно вынести border на уровень пропсов
25726
25767
  border: [
@@ -25740,17 +25781,29 @@ var Flag = function(param) {
25740
25781
  var classes = useStyles$l({
25741
25782
  theme: tweakStyles
25742
25783
  });
25743
- var CC3 = countryCode.toUpperCase();
25744
- var TheFlag = hasFlag(CC3) ? Flags[CC3] : function() {
25784
+ var countryFlagKey = countryCode.toUpperCase();
25785
+ var hasFlagInLibrary = hasFlag(countryFlagKey);
25786
+ if (hasFlagInLibrary) {
25787
+ var FlagComponent = Flags[countryFlagKey];
25745
25788
  return /* @__PURE__ */ jsx("div", {
25746
- className: classes.noFlag,
25747
- children: /* @__PURE__ */ jsx(Icon, {
25748
- type: "minus"
25749
- })
25789
+ className: classes.root,
25790
+ children: /* @__PURE__ */ jsx(FlagComponent, {})
25750
25791
  });
25751
- };
25752
- return /* @__PURE__ */ jsx(TheFlag, {
25753
- className: classes.root
25792
+ }
25793
+ var CustomFlag = customFlags[countryFlagKey];
25794
+ if (CustomFlag !== void 0) {
25795
+ return /* @__PURE__ */ jsx("div", {
25796
+ className: classes.root,
25797
+ dangerouslySetInnerHTML: {
25798
+ __html: CustomFlag
25799
+ }
25800
+ });
25801
+ }
25802
+ return /* @__PURE__ */ jsx("div", {
25803
+ className: classes.noFlag,
25804
+ children: /* @__PURE__ */ jsx(Icon, {
25805
+ type: "minus"
25806
+ })
25754
25807
  });
25755
25808
  };
25756
25809
  var DEFAULT_DATE_FORMAT = "dd.MM.yyyy";
@@ -28718,6 +28771,7 @@ var PhoneInput = function(_param) {
28718
28771
  var _value_countryCode;
28719
28772
  return (_value_countryCode = value === null || value === void 0 ? void 0 : value.countryCode) !== null && _value_countryCode !== void 0 ? _value_countryCode : getCountryCodeFromPhone(phoneWithCode);
28720
28773
  }, [
28774
+ value.countryCode,
28721
28775
  value.dialCode,
28722
28776
  value.phoneNumber
28723
28777
  ]);