@kingteza/crud-component 1.39.0 → 1.40.1
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/common/text-field/NumberField.cjs.js +1 -1
- package/dist/common/text-field/NumberField.d.ts +1 -0
- package/dist/common/text-field/NumberField.es.js +94 -92
- package/dist/crud/CrudComponent.d.ts +1 -0
- package/dist/crud/CrudField.cjs.js +1 -1
- package/dist/crud/CrudField.es.js +97 -95
- package/dist/locale/translations/en.cjs.js +1 -1
- package/dist/locale/translations/en.d.ts +1 -0
- package/dist/locale/translations/en.es.js +1 -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
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const p=require("react/jsx-runtime"),R=require("antd"),o=require("react"),H=require("../../locale/index.cjs.js"),U=require("../tooltip/TooltipComponent.cjs.js"),V=require("./TextField.cjs.js"),_=/\D/g,b=/\B(?=(\d{3})+(?!\d))/g,z=/\$\s?|(,*)/g,J=new Set(["e","E","."]);function Q(e,t,c){return`${e??t??""} ${c}`.trim()}function W(e){if(e==null)return"";const t=String(e);if(!t.includes("."))return t.replace(b,",");const[c,...s]=t.split(".");return[c.replace(b,","),...s].join(".")}function X(e){return(e==null?void 0:e.replace(z,""))??""}function Z(e,t){return e==null?"":String(e).replace(t,"")}function ee(e,t){return e==null?"":e.replace(t,"")}const re=o.forwardRef(function({changeOnWheel:t,type:c,required:s,label:a,rules:m=[],placeholder:f,onEnter:g,form:E,nextFocus:T,min:x,moneyField:i,addonAfter:h,minLength:v,defaultValue:w,pattern:M,disabled:P,readOnly:S,onChange:q,value:y,max:D,addonBefore:L,size:C,isInt:n=!1,tooltip:I,help:O,step:j,...A},k){const{t:d}=H.useTranslationLib(),u=x===null,l=n&&!u,K=f??a,$=o.useMemo(()=>{const r=[...m,{required:s,message:Q(a,f,d("err.validation.required"))}];return n&&r.push({type:"number",validator:async(te,N)=>{if(!(N==null||Number.isInteger(N)))throw new Error(d("err.validation.integer"))}}),r},[m,a,f,d,s,n]),B=o.useMemo(()=>{if(i)return W;if(l)return r=>Z(r,_)},[i,l]),Y=o.useMemo(()=>{if(i)return X;if(l)return r=>ee(r,_)},[i,l]),F=o.useCallback(r=>V.onEnterInternalTextField(r,T,E,g),[T,E,g]),G=o.useCallback(r=>{if(!u&&r.key==="-"){r.preventDefault();return}J.has(r.key)&&r.preventDefault()},[u]);return p.jsx(U,{title:I,children:p.jsx(R.Form.Item,{...A,label:a,rules:$,help:O,children:p.jsx(R.InputNumber,{ref:k,changeOnWheel:t,disabled:P,defaultValue:w,value:y,readOnly:S,addonBefore:L,minLength:v,addonAfter:h,step:n?1:j,inputMode:n?"numeric":void 0,pattern:n?u?"-?[0-9]*":"[0-9]*":M,precision:n?0:void 0,onChange:q,onPressEnter:F,className:"max-width",min:u?void 0:x??0,max:D,type:i?void 0:"number",size:C,formatter:B,parser:Y,onKeyDown:n?G:void 0,placeholder:K})})})});module.exports=re;
|
|
@@ -1,129 +1,131 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useTranslationLib as
|
|
5
|
-
import
|
|
6
|
-
import { onEnterInternalTextField as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
return `${r ?? e ?? ""} ${
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { Form as U, InputNumber as V } from "antd";
|
|
3
|
+
import { forwardRef as z, useMemo as m, useCallback as h } from "react";
|
|
4
|
+
import { useTranslationLib as F } from "../../locale/index.es.js";
|
|
5
|
+
import J from "../tooltip/TooltipComponent.es.js";
|
|
6
|
+
import { onEnterInternalTextField as Q } from "./TextField.es.js";
|
|
7
|
+
const v = /\D/g, w = /\B(?=(\d{3})+(?!\d))/g, W = /\$\s?|(,*)/g, X = /* @__PURE__ */ new Set(["e", "E", "."]);
|
|
8
|
+
function Z(r, e, u) {
|
|
9
|
+
return `${r ?? e ?? ""} ${u}`.trim();
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function rr(r) {
|
|
12
12
|
if (r == null) return "";
|
|
13
13
|
const e = String(r);
|
|
14
14
|
if (!e.includes("."))
|
|
15
|
-
return e.replace(
|
|
16
|
-
const [
|
|
17
|
-
return [
|
|
15
|
+
return e.replace(w, ",");
|
|
16
|
+
const [u, ...o] = e.split(".");
|
|
17
|
+
return [u.replace(w, ","), ...o].join(".");
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return (r == null ? void 0 : r.replace(
|
|
19
|
+
function tr(r) {
|
|
20
|
+
return (r == null ? void 0 : r.replace(W, "")) ?? "";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function er(r, e) {
|
|
23
23
|
return r == null ? "" : String(r).replace(e, "");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function nr(r, e) {
|
|
26
26
|
return r == null ? "" : r.replace(e, "");
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const lr = z(
|
|
29
29
|
function({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
changeOnWheel: e,
|
|
31
|
+
type: u,
|
|
32
|
+
required: o,
|
|
33
|
+
label: c,
|
|
34
|
+
rules: d = [],
|
|
35
|
+
placeholder: f,
|
|
36
|
+
onEnter: g,
|
|
37
|
+
form: E,
|
|
38
|
+
nextFocus: N,
|
|
39
|
+
min: T,
|
|
40
|
+
moneyField: i,
|
|
41
|
+
addonAfter: P,
|
|
42
|
+
minLength: R,
|
|
43
|
+
defaultValue: S,
|
|
44
|
+
pattern: b,
|
|
45
|
+
disabled: y,
|
|
46
|
+
readOnly: D,
|
|
47
|
+
onChange: L,
|
|
48
|
+
value: I,
|
|
49
|
+
max: M,
|
|
50
|
+
addonBefore: O,
|
|
51
|
+
size: x,
|
|
51
52
|
isInt: n = !1,
|
|
52
|
-
tooltip:
|
|
53
|
-
help:
|
|
54
|
-
step:
|
|
55
|
-
...
|
|
56
|
-
},
|
|
57
|
-
const { t:
|
|
53
|
+
tooltip: A,
|
|
54
|
+
help: C,
|
|
55
|
+
step: K,
|
|
56
|
+
...k
|
|
57
|
+
}, $) {
|
|
58
|
+
const { t: l } = F(), s = T === null, a = n && !s, j = f ?? c, B = m(() => {
|
|
58
59
|
const t = [
|
|
59
|
-
...
|
|
60
|
+
...d,
|
|
60
61
|
{
|
|
61
|
-
required:
|
|
62
|
-
message:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
required: o,
|
|
63
|
+
message: Z(
|
|
64
|
+
c,
|
|
65
|
+
f,
|
|
66
|
+
l("err.validation.required")
|
|
66
67
|
)
|
|
67
68
|
}
|
|
68
69
|
];
|
|
69
70
|
return n && t.push({
|
|
70
71
|
type: "number",
|
|
71
|
-
validator: async (
|
|
72
|
-
if (!(
|
|
73
|
-
throw new Error(
|
|
72
|
+
validator: async (or, _) => {
|
|
73
|
+
if (!(_ == null || Number.isInteger(_)))
|
|
74
|
+
throw new Error(l("err.validation.integer"));
|
|
74
75
|
}
|
|
75
76
|
}), t;
|
|
76
|
-
}, [
|
|
77
|
-
if (
|
|
78
|
-
if (
|
|
79
|
-
return (t) =>
|
|
80
|
-
}, [
|
|
81
|
-
if (
|
|
82
|
-
if (
|
|
83
|
-
return (t) =>
|
|
84
|
-
}, [
|
|
85
|
-
(t) =>
|
|
86
|
-
[E, g
|
|
87
|
-
),
|
|
77
|
+
}, [d, c, f, l, o, n]), Y = m(() => {
|
|
78
|
+
if (i) return rr;
|
|
79
|
+
if (a)
|
|
80
|
+
return (t) => er(t, v);
|
|
81
|
+
}, [i, a]), q = m(() => {
|
|
82
|
+
if (i) return tr;
|
|
83
|
+
if (a)
|
|
84
|
+
return (t) => nr(t, v);
|
|
85
|
+
}, [i, a]), G = h(
|
|
86
|
+
(t) => Q(t, N, E, g),
|
|
87
|
+
[N, E, g]
|
|
88
|
+
), H = h(
|
|
88
89
|
(t) => {
|
|
89
|
-
if (!
|
|
90
|
+
if (!s && t.key === "-") {
|
|
90
91
|
t.preventDefault();
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
+
X.has(t.key) && t.preventDefault();
|
|
94
95
|
},
|
|
95
|
-
[
|
|
96
|
+
[s]
|
|
96
97
|
);
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
|
|
98
|
+
return /* @__PURE__ */ p(J, { title: A, children: /* @__PURE__ */ p(U.Item, { ...k, label: c, rules: B, help: C, children: /* @__PURE__ */ p(
|
|
99
|
+
V,
|
|
99
100
|
{
|
|
100
|
-
ref:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
ref: $,
|
|
102
|
+
changeOnWheel: e,
|
|
103
|
+
disabled: y,
|
|
104
|
+
defaultValue: S,
|
|
105
|
+
value: I,
|
|
106
|
+
readOnly: D,
|
|
107
|
+
addonBefore: O,
|
|
108
|
+
minLength: R,
|
|
109
|
+
addonAfter: P,
|
|
110
|
+
step: n ? 1 : K,
|
|
109
111
|
inputMode: n ? "numeric" : void 0,
|
|
110
|
-
pattern: n ?
|
|
112
|
+
pattern: n ? s ? "-?[0-9]*" : "[0-9]*" : b,
|
|
111
113
|
precision: n ? 0 : void 0,
|
|
112
|
-
onChange:
|
|
113
|
-
onPressEnter:
|
|
114
|
+
onChange: L,
|
|
115
|
+
onPressEnter: G,
|
|
114
116
|
className: "max-width",
|
|
115
|
-
min:
|
|
116
|
-
max:
|
|
117
|
-
type:
|
|
118
|
-
size:
|
|
119
|
-
formatter:
|
|
120
|
-
parser:
|
|
121
|
-
onKeyDown: n ?
|
|
122
|
-
placeholder:
|
|
117
|
+
min: s ? void 0 : T ?? 0,
|
|
118
|
+
max: M,
|
|
119
|
+
type: i ? void 0 : "number",
|
|
120
|
+
size: x,
|
|
121
|
+
formatter: Y,
|
|
122
|
+
parser: q,
|
|
123
|
+
onKeyDown: n ? H : void 0,
|
|
124
|
+
placeholder: j
|
|
123
125
|
}
|
|
124
126
|
) }) });
|
|
125
127
|
}
|
|
126
128
|
);
|
|
127
129
|
export {
|
|
128
|
-
|
|
130
|
+
lr as default
|
|
129
131
|
};
|
|
@@ -171,6 +171,7 @@ export interface NumberBasedFieldProps<T> extends InitialCrudField<T>, AddonFiel
|
|
|
171
171
|
formatted?: boolean;
|
|
172
172
|
int?: boolean;
|
|
173
173
|
step?: number;
|
|
174
|
+
changeOnWheel?: boolean;
|
|
174
175
|
onChange?: (value: number, form: FormInstance<T>) => void;
|
|
175
176
|
}
|
|
176
177
|
export interface DateBasedFieldProps<T> extends InitialCrudField<T>, Copyable<false> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),p=require("antd"),T=require("react"),Y=require("react-highlight-words"),Z=require("../locale/index.cjs.js"),ee=require("./FileCrudField.cjs.js"),re=require("./ImageCrudField.cjs.js"),te=require("../common/check-box/CheckBox.cjs.js"),ne=require("../common/date-picker/DatePicker.cjs.js"),ae=require("../common/date-picker/TimePicker.cjs.js"),D=require("../common/select/SelectComponent.cjs.js"),oe=require("../common/text-field/NumberField.cjs.js"),le=require("../common/text-field/PhoneNumberField.cjs.js"),se=require("../common/text-field/TextField.cjs.js"),ie=require("../common/tooltip/TooltipComponent.cjs.js"),de=require("./CrudTextAreaComponent.cjs.js"),_=require("../util/CrudUtil.cjs.js"),E=require("../context/CrudSearchContext.cjs.js");function ce(F){const{label:s,name:d,type:c,required:h,hidden:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),p=require("antd"),T=require("react"),Y=require("react-highlight-words"),Z=require("../locale/index.cjs.js"),ee=require("./FileCrudField.cjs.js"),re=require("./ImageCrudField.cjs.js"),te=require("../common/check-box/CheckBox.cjs.js"),ne=require("../common/date-picker/DatePicker.cjs.js"),ae=require("../common/date-picker/TimePicker.cjs.js"),D=require("../common/select/SelectComponent.cjs.js"),oe=require("../common/text-field/NumberField.cjs.js"),le=require("../common/text-field/PhoneNumberField.cjs.js"),se=require("../common/text-field/TextField.cjs.js"),ie=require("../common/tooltip/TooltipComponent.cjs.js"),de=require("./CrudTextAreaComponent.cjs.js"),_=require("../util/CrudUtil.cjs.js"),E=require("../context/CrudSearchContext.cjs.js");function ce(F){const{label:s,name:d,type:c,required:h,hidden:O,rules:b=[],updatable:m=!0,readonly:y=!1,fieldClassName:f,customFormFieldRender:k,fieldTooltip:S,fieldHelper:C,formLayoutProps:q,...r}=F,l=p.Form.useFormInstance();T.useEffect(()=>{if(c==="select"){const{items:a=[],onSearch:o,searchOnType:u}=r;!(a!=null&&a.length)&&!u&&(o==null||o(void 0,l,r==null?void 0:r.updatingValue))}},[l,r,c,r==null?void 0:r.updatingValue]);const R=E.useCrudSearchContext(),x=T.useCallback((a,o)=>{R&&R.search(),!y&&o&&o(a,l)},[R,y,l]);if(y||O)return e.jsx(e.Fragment,{});if(k)return k(l,F);switch(c){case"text":case"email":case"password":{const{maxLength:a,onChange:o,placeholder:u,addonAfter:v,addonBefore:i}=r;return e.jsx(se.default,{...q,maxLength:a,placeholder:u,disabled:!m,rules:b,required:h,onChange:o?N=>o(N,l):void 0,type:c,name:d,tooltip:S,label:s,className:f,autoComplete:"new-password",addonAfter:v,addonBefore:i,help:C})}case"phone":{const{onChange:a,placeholder:o,addonAfter:u,addonBefore:v}=r;return e.jsx(le,{...r,...q,placeholder:o,disabled:!m,rules:b,required:h,onChange:a?i=>a(i,l):void 0,type:c,name:d,tooltip:S,label:s,className:f,autoComplete:"new-password",addonAfter:u,addonBefore:v,help:C})}case"number":{const{onChange:a,placeholder:o,allowMinus:u,min:v,max:i,addonAfter:N,addonBefore:w,int:P,step:n,changeOnWheel:j=!1}=r;return e.jsx(oe,{...q,step:n,changeOnWheel:j,placeholder:o,disabled:!m,moneyField:!!r.formatted,type:c,onChange:a?H=>a(H,l):void 0,rules:b,autoComplete:"false",required:h,tooltip:S,className:f,min:u?null:v,max:i,addonAfter:N,addonBefore:w,name:d,label:s,help:C,isInt:P})}case"date":{const{range:a,disableToday:o,disabledFutureDays:u,disabledPastDays:v,onChange:i,placeholder:N,format:w}=r;return e.jsx(ne,{...q,placeholder:N,required:h,disabled:!m,type:c,format:w,tooltip:S,range:a,name:d,label:s,onChange:x,className:f,disableToday:o,disabledFutureDays:u,disabledPastDays:v,help:C})}case"time":{const{range:a=!1,disableCurrent:o,disabledFuture:u,disabledPast:v,onChange:i,use12Hours:N,format:w,placeholder:P}=r;return e.jsx(ae,{...q,placeholder:P,required:h,format:w,disabled:!m,type:c,tooltip:S,range:a,use12Hours:N,name:d,label:s,onChange:x,className:f,disableCurrent:o,disabledFuture:u,disabledPast:v,help:C})}case"textarea":return e.jsx(de,{...F});case"image":return e.jsx(re.default,{...r,required:h,name:d,label:s,rules:b,fieldHelper:C,fieldClassName:f,onRemoved:r.onRemoved,onUploading:r.onUploading,provider:r.provider});case"file":return e.jsx(ee.default,{...r,required:h,name:d,label:s,rules:b,fieldHelper:C,fieldClassName:f,onRemoved:r.onRemoved,onUploading:r.onUploading,provider:r.provider});case"select":return e.jsx($,{...r,required:h,name:d,label:s,rules:b,fieldClassName:f,form:l,help:C,updatable:m,readonly:y,fieldTooltip:S,fieldHelper:C});case"enum":return e.jsx(W,{...F});case"checkbox":{const{onChange:a,switch:o}=r;return e.jsx(te,{...q,className:f,rules:b,onChange:x,label:s,tooltip:S,disabled:!m,name:d,help:C,switch:o})}case"color":return e.jsx(z,{...r,type:"color",required:h,name:d,label:s,rules:b,fieldClassName:f,updatable:m,readonly:y,fieldTooltip:S,fieldHelper:C});default:return e.jsx(e.Fragment,{children:`${c} Not Implemented`})}}function W(F){const s=p.Form.useFormInstance(),{label:d,name:c,type:h,required:O,hidden:b,rules:m=[],updatable:y=!0,readonly:f=!1,fieldClassName:k,customFormFieldRender:S,fieldTooltip:C,fieldHelper:q,formLayoutProps:r,...l}=F,{t:R}=Z.useTranslationLibNoNS(),{enum:x,translation:a,onChange:o,onSearch:u,multiple:v,tagRender:i}=l,N=Array.isArray(x)?x:Object.keys(x),w=E.useCrudSearchContext(),P=T.useCallback(n=>{w&&w.search(),!f&&o&&o(n,s)},[w,f,o,s]);return"radio"in l&&l.radio?e.jsx(p.Form.Item,{...l,...r,name:c,required:O,tooltip:C,rules:m,label:d,className:["w-100",k].join(" "),help:q,children:e.jsx(p.Radio.Group,{...l,onChange:n=>{var j;return P((j=n==null?void 0:n.target)==null?void 0:j.value)},children:N.map(n=>e.jsx(p.Radio,{disabled:!y,value:n,children:a?R(a[n]):n},n))})}):"checkbox"in l&&l.checkbox?e.jsx(p.Form.Item,{...l,...r,name:c,required:O,tooltip:C,rules:m,label:d,className:["w-100",k].join(" "),help:q,children:e.jsx(p.Checkbox.Group,{className:"w-100",onChange:P,children:N.map(n=>{const j=e.jsx(p.Checkbox,{disabled:!y,value:n,children:a?R(a[n]):n},n);return"checkboxGrid"in l&&l.checkboxGrid?e.jsx(p.Col,{...l.checkboxGrid,children:j}):j})})}):e.jsx(D,{...l,...r,notSearch:!0,tagRender:typeof i=="function"?i:i?n=>{const{value:j,label:H}=n,I=i[j];return I?e.jsx(p.Tag,{color:I.color,children:H}):e.jsx(p.Tag,{children:H})}:void 0,onChange:P,className:["w-100",k].join(" "),name:c,items:N,required:O,tooltip:C,rules:m,label:d,help:q,disabled:!y,onSearch:u?n=>u(n,s):void 0,allowClear:!0,mode:v?"multiple":void 0,showLoadingInEmptyIndicator:!0,itemBuilder:n=>e.jsx(p.Select.Option,{value:n,children:a?R(a[n]):n},n)})}function $(F){const{items:s=[],loading:d,searchOnType:c,onSearch:h,multiple:O,onChange:b,highlightSearch:m,required:y,fieldClassName:f,rules:k,fieldTooltip:S,updatable:C,label:q,name:r,tagRender:l,updatingValue:R,onSet:x,placeholder:a,allowClear:o=!0,selectOptionRender:u,formLayoutProps:v}=F,i=F.form,[N,w]=T.useState(""),P=T.useMemo(()=>_.getRealName(r),[r]),n=T.useMemo(()=>_.getRealName(r,"upsertFieldName"),[r]),j=p.Form.useWatch(P,i),[H,I]=T.useState(!0);T.useEffect(()=>{x&&H&&j&&(x==null||x(j,s,i),I(!1))},[H,i,s,P,x,j]),T.useEffect(()=>{j&&I(!0)},[j]);const J=T.useCallback(async t=>{w(t),c&&(h==null||h(t,i,R))},[i,h,c,R]),K=T.useCallback(t=>u?u(t):t.value,[u]),L=E.useCrudSearchContext(),Q=T.useCallback(t=>{L&&L.search(),b&&(w(""),b(t,i))},[L,b,i]);return e.jsx(D,{...F,...v,showLoadingInEmptyIndicator:!0,maxTagCount:"responsive",maxTagPlaceholder:t=>e.jsxs(ie,{title:e.jsx(e.Fragment,{children:t.map(g=>e.jsxs(e.Fragment,{children:[g.label," ",e.jsx("br",{})]}))}),children:["+",t==null?void 0:t.length]}),placeholder:a,onSelect:t=>{x==null||x(t==null?void 0:t.key,s,i)},onChange:Q,mode:O?"multiple":void 0,className:["w-100",f].join(" "),name:n,items:s,required:y,tooltip:S,tagRender:l,rules:k,disabled:!C,label:q,allowClear:o,onSearch:J,loading:d,filterOption:m?(t,g)=>{var A,B,G;try{const M=t.toLowerCase().split(/\s+/),V=((typeof(g==null?void 0:g.children)=="string"?g==null?void 0:g.children:(B=(A=g==null?void 0:g.children)==null?void 0:A.props)==null?void 0:B.textToHighlight)??"").toLowerCase(),X=(((G=g==null?void 0:g.value)==null?void 0:G.toString())??"").toLowerCase();return M.every(U=>V.indexOf(U)>=0||X.indexOf(U)>=0)}catch{return!0}}:void 0,itemBuilder:m?t=>{const g=t.value?String(t.value):void 0;return e.jsx(p.Select.Option,{value:t.key,title:g,disabled:t.disabled,children:e.jsx(Y,{highlightClassName:"highlight-text",searchWords:(N??"").split(" "),autoEscape:!0,textToHighlight:g??""})},t.key)}:t=>e.jsx(p.Select.Option,{value:t.key,title:t.value,disabled:t.disabled,children:K(t)},t.key)})}function z(F){const{formLayoutProps:s,required:d,fieldClassName:c,rules:h,fieldTooltip:O,updatable:b,label:m,name:y,fieldHelper:f}=F;return e.jsx(p.Form.Item,{...s,label:m,name:y,required:d,rules:h,tooltip:O,help:f,getValueFromEvent:k=>typeof k=="object"?k.toHexString():k,children:e.jsx(p.ColorPicker,{disabledAlpha:!0,format:"hex",defaultFormat:"hex",showText:!0,trigger:"click",className:c,disabled:!b,...F.innerProps})})}exports.ColorCrudFieldComponent=z;exports.EnumCrudFieldComponent=W;exports.SelectCrudFieldComponent=$;exports.default=ce;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as r, Fragment as A, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
-
import { Form as
|
|
2
|
+
import { Form as O, ColorPicker as ae, Radio as z, Checkbox as J, Col as ne, Select as E, Tag as K } from "antd";
|
|
3
3
|
import { useEffect as G, useCallback as j, useState as Q, useMemo as V } from "react";
|
|
4
4
|
import le from "react-highlight-words";
|
|
5
5
|
import { useTranslationLibNoNS as ie } from "../locale/index.es.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import se from "./FileCrudField.es.js";
|
|
7
|
+
import de from "./ImageCrudField.es.js";
|
|
8
8
|
import ce from "../common/check-box/CheckBox.es.js";
|
|
9
9
|
import me from "../common/date-picker/DatePicker.es.js";
|
|
10
10
|
import ue from "../common/date-picker/TimePicker.es.js";
|
|
11
11
|
import Y from "../common/select/SelectComponent.es.js";
|
|
12
12
|
import he from "../common/text-field/NumberField.es.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import fe from "../common/text-field/PhoneNumberField.es.js";
|
|
14
|
+
import pe from "../common/text-field/TextField.es.js";
|
|
15
15
|
import ge from "../common/tooltip/TooltipComponent.es.js";
|
|
16
16
|
import Ce from "./CrudTextAreaComponent.es.js";
|
|
17
17
|
import X from "../util/CrudUtil.es.js";
|
|
@@ -19,20 +19,20 @@ import { useCrudSearchContext as U } from "../context/CrudSearchContext.es.js";
|
|
|
19
19
|
function Ue(y) {
|
|
20
20
|
const {
|
|
21
21
|
label: i,
|
|
22
|
-
name:
|
|
22
|
+
name: d,
|
|
23
23
|
type: c,
|
|
24
24
|
required: u,
|
|
25
25
|
hidden: I,
|
|
26
26
|
rules: b = [],
|
|
27
27
|
updatable: h = !0,
|
|
28
28
|
readonly: v = !1,
|
|
29
|
-
fieldClassName:
|
|
29
|
+
fieldClassName: f,
|
|
30
30
|
customFormFieldRender: w,
|
|
31
31
|
fieldTooltip: R,
|
|
32
|
-
fieldHelper:
|
|
32
|
+
fieldHelper: p,
|
|
33
33
|
formLayoutProps: T,
|
|
34
34
|
...e
|
|
35
|
-
} = y, l =
|
|
35
|
+
} = y, l = O.useFormInstance();
|
|
36
36
|
G(() => {
|
|
37
37
|
if (c === "select") {
|
|
38
38
|
const {
|
|
@@ -53,9 +53,9 @@ function Ue(y) {
|
|
|
53
53
|
case "text":
|
|
54
54
|
case "email":
|
|
55
55
|
case "password": {
|
|
56
|
-
const { maxLength: a, onChange: n, placeholder: m, addonAfter: N, addonBefore:
|
|
56
|
+
const { maxLength: a, onChange: n, placeholder: m, addonAfter: N, addonBefore: s } = e;
|
|
57
57
|
return /* @__PURE__ */ r(
|
|
58
|
-
|
|
58
|
+
pe,
|
|
59
59
|
{
|
|
60
60
|
...T,
|
|
61
61
|
maxLength: a,
|
|
@@ -65,21 +65,21 @@ function Ue(y) {
|
|
|
65
65
|
required: u,
|
|
66
66
|
onChange: n ? (F) => n(F, l) : void 0,
|
|
67
67
|
type: c,
|
|
68
|
-
name:
|
|
68
|
+
name: d,
|
|
69
69
|
tooltip: R,
|
|
70
70
|
label: i,
|
|
71
|
-
className:
|
|
71
|
+
className: f,
|
|
72
72
|
autoComplete: "new-password",
|
|
73
73
|
addonAfter: N,
|
|
74
|
-
addonBefore:
|
|
75
|
-
help:
|
|
74
|
+
addonBefore: s,
|
|
75
|
+
help: p
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
case "phone": {
|
|
80
80
|
const { onChange: a, placeholder: n, addonAfter: m, addonBefore: N } = e;
|
|
81
81
|
return /* @__PURE__ */ r(
|
|
82
|
-
|
|
82
|
+
fe,
|
|
83
83
|
{
|
|
84
84
|
...e,
|
|
85
85
|
...T,
|
|
@@ -87,16 +87,16 @@ function Ue(y) {
|
|
|
87
87
|
disabled: !h,
|
|
88
88
|
rules: b,
|
|
89
89
|
required: u,
|
|
90
|
-
onChange: a ? (
|
|
90
|
+
onChange: a ? (s) => a(s, l) : void 0,
|
|
91
91
|
type: c,
|
|
92
|
-
name:
|
|
92
|
+
name: d,
|
|
93
93
|
tooltip: R,
|
|
94
94
|
label: i,
|
|
95
|
-
className:
|
|
95
|
+
className: f,
|
|
96
96
|
autoComplete: "new-password",
|
|
97
97
|
addonAfter: m,
|
|
98
98
|
addonBefore: N,
|
|
99
|
-
help:
|
|
99
|
+
help: p
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
}
|
|
@@ -106,34 +106,36 @@ function Ue(y) {
|
|
|
106
106
|
placeholder: n,
|
|
107
107
|
allowMinus: m,
|
|
108
108
|
min: N,
|
|
109
|
-
max:
|
|
109
|
+
max: s,
|
|
110
110
|
addonAfter: F,
|
|
111
111
|
addonBefore: k,
|
|
112
112
|
int: H,
|
|
113
|
-
step: o
|
|
113
|
+
step: o,
|
|
114
|
+
changeOnWheel: x = !1
|
|
114
115
|
} = e;
|
|
115
116
|
return /* @__PURE__ */ r(
|
|
116
117
|
he,
|
|
117
118
|
{
|
|
118
119
|
...T,
|
|
119
120
|
step: o,
|
|
121
|
+
changeOnWheel: x,
|
|
120
122
|
placeholder: n,
|
|
121
123
|
disabled: !h,
|
|
122
124
|
moneyField: !!e.formatted,
|
|
123
125
|
type: c,
|
|
124
|
-
onChange: a ? (
|
|
126
|
+
onChange: a ? (L) => a(L, l) : void 0,
|
|
125
127
|
rules: b,
|
|
126
128
|
autoComplete: "false",
|
|
127
129
|
required: u,
|
|
128
130
|
tooltip: R,
|
|
129
|
-
className:
|
|
131
|
+
className: f,
|
|
130
132
|
min: m ? null : N,
|
|
131
|
-
max:
|
|
133
|
+
max: s,
|
|
132
134
|
addonAfter: F,
|
|
133
135
|
addonBefore: k,
|
|
134
|
-
name:
|
|
136
|
+
name: d,
|
|
135
137
|
label: i,
|
|
136
|
-
help:
|
|
138
|
+
help: p,
|
|
137
139
|
isInt: H
|
|
138
140
|
}
|
|
139
141
|
);
|
|
@@ -144,7 +146,7 @@ function Ue(y) {
|
|
|
144
146
|
disableToday: n,
|
|
145
147
|
disabledFutureDays: m,
|
|
146
148
|
disabledPastDays: N,
|
|
147
|
-
onChange:
|
|
149
|
+
onChange: s,
|
|
148
150
|
placeholder: F,
|
|
149
151
|
format: k
|
|
150
152
|
} = e;
|
|
@@ -159,14 +161,14 @@ function Ue(y) {
|
|
|
159
161
|
format: k,
|
|
160
162
|
tooltip: R,
|
|
161
163
|
range: a,
|
|
162
|
-
name:
|
|
164
|
+
name: d,
|
|
163
165
|
label: i,
|
|
164
166
|
onChange: C,
|
|
165
|
-
className:
|
|
167
|
+
className: f,
|
|
166
168
|
disableToday: n,
|
|
167
169
|
disabledFutureDays: m,
|
|
168
170
|
disabledPastDays: N,
|
|
169
|
-
help:
|
|
171
|
+
help: p
|
|
170
172
|
}
|
|
171
173
|
);
|
|
172
174
|
}
|
|
@@ -176,7 +178,7 @@ function Ue(y) {
|
|
|
176
178
|
disableCurrent: n,
|
|
177
179
|
disabledFuture: m,
|
|
178
180
|
disabledPast: N,
|
|
179
|
-
onChange:
|
|
181
|
+
onChange: s,
|
|
180
182
|
use12Hours: F,
|
|
181
183
|
format: k,
|
|
182
184
|
placeholder: H
|
|
@@ -193,14 +195,14 @@ function Ue(y) {
|
|
|
193
195
|
tooltip: R,
|
|
194
196
|
range: a,
|
|
195
197
|
use12Hours: F,
|
|
196
|
-
name:
|
|
198
|
+
name: d,
|
|
197
199
|
label: i,
|
|
198
200
|
onChange: C,
|
|
199
|
-
className:
|
|
201
|
+
className: f,
|
|
200
202
|
disableCurrent: n,
|
|
201
203
|
disabledFuture: m,
|
|
202
204
|
disabledPast: N,
|
|
203
|
-
help:
|
|
205
|
+
help: p
|
|
204
206
|
}
|
|
205
207
|
);
|
|
206
208
|
}
|
|
@@ -208,15 +210,15 @@ function Ue(y) {
|
|
|
208
210
|
return /* @__PURE__ */ r(Ce, { ...y });
|
|
209
211
|
case "image":
|
|
210
212
|
return /* @__PURE__ */ r(
|
|
211
|
-
|
|
213
|
+
de,
|
|
212
214
|
{
|
|
213
215
|
...e,
|
|
214
216
|
required: u,
|
|
215
|
-
name:
|
|
217
|
+
name: d,
|
|
216
218
|
label: i,
|
|
217
219
|
rules: b,
|
|
218
|
-
fieldHelper:
|
|
219
|
-
fieldClassName:
|
|
220
|
+
fieldHelper: p,
|
|
221
|
+
fieldClassName: f,
|
|
220
222
|
onRemoved: e.onRemoved,
|
|
221
223
|
onUploading: e.onUploading,
|
|
222
224
|
provider: e.provider
|
|
@@ -224,15 +226,15 @@ function Ue(y) {
|
|
|
224
226
|
);
|
|
225
227
|
case "file":
|
|
226
228
|
return /* @__PURE__ */ r(
|
|
227
|
-
|
|
229
|
+
se,
|
|
228
230
|
{
|
|
229
231
|
...e,
|
|
230
232
|
required: u,
|
|
231
|
-
name:
|
|
233
|
+
name: d,
|
|
232
234
|
label: i,
|
|
233
235
|
rules: b,
|
|
234
|
-
fieldHelper:
|
|
235
|
-
fieldClassName:
|
|
236
|
+
fieldHelper: p,
|
|
237
|
+
fieldClassName: f,
|
|
236
238
|
onRemoved: e.onRemoved,
|
|
237
239
|
onUploading: e.onUploading,
|
|
238
240
|
provider: e.provider
|
|
@@ -244,16 +246,16 @@ function Ue(y) {
|
|
|
244
246
|
{
|
|
245
247
|
...e,
|
|
246
248
|
required: u,
|
|
247
|
-
name:
|
|
249
|
+
name: d,
|
|
248
250
|
label: i,
|
|
249
251
|
rules: b,
|
|
250
|
-
fieldClassName:
|
|
252
|
+
fieldClassName: f,
|
|
251
253
|
form: l,
|
|
252
|
-
help:
|
|
254
|
+
help: p,
|
|
253
255
|
updatable: h,
|
|
254
256
|
readonly: v,
|
|
255
257
|
fieldTooltip: R,
|
|
256
|
-
fieldHelper:
|
|
258
|
+
fieldHelper: p
|
|
257
259
|
}
|
|
258
260
|
);
|
|
259
261
|
case "enum":
|
|
@@ -264,14 +266,14 @@ function Ue(y) {
|
|
|
264
266
|
ce,
|
|
265
267
|
{
|
|
266
268
|
...T,
|
|
267
|
-
className:
|
|
269
|
+
className: f,
|
|
268
270
|
rules: b,
|
|
269
271
|
onChange: C,
|
|
270
272
|
label: i,
|
|
271
273
|
tooltip: R,
|
|
272
274
|
disabled: !h,
|
|
273
|
-
name:
|
|
274
|
-
help:
|
|
275
|
+
name: d,
|
|
276
|
+
help: p,
|
|
275
277
|
switch: n
|
|
276
278
|
}
|
|
277
279
|
);
|
|
@@ -283,14 +285,14 @@ function Ue(y) {
|
|
|
283
285
|
...e,
|
|
284
286
|
type: "color",
|
|
285
287
|
required: u,
|
|
286
|
-
name:
|
|
288
|
+
name: d,
|
|
287
289
|
label: i,
|
|
288
290
|
rules: b,
|
|
289
|
-
fieldClassName:
|
|
291
|
+
fieldClassName: f,
|
|
290
292
|
updatable: h,
|
|
291
293
|
readonly: v,
|
|
292
294
|
fieldTooltip: R,
|
|
293
|
-
fieldHelper:
|
|
295
|
+
fieldHelper: p
|
|
294
296
|
}
|
|
295
297
|
);
|
|
296
298
|
default:
|
|
@@ -298,18 +300,18 @@ function Ue(y) {
|
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
302
|
function be(y) {
|
|
301
|
-
const i =
|
|
302
|
-
label:
|
|
303
|
+
const i = O.useFormInstance(), {
|
|
304
|
+
label: d,
|
|
303
305
|
name: c,
|
|
304
306
|
type: u,
|
|
305
307
|
required: I,
|
|
306
308
|
hidden: b,
|
|
307
309
|
rules: h = [],
|
|
308
310
|
updatable: v = !0,
|
|
309
|
-
readonly:
|
|
311
|
+
readonly: f = !1,
|
|
310
312
|
fieldClassName: w,
|
|
311
313
|
customFormFieldRender: R,
|
|
312
|
-
fieldTooltip:
|
|
314
|
+
fieldTooltip: p,
|
|
313
315
|
fieldHelper: T,
|
|
314
316
|
formLayoutProps: e,
|
|
315
317
|
...l
|
|
@@ -319,23 +321,23 @@ function be(y) {
|
|
|
319
321
|
onChange: n,
|
|
320
322
|
onSearch: m,
|
|
321
323
|
multiple: N,
|
|
322
|
-
tagRender:
|
|
324
|
+
tagRender: s
|
|
323
325
|
} = l, F = Array.isArray(C) ? C : Object.keys(C), k = U(), H = j(
|
|
324
326
|
(o) => {
|
|
325
|
-
k && k.search(), !
|
|
327
|
+
k && k.search(), !f && n && n(o, i);
|
|
326
328
|
},
|
|
327
|
-
[k,
|
|
329
|
+
[k, f, n, i]
|
|
328
330
|
);
|
|
329
331
|
return "radio" in l && l.radio ? /* @__PURE__ */ r(
|
|
330
|
-
|
|
332
|
+
O.Item,
|
|
331
333
|
{
|
|
332
334
|
...l,
|
|
333
335
|
...e,
|
|
334
336
|
name: c,
|
|
335
337
|
required: I,
|
|
336
|
-
tooltip:
|
|
338
|
+
tooltip: p,
|
|
337
339
|
rules: h,
|
|
338
|
-
label:
|
|
340
|
+
label: d,
|
|
339
341
|
className: ["w-100", w].join(" "),
|
|
340
342
|
help: T,
|
|
341
343
|
children: /* @__PURE__ */ r(
|
|
@@ -351,15 +353,15 @@ function be(y) {
|
|
|
351
353
|
)
|
|
352
354
|
}
|
|
353
355
|
) : "checkbox" in l && l.checkbox ? /* @__PURE__ */ r(
|
|
354
|
-
|
|
356
|
+
O.Item,
|
|
355
357
|
{
|
|
356
358
|
...l,
|
|
357
359
|
...e,
|
|
358
360
|
name: c,
|
|
359
361
|
required: I,
|
|
360
|
-
tooltip:
|
|
362
|
+
tooltip: p,
|
|
361
363
|
rules: h,
|
|
362
|
-
label:
|
|
364
|
+
label: d,
|
|
363
365
|
className: ["w-100", w].join(" "),
|
|
364
366
|
help: T,
|
|
365
367
|
children: /* @__PURE__ */ r(J.Group, { className: "w-100", onChange: H, children: F.map((o) => {
|
|
@@ -373,18 +375,18 @@ function be(y) {
|
|
|
373
375
|
...l,
|
|
374
376
|
...e,
|
|
375
377
|
notSearch: !0,
|
|
376
|
-
tagRender: typeof
|
|
377
|
-
const { value: x, label:
|
|
378
|
-
return
|
|
378
|
+
tagRender: typeof s == "function" ? s : s ? (o) => {
|
|
379
|
+
const { value: x, label: L } = o, S = s[x];
|
|
380
|
+
return S ? /* @__PURE__ */ r(K, { color: S.color, children: L }) : /* @__PURE__ */ r(K, { children: L });
|
|
379
381
|
} : void 0,
|
|
380
382
|
onChange: H,
|
|
381
383
|
className: ["w-100", w].join(" "),
|
|
382
384
|
name: c,
|
|
383
385
|
items: F,
|
|
384
386
|
required: I,
|
|
385
|
-
tooltip:
|
|
387
|
+
tooltip: p,
|
|
386
388
|
rules: h,
|
|
387
|
-
label:
|
|
389
|
+
label: d,
|
|
388
390
|
help: T,
|
|
389
391
|
disabled: !v,
|
|
390
392
|
onSearch: m ? (o) => m(o, i) : void 0,
|
|
@@ -398,17 +400,17 @@ function be(y) {
|
|
|
398
400
|
function xe(y) {
|
|
399
401
|
const {
|
|
400
402
|
items: i = [],
|
|
401
|
-
loading:
|
|
403
|
+
loading: d,
|
|
402
404
|
searchOnType: c,
|
|
403
405
|
onSearch: u,
|
|
404
406
|
multiple: I,
|
|
405
407
|
onChange: b,
|
|
406
408
|
highlightSearch: h,
|
|
407
409
|
required: v,
|
|
408
|
-
fieldClassName:
|
|
410
|
+
fieldClassName: f,
|
|
409
411
|
rules: w,
|
|
410
412
|
fieldTooltip: R,
|
|
411
|
-
updatable:
|
|
413
|
+
updatable: p,
|
|
412
414
|
label: T,
|
|
413
415
|
name: e,
|
|
414
416
|
tagRender: l,
|
|
@@ -418,28 +420,28 @@ function xe(y) {
|
|
|
418
420
|
allowClear: n = !0,
|
|
419
421
|
selectOptionRender: m,
|
|
420
422
|
formLayoutProps: N
|
|
421
|
-
} = y,
|
|
423
|
+
} = y, s = y.form, [F, k] = Q(""), H = V(() => X.getRealName(e), [e]), o = V(
|
|
422
424
|
() => X.getRealName(e, "upsertFieldName"),
|
|
423
425
|
[e]
|
|
424
|
-
), x =
|
|
426
|
+
), x = O.useWatch(H, s), [L, S] = Q(!0);
|
|
425
427
|
G(() => {
|
|
426
|
-
C &&
|
|
427
|
-
}, [
|
|
428
|
-
x &&
|
|
428
|
+
C && L && x && (C == null || C(x, i, s), S(!1));
|
|
429
|
+
}, [L, s, i, H, C, x]), G(() => {
|
|
430
|
+
x && S(!0);
|
|
429
431
|
}, [x]);
|
|
430
432
|
const Z = j(
|
|
431
433
|
async (t) => {
|
|
432
|
-
k(t), c && (u == null || u(t,
|
|
434
|
+
k(t), c && (u == null || u(t, s, P));
|
|
433
435
|
},
|
|
434
|
-
[
|
|
436
|
+
[s, u, c, P]
|
|
435
437
|
), ee = j(
|
|
436
438
|
(t) => m ? m(t) : t.value,
|
|
437
439
|
[m]
|
|
438
440
|
), B = U(), re = j(
|
|
439
441
|
(t) => {
|
|
440
|
-
B && B.search(), b && (k(""), b(t,
|
|
442
|
+
B && B.search(), b && (k(""), b(t, s));
|
|
441
443
|
},
|
|
442
|
-
[B, b,
|
|
444
|
+
[B, b, s]
|
|
443
445
|
);
|
|
444
446
|
return /* @__PURE__ */ r(
|
|
445
447
|
Y,
|
|
@@ -464,27 +466,27 @@ function xe(y) {
|
|
|
464
466
|
),
|
|
465
467
|
placeholder: a,
|
|
466
468
|
onSelect: (t) => {
|
|
467
|
-
C == null || C(t == null ? void 0 : t.key, i,
|
|
469
|
+
C == null || C(t == null ? void 0 : t.key, i, s);
|
|
468
470
|
},
|
|
469
471
|
onChange: re,
|
|
470
472
|
mode: I ? "multiple" : void 0,
|
|
471
|
-
className: ["w-100",
|
|
473
|
+
className: ["w-100", f].join(" "),
|
|
472
474
|
name: o,
|
|
473
475
|
items: i,
|
|
474
476
|
required: v,
|
|
475
477
|
tooltip: R,
|
|
476
478
|
tagRender: l,
|
|
477
479
|
rules: w,
|
|
478
|
-
disabled: !
|
|
480
|
+
disabled: !p,
|
|
479
481
|
label: T,
|
|
480
482
|
allowClear: n,
|
|
481
483
|
onSearch: Z,
|
|
482
|
-
loading:
|
|
484
|
+
loading: d,
|
|
483
485
|
filterOption: h ? (t, g) => {
|
|
484
|
-
var q, D,
|
|
486
|
+
var q, D, W;
|
|
485
487
|
try {
|
|
486
|
-
const
|
|
487
|
-
return
|
|
488
|
+
const M = t.toLowerCase().split(/\s+/), te = ((typeof (g == null ? void 0 : g.children) == "string" ? g == null ? void 0 : g.children : (D = (q = g == null ? void 0 : g.children) == null ? void 0 : q.props) == null ? void 0 : D.textToHighlight) ?? "").toLowerCase(), oe = (((W = g == null ? void 0 : g.value) == null ? void 0 : W.toString()) ?? "").toLowerCase();
|
|
489
|
+
return M.every(
|
|
488
490
|
(_) => te.indexOf(_) >= 0 || oe.indexOf(_) >= 0
|
|
489
491
|
);
|
|
490
492
|
} catch {
|
|
@@ -527,25 +529,25 @@ function xe(y) {
|
|
|
527
529
|
function ye(y) {
|
|
528
530
|
const {
|
|
529
531
|
formLayoutProps: i,
|
|
530
|
-
required:
|
|
532
|
+
required: d,
|
|
531
533
|
fieldClassName: c,
|
|
532
534
|
rules: u,
|
|
533
535
|
fieldTooltip: I,
|
|
534
536
|
updatable: b,
|
|
535
537
|
label: h,
|
|
536
538
|
name: v,
|
|
537
|
-
fieldHelper:
|
|
539
|
+
fieldHelper: f
|
|
538
540
|
} = y;
|
|
539
541
|
return /* @__PURE__ */ r(
|
|
540
|
-
|
|
542
|
+
O.Item,
|
|
541
543
|
{
|
|
542
544
|
...i,
|
|
543
545
|
label: h,
|
|
544
546
|
name: v,
|
|
545
|
-
required:
|
|
547
|
+
required: d,
|
|
546
548
|
rules: u,
|
|
547
549
|
tooltip: I,
|
|
548
|
-
help:
|
|
550
|
+
help: f,
|
|
549
551
|
getValueFromEvent: (w) => typeof w == "object" ? w.toHexString() : w,
|
|
550
552
|
children: /* @__PURE__ */ r(
|
|
551
553
|
ae,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={str:{delete:"Delete",clone:"Clone",update:"Update",new:"New",back:"Back",next:"Next",save:"Save",import:"Import",cancel:"Cancel",print:"Print",hide:"Hide",no:"No",action:"Action",remove:"Remove",view:"View",ok:"Ok",yes:"Yes",warning:"Warning",success:"Success",error:"Error",retry:"Retry",previous:"Previous",unhide:"Unhide",downloadCsvTemplate:"Download CSV Template",importCsvFile:"Import CSV File",export:"Export",goBack:"Go Back",refresh:"Refresh",fileUploadMessage1:"Drag file here or ",fileUploadMessage2:"Click to Upload",rotateLeft:"Rotate Left",rotateRight:"Rotate Right",flipHorizontal:"Flip Horizontal",flipVertical:"Flip Vertical",skipCrop:"Skip Crop",showFields:"Show Fields"},err:{save:"An error occurred while saving",validation:{required:"is required",minLength8:"must be at least 8 characters",percentage:"must be a percentage",maximumValueExceeded:"must be less than %maxValue%",invalidNic:"must be a valid NIC",invalid:"must be a valid",integer:"must be an integer"},notFound:"Not Found"},message:{loading:{saving:"Saving"},uploadButtonText:"Click to Upload"},qus:{importWithIssues:"Some fields have issues. Do you want to proceed with the import?",doYouWantToDelete:"Do you want to delete?",doYouWantToHide:"Do you want to hide?",doYouWantToUnhide:"Do you want to unhide?"}};module.exports=e;
|
|
1
|
+
"use strict";const e={str:{delete:"Delete",clone:"Clone",update:"Update",new:"New",back:"Back",next:"Next",save:"Save",import:"Import",cancel:"Cancel",print:"Print",hide:"Hide",no:"No",action:"Action",remove:"Remove",view:"View",ok:"Ok",yes:"Yes",warning:"Warning",success:"Success",error:"Error",retry:"Retry",previous:"Previous",unhide:"Unhide",downloadCsvTemplate:"Download CSV Template",importCsvFile:"Import CSV File",export:"Export",goBack:"Go Back",refresh:"Refresh",fileUploadMessage1:"Drag file here or ",fileUploadMessage2:"Click to Upload",rotateLeft:"Rotate Left",rotateRight:"Rotate Right",flipHorizontal:"Flip Horizontal",flipVertical:"Flip Vertical",skipCrop:"Skip Crop",showFields:"Show Fields"},err:{save:"An error occurred while saving",validation:{required:"is required",minLength8:"must be at least 8 characters",percentage:"must be a percentage",maximumValueExceeded:"must be less than %maxValue%",invalidNic:"must be a valid NIC",invalid:"must be a valid",invalidEmail:"Invalid email address",integer:"must be an integer"},notFound:"Not Found"},message:{loading:{saving:"Saving"},uploadButtonText:"Click to Upload"},qus:{importWithIssues:"Some fields have issues. Do you want to proceed with the import?",doYouWantToDelete:"Do you want to delete?",doYouWantToHide:"Do you want to hide?",doYouWantToUnhide:"Do you want to unhide?"}};module.exports=e;
|
|
@@ -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;
|