@toclocoinc/lattice-grid 1.9.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/docs/API.html +330 -3
- package/lattice-grid.d.ts +255 -4
- package/lattice-grid.esm.min.js +1169 -104
- package/lattice-grid.min.cjs +1166 -104
- package/lattice-grid.min.css +1 -1
- package/lattice-grid.min.js +1166 -104
- package/modules/charts.esm.min.js +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/dhtmlx-compat.esm.min.js +1166 -104
- package/modules/htmx.esm.min.js +874 -39
- package/modules/htmx.min.cjs +874 -39
- package/modules/htmx.min.js +874 -39
- package/modules/react.esm.min.js +1 -1
- package/modules/svelte.esm.min.js +1 -1
- package/modules/vue.esm.min.js +1 -1
- package/modules/webcomponent.esm.min.js +1166 -104
- package/package.json +1 -1
package/lattice-grid.min.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.11.0 — core + DOM renderer
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
@@ -12819,7 +12819,10 @@ this.invalidate('filter');
|
|
|
12819
12819
|
}else{
|
|
12820
12820
|
this.invalidate('total');
|
|
12821
12821
|
}
|
|
12822
|
-
this.#emit('rows:changed',{
|
|
12822
|
+
this.#emit('rows:changed',{
|
|
12823
|
+
companion:true,
|
|
12824
|
+
added:result.added.length,updated:result.updated.length,removed:result.removed.length,
|
|
12825
|
+
});
|
|
12823
12826
|
return result;
|
|
12824
12827
|
}
|
|
12825
12828
|
groupHeadingsAt(index){
|
|
@@ -12856,7 +12859,9 @@ this.#dropTotalState();
|
|
|
12856
12859
|
this.#handles.invalidate();
|
|
12857
12860
|
this.#view=null;
|
|
12858
12861
|
this.invalidate('filter');
|
|
12859
|
-
this.#emit('rows:changed',{
|
|
12862
|
+
this.#emit('rows:changed',{
|
|
12863
|
+
companion:true,added:0,updated:0,removed:0,moved:1,
|
|
12864
|
+
});
|
|
12860
12865
|
return true;
|
|
12861
12866
|
}
|
|
12862
12867
|
reload(_opts){
|
|
@@ -13052,6 +13057,15 @@ return out;
|
|
|
13052
13057
|
facetIndices(colId){
|
|
13053
13058
|
return this.#runFilter(colId||null);
|
|
13054
13059
|
}
|
|
13060
|
+
facetRows(colId){
|
|
13061
|
+
const indices=this.facetIndices(colId);
|
|
13062
|
+
const out=[];
|
|
13063
|
+
for(let i=0;i<indices.length;i++){
|
|
13064
|
+
const row=this.#leafRow(indices[i]);
|
|
13065
|
+
if(row)out.push(row);
|
|
13066
|
+
}
|
|
13067
|
+
return out;
|
|
13068
|
+
}
|
|
13055
13069
|
invalidateRows(){
|
|
13056
13070
|
this.#rowCache.clear();
|
|
13057
13071
|
this.#quickText.clear();
|
|
@@ -15049,6 +15063,759 @@ if(isFunction(emit))emit(type,payload);
|
|
|
15049
15063
|
}
|
|
15050
15064
|
}
|
|
15051
15065
|
});
|
|
15066
|
+
__def("packages/core/src/source/derive.js",function(__exports,__req){
|
|
15067
|
+
'use strict';
|
|
15068
|
+
Object.defineProperty(__exports,"FOLLOW_MODES",{enumerable:true,get:function(){return FOLLOW_MODES;}});
|
|
15069
|
+
Object.defineProperty(__exports,"BUCKETS",{enumerable:true,get:function(){return BUCKETS;}});
|
|
15070
|
+
Object.defineProperty(__exports,"DERIVED_ROW_KEY",{enumerable:true,get:function(){return DERIVED_ROW_KEY;}});
|
|
15071
|
+
Object.defineProperty(__exports,"readPath",{enumerable:true,get:function(){return readPath;}});
|
|
15072
|
+
Object.defineProperty(__exports,"unnest",{enumerable:true,get:function(){return unnest;}});
|
|
15073
|
+
Object.defineProperty(__exports,"bucketOf",{enumerable:true,get:function(){return bucketOf;}});
|
|
15074
|
+
Object.defineProperty(__exports,"reduceValues",{enumerable:true,get:function(){return reduceValues;}});
|
|
15075
|
+
Object.defineProperty(__exports,"applyLimit",{enumerable:true,get:function(){return applyLimit;}});
|
|
15076
|
+
Object.defineProperty(__exports,"applyCumulative",{enumerable:true,get:function(){return applyCumulative;}});
|
|
15077
|
+
Object.defineProperty(__exports,"groupRows",{enumerable:true,get:function(){return groupRows;}});
|
|
15078
|
+
Object.defineProperty(__exports,"finishGroups",{enumerable:true,get:function(){return finishGroups;}});
|
|
15079
|
+
Object.defineProperty(__exports,"derive",{enumerable:true,get:function(){return derive;}});
|
|
15080
|
+
Object.defineProperty(__exports,"joinRows",{enumerable:true,get:function(){return joinRows;}});
|
|
15081
|
+
Object.defineProperty(__exports,"preGroup",{enumerable:true,get:function(){return preGroup;}});
|
|
15082
|
+
Object.defineProperty(__exports,"buildJoinIndex",{enumerable:true,get:function(){return buildJoinIndex;}});
|
|
15083
|
+
Object.defineProperty(__exports,"joinOne",{enumerable:true,get:function(){return joinOne;}});
|
|
15084
|
+
Object.defineProperty(__exports,"joinKeyOf",{enumerable:true,get:function(){return joinKeyOf;}});
|
|
15085
|
+
const __m0=__req("packages/core/src/internal/util.js");
|
|
15086
|
+
const isFunction=__m0["isFunction"];
|
|
15087
|
+
const isObject=__m0["isObject"];
|
|
15088
|
+
const __m1=__req("packages/core/src/compute/total.js");
|
|
15089
|
+
const TOTAL_FNS=__m1["TOTAL_FNS"];
|
|
15090
|
+
const FOLLOW_MODES=Object.freeze(['filtered','all','selected','grouped']);
|
|
15091
|
+
const BUCKETS=Object.freeze(['day','week','month','quarter','year']);
|
|
15092
|
+
const DERIVED_ROW_KEY='__key';
|
|
15093
|
+
function readPath(obj,path){
|
|
15094
|
+
if(!isObject(obj)||typeof path!=='string')return undefined;
|
|
15095
|
+
if(!path.includes('.'))return(obj)[path];
|
|
15096
|
+
let cursor=(obj);
|
|
15097
|
+
for(const part of path.split('.')){
|
|
15098
|
+
if(!isObject(cursor))return undefined;
|
|
15099
|
+
cursor=(cursor)[part];
|
|
15100
|
+
}
|
|
15101
|
+
return cursor;
|
|
15102
|
+
}
|
|
15103
|
+
function unnest(rows,path){
|
|
15104
|
+
const out=[];
|
|
15105
|
+
for(const row of rows){
|
|
15106
|
+
const list=readPath(row,path);
|
|
15107
|
+
if(!Array.isArray(list)||!list.length)continue;
|
|
15108
|
+
for(const item of list)out.push({...((row)),[path]:item});
|
|
15109
|
+
}
|
|
15110
|
+
return out;
|
|
15111
|
+
}
|
|
15112
|
+
function bucketOf(value,by){
|
|
15113
|
+
const at=value instanceof Date?value:new Date((value));
|
|
15114
|
+
const time=at.getTime();
|
|
15115
|
+
if(!Number.isFinite(time))return null;
|
|
15116
|
+
const y=at.getUTCFullYear();
|
|
15117
|
+
const m=at.getUTCMonth();
|
|
15118
|
+
const d=at.getUTCDate();
|
|
15119
|
+
const iso=(date)=>date.toISOString().slice(0,10);
|
|
15120
|
+
switch(by){
|
|
15121
|
+
case'year':return iso(new Date(Date.UTC(y,0,1)));
|
|
15122
|
+
case'quarter':return iso(new Date(Date.UTC(y,Math.floor(m/3)*3,1)));
|
|
15123
|
+
case'month':return iso(new Date(Date.UTC(y,m,1)));
|
|
15124
|
+
case'week':{
|
|
15125
|
+
const day=(at.getUTCDay()+6)%7;
|
|
15126
|
+
return iso(new Date(Date.UTC(y,m,d-day)));
|
|
15127
|
+
}
|
|
15128
|
+
default:return iso(new Date(Date.UTC(y,m,d)));
|
|
15129
|
+
}
|
|
15130
|
+
}
|
|
15131
|
+
function groupKeyOf(row,by,bucket){
|
|
15132
|
+
const values=by.map((path)=>(
|
|
15133
|
+
bucket&&bucket.of===path?bucketOf(readPath(row,path),bucket.by):readPath(row,path)
|
|
15134
|
+
));
|
|
15135
|
+
return{key:values.map((v)=>(v===undefined||v===null?'\u0000':String(v))).join('\u001f'),values};
|
|
15136
|
+
}
|
|
15137
|
+
function reduceValues(values,fn){
|
|
15138
|
+
const kernel=TOTAL_FNS[fn];
|
|
15139
|
+
if(!kernel)return null;
|
|
15140
|
+
return kernel({get:(i)=>values[i]},ROW_INDICES(values.length));
|
|
15141
|
+
}
|
|
15142
|
+
function reduceGroup(rows,select){
|
|
15143
|
+
const out={};
|
|
15144
|
+
const indices=ROW_INDICES(rows.length);
|
|
15145
|
+
for(const[id,spec]of Object.entries(select)){
|
|
15146
|
+
const fn=spec.fn||'count';
|
|
15147
|
+
const kernel=TOTAL_FNS[fn];
|
|
15148
|
+
if(!kernel){out[id]=null;continue;}
|
|
15149
|
+
const values=spec.of?rows.map((row)=>readPath(row,spec.of)):[];
|
|
15150
|
+
out[id]=kernel({get:(i)=>values[i]},indices);
|
|
15151
|
+
}
|
|
15152
|
+
return out;
|
|
15153
|
+
}
|
|
15154
|
+
const ROW_INDICES=(()=>{
|
|
15155
|
+
const cache=new Map();
|
|
15156
|
+
return(n)=>{
|
|
15157
|
+
let hit=cache.get(n);
|
|
15158
|
+
if(!hit){
|
|
15159
|
+
hit=new Uint32Array(n);
|
|
15160
|
+
for(let i=0;i<n;i++)hit[i]=i;
|
|
15161
|
+
if(cache.size<512)cache.set(n,hit);
|
|
15162
|
+
}
|
|
15163
|
+
return hit;
|
|
15164
|
+
};
|
|
15165
|
+
})();
|
|
15166
|
+
function applyLimit(rows,limit,per){
|
|
15167
|
+
if(!Number.isFinite(limit)||limit<=0)return rows;
|
|
15168
|
+
if(!per)return rows.slice(0,limit);
|
|
15169
|
+
const seen=new Map();
|
|
15170
|
+
const out=[];
|
|
15171
|
+
for(const row of rows){
|
|
15172
|
+
const key=String(readPath(row,per));
|
|
15173
|
+
const taken=seen.get(key)||0;
|
|
15174
|
+
if(taken>=limit)continue;
|
|
15175
|
+
seen.set(key,taken+1);
|
|
15176
|
+
out.push(row);
|
|
15177
|
+
}
|
|
15178
|
+
return out;
|
|
15179
|
+
}
|
|
15180
|
+
function applyCumulative(rows,spec){
|
|
15181
|
+
const total=rows.reduce((sum,row)=>sum+(Number(readPath(row,spec.of))||0),0);
|
|
15182
|
+
if(!total)return rows;
|
|
15183
|
+
const cutoff=total*spec.upTo;
|
|
15184
|
+
let running=0;
|
|
15185
|
+
const out=[];
|
|
15186
|
+
for(const row of rows){
|
|
15187
|
+
out.push(row);
|
|
15188
|
+
running+=Number(readPath(row,spec.of))||0;
|
|
15189
|
+
if(running>=cutoff)break;
|
|
15190
|
+
}
|
|
15191
|
+
return out;
|
|
15192
|
+
}
|
|
15193
|
+
function sortRows(rows,spec){
|
|
15194
|
+
if(!Array.isArray(spec)||!spec.length)return rows;
|
|
15195
|
+
return[...rows].sort((a,b)=>{
|
|
15196
|
+
for(const entry of spec){
|
|
15197
|
+
const av=readPath(a,entry.col);
|
|
15198
|
+
const bv=readPath(b,entry.col);
|
|
15199
|
+
if(av===bv)continue;
|
|
15200
|
+
if(av===null||av===undefined)return 1;
|
|
15201
|
+
if(bv===null||bv===undefined)return-1;
|
|
15202
|
+
const less=typeof av==='number'&&typeof bv==='number'
|
|
15203
|
+
?av<bv
|
|
15204
|
+
:String(av)<String(bv);
|
|
15205
|
+
return(less?-1:1)*(entry.dir==='desc'?-1:1);
|
|
15206
|
+
}
|
|
15207
|
+
return 0;
|
|
15208
|
+
});
|
|
15209
|
+
}
|
|
15210
|
+
function groupRows(rows,spec,keyOf){
|
|
15211
|
+
const by=spec.groupBy
|
|
15212
|
+
?(Array.isArray(spec.groupBy)?spec.groupBy:[spec.groupBy])
|
|
15213
|
+
:null;
|
|
15214
|
+
const bucket=isObject(spec.bucket)?spec.bucket:null;
|
|
15215
|
+
const groups=new Map();
|
|
15216
|
+
const rowGroup=new Map();
|
|
15217
|
+
if(!by)return{groups,rowGroup};
|
|
15218
|
+
for(const row of rows){
|
|
15219
|
+
const{key,values}=groupKeyOf(row,by,bucket);
|
|
15220
|
+
let group=groups.get(key);
|
|
15221
|
+
if(!group){group={values,rows:new Map()};groups.set(key,group);}
|
|
15222
|
+
const rowKey=keyOf(row);
|
|
15223
|
+
group.rows.set(rowKey,row);
|
|
15224
|
+
rowGroup.set(rowKey,key);
|
|
15225
|
+
}
|
|
15226
|
+
return{groups,rowGroup};
|
|
15227
|
+
}
|
|
15228
|
+
function finishGroups(groups,spec,cache=null,dirty=null){
|
|
15229
|
+
const by=Array.isArray(spec.groupBy)?spec.groupBy:[spec.groupBy];
|
|
15230
|
+
let out=[...groups.entries()].map(([key,group])=>{
|
|
15231
|
+
if(cache&&dirty&&!dirty.has(key)){
|
|
15232
|
+
const kept=cache.get(key);
|
|
15233
|
+
if(kept)return kept;
|
|
15234
|
+
}
|
|
15235
|
+
const row={[DERIVED_ROW_KEY]:key};
|
|
15236
|
+
by.forEach((path,i)=>{
|
|
15237
|
+
row[path.includes('.')?path.split('.').pop():path]=group.values[i];
|
|
15238
|
+
});
|
|
15239
|
+
Object.assign(row,reduceGroup([...group.rows.values()],spec.select||{}));
|
|
15240
|
+
if(cache)cache.set(key,row);
|
|
15241
|
+
return row;
|
|
15242
|
+
});
|
|
15243
|
+
out=sortRows(out,spec.sort);
|
|
15244
|
+
if(isObject(spec.cumulative))out=applyCumulative(out,spec.cumulative);
|
|
15245
|
+
return applyLimit(out,spec.limit,spec.limitPer||null);
|
|
15246
|
+
}
|
|
15247
|
+
function derive(rows,spec){
|
|
15248
|
+
const working=preGroup(rows,spec);
|
|
15249
|
+
const by=spec.groupBy
|
|
15250
|
+
?(Array.isArray(spec.groupBy)?spec.groupBy:[spec.groupBy])
|
|
15251
|
+
:null;
|
|
15252
|
+
const bucket=isObject(spec.bucket)?spec.bucket:null;
|
|
15253
|
+
let out;
|
|
15254
|
+
if(!by){
|
|
15255
|
+
out=working.map((row,i)=>({
|
|
15256
|
+
...((row)),
|
|
15257
|
+
[DERIVED_ROW_KEY]:String(readPath(row,spec.rowKey||'id')??i),
|
|
15258
|
+
}));
|
|
15259
|
+
}else{
|
|
15260
|
+
const groups=new Map();
|
|
15261
|
+
for(const row of working){
|
|
15262
|
+
const{key,values}=groupKeyOf(row,by,bucket);
|
|
15263
|
+
let bucketed=groups.get(key);
|
|
15264
|
+
if(!bucketed){bucketed={values,rows:[]};groups.set(key,bucketed);}
|
|
15265
|
+
bucketed.rows.push(row);
|
|
15266
|
+
}
|
|
15267
|
+
out=[...groups.entries()].map(([key,group])=>{
|
|
15268
|
+
const row={[DERIVED_ROW_KEY]:key};
|
|
15269
|
+
by.forEach((path,i)=>{row[path.includes('.')?path.split('.').pop():path]=group.values[i];});
|
|
15270
|
+
Object.assign(row,reduceGroup(group.rows,spec.select||{}));
|
|
15271
|
+
return row;
|
|
15272
|
+
});
|
|
15273
|
+
}
|
|
15274
|
+
out=sortRows(out,spec.sort);
|
|
15275
|
+
if(isObject(spec.cumulative))out=applyCumulative(out,spec.cumulative);
|
|
15276
|
+
return applyLimit(out,spec.limit,spec.limitPer||null);
|
|
15277
|
+
}
|
|
15278
|
+
function joinRows(rows,spec){
|
|
15279
|
+
const on=spec.on;
|
|
15280
|
+
const leftKey=isObject(on)?String(on.left||on.right||''):String(on||'');
|
|
15281
|
+
const rightKey=isObject(on)?String(on.right||on.left||''):String(on||'');
|
|
15282
|
+
if(!leftKey||!rightKey)return(rows);
|
|
15283
|
+
const index=spec.index instanceof Map
|
|
15284
|
+
?spec.index
|
|
15285
|
+
:buildJoinIndex(Array.isArray(spec.rows)?spec.rows:[],rightKey);
|
|
15286
|
+
const fields=Array.isArray(spec.select)?spec.select.map(String):null;
|
|
15287
|
+
const prefix=spec.prefix?String(spec.prefix):'';
|
|
15288
|
+
const keep=String(spec.type||'inner')==='left';
|
|
15289
|
+
const out=[];
|
|
15290
|
+
for(const row of rows){
|
|
15291
|
+
const value=readPath(row,leftKey);
|
|
15292
|
+
const match=value==null?undefined:index.get(String(value));
|
|
15293
|
+
if(!match){if(keep)out.push((row));continue;}
|
|
15294
|
+
const merged={...((row))};
|
|
15295
|
+
const names=fields||Object.keys(match);
|
|
15296
|
+
for(const name of names){
|
|
15297
|
+
if(!prefix&&name===leftKey)continue;
|
|
15298
|
+
merged[prefix?prefix+name:name]=readPath(match,name);
|
|
15299
|
+
}
|
|
15300
|
+
out.push(merged);
|
|
15301
|
+
}
|
|
15302
|
+
return out;
|
|
15303
|
+
}
|
|
15304
|
+
function preGroup(rows,spec){
|
|
15305
|
+
let working=Array.isArray(rows)?rows:[];
|
|
15306
|
+
if(spec.unnest)working=unnest(working,spec.unnest);
|
|
15307
|
+
if(isObject(spec.join)&&(Array.isArray(spec.join.rows)||spec.join.index instanceof Map)){
|
|
15308
|
+
working=joinRows(working,spec.join);
|
|
15309
|
+
}
|
|
15310
|
+
if(isFunction(spec.where))working=working.filter((row)=>!!spec.where(row));
|
|
15311
|
+
return working;
|
|
15312
|
+
}
|
|
15313
|
+
function buildJoinIndex(rows,rightKey){
|
|
15314
|
+
const index=new Map();
|
|
15315
|
+
for(const row of rows){
|
|
15316
|
+
const value=readPath(row,rightKey);
|
|
15317
|
+
if(value==null)continue;
|
|
15318
|
+
const key=String(value);
|
|
15319
|
+
if(!index.has(key))index.set(key,(row));
|
|
15320
|
+
}
|
|
15321
|
+
return index;
|
|
15322
|
+
}
|
|
15323
|
+
function joinOne(row,spec){
|
|
15324
|
+
const on=spec.on;
|
|
15325
|
+
const leftKey=isObject(on)?String(on.left||on.right||''):String(on||'');
|
|
15326
|
+
const rightKey=isObject(on)?String(on.right||on.left||''):String(on||'');
|
|
15327
|
+
if(!leftKey||!rightKey)return(row);
|
|
15328
|
+
const index=spec.index instanceof Map?spec.index:new Map();
|
|
15329
|
+
const value=readPath(row,leftKey);
|
|
15330
|
+
const match=value==null?undefined:index.get(String(value));
|
|
15331
|
+
if(!match)return String(spec.type||'inner')==='left'?(row):null;
|
|
15332
|
+
const fields=Array.isArray(spec.select)?spec.select.map(String):null;
|
|
15333
|
+
const prefix=spec.prefix?String(spec.prefix):'';
|
|
15334
|
+
const merged={...((row))};
|
|
15335
|
+
for(const name of fields||Object.keys(match)){
|
|
15336
|
+
if(!prefix&&name===leftKey)continue;
|
|
15337
|
+
merged[prefix?prefix+name:name]=readPath(match,name);
|
|
15338
|
+
}
|
|
15339
|
+
return merged;
|
|
15340
|
+
}
|
|
15341
|
+
function joinKeyOf(row,path){
|
|
15342
|
+
const value=readPath(row,path);
|
|
15343
|
+
return value==null?null:String(value);
|
|
15344
|
+
}
|
|
15345
|
+
});
|
|
15346
|
+
__def("packages/core/src/source/derived.js",function(__exports,__req){
|
|
15347
|
+
'use strict';
|
|
15348
|
+
Object.defineProperty(__exports,"IDLE_REFRESH_MS",{enumerable:true,get:function(){return IDLE_REFRESH_MS;}});
|
|
15349
|
+
Object.defineProperty(__exports,"PROFILE_FIELDS",{enumerable:true,get:function(){return PROFILE_FIELDS;}});
|
|
15350
|
+
Object.defineProperty(__exports,"DerivedSource",{enumerable:true,get:function(){return DerivedSource;}});
|
|
15351
|
+
Object.defineProperty(__exports,"createDerivedSource",{enumerable:true,get:function(){return createDerivedSource;}});
|
|
15352
|
+
const __m0=__req("packages/core/src/internal/util.js");
|
|
15353
|
+
const isFunction=__m0["isFunction"];
|
|
15354
|
+
const isObject=__m0["isObject"];
|
|
15355
|
+
const warnOnce=__m0["warnOnce"];
|
|
15356
|
+
const __m1=__req("packages/core/src/source/memory.js");
|
|
15357
|
+
const MemorySource=__m1["MemorySource"];
|
|
15358
|
+
const __m2=__req("packages/core/src/source/derive.js");
|
|
15359
|
+
const derive=__m2["derive"];
|
|
15360
|
+
const preGroup=__m2["preGroup"];
|
|
15361
|
+
const groupRows=__m2["groupRows"];
|
|
15362
|
+
const finishGroups=__m2["finishGroups"];
|
|
15363
|
+
const readPath=__m2["readPath"];
|
|
15364
|
+
const buildJoinIndex=__m2["buildJoinIndex"];
|
|
15365
|
+
const joinOne=__m2["joinOne"];
|
|
15366
|
+
const joinKeyOf=__m2["joinKeyOf"];
|
|
15367
|
+
const FOLLOW_MODES=__m2["FOLLOW_MODES"];
|
|
15368
|
+
const DERIVED_ROW_KEY=__m2["DERIVED_ROW_KEY"];
|
|
15369
|
+
const IDLE_REFRESH_MS=16;
|
|
15370
|
+
const PROFILE_FIELDS=Object.freeze([
|
|
15371
|
+
'column','rows','present','missing','distinct',
|
|
15372
|
+
'min','max','mean','median','q1','q3','iqr','stddev','outliers',
|
|
15373
|
+
]);
|
|
15374
|
+
class DerivedSource extends MemorySource{
|
|
15375
|
+
#from=null;
|
|
15376
|
+
#spec={};
|
|
15377
|
+
#off=[];
|
|
15378
|
+
#pending=null;
|
|
15379
|
+
#gone=false;
|
|
15380
|
+
#ctx={};
|
|
15381
|
+
#deriving=false;
|
|
15382
|
+
#index=null;
|
|
15383
|
+
#filterCols=null;
|
|
15384
|
+
#coalesced=false;
|
|
15385
|
+
#cross=[];
|
|
15386
|
+
#rightIndex=null;
|
|
15387
|
+
constructor(config,ctx){
|
|
15388
|
+
super({mode:'memory',rows:[]},ctx);
|
|
15389
|
+
this.#ctx=ctx||{};
|
|
15390
|
+
this.#spec=isObject(config)?config:{};
|
|
15391
|
+
this.#from=(this.#spec.from)||null;
|
|
15392
|
+
if(!this.#from){
|
|
15393
|
+
warnOnce('source.derived.from','source.mode "derived" needs `from`: the grid to derive from.');
|
|
15394
|
+
return;
|
|
15395
|
+
}
|
|
15396
|
+
if(this.#spec.follow&&!FOLLOW_MODES.includes(String(this.#spec.follow))){
|
|
15397
|
+
warnOnce(
|
|
15398
|
+
`source.derived.follow.${this.#spec.follow}`,
|
|
15399
|
+
`unknown follow "${this.#spec.follow}"; using "filtered". Known: ${FOLLOW_MODES.join(', ')}.`,
|
|
15400
|
+
);
|
|
15401
|
+
}
|
|
15402
|
+
this.#watch();
|
|
15403
|
+
this.refresh();
|
|
15404
|
+
}
|
|
15405
|
+
#watch(){
|
|
15406
|
+
const grid=this.#from;
|
|
15407
|
+
if(!grid||!isFunction(grid.on))return;
|
|
15408
|
+
const follow=String(this.#spec.follow||'filtered');
|
|
15409
|
+
const events=['rows:changed'];
|
|
15410
|
+
if(follow==='filtered'||follow==='grouped')events.push('filter:changed');
|
|
15411
|
+
if(follow==='selected')events.push('selection:changed');
|
|
15412
|
+
if(follow==='grouped')events.push('column:grouped');
|
|
15413
|
+
for(const name of events){
|
|
15414
|
+
const handler=(payload)=>{
|
|
15415
|
+
if(name==='rows:changed'&&skipCompanion(payload))return;
|
|
15416
|
+
this.schedule(name==='rows:changed'?payload:null);
|
|
15417
|
+
};
|
|
15418
|
+
grid.on(name,handler);
|
|
15419
|
+
this.#off.push(()=>isFunction(grid.off)&&grid.off(name,handler));
|
|
15420
|
+
}
|
|
15421
|
+
this.#watchJoin();
|
|
15422
|
+
}
|
|
15423
|
+
#watchJoin(){
|
|
15424
|
+
const join=this.#spec.join;
|
|
15425
|
+
const partner=join&&join.with;
|
|
15426
|
+
if(!partner||!isFunction(partner.on))return;
|
|
15427
|
+
const follow=String(join.follow||'all');
|
|
15428
|
+
const events=follow==='all'?['rows:changed']:['rows:changed','filter:changed'];
|
|
15429
|
+
for(const name of events){
|
|
15430
|
+
const handler=(payload)=>{
|
|
15431
|
+
if(name==='rows:changed'&&skipCompanion(payload))return;
|
|
15432
|
+
this.schedule({partner:true});
|
|
15433
|
+
};
|
|
15434
|
+
partner.on(name,handler);
|
|
15435
|
+
this.#off.push(()=>isFunction(partner.off)&&partner.off(name,handler));
|
|
15436
|
+
}
|
|
15437
|
+
}
|
|
15438
|
+
#joinPaths(){
|
|
15439
|
+
const join=this.#spec.join;
|
|
15440
|
+
if(!join||!join.with)return null;
|
|
15441
|
+
const on=join.on;
|
|
15442
|
+
const left=isObject(on)?String(on.left||on.right||''):String(on||'');
|
|
15443
|
+
const right=isObject(on)?String(on.right||on.left||''):String(on||'');
|
|
15444
|
+
return left&&right?{left,right}:null;
|
|
15445
|
+
}
|
|
15446
|
+
#refreshRight(){
|
|
15447
|
+
const paths=this.#joinPaths();
|
|
15448
|
+
if(!paths){this.#rightIndex=null;return null;}
|
|
15449
|
+
const previous=this.#rightIndex;
|
|
15450
|
+
this.#rightIndex=buildJoinIndex(this.#joinRows(),paths.right);
|
|
15451
|
+
if(!previous)return null;
|
|
15452
|
+
const join=this.#spec.join||{};
|
|
15453
|
+
const fields=Array.isArray(join.select)?join.select.map(String):null;
|
|
15454
|
+
const signature=(row)=>{
|
|
15455
|
+
if(!row)return null;
|
|
15456
|
+
const names=fields||Object.keys(row);
|
|
15457
|
+
return names.map((name)=>String(readPath(row,name))).join('\u0001');
|
|
15458
|
+
};
|
|
15459
|
+
const affected=new Set();
|
|
15460
|
+
const gained=new Set();
|
|
15461
|
+
for(const[key,row]of this.#rightIndex){
|
|
15462
|
+
if(signature(row)===signature(previous.get(key)))continue;
|
|
15463
|
+
affected.add(key);
|
|
15464
|
+
if(!previous.has(key))gained.add(key);
|
|
15465
|
+
}
|
|
15466
|
+
for(const key of previous.keys())if(!this.#rightIndex.has(key))affected.add(key);
|
|
15467
|
+
return{affected,gained};
|
|
15468
|
+
}
|
|
15469
|
+
#patchPartner(keys,spec){
|
|
15470
|
+
const index=this.#index;
|
|
15471
|
+
if(!index||!index.leftByJoinKey)return null;
|
|
15472
|
+
const touched=[];
|
|
15473
|
+
for(const key of keys){
|
|
15474
|
+
const rows=index.leftByJoinKey.get(key);
|
|
15475
|
+
if(!rows)continue;
|
|
15476
|
+
for(const rowKey of rows){
|
|
15477
|
+
const data=index.rowData.get(rowKey);
|
|
15478
|
+
if(data!==undefined)touched.push({key:rowKey,data});
|
|
15479
|
+
}
|
|
15480
|
+
}
|
|
15481
|
+
return this.#applyPatch({updated:touched,added:[],removed:[]},spec);
|
|
15482
|
+
}
|
|
15483
|
+
#partnerPatchable(spec,gained){
|
|
15484
|
+
if(!this.#index||!this.#index.leftByJoinKey)return false;
|
|
15485
|
+
if(spec.unnest||spec.where||String(spec.follow||'filtered')==='grouped')return false;
|
|
15486
|
+
const join=spec.join||{};
|
|
15487
|
+
if(String(join.type||'inner')==='left')return true;
|
|
15488
|
+
return gained.size===0;
|
|
15489
|
+
}
|
|
15490
|
+
#joinRows(){
|
|
15491
|
+
const join=this.#spec.join;
|
|
15492
|
+
const partner=join&&join.with;
|
|
15493
|
+
if(!partner||!partner.rows)return[];
|
|
15494
|
+
const out=[];
|
|
15495
|
+
const take=(row)=>{if(!row.group)out.push(unwrap(row));};
|
|
15496
|
+
if(String(join.follow||'all')==='filtered'&&isFunction(partner.rows.forEach)){
|
|
15497
|
+
partner.rows.forEach(take);
|
|
15498
|
+
}else if(isFunction(partner.rows.forEachAll)){
|
|
15499
|
+
partner.rows.forEachAll(take);
|
|
15500
|
+
}
|
|
15501
|
+
return out;
|
|
15502
|
+
}
|
|
15503
|
+
schedule(change){
|
|
15504
|
+
const mode=this.#spec.refresh===undefined?'idle':this.#spec.refresh;
|
|
15505
|
+
if(mode==='manual')return;
|
|
15506
|
+
if(mode==='live'){this.refresh(change);return;}
|
|
15507
|
+
const wait=typeof mode==='number'&&Number.isFinite(mode)?mode:IDLE_REFRESH_MS;
|
|
15508
|
+
if(this.#pending){this.#coalesced=true;return;}
|
|
15509
|
+
this.#coalesced=false;
|
|
15510
|
+
this.#pending=setTimeout(()=>{
|
|
15511
|
+
this.#pending=null;
|
|
15512
|
+
this.refresh(this.#coalesced?null:change);
|
|
15513
|
+
},wait);
|
|
15514
|
+
}
|
|
15515
|
+
refresh(change){
|
|
15516
|
+
if(this.#gone||!this.#from)return;
|
|
15517
|
+
if(this.#deriving){
|
|
15518
|
+
warnOnce(
|
|
15519
|
+
'source.derived.cycle',
|
|
15520
|
+
'a derived grid is deriving from itself, directly or through a chain. '
|
|
15521
|
+
+'The cycle was refused; check the `from` of each grid in the chain.',
|
|
15522
|
+
);
|
|
15523
|
+
return;
|
|
15524
|
+
}
|
|
15525
|
+
this.#deriving=true;
|
|
15526
|
+
try{
|
|
15527
|
+
const rows=this.#spec.profile
|
|
15528
|
+
?this.#deriveProfile()
|
|
15529
|
+
:this.#deriveRows(change);
|
|
15530
|
+
this.setRows(rows);
|
|
15531
|
+
this.invalidate('filter');
|
|
15532
|
+
if(isFunction(this.#ctx.emit)){
|
|
15533
|
+
(this.#ctx.emit)('rows:changed',{},'derived');
|
|
15534
|
+
}
|
|
15535
|
+
}finally{
|
|
15536
|
+
this.#deriving=false;
|
|
15537
|
+
}
|
|
15538
|
+
}
|
|
15539
|
+
#deriveRows(change){
|
|
15540
|
+
const partnerMoved=isObject(change)&&change.partner===true;
|
|
15541
|
+
const delta=partnerMoved?this.#refreshRight():null;
|
|
15542
|
+
const spec=this.#resolvedSpec();
|
|
15543
|
+
if(delta&&this.#index){
|
|
15544
|
+
if(!delta.affected.size){
|
|
15545
|
+
return finishGroups(this.#index.groups,spec,this.#index.reduced,new Set());
|
|
15546
|
+
}
|
|
15547
|
+
if(this.#partnerPatchable(spec,delta.gained)){
|
|
15548
|
+
const dirty=this.#patchPartner(delta.affected,spec);
|
|
15549
|
+
if(dirty)return finishGroups(this.#index.groups,spec,this.#index.reduced,dirty);
|
|
15550
|
+
}
|
|
15551
|
+
}
|
|
15552
|
+
const patch=this.#patchable(spec,change);
|
|
15553
|
+
if(patch&&this.#index){
|
|
15554
|
+
const dirty=this.#applyPatch(patch,spec);
|
|
15555
|
+
return finishGroups(this.#index.groups,spec,this.#index.reduced,dirty);
|
|
15556
|
+
}
|
|
15557
|
+
const rows=preGroup(this.#sourceRows(),spec);
|
|
15558
|
+
this.#filterCols=this.#sourceFilterColumns();
|
|
15559
|
+
if(!spec.groupBy){this.#index=null;return derive(rows,spec);}
|
|
15560
|
+
const keyOf=this.#keyOf();
|
|
15561
|
+
const{groups,rowGroup}=groupRows(rows,spec,keyOf);
|
|
15562
|
+
const rowData=new Map();
|
|
15563
|
+
for(const[key,groupKey]of rowGroup){
|
|
15564
|
+
const group=groups.get(groupKey);
|
|
15565
|
+
if(group)rowData.set(key,group.rows.get(key));
|
|
15566
|
+
}
|
|
15567
|
+
const reduced=new Map();
|
|
15568
|
+
const paths=this.#joinPaths();
|
|
15569
|
+
const leftJoinKey=new Map();
|
|
15570
|
+
const leftByJoinKey=new Map();
|
|
15571
|
+
if(paths){
|
|
15572
|
+
for(const[key,data]of rowData){
|
|
15573
|
+
const jk=joinKeyOf(data,paths.left);
|
|
15574
|
+
if(jk===null)continue;
|
|
15575
|
+
leftJoinKey.set(key,jk);
|
|
15576
|
+
let bucket=leftByJoinKey.get(jk);
|
|
15577
|
+
if(!bucket){bucket=new Set();leftByJoinKey.set(jk,bucket);}
|
|
15578
|
+
bucket.add(key);
|
|
15579
|
+
}
|
|
15580
|
+
}
|
|
15581
|
+
this.#index={groups,rowGroup,rowData,reduced,leftJoinKey,leftByJoinKey};
|
|
15582
|
+
return finishGroups(groups,spec,reduced,null);
|
|
15583
|
+
}
|
|
15584
|
+
#patchable(spec,change){
|
|
15585
|
+
if(!this.#index||!spec.groupBy)return null;
|
|
15586
|
+
if(spec.unnest||spec.where||String(spec.follow||'filtered')==='grouped')return null;
|
|
15587
|
+
if(isObject(spec.join)&&spec.join.with&&!(spec.join.index instanceof Map))return null;
|
|
15588
|
+
if(!isObject(change))return null;
|
|
15589
|
+
const updated=Array.isArray(change.updated)?change.updated:null;
|
|
15590
|
+
const added=Array.isArray(change.added)?change.added:null;
|
|
15591
|
+
const removed=Array.isArray(change.removed)?change.removed:null;
|
|
15592
|
+
if(!updated&&!added&&!removed)return null;
|
|
15593
|
+
const cols=this.#filterCols;
|
|
15594
|
+
if(cols&&cols.size&&String(spec.follow||'filtered')!=='all'){
|
|
15595
|
+
for(const row of updated||[]){
|
|
15596
|
+
const key=row&&row.key;
|
|
15597
|
+
const before=key===undefined?undefined:this.#index.rowData.get(String(key));
|
|
15598
|
+
const after=unwrap(row);
|
|
15599
|
+
for(const col of cols){
|
|
15600
|
+
if(readPath(before,col)!==readPath(after,col))return null;
|
|
15601
|
+
}
|
|
15602
|
+
}
|
|
15603
|
+
}
|
|
15604
|
+
return{updated:updated||[],added:added||[],removed:removed||[]};
|
|
15605
|
+
}
|
|
15606
|
+
#applyPatch(patch,spec){
|
|
15607
|
+
const index=
|
|
15608
|
+
(this.#index);
|
|
15609
|
+
const keyOf=this.#keyOf();
|
|
15610
|
+
const dirty=new Set();
|
|
15611
|
+
const join=isObject(spec.join)&&spec.join.index instanceof Map?spec.join:null;
|
|
15612
|
+
const paths=this.#joinPaths();
|
|
15613
|
+
const drop=(key)=>{
|
|
15614
|
+
const was=index.rowGroup.get(key);
|
|
15615
|
+
if(was===undefined)return;
|
|
15616
|
+
dirty.add(was);
|
|
15617
|
+
const group=index.groups.get(was);
|
|
15618
|
+
if(group){
|
|
15619
|
+
group.rows.delete(key);
|
|
15620
|
+
if(!group.rows.size)index.groups.delete(was);
|
|
15621
|
+
}
|
|
15622
|
+
index.rowGroup.delete(key);
|
|
15623
|
+
index.rowData.delete(key);
|
|
15624
|
+
if(index.leftJoinKey){
|
|
15625
|
+
const jk=index.leftJoinKey.get(key);
|
|
15626
|
+
if(jk!==undefined){
|
|
15627
|
+
const bucket=index.leftByJoinKey.get(jk);
|
|
15628
|
+
if(bucket){bucket.delete(key);if(!bucket.size)index.leftByJoinKey.delete(jk);}
|
|
15629
|
+
index.leftJoinKey.delete(key);
|
|
15630
|
+
}
|
|
15631
|
+
}
|
|
15632
|
+
};
|
|
15633
|
+
const place=(raw)=>{
|
|
15634
|
+
const row=join?joinOne(raw,join):raw;
|
|
15635
|
+
if(!row)return;
|
|
15636
|
+
const key=keyOf(row);
|
|
15637
|
+
const single=groupRows([row],spec,keyOf);
|
|
15638
|
+
for(const[groupKey,built]of single.groups){
|
|
15639
|
+
let group=index.groups.get(groupKey);
|
|
15640
|
+
if(!group){group={values:built.values,rows:new Map()};index.groups.set(groupKey,group);}
|
|
15641
|
+
group.rows.set(key,row);
|
|
15642
|
+
index.rowGroup.set(key,groupKey);
|
|
15643
|
+
dirty.add(groupKey);
|
|
15644
|
+
}
|
|
15645
|
+
index.rowData.set(key,row);
|
|
15646
|
+
if(paths&&index.leftByJoinKey){
|
|
15647
|
+
const jk=joinKeyOf(row,paths.left);
|
|
15648
|
+
if(jk!==null){
|
|
15649
|
+
index.leftJoinKey.set(key,jk);
|
|
15650
|
+
let bucket=index.leftByJoinKey.get(jk);
|
|
15651
|
+
if(!bucket){bucket=new Set();index.leftByJoinKey.set(jk,bucket);}
|
|
15652
|
+
bucket.add(key);
|
|
15653
|
+
}
|
|
15654
|
+
}
|
|
15655
|
+
};
|
|
15656
|
+
for(const key of patch.removed)drop(String(key));
|
|
15657
|
+
for(const row of patch.updated){drop(String(row.key));place(unwrap(row));}
|
|
15658
|
+
for(const row of patch.added)place(unwrap(row));
|
|
15659
|
+
return dirty;
|
|
15660
|
+
}
|
|
15661
|
+
#keyOf(){
|
|
15662
|
+
const grid=this.#from;
|
|
15663
|
+
const field=(grid&&grid.config&&grid.config.rowKey)||'id';
|
|
15664
|
+
return(row)=>String(readPath(row,typeof field==='string'?field:'id')??'');
|
|
15665
|
+
}
|
|
15666
|
+
#sourceFilterColumns(){
|
|
15667
|
+
const grid=this.#from;
|
|
15668
|
+
const state=grid&&grid.state&&isFunction(grid.state.get)?grid.state.get():null;
|
|
15669
|
+
const ids=new Set();
|
|
15670
|
+
const walk=(node)=>{
|
|
15671
|
+
if(!node)return;
|
|
15672
|
+
if(Array.isArray(node.conditions)){node.conditions.forEach(walk);return;}
|
|
15673
|
+
if(node.col)ids.add(String(node.col));
|
|
15674
|
+
};
|
|
15675
|
+
if(state)walk(state.filters);
|
|
15676
|
+
return ids;
|
|
15677
|
+
}
|
|
15678
|
+
#resolvedSpec(){
|
|
15679
|
+
let spec=this.#spec;
|
|
15680
|
+
if(spec.join&&spec.join.with){
|
|
15681
|
+
if(!this.#rightIndex)this.#refreshRight();
|
|
15682
|
+
spec={...spec,join:{...spec.join,index:this.#rightIndex}};
|
|
15683
|
+
}
|
|
15684
|
+
if(String(spec.follow||'filtered')!=='grouped')return spec;
|
|
15685
|
+
const grid=this.#from;
|
|
15686
|
+
const state=grid&&grid.state&&isFunction(grid.state.get)?grid.state.get():null;
|
|
15687
|
+
const grouped=state&&Array.isArray(state.group)?state.group:[];
|
|
15688
|
+
if(!grouped.length)return spec;
|
|
15689
|
+
return{...spec,groupBy:[...grouped]};
|
|
15690
|
+
}
|
|
15691
|
+
#sourceRows(){
|
|
15692
|
+
const grid=this.#from;
|
|
15693
|
+
const follow=String(this.#spec.follow||'filtered');
|
|
15694
|
+
if(!grid||!grid.rows)return[];
|
|
15695
|
+
if(follow==='all'){
|
|
15696
|
+
const every=[];
|
|
15697
|
+
if(isFunction(grid.rows.forEachAll)){
|
|
15698
|
+
grid.rows.forEachAll((row)=>{if(!row.group)every.push(unwrap(row));});
|
|
15699
|
+
}
|
|
15700
|
+
return every;
|
|
15701
|
+
}
|
|
15702
|
+
if(follow==='selected'){
|
|
15703
|
+
const rows=grid.selection&&isFunction(grid.selection.rows)?grid.selection.rows():[];
|
|
15704
|
+
return rows.filter(Boolean).map(unwrap);
|
|
15705
|
+
}
|
|
15706
|
+
const cross=this.#crossColumn();
|
|
15707
|
+
const out=[];
|
|
15708
|
+
if(cross&&this.#cross.length&&isFunction(grid.rows.forEachExcept)){
|
|
15709
|
+
grid.rows.forEachExcept(cross,(row)=>{if(!row.group)out.push(unwrap(row));});
|
|
15710
|
+
return out;
|
|
15711
|
+
}
|
|
15712
|
+
if(isFunction(grid.rows.forEach)){
|
|
15713
|
+
grid.rows.forEach((row)=>{if(!row.group)out.push(unwrap(row));});
|
|
15714
|
+
}
|
|
15715
|
+
return out;
|
|
15716
|
+
}
|
|
15717
|
+
#crossColumn(){
|
|
15718
|
+
const cfg=this.#spec.crossFilter;
|
|
15719
|
+
if(!cfg)return null;
|
|
15720
|
+
if(typeof cfg==='string')return cfg;
|
|
15721
|
+
if(cfg.col)return String(cfg.col);
|
|
15722
|
+
const by=this.#spec.groupBy;
|
|
15723
|
+
const first=Array.isArray(by)?by[0]:by;
|
|
15724
|
+
return first?String(first):null;
|
|
15725
|
+
}
|
|
15726
|
+
#pushCross(){
|
|
15727
|
+
const col=this.#crossColumn();
|
|
15728
|
+
const grid=this.#from;
|
|
15729
|
+
if(!col||!grid||!grid.filters||!isFunction(grid.filters.set))return;
|
|
15730
|
+
const compute=this.#ctx.compute||{};
|
|
15731
|
+
const current=isFunction(grid.filters.get)?grid.filters.get():null;
|
|
15732
|
+
const others=isFunction(compute.pruneColumn)?compute.pruneColumn(current,col):null;
|
|
15733
|
+
const keys=this.#cross;
|
|
15734
|
+
if(!keys.length){grid.filters.set(others||null);return;}
|
|
15735
|
+
const mine=keys.length===1
|
|
15736
|
+
?{col,op:'eq',value:keys[0]}
|
|
15737
|
+
:{col,op:'in',value:keys.slice()};
|
|
15738
|
+
const rest=others?(others.conditions&&others.op?others.conditions:[others]):[];
|
|
15739
|
+
grid.filters.set(rest.length?{op:'and',conditions:[...rest,mine]}:mine);
|
|
15740
|
+
}
|
|
15741
|
+
crossFilter(){
|
|
15742
|
+
const self=this;
|
|
15743
|
+
return{
|
|
15744
|
+
enabled(){return!!self.#crossColumn();},
|
|
15745
|
+
column(){return self.#crossColumn();},
|
|
15746
|
+
get(){return self.#cross.slice();},
|
|
15747
|
+
set(keys){
|
|
15748
|
+
const next=keys==null?[]:(Array.isArray(keys)?keys:[keys]);
|
|
15749
|
+
self.#cross=next.map((k)=>String(k));
|
|
15750
|
+
self.#pushCross();
|
|
15751
|
+
},
|
|
15752
|
+
toggle(key){
|
|
15753
|
+
const k=String(key);
|
|
15754
|
+
const at=self.#cross.indexOf(k);
|
|
15755
|
+
if(at>=0)self.#cross.splice(at,1);else self.#cross.push(k);
|
|
15756
|
+
self.#pushCross();
|
|
15757
|
+
},
|
|
15758
|
+
clear(){self.#cross=[];self.#pushCross();},
|
|
15759
|
+
};
|
|
15760
|
+
}
|
|
15761
|
+
#deriveProfile(){
|
|
15762
|
+
const grid=this.#from;
|
|
15763
|
+
if(!grid||!grid.statistics||!isFunction(grid.statistics.profile))return[];
|
|
15764
|
+
const wanted=Array.isArray(this.#spec.profile)?this.#spec.profile:[this.#spec.profile];
|
|
15765
|
+
const rows=wanted.filter(Boolean).map((colId)=>{
|
|
15766
|
+
const stats=grid.statistics.profile(String(colId))||{};
|
|
15767
|
+
const row={[DERIVED_ROW_KEY]:String(colId)};
|
|
15768
|
+
for(const field of PROFILE_FIELDS){
|
|
15769
|
+
row[field]=field==='column'?String(colId):(stats[field]??null);
|
|
15770
|
+
}
|
|
15771
|
+
row.outliers=Array.isArray(stats.outliers)?stats.outliers.length:(stats.outliers??null);
|
|
15772
|
+
return row;
|
|
15773
|
+
});
|
|
15774
|
+
if(this.#spec.orient!=='metrics')return rows;
|
|
15775
|
+
const first=rows[0];
|
|
15776
|
+
if(!first)return[];
|
|
15777
|
+
return PROFILE_FIELDS.filter((f)=>f!=='column').map((field)=>({
|
|
15778
|
+
[DERIVED_ROW_KEY]:field,metric:field,value:first[field],
|
|
15779
|
+
}));
|
|
15780
|
+
}
|
|
15781
|
+
apply(change){
|
|
15782
|
+
const ops=['add','update','remove'];
|
|
15783
|
+
const rejected=[];
|
|
15784
|
+
for(const op of ops){
|
|
15785
|
+
for(const row of(change&&change[op])||[]){
|
|
15786
|
+
rejected.push({operation:op,id:row&&row.id,reason:'derived-read-only'});
|
|
15787
|
+
}
|
|
15788
|
+
}
|
|
15789
|
+
if(rejected.length){
|
|
15790
|
+
warnOnce(
|
|
15791
|
+
'source.derived.readonly',
|
|
15792
|
+
'a derived grid is read-only: its rows are computed from another grid. '
|
|
15793
|
+
+'Write to the source grid instead, and the derived one follows.',
|
|
15794
|
+
);
|
|
15795
|
+
}
|
|
15796
|
+
return{added:[],updated:[],removed:[],rejected};
|
|
15797
|
+
}
|
|
15798
|
+
destroy(){
|
|
15799
|
+
this.#gone=true;
|
|
15800
|
+
if(this.#pending){clearTimeout(this.#pending);this.#pending=null;}
|
|
15801
|
+
for(const off of this.#off){try{off();}catch{}}
|
|
15802
|
+
this.#off=[];
|
|
15803
|
+
this.#from=null;
|
|
15804
|
+
super.destroy();
|
|
15805
|
+
}
|
|
15806
|
+
}
|
|
15807
|
+
function skipCompanion(payload){
|
|
15808
|
+
return isObject(payload)&&payload.companion===true;
|
|
15809
|
+
}
|
|
15810
|
+
function unwrap(row){
|
|
15811
|
+
return isObject(row)&&'data'in(row)
|
|
15812
|
+
?(row).data
|
|
15813
|
+
:row;
|
|
15814
|
+
}
|
|
15815
|
+
function createDerivedSource(config,ctx){
|
|
15816
|
+
return new DerivedSource(config,ctx);
|
|
15817
|
+
}
|
|
15818
|
+
});
|
|
15052
15819
|
__def("packages/core/src/source/index.js",function(__exports,__req){
|
|
15053
15820
|
'use strict';
|
|
15054
15821
|
Object.defineProperty(__exports,"createMemorySource",{enumerable:true,get:function(){return createMemorySource;}});
|
|
@@ -15062,6 +15829,10 @@ Object.defineProperty(__exports,"PROTOCOL",{enumerable:true,get:function(){retur
|
|
|
15062
15829
|
Object.defineProperty(__exports,"createStreamSource",{enumerable:true,get:function(){return createStreamSource;}});
|
|
15063
15830
|
Object.defineProperty(__exports,"StreamSource",{enumerable:true,get:function(){return StreamSource;}});
|
|
15064
15831
|
Object.defineProperty(__exports,"DEFAULT_PROMOTE_BELOW",{enumerable:true,get:function(){return DEFAULT_PROMOTE_BELOW;}});
|
|
15832
|
+
Object.defineProperty(__exports,"createDerivedSource",{enumerable:true,get:function(){return createDerivedSource;}});
|
|
15833
|
+
Object.defineProperty(__exports,"DerivedSource",{enumerable:true,get:function(){return DerivedSource;}});
|
|
15834
|
+
Object.defineProperty(__exports,"IDLE_REFRESH_MS",{enumerable:true,get:function(){return IDLE_REFRESH_MS;}});
|
|
15835
|
+
Object.defineProperty(__exports,"PROFILE_FIELDS",{enumerable:true,get:function(){return PROFILE_FIELDS;}});
|
|
15065
15836
|
Object.defineProperty(__exports,"MODES",{enumerable:true,get:function(){return MODES;}});
|
|
15066
15837
|
Object.defineProperty(__exports,"createSource",{enumerable:true,get:function(){return createSource;}});
|
|
15067
15838
|
const __m0=__req("packages/core/src/internal/util.js");
|
|
@@ -15083,41 +15854,57 @@ const __m4=__req("packages/core/src/source/stream.js");
|
|
|
15083
15854
|
const createStreamSource=__m4["createStreamSource"];
|
|
15084
15855
|
const StreamSource=__m4["StreamSource"];
|
|
15085
15856
|
const DEFAULT_PROMOTE_BELOW=__m4["DEFAULT_PROMOTE_BELOW"];
|
|
15086
|
-
const __m5=__req("packages/core/src/source/
|
|
15087
|
-
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
15091
|
-
|
|
15092
|
-
|
|
15093
|
-
Object.defineProperty(__exports,"
|
|
15094
|
-
Object.defineProperty(__exports,"
|
|
15095
|
-
Object.defineProperty(__exports,"
|
|
15096
|
-
Object.defineProperty(__exports,"
|
|
15097
|
-
Object.defineProperty(__exports,"
|
|
15098
|
-
Object.defineProperty(__exports,"
|
|
15099
|
-
Object.defineProperty(__exports,"
|
|
15100
|
-
Object.defineProperty(__exports,"
|
|
15101
|
-
Object.defineProperty(__exports,"
|
|
15102
|
-
|
|
15103
|
-
Object.defineProperty(__exports,"
|
|
15104
|
-
Object.defineProperty(__exports,"
|
|
15105
|
-
|
|
15106
|
-
Object.defineProperty(__exports,"
|
|
15107
|
-
Object.defineProperty(__exports,"
|
|
15108
|
-
|
|
15109
|
-
|
|
15110
|
-
Object.defineProperty(__exports,"
|
|
15111
|
-
|
|
15112
|
-
Object.defineProperty(__exports,"
|
|
15113
|
-
Object.defineProperty(__exports,"
|
|
15114
|
-
Object.defineProperty(__exports,"
|
|
15115
|
-
Object.defineProperty(__exports,"
|
|
15116
|
-
Object.defineProperty(__exports,"
|
|
15117
|
-
|
|
15118
|
-
Object.defineProperty(__exports,"
|
|
15119
|
-
Object.defineProperty(__exports,"
|
|
15120
|
-
|
|
15857
|
+
const __m5=__req("packages/core/src/source/derived.js");
|
|
15858
|
+
const createDerivedSource=__m5["createDerivedSource"];
|
|
15859
|
+
const DerivedSource=__m5["DerivedSource"];
|
|
15860
|
+
const IDLE_REFRESH_MS=__m5["IDLE_REFRESH_MS"];
|
|
15861
|
+
const PROFILE_FIELDS=__m5["PROFILE_FIELDS"];
|
|
15862
|
+
const __m6=__req("packages/core/src/source/derive.js");
|
|
15863
|
+
Object.defineProperty(__exports,"derive",{enumerable:true,get:function(){return __m6["derive"];}});
|
|
15864
|
+
Object.defineProperty(__exports,"unnest",{enumerable:true,get:function(){return __m6["unnest"];}});
|
|
15865
|
+
Object.defineProperty(__exports,"readPath",{enumerable:true,get:function(){return __m6["readPath"];}});
|
|
15866
|
+
Object.defineProperty(__exports,"bucketOf",{enumerable:true,get:function(){return __m6["bucketOf"];}});
|
|
15867
|
+
Object.defineProperty(__exports,"applyLimit",{enumerable:true,get:function(){return __m6["applyLimit"];}});
|
|
15868
|
+
Object.defineProperty(__exports,"applyCumulative",{enumerable:true,get:function(){return __m6["applyCumulative"];}});
|
|
15869
|
+
Object.defineProperty(__exports,"reduceValues",{enumerable:true,get:function(){return __m6["reduceValues"];}});
|
|
15870
|
+
Object.defineProperty(__exports,"FOLLOW_MODES",{enumerable:true,get:function(){return __m6["FOLLOW_MODES"];}});
|
|
15871
|
+
Object.defineProperty(__exports,"BUCKETS",{enumerable:true,get:function(){return __m6["BUCKETS"];}});
|
|
15872
|
+
Object.defineProperty(__exports,"DERIVED_ROW_KEY",{enumerable:true,get:function(){return __m6["DERIVED_ROW_KEY"];}});
|
|
15873
|
+
const __m7=__req("packages/core/src/source/abort.js");
|
|
15874
|
+
Object.defineProperty(__exports,"AbortScope",{enumerable:true,get:function(){return __m7["AbortScope"];}});
|
|
15875
|
+
Object.defineProperty(__exports,"RequestToken",{enumerable:true,get:function(){return __m7["RequestToken"];}});
|
|
15876
|
+
Object.defineProperty(__exports,"SupersededError",{enumerable:true,get:function(){return __m7["SupersededError"];}});
|
|
15877
|
+
Object.defineProperty(__exports,"createAbortScope",{enumerable:true,get:function(){return __m7["createAbortScope"];}});
|
|
15878
|
+
Object.defineProperty(__exports,"isAbortError",{enumerable:true,get:function(){return __m7["isAbortError"];}});
|
|
15879
|
+
const __m8=__req("packages/core/src/source/filterwire.js");
|
|
15880
|
+
Object.defineProperty(__exports,"RELATIVE_TOKENS",{enumerable:true,get:function(){return __m8["RELATIVE_TOKENS"];}});
|
|
15881
|
+
Object.defineProperty(__exports,"parseRelativeToken",{enumerable:true,get:function(){return __m8["parseRelativeToken"];}});
|
|
15882
|
+
Object.defineProperty(__exports,"resolveRelativeRange",{enumerable:true,get:function(){return __m8["resolveRelativeRange"];}});
|
|
15883
|
+
Object.defineProperty(__exports,"resolveRelativeCondition",{enumerable:true,get:function(){return __m8["resolveRelativeCondition"];}});
|
|
15884
|
+
Object.defineProperty(__exports,"relativeTokenOf",{enumerable:true,get:function(){return __m8["relativeTokenOf"];}});
|
|
15885
|
+
Object.defineProperty(__exports,"buildFilterSet",{enumerable:true,get:function(){return __m8["buildFilterSet"];}});
|
|
15886
|
+
Object.defineProperty(__exports,"normaliseFilterSet",{enumerable:true,get:function(){return __m8["normaliseFilterSet"];}});
|
|
15887
|
+
Object.defineProperty(__exports,"wireFilters",{enumerable:true,get:function(){return __m8["wireFilters"];}});
|
|
15888
|
+
Object.defineProperty(__exports,"querySignature",{enumerable:true,get:function(){return __m8["querySignature"];}});
|
|
15889
|
+
Object.defineProperty(__exports,"mapConditions",{enumerable:true,get:function(){return __m8["mapConditions"];}});
|
|
15890
|
+
Object.defineProperty(__exports,"forEachCondition",{enumerable:true,get:function(){return __m8["forEachCondition"];}});
|
|
15891
|
+
Object.defineProperty(__exports,"isGroup",{enumerable:true,get:function(){return __m8["isGroup"];}});
|
|
15892
|
+
const __m9=__req("packages/core/src/source/blockcache.js");
|
|
15893
|
+
Object.defineProperty(__exports,"BlockCache",{enumerable:true,get:function(){return __m9["BlockCache"];}});
|
|
15894
|
+
Object.defineProperty(__exports,"DEFAULT_PAGE_SIZE",{enumerable:true,get:function(){return __m9["DEFAULT_PAGE_SIZE"];}});
|
|
15895
|
+
Object.defineProperty(__exports,"DEFAULT_MAX_CACHED_PAGES",{enumerable:true,get:function(){return __m9["DEFAULT_MAX_CACHED_PAGES"];}});
|
|
15896
|
+
const __m10=__req("packages/core/src/source/gapbuffer.js");
|
|
15897
|
+
Object.defineProperty(__exports,"GapBuffer",{enumerable:true,get:function(){return __m10["GapBuffer"];}});
|
|
15898
|
+
const __m11=__req("packages/core/src/source/rows.js");
|
|
15899
|
+
Object.defineProperty(__exports,"RowFactory",{enumerable:true,get:function(){return __m11["RowFactory"];}});
|
|
15900
|
+
Object.defineProperty(__exports,"createRowFactory",{enumerable:true,get:function(){return __m11["createRowFactory"];}});
|
|
15901
|
+
Object.defineProperty(__exports,"groupKey",{enumerable:true,get:function(){return __m11["groupKey"];}});
|
|
15902
|
+
Object.defineProperty(__exports,"lazyRowView",{enumerable:true,get:function(){return __m11["lazyRowView"];}});
|
|
15903
|
+
Object.defineProperty(__exports,"DEFAULT_ROW_HEIGHT",{enumerable:true,get:function(){return __m11["DEFAULT_ROW_HEIGHT"];}});
|
|
15904
|
+
const __m12=__req("packages/core/src/source/handles.js");
|
|
15905
|
+
Object.defineProperty(__exports,"HandleProvider",{enumerable:true,get:function(){return __m12["HandleProvider"];}});
|
|
15906
|
+
Object.defineProperty(__exports,"createHandleProvider",{enumerable:true,get:function(){return __m12["createHandleProvider"];}});
|
|
15907
|
+
const MODES=Object.freeze(['memory','paged','remote','stream','derived']);
|
|
15121
15908
|
function createSource(config,ctx){
|
|
15122
15909
|
if(!ctx)fail('createSource requires a SourceContext');
|
|
15123
15910
|
const resolved=isObject(config)?config:{mode:'memory'};
|
|
@@ -15127,6 +15914,7 @@ case'memory':return createMemorySource((resolved),ctx);
|
|
|
15127
15914
|
case'paged':return createPagedSource((resolved),ctx);
|
|
15128
15915
|
case'remote':return createRemoteSource((resolved),ctx);
|
|
15129
15916
|
case'stream':return createStreamSource((resolved),ctx);
|
|
15917
|
+
case'derived':return createDerivedSource((resolved),ctx);
|
|
15130
15918
|
default:
|
|
15131
15919
|
warnOnce(
|
|
15132
15920
|
`source.mode.${mode}`,
|
|
@@ -22565,6 +23353,7 @@ result.rejected=rejected;
|
|
|
22565
23353
|
if(this.#run)this.#run(plan,change);
|
|
22566
23354
|
if(!opts.silent){
|
|
22567
23355
|
this.#emit('rows:changed',{
|
|
23356
|
+
identified:true,
|
|
22568
23357
|
added:result.added,updated:result.updated,removed:result.removed,
|
|
22569
23358
|
rejected:result.rejected,plan,
|
|
22570
23359
|
},opts.origin||'api');
|
|
@@ -25217,6 +26006,7 @@ const __m19=__req("packages/core/src/compute/index.js");
|
|
|
25217
26006
|
const compute=__m19;
|
|
25218
26007
|
const __m20=__req("packages/core/src/source/index.js");
|
|
25219
26008
|
const createSource=__m20["createSource"];
|
|
26009
|
+
const DERIVED_ROW_KEY=__m20["DERIVED_ROW_KEY"];
|
|
25220
26010
|
const __m21=__req("packages/core/src/source/rows.js");
|
|
25221
26011
|
const pinnedRow=__m21["pinnedRow"];
|
|
25222
26012
|
const DEFAULT_ROW_HEIGHT=__m21["DEFAULT_ROW_HEIGHT"];
|
|
@@ -25473,6 +26263,10 @@ for(const[name,fn]of Object.entries(this.#config.totalFns||{})){
|
|
|
25473
26263
|
if(isFunction(fn))this.#registry.register('totalFn',name,fn);
|
|
25474
26264
|
}
|
|
25475
26265
|
this.#pool=new MaskPool();
|
|
26266
|
+
if(this.#config.rowKey===undefined&&isObject(this.#config.source)
|
|
26267
|
+
&&(this.#config.source).mode==='derived'){
|
|
26268
|
+
this.#config.rowKey=DERIVED_ROW_KEY;
|
|
26269
|
+
}
|
|
25476
26270
|
this.#rowKeyResolver=createRowKey(this.#config.rowKey);
|
|
25477
26271
|
this.#rowKey=(data,index)=>this.#rowKeyResolver.key(data,index);
|
|
25478
26272
|
if(Array.isArray(this.#config.pinnedTopRows))this.#pinnedTop=this.#config.pinnedTopRows.slice();
|
|
@@ -27039,7 +27833,7 @@ const before=flash?grid.#captureCells(change):null;
|
|
|
27039
27833
|
const result=grid.#changes.apply(change);
|
|
27040
27834
|
if(before)grid.#flashChanged(before,result.updated,flash);
|
|
27041
27835
|
grid.#refresh('rows');
|
|
27042
|
-
grid.#bus.emit('rows:changed',{change},'api');
|
|
27836
|
+
grid.#bus.emit('rows:changed',{companion:true,change},'api');
|
|
27043
27837
|
return result;
|
|
27044
27838
|
},
|
|
27045
27839
|
queue(change){return grid.#changes.queue(change);},
|
|
@@ -27098,6 +27892,16 @@ const row=source.at(i);
|
|
|
27098
27892
|
if(row&&!row.group)fn(row,i);
|
|
27099
27893
|
}
|
|
27100
27894
|
},
|
|
27895
|
+
forEachExcept(colId,fn){
|
|
27896
|
+
if(!isFunction(fn))return;
|
|
27897
|
+
const source=grid.#source;
|
|
27898
|
+
if(colId&&isFunction(source.facetRows)){
|
|
27899
|
+
const rows=source.facetRows(colId);
|
|
27900
|
+
for(let i=0;i<rows.length;i++)fn(rows[i],i);
|
|
27901
|
+
return;
|
|
27902
|
+
}
|
|
27903
|
+
this.forEach(fn);
|
|
27904
|
+
},
|
|
27101
27905
|
value(key,colId){
|
|
27102
27906
|
const row=grid.#rowByKey(key);
|
|
27103
27907
|
return grid.#cellValue(row,grid.#columnsView().get(colId)||colId);
|
|
@@ -27152,6 +27956,7 @@ if(target===from)return{moved:false,from,to:target,reason:'unchanged'};
|
|
|
27152
27956
|
if(!grid.#source.moveRow(from,target))return refuse('unchanged');
|
|
27153
27957
|
grid.#rebuildStore();
|
|
27154
27958
|
grid.#refresh('rows');
|
|
27959
|
+
grid.#bus.emit('rows:changed',{moved:1,key,from,to:target},'api');
|
|
27155
27960
|
grid.#bus.emit('row:moved',{key,from,to:target,data:row.data});
|
|
27156
27961
|
return{moved:true,from,to:target};
|
|
27157
27962
|
},
|
|
@@ -28092,6 +28897,18 @@ return grid.#detail.inline?'inline':'target';
|
|
|
28092
28897
|
config(){return grid.#detail?grid.#detail.config:null;},
|
|
28093
28898
|
};
|
|
28094
28899
|
}
|
|
28900
|
+
get crossFilter(){
|
|
28901
|
+
const source=(this.#source);
|
|
28902
|
+
if(source&&isFunction(source.crossFilter))return source.crossFilter();
|
|
28903
|
+
return{
|
|
28904
|
+
enabled(){return false;},
|
|
28905
|
+
column(){return null;},
|
|
28906
|
+
get(){return[];},
|
|
28907
|
+
set(){},
|
|
28908
|
+
toggle(){},
|
|
28909
|
+
clear(){},
|
|
28910
|
+
};
|
|
28911
|
+
}
|
|
28095
28912
|
get facets(){
|
|
28096
28913
|
const grid=this;
|
|
28097
28914
|
return{
|
|
@@ -38450,6 +39267,7 @@ const PREFIX='lat';
|
|
|
38450
39267
|
const NAMESPACE='lattice';
|
|
38451
39268
|
const CLASS={
|
|
38452
39269
|
root:`${PREFIX}-grid-root`,
|
|
39270
|
+
title:`${PREFIX}-title`,
|
|
38453
39271
|
header:`${PREFIX}-header`,
|
|
38454
39272
|
headerStart:`${PREFIX}-header-left-pinned`,
|
|
38455
39273
|
headerCentreClip:`${PREFIX}-header-centre-clip`,
|
|
@@ -38505,6 +39323,8 @@ fail('DomRenderer needs a DOM. Use createHeadlessGrid() on the server.');
|
|
|
38505
39323
|
this.#document=document;
|
|
38506
39324
|
this.#host=element;
|
|
38507
39325
|
this.root=el(document,`${NAMESPACE} ${CLASS.root}`);
|
|
39326
|
+
this.title=el(document,CLASS.title);
|
|
39327
|
+
this.title.hidden=true;
|
|
38508
39328
|
this.header=el(document,CLASS.header);
|
|
38509
39329
|
this.headerStart=el(document,CLASS.headerStart);
|
|
38510
39330
|
this.headerCentreClip=el(document,CLASS.headerCentreClip);
|
|
@@ -38534,6 +39354,7 @@ this.stickyBottom=el(document,CLASS.stickyBottom);
|
|
|
38534
39354
|
this.overlays=el(document,CLASS.overlays);
|
|
38535
39355
|
this.statusBar=el(document,CLASS.statusBar);
|
|
38536
39356
|
this.measureLayer=el(document,CLASS.measure);
|
|
39357
|
+
this.root.appendChild(this.title);
|
|
38537
39358
|
this.root.appendChild(this.header);
|
|
38538
39359
|
this.root.appendChild(this.bodyViewport);
|
|
38539
39360
|
this.root.appendChild(this.stickyTop);
|
|
@@ -38543,6 +39364,14 @@ this.root.appendChild(this.statusBar);
|
|
|
38543
39364
|
this.root.appendChild(this.measureLayer);
|
|
38544
39365
|
}
|
|
38545
39366
|
get document(){return this.#document;}
|
|
39367
|
+
setTitle(text){
|
|
39368
|
+
const value=text===null||text===undefined?'':String(text);
|
|
39369
|
+
this.title.textContent=value;
|
|
39370
|
+
this.title.hidden=value==='';
|
|
39371
|
+
}
|
|
39372
|
+
setHeaderVisible(visible){
|
|
39373
|
+
this.header.hidden=!visible;
|
|
39374
|
+
}
|
|
38546
39375
|
mount(){
|
|
38547
39376
|
this.#host.appendChild(this.root);
|
|
38548
39377
|
}
|
|
@@ -42290,6 +43119,7 @@ this.#host=host;
|
|
|
42290
43119
|
this.#cellLayer=host.cellLayer||textCellLayer;
|
|
42291
43120
|
this.#overscan=Number.isFinite(host.config?.overscan)?host.config.overscan:DEFAULT_OVERSCAN;
|
|
42292
43121
|
this.#viewport=new Viewport(element,{document:host.document});
|
|
43122
|
+
this.#applyChrome(host.config);
|
|
42293
43123
|
this.#layout=new ColumnLayout({
|
|
42294
43124
|
columns:()=>this.#visibleColumns(),
|
|
42295
43125
|
threshold:host.config?.columnVirtualisationAbove,
|
|
@@ -42359,6 +43189,11 @@ onFrame:(ctx)=>this.#frame(ctx),
|
|
|
42359
43189
|
onScrollEnd:()=>this.#host.emit('scroll:end',this.scrollPosition()),
|
|
42360
43190
|
});
|
|
42361
43191
|
}
|
|
43192
|
+
#applyChrome(config){
|
|
43193
|
+
const title=config&&config.title;
|
|
43194
|
+
this.#viewport.setTitle(typeof title==='string'?title:null);
|
|
43195
|
+
this.#viewport.setHeaderVisible(!(config&&config.showHeader===false));
|
|
43196
|
+
}
|
|
42362
43197
|
mount(){
|
|
42363
43198
|
if(this.#mountedOnce)return;
|
|
42364
43199
|
this.#mountedOnce=true;
|
|
@@ -63035,6 +63870,229 @@ grids.push(el.tagName==='TABLE'?hydrateTable(el,config):createGrid(el,config));
|
|
|
63035
63870
|
return grids;
|
|
63036
63871
|
}
|
|
63037
63872
|
});
|
|
63873
|
+
__def("packages/dom/src/stat.js",function(__exports,__req){
|
|
63874
|
+
'use strict';
|
|
63875
|
+
Object.defineProperty(__exports,"deltaOf",{enumerable:true,get:function(){return deltaOf;}});
|
|
63876
|
+
Object.defineProperty(__exports,"toneOf",{enumerable:true,get:function(){return toneOf;}});
|
|
63877
|
+
Object.defineProperty(__exports,"createStat",{enumerable:true,get:function(){return createStat;}});
|
|
63878
|
+
const __m0=__req("packages/core/src/internal/util.js");
|
|
63879
|
+
const isFunction=__m0["isFunction"];
|
|
63880
|
+
const isObject=__m0["isObject"];
|
|
63881
|
+
const warnOnce=__m0["warnOnce"];
|
|
63882
|
+
const __m1=__req("packages/core/src/source/derive.js");
|
|
63883
|
+
const reduceValues=__m1["reduceValues"];
|
|
63884
|
+
const CLS={
|
|
63885
|
+
root:'lat-stat',
|
|
63886
|
+
title:'lat-stat__title',
|
|
63887
|
+
value:'lat-stat__value',
|
|
63888
|
+
delta:'lat-stat__delta',
|
|
63889
|
+
footer:'lat-stat__footer',
|
|
63890
|
+
};
|
|
63891
|
+
const UNIT_PRESERVING=new Set([
|
|
63892
|
+
'sum','min','max','avg','first','last','mode',
|
|
63893
|
+
'median','p25','p75','p90','p95','p99',
|
|
63894
|
+
'stddev','stddevP','mad','range','iqr',
|
|
63895
|
+
'trimmedMean','winsorizedMean','geomean','harmean',
|
|
63896
|
+
]);
|
|
63897
|
+
const NO_DELTA=Object.freeze({direction:'flat',change:null,percent:null});
|
|
63898
|
+
function deltaOf(value,baseline){
|
|
63899
|
+
if(!Number.isFinite((value))
|
|
63900
|
+
||!Number.isFinite((baseline)))return NO_DELTA;
|
|
63901
|
+
const change=(value)-(baseline);
|
|
63902
|
+
const direction=change>0?'up':(change<0?'down':'flat');
|
|
63903
|
+
const percent=baseline===0?null:(change/Math.abs((baseline)))*100;
|
|
63904
|
+
return{direction,change,percent};
|
|
63905
|
+
}
|
|
63906
|
+
function toneOf(direction,goodWhen){
|
|
63907
|
+
if(direction==='flat'||goodWhen==='neither')return'flat';
|
|
63908
|
+
return direction===goodWhen?'good':'bad';
|
|
63909
|
+
}
|
|
63910
|
+
function createStat(spec){
|
|
63911
|
+
const config=isObject(spec)?spec:{};
|
|
63912
|
+
const grid=config.grid||null;
|
|
63913
|
+
const host=resolveContainer(config.container,grid);
|
|
63914
|
+
if(!host){
|
|
63915
|
+
warnOnce('stat.container','createStat needs a `container`: an element or a selector.');
|
|
63916
|
+
return inert();
|
|
63917
|
+
}
|
|
63918
|
+
const doc=host.ownerDocument||(typeof document==='undefined'?null:document);
|
|
63919
|
+
if(!doc){
|
|
63920
|
+
warnOnce('stat.document','createStat needs a document; it draws DOM.');
|
|
63921
|
+
return inert();
|
|
63922
|
+
}
|
|
63923
|
+
const root=doc.createElement('div');
|
|
63924
|
+
root.className=['lattice',CLS.root,config.class].filter(Boolean).join(' ');
|
|
63925
|
+
root.setAttribute('role','group');
|
|
63926
|
+
const titleEl=doc.createElement('div');
|
|
63927
|
+
titleEl.className=CLS.title;
|
|
63928
|
+
const valueEl=doc.createElement('div');
|
|
63929
|
+
valueEl.className=CLS.value;
|
|
63930
|
+
const deltaEl=doc.createElement('div');
|
|
63931
|
+
deltaEl.className=CLS.delta;
|
|
63932
|
+
const footerEl=doc.createElement('div');
|
|
63933
|
+
footerEl.className=CLS.footer;
|
|
63934
|
+
root.appendChild(titleEl);
|
|
63935
|
+
root.appendChild(valueEl);
|
|
63936
|
+
root.appendChild(deltaEl);
|
|
63937
|
+
root.appendChild(footerEl);
|
|
63938
|
+
host.appendChild(root);
|
|
63939
|
+
let current=null;
|
|
63940
|
+
const off=[];
|
|
63941
|
+
let gone=false;
|
|
63942
|
+
function compute(){
|
|
63943
|
+
if(isFunction(config.value))return config.value(grid);
|
|
63944
|
+
if(config.value!==undefined&&!isObject(config.value))return config.value;
|
|
63945
|
+
const from=isObject(config.value)?config.value:config;
|
|
63946
|
+
const col=from.of;
|
|
63947
|
+
const fn=from.fn||'sum';
|
|
63948
|
+
const show=from.show;
|
|
63949
|
+
if(!grid)return null;
|
|
63950
|
+
if(fn==='count')return rowsInScope().length;
|
|
63951
|
+
if(!col)return null;
|
|
63952
|
+
if(show)return pick(String(col),String(fn),String(show));
|
|
63953
|
+
if(scope()==='filtered'&&grid.statistics&&isFunction(grid.statistics.reduce)){
|
|
63954
|
+
return grid.statistics.reduce(String(col),String(fn));
|
|
63955
|
+
}
|
|
63956
|
+
return reduceValues(rowsInScope().map((row)=>valueOf(row,String(col))),String(fn));
|
|
63957
|
+
}
|
|
63958
|
+
function scope(){
|
|
63959
|
+
return String(config.scope||'filtered');
|
|
63960
|
+
}
|
|
63961
|
+
function rowsInScope(){
|
|
63962
|
+
if(!grid||!grid.rows)return[];
|
|
63963
|
+
const want=scope();
|
|
63964
|
+
if(want==='all'){
|
|
63965
|
+
const every=[];
|
|
63966
|
+
if(isFunction(grid.rows.forEachAll))grid.rows.forEachAll((row)=>{if(!row.group)every.push(plain(row));});
|
|
63967
|
+
return every;
|
|
63968
|
+
}
|
|
63969
|
+
if(want==='selected'){
|
|
63970
|
+
const rows=grid.selection&&isFunction(grid.selection.rows)?grid.selection.rows():[];
|
|
63971
|
+
return rows.filter(Boolean).map(plain);
|
|
63972
|
+
}
|
|
63973
|
+
const out=[];
|
|
63974
|
+
if(isFunction(grid.rows.forEach)){
|
|
63975
|
+
grid.rows.forEach((row)=>{if(!row.group)out.push(plain(row));});
|
|
63976
|
+
}
|
|
63977
|
+
return out;
|
|
63978
|
+
}
|
|
63979
|
+
function pick(col,fn,show){
|
|
63980
|
+
if(fn!=='min'&&fn!=='max'){
|
|
63981
|
+
warnOnce(
|
|
63982
|
+
`stat.show.${fn}`,
|
|
63983
|
+
`\`show\` needs \`fn: 'min'\` or \`fn: 'max'\`: "${fn}" reduces to a value that no single `
|
|
63984
|
+
+'row holds, so there is no row to report from.',
|
|
63985
|
+
);
|
|
63986
|
+
return null;
|
|
63987
|
+
}
|
|
63988
|
+
let best=null;
|
|
63989
|
+
let bestRow=null;
|
|
63990
|
+
for(const row of rowsInScope()){
|
|
63991
|
+
const value=Number(valueOf(row,col));
|
|
63992
|
+
if(!Number.isFinite(value))continue;
|
|
63993
|
+
if(best===null||(fn==='max'?value>best:value<best)){
|
|
63994
|
+
best=value;
|
|
63995
|
+
bestRow=row;
|
|
63996
|
+
}
|
|
63997
|
+
}
|
|
63998
|
+
return bestRow===null?null:valueOf(bestRow,show);
|
|
63999
|
+
}
|
|
64000
|
+
function render(value){
|
|
64001
|
+
if(isFunction(config.format))return String(config.format(value,grid));
|
|
64002
|
+
if(value===null||value===undefined)return config.empty??'—';
|
|
64003
|
+
const from=isObject(config.value)?config.value:config;
|
|
64004
|
+
const source=from.show||from.of;
|
|
64005
|
+
const borrow=from.show?true:UNIT_PRESERVING.has(String(from.fn||'sum'));
|
|
64006
|
+
if(borrow&&grid&&source&&isFunction(grid.columns?.get)){
|
|
64007
|
+
const column=grid.columns.get(String(source));
|
|
64008
|
+
if(column&&isFunction(column.formatValue))return column.formatValue(value);
|
|
64009
|
+
}
|
|
64010
|
+
if(typeof value==='number'){
|
|
64011
|
+
return Number.isInteger(value)?String(value):value.toFixed(config.decimals??2);
|
|
64012
|
+
}
|
|
64013
|
+
return String(value);
|
|
64014
|
+
}
|
|
64015
|
+
function refresh(){
|
|
64016
|
+
if(gone)return;
|
|
64017
|
+
const value=compute();
|
|
64018
|
+
const baseline=isFunction(config.baseline)?config.baseline(grid):config.baseline;
|
|
64019
|
+
current=value;
|
|
64020
|
+
titleEl.textContent=config.title??'';
|
|
64021
|
+
titleEl.hidden=!config.title;
|
|
64022
|
+
valueEl.textContent=render(value);
|
|
64023
|
+
const delta=baseline===undefined||baseline===null
|
|
64024
|
+
?NO_DELTA
|
|
64025
|
+
:deltaOf(typeof value==='number'?value:null,Number(baseline));
|
|
64026
|
+
const tone=toneOf(delta.direction,config.goodWhen||'up');
|
|
64027
|
+
deltaEl.hidden=delta.change===null;
|
|
64028
|
+
if(delta.change!==null){
|
|
64029
|
+
const arrow=delta.direction==='up'?'↑':(delta.direction==='down'?'↓':'→');
|
|
64030
|
+
const size=delta.percent===null
|
|
64031
|
+
?render(Math.abs(delta.change))
|
|
64032
|
+
:`${Math.abs(delta.percent).toFixed(1)}%`;
|
|
64033
|
+
deltaEl.textContent=`${arrow} ${size}`;
|
|
64034
|
+
deltaEl.setAttribute('data-tone',tone);
|
|
64035
|
+
deltaEl.setAttribute('data-direction',delta.direction);
|
|
64036
|
+
}
|
|
64037
|
+
footerEl.textContent=isFunction(config.footer)?String(config.footer(value,grid)):(config.footer??'');
|
|
64038
|
+
footerEl.hidden=!footerEl.textContent;
|
|
64039
|
+
root.setAttribute('aria-label',[
|
|
64040
|
+
config.title,valueEl.textContent,
|
|
64041
|
+
delta.change===null?'':deltaEl.textContent,
|
|
64042
|
+
footerEl.textContent,
|
|
64043
|
+
].filter(Boolean).join(', '));
|
|
64044
|
+
}
|
|
64045
|
+
if(grid&&isFunction(grid.on)&&config.live!==false){
|
|
64046
|
+
for(const event of['rows:changed','filter:changed','selection:changed']){
|
|
64047
|
+
const handler=()=>refresh();
|
|
64048
|
+
grid.on(event,handler);
|
|
64049
|
+
off.push(()=>isFunction(grid.off)&&grid.off(event,handler));
|
|
64050
|
+
}
|
|
64051
|
+
}
|
|
64052
|
+
refresh();
|
|
64053
|
+
return{
|
|
64054
|
+
element:()=>root,
|
|
64055
|
+
value:()=>current,
|
|
64056
|
+
refresh,
|
|
64057
|
+
destroy(){
|
|
64058
|
+
gone=true;
|
|
64059
|
+
for(const remove of off){try{remove();}catch{}}
|
|
64060
|
+
off.length=0;
|
|
64061
|
+
root.remove();
|
|
64062
|
+
},
|
|
64063
|
+
};
|
|
64064
|
+
}
|
|
64065
|
+
function plain(row){
|
|
64066
|
+
return isObject(row)&&'data'in(row)
|
|
64067
|
+
?(row).data
|
|
64068
|
+
:row;
|
|
64069
|
+
}
|
|
64070
|
+
function valueOf(row,path){
|
|
64071
|
+
if(!isObject(row))return undefined;
|
|
64072
|
+
if(!path.includes('.'))return(row)[path];
|
|
64073
|
+
let cursor=(row);
|
|
64074
|
+
for(const part of path.split('.')){
|
|
64075
|
+
if(!isObject(cursor))return undefined;
|
|
64076
|
+
cursor=(cursor)[part];
|
|
64077
|
+
}
|
|
64078
|
+
return cursor;
|
|
64079
|
+
}
|
|
64080
|
+
function resolveContainer(container,grid){
|
|
64081
|
+
if(container&&typeof container==='object')return(container);
|
|
64082
|
+
if(typeof container!=='string')return null;
|
|
64083
|
+
const doc=(grid&&grid.element&&grid.element.ownerDocument)
|
|
64084
|
+
||(typeof document==='undefined'?null:document);
|
|
64085
|
+
return doc?doc.querySelector(container):null;
|
|
64086
|
+
}
|
|
64087
|
+
function inert(){
|
|
64088
|
+
return{
|
|
64089
|
+
element:()=>null,
|
|
64090
|
+
value:()=>null,
|
|
64091
|
+
refresh(){},
|
|
64092
|
+
destroy(){},
|
|
64093
|
+
};
|
|
64094
|
+
}
|
|
64095
|
+
});
|
|
63038
64096
|
__def("packages/dom/src/index.js",function(__exports,__req){
|
|
63039
64097
|
'use strict';
|
|
63040
64098
|
Object.defineProperty(__exports,"LatticeGrid",{enumerable:true,get:function(){return LatticeGrid;}});
|
|
@@ -63057,6 +64115,10 @@ const serialiseState=__m4["serialiseState"];
|
|
|
63057
64115
|
const restoreState=__m4["restoreState"];
|
|
63058
64116
|
Object.defineProperty(__exports,"createGrid",{enumerable:true,get:function(){return __m0["createGrid"];}});
|
|
63059
64117
|
Object.defineProperty(__exports,"gridElementsWithin",{enumerable:true,get:function(){return __m0["gridElementsWithin"];}});
|
|
64118
|
+
const __m5=__req("packages/dom/src/stat.js");
|
|
64119
|
+
Object.defineProperty(__exports,"createStat",{enumerable:true,get:function(){return __m5["createStat"];}});
|
|
64120
|
+
Object.defineProperty(__exports,"deltaOf",{enumerable:true,get:function(){return __m5["deltaOf"];}});
|
|
64121
|
+
Object.defineProperty(__exports,"toneOf",{enumerable:true,get:function(){return __m5["toneOf"];}});
|
|
63060
64122
|
Object.defineProperty(__exports,"readTable",{enumerable:true,get:function(){return __m1["readTable"];}});
|
|
63061
64123
|
Object.defineProperty(__exports,"hydrateTable",{enumerable:true,get:function(){return __m1["hydrateTable"];}});
|
|
63062
64124
|
Object.defineProperty(__exports,"autoInit",{enumerable:true,get:function(){return __m2["autoInit"];}});
|
|
@@ -63165,71 +64227,71 @@ Object.defineProperty(__exports,"STATE_VERSION",{enumerable:true,get:function(){
|
|
|
63165
64227
|
Object.defineProperty(__exports,"serialiseState",{enumerable:true,get:function(){return __m4["serialiseState"];}});
|
|
63166
64228
|
Object.defineProperty(__exports,"restoreState",{enumerable:true,get:function(){return __m4["restoreState"];}});
|
|
63167
64229
|
Object.defineProperty(__exports,"VERSION",{enumerable:true,get:function(){return __m4["VERSION"];}});
|
|
63168
|
-
const
|
|
63169
|
-
Object.defineProperty(__exports,"DomRenderer",{enumerable:true,get:function(){return
|
|
63170
|
-
const
|
|
63171
|
-
Object.defineProperty(__exports,"FilterMenu",{enumerable:true,get:function(){return
|
|
63172
|
-
Object.defineProperty(__exports,"mergeColumnFilter",{enumerable:true,get:function(){return
|
|
63173
|
-
Object.defineProperty(__exports,"branchFor",{enumerable:true,get:function(){return
|
|
63174
|
-
const
|
|
63175
|
-
Object.defineProperty(__exports,"ColumnMenu",{enumerable:true,get:function(){return
|
|
63176
|
-
Object.defineProperty(__exports,"columnMenuItems",{enumerable:true,get:function(){return
|
|
63177
|
-
Object.defineProperty(__exports,"cellMenuItems",{enumerable:true,get:function(){return
|
|
63178
|
-
Object.defineProperty(__exports,"autoGroupMenuItems",{enumerable:true,get:function(){return
|
|
63179
|
-
const
|
|
63180
|
-
Object.defineProperty(__exports,"AlignedGrids",{enumerable:true,get:function(){return
|
|
63181
|
-
Object.defineProperty(__exports,"alignGrids",{enumerable:true,get:function(){return
|
|
63182
|
-
Object.defineProperty(__exports,"layoutState",{enumerable:true,get:function(){return
|
|
63183
|
-
const
|
|
63184
|
-
Object.defineProperty(__exports,"ToolPanelDock",{enumerable:true,get:function(){return
|
|
63185
|
-
Object.defineProperty(__exports,"panelHost",{enumerable:true,get:function(){return
|
|
63186
|
-
Object.defineProperty(__exports,"mountPanel",{enumerable:true,get:function(){return
|
|
63187
|
-
const
|
|
63188
|
-
Object.defineProperty(__exports,"CellEditController",{enumerable:true,get:function(){return
|
|
63189
|
-
const
|
|
63190
|
-
Object.defineProperty(__exports,"EditBar",{enumerable:true,get:function(){return
|
|
63191
|
-
const
|
|
63192
|
-
Object.defineProperty(__exports,"HistoryBar",{enumerable:true,get:function(){return
|
|
63193
|
-
Object.defineProperty(__exports,"HISTORY_CLS",{enumerable:true,get:function(){return
|
|
63194
|
-
const
|
|
63195
|
-
Object.defineProperty(__exports,"DiffPainter",{enumerable:true,get:function(){return
|
|
63196
|
-
const
|
|
63197
|
-
Object.defineProperty(__exports,"ViewPicker",{enumerable:true,get:function(){return
|
|
63198
|
-
Object.defineProperty(__exports,"VIEW_CLS",{enumerable:true,get:function(){return
|
|
63199
|
-
Object.defineProperty(__exports,"summariseDiff",{enumerable:true,get:function(){return
|
|
63200
|
-
const
|
|
63201
|
-
Object.defineProperty(__exports,"PromptBar",{enumerable:true,get:function(){return
|
|
63202
|
-
Object.defineProperty(__exports,"PROMPT_CLASS",{enumerable:true,get:function(){return
|
|
63203
|
-
const
|
|
63204
|
-
Object.defineProperty(__exports,"createCellLayer",{enumerable:true,get:function(){return
|
|
63205
|
-
Object.defineProperty(__exports,"compileTemplate",{enumerable:true,get:function(){return
|
|
63206
|
-
Object.defineProperty(__exports,"compileVariant",{enumerable:true,get:function(){return
|
|
63207
|
-
Object.defineProperty(__exports,"checkVariant",{enumerable:true,get:function(){return
|
|
63208
|
-
Object.defineProperty(__exports,"VariantRegistry",{enumerable:true,get:function(){return
|
|
63209
|
-
Object.defineProperty(__exports,"BUILTIN_RENDERERS",{enumerable:true,get:function(){return
|
|
63210
|
-
Object.defineProperty(__exports,"BUILTIN_VARIANTS",{enumerable:true,get:function(){return
|
|
63211
|
-
Object.defineProperty(__exports,"BUILTIN_PIPES",{enumerable:true,get:function(){return
|
|
63212
|
-
const
|
|
63213
|
-
Object.defineProperty(__exports,"editors",{enumerable:true,get:function(){return
|
|
63214
|
-
Object.defineProperty(__exports,"createEditor",{enumerable:true,get:function(){return
|
|
63215
|
-
Object.defineProperty(__exports,"editorFor",{enumerable:true,get:function(){return
|
|
63216
|
-
Object.defineProperty(__exports,"BaseEditor",{enumerable:true,get:function(){return
|
|
63217
|
-
const
|
|
63218
|
-
Object.defineProperty(__exports,"filters",{enumerable:true,get:function(){return
|
|
63219
|
-
Object.defineProperty(__exports,"createFilter",{enumerable:true,get:function(){return
|
|
63220
|
-
Object.defineProperty(__exports,"filterFor",{enumerable:true,get:function(){return
|
|
63221
|
-
Object.defineProperty(__exports,"parseExpression",{enumerable:true,get:function(){return
|
|
63222
|
-
const
|
|
63223
|
-
Object.defineProperty(__exports,"StatusBar",{enumerable:true,get:function(){return
|
|
63224
|
-
Object.defineProperty(__exports,"ContextMenu",{enumerable:true,get:function(){return
|
|
63225
|
-
Object.defineProperty(__exports,"ToolPanel",{enumerable:true,get:function(){return
|
|
63226
|
-
Object.defineProperty(__exports,"TooltipManager",{enumerable:true,get:function(){return
|
|
63227
|
-
Object.defineProperty(__exports,"Pagination",{enumerable:true,get:function(){return
|
|
63228
|
-
Object.defineProperty(__exports,"OverlayLayer",{enumerable:true,get:function(){return
|
|
63229
|
-
const
|
|
63230
|
-
Object.defineProperty(__exports,"setLicense",{enumerable:true,get:function(){return
|
|
63231
|
-
Object.defineProperty(__exports,"licenseInfo",{enumerable:true,get:function(){return
|
|
63232
|
-
Object.defineProperty(__exports,"licenseState",{enumerable:true,get:function(){return
|
|
64230
|
+
const __m6=__req("packages/dom/src/renderer/index.js");
|
|
64231
|
+
Object.defineProperty(__exports,"DomRenderer",{enumerable:true,get:function(){return __m6["DomRenderer"];}});
|
|
64232
|
+
const __m7=__req("packages/dom/src/filtermenu.js");
|
|
64233
|
+
Object.defineProperty(__exports,"FilterMenu",{enumerable:true,get:function(){return __m7["FilterMenu"];}});
|
|
64234
|
+
Object.defineProperty(__exports,"mergeColumnFilter",{enumerable:true,get:function(){return __m7["mergeColumnFilter"];}});
|
|
64235
|
+
Object.defineProperty(__exports,"branchFor",{enumerable:true,get:function(){return __m7["branchFor"];}});
|
|
64236
|
+
const __m8=__req("packages/dom/src/columnmenu.js");
|
|
64237
|
+
Object.defineProperty(__exports,"ColumnMenu",{enumerable:true,get:function(){return __m8["ColumnMenu"];}});
|
|
64238
|
+
Object.defineProperty(__exports,"columnMenuItems",{enumerable:true,get:function(){return __m8["columnMenuItems"];}});
|
|
64239
|
+
Object.defineProperty(__exports,"cellMenuItems",{enumerable:true,get:function(){return __m8["cellMenuItems"];}});
|
|
64240
|
+
Object.defineProperty(__exports,"autoGroupMenuItems",{enumerable:true,get:function(){return __m8["autoGroupMenuItems"];}});
|
|
64241
|
+
const __m9=__req("packages/dom/src/alignedgrids.js");
|
|
64242
|
+
Object.defineProperty(__exports,"AlignedGrids",{enumerable:true,get:function(){return __m9["AlignedGrids"];}});
|
|
64243
|
+
Object.defineProperty(__exports,"alignGrids",{enumerable:true,get:function(){return __m9["alignGrids"];}});
|
|
64244
|
+
Object.defineProperty(__exports,"layoutState",{enumerable:true,get:function(){return __m9["layoutState"];}});
|
|
64245
|
+
const __m10=__req("packages/dom/src/toolpanelmount.js");
|
|
64246
|
+
Object.defineProperty(__exports,"ToolPanelDock",{enumerable:true,get:function(){return __m10["ToolPanelDock"];}});
|
|
64247
|
+
Object.defineProperty(__exports,"panelHost",{enumerable:true,get:function(){return __m10["panelHost"];}});
|
|
64248
|
+
Object.defineProperty(__exports,"mountPanel",{enumerable:true,get:function(){return __m10["mountPanel"];}});
|
|
64249
|
+
const __m11=__req("packages/dom/src/celledit.js");
|
|
64250
|
+
Object.defineProperty(__exports,"CellEditController",{enumerable:true,get:function(){return __m11["CellEditController"];}});
|
|
64251
|
+
const __m12=__req("packages/dom/src/editbar.js");
|
|
64252
|
+
Object.defineProperty(__exports,"EditBar",{enumerable:true,get:function(){return __m12["EditBar"];}});
|
|
64253
|
+
const __m13=__req("packages/dom/src/historybar.js");
|
|
64254
|
+
Object.defineProperty(__exports,"HistoryBar",{enumerable:true,get:function(){return __m13["HistoryBar"];}});
|
|
64255
|
+
Object.defineProperty(__exports,"HISTORY_CLS",{enumerable:true,get:function(){return __m13["HISTORY_CLS"];}});
|
|
64256
|
+
const __m14=__req("packages/dom/src/diffpaint.js");
|
|
64257
|
+
Object.defineProperty(__exports,"DiffPainter",{enumerable:true,get:function(){return __m14["DiffPainter"];}});
|
|
64258
|
+
const __m15=__req("packages/dom/src/viewpicker.js");
|
|
64259
|
+
Object.defineProperty(__exports,"ViewPicker",{enumerable:true,get:function(){return __m15["ViewPicker"];}});
|
|
64260
|
+
Object.defineProperty(__exports,"VIEW_CLS",{enumerable:true,get:function(){return __m15["VIEW_CLS"];}});
|
|
64261
|
+
Object.defineProperty(__exports,"summariseDiff",{enumerable:true,get:function(){return __m15["summariseDiff"];}});
|
|
64262
|
+
const __m16=__req("packages/dom/src/promptbar.js");
|
|
64263
|
+
Object.defineProperty(__exports,"PromptBar",{enumerable:true,get:function(){return __m16["PromptBar"];}});
|
|
64264
|
+
Object.defineProperty(__exports,"PROMPT_CLASS",{enumerable:true,get:function(){return __m16["PROMPT_CLASS"];}});
|
|
64265
|
+
const __m17=__req("packages/dom/src/cell/index.js");
|
|
64266
|
+
Object.defineProperty(__exports,"createCellLayer",{enumerable:true,get:function(){return __m17["createCellLayer"];}});
|
|
64267
|
+
Object.defineProperty(__exports,"compileTemplate",{enumerable:true,get:function(){return __m17["compileTemplate"];}});
|
|
64268
|
+
Object.defineProperty(__exports,"compileVariant",{enumerable:true,get:function(){return __m17["compileVariant"];}});
|
|
64269
|
+
Object.defineProperty(__exports,"checkVariant",{enumerable:true,get:function(){return __m17["checkVariant"];}});
|
|
64270
|
+
Object.defineProperty(__exports,"VariantRegistry",{enumerable:true,get:function(){return __m17["VariantRegistry"];}});
|
|
64271
|
+
Object.defineProperty(__exports,"BUILTIN_RENDERERS",{enumerable:true,get:function(){return __m17["BUILTIN_RENDERERS"];}});
|
|
64272
|
+
Object.defineProperty(__exports,"BUILTIN_VARIANTS",{enumerable:true,get:function(){return __m17["BUILTIN_VARIANTS"];}});
|
|
64273
|
+
Object.defineProperty(__exports,"BUILTIN_PIPES",{enumerable:true,get:function(){return __m17["BUILTIN_PIPES"];}});
|
|
64274
|
+
const __m18=__req("packages/dom/src/editors/index.js");
|
|
64275
|
+
Object.defineProperty(__exports,"editors",{enumerable:true,get:function(){return __m18["editors"];}});
|
|
64276
|
+
Object.defineProperty(__exports,"createEditor",{enumerable:true,get:function(){return __m18["createEditor"];}});
|
|
64277
|
+
Object.defineProperty(__exports,"editorFor",{enumerable:true,get:function(){return __m18["editorFor"];}});
|
|
64278
|
+
Object.defineProperty(__exports,"BaseEditor",{enumerable:true,get:function(){return __m18["BaseEditor"];}});
|
|
64279
|
+
const __m19=__req("packages/dom/src/filters/index.js");
|
|
64280
|
+
Object.defineProperty(__exports,"filters",{enumerable:true,get:function(){return __m19["filters"];}});
|
|
64281
|
+
Object.defineProperty(__exports,"createFilter",{enumerable:true,get:function(){return __m19["createFilter"];}});
|
|
64282
|
+
Object.defineProperty(__exports,"filterFor",{enumerable:true,get:function(){return __m19["filterFor"];}});
|
|
64283
|
+
Object.defineProperty(__exports,"parseExpression",{enumerable:true,get:function(){return __m19["parseExpression"];}});
|
|
64284
|
+
const __m20=__req("packages/dom/src/ui/index.js");
|
|
64285
|
+
Object.defineProperty(__exports,"StatusBar",{enumerable:true,get:function(){return __m20["StatusBar"];}});
|
|
64286
|
+
Object.defineProperty(__exports,"ContextMenu",{enumerable:true,get:function(){return __m20["ContextMenu"];}});
|
|
64287
|
+
Object.defineProperty(__exports,"ToolPanel",{enumerable:true,get:function(){return __m20["ToolPanel"];}});
|
|
64288
|
+
Object.defineProperty(__exports,"TooltipManager",{enumerable:true,get:function(){return __m20["TooltipManager"];}});
|
|
64289
|
+
Object.defineProperty(__exports,"Pagination",{enumerable:true,get:function(){return __m20["Pagination"];}});
|
|
64290
|
+
Object.defineProperty(__exports,"OverlayLayer",{enumerable:true,get:function(){return __m20["OverlayLayer"];}});
|
|
64291
|
+
const __m21=__req("packages/core/src/registry/licence.js");
|
|
64292
|
+
Object.defineProperty(__exports,"setLicense",{enumerable:true,get:function(){return __m21["setLicence"];}});
|
|
64293
|
+
Object.defineProperty(__exports,"licenseInfo",{enumerable:true,get:function(){return __m21["licenceInfo"];}});
|
|
64294
|
+
Object.defineProperty(__exports,"licenseState",{enumerable:true,get:function(){return __m21["licenceState"];}});
|
|
63233
64295
|
const LatticeGrid={
|
|
63234
64296
|
createGrid,
|
|
63235
64297
|
createHeadlessGrid,
|