@ingestro/importer-react 4.4.0 → 4.5.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-3IKZH76S.js +1 -0
- package/chunk-AINUNGZU.js +1 -0
- package/chunk-CQHSLEFA.js +1 -0
- package/{chunk-Z3TOBUAQ.js → chunk-MJ4XZSRH.js} +1 -1
- package/{chunk-XENVJ4YE.js → chunk-OPYMH566.js} +1 -1
- package/{chunk-CFY6K4PV.js → chunk-R7NBOVTH.js} +34 -34
- package/index.d.ts +1 -0
- package/index.js +536 -509
- package/package.json +6 -24
- package/workers/hooks/index.js +1 -1
- package/workers/javascript/index.js +1 -1
- package/workers/mapping/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-AQ2NVI46.js +0 -1
- package/chunk-EK7ODJWE.js +0 -1
- package/chunk-ME2M2B24.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingestro/importer-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"homepage": "https://docs.ingestro.com",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
@@ -9,57 +9,39 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@babel/standalone": "7.29.1",
|
|
11
11
|
"@emotion/css": "^11.11.2",
|
|
12
|
-
"@floating-ui/react": "0.27.8",
|
|
13
|
-
"@handsontable/react-wrapper": "16.2.0",
|
|
14
|
-
"@hookform/resolvers": "^3.3.4",
|
|
15
12
|
"axios": "1.15.0",
|
|
16
13
|
"chroma-js": "^2.1.2",
|
|
17
14
|
"comlink": "^4.3.1",
|
|
18
15
|
"date-fns": "^2.28.0",
|
|
19
16
|
"detect-file-encoding-and-language": "2.4.0",
|
|
20
|
-
"downshift": "^6.1.7",
|
|
21
17
|
"eval5": "1.4.8",
|
|
22
18
|
"file-saver": "^2.0.5",
|
|
23
19
|
"gtin": "^1.0.2",
|
|
24
20
|
"handsontable": "16.2.0",
|
|
25
|
-
"i18next": "^23.5.1",
|
|
26
21
|
"is-promise": "^4.0.0",
|
|
27
22
|
"lodash": "^4.17.21",
|
|
28
|
-
"lucide-react": "0.479.0",
|
|
29
23
|
"match-sorter": "^6.4.0",
|
|
30
24
|
"moment": "^2.29.4",
|
|
31
25
|
"nanoevents": "^7.0.1",
|
|
32
26
|
"numbro": "2.4.0",
|
|
33
|
-
"nuvo-exceljs": "4.
|
|
27
|
+
"nuvo-exceljs": "4.6.0",
|
|
34
28
|
"object-hash": "^3.0.0",
|
|
35
29
|
"prism-code-editor": "5.0.1",
|
|
36
|
-
"react-device-detect": "^2.2.3",
|
|
37
|
-
"react-draggable": "^4.5.0",
|
|
38
|
-
"react-dropzone": "^14.2.3",
|
|
39
|
-
"react-hook-form": "7.54.2",
|
|
40
|
-
"react-i18next": "^13.2.2",
|
|
41
|
-
"react-modal": "3.16.3",
|
|
42
|
-
"react-responsive": "^9.0.2",
|
|
43
|
-
"react-router-dom": "^6.14.2",
|
|
44
|
-
"react-use": "^17.6.0",
|
|
45
|
-
"react-virtualized-auto-sizer": "1.0.25",
|
|
46
|
-
"react-window": "^1.8.9",
|
|
47
30
|
"rxjs": "7.8.1",
|
|
48
31
|
"simplebar": "5.3.9",
|
|
49
|
-
"simplebar-
|
|
32
|
+
"simplebar-core": "^1.3.0",
|
|
50
33
|
"url-join": "^5.0.0",
|
|
51
34
|
"yup": "^0.32.11"
|
|
52
35
|
},
|
|
53
36
|
"exports": {
|
|
54
37
|
".": {
|
|
55
|
-
"import": "./index.js"
|
|
56
|
-
"require": "./index.js"
|
|
38
|
+
"import": "./index.js"
|
|
57
39
|
},
|
|
58
40
|
"./index": {
|
|
59
|
-
"import": "./index.js"
|
|
60
|
-
"require": "./index.js"
|
|
41
|
+
"import": "./index.js"
|
|
61
42
|
}
|
|
62
43
|
},
|
|
44
|
+
"type": "module",
|
|
63
45
|
"module": "./index.js",
|
|
64
46
|
"main": "./index.js",
|
|
65
47
|
"types": "./index.d.ts"
|
package/workers/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,b as m}from"../../chunk-GEB7CZLW.js";import{g as a,h as g}from"../../chunk-
|
|
1
|
+
import{a as s,b as m}from"../../chunk-GEB7CZLW.js";import{g as a,h as g}from"../../chunk-CQHSLEFA.js";import"../../chunk-J5WOZVPO.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{d as r}from"../../chunk-4HB6YDED.js";import"../../chunk-J5WOZVPO.js";import"../../chunk-
|
|
1
|
+
import{d as r}from"../../chunk-4HB6YDED.js";import"../../chunk-J5WOZVPO.js";import"../../chunk-3IKZH76S.js";import{expose as m}from"comlink";m(r);
|
package/workers/mapping/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,b as p}from"../../chunk-MXQF4G2Q.js";import"../../chunk-
|
|
1
|
+
import{a as o,b as p}from"../../chunk-MXQF4G2Q.js";import"../../chunk-3IKZH76S.js";import{expose as t}from"comlink";var e=()=>!0;t({check:e,getOptionMappings:o,getColumnMappings:p});
|
|
@@ -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-MJ4XZSRH.js";import"../../chunk-AINUNGZU.js";import"../../chunk-CQHSLEFA.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{
|
|
1
|
+
import{c as e,d as t,e as o,f as r,g as c,h as n,i as s,k as h}from"../../chunk-R7NBOVTH.js";import"../../chunk-3IKZH76S.js";import{expose as m}from"comlink";var v=()=>!0;m({convertCsv2Sheet:e,convertExcel2Sheet:s,convertJson2Sheet:o,convertXLS2Sheet:r,convertXML2Sheet:c,jsonParser:t,parseDateFormat:h,convertPdf2Sheets:n,check:v});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o}from"../../chunk-
|
|
1
|
+
import{e as o}from"../../chunk-OPYMH566.js";import"../../chunk-AINUNGZU.js";import"../../chunk-CQHSLEFA.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-AQ2NVI46.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a}from"./chunk-ME2M2B24.js";var n=class s extends a{constructor({description:t,key:o,example:e,label:l,type:p,options:r,validators:u,alternativeMatches:h,columnSize:g,isMultiSelection:d,allowCustomOptions:m,creator:M,baseKey:c,baseKeyCounter:C,hidden:y,optionMappingConfiguration:b,...O}){super({description:t,key:o,example:e,label:l,type:p,validators:u,alternativeMatches:h,columnSize:g,creator:M,baseKey:c,baseKeyCounter:C,hidden:y,optionMappingConfiguration:b,...O});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 o=this.options[t];this.optionTypeMap.set(o.value,o.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(e=>e.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()},o=this.getOptions();return{...t,options:o,isMultiSelection:this.isMultiSelection,allowCustomOptions:this.allowCustomOptions}};this.getIsMultiSelection=()=>this.isMultiSelection;this.getAllowCustomOptions=()=>this.allowCustomOptions;this.options=r?.map(i=>({...i,baseKey:i?.baseKey||i.value,baseKeyCounter:i.baseKeyCounter||0,alternativeMatches:i.alternativeMatches.filter(v=>v!==i.label),validations:i.validations||[]})),this.isMultiSelection=d,this.allowCustomOptions=m||!1}clone(){let t=this.serialize();return new s({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,hidden:t.hidden,disabled:t.disabled,optionMappingConfiguration:t.optionMappingConfiguration})}},T=n;export{T as a};
|
package/chunk-EK7ODJWE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var l=(b,a,c,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&f(b,d,{get:()=>a[d],enumerable:!(e=h(a,d))||e.enumerable});return b};var n=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?f(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b};
|
package/chunk-ME2M2B24.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-J5WOZVPO.js";import{isNil as ie,escapeRegExp as rt,isString as it}from"lodash";import fe from"numbro";import{isNil as ge}from"lodash";var u=class r{static{this.currencySymbol={eu:"\u20AC",us:"$"}}static{this.percentageSymbol="%"}static{this.maxSafeNumberLength=17}static convertToFormat(e,t){if(e==null||e===""||typeof e=="string"&&e.trim()==="")return"";let i="";if(typeof e=="string"){let m=this.convertStringToNumber(e,{targetFormat:t?.targetFormat});if(m===null)return e;i=m}else if(typeof e=="number"){let m=e;t?.adornment==="percentage"&&(m=e*100,m=Number(m.toFixed(10))),i=m.toString()}else throw new Error(`[convertToFormat] unsupported type of the "value" - ${typeof e}`);let[n,o]=i.split("."),a=t?.decimalDigits||o?.length||0,l="";try{l=fe(i).format({thousandSeparated:!0,mantissa:a})}catch{return i}if(t?.targetFormat==="eu"){let m=l.replace(/,/g,"$").replace(/\./g,",").replace(/\$/g,".");return this.appendAdornment(m,t)}return this.appendAdornment(l,t)}static detectNumberFormat(e,t){let i=[];for(let l=0;l<e.length;l++)(e[l]===","||e[l]===".")&&i.push(e[l]);if(i.length===0)return;let n=e.replace(/([+\-EUR€SD$%\s])/g,"");if(i.length===1){let[l,m]=n.split(i[0]);return l.length>3?i[0]===","?"eu":"us":l.replace(/0/g,"")===""?i[0]===","?"eu":"us":m.length===3?t?.targetFormat?t?.targetFormat:t?.resolveUncertainty===!1?void 0:i[0]===","?"us":"eu":i[0]===","?"eu":"us"}let o=/^([1-9]\d{0,2})(\.\d{3})*(,\d+)?$/,a=/^([1-9]\d{0,2})(,\d{3})*(\.\d+)?$/;return o.test(n)?"eu":a.test(n)?"us":null}static convertToUsWithDecimal(e,t){let i=e,n=r.getDelimiters(e),o=e.replace(/([+\-EUR€SD$%\s])/g,"");if(n.length===1){let[a,l]=o.split(n[0]);if(l.length===3)return t==="us"?i=`${e}`?.replace(/,/g,""):i=`${e}`?.replace(/\./g,"$")?.replace(/,/,".").replace(/\$/g,""),i}return this.replaceDelimiter(e)}static{this.convertStringToNumber=(e,t)=>{if(typeof e=="number")return`${e}`;if(typeof e!="string")return null;let i=e.trim().replace(/([EUR€SD$%\s])/g,"");if(i==="")return e;let n=t?.format||this.detectNumberFormat(i,{targetFormat:t?.targetFormat}),o="";if(n===null||(n==="us"?o=i.replace(/,/g,""):o=i.replace(/\./g,"$").replace(/,/,".").replace(/\$/g,""),o.length>r.maxSafeNumberLength&&(o=o.slice(0,r.maxSafeNumberLength),o.at(-1)==="."&&(o=o.slice(0,r.maxSafeNumberLength-1))),isNaN(Number(o))))return null;if(t?.adornment==="percentage"&&e.includes("%")){let a=Number(o)/100;o=Number(a.toFixed(10)).toString()}return o}}static hasDecimalPart(e,t){if(typeof e=="number")return e%1!==0;let i=e.trim(),n=t||this.detectNumberFormat(i);return n===null?!1:n==="us"?e.includes("."):e.includes(",")}static appendAdornment(e,t){return t?.adornment==="currency"?t.symbol==="us"?`${this.currencySymbol.us}${e}`:`${e} ${this.currencySymbol[t.symbol??"eu"]}`:t?.adornment==="percentage"?`${e} ${this.percentageSymbol}`:e}static getDelimiters(e){let t=[];for(let i=0;i<e.length;i++)(e[i]===","||e[i]===".")&&t.push(e[i]);return t}static replaceDelimiter(e){let t=e,i=r.detectNumberFormat(`${e}`);return ge(i)?null:(i==="eu"?t=`${e}`?.replace(/\./g,"$")?.replace(/,/,".").replace(/\$/g,""):t=`${e}`?.replace(/,/g,""),t)}};var D=()=>d.getInstance().getTruthyWords(),I=()=>d.getInstance().getFalsyWords(),gt=()=>d.getInstance().getBooleanOptionToRender(),Et=[...D(),...I()];import{isArray as Ee,isNil as ye,isObject as be}from"lodash";var N=class{constructor(){this.parse=(e,t)=>ye(e)||Ee(e)||be(e)?null:D().includes(`${e}`.toLowerCase())?!0:I().includes(`${e}`.toLowerCase())?!1:e===""?null:`${e}`}},w=N;import{isArray as $,isBoolean as Y,isNil as K,isObject as W}from"lodash";var O=class{constructor(){this.parseSingle=(e,t)=>K(e)||W(e)||$(e)?null:Y(e)?JSON.stringify(e):y({value:e,dataModel:t.dataModel,isTrim:!0});this.parseMultiple=(e,t)=>$(e)?e.map(i=>y({value:i,dataModel:t.dataModel,isTrim:!0})):K(e)||W(e)||e===""?null:Y(e)?[JSON.stringify(e)]:[y({value:e,dataModel:t.dataModel,isTrim:!0})];this.parse=(e,t)=>t.dataModel.getIsMultiSelection()&&!t.forceSingle?this.parseMultiple(e,t):this.parseSingle(e,t)}},B=O;import{isArray as _e,isBoolean as Me,isNil as he,isObject as Te}from"lodash";var R=class{constructor(){this.parse=(e,t)=>he(e)||_e(e)||Te(e)?null:Me(e)?JSON.stringify(e):e===""?null:s(`${e}`)}},G=R;import{isArray as De,isBoolean as Ie,isNil as Ne,isObject as Oe}from"lodash";var A=class{constructor(){this.parse=(e,t)=>Ne(e)?null:Ie(e)?e?"1":"0":Oe(e)||De(e)||e===""||s(e)===null?null:this.valueParser(e,t)}},b=A;var C=class extends b{constructor(){super(...arguments);this.valueParser=(t,i)=>{let n=u.convertStringToNumber(t,{format:i?.numberFormat});return n===null?s(`${t}`):Number(n)}}},k=C;var S=class extends b{constructor(){super(...arguments);this.valueParser=(t,i)=>{let n=u.convertStringToNumber(t,{format:i?.numberFormat});return n===null?s(`${t}`):Number(n)}}},q=S;import{isArray as Re,isBoolean as Ae,isNil as Ce,isNumber as Se,isObject as Ue}from"lodash";var U=class{constructor(){this.parse=(e,t)=>{if(Ce(e)||Ue(e)||Re(e))return null;if(Ae(e))return JSON.stringify(e);if(Se(e))return e;if(e===""||s(e)===null)return null;let i=u.convertStringToNumber(e,{adornment:"percentage"});return i===null?s(`${e}`):Number(i)}}},Q=U;import{isArray as Pe,isBoolean as Ve,isNil as xe,isObject as Fe}from"lodash";var P=class{constructor(){this.parse=(e,t)=>{if(xe(e)||Pe(e)||Fe(e))return null;if(Ve(e))return JSON.stringify(e);if(e===""||s(e)===null)return null;let i=u.convertStringToNumber(e,{format:t?.numberFormat});return i===null?s(`${e}`):Number(i)}}},Z=P;import{parse as j,format as X,isMatch as He}from"date-fns";import p from"moment";var f="dd.MM.yyyy HH:mm:ss:SSS";var z="DD.MM.YYYY HH:mm:ss:SSS",J="DD.MM.YYYY HH:mm:ss:SSSZ";var _={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"},v={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 X(j(r,f,new Date),"dd.MM.yyyy")}catch{return r}},Le=(r,e,t,i)=>{try{if(typeof r=="string"){if(i===!1||isNaN(Date.parse(r))&&!$e(r))return r;let n=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"],o;for(let a=0;a<n.length;++a)if(He(r,n[a])){o=n[a];break}if(o)return X(j(r,o,new Date),e||f);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"],ee=(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=p(r,we,!0).isValid()?p(r):p(r,e),n=i.isValid(),o=p(r,e,!0).isValid()&&!t;return r===""&&(n=!0,o=!0),n&&!o?i.format(e):r},Xt=(r,e)=>{let t=()=>p.parseZone(r).format(e);try{if(typeof r=="string"){if(p(r,e,!0).isValid())return e.includes("Z")?t():p.utc(r,e).format(e);if(p(r).isValid())return e.includes("Z")?t():p.utc(r).format(e);throw new Error("not found format")}else throw new Error("not date string")}catch{return r}},vt=(r,e)=>{switch(e){case"date_dmy":case"date_mdy":case"date_iso":case"datetime":return Le(r,_[e],[_[e]]);default:return r}},$e=r=>{let[e,t,i]=r?.split(" ")?.[0]?.split(/[./-]/);return!!(Number(i)&&Number(t)<=12&&Number(e)<=31)};import{parse as Ye,format as Ke}from"date-fns";import{isArray as We,isBoolean as Be,isNil as Ge,isObject as ke}from"lodash";import h from"moment";var qe=/([+-](?:0\d|1[0-4]):?[0-5]\d|Z)$/i,V=class{constructor(){this.parse=(e,t)=>{if(Ge(e)||We(e)||ke(e))return null;if(Be(e))return JSON.stringify(e);let i=t?.dataModel?.getType();if(!i)return s(`${e}`);if(typeof e=="string"){if(e==="")return null;try{if(t?.dataModel?.getType()==="date"){let n=t?.dataModel?.getOutputFormat(),o=e.match(qe),l=!!(o?o[0]:"");if((l?h.parseZone(e,n,!0):h(e,n,!0)).isValid())return e;let c=l?h.parseZone(e,J):h(e,z);if(c.isValid())return c.format(n);throw new Error("invalid date")}else{let n=_[i];if(!n)return s(`${e}`);let o=Ye(e,f,new Date);return Ke(o,n)}}catch{let o=v[i];return o?s(ee(e,o)):s(`${e}`)}}else return s(`${e}`)}}},te=V;import{isArray as Qe}from"lodash";var x=class{constructor({validation:e,regex:t,fields:i,errorMessage:n}){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=n}},ur=x;var T=class r{constructor({description:e,key:t,example:i,label:n,type:o,validators:a,mappingValidation:l,alternativeMatches:m,columnSize:c,creator:oe,baseKey:se,baseKeyCounter:ae,outputFormat:le,numberFormat:ue,hidden:me,disabled:pe,optionMappingConfiguration:de,columnWidth:ce}){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:n})=>{this.baseKey=t,this.key=e,this.baseKeyCounter=i,this.creator=n};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=n,this.type=o,this.validators=a??[],this.mappingValidation=l,this.alternativeMatches=m?[...m.filter(g=>g!==n&&g!==t)?.map(g=>g?.toString())]:[],this.columnSize=c,this.creator=oe,this.baseKey=se||t,this.baseKeyCounter=ae||0,this.outputFormat=le||"",this.numberFormat=ue||"eu",this.hidden=me??!1,this.disabled=pe??!1,this.optionMappingConfiguration=de,this.columnWidth=ce}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"}};var Ze=new k,ze=new q,Je=new Z,je=new Q,Xe=new w,ve=new B,et=new G,tt=new te,H=class{static{this.parse=(e,t)=>{let i;switch(t?.dataModel?.getType()){case"int":i=Ze;break;case"float":i=ze;break;case"boolean":i=Xe;break;case"single-select":case"currency_code":case"country_code_alpha_2":case"country_code_alpha_3":i=ve;break;case"percentage":i=je;break;case"currency_eur":case"currency_usd":i=Je;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 o=d.getInstance().getOptionsForReviewEntries().find(a=>`${a.value}`.includes(`${e}`));o&&(i=`${o.label}`)}else if(T.isTypeCategory(t.type))if(t.isMultiSelection){if(Qe(e)){let n=t.options?.filter(o=>e.some(a=>F(o,a)));n&&(i=n.map(o=>o.label).join(", "))}}else{let n=t.options?.find(o=>F(o,e));n&&(i=`${n?.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 n=u.convertStringToNumber(i,{format:"us"});return n!==null?Number(n):e}else return e}}},re=H;var Yr=r=>Number(r).toLocaleString("de-DE"),Kr=(r,e)=>{let{value:t,isExact:i,columns:n}=e,o=re.parseRawValueToDisplayValue(r,n[0]);return i&&!ie(r)&&o===t?!0:!!(!i&&!ie(r)&&o?.toLowerCase()?.includes(t?.toLowerCase()))},Wr=(r,e,t)=>{let i=new RegExp(rt(e),"gi");return`${r}`.replace(i,t)},Br=r=>typeof r=="string"?r.replace(/(\r\n|\n|\r)/gm,""):r,Gr=(r,e)=>e?e.map((t,i)=>r.map(n=>({rowIndex:i,valid:!0,key:n.key,value:t[n.key]}))):[],s=r=>{if(it(r)){let e=r.trimEnd();return e===""?null:e}return r};var ne=r=>r.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=r=>r?.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{isInteger as nt,isNumber as ot}from"lodash";var Xr=(r,e,t)=>{for(let i=0;i<r.length;i++){let n=r[i].getKey(),o=e;if(t&&(n=L(n),o=L(o)),n===o)return r[i]}return null},vr=(r,e)=>{for(let t=0;t<e.length;t++)if(e[t].getKey()===r)return t;return-1},F=(r,e)=>`${r.value}`==`${e}`,st=(r,e)=>{let t=0;for(let i=0;i<e.length;i++){let n=e[i],o="baseKeyCounter";n?.[o]&&r===n?.["baseKey"]&&t<(n?.[o]??0)&&(t=n?.[o]||0)}return t},at=(r,e)=>!r.some(t=>t.baseKey===e),ei=(r,e,t=!0)=>{let i=t?ne(r):r,n=st(i,e)+1,o=i;return at(e,i)?n--:n>0&&(o=`${i}_${n}`),{key:{value:o,baseKey:i,baseKeyCounter:n}}},y=({value:r,dataModel:e,isTrim:t})=>{let i=e.getOptionTypeMap(),n=r!==void 0?i.get(r):void 0;if(!n&&typeof r=="number"&&(n=i.get(String(r))),!n&&typeof r=="string"){let o=Number(r);isNaN(o)||(n=i.get(o))}if(n=n??"string",r===""&&i.has(r))return r;if(n==="int"){let o=Number(r);return!isNaN(o)&&nt(o)?o:t?s(`${r}`):`${r}`}else if(n==="float"){if(ot(r))return r;let o=`${r}`.replace(/,/,"."),a=u.convertStringToNumber(`${o}`,{format:"us"});return a===null?t?s(`${r}`):`${r}`:Number(a)}else return t?s(`${r}`):`${r}`};export{u as a,D as b,I as c,gt as d,Et as e,L as f,Xr as g,vr as h,F as i,ei as j,y as k,v as l,jt as m,ee as n,Xt as o,vt as p,ur as q,T as r,re as s,Yr as t,Kr as u,Wr as v,Br as w,Gr as x,s as y};
|