ninegrid2 6.217.0 → 6.219.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/dist/bundle.cjs.js +29 -78
- package/dist/bundle.esm.js +29 -78
- package/dist/etc/ngFiltering.js +29 -73
- package/package.json +1 -1
- package/src/etc/ngFiltering.js +29 -73
package/dist/bundle.cjs.js
CHANGED
|
@@ -18036,37 +18036,24 @@ class ngFiltering
|
|
|
18036
18036
|
arr[i] = Number(arr[i]);
|
|
18037
18037
|
}
|
|
18038
18038
|
}
|
|
18039
|
-
|
|
18040
|
-
/** filtering button 용 데이타 */
|
|
18041
|
-
/**
|
|
18042
|
-
filterData.push({
|
|
18043
|
-
"colnm" : key,
|
|
18044
|
-
"data" : arr,
|
|
18045
|
-
}); */
|
|
18046
|
-
//console.log(arr);
|
|
18047
|
-
|
|
18048
|
-
|
|
18049
|
-
//console.log(arr, idx, arr.nineBinarySearch(m.v[idx]));
|
|
18050
18039
|
|
|
18051
18040
|
this.#owner.data.getValidData().filter(m => { return arr.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
|
|
18052
|
-
|
|
18053
|
-
|
|
18054
|
-
//break;
|
|
18055
|
-
|
|
18056
|
-
|
|
18057
18041
|
}
|
|
18058
18042
|
|
|
18059
18043
|
|
|
18060
18044
|
this.#owner.data.refreshFilter();
|
|
18061
|
-
|
|
18062
|
-
var colnms = [];
|
|
18063
|
-
for (let key in jsonFilter) {
|
|
18064
|
-
colnms.push(key);
|
|
18065
|
-
}
|
|
18066
18045
|
//var colnms = filterData.map(item => item.colnm);
|
|
18067
18046
|
|
|
18068
|
-
ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
18069
|
-
|
|
18047
|
+
//ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
18048
|
+
this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
|
|
18049
|
+
//v.filterOptions = null;
|
|
18050
|
+
let options = el.filterOptions;
|
|
18051
|
+
|
|
18052
|
+
options.forEach(opt => {
|
|
18053
|
+
opt.data = [];
|
|
18054
|
+
});
|
|
18055
|
+
|
|
18056
|
+
el.filterOptions = options;
|
|
18070
18057
|
});
|
|
18071
18058
|
|
|
18072
18059
|
for (let key in jsonFilter) {
|
|
@@ -18074,19 +18061,31 @@ class ngFiltering
|
|
|
18074
18061
|
this.#owner.fields.indexOf(key);
|
|
18075
18062
|
|
|
18076
18063
|
//console.log(filterData);
|
|
18077
|
-
ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
18064
|
+
//ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
18065
|
+
this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
|
|
18078
18066
|
//v.filterData = null;
|
|
18079
18067
|
//console.log(v);
|
|
18080
18068
|
//var b = v.colnms;
|
|
18081
|
-
|
|
18082
|
-
|
|
18083
|
-
|
|
18069
|
+
let options = el.filterOptions;
|
|
18070
|
+
|
|
18071
|
+
options.forEach(opt => {
|
|
18072
|
+
|
|
18073
|
+
if (opt.hasOwnProperty(key)) {
|
|
18074
|
+
opt.data = arr;
|
|
18075
|
+
}
|
|
18076
|
+
/**
|
|
18077
|
+
//console.log(colnms, colnm);
|
|
18084
18078
|
if (colnms.includes(colnm)) {
|
|
18085
18079
|
console.log("==================");
|
|
18086
18080
|
|
|
18087
18081
|
v.filterOptions = arr;
|
|
18088
|
-
}
|
|
18082
|
+
} */
|
|
18089
18083
|
});
|
|
18084
|
+
|
|
18085
|
+
|
|
18086
|
+
console.log(options);
|
|
18087
|
+
|
|
18088
|
+
el.filterOptions = options;
|
|
18090
18089
|
});
|
|
18091
18090
|
}
|
|
18092
18091
|
|
|
@@ -18205,7 +18204,7 @@ class ngFilterButton extends HTMLElement
|
|
|
18205
18204
|
};
|
|
18206
18205
|
set filterOptions(v) {
|
|
18207
18206
|
this.#filterOptions = v;
|
|
18208
|
-
this.classList.toggle('filtered',
|
|
18207
|
+
this.classList.toggle('filtered', this.#filterOptions.some(item => item.data.length > 0));
|
|
18209
18208
|
}
|
|
18210
18209
|
|
|
18211
18210
|
#onClick = (e) => {
|
|
@@ -18439,24 +18438,8 @@ class ngFilterPanel extends HTMLElement
|
|
|
18439
18438
|
|
|
18440
18439
|
open = (filterButton) => {
|
|
18441
18440
|
|
|
18442
|
-
/**
|
|
18443
18441
|
const owner = this.shadow.closest("nine-grid");
|
|
18444
18442
|
|
|
18445
|
-
var cell = filterButton.closest("th,td");
|
|
18446
|
-
|
|
18447
|
-
var l = $(filterButton).offset().left - $(owner).offset().left;// - $(this).width() + $(e.target).width() + 1;
|
|
18448
|
-
if (l < 0) l = 0;
|
|
18449
|
-
if (l + $(this).width() > $(owner).width()) l = $(owner).width() - $(this).width() - 5;
|
|
18450
|
-
|
|
18451
|
-
var t = $(cell).offset().top + $(cell).height()- $(owner).offset().top;//$(e.target).offset().top + $(e.target).height() + 2;
|
|
18452
|
-
|
|
18453
|
-
//$(this).offset({left: l, top: t});
|
|
18454
|
-
$(this).css({left: l, top: t});
|
|
18455
|
-
*/
|
|
18456
|
-
|
|
18457
|
-
const owner = this.shadow.closest("nine-grid");
|
|
18458
|
-
|
|
18459
|
-
|
|
18460
18443
|
/** 위치 */
|
|
18461
18444
|
const cell = filterButton.closest("th,td");
|
|
18462
18445
|
|
|
@@ -18504,6 +18487,7 @@ class ngFilterPanel extends HTMLElement
|
|
|
18504
18487
|
|
|
18505
18488
|
//console.log(data);
|
|
18506
18489
|
|
|
18490
|
+
/**
|
|
18507
18491
|
owner.body.querySelectorAll("ng-filter-button").forEach(el => {
|
|
18508
18492
|
//console.log(el);
|
|
18509
18493
|
if (el.closest('th,td').dataset.col != col && el.filterOptions) {
|
|
@@ -18520,50 +18504,17 @@ class ngFilterPanel extends HTMLElement
|
|
|
18520
18504
|
}
|
|
18521
18505
|
});
|
|
18522
18506
|
}
|
|
18523
|
-
});
|
|
18524
|
-
|
|
18525
|
-
//console.log(data);
|
|
18526
|
-
|
|
18527
|
-
/**
|
|
18528
|
-
$("ng-filter-button", owner.body).each((index,el) => {
|
|
18529
|
-
|
|
18530
|
-
if (el.closest('th,td').dataset.col == col || !el.filterData) return true;
|
|
18531
|
-
|
|
18532
|
-
|
|
18533
|
-
console.log(el.filterData, el.colnms, el.dataset.bind);
|
|
18534
|
-
|
|
18535
|
-
el.colnms.forEach(colnm => {
|
|
18536
|
-
var idx = owner.fields.indexOf(colnm);
|
|
18537
|
-
|
|
18538
|
-
console.log(idx);
|
|
18539
|
-
|
|
18540
|
-
if (idx >= 0) {
|
|
18541
|
-
data = data.filter(m => { return el.filterData.nineBinarySearch(m.v[idx] || '') >= 0; });
|
|
18542
|
-
}
|
|
18543
|
-
});
|
|
18544
|
-
|
|
18545
|
-
//data = data.filter(rowData => { return el.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) >= 0; });
|
|
18546
18507
|
}); */
|
|
18547
18508
|
|
|
18548
|
-
|
|
18549
18509
|
var ds = [];
|
|
18550
|
-
//colnms = [...new Set(colnms)];
|
|
18551
|
-
|
|
18552
|
-
//const colnms = [...new Set(filterButton.filterOptions.map(item => item.colnm))];
|
|
18553
|
-
|
|
18554
18510
|
filterButton.filterOptions.forEach((filterOption,i) => {
|
|
18555
18511
|
|
|
18556
|
-
//const colnm = filterOption.colnm;
|
|
18557
|
-
//console.log(filterOption);
|
|
18558
|
-
|
|
18559
18512
|
ds.push({
|
|
18560
18513
|
LVL: 1,
|
|
18561
18514
|
CHK: 'N',
|
|
18562
18515
|
DATA2: '<span class="group">' + $(filterButton).closest('th,td').text() + (filterButton.filterOptions.length > 1 ? ` #${i+1} (${filterOption.colnm})` : '') + '</span>',
|
|
18563
18516
|
});
|
|
18564
18517
|
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
18518
|
/**
|
|
18568
18519
|
var cell = $(`[data-col=${col}][data-bind=${filterOption.colnm}]`, owner.template);
|
|
18569
18520
|
var expr = cell.attr("data-expr");
|
package/dist/bundle.esm.js
CHANGED
|
@@ -18034,37 +18034,24 @@ class ngFiltering
|
|
|
18034
18034
|
arr[i] = Number(arr[i]);
|
|
18035
18035
|
}
|
|
18036
18036
|
}
|
|
18037
|
-
|
|
18038
|
-
/** filtering button 용 데이타 */
|
|
18039
|
-
/**
|
|
18040
|
-
filterData.push({
|
|
18041
|
-
"colnm" : key,
|
|
18042
|
-
"data" : arr,
|
|
18043
|
-
}); */
|
|
18044
|
-
//console.log(arr);
|
|
18045
|
-
|
|
18046
|
-
|
|
18047
|
-
//console.log(arr, idx, arr.nineBinarySearch(m.v[idx]));
|
|
18048
18037
|
|
|
18049
18038
|
this.#owner.data.getValidData().filter(m => { return arr.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
|
|
18050
|
-
|
|
18051
|
-
|
|
18052
|
-
//break;
|
|
18053
|
-
|
|
18054
|
-
|
|
18055
18039
|
}
|
|
18056
18040
|
|
|
18057
18041
|
|
|
18058
18042
|
this.#owner.data.refreshFilter();
|
|
18059
|
-
|
|
18060
|
-
var colnms = [];
|
|
18061
|
-
for (let key in jsonFilter) {
|
|
18062
|
-
colnms.push(key);
|
|
18063
|
-
}
|
|
18064
18043
|
//var colnms = filterData.map(item => item.colnm);
|
|
18065
18044
|
|
|
18066
|
-
ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
18067
|
-
|
|
18045
|
+
//ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
18046
|
+
this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
|
|
18047
|
+
//v.filterOptions = null;
|
|
18048
|
+
let options = el.filterOptions;
|
|
18049
|
+
|
|
18050
|
+
options.forEach(opt => {
|
|
18051
|
+
opt.data = [];
|
|
18052
|
+
});
|
|
18053
|
+
|
|
18054
|
+
el.filterOptions = options;
|
|
18068
18055
|
});
|
|
18069
18056
|
|
|
18070
18057
|
for (let key in jsonFilter) {
|
|
@@ -18072,19 +18059,31 @@ class ngFiltering
|
|
|
18072
18059
|
this.#owner.fields.indexOf(key);
|
|
18073
18060
|
|
|
18074
18061
|
//console.log(filterData);
|
|
18075
|
-
ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
18062
|
+
//ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
18063
|
+
this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
|
|
18076
18064
|
//v.filterData = null;
|
|
18077
18065
|
//console.log(v);
|
|
18078
18066
|
//var b = v.colnms;
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
|
|
18067
|
+
let options = el.filterOptions;
|
|
18068
|
+
|
|
18069
|
+
options.forEach(opt => {
|
|
18070
|
+
|
|
18071
|
+
if (opt.hasOwnProperty(key)) {
|
|
18072
|
+
opt.data = arr;
|
|
18073
|
+
}
|
|
18074
|
+
/**
|
|
18075
|
+
//console.log(colnms, colnm);
|
|
18082
18076
|
if (colnms.includes(colnm)) {
|
|
18083
18077
|
console.log("==================");
|
|
18084
18078
|
|
|
18085
18079
|
v.filterOptions = arr;
|
|
18086
|
-
}
|
|
18080
|
+
} */
|
|
18087
18081
|
});
|
|
18082
|
+
|
|
18083
|
+
|
|
18084
|
+
console.log(options);
|
|
18085
|
+
|
|
18086
|
+
el.filterOptions = options;
|
|
18088
18087
|
});
|
|
18089
18088
|
}
|
|
18090
18089
|
|
|
@@ -18203,7 +18202,7 @@ class ngFilterButton extends HTMLElement
|
|
|
18203
18202
|
};
|
|
18204
18203
|
set filterOptions(v) {
|
|
18205
18204
|
this.#filterOptions = v;
|
|
18206
|
-
this.classList.toggle('filtered',
|
|
18205
|
+
this.classList.toggle('filtered', this.#filterOptions.some(item => item.data.length > 0));
|
|
18207
18206
|
}
|
|
18208
18207
|
|
|
18209
18208
|
#onClick = (e) => {
|
|
@@ -18437,24 +18436,8 @@ class ngFilterPanel extends HTMLElement
|
|
|
18437
18436
|
|
|
18438
18437
|
open = (filterButton) => {
|
|
18439
18438
|
|
|
18440
|
-
/**
|
|
18441
18439
|
const owner = this.shadow.closest("nine-grid");
|
|
18442
18440
|
|
|
18443
|
-
var cell = filterButton.closest("th,td");
|
|
18444
|
-
|
|
18445
|
-
var l = $(filterButton).offset().left - $(owner).offset().left;// - $(this).width() + $(e.target).width() + 1;
|
|
18446
|
-
if (l < 0) l = 0;
|
|
18447
|
-
if (l + $(this).width() > $(owner).width()) l = $(owner).width() - $(this).width() - 5;
|
|
18448
|
-
|
|
18449
|
-
var t = $(cell).offset().top + $(cell).height()- $(owner).offset().top;//$(e.target).offset().top + $(e.target).height() + 2;
|
|
18450
|
-
|
|
18451
|
-
//$(this).offset({left: l, top: t});
|
|
18452
|
-
$(this).css({left: l, top: t});
|
|
18453
|
-
*/
|
|
18454
|
-
|
|
18455
|
-
const owner = this.shadow.closest("nine-grid");
|
|
18456
|
-
|
|
18457
|
-
|
|
18458
18441
|
/** 위치 */
|
|
18459
18442
|
const cell = filterButton.closest("th,td");
|
|
18460
18443
|
|
|
@@ -18502,6 +18485,7 @@ class ngFilterPanel extends HTMLElement
|
|
|
18502
18485
|
|
|
18503
18486
|
//console.log(data);
|
|
18504
18487
|
|
|
18488
|
+
/**
|
|
18505
18489
|
owner.body.querySelectorAll("ng-filter-button").forEach(el => {
|
|
18506
18490
|
//console.log(el);
|
|
18507
18491
|
if (el.closest('th,td').dataset.col != col && el.filterOptions) {
|
|
@@ -18518,50 +18502,17 @@ class ngFilterPanel extends HTMLElement
|
|
|
18518
18502
|
}
|
|
18519
18503
|
});
|
|
18520
18504
|
}
|
|
18521
|
-
});
|
|
18522
|
-
|
|
18523
|
-
//console.log(data);
|
|
18524
|
-
|
|
18525
|
-
/**
|
|
18526
|
-
$("ng-filter-button", owner.body).each((index,el) => {
|
|
18527
|
-
|
|
18528
|
-
if (el.closest('th,td').dataset.col == col || !el.filterData) return true;
|
|
18529
|
-
|
|
18530
|
-
|
|
18531
|
-
console.log(el.filterData, el.colnms, el.dataset.bind);
|
|
18532
|
-
|
|
18533
|
-
el.colnms.forEach(colnm => {
|
|
18534
|
-
var idx = owner.fields.indexOf(colnm);
|
|
18535
|
-
|
|
18536
|
-
console.log(idx);
|
|
18537
|
-
|
|
18538
|
-
if (idx >= 0) {
|
|
18539
|
-
data = data.filter(m => { return el.filterData.nineBinarySearch(m.v[idx] || '') >= 0; });
|
|
18540
|
-
}
|
|
18541
|
-
});
|
|
18542
|
-
|
|
18543
|
-
//data = data.filter(rowData => { return el.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) >= 0; });
|
|
18544
18505
|
}); */
|
|
18545
18506
|
|
|
18546
|
-
|
|
18547
18507
|
var ds = [];
|
|
18548
|
-
//colnms = [...new Set(colnms)];
|
|
18549
|
-
|
|
18550
|
-
//const colnms = [...new Set(filterButton.filterOptions.map(item => item.colnm))];
|
|
18551
|
-
|
|
18552
18508
|
filterButton.filterOptions.forEach((filterOption,i) => {
|
|
18553
18509
|
|
|
18554
|
-
//const colnm = filterOption.colnm;
|
|
18555
|
-
//console.log(filterOption);
|
|
18556
|
-
|
|
18557
18510
|
ds.push({
|
|
18558
18511
|
LVL: 1,
|
|
18559
18512
|
CHK: 'N',
|
|
18560
18513
|
DATA2: '<span class="group">' + $(filterButton).closest('th,td').text() + (filterButton.filterOptions.length > 1 ? ` #${i+1} (${filterOption.colnm})` : '') + '</span>',
|
|
18561
18514
|
});
|
|
18562
18515
|
|
|
18563
|
-
|
|
18564
|
-
|
|
18565
18516
|
/**
|
|
18566
18517
|
var cell = $(`[data-col=${col}][data-bind=${filterOption.colnm}]`, owner.template);
|
|
18567
18518
|
var expr = cell.attr("data-expr");
|
package/dist/etc/ngFiltering.js
CHANGED
|
@@ -104,24 +104,8 @@ export class ngFiltering
|
|
|
104
104
|
arr[i] = Number(arr[i]);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
/** filtering button 용 데이타 */
|
|
109
|
-
/**
|
|
110
|
-
filterData.push({
|
|
111
|
-
"colnm" : key,
|
|
112
|
-
"data" : arr,
|
|
113
|
-
}); */
|
|
114
|
-
//console.log(arr);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
//console.log(arr, idx, arr.nineBinarySearch(m.v[idx]));
|
|
118
107
|
|
|
119
108
|
this.#owner.data.getValidData().filter(m => { return arr.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
//break;
|
|
123
|
-
|
|
124
|
-
|
|
125
109
|
}
|
|
126
110
|
|
|
127
111
|
|
|
@@ -133,8 +117,16 @@ export class ngFiltering
|
|
|
133
117
|
}
|
|
134
118
|
//var colnms = filterData.map(item => item.colnm);
|
|
135
119
|
|
|
136
|
-
ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
137
|
-
|
|
120
|
+
//ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
121
|
+
this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
|
|
122
|
+
//v.filterOptions = null;
|
|
123
|
+
let options = el.filterOptions;
|
|
124
|
+
|
|
125
|
+
options.forEach(opt => {
|
|
126
|
+
opt.data = [];
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
el.filterOptions = options;
|
|
138
130
|
});
|
|
139
131
|
|
|
140
132
|
for (let key in jsonFilter) {
|
|
@@ -142,19 +134,31 @@ export class ngFiltering
|
|
|
142
134
|
const idx = this.#owner.fields.indexOf(key);
|
|
143
135
|
|
|
144
136
|
//console.log(filterData);
|
|
145
|
-
ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
137
|
+
//ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
138
|
+
this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
|
|
146
139
|
//v.filterData = null;
|
|
147
140
|
//console.log(v);
|
|
148
141
|
//var b = v.colnms;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
142
|
+
let options = el.filterOptions;
|
|
143
|
+
|
|
144
|
+
options.forEach(opt => {
|
|
145
|
+
|
|
146
|
+
if (opt.hasOwnProperty(key)) {
|
|
147
|
+
opt.data = arr;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
//console.log(colnms, colnm);
|
|
152
151
|
if (colnms.includes(colnm)) {
|
|
153
152
|
console.log("==================");
|
|
154
153
|
|
|
155
154
|
v.filterOptions = arr;
|
|
156
|
-
}
|
|
155
|
+
} */
|
|
157
156
|
});
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
console.log(options);
|
|
160
|
+
|
|
161
|
+
el.filterOptions = options;
|
|
158
162
|
});
|
|
159
163
|
}
|
|
160
164
|
|
|
@@ -273,7 +277,7 @@ class ngFilterButton extends HTMLElement
|
|
|
273
277
|
};
|
|
274
278
|
set filterOptions(v) {
|
|
275
279
|
this.#filterOptions = v;
|
|
276
|
-
this.classList.toggle('filtered',
|
|
280
|
+
this.classList.toggle('filtered', this.#filterOptions.some(item => item.data.length > 0));
|
|
277
281
|
}
|
|
278
282
|
|
|
279
283
|
#onClick = (e) => {
|
|
@@ -507,24 +511,8 @@ class ngFilterPanel extends HTMLElement
|
|
|
507
511
|
|
|
508
512
|
open = (filterButton) => {
|
|
509
513
|
|
|
510
|
-
/**
|
|
511
514
|
const owner = this.shadow.closest("nine-grid");
|
|
512
515
|
|
|
513
|
-
var cell = filterButton.closest("th,td");
|
|
514
|
-
|
|
515
|
-
var l = $(filterButton).offset().left - $(owner).offset().left;// - $(this).width() + $(e.target).width() + 1;
|
|
516
|
-
if (l < 0) l = 0;
|
|
517
|
-
if (l + $(this).width() > $(owner).width()) l = $(owner).width() - $(this).width() - 5;
|
|
518
|
-
|
|
519
|
-
var t = $(cell).offset().top + $(cell).height()- $(owner).offset().top;//$(e.target).offset().top + $(e.target).height() + 2;
|
|
520
|
-
|
|
521
|
-
//$(this).offset({left: l, top: t});
|
|
522
|
-
$(this).css({left: l, top: t});
|
|
523
|
-
*/
|
|
524
|
-
|
|
525
|
-
const owner = this.shadow.closest("nine-grid");
|
|
526
|
-
|
|
527
|
-
|
|
528
516
|
/** 위치 */
|
|
529
517
|
const cell = filterButton.closest("th,td");
|
|
530
518
|
|
|
@@ -572,6 +560,7 @@ class ngFilterPanel extends HTMLElement
|
|
|
572
560
|
|
|
573
561
|
//console.log(data);
|
|
574
562
|
|
|
563
|
+
/**
|
|
575
564
|
owner.body.querySelectorAll("ng-filter-button").forEach(el => {
|
|
576
565
|
//console.log(el);
|
|
577
566
|
if (el.closest('th,td').dataset.col != col && el.filterOptions) {
|
|
@@ -588,50 +577,17 @@ class ngFilterPanel extends HTMLElement
|
|
|
588
577
|
}
|
|
589
578
|
});
|
|
590
579
|
}
|
|
591
|
-
});
|
|
592
|
-
|
|
593
|
-
//console.log(data);
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
$("ng-filter-button", owner.body).each((index,el) => {
|
|
597
|
-
|
|
598
|
-
if (el.closest('th,td').dataset.col == col || !el.filterData) return true;
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
console.log(el.filterData, el.colnms, el.dataset.bind);
|
|
602
|
-
|
|
603
|
-
el.colnms.forEach(colnm => {
|
|
604
|
-
var idx = owner.fields.indexOf(colnm);
|
|
605
|
-
|
|
606
|
-
console.log(idx);
|
|
607
|
-
|
|
608
|
-
if (idx >= 0) {
|
|
609
|
-
data = data.filter(m => { return el.filterData.nineBinarySearch(m.v[idx] || '') >= 0; });
|
|
610
|
-
}
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
//data = data.filter(rowData => { return el.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) >= 0; });
|
|
614
580
|
}); */
|
|
615
581
|
|
|
616
|
-
|
|
617
582
|
var ds = [];
|
|
618
|
-
//colnms = [...new Set(colnms)];
|
|
619
|
-
|
|
620
|
-
//const colnms = [...new Set(filterButton.filterOptions.map(item => item.colnm))];
|
|
621
|
-
|
|
622
583
|
filterButton.filterOptions.forEach((filterOption,i) => {
|
|
623
584
|
|
|
624
|
-
//const colnm = filterOption.colnm;
|
|
625
|
-
//console.log(filterOption);
|
|
626
|
-
|
|
627
585
|
ds.push({
|
|
628
586
|
LVL: 1,
|
|
629
587
|
CHK: 'N',
|
|
630
588
|
DATA2: '<span class="group">' + $(filterButton).closest('th,td').text() + (filterButton.filterOptions.length > 1 ? ` #${i+1} (${filterOption.colnm})` : '') + '</span>',
|
|
631
589
|
});
|
|
632
590
|
|
|
633
|
-
|
|
634
|
-
|
|
635
591
|
/**
|
|
636
592
|
var cell = $(`[data-col=${col}][data-bind=${filterOption.colnm}]`, owner.template);
|
|
637
593
|
var expr = cell.attr("data-expr");
|
package/package.json
CHANGED
package/src/etc/ngFiltering.js
CHANGED
|
@@ -104,24 +104,8 @@ export class ngFiltering
|
|
|
104
104
|
arr[i] = Number(arr[i]);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
/** filtering button 용 데이타 */
|
|
109
|
-
/**
|
|
110
|
-
filterData.push({
|
|
111
|
-
"colnm" : key,
|
|
112
|
-
"data" : arr,
|
|
113
|
-
}); */
|
|
114
|
-
//console.log(arr);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
//console.log(arr, idx, arr.nineBinarySearch(m.v[idx]));
|
|
118
107
|
|
|
119
108
|
this.#owner.data.getValidData().filter(m => { return arr.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
//break;
|
|
123
|
-
|
|
124
|
-
|
|
125
109
|
}
|
|
126
110
|
|
|
127
111
|
|
|
@@ -133,8 +117,16 @@ export class ngFiltering
|
|
|
133
117
|
}
|
|
134
118
|
//var colnms = filterData.map(item => item.colnm);
|
|
135
119
|
|
|
136
|
-
ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
137
|
-
|
|
120
|
+
//ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
121
|
+
this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
|
|
122
|
+
//v.filterOptions = null;
|
|
123
|
+
let options = el.filterOptions;
|
|
124
|
+
|
|
125
|
+
options.forEach(opt => {
|
|
126
|
+
opt.data = [];
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
el.filterOptions = options;
|
|
138
130
|
});
|
|
139
131
|
|
|
140
132
|
for (let key in jsonFilter) {
|
|
@@ -142,19 +134,31 @@ export class ngFiltering
|
|
|
142
134
|
const idx = this.#owner.fields.indexOf(key);
|
|
143
135
|
|
|
144
136
|
//console.log(filterData);
|
|
145
|
-
ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
137
|
+
//ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
|
|
138
|
+
this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
|
|
146
139
|
//v.filterData = null;
|
|
147
140
|
//console.log(v);
|
|
148
141
|
//var b = v.colnms;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
142
|
+
let options = el.filterOptions;
|
|
143
|
+
|
|
144
|
+
options.forEach(opt => {
|
|
145
|
+
|
|
146
|
+
if (opt.hasOwnProperty(key)) {
|
|
147
|
+
opt.data = arr;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
//console.log(colnms, colnm);
|
|
152
151
|
if (colnms.includes(colnm)) {
|
|
153
152
|
console.log("==================");
|
|
154
153
|
|
|
155
154
|
v.filterOptions = arr;
|
|
156
|
-
}
|
|
155
|
+
} */
|
|
157
156
|
});
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
console.log(options);
|
|
160
|
+
|
|
161
|
+
el.filterOptions = options;
|
|
158
162
|
});
|
|
159
163
|
}
|
|
160
164
|
|
|
@@ -273,7 +277,7 @@ class ngFilterButton extends HTMLElement
|
|
|
273
277
|
};
|
|
274
278
|
set filterOptions(v) {
|
|
275
279
|
this.#filterOptions = v;
|
|
276
|
-
this.classList.toggle('filtered',
|
|
280
|
+
this.classList.toggle('filtered', this.#filterOptions.some(item => item.data.length > 0));
|
|
277
281
|
}
|
|
278
282
|
|
|
279
283
|
#onClick = (e) => {
|
|
@@ -507,24 +511,8 @@ class ngFilterPanel extends HTMLElement
|
|
|
507
511
|
|
|
508
512
|
open = (filterButton) => {
|
|
509
513
|
|
|
510
|
-
/**
|
|
511
514
|
const owner = this.shadow.closest("nine-grid");
|
|
512
515
|
|
|
513
|
-
var cell = filterButton.closest("th,td");
|
|
514
|
-
|
|
515
|
-
var l = $(filterButton).offset().left - $(owner).offset().left;// - $(this).width() + $(e.target).width() + 1;
|
|
516
|
-
if (l < 0) l = 0;
|
|
517
|
-
if (l + $(this).width() > $(owner).width()) l = $(owner).width() - $(this).width() - 5;
|
|
518
|
-
|
|
519
|
-
var t = $(cell).offset().top + $(cell).height()- $(owner).offset().top;//$(e.target).offset().top + $(e.target).height() + 2;
|
|
520
|
-
|
|
521
|
-
//$(this).offset({left: l, top: t});
|
|
522
|
-
$(this).css({left: l, top: t});
|
|
523
|
-
*/
|
|
524
|
-
|
|
525
|
-
const owner = this.shadow.closest("nine-grid");
|
|
526
|
-
|
|
527
|
-
|
|
528
516
|
/** 위치 */
|
|
529
517
|
const cell = filterButton.closest("th,td");
|
|
530
518
|
|
|
@@ -572,6 +560,7 @@ class ngFilterPanel extends HTMLElement
|
|
|
572
560
|
|
|
573
561
|
//console.log(data);
|
|
574
562
|
|
|
563
|
+
/**
|
|
575
564
|
owner.body.querySelectorAll("ng-filter-button").forEach(el => {
|
|
576
565
|
//console.log(el);
|
|
577
566
|
if (el.closest('th,td').dataset.col != col && el.filterOptions) {
|
|
@@ -588,50 +577,17 @@ class ngFilterPanel extends HTMLElement
|
|
|
588
577
|
}
|
|
589
578
|
});
|
|
590
579
|
}
|
|
591
|
-
});
|
|
592
|
-
|
|
593
|
-
//console.log(data);
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
$("ng-filter-button", owner.body).each((index,el) => {
|
|
597
|
-
|
|
598
|
-
if (el.closest('th,td').dataset.col == col || !el.filterData) return true;
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
console.log(el.filterData, el.colnms, el.dataset.bind);
|
|
602
|
-
|
|
603
|
-
el.colnms.forEach(colnm => {
|
|
604
|
-
var idx = owner.fields.indexOf(colnm);
|
|
605
|
-
|
|
606
|
-
console.log(idx);
|
|
607
|
-
|
|
608
|
-
if (idx >= 0) {
|
|
609
|
-
data = data.filter(m => { return el.filterData.nineBinarySearch(m.v[idx] || '') >= 0; });
|
|
610
|
-
}
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
//data = data.filter(rowData => { return el.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) >= 0; });
|
|
614
580
|
}); */
|
|
615
581
|
|
|
616
|
-
|
|
617
582
|
var ds = [];
|
|
618
|
-
//colnms = [...new Set(colnms)];
|
|
619
|
-
|
|
620
|
-
//const colnms = [...new Set(filterButton.filterOptions.map(item => item.colnm))];
|
|
621
|
-
|
|
622
583
|
filterButton.filterOptions.forEach((filterOption,i) => {
|
|
623
584
|
|
|
624
|
-
//const colnm = filterOption.colnm;
|
|
625
|
-
//console.log(filterOption);
|
|
626
|
-
|
|
627
585
|
ds.push({
|
|
628
586
|
LVL: 1,
|
|
629
587
|
CHK: 'N',
|
|
630
588
|
DATA2: '<span class="group">' + $(filterButton).closest('th,td').text() + (filterButton.filterOptions.length > 1 ? ` #${i+1} (${filterOption.colnm})` : '') + '</span>',
|
|
631
589
|
});
|
|
632
590
|
|
|
633
|
-
|
|
634
|
-
|
|
635
591
|
/**
|
|
636
592
|
var cell = $(`[data-col=${col}][data-bind=${filterOption.colnm}]`, owner.template);
|
|
637
593
|
var expr = cell.attr("data-expr");
|