@ingestro/importer-react 4.6.1 → 4.8.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.
@@ -0,0 +1 @@
1
+ import{B as T,C as V,a as G,b as q,c as Z,d as J,e as j,f as ee,h as te,l as re,m as f}from"./chunk-MPSYBYIV.js";import{a as m,c as a,f as x,h as b}from"./chunk-AAZKUHPZ.js";import{a as g}from"./chunk-J5WOZVPO.js";var U=class{constructor({validation:e,regex:t,fields:i,errorMessage:o,operator:n,value:s}){this.getValidation=()=>this.validation;this.getRegex=()=>this.regex;this.getFields=()=>this.fields;this.getErrorMessage=()=>this.errorMessage;this.getOperator=()=>this.operator;this.getValue=()=>this.value;this.serialize=()=>({validation:this.getValidation(),fields:this.getFields(),regex:this.getRegex(),errorMessage:this.getErrorMessage(),operator:this.getOperator(),value:this.getValue()});this.validation=e,this.regex=t,this.fields=i??[],this.errorMessage=o,this.operator=n,this.value=s}},ht=U;var h=class r{constructor({description:e,key:t,example:i,label:o,type:n,validators:s,mappingValidation:y,alternativeMatches:c,columnSize:l,creator:p,baseKey:u,baseKeyCounter:E,outputFormat:M,inputFormat:O,numberFormat:D,hidden:S,disabled:P,optionMappingConfiguration:R,columnWidth:I,excludeFromAutoMatching:_}){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.getInputFormat=()=>this.inputFormat;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(),inputFormat:this.getInputFormat(),isMultiSelection:this.getIsMultiSelection(),numberFormat:this.getNumberFormat(),baseKey:this.getBaseKey(),baseKeyCounter:this.getBaseKeyCounter(),creator:this.getCreator(),hidden:this.isHidden(),disabled:this.isDisabled(),optionMappingConfiguration:this.getOptionMappingConfiguration(),excludeFromAutoMatching:this.isExcludedFromAutoMatching()});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,inputFormat:e.inputFormat,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration,excludeFromAutoMatching:e.excludeFromAutoMatching})};this.isHidden=()=>this.hidden;this.isExcludedFromAutoMatching=()=>this.excludeFromAutoMatching;this.getOptionMappingConfiguration=()=>this.optionMappingConfiguration;this.description=e,this.key=t,this.example=i,this.label=o,this.type=n,this.validators=s??[],this.mappingValidation=y,this.alternativeMatches=c?[...c.filter(d=>d!==o&&d!==t)?.map(d=>d?.toString())]:[],this.columnSize=l,this.creator=p,this.baseKey=u||t,this.baseKeyCounter=E||0,this.outputFormat=M||"",this.inputFormat=O??null,this.numberFormat=D||"eu",this.hidden=S??!1,this.disabled=P??!1,this.optionMappingConfiguration=R,this.columnWidth=I,this.excludeFromAutoMatching=_??!1}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 z,escapeRegExp as Mt,isArray as gt}from"lodash";var N=()=>g.getInstance().getTruthyWords(),L=()=>g.getInstance().getFalsyWords(),Rt=()=>g.getInstance().getBooleanOptionToRender(),It=[...N(),...L()];import{isArray as Ae,isNil as Oe,isObject as De}from"lodash";var H=class{constructor(){this.parse=(e,t)=>Oe(e)||Ae(e)||De(e)?null:N().includes(`${e}`.toLowerCase())?!0:L().includes(`${e}`.toLowerCase())?!1:e===""?null:`${e}`}},oe=H;import{isArray as ne,isBoolean as se,isNil as ae,isObject as le}from"lodash";var Y=class{constructor(){this.parseSingle=(e,t)=>ae(e)||le(e)||ne(e)?null:se(e)?JSON.stringify(e):b({value:e,dataModel:t.dataModel,isTrim:!0});this.parseMultiple=(e,t)=>ne(e)?e.map(i=>b({value:i,dataModel:t.dataModel,isTrim:!0})):ae(e)||le(e)||e===""?null:se(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)}},pe=Y;import{isArray as Se,isBoolean as Pe,isNil as Re,isObject as Ie}from"lodash";var w=class{constructor(){this.parse=(e,t)=>{if(Re(e)||Se(e)||Ie(e))return null;if(Pe(e))return JSON.stringify(e);if(e==="")return null;let i=`${e}`;return a(/[eE]/.test(i)?m.expandScientificNotation(i):i)}}},ue=w;import{isArray as _e,isBoolean as xe,isNil as Ve,isObject as Ue}from"lodash";var v=class{constructor(){this.parse=(e,t)=>Ve(e)?null:xe(e)?e?"1":"0":Ue(e)||_e(e)||e===""||a(e)===null?null:this.valueParser(e,t)}},C=v;var $=class extends C{constructor(){super(...arguments);this.valueParser=(t,i)=>{let o=m.convertStringToNumber(t,{format:i?.numberFormat});return o===null?a(`${t}`):Number(o)}}},me=$;var W=class extends C{constructor(){super(...arguments);this.valueParser=(t,i)=>{let o=m.convertStringToNumber(t,{format:i?.numberFormat});return o===null?a(`${t}`):Number(o)}}},de=W;import{isArray as Fe,isBoolean as Ne,isNil as Le,isNumber as He,isObject as Ye}from"lodash";var K=class{constructor(){this.parse=(e,t)=>{if(Le(e)||Ye(e)||Fe(e))return null;if(Ne(e))return JSON.stringify(e);if(He(e))return e;if(e===""||a(e)===null)return null;let i=m.convertStringToNumber(e,{adornment:"percentage"});return i===null?a(`${e}`):Number(i)}}},ye=K;import{isArray as we,isBoolean as ve,isNil as $e,isObject as We}from"lodash";var X=class{constructor(){this.parse=(e,t)=>{if($e(e)||we(e)||We(e))return null;if(ve(e))return JSON.stringify(e);if(e===""||a(e)===null)return null;let i=m.convertStringToNumber(e,{format:t?.numberFormat});return i===null?a(`${e}`):Number(i)}}},ce=X;var Me=["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:ss","yyyy-MM-dd","yyyy-dd-MM","yyyy-MM-dd HH:mm:ss","dd-MM-yyyy","MM-dd-yyyy","MM/dd/yyyy","MM.dd.yyyy","yyyy/MM/dd","yyyyMMdd","dd MMM yyyy","dd MMMM yyyy","MM-dd-yyyy HH:mm:ss","MM/dd/yyyy HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd-yyyy HH:mm","MM/dd/yyyy HH:mm","dd-MMM-yyyy","MMM yyyy","MMMM yyyy","MMMM d, yyyy","MMM d, yyyy","MM dd yyyy","yyyy-MM-dd'T'HH:mm:ss.SSS","yyyy-MM-dd'T'HH:mm:ss.SSSxxx","yyyy.MM.dd","yyyy MM dd","yyyy/dd/MM","yyyy.dd.MM","dd yyyy MM","dd.yyyy.MM","dd-yyyy-MM","yyyy dd MM","MM yyyy dd","dd/yyyy/MM","MM/yyyy/dd"],Ke=["dd.MM.yyyy","dd/MM/yyyy","dd-MM-yyyy","MM.dd.yyyy","MM/dd/yyyy","MM-dd-yyyy","yyyy.MM.dd","yyyy/MM/dd","yyyy-MM-dd","yyyy.dd.MM","yyyy/dd/MM","yyyy-dd-MM","dd MMM yyyy","dd MMMM yyyy","MMM dd, yyyy","MMMM dd, yyyy","MMM dd yyyy","yyyy MMM dd"],Xe=["ddMMyyyy","MMddyyyy","yyyyMMdd"],Be=[""," HH:mm"," HH:mm:ss"],ke=["yyyy-MM-dd","yyyy-dd-MM"],ze=["'T'HH:mm:ss","'T'HH:mm:ss.SSS","'T'HH:mm:ss.SSSxxx"],Qe=[...Ke.flatMap(r=>Be.map(e=>`${r}${e}`)),...Xe,...ke.flatMap(r=>ze.map(e=>`${r}${e}`))],Ge=new Set(Me),ge=new Set([...Me,...Qe.filter(r=>!Ge.has(r))]);var qe={YYYY:"yyyy",YY:"yy",MMMM:"MMMM",MMM:"MMM",MM:"MM",M:"M",DD:"dd",D:"d",HH:"HH",H:"H",hh:"hh",h:"h",mm:"mm",m:"m",ss:"ss",s:"s",SSS:"SSS",SS:"SS",S:"S",A:"a",a:"a",XXXXX:"XXXXX",XXXX:"XXXX",XXX:"XXX",XX:"XX",X:"X",xxxxx:"xxxxx",xxxx:"xxxx",xxx:"xxx",xx:"xx",x:"x",ZZ:"xxx",Z:"X"},fe=r=>r.replace(/'/g,"''"),Ze=r=>{let e="",t=0;for(;t<r.length;){let i=r[t];if(i==="'"){t+=1;let o="";for(;t<r.length;)if(r[t]==="'")if(r[t+1]==="'")o+="'",t+=2;else{t+=1;break}else o+=r[t],t+=1;e+=`'${fe(o)}'`;continue}if(i==="["){t+=1;let o="";for(;t<r.length;)if(r[t]==="]")if(r[t+1]==="]")o+="]",t+=2;else{t+=1;break}else o+=r[t],t+=1;e+=`'${fe(o)}'`;continue}if(i==="T"){e+="'T'",t+=1;continue}if(/[A-Za-z]/.test(i)){let o=1;for(;r[t+o]===i;)o++;let n=r.slice(t,t+o);e+=qe[n]??n,t+=o}else e+=i,t+=1}return e},Je=r=>{if(!f(r))return!1;let e=Ze(r.trim());return ge.has(e)},cr=r=>{if(!f(r))return null;let e=r.trim();return Je(e)?e:null},je=({sourceRows:r,inputFormat:e})=>{let t=e.trim(),i=0,o=0;for(let n=0;n<r.length;n++){let s=r[n];re(s)&&(o+=1,T(s.trim(),t)||(i+=1))}return{mismatchCount:i,totalCount:o}},Mr=(r,e)=>{let t=e.trim();if(T(r,t))return!1;let i=r.trim();return/^\d{4}-\d{2}-\d{2}/.test(i)?!!(t.includes("/")||t.includes(".")&&!t.includes("/")):!1},gr=({columnKey:r,sourceRows:e,inputFormat:t})=>{let{mismatchCount:i,totalCount:o}=je({sourceRows:e,inputFormat:t});i!==0&&console.warn(`Ingestro: Column '${r}': ${i} of ${o} cells did not match inputFormat '${t.trim()}'.`)};import{parse as et,format as tt}from"date-fns";import{isArray as rt,isBoolean as it,isNil as ot,isObject as nt}from"lodash";import A from"moment";var Te=/([+-](?:0\d|1[0-4]):?[0-5]\d|Z)$/i,he=(r,e)=>{let o=!!r.match(Te)?A.parseZone(r,e,!0):A(r,e,!0);return o.isValid()&&o.format(e)===r},B=class{constructor(){this.parse=(e,t)=>{if(ot(e)||rt(e)||nt(e))return null;if(it(e))return JSON.stringify(e);let i=t?.dataModel?.getType();if(!i)return a(`${e}`);if(typeof e=="string"){if(e==="")return null;try{if(t?.dataModel?.getType()==="date"){let o=t?.dataModel?.getOutputFormat(),n=t?.dataModel?.getInputFormat(),s=`${e}`,y=!1;if(f(n)&&!t?.skipDeclaredInputFormatNormalization){let u=J(s);if(T(s,n)||u)u||(s=`${V([s],n)[0]}`),y=!0;else{let M=V([s],n)[0];if(M===s)return he(s,o)?s:a(s);s=`${M}`,y=!0}}if(!y&&he(s,o))return s;let p=!!s.match(Te)?A.parseZone(s,Z):A(s,q);if(p.isValid())return p.format(o);throw new Error("invalid date")}else{let o=j[i];if(!o)return a(`${e}`);let n=et(e,G,new Date);return tt(n,o)}}catch{let n=ee[i];return n?a(te(e,n)):a(`${e}`)}}else return a(`${e}`)}}},Ee=B;import{isArray as st}from"lodash";var at=new me,lt=new de,pt=new ce,ut=new ye,mt=new oe,dt=new pe,yt=new ue,ct=new Ee,k=class{static{this.parse=(e,t)=>{let i;switch(t?.dataModel?.getType()){case"int":i=at;break;case"float":i=lt;break;case"boolean":i=mt;break;case"single-select":case"currency_code":case"country_code_alpha_2":case"country_code_alpha_3":i=dt;break;case"percentage":i=ut;break;case"currency_eur":case"currency_usd":i=pt;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=ct;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=yt;break}return i.parse(e,t)}}static{this.parseRawValueToDisplayValue=(e,t)=>{let i=e;if(t.isNumeric)i=m.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 n=g.getInstance().getOptionsForReviewEntries().find(s=>`${s.value}`.includes(`${e}`));n&&(i=`${n.label}`)}else if(h.isTypeCategory(t.type))if(t.isMultiSelection){if(st(e)){let o=t.options?.filter(n=>e.some(s=>x(n,s)));o&&(i=o.map(n=>n.label).join(", "))}}else{let o=t.options?.find(n=>x(n,e));o&&(i=`${o?.label}`)}return`${i}`}}static{this.parseDisplayValueToRawValue=(e,t)=>{if(t.isNumeric){let i=m.convertToUsWithDecimal(`${e}`,t.numberFormat??"eu");if(i===null)return e;let o=m.convertStringToNumber(i,{format:"us"});return o!==null?Number(o):e}else return e}}},be=k;var Zr=(r,e)=>Number(r).toLocaleString(e??"de-DE"),ft={de:"de-DE",en:"en-US",es:"es-ES",fr:"fr-FR",it:"it-IT",nl:"nl-NL",pl:"pl-PL",pt:"pt-PT",sv:"sv-SE",cz:"cs-CZ",dk:"da-DK",hu:"hu-HU",lt:"lt-LT",no:"nb-NO",ru:"ru-RU",sk:"sk-SK",zh:"zh-CN"},Jr=r=>r?ft[r]??"de-DE":"de-DE",jr=(r,e)=>{let{value:t,isExact:i,columns:o,isEmptyValues:n}=e;if(n)return z(r)||r==="";if(gt(r)&&o[0]?.isMultiSelection){let y=o[0],c=r.map(l=>{let p=y.options?.find(u=>`${u.value}`==`${l}`);return p?p.label:`${l}`}).join(", ");return i?c===t:c.toLowerCase().includes(t.toLowerCase())}let s=be.parseRawValueToDisplayValue(r,o[0]);return i&&!z(r)&&s===t?!0:!!(!i&&!z(r)&&s?.toLowerCase()?.includes(t?.toLowerCase()))},ei=(r,e,t,i)=>{let o=r.map(l=>{let p=i.options?.find(u=>`${u.value}`==`${l}`);return p?p.label:`${l}`}),n=e.split(",").map(l=>l.trim()).filter(Boolean);if(n.length===0)return r;let s=-1;for(let l=0;l<=o.length-n.length;l++){let p=!0;for(let u=0;u<n.length;u++)if(o[l+u].toLowerCase()!==n[u].toLowerCase()){p=!1;break}if(p){s=l;break}}if(s===-1)return r;let y=[...r.slice(0,s),...t,...r.slice(s+n.length)],c=new Set;return y.filter(l=>{let p=`${l}`;return c.has(p)?!1:(c.add(p),!0)})},ti=(r,e,t)=>{let i=new RegExp(Mt(e),"gi");return`${r}`.replace(i,t)},ri=r=>typeof r=="string"?r.replace(/(\r\n|\n|\r)/gm,""):r,ii=(r,e)=>e?e.map((t,i)=>r.map(o=>({rowIndex:i,valid:!0,key:o.key,value:t[o.key]}))):[];var Q=class r extends h{constructor({description:t,key:i,example:o,label:n,type:s,options:y,validators:c,alternativeMatches:l,columnSize:p,isMultiSelection:u,allowCustomOptions:E,allowedCustomOptionTypes:M,preserveUnmappedOptions:O,creator:D,baseKey:S,baseKeyCounter:P,hidden:R,optionMappingConfiguration:I,..._}){super({description:t,key:i,example:o,label:n,type:s,validators:c,alternativeMatches:l,columnSize:p,creator:D,baseKey:S,baseKeyCounter:P,hidden:R,optionMappingConfiguration:I,..._});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(),inputFormat:this.getInputFormat(),numberFormat:this.getNumberFormat(),baseKey:this.getBaseKey(),baseKeyCounter:this.getBaseKeyCounter(),creator:this.getCreator(),hidden:this.isHidden(),disabled:this.isDisabled(),optionMappingConfiguration:this.getOptionMappingConfiguration(),excludeFromAutoMatching:this.isExcludedFromAutoMatching()},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=y?.map(d=>({...d,baseKey:d?.baseKey||d.value,baseKeyCounter:d.baseKeyCounter||0,alternativeMatches:d.alternativeMatches.filter(Ce=>Ce!==d.label),validations:d.validations||[]})),this.isMultiSelection=u,this.allowCustomOptions=E,this.allowedCustomOptionTypes=M?[...M]:void 0,this.preserveUnmappedOptions=O}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,excludeFromAutoMatching:t.excludeFromAutoMatching})}},pi=Q;export{N as a,L as b,Rt as c,It as d,cr as e,Mr as f,gr as g,ht as h,h as i,be as j,Zr as k,Jr as l,jr as m,ei as n,ti as o,ri as p,ii as q,pi as r};
package/index.d.ts CHANGED
@@ -103,6 +103,7 @@ export type ModifierAddColumn = ({
103
103
  validations,
104
104
  dropdownOptions,
105
105
  outputFormat,
106
+ inputFormat,
106
107
  isMultiSelect,
107
108
  columnWidth,
108
109
  hidden,
@@ -114,6 +115,7 @@ export type ModifierAddColumn = ({
114
115
  validations?: ValidatorAPI[] | null;
115
116
  dropdownOptions?: DropdownOptionAPI[];
116
117
  outputFormat?: string | null;
118
+ inputFormat?: string | null;
117
119
  isMultiSelect?: boolean;
118
120
  columnWidth?: number;
119
121
  hidden?: boolean;
@@ -133,6 +135,7 @@ export type ModifierStack<ROW_DATA> = {
133
135
  columnIndex?: number;
134
136
  columnDropdownOptions?: DropdownOptionAPI[];
135
137
  outputFormat?: string | null;
138
+ inputFormat?: string | null;
136
139
  isMultiSelect?: boolean;
137
140
  hidden?: boolean;
138
141
  disabled?: boolean;
@@ -206,19 +209,23 @@ export type ISheetData = {
206
209
 
207
210
  type IUploadStepUpdateDataFn = (data: SheetLikeData[]) => void;
208
211
 
209
- export type IAlertFn = (params: {
212
+ export type IAlertFn = (params?: {
210
213
  title: string;
211
214
  description: string;
212
215
  cancelButton: string;
213
216
  proceedButton: string;
214
217
  }) => void;
215
218
 
216
- export type IBlockFn = (params: {
219
+ export type IBlockFn = (params?: {
217
220
  title: string;
218
221
  description: string;
219
222
  closeButton: string;
220
223
  }) => void;
221
224
 
225
+ export type IProceedFn = (options?: { rerunHandler?: boolean }) => void;
226
+
227
+ export type IStayFn = (options?: { rerunHandler?: boolean }) => void;
228
+
222
229
  export type AddedColumnSource =
223
230
  | 'metadata_cell'
224
231
  | 'custom_value'
@@ -276,6 +283,8 @@ export type IMappingStepHandler = (params: {
276
283
  alert: IAlertFn;
277
284
  block: IBlockFn;
278
285
  logs: ImportLogs;
286
+ proceed: IProceedFn;
287
+ stay: IStayFn;
279
288
  }) => Promise<void> | void;
280
289
 
281
290
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -286,6 +295,8 @@ export type IHeaderStepHandler = (params: {
286
295
  updateData: IHeaderStepUpdateDataFn;
287
296
  alert: IAlertFn;
288
297
  block: IBlockFn;
298
+ proceed: IProceedFn;
299
+ stay: IStayFn;
289
300
  }) => Promise<void> | void;
290
301
 
291
302
  export type IReviewData = Record<
@@ -303,6 +314,8 @@ export type IReviewStepHandler = (params: {
303
314
  updateData: IReviewStepUpdateDataFn;
304
315
  block: IBlockFn;
305
316
  logs: ImportLogs;
317
+ proceed: IProceedFn;
318
+ stay: IStayFn;
306
319
  }) => Promise<void> | void;
307
320
 
308
321
  export type IStepHandler = {
@@ -333,6 +346,25 @@ export declare const STEP_IDENTIFIERS: {
333
346
 
334
347
  export type OnStepChange = (step: StepIdentifier) => void;
335
348
 
349
+ export type UploadErrorType =
350
+ | 'file-invalid-type'
351
+ | 'file-too-large'
352
+ | 'too-many-files'
353
+ | 'parse-error'
354
+ | 'advanced-parsing-not-allowed'
355
+ | 'empty-file'
356
+ | 'max-records-exceeded'
357
+ | 'unknown';
358
+
359
+ export type UploadError = {
360
+ type: UploadErrorType;
361
+ message: string;
362
+ };
363
+
364
+ export type OnUploadError = (error: UploadError) => void;
365
+
366
+ export type OnUploadSuccess = () => void;
367
+
336
368
  export type ConfigureAPI = {
337
369
  licenseKey: string;
338
370
  settings: SettingsAPI;
@@ -342,6 +374,8 @@ export type ConfigureAPI = {
342
374
  onEntryChange?: OnEntryChange;
343
375
  onEntryInit?: OnEntryInit;
344
376
  onStepChange?: OnStepChange;
377
+ onUploadError?: OnUploadError;
378
+ onUploadSuccess?: OnUploadSuccess;
345
379
  /** @deprecated - this setting is deprecated. */
346
380
  dataHandler?: DataHandler;
347
381
  stepHandler?: IStepHandler;
@@ -395,6 +429,8 @@ export type ActiveColumnType = Exclude<
395
429
  | 'currency_code'
396
430
  >;
397
431
 
432
+ export type CompareOperator = 'GTE' | 'GT' | 'LT' | 'LTE' | 'EQ' | 'NEQ';
433
+
398
434
  export type ValidationTypeAPI =
399
435
  | 'required'
400
436
  | 'unique'
@@ -406,7 +442,8 @@ export type ValidationTypeAPI =
406
442
  | 'required_with_values'
407
443
  | 'required_without_values'
408
444
  | 'required_with_all_values'
409
- | 'required_without_all_values';
445
+ | 'required_without_all_values'
446
+ | 'compare';
410
447
 
411
448
  export type ColumnValueAPI = Record<string, FieldValue[] | FieldValue>;
412
449
 
@@ -414,6 +451,8 @@ export type columnsAPI = string[];
414
451
 
415
452
  export type ValidatorAPI = {
416
453
  validate: ValidationTypeAPI;
454
+ operator?: CompareOperator;
455
+ value?: number;
417
456
  regex?: string | null;
418
457
  columnValues?: ColumnValueAPI | null;
419
458
  columns?: columnsAPI;
@@ -518,6 +557,7 @@ export type ColumnAPI = {
518
557
  alternativeMatches?: string[];
519
558
  isMultiSelect?: boolean;
520
559
  outputFormat?: string | null;
560
+ inputFormat?: string | null;
521
561
  allowCustomOptions?: boolean;
522
562
  allowedCustomOptionTypes?: DropdownOptionType[];
523
563
  preserveUnmappedOptions?: PreserveUnmappedOptions;
@@ -529,6 +569,7 @@ export type ColumnAPI = {
529
569
  hidden?: boolean;
530
570
  disabled?: boolean;
531
571
  optionMappingConfiguration?: IMappingConfiguration;
572
+ excludeFromAutoMatching?: boolean;
532
573
  };
533
574
 
534
575
  export type I18nOverrides =
@@ -542,6 +583,14 @@ export type I18nOverrides =
542
583
  pl?: Record<string, string>;
543
584
  pt?: Record<string, string>;
544
585
  sv?: Record<string, string>;
586
+ cz?: Record<string, string>;
587
+ hu?: Record<string, string>;
588
+ lt?: Record<string, string>;
589
+ no?: Record<string, string>;
590
+ ru?: Record<string, string>;
591
+ sk?: Record<string, string>;
592
+ zh?: Record<string, string>;
593
+ dk?: Record<string, string>;
545
594
  }
546
595
  | Record<string, string>;
547
596
 
@@ -575,6 +624,20 @@ export type ISkipConfiguration = {
575
624
  mapping?: ISkipConfigurationMapping;
576
625
  };
577
626
 
627
+ export type SheetMappingMode =
628
+ | 'disabled'
629
+ | 'headers_only'
630
+ | 'headers_with_samples';
631
+
632
+ export type SheetMappingConfiguration = {
633
+ join?: {
634
+ mode: SheetMappingMode;
635
+ };
636
+ append?: {
637
+ mode: SheetMappingMode;
638
+ };
639
+ };
640
+
578
641
  export type SettingsAPI = {
579
642
  developerMode?: boolean;
580
643
  identifier: string;
@@ -598,6 +661,7 @@ export type SettingsAPI = {
598
661
  onlyMappedColumns?: boolean;
599
662
  allowCustomColumns?: boolean;
600
663
  allowedCustomColumnTypes?: ActiveColumnType[];
664
+ allowColumnNameEdits?: boolean;
601
665
  columnResize?: boolean;
602
666
  /** @deprecated - this setting will be deprecated. Use allowCustomOptions from Target Data Model instead. */
603
667
  allowCustomOptions?: boolean;
@@ -630,7 +694,10 @@ export type SettingsAPI = {
630
694
  transpose?: boolean;
631
695
  mergeHeaders?: boolean;
632
696
  metadataSelection?: boolean;
633
- skipConfiguration?: SkipConfiguration;
697
+ collapseMatchedColumns?: boolean;
698
+ skipConfiguration?: ISkipConfiguration;
699
+ disableColumnRemapping?: boolean;
700
+ sheetMappingConfiguration?: SheetMappingConfiguration;
634
701
  };
635
702
 
636
703
  export type FieldValue =
@@ -759,6 +826,7 @@ export type ImportLogsAddedColumn = {
759
826
  key: string;
760
827
  columnType: ColumnType;
761
828
  outputFormat?: string | null;
829
+ inputFormat?: string | null;
762
830
  };
763
831
 
764
832
  export type ImportLogsAddedOptions = {
@@ -789,7 +857,6 @@ export type IAdditionalInfoTheme = {
789
857
  text?: CSSInterpolation;
790
858
  infoModal?: {
791
859
  root?: CSSInterpolation;
792
- closeIcon?: CSSInterpolation;
793
860
  scrollbar?: {
794
861
  navigatorColor?: string;
795
862
  backgroundColor?: string;
@@ -950,6 +1017,7 @@ type ButtonThemeVariantAPI = {
950
1017
  secondary?: ButtonThemeCssObjectAPI;
951
1018
  tertiary?: ButtonThemeCssObjectAPI;
952
1019
  import?: ButtonThemeCssObjectAPI;
1020
+ select?: ButtonThemeCssObjectAPI;
953
1021
  cleanData?: ButtonThemeCssObjectAPI;
954
1022
  exportExcel?: ButtonThemeCssObjectAPI & {
955
1023
  dropdown?: {
@@ -1011,44 +1079,144 @@ type LoaderThemeAPI = {
1011
1079
  loadAnimationColor?: string;
1012
1080
  };
1013
1081
 
1014
- type HeaderMatchAPI = {
1082
+ type HeaderMatchScrollbarAPI = {
1083
+ navigatorColor?: string;
1084
+ backgroundColor?: string;
1085
+ };
1086
+
1087
+ type HeaderMatchSurfaceAPI = {
1088
+ root?: CSSInterpolation;
1089
+ backgroundColor?: string;
1090
+ borderColor?: string;
1091
+ borderRadius?: string;
1092
+ boxShadow?: string;
1093
+ };
1094
+
1095
+ type HeaderMatchDividerSectionAPI = {
1096
+ root?: CSSInterpolation;
1097
+ dividerColor?: string;
1098
+ };
1099
+
1100
+ type HeaderMatchTextStyleAPI = {
1101
+ root?: CSSInterpolation;
1102
+ color?: string;
1103
+ fontSize?: string;
1104
+ fontWeight?: string;
1105
+ };
1106
+
1107
+ // Shared by the unselected and selected ("selected") sheet-tab states — same shape either way.
1108
+ type HeaderMatchSheetTabAPI = {
1109
+ root?: CSSInterpolation;
1110
+ title?: CSSInterpolation;
1111
+ description?: CSSInterpolation;
1112
+ border?: CSSInterpolation;
1113
+ // styles the file icon shown next to the sheet/tab name
1114
+ icon?: CSSInterpolation;
1115
+ };
1116
+
1117
+ // Header-select button themes intentionally omit ButtonThemeCssObjectAPI's nested `icon`
1118
+ // key — that path was never wired for popover/merge confirm buttons.
1119
+ type HeaderMatchButtonThemeAPI = CSSInterpolation;
1120
+
1121
+ type HeaderMatchDeleteButtonThemeAPI = CSSInterpolation & {
1122
+ // trash icon color (read as an inline style on the SVG, not via CSS spread on the button)
1123
+ icon?: CSSInterpolation;
1124
+ };
1125
+
1126
+ type HeaderMatchDropdownItemThemeAPI = CSSInterpolation & {
1127
+ // persistent selected separator item — backgroundColor is applied; text color uses `color` on the item
1128
+ selected?: CSSInterpolation;
1129
+ };
1130
+
1131
+ type HeaderMatchQuickFillButtonThemeAPI = CSSInterpolation & {
1132
+ label?: CSSInterpolation;
1133
+ value?: CSSInterpolation;
1134
+ icon?: CSSInterpolation;
1135
+ };
1136
+
1137
+ export type HeaderMatchAPI = {
1138
+ // core — always rendered, no settings flag
1015
1139
  root?: CSSInterpolation;
1016
1140
  pageHeader?: HeaderThemeAPI;
1017
1141
  content?: CSSInterpolation;
1018
- sheetName?: {
1019
- root?: CSSInterpolation;
1020
- title?: CSSInterpolation;
1021
- description?: CSSInterpolation;
1022
- border?: CSSInterpolation;
1142
+ sheetName?: HeaderMatchSheetTabAPI & {
1143
+ // persistent "currently active sheet tab" state - distinct from :hover/:active
1144
+ selected?: HeaderMatchSheetTabAPI;
1023
1145
  };
1024
1146
  table?: {
1025
1147
  th?: CSSInterpolation;
1026
1148
  td?: CSSInterpolation;
1027
1149
  selectRowColor?: string;
1028
1150
  hoverRowColor?: string;
1029
- scrollbar?: {
1030
- navigatorColor?: string;
1031
- backgroundColor?: string;
1032
- };
1151
+ // background/text color for a row that is both selected and hovered (defaults to a darkened selectRowColor)
1152
+ highlightRowColor?: string;
1153
+ textColor?: string;
1154
+ mergedCell?: CSSInterpolation;
1155
+ scrollbar?: HeaderMatchScrollbarAPI;
1033
1156
  };
1034
1157
  fullScreen?: {
1035
1158
  root?: CSSInterpolation;
1036
1159
  icon?: CSSInterpolation;
1037
1160
  };
1038
- sheetNameSelected?: {
1039
- root?: CSSInterpolation;
1040
- title?: CSSInterpolation;
1041
- description?: CSSInterpolation;
1042
- border?: CSSInterpolation;
1043
- };
1044
- progressBar?: {
1045
- root?: CSSInterpolation;
1046
- progress?: {
1047
- navigatorColor?: string;
1048
- backgroundColor?: string;
1161
+ additionalInfo?: IAdditionalInfoTheme;
1162
+
1163
+ // gated behind settings.transpose / settings.mergeHeaders / settings.metadataSelection
1164
+ features?: {
1165
+ buttons?: {
1166
+ primary?: HeaderMatchButtonThemeAPI;
1167
+ secondary?: HeaderMatchButtonThemeAPI;
1168
+ };
1169
+ toolbar?: HeaderMatchSurfaceAPI & {
1170
+ dividerColor?: string;
1171
+ spinnerColor?: string;
1172
+ // pen / merge-info SVG color (inline style)
1173
+ iconColor?: string;
1174
+ button?: HeaderMatchButtonThemeAPI;
1175
+ // pen button + merge separator trigger wrapper
1176
+ iconButton?: HeaderMatchButtonThemeAPI;
1177
+ deleteButton?: HeaderMatchDeleteButtonThemeAPI;
1178
+ // the "Select headers to merge" / "N rows selected" status text in the merge edit bar
1179
+ text?: CSSInterpolation;
1180
+ dropdownMenu?: HeaderMatchSurfaceAPI & {
1181
+ item?: HeaderMatchDropdownItemThemeAPI;
1182
+ };
1183
+ };
1184
+ metadataSelection?: {
1185
+ root?: CSSInterpolation;
1186
+ selectedBorderColor?: string;
1187
+ hoverBackground?: string;
1188
+ // metadata +/- button container
1189
+ iconButton?: CSSInterpolation;
1190
+ // metadata +/- SVG color (falls back to selectedBorderColor)
1191
+ iconColor?: string;
1192
+ valuePreview?: {
1193
+ root?: CSSInterpolation;
1194
+ label?: CSSInterpolation;
1195
+ value?: CSSInterpolation;
1196
+ };
1197
+ };
1198
+ formPopover?: HeaderMatchSurfaceAPI & {
1199
+ width?: string;
1200
+ header?: HeaderMatchDividerSectionAPI;
1201
+ title?: HeaderMatchTextStyleAPI;
1202
+ description?: HeaderMatchTextStyleAPI;
1203
+ content?: CSSInterpolation;
1204
+ footer?: HeaderMatchDividerSectionAPI;
1205
+ controls?: {
1206
+ input?: {
1207
+ root?: CSSInterpolation;
1208
+ color?: string;
1209
+ backgroundColor?: string;
1210
+ borderColor?: string;
1211
+ borderRadius?: string;
1212
+ fontSize?: string;
1213
+ placeholderColor?: string;
1214
+ focusBorderColor?: string;
1215
+ };
1216
+ quickFillButton?: HeaderMatchQuickFillButtonThemeAPI;
1217
+ };
1049
1218
  };
1050
1219
  };
1051
- additionalInfo?: IAdditionalInfoTheme;
1052
1220
  };
1053
1221
 
1054
1222
  type DropzoneIllustrationStyle = {
@@ -1221,6 +1389,9 @@ type ColumnMatchThemeAPI = {
1221
1389
  hasMatchIcon?: CSSInterpolation;
1222
1390
  notMatchIcon?: CSSInterpolation;
1223
1391
  notMatchErrorIcon?: CSSInterpolation;
1392
+ hasMatchIconUrl?: string;
1393
+ notMatchIconUrl?: string;
1394
+ notMatchErrorIconUrl?: string;
1224
1395
  showMore?: {
1225
1396
  root?: CSSInterpolation;
1226
1397
  text?: CSSInterpolation;
@@ -1236,6 +1407,19 @@ type ColumnMatchThemeAPI = {
1236
1407
  columnPopover?: CSSInterpolation;
1237
1408
  additionalInfo?: IAdditionalInfoTheme;
1238
1409
  infoBox?: InfoBoxThemeAPI;
1410
+ unmappedValuesBanner?: {
1411
+ wrapper?: CSSInterpolation;
1412
+ root?: CSSInterpolation;
1413
+ icon?: CSSInterpolation;
1414
+ text?: CSSInterpolation;
1415
+ toggle?: {
1416
+ root?: CSSInterpolation;
1417
+ rootOn?: CSSInterpolation;
1418
+ rootOff?: CSSInterpolation;
1419
+ thumb?: CSSInterpolation;
1420
+ label?: CSSInterpolation;
1421
+ };
1422
+ };
1239
1423
  };
1240
1424
 
1241
1425
  type FilterConditionDropdown = {
@@ -1331,12 +1515,14 @@ export type ReviewEntriesThemeAPI = {
1331
1515
  warning?: CSSInterpolation;
1332
1516
  info?: CSSInterpolation;
1333
1517
  addColumn?: CSSInterpolation;
1518
+ disabled?: CSSInterpolation;
1334
1519
  };
1335
1520
  selectedBackground?: {
1336
1521
  normal?: string;
1337
1522
  error?: string;
1338
1523
  warning?: string;
1339
1524
  info?: string;
1525
+ disabled?: string;
1340
1526
  };
1341
1527
  scrollbar?: {
1342
1528
  navigatorColor?: string;
@@ -1399,6 +1585,7 @@ export type ReviewEntriesThemeAPI = {
1399
1585
  error?: string;
1400
1586
  warning?: string;
1401
1587
  info?: string;
1588
+ disabled?: string;
1402
1589
  };
1403
1590
  icon?: CSSInterpolation;
1404
1591
  infoIcon?: CSSInterpolation;
@@ -1410,6 +1597,7 @@ export type ReviewEntriesThemeAPI = {
1410
1597
  checkbox?: CSSInterpolation;
1411
1598
  allCheckbox?: CSSInterpolation;
1412
1599
  };
1600
+ prompts?: CSSInterpolation;
1413
1601
  addRowButton?: CSSInterpolation;
1414
1602
  duplicateButton?: CSSInterpolation;
1415
1603
  clearFilterButton?: CSSInterpolation;
@@ -1426,6 +1614,8 @@ export type ReviewEntriesThemeAPI = {
1426
1614
  selected?: CSSInterpolation;
1427
1615
  allRows?: CSSInterpolation;
1428
1616
  errorRows?: CSSInterpolation;
1617
+ warningRows?: CSSInterpolation;
1618
+ infoRows?: CSSInterpolation;
1429
1619
  root?: CSSInterpolation;
1430
1620
  };
1431
1621
  submitModal?: Omit<DialogThemeAPI, 'scrollbar'> & {
@@ -1717,6 +1907,7 @@ export type CleaningAssistantThemeAPI = {
1717
1907
  findButton?: CSSInterpolation;
1718
1908
  dismissButton?: CSSInterpolation;
1719
1909
  applyButton?: CSSInterpolation;
1910
+ applyButtonDisabled?: CSSInterpolation;
1720
1911
  };
1721
1912
  loadingState?: {
1722
1913
  root?: CSSInterpolation;