@kingteza/crud-component 1.34.1 → 1.36.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/common/wizard/WizardViewForm.cjs.js +1 -1
- package/dist/common/wizard/WizardViewForm.d.ts +6 -3
- package/dist/common/wizard/WizardViewForm.es.js +59 -52
- package/dist/crud/actions/index.cjs.js +1 -1
- package/dist/crud/actions/index.d.ts +4 -1
- package/dist/crud/actions/index.es.js +82 -63
- package/dist/crud/view/CrudDecListView.cjs.js +1 -1
- package/dist/crud/view/CrudDecListView.es.js +40 -36
- package/dist/crud/view/CrudViewer.cjs.js +1 -1
- package/dist/index.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.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/dist/util/crud/crud-action.util.cjs.js +1 -0
- package/dist/util/crud/crud-action.util.d.ts +2 -0
- package/dist/util/crud/crud-action.util.es.js +20 -0
- 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 c=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),R=require("antd"),n=require("react"),y=require("../appearance/Hider.cjs.js"),H=n.forwardRef(({pages:d,onSubmit:u,initPosition:f=0,type:w,labelPlacement:p,className:x,pageStyle:C,showSteps:k=!0,freeNavigation:S},q)=>{const[t,i]=n.useState(0),[r,m]=n.useState([]);n.useEffect(()=>{i(f)},[f]),n.useImperativeHandle(q,()=>({gotTo:s=>i(s)}),[]);const h=n.useCallback((s,a=!1,l=!1)=>{const e=[...r];if(s!==void 0&&(e[t]=s,m(e)),l||i(t+1),a&&u){let o={};for(const j of e)for(const v in j)o[v]=j[v];u(e,o)}},[t,r,u]),b=n.useCallback(()=>{const s=[...r];s[t]=void 0,m(s),i(t-1)},[t,r]),g=n.useMemo(()=>{let s=[],a=[];const l=d.filter(e=>!e.hidden);for(let e=0;e<l.length;e++){const o=l[e];a.push(c.jsx(y,{hide:t!==e,children:o.component({forward:h,backward:b},r,t===e)},`${o.title}${e}`)),s.push({icon:o.icon,title:o.title,disabled:o.disabled})}return{_pages:a,steps:s}},[b,t,r,h,d]),F=n.useCallback(s=>{i(s)},[]);return c.jsxs(c.Fragment,{children:[k&&c.jsx(R.Steps,{labelPlacement:p,titlePlacement:p,className:[x,"pb-3"].join(" "),current:t,type:w,items:g.steps,onChange:S?F:void 0}),c.jsx("div",{style:C,children:g._pages})]})});module.exports=H;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { StepsProps } from 'antd/lib';
|
|
1
2
|
import { default as React, ReactElement } from 'react';
|
|
2
3
|
interface WizardViewFormProps {
|
|
3
4
|
pages: {
|
|
4
5
|
hidden?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
5
7
|
icon?: React.ReactNode;
|
|
6
8
|
title: string;
|
|
7
9
|
component: (func: {
|
|
@@ -9,13 +11,14 @@ interface WizardViewFormProps {
|
|
|
9
11
|
backward: () => void;
|
|
10
12
|
}, formSubmissionData: any[], isActive: boolean) => ReactElement;
|
|
11
13
|
}[];
|
|
12
|
-
labelPlacement?:
|
|
14
|
+
labelPlacement?: 'vertical' | 'horizontal';
|
|
13
15
|
initPosition?: number;
|
|
14
16
|
onSubmit?: (val: (any | undefined)[], combinedValue: any) => void;
|
|
15
|
-
type?:
|
|
17
|
+
type?: StepsProps['type'];
|
|
16
18
|
className?: string;
|
|
17
|
-
progressDot?: boolean;
|
|
18
19
|
pageStyle?: React.CSSProperties;
|
|
20
|
+
showSteps?: boolean;
|
|
21
|
+
freeNavigation?: boolean;
|
|
19
22
|
}
|
|
20
23
|
export interface WizardViewFormRef {
|
|
21
24
|
gotTo: (index: number) => void;
|
|
@@ -1,74 +1,81 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Steps as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { jsx as a, jsxs as _, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { Steps as z } from "antd";
|
|
3
|
+
import { forwardRef as E, useState as C, useEffect as I, useImperativeHandle as M, useCallback as d, useMemo as N } from "react";
|
|
4
|
+
import R from "../appearance/Hider.es.js";
|
|
5
|
+
const A = E(
|
|
6
6
|
({
|
|
7
|
-
pages:
|
|
7
|
+
pages: f,
|
|
8
8
|
onSubmit: l,
|
|
9
|
-
initPosition:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
C,
|
|
9
|
+
initPosition: m = 0,
|
|
10
|
+
type: S,
|
|
11
|
+
labelPlacement: p,
|
|
12
|
+
className: j,
|
|
13
|
+
pageStyle: k,
|
|
14
|
+
showSteps: x = !0,
|
|
15
|
+
freeNavigation: F
|
|
16
|
+
}, y) => {
|
|
17
|
+
const [s, n] = C(0), [r, u] = C([]);
|
|
18
|
+
I(() => {
|
|
19
|
+
n(m);
|
|
20
|
+
}, [m]), M(
|
|
21
|
+
y,
|
|
23
22
|
() => ({
|
|
24
|
-
gotTo: (
|
|
23
|
+
gotTo: (t) => n(t)
|
|
25
24
|
}),
|
|
26
25
|
[]
|
|
27
26
|
);
|
|
28
|
-
const
|
|
29
|
-
(
|
|
27
|
+
const h = d(
|
|
28
|
+
(t, i = !1, c = !1) => {
|
|
30
29
|
const e = [...r];
|
|
31
|
-
if (
|
|
32
|
-
|
|
30
|
+
if (t !== void 0 && (e[s] = t, u(e)), c || n(s + 1), i && l) {
|
|
31
|
+
let o = {};
|
|
33
32
|
for (const w of e)
|
|
34
|
-
for (const
|
|
35
|
-
o[
|
|
33
|
+
for (const b in w)
|
|
34
|
+
o[b] = w[b];
|
|
36
35
|
l(e, o);
|
|
37
36
|
}
|
|
38
37
|
},
|
|
39
|
-
[
|
|
40
|
-
),
|
|
41
|
-
const
|
|
42
|
-
s
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
c
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
[s, r, l]
|
|
39
|
+
), g = d(() => {
|
|
40
|
+
const t = [...r];
|
|
41
|
+
t[s] = void 0, u(t), n(s - 1);
|
|
42
|
+
}, [s, r]), v = N(() => {
|
|
43
|
+
let t = [], i = [];
|
|
44
|
+
const c = f.filter((e) => !e.hidden);
|
|
45
|
+
for (let e = 0; e < c.length; e++) {
|
|
46
|
+
const o = c[e];
|
|
47
|
+
i.push(
|
|
48
|
+
/* @__PURE__ */ a(R, { hide: s !== e, children: o.component({ forward: h, backward: g }, r, s === e) }, `${o.title}${e}`)
|
|
49
|
+
), t.push({
|
|
50
|
+
icon: o.icon,
|
|
51
|
+
title: o.title,
|
|
52
|
+
disabled: o.disabled
|
|
53
|
+
});
|
|
50
54
|
}
|
|
51
55
|
return {
|
|
52
|
-
_pages:
|
|
53
|
-
steps:
|
|
56
|
+
_pages: i,
|
|
57
|
+
steps: t
|
|
54
58
|
};
|
|
55
|
-
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
}, [g, s, r, h, f]), H = d((t) => {
|
|
60
|
+
n(t);
|
|
61
|
+
}, []);
|
|
62
|
+
return /* @__PURE__ */ _($, { children: [
|
|
63
|
+
x && /* @__PURE__ */ a(
|
|
64
|
+
z,
|
|
59
65
|
{
|
|
60
|
-
labelPlacement:
|
|
61
|
-
|
|
62
|
-
className: [
|
|
63
|
-
current:
|
|
64
|
-
type:
|
|
65
|
-
|
|
66
|
+
labelPlacement: p,
|
|
67
|
+
titlePlacement: p,
|
|
68
|
+
className: [j, "pb-3"].join(" "),
|
|
69
|
+
current: s,
|
|
70
|
+
type: S,
|
|
71
|
+
items: v.steps,
|
|
72
|
+
onChange: F ? H : void 0
|
|
66
73
|
}
|
|
67
74
|
),
|
|
68
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ a("div", { style: k, children: v._pages })
|
|
69
76
|
] });
|
|
70
77
|
}
|
|
71
78
|
);
|
|
72
79
|
export {
|
|
73
|
-
|
|
80
|
+
A as default
|
|
74
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),b=require("react"),$=require("../../common/button/CloneButtonTable.cjs.js"),H=require("../../common/button/DeleteButtonTable.cjs.js"),w=require("../../common/button/ExportButton.cjs.js"),B=require("../../common/button/HideButtonTable.cjs.js"),C=require("../../common/button/UpdateButtonTable.cjs.js"),k=require("../../util/crud/crud-action.util.cjs.js"),V=require("../modal/index.cjs.js");function K({data:u,idField:r="id",extraAction:c,onUpdate:L,onClickUpdate:v,onClickClone:m,onDelete:y,onHide:g,onExport:_,isHiding:o,isDeleting:S,confirmHiding:N,confirmDeleting:Q,closeViewOnClickUpdate:n,recentUpdateOrDeleteId:A,setRecentUpdateOrDeleteId:j,setOpenView:x,inBuiltModalProps:q,updatable:T,deletable:h}){const W=c==null?void 0:c(u),E=b.useRef(null),z=b.useCallback((f,Z=!0,G=!1)=>{var J;j==null||j(f[r]),q?(J=E.current)==null||J.update(f,Z,G):G?m==null||m(f):v==null||v(f),n&&(x==null||x(void 0))},[r,q,m,v,n,x,j]),X=b.useMemo(()=>!!(!T||T(u)),[T,u]),Y=b.useMemo(()=>!!(!h||h(u)),[h,u]);return s.jsxs(s.Fragment,{children:[q&&s.jsx(V,{ref:E,...q}),W,(L||v||(q==null?void 0:q.onUpdate))&&X&&s.jsx(C,{value:u,onClick:f=>z(f)}),(m||(q==null?void 0:q.onCreate))&&s.jsx($,{value:u,onClick:f=>z(f,!1,!0)}),_&&s.jsx(w.ExportButton,{value:u,onClick:async f=>await _(f)}),g&&s.jsx(B,{value:u,disabled:o,shouldConfirm:N,loading:o&&u[r]===A,onClick:async f=>{j==null||j(f[r]),await g({[r]:f[r]})}}),y&&Y&&s.jsx(H,{value:u,disabled:S,shouldConfirm:Q,loading:S&&u[r]===A,onClick:async f=>{j==null||j(f[r]),await y({[r]:f[r]})}})]})}function F(u){if(k.hasCrudActions(u,u.data))return s.jsx(K,{...u})}exports.CrudActionsInternal=K;exports.default=F;
|
|
@@ -22,7 +22,10 @@ export interface CrudActionsProps<T, FormType> {
|
|
|
22
22
|
setOpenView?: (data: T | undefined) => void;
|
|
23
23
|
inBuiltModalProps?: CrudModalProps<T, FormType>;
|
|
24
24
|
}
|
|
25
|
-
declare function
|
|
25
|
+
export declare function CrudActionsInternal<T, FormType>({ data, idField, extraAction, onUpdate, onClickUpdate, onClickClone, onDelete, onHide, onExport, isHiding, isDeleting, confirmHiding, confirmDeleting, closeViewOnClickUpdate, recentUpdateOrDeleteId, setRecentUpdateOrDeleteId, setOpenView, inBuiltModalProps, updatable, deletable, }: CrudActionsProps<T, FormType> & {
|
|
26
|
+
data: T;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare function CrudActions<T, FormType>(props: CrudActionsProps<T, FormType> & {
|
|
26
29
|
data: T;
|
|
27
30
|
}): import("react/jsx-runtime").JSX.Element | undefined;
|
|
28
31
|
export default CrudActions;
|
|
@@ -1,85 +1,104 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { ExportButton as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as h, jsxs as w, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as k, useCallback as B, useMemo as W } from "react";
|
|
3
|
+
import V from "../../common/button/CloneButtonTable.es.js";
|
|
4
|
+
import F from "../../common/button/DeleteButtonTable.es.js";
|
|
5
|
+
import { ExportButton as c } from "../../common/button/ExportButton.es.js";
|
|
6
|
+
import M from "../../common/button/HideButtonTable.es.js";
|
|
7
|
+
import s from "../../common/button/UpdateButtonTable.es.js";
|
|
8
|
+
import { hasCrudActions as P } from "../../util/crud/crud-action.util.es.js";
|
|
9
|
+
import R from "../modal/index.es.js";
|
|
10
|
+
function I({
|
|
11
|
+
data: f,
|
|
12
|
+
idField: u = "id",
|
|
13
|
+
extraAction: y,
|
|
14
|
+
onUpdate: X,
|
|
14
15
|
onClickUpdate: T,
|
|
15
|
-
onClickClone:
|
|
16
|
-
onDelete:
|
|
17
|
-
onHide:
|
|
18
|
-
onExport:
|
|
19
|
-
isHiding:
|
|
20
|
-
isDeleting:
|
|
21
|
-
confirmHiding:
|
|
22
|
-
confirmDeleting:
|
|
23
|
-
closeViewOnClickUpdate:
|
|
24
|
-
recentUpdateOrDeleteId:
|
|
25
|
-
setRecentUpdateOrDeleteId:
|
|
26
|
-
setOpenView:
|
|
27
|
-
inBuiltModalProps:
|
|
28
|
-
updatable:
|
|
29
|
-
deletable:
|
|
16
|
+
onClickClone: b,
|
|
17
|
+
onDelete: q,
|
|
18
|
+
onHide: x,
|
|
19
|
+
onExport: z,
|
|
20
|
+
isHiding: E,
|
|
21
|
+
isDeleting: G,
|
|
22
|
+
confirmHiding: Y,
|
|
23
|
+
confirmDeleting: Z,
|
|
24
|
+
closeViewOnClickUpdate: J,
|
|
25
|
+
recentUpdateOrDeleteId: K,
|
|
26
|
+
setRecentUpdateOrDeleteId: r,
|
|
27
|
+
setOpenView: o,
|
|
28
|
+
inBuiltModalProps: v,
|
|
29
|
+
updatable: j,
|
|
30
|
+
deletable: g
|
|
30
31
|
}) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
h == null || h(m[y]), f ? (u = Z.current) == null || u.update(m, k, E) : E ? q == null || q(m) : T == null || T(m), b && (Q == null || Q(void 0));
|
|
32
|
+
const _ = y == null ? void 0 : y(f), L = k(null), N = B(
|
|
33
|
+
(m, H = !0, Q = !1) => {
|
|
34
|
+
var S;
|
|
35
|
+
r == null || r(m[u]), v ? (S = L.current) == null || S.update(m, H, Q) : Q ? b == null || b(m) : T == null || T(m), J && (o == null || o(void 0));
|
|
36
36
|
},
|
|
37
|
-
[
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
[
|
|
38
|
+
u,
|
|
39
|
+
v,
|
|
40
|
+
b,
|
|
41
|
+
T,
|
|
42
|
+
J,
|
|
43
|
+
o,
|
|
44
|
+
r
|
|
45
|
+
]
|
|
46
|
+
), $ = W(
|
|
47
|
+
() => !!(!j || j(f)),
|
|
48
|
+
[j, f]
|
|
49
|
+
), A = W(
|
|
50
|
+
() => !!(!g || g(f)),
|
|
51
|
+
[g, f]
|
|
52
|
+
);
|
|
53
|
+
return /* @__PURE__ */ w(C, { children: [
|
|
54
|
+
v && /* @__PURE__ */ h(R, { ref: L, ...v }),
|
|
55
|
+
_,
|
|
56
|
+
(X || T || (v == null ? void 0 : v.onUpdate)) && $ && /* @__PURE__ */ h(s, { value: f, onClick: (m) => N(m) }),
|
|
57
|
+
(b || (v == null ? void 0 : v.onCreate)) && /* @__PURE__ */ h(
|
|
58
|
+
V,
|
|
45
59
|
{
|
|
46
|
-
value:
|
|
47
|
-
onClick: (m) =>
|
|
60
|
+
value: f,
|
|
61
|
+
onClick: (m) => N(m, !1, !0)
|
|
48
62
|
}
|
|
49
63
|
),
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
z && /* @__PURE__ */ h(
|
|
65
|
+
c,
|
|
52
66
|
{
|
|
53
|
-
value:
|
|
54
|
-
onClick: async (m) => await
|
|
67
|
+
value: f,
|
|
68
|
+
onClick: async (m) => await z(m)
|
|
55
69
|
}
|
|
56
70
|
),
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
x && /* @__PURE__ */ h(
|
|
72
|
+
M,
|
|
59
73
|
{
|
|
60
|
-
value:
|
|
61
|
-
disabled:
|
|
62
|
-
shouldConfirm:
|
|
63
|
-
loading:
|
|
74
|
+
value: f,
|
|
75
|
+
disabled: E,
|
|
76
|
+
shouldConfirm: Y,
|
|
77
|
+
loading: E && f[u] === K,
|
|
64
78
|
onClick: async (m) => {
|
|
65
|
-
|
|
79
|
+
r == null || r(m[u]), await x({ [u]: m[u] });
|
|
66
80
|
}
|
|
67
81
|
}
|
|
68
82
|
),
|
|
69
|
-
|
|
70
|
-
|
|
83
|
+
q && A && /* @__PURE__ */ h(
|
|
84
|
+
F,
|
|
71
85
|
{
|
|
72
|
-
value:
|
|
73
|
-
disabled:
|
|
74
|
-
shouldConfirm:
|
|
75
|
-
loading:
|
|
86
|
+
value: f,
|
|
87
|
+
disabled: G,
|
|
88
|
+
shouldConfirm: Z,
|
|
89
|
+
loading: G && f[u] === K,
|
|
76
90
|
onClick: async (m) => {
|
|
77
|
-
|
|
91
|
+
r == null || r(m[u]), await q({ [u]: m[u] });
|
|
78
92
|
}
|
|
79
93
|
}
|
|
80
94
|
)
|
|
81
|
-
] })
|
|
95
|
+
] });
|
|
96
|
+
}
|
|
97
|
+
function d(f) {
|
|
98
|
+
if (P(f, f.data))
|
|
99
|
+
return /* @__PURE__ */ h(I, { ...f });
|
|
82
100
|
}
|
|
83
101
|
export {
|
|
84
|
-
|
|
102
|
+
I as CrudActionsInternal,
|
|
103
|
+
d as default
|
|
85
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),C=require("../../common/description/DescList.cjs.js"),h=require("react"),x=require("../../locale/index.cjs.js"),j=require("./CrudViewerUtil.cjs.js"),w=require("../../util/CrudUtil.cjs.js"),V=require("../actions/index.cjs.js"),v=require("../../util/ObjectUtil.cjs.js"),f=require("../../util/crud/crud-action.util.cjs.js");function L({className:a,fields:n,data:e,descListColumn:d={xs:1,md:3,sm:2,lg:4},layout:m,keepEmptyValues:q,inBuiltModalProps:o,...i}){const{t:s}=x.useTranslationLib(),b=h.useMemo(()=>{const c=n.filter(({hidden:t,hideInDescList:u})=>!t&&!u).map((t,u)=>{const g=w.getRealName(t.name);return{label:t.label,noFormatting:!0,value:j.getRendererValueCrudViewer(t)(v.getValueByPath(e,g),e,u)}}),l=f.hasCrudActions(i,e)?r.jsx(V.CrudActionsInternal,{data:e,...i,inBuiltModalProps:o?{...o,fields:n}:void 0}):void 0;return l&&c.push({label:s("str.action"),value:l}),c},[e,n,s,i]);return e?r.jsx(C,{keepEmptyValues:q,bordered:!0,column:d,className:a,layout:m,list:b}):r.jsx(r.Fragment,{})}exports.CrudDecListView=L;
|
|
@@ -1,57 +1,61 @@
|
|
|
1
|
-
import { jsx as m, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { useTranslationLib as
|
|
5
|
-
import { getRendererValueCrudViewer as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getValueByPath as
|
|
1
|
+
import { jsx as m, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import C from "../../common/description/DescList.es.js";
|
|
3
|
+
import { useMemo as b } from "react";
|
|
4
|
+
import { useTranslationLib as v } from "../../locale/index.es.js";
|
|
5
|
+
import { getRendererValueCrudViewer as w } from "./CrudViewerUtil.es.js";
|
|
6
|
+
import V from "../../util/CrudUtil.es.js";
|
|
7
|
+
import { CrudActionsInternal as x } from "../actions/index.es.js";
|
|
8
|
+
import { getValueByPath as F } from "../../util/ObjectUtil.es.js";
|
|
9
|
+
import { hasCrudActions as L } from "../../util/crud/crud-action.util.es.js";
|
|
9
10
|
function T({
|
|
10
|
-
className:
|
|
11
|
+
className: c,
|
|
11
12
|
fields: t,
|
|
12
|
-
data:
|
|
13
|
+
data: o,
|
|
13
14
|
descListColumn: f = { xs: 1, md: 3, sm: 2, lg: 4 },
|
|
14
|
-
layout:
|
|
15
|
+
layout: p,
|
|
15
16
|
keepEmptyValues: a,
|
|
16
|
-
inBuiltModalProps:
|
|
17
|
-
...
|
|
17
|
+
inBuiltModalProps: n,
|
|
18
|
+
...e
|
|
18
19
|
}) {
|
|
19
|
-
const { t:
|
|
20
|
-
const l = t.filter(({ hidden:
|
|
21
|
-
const
|
|
20
|
+
const { t: s } = v(), h = b(() => {
|
|
21
|
+
const l = t.filter(({ hidden: r, hideInDescList: i }) => !r && !i).map((r, i) => {
|
|
22
|
+
const d = V.getRealName(r.name);
|
|
22
23
|
return {
|
|
23
|
-
label:
|
|
24
|
+
label: r.label,
|
|
24
25
|
noFormatting: !0,
|
|
25
|
-
value:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
value: w(r)(
|
|
27
|
+
F(o, d),
|
|
28
|
+
o,
|
|
29
|
+
i
|
|
29
30
|
)
|
|
30
31
|
};
|
|
31
|
-
}),
|
|
32
|
-
|
|
32
|
+
}), u = L(
|
|
33
|
+
e,
|
|
34
|
+
o
|
|
35
|
+
) ? /* @__PURE__ */ m(
|
|
36
|
+
x,
|
|
33
37
|
{
|
|
34
|
-
data:
|
|
35
|
-
...
|
|
36
|
-
inBuiltModalProps:
|
|
38
|
+
data: o,
|
|
39
|
+
...e,
|
|
40
|
+
inBuiltModalProps: n ? { ...n, fields: t } : void 0
|
|
37
41
|
}
|
|
38
42
|
) : void 0;
|
|
39
|
-
return
|
|
40
|
-
label:
|
|
41
|
-
value:
|
|
43
|
+
return u && l.push({
|
|
44
|
+
label: s("str.action"),
|
|
45
|
+
value: u
|
|
42
46
|
}), l;
|
|
43
|
-
}, [
|
|
44
|
-
return
|
|
45
|
-
|
|
47
|
+
}, [o, t, s, e]);
|
|
48
|
+
return o ? /* @__PURE__ */ m(
|
|
49
|
+
C,
|
|
46
50
|
{
|
|
47
51
|
keepEmptyValues: a,
|
|
48
52
|
bordered: !0,
|
|
49
53
|
column: f,
|
|
50
|
-
className:
|
|
51
|
-
layout:
|
|
52
|
-
list:
|
|
54
|
+
className: c,
|
|
55
|
+
layout: p,
|
|
56
|
+
list: h
|
|
53
57
|
}
|
|
54
|
-
) : /* @__PURE__ */ m(
|
|
58
|
+
) : /* @__PURE__ */ m(g, {});
|
|
55
59
|
}
|
|
56
60
|
export {
|
|
57
61
|
T as CrudDecListView
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),qt=require("antd"),Ct=require("@dnd-kit/core"),St=require("@dnd-kit/modifiers"),It=require("@dnd-kit/utilities"),T=require("@dnd-kit/sortable"),Rt=require("../../common/button/Button.cjs.js"),lt=require("../../common/button/RefreshButton.cjs.js"),
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),qt=require("antd"),Ct=require("@dnd-kit/core"),St=require("@dnd-kit/modifiers"),It=require("@dnd-kit/utilities"),T=require("@dnd-kit/sortable"),Rt=require("../../common/button/Button.cjs.js"),lt=require("../../common/button/RefreshButton.cjs.js"),dt=require("../../common/button/ViewButtonTable.cjs.js"),Mt=require("../actions/index.cjs.js"),Tt=require("../../common/table/table.cjs.js"),s=require("react"),Vt=require("../../locale/index.cjs.js"),Bt=require("../CrudSearchComponent.cjs.js"),Dt=require("./CrudDecListView.cjs.js"),st=require("./CrudViewerUtil.cjs.js"),Ot=require("@ant-design/icons"),rt=require("../../util/CrudUtil.cjs.js"),Nt=require("../../common/layout/VerticalSpace.cjs.js"),kt=s.memo(Tt);function Et({summary:j,idField:o="id",loadingData:q,fields:h,isDeleting:l,isHiding:V,viewable:c=!1,paginateProps:f,onDelete:S,deletable:d,updatable:k,onHide:z,onUpdate:B,data:I=[],extraAction:D,onClickUpdate:O,minusHeight:E,scroll:$,onClickClone:A,className:_,expandable:G,size:J,bordered:K,descListColumn:ut,extraView:L,decListLayout:it,scrollToTop:zt,onClickRefresh:Q,closeViewOnClickUpdate:X,onExport:Y,confirmHiding:Z,confirmDeleting:W,rowClassName:P,actionWidth:H=190,draggable:t,rowSelection:U,...ft}){const{t:w}=Vt.useTranslationLib(),p=s.useMemo(()=>h.map(({hideInTable:e,hidden:r,width:u,label:m,halign:R,...C})=>{const N=rt.getRealName(C.name);return{title:m,width:u,key:N,dataIndex:N,hidden:e||r,align:R??(C.type==="number"?"right":void 0),render:st.getRendererValueCrudViewer(C),sorter:C.sorter,defaultSortOrder:C.defaultSortOrder}}),[h]),[i,M]=s.useState(),[F,a]=s.useState(),[y,b]=s.useState([]),mt=s.useCallback(e=>{M(e)},[]);s.useEffect(()=>{I&&b(I)},[I]),s.useEffect(()=>{I&&M(e=>{if(e)return I.find(r=>r[o]===e[o])})},[I,o,i]);const g=s.useCallback(e=>{var m;const{active:r,over:u}=e;if(t!=null&&t.onDragEnd&&(t==null||t.onDragEnd(e)),r.id!==(u==null?void 0:u.id)){const R=y.findIndex(x=>x[o]===r.id),C=y.findIndex(x=>x[o]===(u==null?void 0:u.id)),N=T.arrayMove(y,R,C);b(x=>{const ht=x.findIndex(v=>v[o]===(r==null?void 0:r.id)),yt=x.findIndex(v=>v[o]===(u==null?void 0:u.id));return T.arrayMove(x,ht,yt)}),(m=t==null?void 0:t.onDrag)==null||m.call(t,{newOrder:N.map(x=>x[o])})}},[y,o,t]),xt=s.useMemo(()=>{let e=typeof c=="string"?i==null?void 0:i[c]:void 0;if(typeof e=="object"){const r=h.find(u=>rt.getRealName(u.name)===c);e=st.getRendererValueCrudViewer(r)(e,i,0)}return e},[c,i,h]),tt=s.useMemo(()=>({rowSelection:U,rowClassName:P,className:_,scroll:$??(E?{y:`calc(100vh - ${E})`}:void 0),id:"crud-table",bordered:K,size:J,expandable:G}),[U,P,_,$,E,K,J,G]),et=s.useMemo(()=>f?{...f,total:f.count,onChange:f.setPage,current:f.page,pageSize:f.pageSize}:void 0,[f]),nt=s.useMemo(()=>{const e=B||O||S||D||c,r=[];return t&&r.push({key:"key",align:"center",width:5,title:t==null?void 0:t.columnLabel,render:()=>n.jsx(Lt,{tooltip:t==null?void 0:t.tooltip})}),r.push(...p),e&&e&&r.push({title:w("str.action"),fixed:"right",width:H,render:(u,m)=>n.jsxs(n.Fragment,{children:[c&&n.jsx(dt,{value:m,onClick:typeof c=="object"?()=>{var R;return(R=c.onClick)==null?void 0:R.call(c,m)}:mt}),n.jsx(Mt.default,{data:m,idField:o,extraAction:D,onUpdate:B,onClickUpdate:O,onClickClone:A,onDelete:S,deletable:d,updatable:k,onHide:z,onExport:Y,isHiding:V,isDeleting:l,confirmHiding:Z,confirmDeleting:W,closeViewOnClickUpdate:X,recentUpdateOrDeleteId:F,setRecentUpdateOrDeleteId:a,setOpenView:M})]})}),r},[p,B,O,S,d,k,D,c,w,H]),ot=s.useMemo(()=>y.map(e=>e[o]),[y,o]),jt=s.useCallback(()=>{const e=n.jsx(kt,{...tt,summary:j,dataSource:y,loading:q,components:t?{body:{row:vt}}:void 0,pagination:et,columns:nt});return t?n.jsx(Ct.DndContext,{modifiers:[St.restrictToVerticalAxis],onDragEnd:g,children:n.jsx(T.SortableContext,{items:ot,strategy:T.verticalListSortingStrategy,children:e})}):e},[tt,y,q,et,nt,j,t,ot,g]);return n.jsxs("div",{children:[(typeof c=="boolean"||typeof c=="string")&&n.jsx(qt.Modal,{width:"100%",open:!!i,title:xt??n.jsx("div",{children:" "}),footer:n.jsx(n.Fragment,{}),closable:!0,onCancel:()=>M(void 0),children:!!i&&n.jsxs("div",{children:[n.jsx(Dt.CrudDecListView,{layout:it,descListColumn:ut,data:i,fields:h,idField:o,extraAction:D,onUpdate:B,onClickUpdate:O,onClickClone:A,onDelete:S,deletable:d,updatable:k,onHide:z,onExport:Y,isHiding:V,isDeleting:l,confirmHiding:Z,confirmDeleting:W,closeViewOnClickUpdate:X,recentUpdateOrDeleteId:F,setRecentUpdateOrDeleteId:a,setOpenView:M}),L==null?void 0:L(i)]},i==null?void 0:i[o])}),n.jsx(Bt,{fields:h,...ft}),n.jsxs(Nt,{children:[!!Q&&n.jsx(lt.RefreshButton,{onClick:Q}),jt()]})]})}const ct=s.createContext({}),Lt=({tooltip:j})=>{const{setActivatorNodeRef:o,listeners:q}=s.useContext(ct);return n.jsx(Rt,{type:"text",size:"small",tooltip:j,icon:n.jsx(Ot.HolderOutlined,{}),style:{cursor:"move",border:"none"},ref:o,...q})},vt=j=>{const{attributes:o,listeners:q,setNodeRef:h,setActivatorNodeRef:l,transform:V,transition:c,isDragging:f}=T.useSortable({id:j["data-row-key"]}),S={...j.style,transform:It.CSS.Translate.toString(V),transition:c,...f?{position:"relative",zIndex:9999}:{}},d=s.useMemo(()=>({setActivatorNodeRef:l,listeners:q}),[l,q]);return n.jsx(ct.Provider,{value:d,children:n.jsx("tr",{...j,ref:h,style:S,...o})})};module.exports=Et;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const i=require("./locale/hooks/translation-constants.cjs.js"),u=require("./locale/index.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const i=require("./locale/hooks/translation-constants.cjs.js"),u=require("./locale/index.cjs.js"),t=require("./crud/CrudComponent.cjs.js"),r=require("./crud/CrudField.cjs.js"),C=require("./crud/CrudFormWizard.cjs.js"),n=require("./crud/CrudReportComponent.cjs.js"),l=require("./crud/CrudSearchComponent.cjs.js"),e=require("./crud/ImageCrudField.cjs.js"),o=require("./crud/FileCrudField.cjs.js"),a=require("./crud/FileCrudDragNDropField.cjs.js"),s=require("./crud/CrudTextAreaComponent.cjs.js"),m=require("./crud/import/CrudImportComponent.cjs.js"),F=require("./crud/import/CrudImportButton.cjs.js"),p=require("./crud/actions/index.cjs.js"),c=require("./crud/view/CrudViewer.cjs.js"),q=require("./context/CrudComponentProvider.cjs.js"),d=require("./crud/CrudForm.cjs.js"),V=require("./crud/modal/index.cjs.js"),I=require("./crud/view/CrudDecListView.cjs.js"),g=require("./crud/view/CrudViewerUtil.cjs.js");exports.TRANSLATION_NAMESPACE=i.TRANSLATION_NAMESPACE;exports.setupI18n=u.setupI18n;exports.updateTranslations=u.updateTranslations;exports.CrudComponent=t;exports.ColorCrudFieldComponent=r.ColorCrudFieldComponent;exports.CrudField=r.default;exports.SelectCrudFieldComponent=r.SelectCrudFieldComponent;exports.CrudFormWizard=C;exports.CrudReportComponent=n;exports.CrudSearchComponent=l;exports.FileDownloadProvider=e.FileDownloadProvider;exports.FileUploadProvider=e.FileUploadProvider;exports.ImageCellValue=e.ImageCellValue;exports.ImageCrudCellValue=e.ImageCrudCellValue;exports.ImageCrudField=e.default;exports.FileCellValue=o.FileCellValue;exports.FileCrudCellValue=o.FileCrudCellValue;exports.FileCrudField=o.default;exports.FileCrudDragNDropField=a;exports.CrudTextAreaComponent=s;exports.CrudImportComponent=m;exports.CrudImportButton=F;exports.CrudActions=p.default;exports.CrudViewer=c;exports.CrudComponentProvider=q.CrudComponentProvider;exports.CrudForm=d.CrudForm;exports.CrudFormFields=d.CrudFormFields;exports.CrudModal=V;exports.CrudDecListView=I.CrudDecListView;exports.getRendererValueCrudViewer=g.getRendererValueCrudViewer;
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(a,n){const{extraAction:t,onUpdate:l,onClickUpdate:s,onClickClone:u,onDelete:C,onHide:d,onExport:f,inBuiltModalProps:e,updatable:r,deletable:c}=a;if(!n)return!1;const o=t==null?void 0:t(n),i=r?r(n):!0,b=c?c(n):!0;return!!((Array.isArray(o)?o.filter(Boolean).length:o)||l||i&&s||e!=null&&e.onUpdate||u||e!=null&&e.onCreate||b&&C||f||d)}exports.hasCrudActions=p;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function d(a, n) {
|
|
2
|
+
const {
|
|
3
|
+
extraAction: t,
|
|
4
|
+
onUpdate: l,
|
|
5
|
+
onClickUpdate: s,
|
|
6
|
+
onClickClone: C,
|
|
7
|
+
onDelete: f,
|
|
8
|
+
onHide: p,
|
|
9
|
+
onExport: u,
|
|
10
|
+
inBuiltModalProps: e,
|
|
11
|
+
updatable: r,
|
|
12
|
+
deletable: c
|
|
13
|
+
} = a;
|
|
14
|
+
if (!n) return !1;
|
|
15
|
+
const o = t == null ? void 0 : t(n), U = r ? r(n) : !0, b = c ? c(n) : !0;
|
|
16
|
+
return !!((Array.isArray(o) ? o.filter(Boolean).length : o) || l || U && s || e != null && e.onUpdate || C || e != null && e.onCreate || b && f || u || p);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
d as hasCrudActions
|
|
20
|
+
};
|