@ingestro/importer-react 4.6.1 → 4.7.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/{chunk-DTAX554T.js → chunk-5QL3SKPX.js} +34 -34
- package/{chunk-G6K4577L.js → chunk-6PSIXCPC.js} +1 -1
- package/chunk-DILA2NVE.js +1 -0
- package/chunk-EOOYBY4D.js +1 -0
- package/{chunk-UUTDHNU4.js → chunk-WBRCEI6U.js} +1 -1
- package/index.d.ts +31 -2
- package/index.js +375 -375
- package/package.json +1 -1
- package/workers/hooks/index.js +1 -1
- package/workers/matchValues/index.js +1 -1
- package/workers/parseData/index.js +1 -1
- package/workers/searchAndReplace/index.js +1 -1
- package/chunk-LXX3YWEI.js +0 -1
- package/chunk-ZD4M7W75.js +0 -1
package/package.json
CHANGED
package/workers/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,b as m}from"../../chunk-GEB7CZLW.js";import{d as a,e as g}from"../../chunk-
|
|
1
|
+
import{a as s,b as m}from"../../chunk-GEB7CZLW.js";import{d as a,e as g}from"../../chunk-DILA2NVE.js";import"../../chunk-3IKZH76S.js";import{isEmpty as p,isNil as v,isUndefined as R}from"lodash";import{expose as h}from"comlink";var I=(n,t,o,f,r)=>{p(n)||Object.keys(n).forEach(e=>{let l=a(r,e);R(n[e].value)||(f[t][e]=n[e].value);let d=g(e,r.filter(i=>!i.isHidden()));v(n[e].info)||d<0||n[e].info?.forEach(i=>{if(!l?.isDisabled()&&i.level===m)return;let c={rowIndex:t,colIndex:d,popover:{message:i.message,level:i.level||s}};(o[t]?.length??0)===0?o[t]=[c]:o[t].push(c)})})},E=async({initResults:n,dataInfos:t,initialValues:o},f)=>{for(let r=0;r<n.length;r++)I(n[r][0],n[r][1],t,o,f);return{dataInfos:t,initialValues:o}},b=async({initialValues:n,key:t,result:o,colIndex:f})=>{let r={};for(let e=0;e<o.length;e++)if(R(o[e][0].value)||n[o[e][1]]&&(n[o[e][1]][t]=o[e][0].value),o?.[e]?.[0]?.info&&f>=0){let l=o?.[e]?.[0]?.info??[],d={message:o?.[e]?.[0]?.info?.[0]?.message??"",level:o?.[e]?.[0]?.info?.[0]?.level??s};for(let c=0;c<l?.length;c++)if(l[c].level!==m){d={message:o?.[e]?.[0]?.info?.[c]?.message??"",level:o?.[e]?.[0]?.info?.[c]?.level??s};break}let i={rowIndex:o[e][1],colIndex:f,popover:d};i.popover.level!==m&&n[o[e][1]]&&((r[o[e][1]]?.length??0)===0?r[o[e][1]]=[i]:r[o[e][1]].push(i))}return{dataInfos:r,initialValues:n}},x=async({dataInfos:n,columnDataInfos:t})=>{let o=Object.keys(t);for(let f=0;f<o.length;f++){let r=o[f];t?.[r]?.length>0&&(n[r]||(n[r]=[]),n[r].push(...t[r]))}return{dataInfos:n}},D=()=>!0;h({check:D,handleOnEntryInit:E,handleColumnHooks:b,integrateColumnHooksData:x});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,f as t,g as m,h as n,i,j as r}from"../../chunk-
|
|
1
|
+
import{e as o,f as t,g as m,h as n,i,j as r}from"../../chunk-6PSIXCPC.js";import"../../chunk-EOOYBY4D.js";import"../../chunk-DILA2NVE.js";import"../../chunk-J5WOZVPO.js";import"../../chunk-3IKZH76S.js";import{expose as e}from"comlink";var p=()=>!0;e({check:p,getValues:r,addToAllRows:o,joinWithoutColumns:t,joinOnColumns:m,appendToColumns:n,countMatching:i});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as t,e as r,f as o,g as c,h as n,i as s,j as h,l as m}from"../../chunk-
|
|
1
|
+
import{c as e,d as t,e as r,f as o,g as c,h as n,i as s,j as h,l as m}from"../../chunk-5QL3SKPX.js";import"../../chunk-3IKZH76S.js";import{expose as v}from"comlink";var S=()=>!0;v({convertCsv2Sheet:e,convertExcel2Sheet:s,convertJson2Sheet:r,convertXLS2Sheet:o,convertXML2Sheet:c,jsonParser:t,parseDateFormat:m,convertPdf2Sheets:n,convertNumbers2Sheet:h,check:S});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o}from"../../chunk-
|
|
1
|
+
import{e as o}from"../../chunk-WBRCEI6U.js";import"../../chunk-EOOYBY4D.js";import"../../chunk-DILA2NVE.js";import"../../chunk-J5WOZVPO.js";import"../../chunk-3IKZH76S.js";import*as e from"comlink";var m=()=>!0;e.expose({check:m,getCountBySearchValue:o});
|
package/chunk-LXX3YWEI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as u,c as l,f as A,h as b}from"./chunk-ZD4M7W75.js";import{a as E}from"./chunk-J5WOZVPO.js";var P=class{constructor({validation:e,regex:t,fields:i,errorMessage:o}){this.getValidation=()=>this.validation;this.getRegex=()=>this.regex;this.getFields=()=>this.fields;this.getErrorMessage=()=>this.errorMessage;this.serialize=()=>({validation:this.getValidation(),fields:this.getFields(),regex:this.getRegex(),errorMessage:this.getErrorMessage()});this.validation=e,this.regex=t,this.fields=i??[],this.errorMessage=o}},st=P;var M=class r{constructor({description:e,key:t,example:i,label:o,type:s,validators:n,mappingValidation:c,alternativeMatches:d,columnSize:a,creator:p,baseKey:m,baseKeyCounter:D,outputFormat:T,numberFormat:I,hidden:S,disabled:N,optionMappingConfiguration:U,columnWidth:V}){this.getDescription=()=>this.description;this.getKey=()=>this.key;this.getExample=()=>this.example;this.getLabel=()=>this.label;this.setLabel=e=>{this.label=e};this.getType=()=>this.type;this.getOutputFormat=()=>r.getOutputFormat(this.outputFormat);this.getValidators=()=>this.validators;this.getColumnSize=()=>this.columnSize;this.getColumnWidth=()=>this.columnWidth;this.getIsRequired=()=>!!this.validators.find(t=>t.getValidation()==="REQUIRED");this.getIsUnique=()=>!!this.validators.find(t=>t.getValidation()==="UNIQUE");this.getIsUniqueAndRequired=()=>this.getIsRequired()===!0&&this.getIsUnique()===!0;this.hasMappingValidation=()=>!!(this.mappingValidation&&this.mappingValidation.logic&&this.mappingValidation.logic.trim().length>0);this.getMappingValidation=()=>this.mappingValidation||void 0;this.getAlternativeMatches=()=>this.alternativeMatches.filter(e=>!!e);this.getCreator=()=>this.creator;this.getBaseKey=()=>this.baseKey;this.getBaseKeyCounter=()=>this.baseKeyCounter;this.setCustomKey=({key:e,baseKey:t,baseKeyCounter:i,creator:o})=>{this.baseKey=t,this.key=e,this.baseKeyCounter=i,this.creator=o};this.isDropdown=()=>r.isTypeDropdown(this.getType());this.isCategoryType=()=>r.isTypeCategory(this.getType());this.isBooleanType=()=>this.type==="boolean";this.serialize=()=>({description:this.getDescription(),example:this.getExample(),key:this.getKey(),label:this.getLabel(),type:this.getType(),validators:[],alternativeMatches:this.getAlternativeMatches(),columnSize:this.getColumnSize(),columnWidth:this.getColumnWidth(),outputFormat:this.getOutputFormat(),isMultiSelection:this.getIsMultiSelection(),numberFormat:this.getNumberFormat(),baseKey:this.getBaseKey(),baseKeyCounter:this.getBaseKeyCounter(),creator:this.getCreator(),hidden:this.isHidden(),disabled:this.isDisabled(),optionMappingConfiguration:this.getOptionMappingConfiguration()});this.getIsMultiSelection=()=>!1;this.getNumberFormat=()=>this.numberFormat;this.isDisabled=()=>this.disabled;this.isNumeric=()=>this.type==="int"||this.type==="float"||this.type==="currency_eur"||this.type==="currency_usd"||this.type==="percentage";this.isCurrency=()=>this.type==="currency_eur"||this.type==="currency_usd";this.baseClone=()=>{let e=this.serialize();return new r({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,validators:this.getValidators(),alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,columnWidth:e.columnWidth,baseKey:e.baseKey,baseKeyCounter:e.baseKeyCounter,creator:e.creator,numberFormat:e.numberFormat,outputFormat:e.outputFormat,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration})};this.isHidden=()=>this.hidden;this.getOptionMappingConfiguration=()=>this.optionMappingConfiguration;this.description=e,this.key=t,this.example=i,this.label=o,this.type=s,this.validators=n??[],this.mappingValidation=c,this.alternativeMatches=d?[...d.filter(y=>y!==o&&y!==t)?.map(y=>y?.toString())]:[],this.columnSize=a,this.creator=p,this.baseKey=m||t,this.baseKeyCounter=D||0,this.outputFormat=T||"",this.numberFormat=I||"eu",this.hidden=S??!1,this.disabled=N??!1,this.optionMappingConfiguration=U,this.columnWidth=V}static{this.getOutputFormat=e=>(e||"DD.MM.YYYY").replace(/d/g,"D").replace(/e|E/g,"")}static{this.isTypeDropdown=e=>r.isTypeCategory(e)||e==="boolean"}static{this.isTypeCategory=e=>e==="single-select"||e==="currency_code"||e==="country_code_alpha_2"||e==="country_code_alpha_3"}};import{isNil as v,escapeRegExp as rt,isArray as it}from"lodash";var H=()=>E.getInstance().getTruthyWords(),x=()=>E.getInstance().getFalsyWords(),ft=()=>E.getInstance().getBooleanOptionToRender(),yt=[...H(),...x()];import{isArray as ye,isNil as Ee,isObject as Me}from"lodash";var L=class{constructor(){this.parse=(e,t)=>Ee(e)||ye(e)||Me(e)?null:H().includes(`${e}`.toLowerCase())?!0:x().includes(`${e}`.toLowerCase())?!1:e===""?null:`${e}`}},Z=L;import{isArray as q,isBoolean as J,isNil as j,isObject as X}from"lodash";var F=class{constructor(){this.parseSingle=(e,t)=>j(e)||X(e)||q(e)?null:J(e)?JSON.stringify(e):b({value:e,dataModel:t.dataModel,isTrim:!0});this.parseMultiple=(e,t)=>q(e)?e.map(i=>b({value:i,dataModel:t.dataModel,isTrim:!0})):j(e)||X(e)||e===""?null:J(e)?[JSON.stringify(e)]:[b({value:e,dataModel:t.dataModel,isTrim:!0})];this.parse=(e,t)=>t.dataModel.getIsMultiSelection()&&!t.forceSingle?this.parseMultiple(e,t):this.parseSingle(e,t)}},ee=F;import{isArray as he,isBoolean as Te,isNil as be,isObject as _e}from"lodash";var w=class{constructor(){this.parse=(e,t)=>be(e)||he(e)||_e(e)?null:Te(e)?JSON.stringify(e):e===""?null:l(`${e}`)}},te=w;import{isArray as Ce,isBoolean as Oe,isNil as Re,isObject as De}from"lodash";var Y=class{constructor(){this.parse=(e,t)=>Re(e)?null:Oe(e)?e?"1":"0":De(e)||Ce(e)||e===""||l(e)===null?null:this.valueParser(e,t)}},C=Y;var W=class extends C{constructor(){super(...arguments);this.valueParser=(t,i)=>{let o=u.convertStringToNumber(t,{format:i?.numberFormat});return o===null?l(`${t}`):Number(o)}}},re=W;var B=class extends C{constructor(){super(...arguments);this.valueParser=(t,i)=>{let o=u.convertStringToNumber(t,{format:i?.numberFormat});return o===null?l(`${t}`):Number(o)}}},ie=B;import{isArray as Ie,isBoolean as Se,isNil as Ne,isNumber as Ue,isObject as Ve}from"lodash";var $=class{constructor(){this.parse=(e,t)=>{if(Ne(e)||Ve(e)||Ie(e))return null;if(Se(e))return JSON.stringify(e);if(Ue(e))return e;if(e===""||l(e)===null)return null;let i=u.convertStringToNumber(e,{adornment:"percentage"});return i===null?l(`${e}`):Number(i)}}},oe=$;import{isArray as Ae,isBoolean as Pe,isNil as He,isObject as xe}from"lodash";var K=class{constructor(){this.parse=(e,t)=>{if(He(e)||Ae(e)||xe(e))return null;if(Pe(e))return JSON.stringify(e);if(e===""||l(e)===null)return null;let i=u.convertStringToNumber(e,{format:t?.numberFormat});return i===null?l(`${e}`):Number(i)}}},se=K;import{parse as le,format as pe,isMatch as Le}from"date-fns";import g from"moment";var h="dd.MM.yyyy HH:mm:ss:SSS";var ne="DD.MM.YYYY HH:mm:ss:SSS",ae="DD.MM.YYYY HH:mm:ss:SSSZ";var O={date_dmy:"dd.MM.yyyy",date_mdy:"MM.dd.yyyy",date_iso:"yyyy-MM-dd",datetime:"yyyy-MM-dd HH:mm:ss",time_hm:"hh:mm aaa",time_hms:"hh:mm:ss aaa",time_hm_24:"HH:mm",time_hms_24:"HH:mm:ss"},ue={time_hm:"hh:mm a",time_hms:"hh:mm:ss a",time_hm_24:"HH:mm",time_hms_24:"HH:mm:ss"},Jt=r=>{try{return pe(le(r,h,new Date),"dd.MM.yyyy")}catch{return r}},Fe=(r,e,t,i)=>{try{if(typeof r=="string"){if(i===!1||isNaN(Date.parse(r))&&!Ye(r))return r;let o=t||["dd.MM.yyyy HH:mm:ss","dd.MM.yyyy HH:mm","dd.MM.yyyy","dd/MM/yyyy HH:mm:ss","dd/MM/yyyy HH:mm","dd/MM/yyyy","dd-MM-yyyy HH:mm:ss","dd-MM-yyyy HH:mm","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd","yyyy-MM-dd HH:mm:ss","dd-MM-yyyy"],s;for(let n=0;n<o.length;++n)if(Le(r,o[n])){s=o[n];break}if(s)return pe(le(r,s,new Date),e||h);throw new Error("not found format")}else throw new Error("not date string")}catch{return r}},we=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],me=(r,e)=>{r===null&&(r=""),r=/^\d{3,}$/.test(r)?parseInt(r,10):r;let t=/^\d{1,2}$/.test(r);t&&(r+=":00");let i=g(r,we,!0).isValid()?g(r):g(r,e),o=i.isValid(),s=g(r,e,!0).isValid()&&!t;return r===""&&(o=!0,s=!0),o&&!s?i.format(e):r},jt=(r,e)=>{let t=()=>g.parseZone(r).format(e);try{if(typeof r=="string"){if(g(r,e,!0).isValid())return e.includes("Z")?t():g.utc(r,e).format(e);if(g(r).isValid())return e.includes("Z")?t():g.utc(r).format(e);throw new Error("not found format")}else throw new Error("not date string")}catch{return r}},Xt=(r,e)=>{switch(e){case"date_dmy":case"date_mdy":case"date_iso":case"datetime":return Fe(r,O[e],[O[e]]);default:return r}},Ye=r=>{let[e,t,i]=r?.split(" ")?.[0]?.split(/[./-]/);return!!(Number(i)&&Number(t)<=12&&Number(e)<=31)};import{parse as We,format as Be}from"date-fns";import{isArray as $e,isBoolean as Ke,isNil as ke,isObject as Ge}from"lodash";import R from"moment";var ve=/([+-](?:0\d|1[0-4]):?[0-5]\d|Z)$/i,k=class{constructor(){this.parse=(e,t)=>{if(ke(e)||$e(e)||Ge(e))return null;if(Ke(e))return JSON.stringify(e);let i=t?.dataModel?.getType();if(!i)return l(`${e}`);if(typeof e=="string"){if(e==="")return null;try{if(t?.dataModel?.getType()==="date"){let o=t?.dataModel?.getOutputFormat(),s=e.match(ve),c=!!(s?s[0]:"");if((c?R.parseZone(e,o,!0):R(e,o,!0)).isValid())return e;let a=c?R.parseZone(e,ae):R(e,ne);if(a.isValid())return a.format(o);throw new Error("invalid date")}else{let o=O[i];if(!o)return l(`${e}`);let s=We(e,h,new Date);return Be(s,o)}}catch{let s=ue[i];return s?l(me(e,s)):l(`${e}`)}}else return l(`${e}`)}}},de=k;import{isArray as ze}from"lodash";var Qe=new re,Ze=new ie,qe=new se,Je=new oe,je=new Z,Xe=new ee,et=new te,tt=new de,G=class{static{this.parse=(e,t)=>{let i;switch(t?.dataModel?.getType()){case"int":i=Qe;break;case"float":i=Ze;break;case"boolean":i=je;break;case"single-select":case"currency_code":case"country_code_alpha_2":case"country_code_alpha_3":i=Xe;break;case"percentage":i=Je;break;case"currency_eur":case"currency_usd":i=qe;break;case"date":case"date_dmy":case"date_mdy":case"date_iso":case"datetime":case"time_hms":case"time_hms_24":case"time_hm":case"time_hm_24":i=tt;break;case"email":case"url_www":case"url_https":case"url":case"phone":case"zip_code_de":case"bic":case"vat_eu":case"gtin":case"iban":default:i=et;break}return i.parse(e,t)}}static{this.parseRawValueToDisplayValue=(e,t)=>{let i=e;if(t.isNumeric)i=u.convertToFormat(e,{targetFormat:t.numberFormat||"eu",adornment:t.type==="percentage"?"percentage":void 0}),["currency_eur","currency_usd"].includes(t.type)&&(t.type==="currency_usd"?i=`$${i}`:i=`${i} \u20AC`);else if(t.type==="boolean"){let s=E.getInstance().getOptionsForReviewEntries().find(n=>`${n.value}`.includes(`${e}`));s&&(i=`${s.label}`)}else if(M.isTypeCategory(t.type))if(t.isMultiSelection){if(ze(e)){let o=t.options?.filter(s=>e.some(n=>A(s,n)));o&&(i=o.map(s=>s.label).join(", "))}}else{let o=t.options?.find(s=>A(s,e));o&&(i=`${o?.label}`)}return`${i}`}}static{this.parseDisplayValueToRawValue=(e,t)=>{if(t.isNumeric){let i=u.convertToUsWithDecimal(`${e}`,t.numberFormat??"eu");if(i===null)return e;let o=u.convertStringToNumber(i,{format:"us"});return o!==null?Number(o):e}else return e}}},ce=G;var Vr=r=>Number(r).toLocaleString("de-DE"),Ar=(r,e)=>{let{value:t,isExact:i,columns:o,isEmptyValues:s}=e;if(s)return v(r)||r==="";if(it(r)&&o[0]?.isMultiSelection){let c=o[0],d=r.map(a=>{let p=c.options?.find(m=>`${m.value}`==`${a}`);return p?p.label:`${a}`}).join(", ");return i?d===t:d.toLowerCase().includes(t.toLowerCase())}let n=ce.parseRawValueToDisplayValue(r,o[0]);return i&&!v(r)&&n===t?!0:!!(!i&&!v(r)&&n?.toLowerCase()?.includes(t?.toLowerCase()))},Pr=(r,e,t,i)=>{let o=r.map(a=>{let p=i.options?.find(m=>`${m.value}`==`${a}`);return p?p.label:`${a}`}),s=e.split(",").map(a=>a.trim()).filter(Boolean);if(s.length===0)return r;let n=-1;for(let a=0;a<=o.length-s.length;a++){let p=!0;for(let m=0;m<s.length;m++)if(o[a+m].toLowerCase()!==s[m].toLowerCase()){p=!1;break}if(p){n=a;break}}if(n===-1)return r;let c=[...r.slice(0,n),...t,...r.slice(n+s.length)],d=new Set;return c.filter(a=>{let p=`${a}`;return d.has(p)?!1:(d.add(p),!0)})},Hr=(r,e,t)=>{let i=new RegExp(rt(e),"gi");return`${r}`.replace(i,t)},xr=r=>typeof r=="string"?r.replace(/(\r\n|\n|\r)/gm,""):r,Lr=(r,e)=>e?e.map((t,i)=>r.map(o=>({rowIndex:i,valid:!0,key:o.key,value:t[o.key]}))):[];var z=class r extends M{constructor({description:t,key:i,example:o,label:s,type:n,options:c,validators:d,alternativeMatches:a,columnSize:p,isMultiSelection:m,allowCustomOptions:D,allowedCustomOptionTypes:T,preserveUnmappedOptions:I,creator:S,baseKey:N,baseKeyCounter:U,hidden:V,optionMappingConfiguration:y,...ge}){super({description:t,key:i,example:o,label:s,type:n,validators:d,alternativeMatches:a,columnSize:p,creator:S,baseKey:N,baseKeyCounter:U,hidden:V,optionMappingConfiguration:y,...ge});this.optionTypeMap=null;this.getOptions=()=>this.options;this.getOptionTypeMap=()=>{if(!this.optionTypeMap){this.optionTypeMap=new Map;for(let t=0;t<this.options.length;t++){let i=this.options[t];this.optionTypeMap.set(i.value,i.type??"string")}}return this.optionTypeMap};this.setOptions=t=>{this.options=t,this.optionTypeMap=null};this.serialize=()=>{let t={description:this.getDescription(),example:this.getExample(),isRequired:this.getIsRequired(),key:this.getKey(),label:this.getLabel(),type:this.getType(),validators:this.getValidators().map(o=>o.serialize()),alternativeMatches:this.getAlternativeMatches(),columnSize:this.getColumnSize(),columnWidth:this.getColumnWidth(),outputFormat:this.getOutputFormat(),numberFormat:this.getNumberFormat(),baseKey:this.getBaseKey(),baseKeyCounter:this.getBaseKeyCounter(),creator:this.getCreator(),hidden:this.isHidden(),disabled:this.isDisabled(),optionMappingConfiguration:this.getOptionMappingConfiguration()},i=this.getOptions();return{...t,options:i,isMultiSelection:this.isMultiSelection,allowCustomOptions:this.allowCustomOptions,allowedCustomOptionTypes:this.allowedCustomOptionTypes?[...this.allowedCustomOptionTypes]:void 0,preserveUnmappedOptions:this.preserveUnmappedOptions}};this.getIsMultiSelection=()=>this.isMultiSelection;this.getAllowCustomOptions=()=>this.allowCustomOptions;this.getAllowedCustomOptionTypes=()=>this.allowedCustomOptionTypes?[...this.allowedCustomOptionTypes]:void 0;this.getPreserveUnmappedOptions=()=>this.preserveUnmappedOptions;this.options=c?.map(f=>({...f,baseKey:f?.baseKey||f.value,baseKeyCounter:f.baseKeyCounter||0,alternativeMatches:f.alternativeMatches.filter(fe=>fe!==f.label),validations:f.validations||[]})),this.isMultiSelection=m,this.allowCustomOptions=D,this.allowedCustomOptionTypes=T?[...T]:void 0,this.preserveUnmappedOptions=I}clone(){let t=this.serialize();return new r({description:t.description,example:t.example,key:t.key,label:t.label,type:t.type,options:t.options,validators:this.getValidators(),alternativeMatches:t.alternativeMatches,columnSize:t.columnSize,columnWidth:t.columnWidth,isMultiSelection:t.isMultiSelection,allowCustomOptions:t.allowCustomOptions,allowedCustomOptionTypes:t.allowedCustomOptionTypes,preserveUnmappedOptions:t.preserveUnmappedOptions,hidden:t.hidden,disabled:t.disabled,optionMappingConfiguration:t.optionMappingConfiguration})}},$r=z;export{H as a,x as b,ft as c,yt as d,ue as e,Jt as f,me as g,jt as h,Xt as i,st as j,M as k,ce as l,Vr as m,Ar as n,Pr as o,Hr as p,xr as q,Lr as r,$r as s};
|
package/chunk-ZD4M7W75.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var p=n=>n.trim()?.replace(/[-!$%^&*()+|~=`{}\[\]:";'<>?,.\/]/g,"")?.replace(/^_+/,"")?.replace(/_+$/,"")?.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g,"")?.replace(/ /g,"_")?.replace(/ß/g,"ss")?.replace(/ä/g,"ae")?.replace(/ö/g,"oe")?.replace(/ü/g,"ue")?.toLowerCase(),l=n=>n?.replace(/[-!$%^&*()_+|~=`{}\\[\]:";'<>?,.\\/]/g," ")?.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g," ")?.toLowerCase();import f from"numbro";import{isNil as g}from"lodash";var d=class n{static{this.currencySymbol={eu:"\u20AC",us:"$"}}static{this.percentageSymbol="%"}static{this.maxSafeNumberLength=17}static convertToFormat(e,r){if(e==null||e===""||typeof e=="string"&&e.trim()==="")return"";let t="";if(typeof e=="string"){let s=this.convertStringToNumber(e,{targetFormat:r?.targetFormat});if(s===null)return e;t=s}else if(typeof e=="number"){let s=e;r?.adornment==="percentage"&&(s=e*100,s=Number(s.toFixed(10))),t=s.toString()}else throw new Error(`[convertToFormat] unsupported type of the "value" - ${typeof e}`);let[i,o]=t.split("."),u=r?.decimalDigits||o?.length||0,a="";try{a=f(t).format({thousandSeparated:!0,mantissa:u})}catch{return t}if(r?.targetFormat==="eu"){let s=a.replace(/,/g,"$").replace(/\./g,",").replace(/\$/g,".");return this.appendAdornment(s,r)}return this.appendAdornment(a,r)}static detectNumberFormat(e,r){let t=[];for(let a=0;a<e.length;a++)(e[a]===","||e[a]===".")&&t.push(e[a]);if(t.length===0)return;let i=e.replace(/([+\-EUR€SD$%\s])/g,"");if(t.length===1){let[a,s]=i.split(t[0]);return a.length>3?t[0]===","?"eu":"us":a.replace(/0/g,"")===""?t[0]===","?"eu":"us":s.length===3?r?.targetFormat?r?.targetFormat:r?.resolveUncertainty===!1?void 0:t[0]===","?"us":"eu":t[0]===","?"eu":"us"}let o=/^([1-9]\d{0,2})(\.\d{3})*(,\d+)?$/,u=/^([1-9]\d{0,2})(,\d{3})*(\.\d+)?$/;return o.test(i)?"eu":u.test(i)?"us":null}static convertToUsWithDecimal(e,r){let t=e,i=n.getDelimiters(e),o=e.replace(/([+\-EUR€SD$%\s])/g,"");if(i.length===1){let[u,a]=o.split(i[0]);if(a.length===3)return r==="us"?t=`${e}`?.replace(/,/g,""):t=`${e}`?.replace(/\./g,"$")?.replace(/,/,".").replace(/\$/g,""),t}return this.replaceDelimiter(e)}static{this.convertStringToNumber=(e,r)=>{if(typeof e=="number")return`${e}`;if(typeof e!="string")return null;let t=e.trim().replace(/([EUR€SD$%\s])/g,"");if(t==="")return e;let i=r?.format||this.detectNumberFormat(t,{targetFormat:r?.targetFormat}),o="";if(i===null||(i==="us"?o=t.replace(/,/g,""):o=t.replace(/\./g,"$").replace(/,/,".").replace(/\$/g,""),o.length>n.maxSafeNumberLength&&(o=o.slice(0,n.maxSafeNumberLength),o.at(-1)==="."&&(o=o.slice(0,n.maxSafeNumberLength-1))),isNaN(Number(o))))return null;if(r?.adornment==="percentage"&&e.includes("%")){let u=Number(o)/100;o=Number(u.toFixed(10)).toString()}return o}}static hasDecimalPart(e,r){if(typeof e=="number")return e%1!==0;let t=e.trim(),i=r||this.detectNumberFormat(t);return i===null?!1:i==="us"?e.includes("."):e.includes(",")}static appendAdornment(e,r){return r?.adornment==="currency"?r.symbol==="us"?`${this.currencySymbol.us}${e}`:`${e} ${this.currencySymbol[r.symbol??"eu"]}`:r?.adornment==="percentage"?`${e} ${this.percentageSymbol}`:e}static getDelimiters(e){let r=[];for(let t=0;t<e.length;t++)(e[t]===","||e[t]===".")&&r.push(e[t]);return r}static replaceDelimiter(e){let r=e,t=n.detectNumberFormat(`${e}`);return g(t)?null:(t==="eu"?r=`${e}`?.replace(/\./g,"$")?.replace(/,/,".").replace(/\$/g,""):r=`${e}`?.replace(/,/g,""),r)}};import{isInteger as b,isNumber as y,isString as _}from"lodash";var m=n=>{if(_(n)){let e=n.trimEnd();return e===""?null:e}return n},P=(n,e,r)=>{for(let t=0;t<n.length;t++){let i=n[t].getKey(),o=e;if(r&&(i=l(i),o=l(o)),i===o)return n[t]}return null},M=(n,e)=>{for(let r=0;r<e.length;r++)if(e[r].getKey()===n)return r;return-1},C=(n,e)=>`${n.value}`==`${e}`,h=(n,e)=>{let r=0;for(let t=0;t<e.length;t++){let i=e[t],o="baseKeyCounter";i?.[o]&&n===i?.["baseKey"]&&r<(i?.[o]??0)&&(r=i?.[o]||0)}return r},N=(n,e)=>!n.some(r=>r.baseKey===e),K=(n,e,r=!0)=>{let t=r?p(n):n,i=h(t,e)+1,o=t;return N(e,t)?i--:i>0&&(o=`${t}_${i}`),{key:{value:o,baseKey:t,baseKeyCounter:i}}},T=({value:n,dataModel:e,isTrim:r})=>{let t=e.getOptionTypeMap(),i=n!==void 0?t.get(n):void 0;if(!i&&typeof n=="number"&&(i=t.get(String(n))),!i&&typeof n=="string"){let o=Number(n);isNaN(o)||(i=t.get(o))}if(i=i??"string",n===""&&t.has(n))return n;if(i==="int"){let o=Number(n);return!isNaN(o)&&b(o)?o:r?m(`${n}`):`${n}`}else if(i==="float"){if(y(n))return n;let o=`${n}`.replace(/,/,"."),u=d.convertStringToNumber(`${o}`,{format:"us"});return u===null?r?m(`${n}`):`${n}`:Number(u)}else return r?m(`${n}`):`${n}`};export{d as a,l as b,m as c,P as d,M as e,C as f,K as g,T as h};
|