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