@toclocoinc/lattice-grid 1.13.0 → 1.14.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 +1 -1
- package/docs/API.html +592 -2
- package/docs/api-detail.html +276 -2
- package/lattice-grid.d.ts +30 -7
- package/lattice-grid.esm.min.js +158 -2
- package/lattice-grid.min.cjs +158 -2
- package/lattice-grid.min.js +158 -2
- package/modules/charts.esm.min.js +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/dhtmlx-compat.esm.min.js +227 -31
- package/modules/htmx.esm.min.js +158 -2
- package/modules/htmx.min.cjs +158 -2
- package/modules/htmx.min.js +158 -2
- package/modules/react.esm.min.js +26 -11
- package/modules/svelte.esm.min.js +26 -11
- package/modules/vue.esm.min.js +26 -11
- package/modules/webcomponent.esm.min.js +158 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.14.0, webcomponent module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
@@ -1428,7 +1428,7 @@ return{valid:false,...info,reason:'product'};
|
|
|
1428
1428
|
}
|
|
1429
1429
|
if(isExpired(parsed.expires,at)){
|
|
1430
1430
|
if(warn){
|
|
1431
|
-
warnOnce('licence.expired',`licence expired on ${parsed.expires}. The grid will render with a watermark. Renew at
|
|
1431
|
+
warnOnce('licence.expired',`licence expired on ${parsed.expires}. The grid will render with a watermark. Renew at latticegrid.dev.`);
|
|
1432
1432
|
}
|
|
1433
1433
|
return{valid:false,...info,reason:'expired'};
|
|
1434
1434
|
}
|
|
@@ -27081,6 +27081,123 @@ return out;
|
|
|
27081
27081
|
}
|
|
27082
27082
|
return value;
|
|
27083
27083
|
}
|
|
27084
|
+
function describeValue(value){
|
|
27085
|
+
if(value===null)return'null';
|
|
27086
|
+
if(Array.isArray(value))return`an array of ${value.length}`;
|
|
27087
|
+
const kind=typeof value;
|
|
27088
|
+
if(kind==='string')return`the string '${value.length>24?`${value.slice(0,24)}…`:value}'`;
|
|
27089
|
+
if(kind==='number'||kind==='boolean')return`the ${kind} ${String(value)}`;
|
|
27090
|
+
return`a ${kind}`;
|
|
27091
|
+
}
|
|
27092
|
+
const CONFIG_SHAPES=Object.freeze({
|
|
27093
|
+
allowUnsafeTemplates:'boolean',
|
|
27094
|
+
columnVirtualisationAbove:'number',
|
|
27095
|
+
groupFooter:'boolean',
|
|
27096
|
+
headerHeight:'number',
|
|
27097
|
+
licence:'string',
|
|
27098
|
+
locale:'string',
|
|
27099
|
+
maximise:'boolean',
|
|
27100
|
+
overscan:'number',
|
|
27101
|
+
quickFilterText:'string',
|
|
27102
|
+
sampleSize:'number',
|
|
27103
|
+
sharedMemory:'boolean',
|
|
27104
|
+
shortcuts:'boolean',
|
|
27105
|
+
showColumnFunctions:'boolean',
|
|
27106
|
+
showHeader:'boolean',
|
|
27107
|
+
showTotalInHeader:'boolean',
|
|
27108
|
+
targetSize:['default','large'],
|
|
27109
|
+
timeZone:'string',
|
|
27110
|
+
title:'string',
|
|
27111
|
+
totalFilteredOnly:'boolean',
|
|
27112
|
+
totalOnlyChangedColumns:'boolean',
|
|
27113
|
+
useWorker:'boolean',
|
|
27114
|
+
workerThreshold:'number',
|
|
27115
|
+
workerUrl:'string',
|
|
27116
|
+
});
|
|
27117
|
+
function isPlainObject(v){
|
|
27118
|
+
return v!==null&&typeof v==='object'&&!Array.isArray(v);
|
|
27119
|
+
}
|
|
27120
|
+
const CONFIG_WIDE_CHECKS=Object.freeze({
|
|
27121
|
+
columns:(v)=>!Array.isArray(v),
|
|
27122
|
+
columnGroups:(v)=>!Array.isArray(v),
|
|
27123
|
+
rows:(v)=>!Array.isArray(v),
|
|
27124
|
+
pinnedTopRows:(v)=>!Array.isArray(v),
|
|
27125
|
+
pinnedBottomRows:(v)=>!Array.isArray(v),
|
|
27126
|
+
alignedGrids:(v)=>!Array.isArray(v),
|
|
27127
|
+
rowKey:(v)=>typeof v!=='string'&&typeof v!=='function',
|
|
27128
|
+
rowHeight:(v)=>typeof v!=='number'&&typeof v!=='function',
|
|
27129
|
+
source:(v)=>!isPlainObject(v),
|
|
27130
|
+
columnDefaults:(v)=>!isPlainObject(v),
|
|
27131
|
+
columnPresets:(v)=>!isPlainObject(v),
|
|
27132
|
+
dataTypes:(v)=>!isPlainObject(v),
|
|
27133
|
+
components:(v)=>!isPlainObject(v),
|
|
27134
|
+
pipes:(v)=>!isPlainObject(v),
|
|
27135
|
+
totalFns:(v)=>!isPlainObject(v),
|
|
27136
|
+
variants:(v)=>!isPlainObject(v),
|
|
27137
|
+
formulaFunctions:(v)=>!isPlainObject(v),
|
|
27138
|
+
typeOptions:(v)=>!isPlainObject(v),
|
|
27139
|
+
formatting:(v)=>!isPlainObject(v),
|
|
27140
|
+
tree:(v)=>!isPlainObject(v),
|
|
27141
|
+
detail:(v)=>!isPlainObject(v),
|
|
27142
|
+
comments:(v)=>!isPlainObject(v),
|
|
27143
|
+
presence:(v)=>!isPlainObject(v),
|
|
27144
|
+
permissions:(v)=>!isPlainObject(v),
|
|
27145
|
+
state:(v)=>!isPlainObject(v),
|
|
27146
|
+
updates:(v)=>!isPlainObject(v),
|
|
27147
|
+
diff:(v)=>!isPlainObject(v),
|
|
27148
|
+
views:(v)=>!isPlainObject(v),
|
|
27149
|
+
responsive:(v)=>!isPlainObject(v),
|
|
27150
|
+
hostFilter:(v)=>!isPlainObject(v),
|
|
27151
|
+
pivot:(v)=>!isPlainObject(v),
|
|
27152
|
+
ai:(v)=>!isPlainObject(v),
|
|
27153
|
+
environment:(v)=>typeof v!=='function',
|
|
27154
|
+
edit:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27155
|
+
pagination:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27156
|
+
facets:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27157
|
+
rowForm:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27158
|
+
rowReorder:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27159
|
+
columnTagFilter:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27160
|
+
historyBar:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27161
|
+
rowTransfer:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27162
|
+
statusBar:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27163
|
+
toolPanel:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27164
|
+
stickyGroupHeaders:(v)=>!isPlainObject(v)&&typeof v!=='boolean'&&typeof v!=='number',
|
|
27165
|
+
contextMenu:(v)=>typeof v!=='boolean'&&typeof v!=='function',
|
|
27166
|
+
columnMenu:(v)=>typeof v!=='boolean'&&typeof v!=='function',
|
|
27167
|
+
fullWidth:(v)=>!isPlainObject(v)&&typeof v!=='boolean',
|
|
27168
|
+
highlightOnChange:(v)=>!isPlainObject(v)&&typeof v!=='boolean'&&typeof v!=='string',
|
|
27169
|
+
rowTemplate:(v)=>!isPlainObject(v)&&typeof v!=='string',
|
|
27170
|
+
cornerRadius:(v)=>typeof v!=='boolean'&&typeof v!=='number'&&typeof v!=='string',
|
|
27171
|
+
grandTotalRow:(v)=>v!=='bottom'&&typeof v!=='boolean',
|
|
27172
|
+
autoHeight:(v)=>v!=='visible'&&typeof v!=='boolean',
|
|
27173
|
+
gridLines:(v)=>!['both','horizontal','vertical','none','rows','columns'].includes(
|
|
27174
|
+
(v),
|
|
27175
|
+
)&&typeof v!=='boolean',
|
|
27176
|
+
selection:(v)=>!isPlainObject(v)
|
|
27177
|
+
&&v!=='single'&&v!=='multiple'&&v!=='none',
|
|
27178
|
+
density:(v)=>typeof v!=='number'
|
|
27179
|
+
&&!['compact','standard','comfortable','spacious'].includes((v)),
|
|
27180
|
+
theme:(v)=>typeof v!=='string',
|
|
27181
|
+
rowClass:(v)=>typeof v!=='string'&&typeof v!=='function'&&!Array.isArray(v),
|
|
27182
|
+
rowStyle:(v)=>!isPlainObject(v)&&typeof v!=='function',
|
|
27183
|
+
});
|
|
27184
|
+
const KNOWN_CONFIG_KEYS=new Set([
|
|
27185
|
+
'ai','alignedGrids','allowUnsafeTemplates','autoHeight','columnDefaults',
|
|
27186
|
+
'columnGroups','columnMenu','columnPresets','columnTagFilter',
|
|
27187
|
+
'columnVirtualisationAbove','columns','comments','components','context',
|
|
27188
|
+
'contextMenu','cornerRadius','dataTypes','density','detail','diff','edit',
|
|
27189
|
+
'environment','facets','formatting','formulaFunctions','fullWidth',
|
|
27190
|
+
'grandTotalRow','gridLines','groupFooter','headerHeight','highlightOnChange',
|
|
27191
|
+
'historyBar','hostFilter','licence','locale','maximise','overscan','pagination',
|
|
27192
|
+
'permissions','pinnedBottomRows','pinnedTopRows','pipes','pivot','presence',
|
|
27193
|
+
'quickFilterText','responsive','rowClass','rowForm','rowHeight','rowKey',
|
|
27194
|
+
'rowReorder','rowStyle','rowTemplate','rowTransfer','rows','sampleSize',
|
|
27195
|
+
'selection','sharedMemory','shortcuts','showColumnFunctions','showHeader',
|
|
27196
|
+
'showTotalInHeader','source','state','statusBar','stickyGroupHeaders',
|
|
27197
|
+
'targetSize','theme','timeZone','title','toolPanel','totalFilteredOnly',
|
|
27198
|
+
'totalFns','totalOnlyChangedColumns','tree','typeOptions','updates','useWorker',
|
|
27199
|
+
'variants','views','workerThreshold','workerUrl',
|
|
27200
|
+
]);
|
|
27084
27201
|
const CONFIG_DEFAULTS=Object.freeze({
|
|
27085
27202
|
locale:undefined,
|
|
27086
27203
|
messages:undefined,
|
|
@@ -27178,6 +27295,45 @@ pageSize:0,
|
|
|
27178
27295
|
#ready=false;
|
|
27179
27296
|
#teardown=new Set();
|
|
27180
27297
|
constructor(config={}){
|
|
27298
|
+
for(const key of Object.keys(config)){
|
|
27299
|
+
if(!KNOWN_CONFIG_KEYS.has(key)){
|
|
27300
|
+
warnOnce(
|
|
27301
|
+
`config.unknown:${key}`,
|
|
27302
|
+
`'${key}' is not a configuration key this grid recognises, so it had no `
|
|
27303
|
+
+'effect. Check the spelling against the reference.',
|
|
27304
|
+
);
|
|
27305
|
+
continue;
|
|
27306
|
+
}
|
|
27307
|
+
const shape=CONFIG_SHAPES[key];
|
|
27308
|
+
const value=config[key];
|
|
27309
|
+
if(value===undefined)continue;
|
|
27310
|
+
if(shape===undefined){
|
|
27311
|
+
const unusable=CONFIG_WIDE_CHECKS[key];
|
|
27312
|
+
if(unusable&&unusable(value)){
|
|
27313
|
+
warnOnce(
|
|
27314
|
+
`config.value:${key}`,
|
|
27315
|
+
`'${key}' was given ${describeValue(value)}, which is not one of the `
|
|
27316
|
+
+'shapes it accepts. Check the type against the reference.',
|
|
27317
|
+
);
|
|
27318
|
+
}
|
|
27319
|
+
continue;
|
|
27320
|
+
}
|
|
27321
|
+
if(Array.isArray(shape)){
|
|
27322
|
+
if(!shape.includes(value)){
|
|
27323
|
+
warnOnce(
|
|
27324
|
+
`config.value:${key}`,
|
|
27325
|
+
`'${key}' was given ${describeValue(value)}, which is not one of `
|
|
27326
|
+
+`${shape.map((v)=>`'${v}'`).join(', ')}. It was ignored.`,
|
|
27327
|
+
);
|
|
27328
|
+
}
|
|
27329
|
+
}else if(typeof value!==shape){
|
|
27330
|
+
warnOnce(
|
|
27331
|
+
`config.value:${key}`,
|
|
27332
|
+
`'${key}' expects a ${shape} and was given ${describeValue(value)}. `
|
|
27333
|
+
+'It was ignored.',
|
|
27334
|
+
);
|
|
27335
|
+
}
|
|
27336
|
+
}
|
|
27181
27337
|
this.#config={...CONFIG_DEFAULTS,...config};
|
|
27182
27338
|
this.#suppliedConfig={...config};
|
|
27183
27339
|
this.#bus=new EventBus();
|