react-gldn-kit 0.1.154 → 0.1.156

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.
@@ -147,9 +147,6 @@ var PhoneBox = function (props) {
147
147
  return;
148
148
  }
149
149
  var baseValue = phone.value;
150
- if (countryPhoneSettings.code === '+880') {
151
- baseValue = '1';
152
- }
153
150
  setPhone({
154
151
  value: baseValue,
155
152
  errorText: '',
@@ -12,7 +12,7 @@ exports.PHONE_MASK = {
12
12
  BD: {
13
13
  name: 'Bangladesh',
14
14
  code: '+880',
15
- mask: 'XXXX XXXXXX',
15
+ mask: '1XXX XXXXXX',
16
16
  length: 10,
17
17
  Flag: BnSvg_1.BnSvg,
18
18
  },
@@ -97,9 +97,6 @@ var PhoneInput = function (props) {
97
97
  var handleChooseSettings = function (p) { return function () {
98
98
  setCountryPhoneSettings(p);
99
99
  var value = p.code;
100
- if (p.code === '+880') {
101
- value = '+8801';
102
- }
103
100
  setPhone({
104
101
  value: value,
105
102
  errorText: '',
@@ -181,20 +178,27 @@ var PhoneInput = function (props) {
181
178
  setCountryPhoneSettings(country || constants_1.DEFAULT_COUNTRY_INFO);
182
179
  }, [countryCodeDefault, countryInfo, defaultValueProps]);
183
180
  (0, react_1.useEffect)(function () {
184
- if (phone.value && !phone.errorText) {
181
+ var _a, _b;
182
+ var baseLength = defaultValueProps === '+'
183
+ ? (_a = countryPhoneSettings === null || countryPhoneSettings === void 0 ? void 0 : countryPhoneSettings.code.length) !== null && _a !== void 0 ? _a : 0
184
+ : (_b = defaultValueProps === null || defaultValueProps === void 0 ? void 0 : defaultValueProps.length) !== null && _b !== void 0 ? _b : 0;
185
+ if (phone.value && !phone.errorText && phone.value.length > baseLength) {
185
186
  onChange(phone.value);
186
187
  return;
187
188
  }
188
189
  onChange('');
189
- }, [phone, onChange]);
190
+ }, [
191
+ phone.value,
192
+ phone.errorText,
193
+ defaultValueProps,
194
+ countryPhoneSettings,
195
+ onChange,
196
+ ]);
190
197
  (0, react_1.useEffect)(function () {
191
198
  if (countryPhoneSettings === null || countryPhoneSettings === void 0 ? void 0 : countryPhoneSettings.code) {
192
199
  var baseValue = defaultValueProps !== '+'
193
200
  ? defaultValueProps
194
201
  : countryPhoneSettings.code;
195
- if (countryPhoneSettings.code === '+880') {
196
- baseValue = '+8801';
197
- }
198
202
  setPhone({
199
203
  value: baseValue,
200
204
  errorText: '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-gldn-kit",
3
- "version": "0.1.154",
3
+ "version": "0.1.156",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "keywords": [],
@@ -44,7 +44,7 @@
44
44
  "postcss-loader": "^8.1.1",
45
45
  "postcss-preset-env": "^10.1.2",
46
46
  "prettier": "^2.8.8",
47
- "react-render-hooks": "^0.0.114",
47
+ "react-render-hooks": "^0.0.115",
48
48
  "rimraf": "^6.0.1",
49
49
  "scheduler": "^0.25.0",
50
50
  "style-loader": "^4.0.0",