@sheetxl/primitives 0.8.0-beta.1 → 0.8.0-beta.3
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/browser/cjs/index.cjs +1 -1
- package/browser/esm/index.mjs +88 -73
- package/node/esm/index.mjs +98 -83
- package/package.json +1 -1
- package/types/src/ErrorPolicy.d.ts +48 -57
- package/types/src/Flatten.d.ts +6 -3
- package/types/src/FormulaContext.d.ts +19 -5
- package/types/src/IFormulaContext.d.ts +83 -7
- package/types/src/IFunction.d.ts +339 -44
- package/types/src/IFunctionArguments.d.ts +64 -15
- package/types/src/IRange.d.ts +152 -38
- package/types/src/IRangeStats.d.ts +32 -2
- package/types/src/IRuntime.d.ts +24 -1
- package/types/src/Lazy.d.ts +76 -0
- package/types/src/NoFilter.d.ts +34 -0
- package/types/src/NoLift.d.ts +31 -0
- package/types/src/Repeating.d.ts +24 -4
- package/types/src/ReportType.d.ts +42 -0
- package/types/src/Scalar.d.ts +1 -1
- package/types/src/ValueKind.d.ts +43 -0
- package/types/src/Volatile.d.ts +12 -0
- package/types/src/WildCard.d.ts +13 -9
- package/types/src/index.d.ts +6 -1
- package/types/src/Compat.d.ts +0 -77
package/browser/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e;Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),function(e){e.MAX_TEXT_LENGTH=32767;let t=e.MAX_SIGNIFICANT_DIGITS=15;e.truncateNumberText=function(e){let n=e.length;if(n<=t)return e;let r=0,i=null;for(let a=0;a<n;a++){let n=e.charCodeAt(a);if(n>=48&&n<=57){if(r===0&&n===48)continue;r++,r>t&&((i??=e.split(``))[a]=`0`)}else if((n===69||n===101)&&r>0)break}return i===null?e:i.join(``)}}(e||={});var t,n,r,i,a={Number:`number`,String:`string`,Boolean:`boolean`,Error:`error`,RichData:`richData`,Null:`null`},o={...a,Date:`date`},s=/[.*+?^${}()|[\]\\]/,c=e=>s.test(e)?`\\`+e:e,l={isWildCard:e=>typeof e==`string`&&/[*?]/.test(e),toRegex:(e,t,n=!1)=>{let r=``,i=e.length;for(let t=0;t<i;t++){let n=e[t];if(n===`~`){let n=e[t+1];n===`*`||n===`?`||n===`~`?(r+=c(n),t++):r+=`~`;continue}n===`*`?r+=`.*`:r+=n===`?`?`.`:c(n)}return RegExp(n?`^${r}$`:r,t)}},u={noReferenceLift:`A multi-cell reference at a non-repeating scalar parameter is #VALUE! rather than a broadcast.`,noMemberFilter:`Members of a repeating scalar parameter are coerced rather than filtered; one that cannot be is #VALUE!.`},d={atp:[`noReferenceLift`,`noMemberFilter`]};function f(e){if(!e)return null;let t=e.trim().toLowerCase();for(let e of Object.keys(u))if(e.toLowerCase()===t)return e;return null}(n=t||={}).Axis={Column:`column`,Row:`row`},n.AxisSelection={...t.Axis,Both:`both`},n.Direction={Up:`up`,Down:`down`,Left:`left`,Right:`right`},(r||={}).Aggregate={Count:`count`,NumericalCount:`numericalCount`,Sum:`sum`,Average:`average`,StdDev:`stdDev`,PopulationStdDev:`stdDevP`,Variance:`var`,PopulationVariance:`varP`,Min:`min`,Max:`max`},function(e){let t=e.Code={Parse:0,Null:1,Div0:2,Value:3,Ref:4,Name:5,Num:6,NA:7,GettingData:8,Spill:9,Connect:10,Blocked:11,Unknown:12,Field:13,Calc:14,Busy:16,Python:19,Timeout:20},n=e.Label={Parse:`#PARSE!`,Null:`#NULL!`,Div0:`#DIV/0!`,Value:`#VALUE!`,Ref:`#REF!`,Name:`#NAME?`,Num:`#NUM!`,NA:`#N/A`,GettingData:`#GETTING_DATA`,Spill:`#SPILL!`,Connect:`#CONNECT!`,Blocked:`#BLOCKED!`,Unknown:`#UNKNOWN!`,Field:`#FIELD!`,Calc:`#CALC!`,Busy:`#BUSY!`,Python:`#PYTHON!`,Timeout:`#TIMEOUT!`};class r extends Error{constructor(e,t,n,r){super(n,r),this._label=t,this._code=e,this.details=r}static{this.code=i.Code.Unknown}get isFormulaError(){return!0}getLabel(){return this._label}getCode(){return this._code}equals(e){return!!e&&(this._code===e._code||this._code===e.code)}get[Symbol.toStringTag](){return`[FormulaError]`}toString(){return this._label}}e.Known=r;class a extends r{constructor(e,r){super(t.Parse,n.Parse,e,r)}static{this.code=i.Code.Parse}getDetails(){let e=this.details;return{line:e?.line??1,column:e?.column??1,offset:e?.offset??0,length:e?.length??0}}}e.Parse=a;class o extends r{constructor(e,r){super(t.Null,n.Null,e,r)}static{this.code=i.Code.Null}}e.Null=o;class s extends r{constructor(e,r){super(t.Div0,n.Div0,e,r)}static{this.code=i.Code.Div0}}e.Div0=s;class c extends r{constructor(e,r){super(t.Value,n.Value,e,r)}static{this.code=i.Code.Value}}e.Value=c;class l extends r{constructor(e,r){super(t.Ref,n.Ref,e,r)}static{this.code=i.Code.Ref}}e.Ref=l;class u extends r{constructor(e,r){super(t.Name,n.Name,e,r)}static{this.code=i.Code.Name}}e.Name=u;class d extends r{constructor(e,r){super(t.Num,n.Num,e,r)}static{this.code=i.Code.Num}}e.Num=d;class f extends r{constructor(e,r){super(t.NA,n.NA,e,r)}static{this.code=i.Code.NA}}e.NA=f;class p extends r{constructor(e,r){super(t.GettingData,n.GettingData,e,r)}static{this.code=i.Code.GettingData}}e.GettingData=p;class m extends r{constructor(e,r){super(t.Spill,n.Spill,e,r)}static{this.code=i.Code.Spill}}e.Spill=m;class h extends r{constructor(e,r){super(t.Connect,n.Connect,e,r)}static{this.code=i.Code.Connect}}e.Connect=h;class g extends r{constructor(e,r){super(t.Blocked,n.Blocked,e,r)}static{this.code=i.Code.Blocked}}e.Blocked=g;class _ extends r{constructor(e,r){super(t.Unknown,n.Unknown,e,r)}static{this.code=i.Code.Unknown}}e.Unknown=_;class v extends r{constructor(e,r){super(t.Field,n.Field,e,r)}static{this.code=i.Code.Field}}e.Field=v;class y extends r{constructor(e,r){super(t.Calc,n.Calc,e,r)}static{this.code=i.Code.Calc}}e.Calc=y;class b extends r{constructor(e,r){super(t.Busy,n.Busy,e,r)}static{this.code=i.Code.Busy}}e.Busy=b;class x extends r{constructor(e,r){super(t.Python,n.Python,e,r)}static{this.code=i.Code.Python}}e.Python=x;class S extends r{constructor(e,r){super(t.Timeout,n.Timeout,e,r)}static{this.code=i.Code.Timeout}}e.Timeout=S}(i||={});var p={};p[i.Code.Parse]=i.Parse,p[i.Code.Null]=i.Null,p[i.Code.Div0]=i.Div0,p[i.Code.Value]=i.Value,p[i.Code.Ref]=i.Ref,p[i.Code.Name]=i.Name,p[i.Code.Num]=i.Num,p[i.Code.NA]=i.NA,p[i.Code.GettingData]=i.GettingData,p[i.Code.Spill]=i.Spill,p[i.Code.Connect]=i.Connect,p[i.Code.Blocked]=i.Blocked,p[i.Code.Unknown]=i.Unknown,p[i.Code.Field]=i.Field,p[i.Code.Calc]=i.Calc,p[i.Code.Busy]=i.Busy,p[i.Code.Python]=i.Python,p[i.Code.Timeout]=i.Timeout;var m=new Map,h=new Map,g=new Map,_=new Map,v=Object.keys(p);for(let e=0;e<v.length;e++){let t=p[v[e]],n=new t;g.set(n.getLabel(),t),_.set(n.getCode(),t),m.set(n.getLabel(),n),h.set(n.getCode(),n)}(function(e){let t=e.getBuiltInByCode=e=>h.get(e);e.BuiltIn={Parse:t(i.Code.Parse),Null:t(i.Code.Null),Div0:t(i.Code.Div0),Value:t(i.Code.Value),Ref:t(i.Code.Ref),Name:t(i.Code.Name),Num:t(i.Code.Num),NA:t(i.Code.NA),GettingData:t(i.Code.GettingData),Spill:t(i.Code.Spill),Connect:t(i.Code.Connect),Blocked:t(i.Code.Blocked),Unknown:t(i.Code.Unknown),Field:t(i.Code.Field),Calc:t(i.Code.Calc),Busy:t(i.Code.Busy),Python:t(i.Code.Python),Timeout:t(i.Code.Timeout)},e.newTypedError=(e,t,n)=>{let r;return r=typeof e==`string`?g.get(e):_.get(e),r||=i.Unknown,new r(t,n)},e.getBuiltInByLabel=e=>m.get(e),e.isError=function(e,t){return!!e&&!0===e.isFormulaError&&(t===void 0||e.getCode()===t)}})(i||={});var y=class{createRange(e,t,n){throw new S}getReference(e,t){throw new S}getResizedReference(e,t,n){throw new S}getNumberFormat(e,t){throw new S}fromSerialDate(e,t){throw new S}toSerialDate(e,t){throw new S}getDateParts(e,t){throw new S}getSerialDate(e,t,n,r,i,a,o){throw new S}getNow(){throw new S}getValueAt(e,t,n,r){return null}getEntireCoords(){return C}isValidDate(e,t){return e instanceof Date||Object.prototype.toString.call(e)===`[object Date]`?!isNaN(e.getTime()):!t&&typeof e==`number`&&!(e<0||e>T)}getRow(){return 0}getColumn(){return 0}getFormulaAt(e,t,n){return null}getSpillAt(e,t,n){return null}getSheetIndex(e){return-1}getSheetCount(){return 1}markVolatile(){}formatResults(e){}filterHidden(e,t){return e}filterTotals(e){return e}getFunction(e){return null}getAddress(e,t){throw new S}parseAsSerialDate(e,t){throw new S}parseAsDate(e,t){throw new S}parseAsNumber(e,t){throw new S}createCriteria(e){throw new S}parseAsLiteral(e){let t=e.toUpperCase();return t===`TRUE`||t!==`FALSE`&&i.getBuiltInByLabel(t)}toText(e){return typeof e==`string`?e:e==null?``:typeof e==`boolean`?e?`TRUE`:`FALSE`:e?.isFormulaError?e.getLabel():String(e)}compare(e,t,n){if(e===t)return 0;let r=b(e),i=b(t);return r===i?e<t?-1:+(e>t):r<i?-1:1}getRuntime(){return w}getArgs(){throw new S(x)}},b=e=>{if(e==null)return 0;switch(typeof e){case`number`:return 1;case`string`:return 2;case`boolean`:return 3;default:return 4}},x=`FormulaContext.getArgs() is only valid while a function body is running`,S=class extends Error{constructor(e=`Not implemented in StubbedFormulaContext`){super(e),this.name=`NotImplementedError`}},C=Object.freeze({colStart:0,rowStart:0,colEnd:2**14-1,rowEnd:2**20-1}),w={isDate1904:()=>!1,getLocale:()=>O.tag,getLocaleProfile:()=>O,isR1C1:()=>!1,getNow:()=>0,getLocation:()=>`unknown`,getVersion:()=>`1.0.0`,getOS:()=>`unknown`,getUser:()=>`unidentified`,getDescription:()=>`Stubbed Formula Context`},T=2958465,E=new y,D=class{constructor(){this._scope=E,this._argsFn=null}_setScope(e){this._scope=e??E}_getScope(){return this._scope}_setArgsProvider(e){this._argsFn=e}getNumberFormat(e,t){return this._getScope().getNumberFormat(e,t)}getEntireCoords(){return this._getScope().getEntireCoords()??C}parseAsSerialDate(e,t){return this._getScope().parseAsSerialDate(e,t)}parseAsDate(e,t){return this._getScope().parseAsDate(e,t)}parseAsNumber(e,t){return this._getScope().parseAsNumber(e,t)}createCriteria(e){return this._getScope().createCriteria(e)}parseAsLiteral(e){let t=this._getScope();return t.parseAsLiteral?t.parseAsLiteral(e):E.parseAsLiteral(e)}toText(e){return this._getScope().toText(e)}isValidDate(e,t=!1){return this._getScope().isValidDate(e,t)}fromSerialDate(e,t=!1){return this._getScope().fromSerialDate(e,t)}toSerialDate(e,t=!1){return this._getScope().toSerialDate(e,t)}getDateParts(e,t){return this._getScope().getDateParts(e,t)}getSerialDate(e,t,n,r=0,i=0,a=0,o=0){return this._getScope().getSerialDate(e,t,n,r,i,a,o)}getNow(){return this._getScope().getNow()}createRange(e,t,n){return this._getScope().createRange(e,t,n)}getRow(){return this._getScope().getRow?.()??0}getColumn(){return this._getScope().getColumn?.()??0}getReference(e,t){return this._getScope().getReference(e,t)}getResizedReference(e,t,n){return this._getScope().getResizedReference(e,t,n)}getValueAt(e,t,n){return this._getScope().getValueAt(e,t,n)}getFormulaAt(e,t,n){return this._getScope().getFormulaAt?.(e,t,n)??null}getSpillAt(e,t,n){return this._getScope().getSpillAt?.(e,t,n)??null}getSheetIndex(e){return this._getScope().getSheetIndex?.(e)??-1}getSheetCount(){return this._getScope().getSheetCount?.()??1}markVolatile(){this._getScope().markVolatile?.()}formatResults(e){this._getScope().formatResults?.(e)}filterHidden(e,t){return this._getScope().filterHidden?.(e,t)??e}filterTotals(e){return this._getScope().filterTotals?.(e)??e}getFunction(e){return this._getScope().getFunction?.(e)??null}getAddress(e,t){return this._getScope().getAddress(e,t)}compare(e,t,n){return this._getScope().compare?.(e,t,n)??E.compare(e,t,n)}getRuntime(){return this._getScope().getRuntime()}getArgs(){let e=this._argsFn,t=e?e():null;if(!t)throw new S(x);return t}get[Symbol.toStringTag](){return`[FormulaContext]`}toString(){return this._getScope()?.toString?.()??`{STUB SCOPE}`}},O=Object.freeze({tag:`en-US`,numberingSystem:`latn`,decimal:`.`,group:`,`,grouping:[3],minusSign:`-`,percentSign:`%`,permilleSign:`‰`,currencyCode:`USD`,currencySymbol:`$`,currencyDisplay:`symbol`,currencyPosition:`before`,currencySpacing:`tight`,date:Object.freeze({calendar:`gregory`,short:`M/d/yy`,medium:`MMM d, y`,long:`MMMM d, y`,timeShort:`h:mm a`,timeLong:`h:mm:ss a`,am:`AM`,pm:`PM`,firstDay:0,weekend:[6,0],monthsWide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthsAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],weekdaysWide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],weekdaysAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],hour12:!0}),listSeparator:`,`,csvDelimiter:`,`,rtl:!1,collator:Object.freeze({sensitivity:`base`,numeric:!0})}),k=new D;exports.CompatAliases=d,exports.CompatFeatures=u,exports.DEFAULT_LOCALE_PROFILE=O,exports.FormulaContext=k,Object.defineProperty(exports,"FormulaError",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"IRange",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"IRangeStats",{enumerable:!0,get:function(){return r}}),exports.InteropScalarType=o,exports.Observable=class{constructor(e){this._subscribeFn=e}subscribe(e,t,n){let r=typeof e==`object`?{next:e.next||(()=>{}),error:e.error||(()=>{}),complete:e.complete||(()=>{}),unsubscribe:()=>{}}:{next:e||(()=>{}),error:t||(()=>{}),complete:n||(()=>{}),unsubscribe:()=>{}},i=this._subscribeFn(r);return r.unsubscribe=()=>{typeof i==`function`&&i()},r}},Object.defineProperty(exports,"Scalar",{enumerable:!0,get:function(){return e}}),exports.ScalarType=a,exports.ScopedFormulaContext=D,exports.StubbedFormulaContext=y,exports.WildCard=l,exports.resolveCompatFeature=f,exports.resolveCompatFeatures=function(e){let t=f(e);if(t)return[t];let n=(e??``).trim().toLowerCase();for(let e of Object.keys(d))if(e.toLowerCase()===n)return d[e];return null};
|
|
1
|
+
var e;Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),function(e){e.MAX_TEXT_LENGTH=32767;let t=e.MAX_SIGNIFICANT_DIGITS=15;e.truncateNumberText=function(e){let n=e.length;if(n<=t)return e;let r=0,i=null;for(let a=0;a<n;a++){let n=e.charCodeAt(a);if(n>=48&&n<=57){if(r===0&&n===48)continue;r++,r>t&&((i??=e.split(``))[a]=`0`)}else if((n===69||n===101)&&r>0)break}return i===null?e:i.join(``)}}(e||={});var t,n,r,i,a={Number:`number`,String:`string`,Boolean:`boolean`,Error:`error`,RichData:`richData`,Null:`null`},o={...a,Date:`date`},s={...a,Reference:`reference`,Array:`array`,Lambda:`lambda`,Omitted:`omitted`},c=/[.*+?^${}()|[\]\\]/,l=e=>c.test(e)?`\\`+e:e,u={isWildCard:e=>typeof e==`string`&&/[*?]/.test(e),toRegex:(e,t,n=!1)=>{let r=``,i=e.length;for(let t=0;t<i;t++){let n=e[t];if(n===`~`){let n=e[t+1];n!==`*`&&n!==`?`&&n!==`~`||(r+=l(n),t++);continue}n===`*`?r+=`[\\s\\S]*`:r+=n===`?`?`[\\s\\S]`:l(n)}return RegExp(n===`start`?`^${r}`:n?`^${r}$`:r,t)}};(n=t||={}).Axis={Column:`column`,Row:`row`},n.AxisSelection={...t.Axis,Both:`both`},n.Direction={Up:`up`,Down:`down`,Left:`left`,Right:`right`},(r||={}).Aggregate={Count:`count`,NumericalCount:`numericalCount`,Sum:`sum`,Average:`average`,StdDev:`stdDev`,PopulationStdDev:`stdDevP`,Variance:`var`,PopulationVariance:`varP`,Min:`min`,Max:`max`},function(e){let t=e.Code={Parse:0,Null:1,Div0:2,Value:3,Ref:4,Name:5,Num:6,NA:7,GettingData:8,Spill:9,Connect:10,Blocked:11,Unknown:12,Field:13,Calc:14,Busy:16,Python:19,Timeout:20},n=e.Label={Parse:`#PARSE!`,Null:`#NULL!`,Div0:`#DIV/0!`,Value:`#VALUE!`,Ref:`#REF!`,Name:`#NAME?`,Num:`#NUM!`,NA:`#N/A`,GettingData:`#GETTING_DATA`,Spill:`#SPILL!`,Connect:`#CONNECT!`,Blocked:`#BLOCKED!`,Unknown:`#UNKNOWN!`,Field:`#FIELD!`,Calc:`#CALC!`,Busy:`#BUSY!`,Python:`#PYTHON!`,Timeout:`#TIMEOUT!`};class r extends Error{constructor(e,t,n,r){super(n,r),this._label=t,this._code=e,this.details=r}static{this.code=i.Code.Unknown}get isFormulaError(){return!0}getLabel(){return this._label}getCode(){return this._code}equals(e){return!!e&&(this._code===e._code||this._code===e.code)}get[Symbol.toStringTag](){return`[FormulaError]`}toString(){return this._label}}e.Known=r;class a extends r{constructor(e,r){super(t.Parse,n.Parse,e,r)}static{this.code=i.Code.Parse}getDetails(){let e=this.details;return{line:e?.line??1,column:e?.column??1,offset:e?.offset??0,length:e?.length??0}}}e.Parse=a;class o extends r{constructor(e,r){super(t.Null,n.Null,e,r)}static{this.code=i.Code.Null}}e.Null=o;class s extends r{constructor(e,r){super(t.Div0,n.Div0,e,r)}static{this.code=i.Code.Div0}}e.Div0=s;class c extends r{constructor(e,r){super(t.Value,n.Value,e,r)}static{this.code=i.Code.Value}}e.Value=c;class l extends r{constructor(e,r){super(t.Ref,n.Ref,e,r)}static{this.code=i.Code.Ref}}e.Ref=l;class u extends r{constructor(e,r){super(t.Name,n.Name,e,r)}static{this.code=i.Code.Name}}e.Name=u;class d extends r{constructor(e,r){super(t.Num,n.Num,e,r)}static{this.code=i.Code.Num}}e.Num=d;class f extends r{constructor(e,r){super(t.NA,n.NA,e,r)}static{this.code=i.Code.NA}}e.NA=f;class p extends r{constructor(e,r){super(t.GettingData,n.GettingData,e,r)}static{this.code=i.Code.GettingData}}e.GettingData=p;class m extends r{constructor(e,r){super(t.Spill,n.Spill,e,r)}static{this.code=i.Code.Spill}}e.Spill=m;class h extends r{constructor(e,r){super(t.Connect,n.Connect,e,r)}static{this.code=i.Code.Connect}}e.Connect=h;class g extends r{constructor(e,r){super(t.Blocked,n.Blocked,e,r)}static{this.code=i.Code.Blocked}}e.Blocked=g;class _ extends r{constructor(e,r){super(t.Unknown,n.Unknown,e,r)}static{this.code=i.Code.Unknown}}e.Unknown=_;class v extends r{constructor(e,r){super(t.Field,n.Field,e,r)}static{this.code=i.Code.Field}}e.Field=v;class y extends r{constructor(e,r){super(t.Calc,n.Calc,e,r)}static{this.code=i.Code.Calc}}e.Calc=y;class b extends r{constructor(e,r){super(t.Busy,n.Busy,e,r)}static{this.code=i.Code.Busy}}e.Busy=b;class x extends r{constructor(e,r){super(t.Python,n.Python,e,r)}static{this.code=i.Code.Python}}e.Python=x;class S extends r{constructor(e,r){super(t.Timeout,n.Timeout,e,r)}static{this.code=i.Code.Timeout}}e.Timeout=S}(i||={});var d={};d[i.Code.Parse]=i.Parse,d[i.Code.Null]=i.Null,d[i.Code.Div0]=i.Div0,d[i.Code.Value]=i.Value,d[i.Code.Ref]=i.Ref,d[i.Code.Name]=i.Name,d[i.Code.Num]=i.Num,d[i.Code.NA]=i.NA,d[i.Code.GettingData]=i.GettingData,d[i.Code.Spill]=i.Spill,d[i.Code.Connect]=i.Connect,d[i.Code.Blocked]=i.Blocked,d[i.Code.Unknown]=i.Unknown,d[i.Code.Field]=i.Field,d[i.Code.Calc]=i.Calc,d[i.Code.Busy]=i.Busy,d[i.Code.Python]=i.Python,d[i.Code.Timeout]=i.Timeout;var f=new Map,p=new Map,m=new Map,h=new Map,g=Object.keys(d);for(let e=0;e<g.length;e++){let t=d[g[e]],n=new t;m.set(n.getLabel(),t),h.set(n.getCode(),t),f.set(n.getLabel(),n),p.set(n.getCode(),n)}(function(e){let t=e.getBuiltInByCode=e=>p.get(e);e.BuiltIn={Parse:t(i.Code.Parse),Null:t(i.Code.Null),Div0:t(i.Code.Div0),Value:t(i.Code.Value),Ref:t(i.Code.Ref),Name:t(i.Code.Name),Num:t(i.Code.Num),NA:t(i.Code.NA),GettingData:t(i.Code.GettingData),Spill:t(i.Code.Spill),Connect:t(i.Code.Connect),Blocked:t(i.Code.Blocked),Unknown:t(i.Code.Unknown),Field:t(i.Code.Field),Calc:t(i.Code.Calc),Busy:t(i.Code.Busy),Python:t(i.Code.Python),Timeout:t(i.Code.Timeout)},e.newTypedError=(e,t,n)=>{let r;return r=typeof e==`string`?m.get(e):h.get(e),r||=i.Unknown,new r(t,n)},e.getBuiltInByLabel=e=>f.get(e),e.isError=function(e,t){return!!e&&!0===e.isFormulaError&&(t===void 0||e.getCode()===t)}})(i||={});var _=class{createRange(e,t,n){throw new b}flattenAreas(e){throw new b}getReference(e,t){throw new b}getResizedReference(e,t,n){throw new b}getNumberFormat(e,t){throw new b}fromSerialDate(e,t){throw new b}toSerialDate(e,t){throw new b}getDateParts(e,t){throw new b}getSerialDate(e,t,n,r,i,a,o){throw new b}getNow(){throw new b}getRandom(){return Math.random()}getValueAt(e,t,n,r){return null}getEntireCoords(){return x}isValidDate(e,t){return e instanceof Date||Object.prototype.toString.call(e)===`[object Date]`?!isNaN(e.getTime()):!t&&typeof e==`number`&&!(e<0||e>C)}getRow(){return 0}getColumn(){return 0}isImplicitIntersect(){return!1}getFormulaAt(e,t,n){return null}getSpillAt(e,t,n){return null}getSheetIndex(e){return-1}getSheetCount(){return 1}markVolatile(){}formatResults(e){}filterHidden(e,t){return e}filterTotals(e){return e}getFunction(e){return null}getAddress(e,t){throw new b}parseAsSerialDate(e,t){throw new b}parseAsDate(e,t){throw new b}parseAsNumber(e,t){throw new b}createCriteria(e,t){throw new b}parseAsLiteral(e){let t=e.toUpperCase();return t===`TRUE`||t!==`FALSE`&&i.getBuiltInByLabel(t)}toText(e){return typeof e==`string`?e:e==null?``:typeof e==`boolean`?e?`TRUE`:`FALSE`:e?.isFormulaError?e.getLabel():String(e)}compare(e,t,n){if(e===t)return 0;let r=v(e),i=v(t);return r===i?e<t?-1:+(e>t):r<i?-1:1}getRuntime(){return S}getArgs(){throw new b(y)}},v=e=>{if(e==null)return 0;switch(typeof e){case`number`:return 1;case`string`:return 2;case`boolean`:return 3;default:return 4}},y=`FormulaContext.getArgs() is only valid while a function body is running`,b=class extends Error{constructor(e=`Not implemented in StubbedFormulaContext`){super(e),this.name=`NotImplementedError`}},x=Object.freeze({colStart:0,rowStart:0,colEnd:2**14-1,rowEnd:2**20-1}),S={isDate1904:()=>!1,getLocale:()=>E.tag,getLocaleProfile:()=>E,isR1C1:()=>!1,getNow:()=>0,getRandom:()=>Math.random(),getLocation:()=>`unknown`,getVersion:()=>`1.0.0`,getOS:()=>`unknown`,getUser:()=>`unidentified`,getDescription:()=>`Stubbed Formula Context`},C=2958465,w=new _,T=class{constructor(){this._scope=w,this._argsFn=null}_setScope(e){this._scope=e??w}_getScope(){return this._scope}_setArgsProvider(e){this._argsFn=e}getNumberFormat(e,t){return this._getScope().getNumberFormat(e,t)}getEntireCoords(){return this._getScope().getEntireCoords()??x}parseAsSerialDate(e,t){return this._getScope().parseAsSerialDate(e,t)}parseAsDate(e,t){return this._getScope().parseAsDate(e,t)}parseAsNumber(e,t){return this._getScope().parseAsNumber(e,t)}createCriteria(e,t){return this._getScope().createCriteria(e,t)}parseAsLiteral(e){let t=this._getScope();return t.parseAsLiteral?t.parseAsLiteral(e):w.parseAsLiteral(e)}toText(e){return this._getScope().toText(e)}isValidDate(e,t=!1){return this._getScope().isValidDate(e,t)}fromSerialDate(e,t=!1){return this._getScope().fromSerialDate(e,t)}toSerialDate(e,t=!1){return this._getScope().toSerialDate(e,t)}getDateParts(e,t){return this._getScope().getDateParts(e,t)}getSerialDate(e,t,n,r=0,i=0,a=0,o=0){return this._getScope().getSerialDate(e,t,n,r,i,a,o)}getNow(){return this._getScope().getNow()}getRandom(){return this._getScope().getRandom?.()??Math.random()}createRange(e,t,n){return this._getScope().createRange(e,t,n)}flattenAreas(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let r=e[n],{rows:i,columns:a}=r.getShape();for(let e=0;e<i;e++)for(let n=0;n<a;n++)t.push(r.getValueAt(e,n))}return this.createRange(t.length,1,(e,n)=>t[n.rowIndex])}getRow(){return this._getScope().getRow?.()??0}getColumn(){return this._getScope().getColumn?.()??0}isImplicitIntersect(){return this._getScope().isImplicitIntersect?.()??!1}getReference(e,t){return this._getScope().getReference(e,t)}getResizedReference(e,t,n){return this._getScope().getResizedReference(e,t,n)}getValueAt(e,t,n){return this._getScope().getValueAt(e,t,n)}getFormulaAt(e,t,n){return this._getScope().getFormulaAt?.(e,t,n)??null}getSpillAt(e,t,n){return this._getScope().getSpillAt?.(e,t,n)??null}getSheetIndex(e){return this._getScope().getSheetIndex?.(e)??-1}getSheetCount(){return this._getScope().getSheetCount?.()??1}markVolatile(){this._getScope().markVolatile?.()}formatResults(e){this._getScope().formatResults?.(e)}filterHidden(e,t){return this._getScope().filterHidden?.(e,t)??e}filterTotals(e){return this._getScope().filterTotals?.(e)??e}getFunction(e){return this._getScope().getFunction?.(e)??null}getAddress(e,t){return this._getScope().getAddress(e,t)}compare(e,t,n){return this._getScope().compare?.(e,t,n)??w.compare(e,t,n)}getRuntime(){return this._getScope().getRuntime()}getArgs(){let e=this._argsFn,t=e?e():null;if(!t)throw new b(y);return t}get[Symbol.toStringTag](){return`[FormulaContext]`}toString(){return this._getScope()?.toString?.()??`{STUB SCOPE}`}},E=Object.freeze({tag:`en-US`,numberingSystem:`latn`,decimal:`.`,group:`,`,grouping:[3],minusSign:`-`,percentSign:`%`,permilleSign:`‰`,currencyCode:`USD`,currencySymbol:`$`,currencyDisplay:`symbol`,currencyPosition:`before`,currencySpacing:`tight`,date:Object.freeze({calendar:`gregory`,short:`M/d/yy`,medium:`MMM d, y`,long:`MMMM d, y`,timeShort:`h:mm a`,timeLong:`h:mm:ss a`,am:`AM`,pm:`PM`,firstDay:0,weekend:[6,0],monthsWide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthsAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],weekdaysWide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],weekdaysAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],hour12:!0}),listSeparator:`,`,csvDelimiter:`,`,rtl:!1,collator:Object.freeze({sensitivity:`base`,numeric:!0})}),D=new T;exports.DEFAULT_LOCALE_PROFILE=E,exports.FormulaContext=D,Object.defineProperty(exports,"FormulaError",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"IRange",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"IRangeStats",{enumerable:!0,get:function(){return r}}),exports.InteropScalarType=o,exports.Observable=class{constructor(e){this._subscribeFn=e}subscribe(e,t,n){let r=typeof e==`object`?{next:e.next||(()=>{}),error:e.error||(()=>{}),complete:e.complete||(()=>{}),unsubscribe:()=>{}}:{next:e||(()=>{}),error:t||(()=>{}),complete:n||(()=>{}),unsubscribe:()=>{}},i=this._subscribeFn(r);return r.unsubscribe=()=>{typeof i==`function`&&i()},r}},Object.defineProperty(exports,"Scalar",{enumerable:!0,get:function(){return e}}),exports.ScalarType=a,exports.ScopedFormulaContext=T,exports.StubbedFormulaContext=_,exports.ValueKind=s,exports.WildCard=u,exports.isLazyValue=e=>typeof e==`object`&&!!e&&!0===e.isLazy;
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.8.0-beta.3
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -32,7 +32,13 @@ var t, n, r, i, a = {
|
|
|
32
32
|
}, o = {
|
|
33
33
|
...a,
|
|
34
34
|
Date: "date"
|
|
35
|
-
}, s =
|
|
35
|
+
}, s = {
|
|
36
|
+
...a,
|
|
37
|
+
Reference: "reference",
|
|
38
|
+
Array: "array",
|
|
39
|
+
Lambda: "lambda",
|
|
40
|
+
Omitted: "omitted"
|
|
41
|
+
}, c = /[.*+?^${}()|[\]\\]/, l = (e) => c.test(e) ? "\\" + e : e, u = {
|
|
36
42
|
isWildCard: (e) => typeof e == "string" && /[*?]/.test(e),
|
|
37
43
|
toRegex: (e, t, n = !1) => {
|
|
38
44
|
let r = "", i = e.length;
|
|
@@ -40,30 +46,14 @@ var t, n, r, i, a = {
|
|
|
40
46
|
let n = e[t];
|
|
41
47
|
if (n === "~") {
|
|
42
48
|
let n = e[t + 1];
|
|
43
|
-
n
|
|
49
|
+
n !== "*" && n !== "?" && n !== "~" || (r += l(n), t++);
|
|
44
50
|
continue;
|
|
45
51
|
}
|
|
46
|
-
n === "*" ? r += "
|
|
47
|
-
}
|
|
48
|
-
return RegExp(n ? `^${r}$` : r, t);
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
noReferenceLift: "A multi-cell reference at a non-repeating scalar parameter is #VALUE! rather than a broadcast.",
|
|
52
|
-
noMemberFilter: "Members of a repeating scalar parameter are coerced rather than filtered; one that cannot be is #VALUE!."
|
|
53
|
-
}, d = { atp: ["noReferenceLift", "noMemberFilter"] };
|
|
54
|
-
function f(e) {
|
|
55
|
-
let t = p(e);
|
|
56
|
-
if (t) return [t];
|
|
57
|
-
let n = (e ?? "").trim().toLowerCase();
|
|
58
|
-
for (let e of Object.keys(d)) if (e.toLowerCase() === n) return d[e];
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
function p(e) {
|
|
62
|
-
if (!e) return null;
|
|
63
|
-
let t = e.trim().toLowerCase();
|
|
64
|
-
for (let e of Object.keys(u)) if (e.toLowerCase() === t) return e;
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
52
|
+
n === "*" ? r += "[\\s\\S]*" : r += n === "?" ? "[\\s\\S]" : l(n);
|
|
53
|
+
}
|
|
54
|
+
return RegExp(n === "start" ? `^${r}` : n ? `^${r}$` : r, t);
|
|
55
|
+
}
|
|
56
|
+
}, d = (e) => typeof e == "object" && !!e && !0 === e.isLazy;
|
|
67
57
|
(n = t ||= {}).Axis = {
|
|
68
58
|
Column: "column",
|
|
69
59
|
Row: "row"
|
|
@@ -325,15 +315,15 @@ function p(e) {
|
|
|
325
315
|
}
|
|
326
316
|
e.Timeout = S;
|
|
327
317
|
}(i ||= {});
|
|
328
|
-
var
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
for (let e = 0; e <
|
|
332
|
-
let t =
|
|
333
|
-
|
|
318
|
+
var f = {};
|
|
319
|
+
f[i.Code.Parse] = i.Parse, f[i.Code.Null] = i.Null, f[i.Code.Div0] = i.Div0, f[i.Code.Value] = i.Value, f[i.Code.Ref] = i.Ref, f[i.Code.Name] = i.Name, f[i.Code.Num] = i.Num, f[i.Code.NA] = i.NA, f[i.Code.GettingData] = i.GettingData, f[i.Code.Spill] = i.Spill, f[i.Code.Connect] = i.Connect, f[i.Code.Blocked] = i.Blocked, f[i.Code.Unknown] = i.Unknown, f[i.Code.Field] = i.Field, f[i.Code.Calc] = i.Calc, f[i.Code.Busy] = i.Busy, f[i.Code.Python] = i.Python, f[i.Code.Timeout] = i.Timeout;
|
|
320
|
+
var p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), _ = Object.keys(f);
|
|
321
|
+
for (let e = 0; e < _.length; e++) {
|
|
322
|
+
let t = f[_[e]], n = new t();
|
|
323
|
+
h.set(n.getLabel(), t), g.set(n.getCode(), t), p.set(n.getLabel(), n), m.set(n.getCode(), n);
|
|
334
324
|
}
|
|
335
325
|
(function(e) {
|
|
336
|
-
let t = e.getBuiltInByCode = (e) =>
|
|
326
|
+
let t = e.getBuiltInByCode = (e) => m.get(e);
|
|
337
327
|
e.BuiltIn = {
|
|
338
328
|
Parse: t(i.Code.Parse),
|
|
339
329
|
Null: t(i.Code.Null),
|
|
@@ -355,12 +345,12 @@ for (let e = 0; e < y.length; e++) {
|
|
|
355
345
|
Timeout: t(i.Code.Timeout)
|
|
356
346
|
}, e.newTypedError = (e, t, n) => {
|
|
357
347
|
let r;
|
|
358
|
-
return r = typeof e == "string" ?
|
|
359
|
-
}, e.getBuiltInByLabel = (e) =>
|
|
348
|
+
return r = typeof e == "string" ? h.get(e) : g.get(e), r ||= i.Unknown, new r(t, n);
|
|
349
|
+
}, e.getBuiltInByLabel = (e) => p.get(e), e.isError = function(e, t) {
|
|
360
350
|
return !!e && !0 === e.isFormulaError && (t === void 0 || e.getCode() === t);
|
|
361
351
|
};
|
|
362
352
|
})(i ||= {});
|
|
363
|
-
var
|
|
353
|
+
var v = class {
|
|
364
354
|
constructor(e) {
|
|
365
355
|
this._subscribeFn = e;
|
|
366
356
|
}
|
|
@@ -380,42 +370,48 @@ var b = class {
|
|
|
380
370
|
typeof i == "function" && i();
|
|
381
371
|
}, r;
|
|
382
372
|
}
|
|
383
|
-
},
|
|
373
|
+
}, y = class {
|
|
384
374
|
createRange(e, t, n) {
|
|
385
|
-
throw new
|
|
375
|
+
throw new S();
|
|
376
|
+
}
|
|
377
|
+
flattenAreas(e) {
|
|
378
|
+
throw new S();
|
|
386
379
|
}
|
|
387
380
|
getReference(e, t) {
|
|
388
|
-
throw new
|
|
381
|
+
throw new S();
|
|
389
382
|
}
|
|
390
383
|
getResizedReference(e, t, n) {
|
|
391
|
-
throw new
|
|
384
|
+
throw new S();
|
|
392
385
|
}
|
|
393
386
|
getNumberFormat(e, t) {
|
|
394
|
-
throw new
|
|
387
|
+
throw new S();
|
|
395
388
|
}
|
|
396
389
|
fromSerialDate(e, t) {
|
|
397
|
-
throw new
|
|
390
|
+
throw new S();
|
|
398
391
|
}
|
|
399
392
|
toSerialDate(e, t) {
|
|
400
|
-
throw new
|
|
393
|
+
throw new S();
|
|
401
394
|
}
|
|
402
395
|
getDateParts(e, t) {
|
|
403
|
-
throw new
|
|
396
|
+
throw new S();
|
|
404
397
|
}
|
|
405
398
|
getSerialDate(e, t, n, r, i, a, o) {
|
|
406
|
-
throw new
|
|
399
|
+
throw new S();
|
|
407
400
|
}
|
|
408
401
|
getNow() {
|
|
409
|
-
throw new
|
|
402
|
+
throw new S();
|
|
403
|
+
}
|
|
404
|
+
getRandom() {
|
|
405
|
+
return Math.random();
|
|
410
406
|
}
|
|
411
407
|
getValueAt(e, t, n, r) {
|
|
412
408
|
return null;
|
|
413
409
|
}
|
|
414
410
|
getEntireCoords() {
|
|
415
|
-
return
|
|
411
|
+
return C;
|
|
416
412
|
}
|
|
417
413
|
isValidDate(e, t) {
|
|
418
|
-
return e instanceof Date || Object.prototype.toString.call(e) === "[object Date]" ? !isNaN(e.getTime()) : !t && typeof e == "number" && !(e < 0 || e >
|
|
414
|
+
return e instanceof Date || Object.prototype.toString.call(e) === "[object Date]" ? !isNaN(e.getTime()) : !t && typeof e == "number" && !(e < 0 || e > T);
|
|
419
415
|
}
|
|
420
416
|
getRow() {
|
|
421
417
|
return 0;
|
|
@@ -423,6 +419,9 @@ var b = class {
|
|
|
423
419
|
getColumn() {
|
|
424
420
|
return 0;
|
|
425
421
|
}
|
|
422
|
+
isImplicitIntersect() {
|
|
423
|
+
return !1;
|
|
424
|
+
}
|
|
426
425
|
getFormulaAt(e, t, n) {
|
|
427
426
|
return null;
|
|
428
427
|
}
|
|
@@ -447,19 +446,19 @@ var b = class {
|
|
|
447
446
|
return null;
|
|
448
447
|
}
|
|
449
448
|
getAddress(e, t) {
|
|
450
|
-
throw new
|
|
449
|
+
throw new S();
|
|
451
450
|
}
|
|
452
451
|
parseAsSerialDate(e, t) {
|
|
453
|
-
throw new
|
|
452
|
+
throw new S();
|
|
454
453
|
}
|
|
455
454
|
parseAsDate(e, t) {
|
|
456
|
-
throw new
|
|
455
|
+
throw new S();
|
|
457
456
|
}
|
|
458
457
|
parseAsNumber(e, t) {
|
|
459
|
-
throw new
|
|
458
|
+
throw new S();
|
|
460
459
|
}
|
|
461
|
-
createCriteria(e) {
|
|
462
|
-
throw new
|
|
460
|
+
createCriteria(e, t) {
|
|
461
|
+
throw new S();
|
|
463
462
|
}
|
|
464
463
|
parseAsLiteral(e) {
|
|
465
464
|
let t = e.toUpperCase();
|
|
@@ -470,16 +469,16 @@ var b = class {
|
|
|
470
469
|
}
|
|
471
470
|
compare(e, t, n) {
|
|
472
471
|
if (e === t) return 0;
|
|
473
|
-
let r =
|
|
472
|
+
let r = b(e), i = b(t);
|
|
474
473
|
return r === i ? e < t ? -1 : +(e > t) : r < i ? -1 : 1;
|
|
475
474
|
}
|
|
476
475
|
getRuntime() {
|
|
477
|
-
return
|
|
476
|
+
return w;
|
|
478
477
|
}
|
|
479
478
|
getArgs() {
|
|
480
|
-
throw new
|
|
479
|
+
throw new S(x);
|
|
481
480
|
}
|
|
482
|
-
},
|
|
481
|
+
}, b = (e) => {
|
|
483
482
|
if (e == null) return 0;
|
|
484
483
|
switch (typeof e) {
|
|
485
484
|
case "number": return 1;
|
|
@@ -487,32 +486,33 @@ var b = class {
|
|
|
487
486
|
case "boolean": return 3;
|
|
488
487
|
default: return 4;
|
|
489
488
|
}
|
|
490
|
-
},
|
|
489
|
+
}, x = "FormulaContext.getArgs() is only valid while a function body is running", S = class extends Error {
|
|
491
490
|
constructor(e = "Not implemented in StubbedFormulaContext") {
|
|
492
491
|
super(e), this.name = "NotImplementedError";
|
|
493
492
|
}
|
|
494
|
-
},
|
|
493
|
+
}, C = Object.freeze({
|
|
495
494
|
colStart: 0,
|
|
496
495
|
rowStart: 0,
|
|
497
496
|
colEnd: 2 ** 14 - 1,
|
|
498
497
|
rowEnd: 2 ** 20 - 1
|
|
499
|
-
}),
|
|
498
|
+
}), w = {
|
|
500
499
|
isDate1904: () => !1,
|
|
501
|
-
getLocale: () =>
|
|
502
|
-
getLocaleProfile: () =>
|
|
500
|
+
getLocale: () => O.tag,
|
|
501
|
+
getLocaleProfile: () => O,
|
|
503
502
|
isR1C1: () => !1,
|
|
504
503
|
getNow: () => 0,
|
|
504
|
+
getRandom: () => Math.random(),
|
|
505
505
|
getLocation: () => "unknown",
|
|
506
506
|
getVersion: () => "1.0.0",
|
|
507
507
|
getOS: () => "unknown",
|
|
508
508
|
getUser: () => "unidentified",
|
|
509
509
|
getDescription: () => "Stubbed Formula Context"
|
|
510
|
-
},
|
|
510
|
+
}, T = 2958465, E = new y(), D = class {
|
|
511
511
|
constructor() {
|
|
512
|
-
this._scope =
|
|
512
|
+
this._scope = E, this._argsFn = null;
|
|
513
513
|
}
|
|
514
514
|
_setScope(e) {
|
|
515
|
-
this._scope = e ??
|
|
515
|
+
this._scope = e ?? E;
|
|
516
516
|
}
|
|
517
517
|
_getScope() {
|
|
518
518
|
return this._scope;
|
|
@@ -524,7 +524,7 @@ var b = class {
|
|
|
524
524
|
return this._getScope().getNumberFormat(e, t);
|
|
525
525
|
}
|
|
526
526
|
getEntireCoords() {
|
|
527
|
-
return this._getScope().getEntireCoords() ??
|
|
527
|
+
return this._getScope().getEntireCoords() ?? C;
|
|
528
528
|
}
|
|
529
529
|
parseAsSerialDate(e, t) {
|
|
530
530
|
return this._getScope().parseAsSerialDate(e, t);
|
|
@@ -535,12 +535,12 @@ var b = class {
|
|
|
535
535
|
parseAsNumber(e, t) {
|
|
536
536
|
return this._getScope().parseAsNumber(e, t);
|
|
537
537
|
}
|
|
538
|
-
createCriteria(e) {
|
|
539
|
-
return this._getScope().createCriteria(e);
|
|
538
|
+
createCriteria(e, t) {
|
|
539
|
+
return this._getScope().createCriteria(e, t);
|
|
540
540
|
}
|
|
541
541
|
parseAsLiteral(e) {
|
|
542
542
|
let t = this._getScope();
|
|
543
|
-
return t.parseAsLiteral ? t.parseAsLiteral(e) :
|
|
543
|
+
return t.parseAsLiteral ? t.parseAsLiteral(e) : E.parseAsLiteral(e);
|
|
544
544
|
}
|
|
545
545
|
toText(e) {
|
|
546
546
|
return this._getScope().toText(e);
|
|
@@ -563,15 +563,30 @@ var b = class {
|
|
|
563
563
|
getNow() {
|
|
564
564
|
return this._getScope().getNow();
|
|
565
565
|
}
|
|
566
|
+
getRandom() {
|
|
567
|
+
return this._getScope().getRandom?.() ?? Math.random();
|
|
568
|
+
}
|
|
566
569
|
createRange(e, t, n) {
|
|
567
570
|
return this._getScope().createRange(e, t, n);
|
|
568
571
|
}
|
|
572
|
+
flattenAreas(e) {
|
|
573
|
+
if (!Array.isArray(e)) return e;
|
|
574
|
+
let t = [];
|
|
575
|
+
for (let n = 0; n < e.length; n++) {
|
|
576
|
+
let r = e[n], { rows: i, columns: a } = r.getShape();
|
|
577
|
+
for (let e = 0; e < i; e++) for (let n = 0; n < a; n++) t.push(r.getValueAt(e, n));
|
|
578
|
+
}
|
|
579
|
+
return this.createRange(t.length, 1, (e, n) => t[n.rowIndex]);
|
|
580
|
+
}
|
|
569
581
|
getRow() {
|
|
570
582
|
return this._getScope().getRow?.() ?? 0;
|
|
571
583
|
}
|
|
572
584
|
getColumn() {
|
|
573
585
|
return this._getScope().getColumn?.() ?? 0;
|
|
574
586
|
}
|
|
587
|
+
isImplicitIntersect() {
|
|
588
|
+
return this._getScope().isImplicitIntersect?.() ?? !1;
|
|
589
|
+
}
|
|
575
590
|
getReference(e, t) {
|
|
576
591
|
return this._getScope().getReference(e, t);
|
|
577
592
|
}
|
|
@@ -612,14 +627,14 @@ var b = class {
|
|
|
612
627
|
return this._getScope().getAddress(e, t);
|
|
613
628
|
}
|
|
614
629
|
compare(e, t, n) {
|
|
615
|
-
return this._getScope().compare?.(e, t, n) ??
|
|
630
|
+
return this._getScope().compare?.(e, t, n) ?? E.compare(e, t, n);
|
|
616
631
|
}
|
|
617
632
|
getRuntime() {
|
|
618
633
|
return this._getScope().getRuntime();
|
|
619
634
|
}
|
|
620
635
|
getArgs() {
|
|
621
636
|
let e = this._argsFn, t = e ? e() : null;
|
|
622
|
-
if (!t) throw new
|
|
637
|
+
if (!t) throw new S(x);
|
|
623
638
|
return t;
|
|
624
639
|
}
|
|
625
640
|
get [Symbol.toStringTag]() {
|
|
@@ -628,7 +643,7 @@ var b = class {
|
|
|
628
643
|
toString() {
|
|
629
644
|
return this._getScope()?.toString?.() ?? "{STUB SCOPE}";
|
|
630
645
|
}
|
|
631
|
-
},
|
|
646
|
+
}, O = Object.freeze({
|
|
632
647
|
tag: "en-US",
|
|
633
648
|
numberingSystem: "latn",
|
|
634
649
|
decimal: ".",
|
|
@@ -708,5 +723,5 @@ var b = class {
|
|
|
708
723
|
sensitivity: "base",
|
|
709
724
|
numeric: !0
|
|
710
725
|
})
|
|
711
|
-
}),
|
|
712
|
-
export {
|
|
726
|
+
}), k = new D();
|
|
727
|
+
export { O as DEFAULT_LOCALE_PROFILE, k as FormulaContext, i as FormulaError, t as IRange, r as IRangeStats, o as InteropScalarType, v as Observable, e as Scalar, a as ScalarType, D as ScopedFormulaContext, y as StubbedFormulaContext, s as ValueKind, u as WildCard, d as isLazyValue };
|