@kingteza/crud-component 1.36.1 → 1.37.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/dist/_virtual/index.cjs.js +1 -1
- package/dist/_virtual/index.cjs2.js +1 -1
- package/dist/_virtual/index.cjs3.js +1 -1
- package/dist/_virtual/index.es.js +2 -5
- package/dist/_virtual/index.es2.js +5 -5
- package/dist/_virtual/index.es3.js +5 -2
- package/dist/crud/CrudSearchComponent.d.ts +6 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/Input.cjs.js +1 -1
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/Input.es.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.cjs.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.es.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountryIcon.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountryIcon.es.js +2 -2
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountrySelect.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountrySelect.es.js +2 -2
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/Flag.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/Flag.es.js +2 -2
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputBasic.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputBasic.es.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputSmart.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputSmart.es.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InternationalIcon.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InternationalIcon.es.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PhoneInputWithCountry.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PhoneInputWithCountry.es.js +2 -2
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PropTypes.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PropTypes.es.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const e=require("./_commonjsHelpers.cjs.js"),r=require("../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.cjs.js");var s=r.__require();const o=e.getDefaultExportFromCjs(s);module.exports=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const s=require("./_commonjsHelpers.cjs.js"),e=require("../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js");var r=e.__require();const t=s.getDefaultExportFromCjs(r);module.exports=t;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as o } from "../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.es.js";
|
|
3
|
-
var p = /* @__PURE__ */ o();
|
|
4
|
-
const s = /* @__PURE__ */ r(p);
|
|
1
|
+
var p = { exports: {} };
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
p as __module
|
|
7
4
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as o } from "../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.es.js";
|
|
3
|
+
var p = /* @__PURE__ */ o();
|
|
4
|
+
const s = /* @__PURE__ */ r(p);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as s } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as r } from "../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
|
|
3
|
+
var a = r();
|
|
4
|
+
const t = /* @__PURE__ */ s(a);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
t as default
|
|
4
7
|
};
|
|
@@ -5,10 +5,16 @@ export type CrudSearchOption<T> = {
|
|
|
5
5
|
} & ({
|
|
6
6
|
type: "text";
|
|
7
7
|
name: keyof T;
|
|
8
|
+
label?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
fieldClassName?: string;
|
|
8
11
|
} | {
|
|
9
12
|
type: "select";
|
|
10
13
|
name: keyof T;
|
|
11
14
|
multiple?: boolean;
|
|
15
|
+
label?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
fieldClassName?: string;
|
|
12
18
|
});
|
|
13
19
|
export interface CrudSearchComponentProps<T, FormType> {
|
|
14
20
|
searchFields?: Array<keyof T | CrudSearchOption<T>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("react"),u=require("../../../../../../../_virtual/index.
|
|
1
|
+
"use strict";const c=require("react"),u=require("../../../../../../../_virtual/index.cjs2.js"),m=require("./useInput.cjs.js");var w=["inputComponent","parse","format","value","defaultValue","onChange","controlled","onKeyDown","type"];function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function P(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?l(Object(t),!0).forEach(function(n){j(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function j(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function h(e,r){if(e==null)return{};var t=C(e,r),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function C(e,r){if(e==null)return{};var t={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(r.indexOf(o)>=0)&&(t[o]=e[o]);return t}function i(e,r){var t=e.inputComponent,n=t===void 0?"input":t,o=e.parse,a=e.format,f=e.value,s=e.defaultValue,y=e.onChange,O=e.controlled,d=e.onKeyDown,p=e.type,g=p===void 0?"text":p,b=h(e,w),v=m(P({ref:r,parse:o,format:a,value:f,defaultValue:s,onChange:y,controlled:O,onKeyDown:d,type:g},b));return c.createElement(n,v)}i=c.forwardRef(i);i.propTypes={parse:u.func.isRequired,format:u.func.isRequired,inputComponent:u.elementType,type:u.string,value:u.string,defaultValue:u.string,onChange:u.func,controlled:u.bool,onKeyDown:u.func,onCut:u.func,onPaste:u.func};module.exports=i;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import f from "react";
|
|
2
|
-
import u from "../../../../../../../_virtual/index.
|
|
2
|
+
import u from "../../../../../../../_virtual/index.es2.js";
|
|
3
3
|
import v from "./useInput.es.js";
|
|
4
4
|
var P = ["inputComponent", "parse", "format", "value", "defaultValue", "onChange", "controlled", "onKeyDown", "type"];
|
|
5
5
|
function l(e, r) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../../_virtual/index.cjs.js"),t=require("../../../react-is@16.13.1/node_modules/react-is/index.cjs.js"),u=require("./factoryWithTypeCheckers.cjs.js"),s=require("./factoryWithThrowingShims.cjs.js");var r;function _(){if(r)return e.__module.exports;if(r=1,process.env.NODE_ENV!=="production"){var o=t.__require(),i=!0;e.__module.exports=u.__require()(o.isElement,i)}else e.__module.exports=s.__require()();return e.__module.exports}exports.__require=_;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../../../_virtual/index.
|
|
1
|
+
import { __module as r } from "../../../../../_virtual/index.es.js";
|
|
2
2
|
import { __require as s } from "../../../react-is@16.13.1/node_modules/react-is/index.es.js";
|
|
3
3
|
import { __require as t } from "./factoryWithTypeCheckers.es.js";
|
|
4
4
|
import { __require as p } from "./factoryWithThrowingShims.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),u=require("../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),u=require("../../../../../../_virtual/index.cjs2.js"),b=require("../../../../../../_virtual/index.cjs3.js"),y=require("./InternationalIcon.cjs.js"),v=require("./Flag.cjs.js");var h=["country","label","aspectRatio"];function s(){return s=Object.assign?Object.assign.bind():function(t){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s.apply(this,arguments)}function d(t,o){if(t==null)return{};var r=C(t,o),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(o.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function C(t,o){if(t==null)return{};var r={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(o.indexOf(e)>=0)&&(r[e]=t[e]);return r}function f(t){var o=t.flags,r=t.flagUrl,n=t.flagComponent,e=t.internationalIcon;function a(i){var c=i.country,p=i.label,m=i.aspectRatio,I=d(i,h),g=e===y?m:void 0;return l.createElement("div",s({},I,{className:b("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":g===1,"PhoneInputCountryIcon--border":c})}),c?l.createElement(n,{country:c,countryName:p,flags:o,flagUrl:r,className:"PhoneInputCountryIconImg"}):l.createElement(e,{title:p,aspectRatio:g,className:"PhoneInputCountryIconImg"}))}return a.propTypes={country:u.string,label:u.string.isRequired,aspectRatio:u.number},a}f({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:v,internationalIcon:y});exports.createCountryIconComponent=f;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import c from "react";
|
|
2
|
-
import p from "../../../../../../_virtual/index.
|
|
3
|
-
import I from "../../../../../../_virtual/index.
|
|
2
|
+
import p from "../../../../../../_virtual/index.es2.js";
|
|
3
|
+
import I from "../../../../../../_virtual/index.es3.js";
|
|
4
4
|
import f from "./InternationalIcon.es.js";
|
|
5
5
|
import b from "./Flag.es.js";
|
|
6
6
|
var h = ["country", "label", "aspectRatio"];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),i=require("../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),i=require("../../../../../../_virtual/index.cjs2.js"),C=require("../../../../../../_virtual/index.cjs3.js"),O=require("../../../../country-flag-icons@1.6.12/node_modules/country-flag-icons/modules/unicode.cjs.js");var I=["value","onChange","options","disabled","readOnly"],S=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function j(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=w(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(e,t){if(e){if(typeof e=="string")return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}}function y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}function m(e,t){if(e==null)return{};var n=A(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function A(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a<r.length;a++)o=r[a],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function v(e){var t=e.value,n=e.onChange,r=e.options,o=e.disabled,a=e.readOnly,f=m(e,I),s=l.useCallback(function(c){var u=c.target.value;n(u==="ZZ"?void 0:u)},[n]);return l.useMemo(function(){return g(r,t)},[r,t]),l.createElement("select",p({},f,{disabled:o||a,readOnly:a,value:t||"ZZ",onChange:s}),r.map(function(c){var u=c.value,h=c.label,d=c.divider;return l.createElement("option",{key:d?"|":u||"ZZ",value:d?"|":u||"ZZ",disabled:!!d,style:d?E:void 0},h)}))}v.propTypes={value:i.string,onChange:i.func.isRequired,options:i.arrayOf(i.shape({value:i.string,label:i.string,divider:i.bool})).isRequired,disabled:i.bool,readOnly:i.bool};var E={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function b(e){var t=e.value,n=e.options,r=e.className,o=e.iconComponent;e.getIconAspectRatio;var a=e.arrowComponent,f=a===void 0?P:a,s=e.unicodeFlags,c=m(e,S),u=l.useMemo(function(){return g(n,t)},[n,t]);return l.createElement("div",{className:"PhoneInputCountry"},l.createElement(v,p({},c,{value:t,options:n,className:C("PhoneInputCountrySelect",r)})),u&&(s&&t?l.createElement("div",{className:"PhoneInputCountryIconUnicode"},O(t)):l.createElement(o,{"aria-hidden":!0,country:t,label:u.label,aspectRatio:s?1:void 0})),l.createElement(f,null))}b.propTypes={iconComponent:i.elementType,arrowComponent:i.elementType,unicodeFlags:i.bool};function P(){return l.createElement("div",{className:"PhoneInputCountrySelectArrow"})}function g(e,t){for(var n=j(e),r;!(r=n()).done;){var o=r.value;if(!o.divider&&T(o.value,t))return o}}function T(e,t){return e==null?t==null:e===t}exports.CountrySelectWithIcon=b;exports.default=v;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import u, { useMemo as v, useCallback as C } from "react";
|
|
2
|
-
import i from "../../../../../../_virtual/index.
|
|
3
|
-
import O from "../../../../../../_virtual/index.
|
|
2
|
+
import i from "../../../../../../_virtual/index.es2.js";
|
|
3
|
+
import O from "../../../../../../_virtual/index.es3.js";
|
|
4
4
|
import I from "../../../../country-flag-icons@1.6.12/node_modules/country-flag-icons/modules/unicode.es.js";
|
|
5
5
|
var S = ["value", "onChange", "options", "disabled", "readOnly"], w = ["value", "options", "className", "iconComponent", "getIconAspectRatio", "arrowComponent", "unicodeFlags"];
|
|
6
6
|
function A(e, n) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react"),o=require("../../../../../../_virtual/index.
|
|
1
|
+
"use strict";const s=require("react"),o=require("../../../../../../_virtual/index.cjs2.js");require("../../../../../../_virtual/index.cjs3.js");var c=["country","countryName","flags","flagUrl"];function l(){return l=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t},l.apply(this,arguments)}function f(t,r){if(t==null)return{};var n=g(t,r),e,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)e=a[i],!(r.indexOf(e)>=0)&&Object.prototype.propertyIsEnumerable.call(t,e)&&(n[e]=t[e])}return n}function g(t,r){if(t==null)return{};var n={},e=Object.keys(t),i,a;for(a=0;a<e.length;a++)i=e[a],!(r.indexOf(i)>=0)&&(n[i]=t[i]);return n}function u(t){var r=t.country,n=t.countryName,e=t.flags,i=t.flagUrl,a=f(t,c);return e&&e[r]?e[r]({title:n}):s.createElement("img",l({},a,{alt:n,role:n?void 0:"presentation",src:i.replace("{XX}",r).replace("{xx}",r.toLowerCase())}))}u.propTypes={country:o.string.isRequired,countryName:o.string.isRequired,flags:o.objectOf(o.elementType),flagUrl:o.string.isRequired};module.exports=u;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import u from "react";
|
|
2
|
-
import i from "../../../../../../_virtual/index.
|
|
3
|
-
import "../../../../../../_virtual/index.
|
|
2
|
+
import i from "../../../../../../_virtual/index.es2.js";
|
|
3
|
+
import "../../../../../../_virtual/index.es3.js";
|
|
4
4
|
var f = ["country", "countryName", "flags", "flagUrl"];
|
|
5
5
|
function l() {
|
|
6
6
|
return l = Object.assign ? Object.assign.bind() : function(t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react"),i=require("../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react"),i=require("../../../../../../_virtual/index.cjs2.js"),O=require("./helpers/inputValuePrefix.cjs.js"),P=require("./useInputKeyDownHandler.cjs.js"),T=require("../../../../libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.cjs.js"),j=require("../../../../libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.cjs.js");var F=["value","onChange","onKeyDown","country","inputFormat","metadata","inputComponent","international","withCountryCallingCode"];function s(){return s=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},s.apply(this,arguments)}function R(t,r){if(t==null)return{};var e=q(t,r),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)n=a[o],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(e[n]=t[n])}return e}function q(t,r){if(t==null)return{};var e={},n=Object.keys(t),o,a;for(a=0;a<n.length;a++)o=n[a],!(r.indexOf(o)>=0)&&(e[o]=t[o]);return e}function b(t){function r(e,n){var o=e.value,a=e.onChange,h=e.onKeyDown,l=e.country,f=e.inputFormat,v=e.metadata,p=v===void 0?t:v,d=e.inputComponent,N=d===void 0?"input":d;e.international,e.withCountryCallingCode;var I=R(e,F),c=O.getPrefixForFormattingValueAsPhoneNumber({inputFormat:f,country:l,metadata:p}),C=m.useCallback(function(g){var u=T.default(g.target.value);if(u===o){var A=y(c,u,l,p);A.indexOf(g.target.value)===0&&(u=u.slice(0,-1))}a(u)},[c,o,a,l,p]),w=P({onKeyDown:h,inputFormat:f});return m.createElement(N,s({},I,{ref:n,value:y(c,o,l,p),onChange:C,onKeyDown:w}))}return r=m.forwardRef(r),r.propTypes={value:i.string.isRequired,onChange:i.func.isRequired,onKeyDown:i.func,country:i.string,inputFormat:i.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:i.object,inputComponent:i.elementType},r}const x=b();function y(t,r,e,n){return O.removePrefixFromFormattedPhoneNumber(j(t+r,e,n),t)}exports.createInput=b;exports.default=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import g, { useCallback as w } from "react";
|
|
2
|
-
import i from "../../../../../../_virtual/index.
|
|
2
|
+
import i from "../../../../../../_virtual/index.es2.js";
|
|
3
3
|
import { getPrefixForFormattingValueAsPhoneNumber as A, removePrefixFromFormattedPhoneNumber as P } from "./helpers/inputValuePrefix.es.js";
|
|
4
4
|
import T from "./useInputKeyDownHandler.es.js";
|
|
5
5
|
import F from "../../../../libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),i=require("../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),i=require("../../../../../../_virtual/index.cjs2.js"),s=require("./helpers/inputValuePrefix.cjs.js"),h=require("./helpers/parsePhoneNumberCharacter.cjs.js"),w=require("./useInputKeyDownHandler.cjs.js"),A=require("../../../../libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouType.cjs.js"),P=require("../../../../input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/Input.cjs.js");var T=["onKeyDown","country","inputFormat","metadata","international","withCountryCallingCode"];function f(){return f=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f.apply(this,arguments)}function F(e,n){if(e==null)return{};var t=j(e,n),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function j(e,n){if(e==null)return{};var t={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(n.indexOf(a)>=0)&&(t[a]=e[a]);return t}function O(e){function n(t,r){var a=t.onKeyDown,o=t.country,y=t.inputFormat,d=t.metadata,p=d===void 0?e:d;t.international,t.withCountryCallingCode;var g=F(t,T),b=l.useCallback(function(I){var v=new A(o,p),u=s.getPrefixForFormattingValueAsPhoneNumber({inputFormat:y,country:o,metadata:p}),c=v.input(u+I),m=v.getTemplate();return u&&(c=s.removePrefixFromFormattedPhoneNumber(c,u),m&&(m=s.removePrefixFromFormattedPhoneNumber(m,u))),{text:c,template:m}},[o,p]),N=w({onKeyDown:a,inputFormat:y});return l.createElement(P,f({},g,{ref:r,parse:h,format:b,onKeyDown:N}))}return n=l.forwardRef(n),n.propTypes={value:i.string.isRequired,onChange:i.func.isRequired,onKeyDown:i.func,country:i.string,inputFormat:i.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:i.object},n}const x=O();exports.createInput=O;exports.default=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import v, { useCallback as w } from "react";
|
|
2
|
-
import i from "../../../../../../_virtual/index.
|
|
2
|
+
import i from "../../../../../../_virtual/index.es2.js";
|
|
3
3
|
import { getPrefixForFormattingValueAsPhoneNumber as A, removePrefixFromFormattedPhoneNumber as O } from "./helpers/inputValuePrefix.es.js";
|
|
4
4
|
import I from "./helpers/parsePhoneNumberCharacter.es.js";
|
|
5
5
|
import h from "./useInputKeyDownHandler.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react"),c=require("../../../../../../_virtual/index.
|
|
1
|
+
"use strict";const e=require("react"),c=require("../../../../../../_virtual/index.cjs2.js");var d=["aspectRatio"],h=["title"],E=["title"];function i(){return i=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},i.apply(this,arguments)}function s(t,r){if(t==null)return{};var n=f(t,r),a,l;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(l=0;l<o.length;l++)a=o[l],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function f(t,r){if(t==null)return{};var n={},a=Object.keys(t),l,o;for(o=0;o<a.length;o++)l=a[o],!(r.indexOf(l)>=0)&&(n[l]=t[l]);return n}function p(t){var r=t.aspectRatio,n=s(t,d);return r===1?e.createElement(m,n):e.createElement(u,n)}p.propTypes={title:c.string.isRequired,aspectRatio:c.number};function u(t){var r=t.title,n=s(t,h);return e.createElement("svg",i({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),e.createElement("title",null,r),e.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},e.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),e.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),e.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),e.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),e.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),e.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),e.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}u.propTypes={title:c.string.isRequired};function m(t){var r=t.title,n=s(t,E);return e.createElement("svg",i({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),e.createElement("title",null,r),e.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},e.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),e.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),e.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),e.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),e.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),e.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),e.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}m.propTypes={title:c.string.isRequired};module.exports=p;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
import i from "../../../../../../_virtual/index.
|
|
2
|
+
import i from "../../../../../../_virtual/index.es2.js";
|
|
3
3
|
var m = ["aspectRatio"], d = ["title"], h = ["title"];
|
|
4
4
|
function c() {
|
|
5
5
|
return c = Object.assign ? Object.assign.bind() : function(t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const P=require("react"),i=require("../../../../../../_virtual/index.cjs.js"),$=require("../../../../../../_virtual/index.cjs2.js"),tt=require("./InputSmart.cjs.js"),et=require("./InputBasic.cjs.js"),nt=require("./CountrySelect.cjs.js"),ot=require("./Flag.cjs.js"),rt=require("./InternationalIcon.cjs.js"),it=require("./helpers/isE164Number.cjs.js"),B=require("./helpers/countries.cjs.js"),at=require("./CountryIcon.cjs.js"),ut=require("./useExternalRef.cjs.js"),W=require("./PropTypes.cjs.js"),b=require("./helpers/phoneInputHelpers.cjs.js"),lt=require("./helpers/getPhoneInputWithCountryStateUpdateFromNewProps.cjs.js"),k=require("../../../../libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/getCountries.cjs.js");var st=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function w(n){"@babel/helpers - typeof";return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(n)}function K(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),o.push.apply(o,t)}return o}function H(n){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?K(Object(o),!0).forEach(function(t){p(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):K(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function F(){return F=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])}return n},F.apply(this,arguments)}function ct(n,e){if(n==null)return{};var o=pt(n,e),t,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(o[t]=n[t])}return o}function pt(n,e){if(n==null)return{};var o={},t=Object.keys(n),r,a;for(a=0;a<t.length;a++)r=t[a],!(e.indexOf(r)>=0)&&(o[r]=n[r]);return o}function yt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function X(n,e){for(var o=0;o<e.length;o++){var t=e[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,J(t.key),t)}}function ft(n,e,o){return e&&X(n.prototype,e),o&&X(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n}function dt(n,e,o){return e=T(e),mt(n,G()?Reflect.construct(e,o||[],T(n).constructor):e.apply(n,o))}function mt(n,e){if(e&&(w(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ct(n)}function Ct(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function G(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G=function(){return!!n})()}function T(n){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},T(n)}function gt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&U(n,e)}function U(n,e){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},U(n,e)}function p(n,e,o){return e=J(e),e in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}function J(n){var e=ht(n,"string");return w(e)=="symbol"?e:e+""}function ht(n,e){if(w(n)!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var t=o.call(n,e);if(w(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var bt=(function(n){function e(o){var t;yt(this,e),t=dt(this,e,[o]),p(t,"setInputRef",function(l){ut.setRefsValue([t.props.inputRef,t.inputRef],l)}),p(t,"isCountrySupportedWithError",function(l){var u=t.props.metadata;return B.isCountrySupportedWithError(l,u)}),p(t,"onCountryChange",function(l){var u=t.props,c=u.international,d=u.metadata,N=u.onChange,h=u.focusInputOnCountrySelection,v=t.state,j=v.phoneDigits,D=v.country,m=b.getPhoneDigitsForNewCountry(j,{prevCountry:D,newCountry:l,metadata:d,useNationalFormat:!c}),S=b.e164(m,l,d);h&&t.inputRef.current.focus(),t.setState({country:l,latestCountrySelectedByUser:l,hasUserSelectedACountry:!0,phoneDigits:m,value:S},function(){N(S)})}),p(t,"onChange",function(l){var u=t.props,c=u.defaultCountry,d=u.onChange,N=u.addInternationalOption,h=u.international,v=u.limitMaxLength,j=u.countryCallingCodeEditable,D=u.metadata,m=t.state,S=m.countries,A=m.phoneDigits,Y=m.country,L=m.latestCountrySelectedByUser,M=b.onPhoneDigitsChange(l,{prevPhoneDigits:A,country:Y,countryRequired:!N,defaultCountry:c,latestCountrySelectedByUser:L,getAnyCountry:function(){return t.getFirstSupportedCountry({countries:S})},countries:S,international:h,limitMaxLength:v,countryCallingCodeEditable:j,metadata:D}),V=M.phoneDigits,Z=M.country,R=M.value,x={phoneDigits:V,value:R,country:Z};L&&R&&!b.couldNumberBelongToCountry(R,L,D)&&(x.latestCountrySelectedByUser=void 0),j===!1&&!R&&V===t.state.phoneDigits&&(x.forceRerender={}),t.setState(x,function(){return d(R)})}),p(t,"_onFocus",function(){return t.setState({isFocused:!0})}),p(t,"_onBlur",function(){return t.setState({isFocused:!1})}),p(t,"onFocus",function(l){t._onFocus();var u=t.props.onFocus;u&&u(l)}),p(t,"onBlur",function(l){var u=t.props.onBlur;t._onBlur(),u&&u(l)}),p(t,"onCountryFocus",function(l){t._onFocus();var u=t.props.countrySelectProps;if(u){var c=u.onFocus;c&&c(l)}}),p(t,"onCountryBlur",function(l){t._onBlur();var u=t.props.countrySelectProps;if(u){var c=u.onBlur;c&&c(l)}}),t.inputRef=P.createRef();var r=t.props,a=r.value;r.labels;var y=r.international,E=r.addInternationalOption,I=r.displayInitialValueAsLocalNumber,_=r.initialValueFormat,f=r.metadata,C=t.props,s=C.defaultCountry,O=C.countries;s&&(t.isCountrySupportedWithError(s)||(s=void 0)),a&&it.validateE164Number(a),O=B.getSupportedCountries(O,f);var g=b.parsePhoneNumber(a,f);t.CountryIcon=at.createCountryIconComponent(t.props);var q=b.getPreSelectedCountry({value:a,phoneNumber:g,defaultCountry:s,required:!E,countries:O||k(f),getAnyCountry:function(){return t.getFirstSupportedCountry({countries:O})},metadata:f});return t.state={props:t.props,country:q,countries:O,phoneDigits:b.getInitialPhoneDigits({value:a,phoneNumber:g,defaultCountry:s,international:y,useNationalFormat:I||_==="national",metadata:f}),value:a},t}return gt(e,n),ft(e,[{key:"componentDidMount",value:function(){var t=this.props.onCountryChange,r=this.props.defaultCountry,a=this.state.country;t&&(r&&(this.isCountrySupportedWithError(r)||(r=void 0)),a!==r&&t(a))}},{key:"componentDidUpdate",value:function(t,r){var a=this.props.onCountryChange,y=this.state.country;a&&y!==r.country&&a(y)}},{key:"getCountrySelectOptions",value:function(t){var r=t.countries,a=this.props,y=a.international,E=a.countryCallingCodeEditable,I=a.countryOptionsOrder,_=a.addInternationalOption,f=a.labels,C=a.locales,s=a.metadata;return this.useMemoCountrySelectOptions(function(){return B.sortCountryOptions(b.getCountrySelectOptions({countries:r||k(s),countryNames:f,addInternationalOption:y&&E===!1?!1:_,compareStringsLocales:C}),B.getSupportedCountryOptions(I,s))},[r,I,_,f,s])}},{key:"useMemoCountrySelectOptions",value:function(t,r){return(!this.countrySelectOptionsMemoDependencies||!vt(r,this.countrySelectOptionsMemoDependencies))&&(this.countrySelectOptionsMemo=t(),this.countrySelectOptionsMemoDependencies=r),this.countrySelectOptionsMemo}},{key:"getFirstSupportedCountry",value:function(t){var r=t.countries,a=this.getCountrySelectOptions({countries:r});return a[0].value}},{key:"render",value:function(){var t=this.props,r=t.name,a=t.disabled,y=t.readOnly,E=t.autoComplete,I=t.style,_=t.className;t.inputRef;var f=t.inputComponent,C=t.numberInputProps,s=t.smartCaret,O=t.countrySelectComponent,g=t.countrySelectProps,q=t.containerComponent,l=t.containerComponentProps;t.defaultCountry,t.countries,t.countryOptionsOrder;var u=t.labels;t.flags,t.flagComponent,t.flagUrl,t.addInternationalOption,t.internationalIcon,t.displayInitialValueAsLocalNumber,t.initialValueFormat,t.onCountryChange,t.limitMaxLength,t.countryCallingCodeEditable,t.focusInputOnCountrySelection,t.reset;var c=t.metadata,d=t.international;t.locales;var N=ct(t,st),h=this.state,v=h.country,j=h.countries,D=h.phoneDigits,m=h.isFocused,S=s?tt.default:et.default,A=this.getCountrySelectOptions({countries:j});return P.createElement(q,F({style:I,className:$(_,"PhoneInput",{"PhoneInput--focus":m,"PhoneInput--disabled":a,"PhoneInput--readOnly":y})},l),P.createElement(O,F({name:r?"".concat(r,"Country"):void 0,"aria-label":u.country},g,{value:v,options:A,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:a||g&&g.disabled,readOnly:y||g&&g.readOnly,iconComponent:this.CountryIcon})),P.createElement(S,F({ref:this.setInputRef,type:"tel",autoComplete:E},C,N,{inputFormat:d===!0?"INTERNATIONAL":d===!1?"NATIONAL":"INTERNATIONAL_OR_NATIONAL",international:d?!0:void 0,withCountryCallingCode:d?!0:void 0,name:r,metadata:c,country:v,value:D||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:a,readOnly:y,inputComponent:f,className:$("PhoneInputInput",C&&C.className,N.className)})))}}],[{key:"getDerivedStateFromProps",value:function(t,r){return H({props:t},lt.default(t,r.props,r))}}])})(P.PureComponent),Q=P.forwardRef(function(n,e){return P.createElement(bt,F({},Ot(n),{inputRef:e}))});Q.propTypes={value:i.string,onChange:i.func.isRequired,onFocus:i.func,onBlur:i.func,disabled:i.bool,readOnly:i.bool,autoComplete:i.string,initialValueFormat:i.oneOf(["national"]),displayInitialValueAsLocalNumber:i.bool,defaultCountry:i.string,countries:i.arrayOf(i.string),labels:W.labels,locales:i.oneOfType([i.string,i.arrayOf(i.string)]),flagUrl:i.string,flags:i.objectOf(i.elementType),flagComponent:i.elementType,addInternationalOption:i.bool,internationalIcon:i.elementType,countryOptionsOrder:i.arrayOf(i.string),style:i.object,className:i.string,countrySelectComponent:i.elementType,countrySelectProps:i.object,inputComponent:i.elementType,numberInputProps:i.object,containerComponent:i.elementType,containerComponentProps:i.object,smartCaret:i.bool,international:i.bool,limitMaxLength:i.bool,countryCallingCodeEditable:i.bool,metadata:W.metadata,onCountryChange:i.func,focusInputOnCountrySelection:i.bool};var z={autoComplete:"tel",countrySelectComponent:nt.CountrySelectWithIcon,flagComponent:ot,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:rt,inputComponent:"input",containerComponent:"div",reset:i.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};function Ot(n){n=H({},n);for(var e in z)n[e]===void 0&&(n[e]=z[e]);return n}function vt(n,e){if(n.length!==e.length)return!1;for(var o=0;o<n.length;){if(n[o]!==e[o])return!1;o++}return!0}module.exports=Q;
|
|
1
|
+
"use strict";const P=require("react"),i=require("../../../../../../_virtual/index.cjs2.js"),$=require("../../../../../../_virtual/index.cjs3.js"),tt=require("./InputSmart.cjs.js"),et=require("./InputBasic.cjs.js"),nt=require("./CountrySelect.cjs.js"),ot=require("./Flag.cjs.js"),rt=require("./InternationalIcon.cjs.js"),it=require("./helpers/isE164Number.cjs.js"),B=require("./helpers/countries.cjs.js"),at=require("./CountryIcon.cjs.js"),ut=require("./useExternalRef.cjs.js"),W=require("./PropTypes.cjs.js"),b=require("./helpers/phoneInputHelpers.cjs.js"),lt=require("./helpers/getPhoneInputWithCountryStateUpdateFromNewProps.cjs.js"),k=require("../../../../libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/getCountries.cjs.js");var st=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function w(n){"@babel/helpers - typeof";return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(n)}function K(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),o.push.apply(o,t)}return o}function H(n){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?K(Object(o),!0).forEach(function(t){p(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):K(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function F(){return F=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])}return n},F.apply(this,arguments)}function ct(n,e){if(n==null)return{};var o=pt(n,e),t,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(o[t]=n[t])}return o}function pt(n,e){if(n==null)return{};var o={},t=Object.keys(n),r,a;for(a=0;a<t.length;a++)r=t[a],!(e.indexOf(r)>=0)&&(o[r]=n[r]);return o}function yt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function X(n,e){for(var o=0;o<e.length;o++){var t=e[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,J(t.key),t)}}function ft(n,e,o){return e&&X(n.prototype,e),o&&X(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n}function dt(n,e,o){return e=T(e),mt(n,G()?Reflect.construct(e,o||[],T(n).constructor):e.apply(n,o))}function mt(n,e){if(e&&(w(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ct(n)}function Ct(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function G(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G=function(){return!!n})()}function T(n){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},T(n)}function gt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&U(n,e)}function U(n,e){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},U(n,e)}function p(n,e,o){return e=J(e),e in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}function J(n){var e=ht(n,"string");return w(e)=="symbol"?e:e+""}function ht(n,e){if(w(n)!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var t=o.call(n,e);if(w(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var bt=(function(n){function e(o){var t;yt(this,e),t=dt(this,e,[o]),p(t,"setInputRef",function(l){ut.setRefsValue([t.props.inputRef,t.inputRef],l)}),p(t,"isCountrySupportedWithError",function(l){var u=t.props.metadata;return B.isCountrySupportedWithError(l,u)}),p(t,"onCountryChange",function(l){var u=t.props,c=u.international,d=u.metadata,N=u.onChange,h=u.focusInputOnCountrySelection,v=t.state,j=v.phoneDigits,D=v.country,m=b.getPhoneDigitsForNewCountry(j,{prevCountry:D,newCountry:l,metadata:d,useNationalFormat:!c}),S=b.e164(m,l,d);h&&t.inputRef.current.focus(),t.setState({country:l,latestCountrySelectedByUser:l,hasUserSelectedACountry:!0,phoneDigits:m,value:S},function(){N(S)})}),p(t,"onChange",function(l){var u=t.props,c=u.defaultCountry,d=u.onChange,N=u.addInternationalOption,h=u.international,v=u.limitMaxLength,j=u.countryCallingCodeEditable,D=u.metadata,m=t.state,S=m.countries,A=m.phoneDigits,Y=m.country,L=m.latestCountrySelectedByUser,M=b.onPhoneDigitsChange(l,{prevPhoneDigits:A,country:Y,countryRequired:!N,defaultCountry:c,latestCountrySelectedByUser:L,getAnyCountry:function(){return t.getFirstSupportedCountry({countries:S})},countries:S,international:h,limitMaxLength:v,countryCallingCodeEditable:j,metadata:D}),V=M.phoneDigits,Z=M.country,R=M.value,x={phoneDigits:V,value:R,country:Z};L&&R&&!b.couldNumberBelongToCountry(R,L,D)&&(x.latestCountrySelectedByUser=void 0),j===!1&&!R&&V===t.state.phoneDigits&&(x.forceRerender={}),t.setState(x,function(){return d(R)})}),p(t,"_onFocus",function(){return t.setState({isFocused:!0})}),p(t,"_onBlur",function(){return t.setState({isFocused:!1})}),p(t,"onFocus",function(l){t._onFocus();var u=t.props.onFocus;u&&u(l)}),p(t,"onBlur",function(l){var u=t.props.onBlur;t._onBlur(),u&&u(l)}),p(t,"onCountryFocus",function(l){t._onFocus();var u=t.props.countrySelectProps;if(u){var c=u.onFocus;c&&c(l)}}),p(t,"onCountryBlur",function(l){t._onBlur();var u=t.props.countrySelectProps;if(u){var c=u.onBlur;c&&c(l)}}),t.inputRef=P.createRef();var r=t.props,a=r.value;r.labels;var y=r.international,E=r.addInternationalOption,I=r.displayInitialValueAsLocalNumber,_=r.initialValueFormat,f=r.metadata,C=t.props,s=C.defaultCountry,O=C.countries;s&&(t.isCountrySupportedWithError(s)||(s=void 0)),a&&it.validateE164Number(a),O=B.getSupportedCountries(O,f);var g=b.parsePhoneNumber(a,f);t.CountryIcon=at.createCountryIconComponent(t.props);var q=b.getPreSelectedCountry({value:a,phoneNumber:g,defaultCountry:s,required:!E,countries:O||k(f),getAnyCountry:function(){return t.getFirstSupportedCountry({countries:O})},metadata:f});return t.state={props:t.props,country:q,countries:O,phoneDigits:b.getInitialPhoneDigits({value:a,phoneNumber:g,defaultCountry:s,international:y,useNationalFormat:I||_==="national",metadata:f}),value:a},t}return gt(e,n),ft(e,[{key:"componentDidMount",value:function(){var t=this.props.onCountryChange,r=this.props.defaultCountry,a=this.state.country;t&&(r&&(this.isCountrySupportedWithError(r)||(r=void 0)),a!==r&&t(a))}},{key:"componentDidUpdate",value:function(t,r){var a=this.props.onCountryChange,y=this.state.country;a&&y!==r.country&&a(y)}},{key:"getCountrySelectOptions",value:function(t){var r=t.countries,a=this.props,y=a.international,E=a.countryCallingCodeEditable,I=a.countryOptionsOrder,_=a.addInternationalOption,f=a.labels,C=a.locales,s=a.metadata;return this.useMemoCountrySelectOptions(function(){return B.sortCountryOptions(b.getCountrySelectOptions({countries:r||k(s),countryNames:f,addInternationalOption:y&&E===!1?!1:_,compareStringsLocales:C}),B.getSupportedCountryOptions(I,s))},[r,I,_,f,s])}},{key:"useMemoCountrySelectOptions",value:function(t,r){return(!this.countrySelectOptionsMemoDependencies||!vt(r,this.countrySelectOptionsMemoDependencies))&&(this.countrySelectOptionsMemo=t(),this.countrySelectOptionsMemoDependencies=r),this.countrySelectOptionsMemo}},{key:"getFirstSupportedCountry",value:function(t){var r=t.countries,a=this.getCountrySelectOptions({countries:r});return a[0].value}},{key:"render",value:function(){var t=this.props,r=t.name,a=t.disabled,y=t.readOnly,E=t.autoComplete,I=t.style,_=t.className;t.inputRef;var f=t.inputComponent,C=t.numberInputProps,s=t.smartCaret,O=t.countrySelectComponent,g=t.countrySelectProps,q=t.containerComponent,l=t.containerComponentProps;t.defaultCountry,t.countries,t.countryOptionsOrder;var u=t.labels;t.flags,t.flagComponent,t.flagUrl,t.addInternationalOption,t.internationalIcon,t.displayInitialValueAsLocalNumber,t.initialValueFormat,t.onCountryChange,t.limitMaxLength,t.countryCallingCodeEditable,t.focusInputOnCountrySelection,t.reset;var c=t.metadata,d=t.international;t.locales;var N=ct(t,st),h=this.state,v=h.country,j=h.countries,D=h.phoneDigits,m=h.isFocused,S=s?tt.default:et.default,A=this.getCountrySelectOptions({countries:j});return P.createElement(q,F({style:I,className:$(_,"PhoneInput",{"PhoneInput--focus":m,"PhoneInput--disabled":a,"PhoneInput--readOnly":y})},l),P.createElement(O,F({name:r?"".concat(r,"Country"):void 0,"aria-label":u.country},g,{value:v,options:A,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:a||g&&g.disabled,readOnly:y||g&&g.readOnly,iconComponent:this.CountryIcon})),P.createElement(S,F({ref:this.setInputRef,type:"tel",autoComplete:E},C,N,{inputFormat:d===!0?"INTERNATIONAL":d===!1?"NATIONAL":"INTERNATIONAL_OR_NATIONAL",international:d?!0:void 0,withCountryCallingCode:d?!0:void 0,name:r,metadata:c,country:v,value:D||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:a,readOnly:y,inputComponent:f,className:$("PhoneInputInput",C&&C.className,N.className)})))}}],[{key:"getDerivedStateFromProps",value:function(t,r){return H({props:t},lt.default(t,r.props,r))}}])})(P.PureComponent),Q=P.forwardRef(function(n,e){return P.createElement(bt,F({},Ot(n),{inputRef:e}))});Q.propTypes={value:i.string,onChange:i.func.isRequired,onFocus:i.func,onBlur:i.func,disabled:i.bool,readOnly:i.bool,autoComplete:i.string,initialValueFormat:i.oneOf(["national"]),displayInitialValueAsLocalNumber:i.bool,defaultCountry:i.string,countries:i.arrayOf(i.string),labels:W.labels,locales:i.oneOfType([i.string,i.arrayOf(i.string)]),flagUrl:i.string,flags:i.objectOf(i.elementType),flagComponent:i.elementType,addInternationalOption:i.bool,internationalIcon:i.elementType,countryOptionsOrder:i.arrayOf(i.string),style:i.object,className:i.string,countrySelectComponent:i.elementType,countrySelectProps:i.object,inputComponent:i.elementType,numberInputProps:i.object,containerComponent:i.elementType,containerComponentProps:i.object,smartCaret:i.bool,international:i.bool,limitMaxLength:i.bool,countryCallingCodeEditable:i.bool,metadata:W.metadata,onCountryChange:i.func,focusInputOnCountrySelection:i.bool};var z={autoComplete:"tel",countrySelectComponent:nt.CountrySelectWithIcon,flagComponent:ot,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:rt,inputComponent:"input",containerComponent:"div",reset:i.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};function Ot(n){n=H({},n);for(var e in z)n[e]===void 0&&(n[e]=z[e]);return n}function vt(n,e){if(n.length!==e.length)return!1;for(var o=0;o<n.length;){if(n[o]!==e[o])return!1;o++}return!0}module.exports=Q;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import S from "react";
|
|
2
|
-
import i from "../../../../../../_virtual/index.
|
|
3
|
-
import V from "../../../../../../_virtual/index.
|
|
2
|
+
import i from "../../../../../../_virtual/index.es2.js";
|
|
3
|
+
import V from "../../../../../../_virtual/index.es3.js";
|
|
4
4
|
import J from "./InputSmart.es.js";
|
|
5
5
|
import Q from "./InputBasic.es.js";
|
|
6
6
|
import { CountrySelectWithIcon as Y } from "./CountrySelect.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../../../_virtual/index.cjs2.js");var t=e.shape({country_calling_codes:e.object.isRequired,countries:e.object.isRequired}),a=e.objectOf(e.string);exports.labels=a;exports.metadata=t;
|