@nanoporetech-digital/components 4.8.0 → 4.9.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/CHANGELOG.md +16 -0
- package/dist/cjs/{nano-table-8ac4ae00.js → nano-table-c0eb1f40.js} +12 -10
- package/dist/cjs/nano-table-c0eb1f40.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{table.worker-f8d9d66b.js → table.worker-444f9491.js} +3 -3
- package/dist/cjs/table.worker-444f9491.js.map +1 -0
- package/dist/cjs/table.worker-c784fdac.js +4 -0
- package/dist/collection/components/table/table-interface.js.map +1 -1
- package/dist/collection/components/table/table.cell.js +1 -1
- package/dist/collection/components/table/table.cell.js.map +1 -1
- package/dist/collection/components/table/table.header.js +3 -3
- package/dist/collection/components/table/table.header.js.map +1 -1
- package/dist/collection/components/table/table.js +6 -3
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.store.js +2 -2
- package/dist/collection/components/table/table.store.js.map +1 -1
- package/dist/collection/components/table/table.worker.js +69 -65
- package/dist/collection/components/table/table.worker.js.map +1 -1
- package/dist/components/table.js +12 -9
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.worker.js +1 -1
- package/dist/esm/{nano-table-2b97d794.js → nano-table-c5d30202.js} +12 -10
- package/dist/esm/nano-table-c5d30202.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/table.worker-c784fdac.js +4 -0
- package/dist/esm/{table.worker-6eec124e.js → table.worker-fee0d673.js} +3 -3
- package/dist/esm/table.worker-fee0d673.js.map +1 -0
- package/dist/nano-assets/fonts/MHeiPRCBold_normal_normal.woff +0 -0
- package/dist/nano-assets/fonts/MHeiPRCBold_normal_normal.woff2 +0 -0
- package/dist/nano-assets/fonts/MHeiPRCHeavy_normal_normal.woff +0 -0
- package/dist/nano-assets/fonts/MHeiPRCHeavy_normal_normal.woff2 +0 -0
- package/dist/nano-assets/fonts/MHeiPRCLight_normal_normal.woff +0 -0
- package/dist/nano-assets/fonts/MHeiPRCLight_normal_normal.woff2 +0 -0
- package/dist/nano-assets/fonts/MHeiPRCMedium_normal_normal.woff +0 -0
- package/dist/nano-assets/fonts/MHeiPRCMedium_normal_normal.woff2 +0 -0
- package/dist/nano-assets/hash.txt +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/p-08c62411.js +5 -0
- package/dist/nano-components/p-08c62411.js.map +1 -0
- package/dist/nano-components/{p-0af67aaf.entry.js → p-8157414f.entry.js} +2 -2
- package/dist/nano-components/{p-7c43c880.js → p-aeb1d0a0.js} +2 -2
- package/dist/nano-components/p-c784fdac.js +4 -0
- package/dist/themes/nanopore.cn.css +1 -1
- package/dist/themes/nanopore.cn.css.map +1 -1
- package/dist/types/components/table/table-interface.d.ts +1 -1
- package/dist/types/components/table/table.worker.d.ts +3 -3
- package/docs-json.json +1 -1
- package/hydrate/index.js +137 -124
- package/package.json +3 -3
- package/dist/cjs/nano-table-8ac4ae00.js.map +0 -1
- package/dist/cjs/table.worker-e2f9ccfa.js +0 -4
- package/dist/cjs/table.worker-f8d9d66b.js.map +0 -1
- package/dist/esm/nano-table-2b97d794.js.map +0 -1
- package/dist/esm/table.worker-6eec124e.js.map +0 -1
- package/dist/esm/table.worker-e2f9ccfa.js +0 -4
- package/dist/nano-components/p-c83c8784.js +0 -5
- package/dist/nano-components/p-c83c8784.js.map +0 -1
- package/dist/nano-components/p-e2f9ccfa.js +0 -4
- /package/dist/nano-components/{p-0af67aaf.entry.js.map → p-8157414f.entry.js.map} +0 -0
- /package/dist/nano-components/{p-7c43c880.js.map → p-aeb1d0a0.js.map} +0 -0
package/hydrate/index.js
CHANGED
@@ -29099,17 +29099,17 @@ function nativeMatch(element, keyword) {
|
|
29099
29099
|
* RecursiveMatch.
|
29100
29100
|
*
|
29101
29101
|
* @param element - String | number | Record<string, string>.
|
29102
|
-
* @param
|
29102
|
+
* @param criterion - Criterion.
|
29103
29103
|
* @param keys - String[].
|
29104
29104
|
* @param options - Object.
|
29105
29105
|
* @param options.ignorePaths - RegExp[].
|
29106
29106
|
* @returns Boolean.
|
29107
29107
|
*/
|
29108
|
-
function recursiveMatch(element,
|
29108
|
+
function recursiveMatch(element, criterion, keys, options) {
|
29109
29109
|
if (typeof element === 'object') {
|
29110
29110
|
if (Array.isArray(element)) {
|
29111
29111
|
for (const elm of element) {
|
29112
|
-
if (recursiveMatch(elm,
|
29112
|
+
if (recursiveMatch(elm, criterion, keys, options)) {
|
29113
29113
|
return true;
|
29114
29114
|
}
|
29115
29115
|
}
|
@@ -29117,16 +29117,16 @@ function recursiveMatch(element, criterium, keys, options) {
|
|
29117
29117
|
else {
|
29118
29118
|
for (const i in element) {
|
29119
29119
|
keys.push(i);
|
29120
|
-
const didMatch = recursiveMatch(element[i],
|
29120
|
+
const didMatch = recursiveMatch(element[i], criterion, keys, options);
|
29121
29121
|
keys.pop();
|
29122
29122
|
if (didMatch)
|
29123
29123
|
return true;
|
29124
29124
|
}
|
29125
29125
|
}
|
29126
29126
|
}
|
29127
|
-
else if (
|
29127
|
+
else if (criterion.type === 'exists') {
|
29128
29128
|
// we check for the presence of a key (jpath)
|
29129
|
-
if (
|
29129
|
+
if (criterion.key.test(keys.join('.'))) {
|
29130
29130
|
return !!element;
|
29131
29131
|
}
|
29132
29132
|
else {
|
@@ -29151,11 +29151,11 @@ function recursiveMatch(element, criterium, keys, options) {
|
|
29151
29151
|
if (!included)
|
29152
29152
|
return false;
|
29153
29153
|
}
|
29154
|
-
if (
|
29155
|
-
if (!
|
29154
|
+
if (criterion.key) {
|
29155
|
+
if (!criterion.key.test(joinedKeys))
|
29156
29156
|
return false;
|
29157
29157
|
}
|
29158
|
-
return nativeMatch(element,
|
29158
|
+
return nativeMatch(element, criterion);
|
29159
29159
|
}
|
29160
29160
|
return false;
|
29161
29161
|
}
|
@@ -29297,7 +29297,7 @@ function getCheckNumber(keyword) {
|
|
29297
29297
|
* @internal
|
29298
29298
|
*/
|
29299
29299
|
function splitNumberOperator(keyword) {
|
29300
|
-
const match = /^\s*\(?\s*(?<startOperator
|
29300
|
+
const match = /^\s*\(?\s*(?<startOperator><=|>=|<|=|>|\.\.\s*)?\s*(?<firstValue>-?\d*\.?\d+)\s*(?:(?<afterDots>\.\.)\s*(?<secondValue>-?\d*\.?\d*))?\s*\)?\s*$/.exec(keyword);
|
29301
29301
|
if (!match) {
|
29302
29302
|
return {
|
29303
29303
|
operator: '=',
|
@@ -29416,7 +29416,7 @@ function splitStringOperator(keyword) {
|
|
29416
29416
|
throw new Error('unreachable');
|
29417
29417
|
}
|
29418
29418
|
let { operator, value } = match.groups;
|
29419
|
-
let secondQuery = parts[1];
|
29419
|
+
let secondQuery = parts[1]?.trim();
|
29420
29420
|
let values = [value];
|
29421
29421
|
if (parts.length > 1) {
|
29422
29422
|
operator = '..';
|
@@ -29440,48 +29440,55 @@ function splitStringOperator(keyword) {
|
|
29440
29440
|
/**
|
29441
29441
|
* @internal
|
29442
29442
|
*/
|
29443
|
-
function
|
29444
|
-
|
29445
|
-
|
29446
|
-
|
29447
|
-
|
29448
|
-
|
29449
|
-
|
29450
|
-
|
29451
|
-
|
29452
|
-
|
29453
|
-
|
29454
|
-
|
29455
|
-
|
29456
|
-
|
29457
|
-
|
29458
|
-
|
29459
|
-
|
29460
|
-
|
29461
|
-
|
29462
|
-
|
29463
|
-
|
29464
|
-
|
29465
|
-
|
29443
|
+
function convertKeywordToCriterion(keyword, options = {
|
29444
|
+
pathAlias: {},
|
29445
|
+
}) {
|
29446
|
+
const { caseSensitive, pathAlias } = options;
|
29447
|
+
const regexpFlags = caseSensitive ? '' : 'i';
|
29448
|
+
let negate = false;
|
29449
|
+
if (keyword.startsWith('-')) {
|
29450
|
+
negate = true;
|
29451
|
+
keyword = keyword.substring(1);
|
29452
|
+
}
|
29453
|
+
const colon = keyword.indexOf(':');
|
29454
|
+
if (colon > -1) {
|
29455
|
+
const value = keyword.substring(colon + 1);
|
29456
|
+
if (colon > 0) {
|
29457
|
+
const key = keyword.substring(0, colon);
|
29458
|
+
if (key === 'is') {
|
29459
|
+
// a property path exists
|
29460
|
+
return {
|
29461
|
+
type: 'exists',
|
29462
|
+
negate,
|
29463
|
+
key: new RegExp(`(^|\\.)${lodash_escaperegexp(value)}(\\.|$)`, regexpFlags),
|
29464
|
+
};
|
29465
|
+
}
|
29466
|
+
else {
|
29467
|
+
return {
|
29468
|
+
type: 'matches',
|
29469
|
+
negate,
|
29470
|
+
key: pathAlias[key]
|
29471
|
+
? pathAlias[key]
|
29472
|
+
: new RegExp(`(^|\\.)${lodash_escaperegexp(key)}(\\.|$)`, regexpFlags),
|
29473
|
+
checkNumber: getCheckNumber(value),
|
29474
|
+
checkString: getCheckString(value, regexpFlags),
|
29475
|
+
};
|
29466
29476
|
}
|
29467
|
-
fillCriterion(criterion, value, insensitive);
|
29468
|
-
}
|
29469
|
-
else {
|
29470
|
-
fillCriterion(criterion, keyword, insensitive);
|
29471
29477
|
}
|
29472
|
-
|
29473
|
-
|
29478
|
+
}
|
29479
|
+
return {
|
29480
|
+
type: 'matches',
|
29481
|
+
negate,
|
29482
|
+
checkNumber: getCheckNumber(keyword),
|
29483
|
+
checkString: getCheckString(keyword, regexpFlags),
|
29484
|
+
};
|
29474
29485
|
}
|
29475
|
-
|
29476
|
-
|
29477
|
-
|
29478
|
-
|
29479
|
-
|
29480
|
-
|
29481
|
-
*/
|
29482
|
-
function fillCriterion(criterion, keyword, insensitive) {
|
29483
|
-
criterion.checkString = getCheckString(keyword, insensitive);
|
29484
|
-
criterion.checkNumber = getCheckNumber(keyword);
|
29486
|
+
function convertKeywordsToCriteria(keywords, options = {
|
29487
|
+
pathAlias: {},
|
29488
|
+
}) {
|
29489
|
+
return keywords.map((keyword) => {
|
29490
|
+
return convertKeywordToCriterion(keyword, options);
|
29491
|
+
});
|
29485
29492
|
}
|
29486
29493
|
|
29487
29494
|
/**
|
@@ -29540,7 +29547,7 @@ function filter$1(data, options = {}) {
|
|
29540
29547
|
keywords = charSplit(keywords, /[ \t\r\n]/);
|
29541
29548
|
}
|
29542
29549
|
const criteria = convertKeywordsToCriteria(keywords, {
|
29543
|
-
|
29550
|
+
caseSensitive: options.caseSensitive,
|
29544
29551
|
pathAlias,
|
29545
29552
|
});
|
29546
29553
|
let matched = 0;
|
@@ -29572,21 +29579,7 @@ function filter$1(data, options = {}) {
|
|
29572
29579
|
}
|
29573
29580
|
}
|
29574
29581
|
|
29575
|
-
// we'll do ordering and filtering in here
|
29576
|
-
// https://fusejs.io/demo.html
|
29577
|
-
//https://github.com/bvaughn/js-search
|
29578
|
-
// https://github.com/cheminfo/smart-array-filter
|
29579
|
-
// https://github.com/thundermiracle/filter-data
|
29580
|
-
function colsFromStore(safeColumns) {
|
29581
|
-
return safeColumns.map((c) => {
|
29582
|
-
if (!!c.sortCompareFn) {
|
29583
|
-
c.sortCompareFn = new Function('return ' + c.sortCompareFn)();
|
29584
|
-
}
|
29585
|
-
return c;
|
29586
|
-
});
|
29587
|
-
}
|
29588
29582
|
const dataWorkers = new Map();
|
29589
|
-
/** SETUP / SYNC */
|
29590
29583
|
function uid() {
|
29591
29584
|
return Date.now().toString(36) + Math.random().toString(36).substring(2);
|
29592
29585
|
}
|
@@ -29613,6 +29606,66 @@ async function syncConfigToWorker(workerId, columns) {
|
|
29613
29606
|
destroyWorkerStore(workerId);
|
29614
29607
|
return true;
|
29615
29608
|
}
|
29609
|
+
/** SEARCH */
|
29610
|
+
/**
|
29611
|
+
* A general text search across all table columns.
|
29612
|
+
* Search is the first thing we do. Cache the result for filtering / sorting
|
29613
|
+
* @param workerId
|
29614
|
+
* @param term
|
29615
|
+
* @returns the searched for data rows - with col filters / sorts also applied
|
29616
|
+
*/
|
29617
|
+
async function workerSearch(workerId, term) {
|
29618
|
+
const workerStore = dataWorkers.get(workerId);
|
29619
|
+
if (!workerStore)
|
29620
|
+
throw 'cannot find worker with ID ' + workerId;
|
29621
|
+
workerStore.searchTerm = term;
|
29622
|
+
if (!term || !term.length) {
|
29623
|
+
workerStore.filterRows = workerStore.rows;
|
29624
|
+
return applyFiltersAndSort(workerStore, workerStore.rows);
|
29625
|
+
}
|
29626
|
+
const availCols = workerStore.columns.filter((c) => c.searchable !== false);
|
29627
|
+
// cache result
|
29628
|
+
workerStore.filterRows = filter$1(workerStore.rows, {
|
29629
|
+
keywords: term,
|
29630
|
+
predicate: 'OR',
|
29631
|
+
includePaths: [...availCols.map((c) => c.prop)],
|
29632
|
+
ignorePaths: ['__uuid', '__index'],
|
29633
|
+
});
|
29634
|
+
// apply filter and sort
|
29635
|
+
return applyFiltersAndSort(workerStore, workerStore.filterRows);
|
29636
|
+
}
|
29637
|
+
/** FILTER */
|
29638
|
+
function filter(rows, filters = []) {
|
29639
|
+
if (!filters)
|
29640
|
+
return rows;
|
29641
|
+
filters.forEach((filter) => {
|
29642
|
+
if (typeof filter.filter === 'boolean') {
|
29643
|
+
rows = rows.filter((row) => row[filter.prop] === filter.filter);
|
29644
|
+
}
|
29645
|
+
else {
|
29646
|
+
rows = filter$1(rows, {
|
29647
|
+
keywords: filter.filter,
|
29648
|
+
includePaths: [filter.prop],
|
29649
|
+
ignorePaths: ['__uuid', '__index'],
|
29650
|
+
});
|
29651
|
+
}
|
29652
|
+
});
|
29653
|
+
return rows;
|
29654
|
+
}
|
29655
|
+
async function workerFilter(workerId, filters) {
|
29656
|
+
const workerStore = dataWorkers.get(workerId);
|
29657
|
+
if (!workerStore)
|
29658
|
+
throw 'cannot find worker with ID ' + workerId;
|
29659
|
+
// get cached results from a search
|
29660
|
+
const data = (!filters || !filters.length) && workerStore.searchTerm
|
29661
|
+
? await workerSearch(workerId, workerStore.searchTerm)
|
29662
|
+
: workerStore.searchTerm
|
29663
|
+
? workerStore.filterRows
|
29664
|
+
: workerStore.rows;
|
29665
|
+
workerStore.filterRows = filter(data, filters);
|
29666
|
+
// apply sort
|
29667
|
+
return sort(workerStore, workerStore.filterRows);
|
29668
|
+
}
|
29616
29669
|
/** SORT */
|
29617
29670
|
/**
|
29618
29671
|
* Finds any currently applied sort conditions from the column config
|
@@ -29678,62 +29731,20 @@ async function workerSort(workerId, prop, order) {
|
|
29678
29731
|
const data = workerStore.filterRows || workerStore.rows;
|
29679
29732
|
return sort(workerStore, data, prop, order);
|
29680
29733
|
}
|
29681
|
-
/**
|
29682
|
-
|
29683
|
-
|
29684
|
-
return rows;
|
29685
|
-
filters.forEach((filter) => {
|
29686
|
-
rows = filter$1(rows, {
|
29687
|
-
keywords: filter.filter,
|
29688
|
-
includePaths: [filter.prop],
|
29689
|
-
ignorePaths: ['__uuid', '__index'],
|
29690
|
-
});
|
29691
|
-
});
|
29692
|
-
return rows;
|
29693
|
-
}
|
29734
|
+
/** UTILS */
|
29735
|
+
// used after a search, it only sorts rn
|
29736
|
+
// (search acting like a filter 'reset' atm)
|
29694
29737
|
function applyFiltersAndSort(workerStore, rows) {
|
29695
29738
|
rows = filter(rows);
|
29696
29739
|
return sort(workerStore, rows);
|
29697
29740
|
}
|
29698
|
-
|
29699
|
-
|
29700
|
-
|
29701
|
-
|
29702
|
-
|
29703
|
-
|
29704
|
-
? await workerSearch(workerId, workerStore.searchTerm)
|
29705
|
-
: workerStore.filterRows || workerStore.rows;
|
29706
|
-
workerStore.filterRows = filter(data, filters);
|
29707
|
-
// apply sort
|
29708
|
-
return sort(workerStore, workerStore.filterRows);
|
29709
|
-
}
|
29710
|
-
/** SEARCH */
|
29711
|
-
/**
|
29712
|
-
* A general text search across all table columns.
|
29713
|
-
* Search is the first thing we do. Cache the result for filtering / sorting
|
29714
|
-
* @param workerId
|
29715
|
-
* @param term
|
29716
|
-
* @returns the searched for data rows - with col filters / sorts also applied
|
29717
|
-
*/
|
29718
|
-
async function workerSearch(workerId, term) {
|
29719
|
-
const workerStore = dataWorkers.get(workerId);
|
29720
|
-
if (!workerStore)
|
29721
|
-
throw 'cannot find worker with ID ' + workerId;
|
29722
|
-
workerStore.searchTerm = term;
|
29723
|
-
if (!term || !term.length) {
|
29724
|
-
workerStore.filterRows = workerStore.rows;
|
29725
|
-
return applyFiltersAndSort(workerStore, workerStore.rows);
|
29726
|
-
}
|
29727
|
-
const availCols = workerStore.columns.filter((c) => c.searchable !== false);
|
29728
|
-
// cache result
|
29729
|
-
workerStore.filterRows = filter$1(workerStore.rows, {
|
29730
|
-
keywords: term,
|
29731
|
-
predicate: 'OR',
|
29732
|
-
includePaths: [...availCols.map((c) => c.prop)],
|
29733
|
-
ignorePaths: ['__uuid', '__index'],
|
29741
|
+
function colsFromStore(safeColumns) {
|
29742
|
+
return safeColumns.map((c) => {
|
29743
|
+
if (!!c.sortCompareFn) {
|
29744
|
+
c.sortCompareFn = new Function('return ' + c.sortCompareFn)();
|
29745
|
+
}
|
29746
|
+
return c;
|
29734
29747
|
});
|
29735
|
-
// apply filter and sort
|
29736
|
-
return applyFiltersAndSort(workerStore, workerStore.filterRows);
|
29737
29748
|
}
|
29738
29749
|
/**
|
29739
29750
|
* Clean up
|
@@ -29793,7 +29804,7 @@ function getDataType(value) {
|
|
29793
29804
|
if (value instanceof Date) {
|
29794
29805
|
return 'date';
|
29795
29806
|
}
|
29796
|
-
if (['number', 'string'].includes(typeof value)) {
|
29807
|
+
if (['number', 'string', 'boolean'].includes(typeof value)) {
|
29797
29808
|
return typeof value;
|
29798
29809
|
}
|
29799
29810
|
return 'unknown';
|
@@ -29809,7 +29820,7 @@ function storeSetData(host, rows) {
|
|
29809
29820
|
return [...prev, curr.prop];
|
29810
29821
|
}, []);
|
29811
29822
|
const unknownCols = cols.filter((col) => !col.type);
|
29812
|
-
// augments data with some internal.
|
29823
|
+
// augments data with some internal props.
|
29813
29824
|
// discern unknown column types
|
29814
29825
|
// convert dates to numbers for worker
|
29815
29826
|
rows = rows.map((row, i) => {
|
@@ -30237,7 +30248,7 @@ const TableColHead = ({ column, headRenderer, onColumnSortClick, onColumnPinned,
|
|
30237
30248
|
extraProps = column.columnProperties(column) || extraProps;
|
30238
30249
|
}
|
30239
30250
|
const baseProps = {
|
30240
|
-
class: Object.assign(Object.assign({}, headerPinClasses('th', headRenderer === null || headRenderer === void 0 ? void 0 : headRenderer.pinned)), { [`${CSSNAMESPACE}__pin--start`]: column.pinned === 'start', [`${CSSNAMESPACE}__pin--end`]: column.pinned === 'end', [`${CSSNAMESPACE}__ordered`]: !!column.order, [`${CSSNAMESPACE}__filtered`]:
|
30251
|
+
class: Object.assign(Object.assign({}, headerPinClasses('th', headRenderer === null || headRenderer === void 0 ? void 0 : headRenderer.pinned)), { [`${CSSNAMESPACE}__pin--start`]: column.pinned === 'start', [`${CSSNAMESPACE}__pin--end`]: column.pinned === 'end', [`${CSSNAMESPACE}__ordered`]: !!column.order, [`${CSSNAMESPACE}__filtered`]: column.filter !== undefined && column.filter !== null }),
|
30241
30252
|
};
|
30242
30253
|
let props = extraProps ? mergeProperties(baseProps, extraProps) : baseProps;
|
30243
30254
|
const content = colheadFootRender(column);
|
@@ -30278,13 +30289,13 @@ const TableColHead = ({ column, headRenderer, onColumnSortClick, onColumnPinned,
|
|
30278
30289
|
[`${CSSNAMESPACE}__cell-content`]: true,
|
30279
30290
|
}, onClick: handleColumnSortClick },
|
30280
30291
|
colheadFootRender(column),
|
30281
|
-
|
30292
|
+
column.filter !== undefined && column.filter !== null && (hAsync("nano-icon", { name: "light/filter" })),
|
30282
30293
|
!!column.order &&
|
30283
30294
|
(column.order === 'desc' ? (hAsync("nano-icon", { name: "solid/long-arrow-down" })) : (hAsync("nano-icon", { name: "solid/long-arrow-up" }))),
|
30284
30295
|
hAsync("div", { class: `${CSSNAMESPACE}__status-icons` },
|
30285
30296
|
hAsync("nano-icon", { name: "light/chevron-down" })))) : (hAsync("div", { class: `${CSSNAMESPACE}__cell-content` },
|
30286
30297
|
colheadFootRender(column),
|
30287
|
-
|
30298
|
+
column.filter !== undefined && column.filter !== null && (hAsync("nano-icon", { name: "light/bars-filter" }))))));
|
30288
30299
|
};
|
30289
30300
|
|
30290
30301
|
// TABLE CELL
|
@@ -30309,7 +30320,7 @@ function cellRender(rowIndex, colIndex) {
|
|
30309
30320
|
: d;
|
30310
30321
|
}
|
30311
30322
|
}
|
30312
|
-
return tpl ? (tpl(hAsync, model)) : model.cellModel ? (hAsync(Fragment, null, (_b = model.cellModel) === null || _b === void 0 ? void 0 : _b.toString())) : ('');
|
30323
|
+
return tpl ? (tpl(hAsync, model)) : model.cellModel !== undefined && model.cellModel !== null ? (hAsync(Fragment, null, (_b = model.cellModel) === null || _b === void 0 ? void 0 : _b.toString())) : ('');
|
30313
30324
|
}
|
30314
30325
|
const baseCellClasses = (colIndex, toString = false) => {
|
30315
30326
|
const store = fetchStores();
|
@@ -30895,6 +30906,8 @@ class Table {
|
|
30895
30906
|
const cFilter = this.filters.find((f) => f.prop === c.prop);
|
30896
30907
|
if (cFilter)
|
30897
30908
|
c.filter = cFilter.filter;
|
30909
|
+
else if (c.filter !== null && c.filter !== undefined)
|
30910
|
+
c.filter = undefined;
|
30898
30911
|
return c;
|
30899
30912
|
});
|
30900
30913
|
this.nanoTblAfterFilter.emit({ filters: this.filters });
|
@@ -30958,7 +30971,7 @@ class Table {
|
|
30958
30971
|
/** Apply initial columns settings */
|
30959
30972
|
async columnInit() {
|
30960
30973
|
this.filters = this.columns
|
30961
|
-
.filter((c) =>
|
30974
|
+
.filter((c) => c.filter !== undefined && c.filter !== null)
|
30962
30975
|
.map((c) => {
|
30963
30976
|
const { filter, prop } = c;
|
30964
30977
|
return { filter, prop };
|
@@ -31094,7 +31107,7 @@ class Table {
|
|
31094
31107
|
sortable: this.defaultSort,
|
31095
31108
|
draggable: this.defaultColDraggable,
|
31096
31109
|
} }),
|
31097
|
-
]))), this._loading && !this.blocks.length && (hAsync("tbody", { class: `${CSSNAMESPACE}__active` }, [...Array(10).keys()].map((rowIndex) => (hAsync("tr", null, this.store.config.state.columns.map((_colModel, colIndex) => (hAsync(TableCell, { rowIndex: rowIndex, colIndex: colIndex, nestedContent: () => hAsync("nano-skeleton", null) })))))))),
|
31110
|
+
]))), this._loading && !this.blocks.length && (hAsync("tbody", { class: `${CSSNAMESPACE}__active` }, [...Array(10).keys()].map((rowIndex) => (hAsync("tr", null, this.store.config.state.columns.map((_colModel, colIndex) => (hAsync(TableCell, { rowIndex: rowIndex, colIndex: colIndex, nestedContent: () => hAsync("nano-skeleton", null) })))))))), hAsync("tr", { hidden: !!this._loading || !!this.blocks.length }, hAsync("th", { class: `${CSSNAMESPACE}__th`, colSpan: this.store.config.state.columns.length }, hAsync("div", { class: "nano-tbl__cell-content nano-tbl__cell-content--no-result" }, hAsync("slot", { name: "no-results" }, "No results found")))), this.blocks.map((block, blockIndex) => (hAsync("tbody", { key: block.__uuid, id: `tbody-${this.renderId}-${blockIndex}`, ref: (tb) => {
|
31098
31111
|
this.blockElements.push(tb);
|
31099
31112
|
}, class: {
|
31100
31113
|
[`${CSSNAMESPACE}__inactive`]: !this.activeBlocks.includes(blockIndex),
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nanoporetech-digital/components",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.9.0",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://git.oxfordnanolabs.local/Digital/nano-components"
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"flickity": "^2.2.1",
|
65
65
|
"focus-options-polyfill": "^1.4.0",
|
66
66
|
"qs": "^6.9.4",
|
67
|
-
"smart-array-filter": "^4.0.
|
67
|
+
"smart-array-filter": "^4.0.2",
|
68
68
|
"squirrelly": "^8",
|
69
69
|
"stencil-wormhole": "3.2.1"
|
70
70
|
},
|
@@ -131,7 +131,7 @@
|
|
131
131
|
"nanopore",
|
132
132
|
"digital"
|
133
133
|
],
|
134
|
-
"gitHead": "
|
134
|
+
"gitHead": "9f54fa10fed83758d1cde74fbddd9cf4742c9b73",
|
135
135
|
"volta": {
|
136
136
|
"node": "14.18.1",
|
137
137
|
"npm": "8.6.0"
|