@kodaris/krubble-components 1.0.56 → 1.0.58
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/custom-elements.json +165 -165
- package/dist/krubble-components.bundled.js +49 -13
- package/dist/krubble-components.bundled.js.map +1 -1
- package/dist/krubble-components.bundled.min.js +2 -2
- package/dist/krubble-components.bundled.min.js.map +1 -1
- package/dist/krubble-components.umd.js +49 -13
- package/dist/krubble-components.umd.js.map +1 -1
- package/dist/krubble-components.umd.min.js +2 -2
- package/dist/krubble-components.umd.min.js.map +1 -1
- package/dist/table/query.d.ts +3 -3
- package/dist/table/query.d.ts.map +1 -1
- package/dist/table/query.js +39 -10
- package/dist/table/query.js.map +1 -1
- package/dist/table/table.d.ts +2 -0
- package/dist/table/table.d.ts.map +1 -1
- package/dist/table/table.js +10 -3
- package/dist/table/table.js.map +1 -1
- package/package.json +1 -1
|
@@ -3019,6 +3019,7 @@
|
|
|
3019
3019
|
greater_than_equal: { key: 'greater_than_equal', type: 'comparison', dataTypes: ['number', 'date'], label: 'Greater than or equal' },
|
|
3020
3020
|
between: { key: 'between', type: 'range', dataTypes: ['number', 'date'], label: 'Between' },
|
|
3021
3021
|
in: { key: 'in', type: 'list', dataTypes: ['string', 'number'], label: 'In' },
|
|
3022
|
+
n_in: { key: 'n_in', type: 'list', dataTypes: ['string', 'number', 'date', 'boolean'], label: 'Not In' },
|
|
3022
3023
|
empty: { key: 'empty', type: 'nil', dataTypes: ['string', 'number', 'date', 'boolean'], label: 'Empty' },
|
|
3023
3024
|
n_empty: { key: 'n_empty', type: 'nil', dataTypes: ['string', 'number', 'date', 'boolean'], label: 'Not empty' },
|
|
3024
3025
|
};
|
|
@@ -3351,6 +3352,14 @@
|
|
|
3351
3352
|
};
|
|
3352
3353
|
this.specificity = [getDateSpecificity(rawStart), getDateSpecificity(rawEnd)];
|
|
3353
3354
|
}
|
|
3355
|
+
else if (kql.startsWith('!(') && kql.endsWith(')')) {
|
|
3356
|
+
this.operator = 'n_in';
|
|
3357
|
+
this.text = kql.substring(2, kql.length - 1).trim();
|
|
3358
|
+
this.value = this.text.split(',')
|
|
3359
|
+
.map(v => v.trim())
|
|
3360
|
+
.map(v => this._parse(v));
|
|
3361
|
+
this.specificity = [getDateSpecificity(this.text)];
|
|
3362
|
+
}
|
|
3354
3363
|
else if (kql.startsWith('(') && kql.endsWith(')')) {
|
|
3355
3364
|
this.operator = 'in';
|
|
3356
3365
|
this.text = kql.substring(1, kql.length - 1).trim();
|
|
@@ -3397,7 +3406,7 @@
|
|
|
3397
3406
|
this.value = null;
|
|
3398
3407
|
this.text = '';
|
|
3399
3408
|
}
|
|
3400
|
-
else if (this.operator === 'in') {
|
|
3409
|
+
else if (this.operator === 'in' || this.operator === 'n_in') {
|
|
3401
3410
|
this.value = [];
|
|
3402
3411
|
this.text = '';
|
|
3403
3412
|
}
|
|
@@ -3415,7 +3424,7 @@
|
|
|
3415
3424
|
this.value = null;
|
|
3416
3425
|
this.text = '';
|
|
3417
3426
|
}
|
|
3418
|
-
else if (this.operator === 'in') {
|
|
3427
|
+
else if (this.operator === 'in' || this.operator === 'n_in') {
|
|
3419
3428
|
this.value = [];
|
|
3420
3429
|
this.text = '';
|
|
3421
3430
|
}
|
|
@@ -3482,14 +3491,14 @@
|
|
|
3482
3491
|
if (this.operator === 'between') {
|
|
3483
3492
|
return !this.value?.start && !this.value?.end;
|
|
3484
3493
|
}
|
|
3485
|
-
if (this.operator === 'in') {
|
|
3494
|
+
if (this.operator === 'in' || this.operator === 'n_in') {
|
|
3486
3495
|
return !this.value?.length;
|
|
3487
3496
|
}
|
|
3488
3497
|
return this.value === undefined || this.value === null || this.value === '';
|
|
3489
3498
|
}
|
|
3490
|
-
/** Returns true if the value array contains the given value. Only applies to 'in'
|
|
3499
|
+
/** Returns true if the value array contains the given value. Only applies to 'in' and 'n_in' operators. */
|
|
3491
3500
|
has(val) {
|
|
3492
|
-
if (this.operator !== 'in' || !Array.isArray(this.value)) {
|
|
3501
|
+
if ((this.operator !== 'in' && this.operator !== 'n_in') || !Array.isArray(this.value)) {
|
|
3493
3502
|
return false;
|
|
3494
3503
|
}
|
|
3495
3504
|
// Bucket values from Solr arrive as strings ("true"/"false") but
|
|
@@ -3504,9 +3513,9 @@
|
|
|
3504
3513
|
}
|
|
3505
3514
|
return this.value.indexOf(val) >= 0;
|
|
3506
3515
|
}
|
|
3507
|
-
/** Adds or removes a value from the 'in' list and rebuilds text/kql. */
|
|
3516
|
+
/** Adds or removes a value from the 'in' or 'n_in' list and rebuilds text/kql. */
|
|
3508
3517
|
toggle(val) {
|
|
3509
|
-
if (this.operator !== 'in') {
|
|
3518
|
+
if (this.operator !== 'in' && this.operator !== 'n_in') {
|
|
3510
3519
|
this.setOperator('in');
|
|
3511
3520
|
}
|
|
3512
3521
|
// Bucket values from Solr arrive as strings ("true"/"false") —
|
|
@@ -3545,8 +3554,8 @@
|
|
|
3545
3554
|
if (this.operator === 'n_empty') {
|
|
3546
3555
|
return true;
|
|
3547
3556
|
}
|
|
3548
|
-
// For 'in' operator, valid as long as there's at least one value (including null for empty buckets)
|
|
3549
|
-
if (this.operator === 'in') {
|
|
3557
|
+
// For 'in'/'n_in' operator, valid as long as there's at least one value (including null for empty buckets)
|
|
3558
|
+
if (this.operator === 'in' || this.operator === 'n_in') {
|
|
3550
3559
|
return Array.isArray(this.value) && this.value.length > 0;
|
|
3551
3560
|
}
|
|
3552
3561
|
if (this.type === 'date') {
|
|
@@ -3690,6 +3699,18 @@
|
|
|
3690
3699
|
data.value = termify(this.value, true);
|
|
3691
3700
|
}
|
|
3692
3701
|
break;
|
|
3702
|
+
case 'n_in':
|
|
3703
|
+
if (Array.isArray(this.value) && this.value.length > 0) {
|
|
3704
|
+
data.operation = 'EXPRESSION';
|
|
3705
|
+
data.not = true;
|
|
3706
|
+
data.value = `(${this.value.map((v) => termify(v, true)).join(' OR ')})`;
|
|
3707
|
+
}
|
|
3708
|
+
else {
|
|
3709
|
+
data.operation = 'EXPRESSION';
|
|
3710
|
+
data.not = true;
|
|
3711
|
+
data.value = termify(this.value, true);
|
|
3712
|
+
}
|
|
3713
|
+
break;
|
|
3693
3714
|
default:
|
|
3694
3715
|
data.operation = 'EXPRESSION';
|
|
3695
3716
|
data.value = termify(this.value, true);
|
|
@@ -3784,6 +3805,11 @@
|
|
|
3784
3805
|
params.operation = 'IN';
|
|
3785
3806
|
params.values = this.value ?? [];
|
|
3786
3807
|
break;
|
|
3808
|
+
case 'n_in':
|
|
3809
|
+
params.operation = 'IN';
|
|
3810
|
+
params.not = true;
|
|
3811
|
+
params.values = this.value ?? [];
|
|
3812
|
+
break;
|
|
3787
3813
|
default:
|
|
3788
3814
|
throw Error(`${this.operator} operator not supported by db params.`);
|
|
3789
3815
|
}
|
|
@@ -3800,7 +3826,7 @@
|
|
|
3800
3826
|
if (this.operator === 'between') {
|
|
3801
3827
|
this.text = `${this._format(this.value?.start)} - ${this._format(this.value?.end)}`;
|
|
3802
3828
|
}
|
|
3803
|
-
else if (this.operator === 'in') {
|
|
3829
|
+
else if (this.operator === 'in' || this.operator === 'n_in') {
|
|
3804
3830
|
this.text = this.value.map((v) => this._format(v)).join(',');
|
|
3805
3831
|
}
|
|
3806
3832
|
else {
|
|
@@ -4014,6 +4040,9 @@
|
|
|
4014
4040
|
case 'in':
|
|
4015
4041
|
this.kql = `(${this.value.map((v) => this._format(v)).join(',')})`;
|
|
4016
4042
|
break;
|
|
4043
|
+
case 'n_in':
|
|
4044
|
+
this.kql = `!(${this.value.map((v) => this._format(v)).join(',')})`;
|
|
4045
|
+
break;
|
|
4017
4046
|
default:
|
|
4018
4047
|
throw Error(`Unknown operator ${this.operator}`);
|
|
4019
4048
|
}
|
|
@@ -4149,6 +4178,7 @@
|
|
|
4149
4178
|
if (this.def.rowHref) {
|
|
4150
4179
|
this._model.rowHref = this.def.rowHref;
|
|
4151
4180
|
}
|
|
4181
|
+
this._sorts = [];
|
|
4152
4182
|
this._model.columns = this.def.columns.map(col => {
|
|
4153
4183
|
const column = {
|
|
4154
4184
|
...col,
|
|
@@ -4157,6 +4187,12 @@
|
|
|
4157
4187
|
if (!column.type) {
|
|
4158
4188
|
column.type = 'string';
|
|
4159
4189
|
}
|
|
4190
|
+
if (col.sort) {
|
|
4191
|
+
this._sorts.push({
|
|
4192
|
+
sortBy: col.id,
|
|
4193
|
+
sortDirection: col.sort
|
|
4194
|
+
});
|
|
4195
|
+
}
|
|
4160
4196
|
if (column.type === 'actions') {
|
|
4161
4197
|
column.label = col.label ?? '';
|
|
4162
4198
|
column.sticky = 'right';
|
|
@@ -4265,7 +4301,7 @@
|
|
|
4265
4301
|
continue;
|
|
4266
4302
|
}
|
|
4267
4303
|
const filterData = col.filter.toSolrData();
|
|
4268
|
-
if (col.facetable && col.filter.operator === 'in') {
|
|
4304
|
+
if (col.facetable && (col.filter.operator === 'in' || col.filter.operator === 'n_in')) {
|
|
4269
4305
|
filterData.tagged = true;
|
|
4270
4306
|
}
|
|
4271
4307
|
request.filterFields.push(filterData);
|
|
@@ -4417,7 +4453,7 @@
|
|
|
4417
4453
|
}
|
|
4418
4454
|
}
|
|
4419
4455
|
// Bucket sync: ensure selected values appear even with 0 results
|
|
4420
|
-
if (col.filter && col.filter.operator === 'in' && Array.isArray(col.filter.value)) {
|
|
4456
|
+
if (col.filter && (col.filter.operator === 'in' || col.filter.operator === 'n_in') && Array.isArray(col.filter.value)) {
|
|
4421
4457
|
for (const selectedVal of col.filter.value) {
|
|
4422
4458
|
if (!buckets.some(b => b.val === selectedVal)) {
|
|
4423
4459
|
buckets.push({
|
|
@@ -5091,7 +5127,7 @@
|
|
|
5091
5127
|
/>
|
|
5092
5128
|
`;
|
|
5093
5129
|
}
|
|
5094
|
-
else if (column.filter.operator === 'in') {
|
|
5130
|
+
else if (column.filter.operator === 'in' || column.filter.operator === 'n_in') {
|
|
5095
5131
|
valueInput = b `
|
|
5096
5132
|
<textarea
|
|
5097
5133
|
class="filter-panel__textarea"
|