react-mui-form-validator 1.1.9 → 1.2.0
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/lib/index.d.ts +3 -3
- package/lib/index.js +349 -88
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ declare namespace ValidatorForm {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
declare class MaterialUiPhoneNumber extends
|
|
119
|
+
declare class MaterialUiPhoneNumber extends React.Component<any, any, any> {
|
|
120
120
|
constructor(props: any);
|
|
121
121
|
flags: {};
|
|
122
122
|
guessSelectedCountry: ((inputNumber: any, onlyCountries: any, defaultCountry: any) => any) & lodash.MemoizedFunction;
|
|
@@ -173,9 +173,9 @@ declare class MaterialUiPhoneNumber extends React__default.Component<any, any, a
|
|
|
173
173
|
getDropdownProps: () => {
|
|
174
174
|
startAdornment?: undefined;
|
|
175
175
|
} | {
|
|
176
|
-
startAdornment:
|
|
176
|
+
startAdornment: React.JSX.Element;
|
|
177
177
|
};
|
|
178
|
-
render():
|
|
178
|
+
render(): React.JSX.Element;
|
|
179
179
|
}
|
|
180
180
|
declare namespace MaterialUiPhoneNumber {
|
|
181
181
|
namespace propTypes {
|
package/lib/index.js
CHANGED
|
@@ -212,7 +212,7 @@ var require_react_is_development = __commonJS({
|
|
|
212
212
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
213
213
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
214
214
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
215
|
-
var
|
|
215
|
+
var Fragment15 = REACT_FRAGMENT_TYPE;
|
|
216
216
|
var Lazy = REACT_LAZY_TYPE;
|
|
217
217
|
var Memo2 = REACT_MEMO_TYPE;
|
|
218
218
|
var Portal3 = REACT_PORTAL_TYPE;
|
|
@@ -271,7 +271,7 @@ var require_react_is_development = __commonJS({
|
|
|
271
271
|
exports.ContextProvider = ContextProvider;
|
|
272
272
|
exports.Element = Element2;
|
|
273
273
|
exports.ForwardRef = ForwardRef2;
|
|
274
|
-
exports.Fragment =
|
|
274
|
+
exports.Fragment = Fragment15;
|
|
275
275
|
exports.Lazy = Lazy;
|
|
276
276
|
exports.Memo = Memo2;
|
|
277
277
|
exports.Portal = Portal3;
|
|
@@ -1174,7 +1174,7 @@ var require_react_is_development2 = __commonJS({
|
|
|
1174
1174
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1175
1175
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
1176
1176
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
1177
|
-
var
|
|
1177
|
+
var Fragment15 = REACT_FRAGMENT_TYPE;
|
|
1178
1178
|
var Lazy = REACT_LAZY_TYPE;
|
|
1179
1179
|
var Memo2 = REACT_MEMO_TYPE;
|
|
1180
1180
|
var Portal3 = REACT_PORTAL_TYPE;
|
|
@@ -1242,7 +1242,7 @@ var require_react_is_development2 = __commonJS({
|
|
|
1242
1242
|
exports.ContextProvider = ContextProvider;
|
|
1243
1243
|
exports.Element = Element2;
|
|
1244
1244
|
exports.ForwardRef = ForwardRef2;
|
|
1245
|
-
exports.Fragment =
|
|
1245
|
+
exports.Fragment = Fragment15;
|
|
1246
1246
|
exports.Lazy = Lazy;
|
|
1247
1247
|
exports.Memo = Memo2;
|
|
1248
1248
|
exports.Portal = Portal3;
|
|
@@ -1465,7 +1465,7 @@ var require_react_is_development3 = __commonJS({
|
|
|
1465
1465
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1466
1466
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
1467
1467
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
1468
|
-
var
|
|
1468
|
+
var Fragment15 = REACT_FRAGMENT_TYPE;
|
|
1469
1469
|
var Lazy = REACT_LAZY_TYPE;
|
|
1470
1470
|
var Memo2 = REACT_MEMO_TYPE;
|
|
1471
1471
|
var Portal3 = REACT_PORTAL_TYPE;
|
|
@@ -1524,7 +1524,7 @@ var require_react_is_development3 = __commonJS({
|
|
|
1524
1524
|
exports.ContextProvider = ContextProvider;
|
|
1525
1525
|
exports.Element = Element2;
|
|
1526
1526
|
exports.ForwardRef = ForwardRef2;
|
|
1527
|
-
exports.Fragment =
|
|
1527
|
+
exports.Fragment = Fragment15;
|
|
1528
1528
|
exports.Lazy = Lazy;
|
|
1529
1529
|
exports.Memo = Memo2;
|
|
1530
1530
|
exports.Portal = Portal3;
|
|
@@ -2035,29 +2035,29 @@ function getFunctionName(fn) {
|
|
|
2035
2035
|
const name = match2 && match2[1];
|
|
2036
2036
|
return name || "";
|
|
2037
2037
|
}
|
|
2038
|
-
function getFunctionComponentName(
|
|
2039
|
-
return
|
|
2038
|
+
function getFunctionComponentName(Component3, fallback = "") {
|
|
2039
|
+
return Component3.displayName || Component3.name || getFunctionName(Component3) || fallback;
|
|
2040
2040
|
}
|
|
2041
2041
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
2042
2042
|
const functionName = getFunctionComponentName(innerType);
|
|
2043
2043
|
return outerType.displayName || (functionName !== "" ? `${wrapperName}(${functionName})` : wrapperName);
|
|
2044
2044
|
}
|
|
2045
|
-
function getDisplayName(
|
|
2046
|
-
if (
|
|
2045
|
+
function getDisplayName(Component3) {
|
|
2046
|
+
if (Component3 == null) {
|
|
2047
2047
|
return void 0;
|
|
2048
2048
|
}
|
|
2049
|
-
if (typeof
|
|
2050
|
-
return
|
|
2049
|
+
if (typeof Component3 === "string") {
|
|
2050
|
+
return Component3;
|
|
2051
2051
|
}
|
|
2052
|
-
if (typeof
|
|
2053
|
-
return getFunctionComponentName(
|
|
2052
|
+
if (typeof Component3 === "function") {
|
|
2053
|
+
return getFunctionComponentName(Component3, "Component");
|
|
2054
2054
|
}
|
|
2055
|
-
if (typeof
|
|
2056
|
-
switch (
|
|
2055
|
+
if (typeof Component3 === "object") {
|
|
2056
|
+
switch (Component3.$$typeof) {
|
|
2057
2057
|
case import_react_is.ForwardRef:
|
|
2058
|
-
return getWrappedName(
|
|
2058
|
+
return getWrappedName(Component3, Component3.render, "ForwardRef");
|
|
2059
2059
|
case import_react_is.Memo:
|
|
2060
|
-
return getWrappedName(
|
|
2060
|
+
return getWrappedName(Component3, Component3.type, "memo");
|
|
2061
2061
|
default:
|
|
2062
2062
|
return void 0;
|
|
2063
2063
|
}
|
|
@@ -7162,7 +7162,7 @@ function createStyled3(input = {}) {
|
|
|
7162
7162
|
}))
|
|
7163
7163
|
}));
|
|
7164
7164
|
}
|
|
7165
|
-
const
|
|
7165
|
+
const Component3 = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
7166
7166
|
if (process.env.NODE_ENV !== "production") {
|
|
7167
7167
|
let displayName;
|
|
7168
7168
|
if (componentName) {
|
|
@@ -7171,12 +7171,12 @@ function createStyled3(input = {}) {
|
|
|
7171
7171
|
if (displayName === void 0) {
|
|
7172
7172
|
displayName = `Styled(${getDisplayName(tag)})`;
|
|
7173
7173
|
}
|
|
7174
|
-
|
|
7174
|
+
Component3.displayName = displayName;
|
|
7175
7175
|
}
|
|
7176
7176
|
if (tag.muiName) {
|
|
7177
|
-
|
|
7177
|
+
Component3.muiName = tag.muiName;
|
|
7178
7178
|
}
|
|
7179
|
-
return
|
|
7179
|
+
return Component3;
|
|
7180
7180
|
};
|
|
7181
7181
|
if (defaultStyledResolver.withConfig) {
|
|
7182
7182
|
muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
|
|
@@ -11939,20 +11939,20 @@ var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
|
|
|
11939
11939
|
}
|
|
11940
11940
|
};
|
|
11941
11941
|
_proto.render = function render() {
|
|
11942
|
-
var _this$props = this.props,
|
|
11942
|
+
var _this$props = this.props, Component3 = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
|
|
11943
11943
|
var contextValue = this.state.contextValue;
|
|
11944
11944
|
var children = values2(this.state.children).map(childFactory2);
|
|
11945
11945
|
delete props.appear;
|
|
11946
11946
|
delete props.enter;
|
|
11947
11947
|
delete props.exit;
|
|
11948
|
-
if (
|
|
11948
|
+
if (Component3 === null) {
|
|
11949
11949
|
return /* @__PURE__ */ import_react9.default.createElement(TransitionGroupContext_default.Provider, {
|
|
11950
11950
|
value: contextValue
|
|
11951
11951
|
}, children);
|
|
11952
11952
|
}
|
|
11953
11953
|
return /* @__PURE__ */ import_react9.default.createElement(TransitionGroupContext_default.Provider, {
|
|
11954
11954
|
value: contextValue
|
|
11955
|
-
}, /* @__PURE__ */ import_react9.default.createElement(
|
|
11955
|
+
}, /* @__PURE__ */ import_react9.default.createElement(Component3, props, children));
|
|
11956
11956
|
};
|
|
11957
11957
|
return TransitionGroup2;
|
|
11958
11958
|
}(import_react9.default.Component);
|
|
@@ -14887,7 +14887,7 @@ var SvgIcon_default = SvgIcon;
|
|
|
14887
14887
|
// node_modules/@mui/material/utils/createSvgIcon.js
|
|
14888
14888
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
14889
14889
|
function createSvgIcon(path, displayName) {
|
|
14890
|
-
function
|
|
14890
|
+
function Component3(props, ref) {
|
|
14891
14891
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SvgIcon_default, _extends({
|
|
14892
14892
|
"data-testid": `${displayName}Icon`,
|
|
14893
14893
|
ref
|
|
@@ -14896,10 +14896,10 @@ function createSvgIcon(path, displayName) {
|
|
|
14896
14896
|
}));
|
|
14897
14897
|
}
|
|
14898
14898
|
if (process.env.NODE_ENV !== "production") {
|
|
14899
|
-
|
|
14899
|
+
Component3.displayName = `${displayName}Icon`;
|
|
14900
14900
|
}
|
|
14901
|
-
|
|
14902
|
-
return /* @__PURE__ */ React49.memo(/* @__PURE__ */ React49.forwardRef(
|
|
14901
|
+
Component3.muiName = SvgIcon_default.muiName;
|
|
14902
|
+
return /* @__PURE__ */ React49.memo(/* @__PURE__ */ React49.forwardRef(Component3));
|
|
14903
14903
|
}
|
|
14904
14904
|
|
|
14905
14905
|
// node_modules/@mui/material/internal/svg-icons/ArrowDropDown.js
|
|
@@ -17123,10 +17123,10 @@ var Typography = /* @__PURE__ */ React62.forwardRef(function Typography2(inProps
|
|
|
17123
17123
|
variant,
|
|
17124
17124
|
variantMapping
|
|
17125
17125
|
});
|
|
17126
|
-
const
|
|
17126
|
+
const Component3 = component || (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
|
|
17127
17127
|
const classes = useUtilityClasses22(ownerState);
|
|
17128
17128
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TypographyRoot, _extends({
|
|
17129
|
-
as:
|
|
17129
|
+
as: Component3,
|
|
17130
17130
|
ref,
|
|
17131
17131
|
ownerState,
|
|
17132
17132
|
className: clsx_default(classes.root, className)
|
|
@@ -18030,9 +18030,8 @@ var MuiSelect = class extends ValidatorComponent_default {
|
|
|
18030
18030
|
};
|
|
18031
18031
|
|
|
18032
18032
|
// src/components/MuiPhoneNumber/index.jsx
|
|
18033
|
-
var
|
|
18033
|
+
var React69 = __toESM(require("react"));
|
|
18034
18034
|
var import_prop_types51 = __toESM(require_prop_types());
|
|
18035
|
-
var import_x22 = __toESM(require("country-flag-icons/react/3x2"));
|
|
18036
18035
|
var import_lodash = require("lodash");
|
|
18037
18036
|
|
|
18038
18037
|
// src/core/data/country.ts
|
|
@@ -18676,53 +18675,316 @@ var allCountries = [].concat(
|
|
|
18676
18675
|
})
|
|
18677
18676
|
);
|
|
18678
18677
|
|
|
18679
|
-
// src/components/MuiPhoneNumber/Item.
|
|
18680
|
-
var
|
|
18678
|
+
// src/components/MuiPhoneNumber/Item.tsx
|
|
18679
|
+
var React68 = __toESM(require("react"));
|
|
18681
18680
|
var import_prop_types50 = __toESM(require_prop_types());
|
|
18681
|
+
|
|
18682
|
+
// src/core/data/iso.ts
|
|
18682
18683
|
var import_x2 = __toESM(require("country-flag-icons/react/3x2"));
|
|
18683
|
-
var
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
|
|
18712
|
-
|
|
18713
|
-
|
|
18684
|
+
var ISOCountries = () => [
|
|
18685
|
+
import_x2.default.AC,
|
|
18686
|
+
import_x2.default.AD,
|
|
18687
|
+
import_x2.default.AE,
|
|
18688
|
+
import_x2.default.AF,
|
|
18689
|
+
import_x2.default.AG,
|
|
18690
|
+
import_x2.default.AI,
|
|
18691
|
+
import_x2.default.AL,
|
|
18692
|
+
import_x2.default.AM,
|
|
18693
|
+
import_x2.default.AO,
|
|
18694
|
+
import_x2.default.AQ,
|
|
18695
|
+
import_x2.default.AR,
|
|
18696
|
+
import_x2.default.AS,
|
|
18697
|
+
import_x2.default.AT,
|
|
18698
|
+
import_x2.default.AU,
|
|
18699
|
+
import_x2.default.AW,
|
|
18700
|
+
import_x2.default.AX,
|
|
18701
|
+
import_x2.default.AZ,
|
|
18702
|
+
import_x2.default.BA,
|
|
18703
|
+
import_x2.default.BB,
|
|
18704
|
+
import_x2.default.BD,
|
|
18705
|
+
import_x2.default.BE,
|
|
18706
|
+
import_x2.default.BF,
|
|
18707
|
+
import_x2.default.BG,
|
|
18708
|
+
import_x2.default.BH,
|
|
18709
|
+
import_x2.default.BI,
|
|
18710
|
+
import_x2.default.BJ,
|
|
18711
|
+
import_x2.default.BL,
|
|
18712
|
+
import_x2.default.BM,
|
|
18713
|
+
import_x2.default.BN,
|
|
18714
|
+
import_x2.default.BO,
|
|
18715
|
+
import_x2.default.BQ,
|
|
18716
|
+
import_x2.default.BR,
|
|
18717
|
+
import_x2.default.BS,
|
|
18718
|
+
import_x2.default.BT,
|
|
18719
|
+
import_x2.default.BV,
|
|
18720
|
+
import_x2.default.BW,
|
|
18721
|
+
import_x2.default.BY,
|
|
18722
|
+
import_x2.default.BZ,
|
|
18723
|
+
import_x2.default.CA,
|
|
18724
|
+
import_x2.default.CC,
|
|
18725
|
+
import_x2.default.CD,
|
|
18726
|
+
import_x2.default.CF,
|
|
18727
|
+
import_x2.default.CG,
|
|
18728
|
+
import_x2.default.CH,
|
|
18729
|
+
import_x2.default.CI,
|
|
18730
|
+
import_x2.default.CK,
|
|
18731
|
+
import_x2.default.CL,
|
|
18732
|
+
import_x2.default.CM,
|
|
18733
|
+
import_x2.default.CN,
|
|
18734
|
+
import_x2.default.CO,
|
|
18735
|
+
import_x2.default.CR,
|
|
18736
|
+
import_x2.default.CU,
|
|
18737
|
+
import_x2.default.CV,
|
|
18738
|
+
import_x2.default.CW,
|
|
18739
|
+
import_x2.default.CX,
|
|
18740
|
+
import_x2.default.CY,
|
|
18741
|
+
import_x2.default.CZ,
|
|
18742
|
+
import_x2.default.DE,
|
|
18743
|
+
import_x2.default.DJ,
|
|
18744
|
+
import_x2.default.DK,
|
|
18745
|
+
import_x2.default.DM,
|
|
18746
|
+
import_x2.default.DO,
|
|
18747
|
+
import_x2.default.DZ,
|
|
18748
|
+
import_x2.default.EC,
|
|
18749
|
+
import_x2.default.EE,
|
|
18750
|
+
import_x2.default.EG,
|
|
18751
|
+
import_x2.default.EH,
|
|
18752
|
+
import_x2.default.ER,
|
|
18753
|
+
import_x2.default.ES,
|
|
18754
|
+
import_x2.default.ET,
|
|
18755
|
+
import_x2.default.EU,
|
|
18756
|
+
import_x2.default.FI,
|
|
18757
|
+
import_x2.default.FJ,
|
|
18758
|
+
import_x2.default.FK,
|
|
18759
|
+
import_x2.default.FM,
|
|
18760
|
+
import_x2.default.FO,
|
|
18761
|
+
import_x2.default.FR,
|
|
18762
|
+
import_x2.default.GA,
|
|
18763
|
+
import_x2.default.GB,
|
|
18764
|
+
import_x2.default.GD,
|
|
18765
|
+
import_x2.default.GE,
|
|
18766
|
+
import_x2.default.GF,
|
|
18767
|
+
import_x2.default.GG,
|
|
18768
|
+
import_x2.default.GH,
|
|
18769
|
+
import_x2.default.GI,
|
|
18770
|
+
import_x2.default.GL,
|
|
18771
|
+
import_x2.default.GM,
|
|
18772
|
+
import_x2.default.GN,
|
|
18773
|
+
import_x2.default.GP,
|
|
18774
|
+
import_x2.default.GQ,
|
|
18775
|
+
import_x2.default.GR,
|
|
18776
|
+
import_x2.default.GS,
|
|
18777
|
+
import_x2.default.GT,
|
|
18778
|
+
import_x2.default.GU,
|
|
18779
|
+
import_x2.default.GW,
|
|
18780
|
+
import_x2.default.GY,
|
|
18781
|
+
import_x2.default.HK,
|
|
18782
|
+
import_x2.default.HM,
|
|
18783
|
+
import_x2.default.HN,
|
|
18784
|
+
import_x2.default.HR,
|
|
18785
|
+
import_x2.default.HT,
|
|
18786
|
+
import_x2.default.HU,
|
|
18787
|
+
import_x2.default.IC,
|
|
18788
|
+
import_x2.default.ID,
|
|
18789
|
+
import_x2.default.IE,
|
|
18790
|
+
import_x2.default.IL,
|
|
18791
|
+
import_x2.default.IM,
|
|
18792
|
+
import_x2.default.IN,
|
|
18793
|
+
import_x2.default.IO,
|
|
18794
|
+
import_x2.default.IQ,
|
|
18795
|
+
import_x2.default.IR,
|
|
18796
|
+
import_x2.default.IS,
|
|
18797
|
+
import_x2.default.IT,
|
|
18798
|
+
import_x2.default.JE,
|
|
18799
|
+
import_x2.default.JM,
|
|
18800
|
+
import_x2.default.JO,
|
|
18801
|
+
import_x2.default.JP,
|
|
18802
|
+
import_x2.default.KE,
|
|
18803
|
+
import_x2.default.KG,
|
|
18804
|
+
import_x2.default.KH,
|
|
18805
|
+
import_x2.default.KI,
|
|
18806
|
+
import_x2.default.KM,
|
|
18807
|
+
import_x2.default.KN,
|
|
18808
|
+
import_x2.default.KP,
|
|
18809
|
+
import_x2.default.KR,
|
|
18810
|
+
import_x2.default.KW,
|
|
18811
|
+
import_x2.default.KY,
|
|
18812
|
+
import_x2.default.KZ,
|
|
18813
|
+
import_x2.default.LA,
|
|
18814
|
+
import_x2.default.LB,
|
|
18815
|
+
import_x2.default.LC,
|
|
18816
|
+
import_x2.default.LI,
|
|
18817
|
+
import_x2.default.LK,
|
|
18818
|
+
import_x2.default.LR,
|
|
18819
|
+
import_x2.default.LS,
|
|
18820
|
+
import_x2.default.LT,
|
|
18821
|
+
import_x2.default.LU,
|
|
18822
|
+
import_x2.default.LV,
|
|
18823
|
+
import_x2.default.LY,
|
|
18824
|
+
import_x2.default.MA,
|
|
18825
|
+
import_x2.default.MC,
|
|
18826
|
+
import_x2.default.MD,
|
|
18827
|
+
import_x2.default.ME,
|
|
18828
|
+
import_x2.default.MF,
|
|
18829
|
+
import_x2.default.MG,
|
|
18830
|
+
import_x2.default.MH,
|
|
18831
|
+
import_x2.default.MK,
|
|
18832
|
+
import_x2.default.ML,
|
|
18833
|
+
import_x2.default.MM,
|
|
18834
|
+
import_x2.default.MN,
|
|
18835
|
+
import_x2.default.MO,
|
|
18836
|
+
import_x2.default.MP,
|
|
18837
|
+
import_x2.default.MQ,
|
|
18838
|
+
import_x2.default.MR,
|
|
18839
|
+
import_x2.default.MS,
|
|
18840
|
+
import_x2.default.MT,
|
|
18841
|
+
import_x2.default.MU,
|
|
18842
|
+
import_x2.default.MV,
|
|
18843
|
+
import_x2.default.MW,
|
|
18844
|
+
import_x2.default.MX,
|
|
18845
|
+
import_x2.default.MY,
|
|
18846
|
+
import_x2.default.MZ,
|
|
18847
|
+
import_x2.default.NA,
|
|
18848
|
+
import_x2.default.NC,
|
|
18849
|
+
import_x2.default.NE,
|
|
18850
|
+
import_x2.default.NF,
|
|
18851
|
+
import_x2.default.NG,
|
|
18852
|
+
import_x2.default.NI,
|
|
18853
|
+
import_x2.default.NL,
|
|
18854
|
+
import_x2.default.NO,
|
|
18855
|
+
import_x2.default.NP,
|
|
18856
|
+
import_x2.default.NR,
|
|
18857
|
+
import_x2.default.NU,
|
|
18858
|
+
import_x2.default.NZ,
|
|
18859
|
+
import_x2.default.OM,
|
|
18860
|
+
import_x2.default.PA,
|
|
18861
|
+
import_x2.default.PE,
|
|
18862
|
+
import_x2.default.PF,
|
|
18863
|
+
import_x2.default.PG,
|
|
18864
|
+
import_x2.default.PH,
|
|
18865
|
+
import_x2.default.PK,
|
|
18866
|
+
import_x2.default.PL,
|
|
18867
|
+
import_x2.default.PM,
|
|
18868
|
+
import_x2.default.PN,
|
|
18869
|
+
import_x2.default.PR,
|
|
18870
|
+
import_x2.default.PS,
|
|
18871
|
+
import_x2.default.PT,
|
|
18872
|
+
import_x2.default.PW,
|
|
18873
|
+
import_x2.default.PY,
|
|
18874
|
+
import_x2.default.QA,
|
|
18875
|
+
import_x2.default.RE,
|
|
18876
|
+
import_x2.default.RO,
|
|
18877
|
+
import_x2.default.RS,
|
|
18878
|
+
import_x2.default.RU,
|
|
18879
|
+
import_x2.default.RW,
|
|
18880
|
+
import_x2.default.SA,
|
|
18881
|
+
import_x2.default.SB,
|
|
18882
|
+
import_x2.default.SC,
|
|
18883
|
+
import_x2.default.SD,
|
|
18884
|
+
import_x2.default.SE,
|
|
18885
|
+
import_x2.default.SG,
|
|
18886
|
+
import_x2.default.SH,
|
|
18887
|
+
import_x2.default.SI,
|
|
18888
|
+
import_x2.default.SJ,
|
|
18889
|
+
import_x2.default.SK,
|
|
18890
|
+
import_x2.default.SL,
|
|
18891
|
+
import_x2.default.SM,
|
|
18892
|
+
import_x2.default.SN,
|
|
18893
|
+
import_x2.default.SO,
|
|
18894
|
+
import_x2.default.SR,
|
|
18895
|
+
import_x2.default.SS,
|
|
18896
|
+
import_x2.default.ST,
|
|
18897
|
+
import_x2.default.SV,
|
|
18898
|
+
import_x2.default.SX,
|
|
18899
|
+
import_x2.default.SY,
|
|
18900
|
+
import_x2.default.SZ,
|
|
18901
|
+
import_x2.default.TA,
|
|
18902
|
+
import_x2.default.TC,
|
|
18903
|
+
import_x2.default.TD,
|
|
18904
|
+
import_x2.default.TF,
|
|
18905
|
+
import_x2.default.TG,
|
|
18906
|
+
import_x2.default.TH,
|
|
18907
|
+
import_x2.default.TJ,
|
|
18908
|
+
import_x2.default.TK,
|
|
18909
|
+
import_x2.default.TL,
|
|
18910
|
+
import_x2.default.TM,
|
|
18911
|
+
import_x2.default.TN,
|
|
18912
|
+
import_x2.default.TO,
|
|
18913
|
+
import_x2.default.TR,
|
|
18914
|
+
import_x2.default.TT,
|
|
18915
|
+
import_x2.default.TV,
|
|
18916
|
+
import_x2.default.TW,
|
|
18917
|
+
import_x2.default.TZ,
|
|
18918
|
+
import_x2.default.UA,
|
|
18919
|
+
import_x2.default.UG,
|
|
18920
|
+
import_x2.default.UM,
|
|
18921
|
+
import_x2.default.US,
|
|
18922
|
+
import_x2.default.UY,
|
|
18923
|
+
import_x2.default.UZ,
|
|
18924
|
+
import_x2.default.VA,
|
|
18925
|
+
import_x2.default.VC,
|
|
18926
|
+
import_x2.default.VE,
|
|
18927
|
+
import_x2.default.VG,
|
|
18928
|
+
import_x2.default.VI,
|
|
18929
|
+
import_x2.default.VN,
|
|
18930
|
+
import_x2.default.VU,
|
|
18931
|
+
import_x2.default.WF,
|
|
18932
|
+
import_x2.default.WS,
|
|
18933
|
+
import_x2.default.XK,
|
|
18934
|
+
import_x2.default.YE,
|
|
18935
|
+
import_x2.default.YT,
|
|
18936
|
+
import_x2.default.ZA,
|
|
18937
|
+
import_x2.default.ZM,
|
|
18938
|
+
import_x2.default.ZW
|
|
18939
|
+
];
|
|
18940
|
+
|
|
18941
|
+
// src/components/MuiPhoneNumber/Item.tsx
|
|
18942
|
+
var Item = (props) => {
|
|
18943
|
+
const {
|
|
18944
|
+
name,
|
|
18945
|
+
iso2,
|
|
18946
|
+
dialCode,
|
|
18947
|
+
localization,
|
|
18948
|
+
itemRef,
|
|
18949
|
+
selected,
|
|
18950
|
+
onClick,
|
|
18951
|
+
native,
|
|
18952
|
+
className = "",
|
|
18953
|
+
...restProps
|
|
18954
|
+
} = props;
|
|
18955
|
+
if (native) {
|
|
18956
|
+
return /* @__PURE__ */ React68.createElement(
|
|
18957
|
+
"option",
|
|
18714
18958
|
{
|
|
18715
|
-
ref,
|
|
18716
18959
|
className: "country",
|
|
18717
18960
|
"data-dial-code": "1",
|
|
18718
18961
|
"data-country-code": iso2,
|
|
18962
|
+
selected,
|
|
18963
|
+
value: iso2,
|
|
18964
|
+
onClick,
|
|
18719
18965
|
...restProps
|
|
18720
18966
|
},
|
|
18721
|
-
|
|
18722
|
-
|
|
18723
|
-
|
|
18967
|
+
localization || name,
|
|
18968
|
+
" ",
|
|
18969
|
+
`+${dialCode}`
|
|
18724
18970
|
);
|
|
18725
18971
|
}
|
|
18972
|
+
const FlagComponent = ISOCountries[iso2.toUpperCase()];
|
|
18973
|
+
return /* @__PURE__ */ React68.createElement(
|
|
18974
|
+
MenuItem_default,
|
|
18975
|
+
{
|
|
18976
|
+
id: "mui_country_id",
|
|
18977
|
+
className: "country",
|
|
18978
|
+
"data-dial-code": "1",
|
|
18979
|
+
selected,
|
|
18980
|
+
"data-country-code": iso2,
|
|
18981
|
+
onClick,
|
|
18982
|
+
...restProps
|
|
18983
|
+
},
|
|
18984
|
+
Boolean(FlagComponent) && /* @__PURE__ */ React68.createElement("div", { className }, /* @__PURE__ */ React68.createElement(FlagComponent, null)),
|
|
18985
|
+
/* @__PURE__ */ React68.createElement("span", { className: "country-name" }, localization || name),
|
|
18986
|
+
/* @__PURE__ */ React68.createElement("span", { className: "dial-code" }, `+${dialCode}`)
|
|
18987
|
+
);
|
|
18726
18988
|
};
|
|
18727
18989
|
Item.propTypes = {
|
|
18728
18990
|
name: import_prop_types50.default.string.isRequired,
|
|
@@ -18730,7 +18992,10 @@ Item.propTypes = {
|
|
|
18730
18992
|
dialCode: import_prop_types50.default.string.isRequired,
|
|
18731
18993
|
itemRef: import_prop_types50.default.func.isRequired,
|
|
18732
18994
|
localization: import_prop_types50.default.string,
|
|
18733
|
-
native: import_prop_types50.default.bool
|
|
18995
|
+
native: import_prop_types50.default.bool,
|
|
18996
|
+
selected: import_prop_types50.default.bool,
|
|
18997
|
+
onClick: import_prop_types50.default.func,
|
|
18998
|
+
className: import_prop_types50.default.string
|
|
18734
18999
|
};
|
|
18735
19000
|
Item.defaultProps = {
|
|
18736
19001
|
localization: null,
|
|
@@ -18772,7 +19037,7 @@ var useStyles = (0, import_mui_styles.makeStyles)({
|
|
|
18772
19037
|
});
|
|
18773
19038
|
|
|
18774
19039
|
// src/components/MuiPhoneNumber/index.jsx
|
|
18775
|
-
var MaterialUiPhoneNumber = class extends
|
|
19040
|
+
var MaterialUiPhoneNumber = class extends React69.Component {
|
|
18776
19041
|
flags = {};
|
|
18777
19042
|
guessSelectedCountry = (0, import_lodash.memoize)(
|
|
18778
19043
|
(inputNumber, onlyCountries, defaultCountry) => {
|
|
@@ -18792,8 +19057,7 @@ var MaterialUiPhoneNumber = class extends import_react16.default.Component {
|
|
|
18792
19057
|
}
|
|
18793
19058
|
return selectedCountry;
|
|
18794
19059
|
},
|
|
18795
|
-
{ dialCode: "", priority: 10001 }
|
|
18796
|
-
this
|
|
19060
|
+
{ dialCode: "", priority: 10001 }
|
|
18797
19061
|
);
|
|
18798
19062
|
if (!bestGuess.name)
|
|
18799
19063
|
return secondBestGuess;
|
|
@@ -19294,14 +19558,12 @@ var MaterialUiPhoneNumber = class extends import_react16.default.Component {
|
|
|
19294
19558
|
return localizedA.localeCompare(localizedB);
|
|
19295
19559
|
});
|
|
19296
19560
|
const isSelected = (country) => Boolean(selectedCountry && selectedCountry.dialCode === country.dialCode);
|
|
19297
|
-
const FlagComponent =
|
|
19561
|
+
const FlagComponent = ISOCountries[selectedCountry.iso2.toUpperCase()];
|
|
19298
19562
|
const dropdownProps = disableDropdown ? {} : {
|
|
19299
|
-
startAdornment: /* @__PURE__ */
|
|
19563
|
+
startAdornment: /* @__PURE__ */ React69.createElement(InputAdornment_default, { className: classes.positionStart, position: "start" }, native ? /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(
|
|
19300
19564
|
NativeSelect_default,
|
|
19301
19565
|
{
|
|
19302
19566
|
id: "country-menu",
|
|
19303
|
-
open: Boolean(anchorEl),
|
|
19304
|
-
onClose: () => this.setState({ anchorEl: null }),
|
|
19305
19567
|
className: classes.native,
|
|
19306
19568
|
classes: {
|
|
19307
19569
|
root: clsx_default(classes.nativeRoot, "native"),
|
|
@@ -19311,7 +19573,7 @@ var MaterialUiPhoneNumber = class extends import_react16.default.Component {
|
|
|
19311
19573
|
IconComponent: Boolean(FlagComponent) && FlagComponent,
|
|
19312
19574
|
disableUnderline: true
|
|
19313
19575
|
},
|
|
19314
|
-
!!preferredCountries.length && (0, import_lodash.map)(preferredCountries, (country, index) => /* @__PURE__ */
|
|
19576
|
+
!!preferredCountries.length && (0, import_lodash.map)(preferredCountries, (country, index) => /* @__PURE__ */ React69.createElement(
|
|
19315
19577
|
Item_default,
|
|
19316
19578
|
{
|
|
19317
19579
|
key: `preferred_${country.iso2}_${index}`,
|
|
@@ -19325,7 +19587,7 @@ var MaterialUiPhoneNumber = class extends import_react16.default.Component {
|
|
|
19325
19587
|
native: true
|
|
19326
19588
|
}
|
|
19327
19589
|
)),
|
|
19328
|
-
(0, import_lodash.map)(onlyCountries, (country, index) => /* @__PURE__ */
|
|
19590
|
+
(0, import_lodash.map)(onlyCountries, (country, index) => /* @__PURE__ */ React69.createElement(
|
|
19329
19591
|
Item_default,
|
|
19330
19592
|
{
|
|
19331
19593
|
key: `preferred_${country.iso2}_${index}`,
|
|
@@ -19339,17 +19601,16 @@ var MaterialUiPhoneNumber = class extends import_react16.default.Component {
|
|
|
19339
19601
|
native: true
|
|
19340
19602
|
}
|
|
19341
19603
|
))
|
|
19342
|
-
)) : /* @__PURE__ */
|
|
19604
|
+
)) : /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(
|
|
19343
19605
|
IconButton_default,
|
|
19344
19606
|
{
|
|
19345
19607
|
className: classes.flagButton,
|
|
19346
|
-
"aria-owns": anchorEl ? "country-menu" : null,
|
|
19347
19608
|
"aria-label": "Select country",
|
|
19348
19609
|
onClick: (e) => this.setState({ anchorEl: e.currentTarget }),
|
|
19349
19610
|
"aria-haspopup": true
|
|
19350
19611
|
},
|
|
19351
|
-
Boolean(FlagComponent) && /* @__PURE__ */
|
|
19352
|
-
), /* @__PURE__ */
|
|
19612
|
+
Boolean(FlagComponent) && /* @__PURE__ */ React69.createElement(FlagComponent, { className: "margin" })
|
|
19613
|
+
), /* @__PURE__ */ React69.createElement(
|
|
19353
19614
|
Menu_default,
|
|
19354
19615
|
{
|
|
19355
19616
|
className: dropdownClass,
|
|
@@ -19358,7 +19619,7 @@ var MaterialUiPhoneNumber = class extends import_react16.default.Component {
|
|
|
19358
19619
|
open: Boolean(anchorEl),
|
|
19359
19620
|
onClose: () => this.setState({ anchorEl: null })
|
|
19360
19621
|
},
|
|
19361
|
-
!!preferredCountries.length && (0, import_lodash.map)(preferredCountries, (country, index) => /* @__PURE__ */
|
|
19622
|
+
!!preferredCountries.length && (0, import_lodash.map)(preferredCountries, (country, index) => /* @__PURE__ */ React69.createElement(
|
|
19362
19623
|
Item_default,
|
|
19363
19624
|
{
|
|
19364
19625
|
key: `preferred_${country.iso2}_${index}`,
|
|
@@ -19374,8 +19635,8 @@ var MaterialUiPhoneNumber = class extends import_react16.default.Component {
|
|
|
19374
19635
|
className: classes.flagIcon
|
|
19375
19636
|
}
|
|
19376
19637
|
)),
|
|
19377
|
-
!!preferredCountries.length && /* @__PURE__ */
|
|
19378
|
-
(0, import_lodash.map)(onlyCountries, (country, index) => /* @__PURE__ */
|
|
19638
|
+
!!preferredCountries.length && /* @__PURE__ */ React69.createElement(Divider_default, null),
|
|
19639
|
+
(0, import_lodash.map)(onlyCountries, (country, index) => /* @__PURE__ */ React69.createElement(
|
|
19379
19640
|
Item_default,
|
|
19380
19641
|
{
|
|
19381
19642
|
key: `preferred_${country.iso2}_${index}`,
|
|
@@ -19427,7 +19688,7 @@ var MaterialUiPhoneNumber = class extends import_react16.default.Component {
|
|
|
19427
19688
|
...restProps
|
|
19428
19689
|
} = this.props;
|
|
19429
19690
|
const dropdownProps = this.getDropdownProps();
|
|
19430
|
-
return /* @__PURE__ */
|
|
19691
|
+
return /* @__PURE__ */ React69.createElement(
|
|
19431
19692
|
TextField_default,
|
|
19432
19693
|
{
|
|
19433
19694
|
placeholder: statePlaceholder,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-mui-form-validator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Validator for forms designed with material-ui components.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@mui/material": "^5.14.3",
|
|
43
|
-
"@types/node": "^20.4.
|
|
43
|
+
"@types/node": "^20.4.8",
|
|
44
44
|
"@types/prop-types": "^15.7.5",
|
|
45
45
|
"@types/react": "^18.2.18",
|
|
46
46
|
"@types/react-dom": "^18.2.7",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"eslint": "^8.46.0",
|
|
51
51
|
"eslint-config-airbnb": "^19.0.4",
|
|
52
52
|
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
53
|
-
"eslint-config-prettier": "^
|
|
53
|
+
"eslint-config-prettier": "^9.0.0",
|
|
54
54
|
"eslint-plugin-import": "^2.28.0",
|
|
55
55
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
56
56
|
"eslint-plugin-prettier": "^5.0.0",
|
|
57
57
|
"eslint-plugin-react": "^7.33.1",
|
|
58
58
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
59
59
|
"prop-types": "^15.8.1",
|
|
60
|
-
"tsup": "^7.
|
|
60
|
+
"tsup": "^7.2.0",
|
|
61
61
|
"typescript": "^5.1.6",
|
|
62
62
|
"warning": "^4.0.3"
|
|
63
63
|
}
|