ninegrid2 6.151.0 → 6.153.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 +47 -70
- package/dist/bundle.esm.js +47 -70
- package/dist/etc/ngFiltering.js +33 -52
- package/dist/etc/ninegridContainer.js +5 -0
- package/dist/utils/ninegrid.js +14 -3
- package/package.json +1 -1
- package/src/etc/ngFiltering.js +33 -52
- package/src/etc/ninegridContainer.js +5 -0
- package/src/utils/ninegrid.js +14 -3
package/dist/bundle.cjs.js
CHANGED
|
@@ -10709,10 +10709,21 @@ var $$1 = /*@__PURE__*/getDefaultExportFromCjs(jqueryExports);
|
|
|
10709
10709
|
class ninegrid {
|
|
10710
10710
|
|
|
10711
10711
|
|
|
10712
|
-
|
|
10713
|
-
|
|
10712
|
+
constructor() {
|
|
10713
|
+
console.log(`welcome nine-grid@${ninegrid.version}`, window.location.hostname);
|
|
10714
|
+
//console.log(i18next);
|
|
10715
|
+
}
|
|
10714
10716
|
|
|
10715
|
-
|
|
10717
|
+
static extendElementPrototype() {
|
|
10718
|
+
console.log(1111);
|
|
10719
|
+
if (!("isHidden" in Element.prototype)) { // ✅ 이미 존재하는 경우 중복 정의 방지
|
|
10720
|
+
Object.defineProperty(Element.prototype, "isHidden", {
|
|
10721
|
+
get: function () {
|
|
10722
|
+
const style = window.getComputedStyle(this);
|
|
10723
|
+
return style.display === "none" || style.visibility === "hidden" || style.opacity === "0";
|
|
10724
|
+
}
|
|
10725
|
+
});
|
|
10726
|
+
}
|
|
10716
10727
|
}
|
|
10717
10728
|
|
|
10718
10729
|
static LOG = {
|
|
@@ -17900,9 +17911,31 @@ class ngFiltering
|
|
|
17900
17911
|
|
|
17901
17912
|
on = (v) => {
|
|
17902
17913
|
|
|
17903
|
-
this.#
|
|
17904
|
-
|
|
17905
|
-
|
|
17914
|
+
this.#isFiltering = true;
|
|
17915
|
+
const lastRowIndex = this.#getLastRowIndex();
|
|
17916
|
+
|
|
17917
|
+
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
17918
|
+
const rowIndex = td.closest("tr")?.sectionRowIndex;
|
|
17919
|
+
if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
17920
|
+
const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
|
|
17921
|
+
.map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
|
|
17922
|
+
.filter(Boolean); // ✅ `null` 제거
|
|
17923
|
+
|
|
17924
|
+
if (options.length > 0) {
|
|
17925
|
+
const filterButton = document.createElement("ng-filter-button");
|
|
17926
|
+
td.appendChild(filterButton);
|
|
17927
|
+
filterButton.filterOptions = options;
|
|
17928
|
+
}
|
|
17929
|
+
}
|
|
17930
|
+
});
|
|
17931
|
+
};
|
|
17932
|
+
|
|
17933
|
+
off = () => {
|
|
17934
|
+
this.#isFiltering = false;
|
|
17935
|
+
|
|
17936
|
+
this.#owner.body.querySelectorAll(".ng-table ng-filter-button").forEach((el) => {
|
|
17937
|
+
el.remove(); // ✅ 요소 삭제
|
|
17938
|
+
});
|
|
17906
17939
|
};
|
|
17907
17940
|
|
|
17908
17941
|
set = (oFilter) => {
|
|
@@ -18016,58 +18049,10 @@ class ngFiltering
|
|
|
18016
18049
|
|
|
18017
18050
|
return index;
|
|
18018
18051
|
};
|
|
18019
|
-
|
|
18020
|
-
#on = () => {
|
|
18021
|
-
this.#isFiltering = true;
|
|
18022
|
-
const lastRowIndex = this.#getLastRowIndex();
|
|
18023
|
-
|
|
18024
|
-
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
18025
|
-
const rowIndex = td.closest("tr")?.sectionRowIndex;
|
|
18026
|
-
if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
18027
|
-
const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
|
|
18028
|
-
.map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
|
|
18029
|
-
.filter(Boolean); // ✅ `null` 제거
|
|
18030
|
-
console.log(options);
|
|
18031
|
-
if (options.length > 0) {
|
|
18032
|
-
const filterButton = document.createElement("ng-filter-button");
|
|
18033
|
-
td.appendChild(filterButton);
|
|
18034
|
-
filterButton.filterOptions = options;
|
|
18035
|
-
}
|
|
18036
|
-
}
|
|
18037
|
-
});
|
|
18038
|
-
};
|
|
18039
18052
|
|
|
18040
|
-
#on1 = () => {
|
|
18041
|
-
this.#isFiltering = true;
|
|
18042
18053
|
|
|
18043
|
-
const lastRowIndex = this.#getLastRowIndex();
|
|
18044
18054
|
|
|
18045
|
-
|
|
18046
|
-
if (td.closest("tr").sectionRowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
18047
|
-
//let colnms = [];
|
|
18048
|
-
const options = [];
|
|
18049
|
-
this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((el) => {
|
|
18050
|
-
if (el.dataset.bind) {
|
|
18051
|
-
options.push({
|
|
18052
|
-
colnm: el.dataset.bind,
|
|
18053
|
-
data: [],
|
|
18054
|
-
});
|
|
18055
|
-
}
|
|
18056
|
-
});
|
|
18057
|
-
|
|
18058
|
-
if (options.length > 0) {
|
|
18059
|
-
const filterButton = document.createElement("ng-filter-button"); // ✅ `ng-filter-button` 생성
|
|
18060
|
-
td.appendChild(filterButton);
|
|
18061
|
-
filterButton.filterOptions = options; // ✅ 속성 설정
|
|
18062
|
-
}
|
|
18063
|
-
}
|
|
18064
|
-
});
|
|
18065
|
-
};
|
|
18066
|
-
|
|
18067
|
-
off = () => {
|
|
18068
|
-
this.#isFiltering = false;
|
|
18069
|
-
$(".ng-table ng-filter-button", this.#owner.body).remove();
|
|
18070
|
-
};
|
|
18055
|
+
|
|
18071
18056
|
|
|
18072
18057
|
#init = (option) => {
|
|
18073
18058
|
|
|
@@ -18172,25 +18157,12 @@ class ngFilterButton extends HTMLElement
|
|
|
18172
18157
|
e.preventDefault();
|
|
18173
18158
|
e.stopPropagation();
|
|
18174
18159
|
|
|
18175
|
-
|
|
18160
|
+
this.#owner.shadowRoot.querySelector('ng-filter-panel');
|
|
18176
18161
|
|
|
18177
|
-
if (this.#owner.shadowRoot.querySelectorAll('ng-filter-panel').length > 1) throw "too many ng-filter-panel";
|
|
18178
|
-
if (!panel) throw 'ng-filter-panel is null';
|
|
18179
|
-
|
|
18180
|
-
var cell = e.target.closest("th,td");
|
|
18181
|
-
|
|
18182
|
-
var l = $(e.target).offset().left - $(this.#owner).offset().left;// - $(panel).width() + $(e.target).width() + 1;
|
|
18183
|
-
if (l < 0) l = 0;
|
|
18184
|
-
if (l + $(panel).width() > $(this.#owner).width()) l = $(this.#owner).width() - $(panel).width() - 5;
|
|
18185
18162
|
|
|
18186
18163
|
|
|
18187
18164
|
|
|
18188
|
-
|
|
18189
|
-
|
|
18190
|
-
//$(panel).offset({left: l, top: t});
|
|
18191
|
-
$(panel).css({left: l, top: t});
|
|
18192
|
-
|
|
18193
|
-
panel.refresh(this.#owner, this);
|
|
18165
|
+
return;
|
|
18194
18166
|
};
|
|
18195
18167
|
}
|
|
18196
18168
|
|
|
@@ -24381,11 +24353,16 @@ class ninegridContainer extends HTMLElement
|
|
|
24381
24353
|
//ninegrid.setCssPath("/css/nine-grid");
|
|
24382
24354
|
|
|
24383
24355
|
//console.log("ninegrid constructor()");
|
|
24356
|
+
|
|
24384
24357
|
|
|
24358
|
+
|
|
24385
24359
|
super();
|
|
24386
24360
|
|
|
24387
24361
|
this.attachShadow({ mode: 'open' });
|
|
24388
24362
|
|
|
24363
|
+
|
|
24364
|
+
ninegrid.extendElementPrototype();
|
|
24365
|
+
|
|
24389
24366
|
this.#layouts = [];
|
|
24390
24367
|
|
|
24391
24368
|
/**
|
package/dist/bundle.esm.js
CHANGED
|
@@ -10707,10 +10707,21 @@ var $$1 = /*@__PURE__*/getDefaultExportFromCjs(jqueryExports);
|
|
|
10707
10707
|
class ninegrid {
|
|
10708
10708
|
|
|
10709
10709
|
|
|
10710
|
-
|
|
10711
|
-
|
|
10710
|
+
constructor() {
|
|
10711
|
+
console.log(`welcome nine-grid@${ninegrid.version}`, window.location.hostname);
|
|
10712
|
+
//console.log(i18next);
|
|
10713
|
+
}
|
|
10712
10714
|
|
|
10713
|
-
|
|
10715
|
+
static extendElementPrototype() {
|
|
10716
|
+
console.log(1111);
|
|
10717
|
+
if (!("isHidden" in Element.prototype)) { // ✅ 이미 존재하는 경우 중복 정의 방지
|
|
10718
|
+
Object.defineProperty(Element.prototype, "isHidden", {
|
|
10719
|
+
get: function () {
|
|
10720
|
+
const style = window.getComputedStyle(this);
|
|
10721
|
+
return style.display === "none" || style.visibility === "hidden" || style.opacity === "0";
|
|
10722
|
+
}
|
|
10723
|
+
});
|
|
10724
|
+
}
|
|
10714
10725
|
}
|
|
10715
10726
|
|
|
10716
10727
|
static LOG = {
|
|
@@ -17898,9 +17909,31 @@ class ngFiltering
|
|
|
17898
17909
|
|
|
17899
17910
|
on = (v) => {
|
|
17900
17911
|
|
|
17901
|
-
this.#
|
|
17902
|
-
|
|
17903
|
-
|
|
17912
|
+
this.#isFiltering = true;
|
|
17913
|
+
const lastRowIndex = this.#getLastRowIndex();
|
|
17914
|
+
|
|
17915
|
+
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
17916
|
+
const rowIndex = td.closest("tr")?.sectionRowIndex;
|
|
17917
|
+
if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
17918
|
+
const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
|
|
17919
|
+
.map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
|
|
17920
|
+
.filter(Boolean); // ✅ `null` 제거
|
|
17921
|
+
|
|
17922
|
+
if (options.length > 0) {
|
|
17923
|
+
const filterButton = document.createElement("ng-filter-button");
|
|
17924
|
+
td.appendChild(filterButton);
|
|
17925
|
+
filterButton.filterOptions = options;
|
|
17926
|
+
}
|
|
17927
|
+
}
|
|
17928
|
+
});
|
|
17929
|
+
};
|
|
17930
|
+
|
|
17931
|
+
off = () => {
|
|
17932
|
+
this.#isFiltering = false;
|
|
17933
|
+
|
|
17934
|
+
this.#owner.body.querySelectorAll(".ng-table ng-filter-button").forEach((el) => {
|
|
17935
|
+
el.remove(); // ✅ 요소 삭제
|
|
17936
|
+
});
|
|
17904
17937
|
};
|
|
17905
17938
|
|
|
17906
17939
|
set = (oFilter) => {
|
|
@@ -18014,58 +18047,10 @@ class ngFiltering
|
|
|
18014
18047
|
|
|
18015
18048
|
return index;
|
|
18016
18049
|
};
|
|
18017
|
-
|
|
18018
|
-
#on = () => {
|
|
18019
|
-
this.#isFiltering = true;
|
|
18020
|
-
const lastRowIndex = this.#getLastRowIndex();
|
|
18021
|
-
|
|
18022
|
-
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
18023
|
-
const rowIndex = td.closest("tr")?.sectionRowIndex;
|
|
18024
|
-
if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
18025
|
-
const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
|
|
18026
|
-
.map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
|
|
18027
|
-
.filter(Boolean); // ✅ `null` 제거
|
|
18028
|
-
console.log(options);
|
|
18029
|
-
if (options.length > 0) {
|
|
18030
|
-
const filterButton = document.createElement("ng-filter-button");
|
|
18031
|
-
td.appendChild(filterButton);
|
|
18032
|
-
filterButton.filterOptions = options;
|
|
18033
|
-
}
|
|
18034
|
-
}
|
|
18035
|
-
});
|
|
18036
|
-
};
|
|
18037
18050
|
|
|
18038
|
-
#on1 = () => {
|
|
18039
|
-
this.#isFiltering = true;
|
|
18040
18051
|
|
|
18041
|
-
const lastRowIndex = this.#getLastRowIndex();
|
|
18042
18052
|
|
|
18043
|
-
|
|
18044
|
-
if (td.closest("tr").sectionRowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
18045
|
-
//let colnms = [];
|
|
18046
|
-
const options = [];
|
|
18047
|
-
this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((el) => {
|
|
18048
|
-
if (el.dataset.bind) {
|
|
18049
|
-
options.push({
|
|
18050
|
-
colnm: el.dataset.bind,
|
|
18051
|
-
data: [],
|
|
18052
|
-
});
|
|
18053
|
-
}
|
|
18054
|
-
});
|
|
18055
|
-
|
|
18056
|
-
if (options.length > 0) {
|
|
18057
|
-
const filterButton = document.createElement("ng-filter-button"); // ✅ `ng-filter-button` 생성
|
|
18058
|
-
td.appendChild(filterButton);
|
|
18059
|
-
filterButton.filterOptions = options; // ✅ 속성 설정
|
|
18060
|
-
}
|
|
18061
|
-
}
|
|
18062
|
-
});
|
|
18063
|
-
};
|
|
18064
|
-
|
|
18065
|
-
off = () => {
|
|
18066
|
-
this.#isFiltering = false;
|
|
18067
|
-
$(".ng-table ng-filter-button", this.#owner.body).remove();
|
|
18068
|
-
};
|
|
18053
|
+
|
|
18069
18054
|
|
|
18070
18055
|
#init = (option) => {
|
|
18071
18056
|
|
|
@@ -18170,25 +18155,12 @@ class ngFilterButton extends HTMLElement
|
|
|
18170
18155
|
e.preventDefault();
|
|
18171
18156
|
e.stopPropagation();
|
|
18172
18157
|
|
|
18173
|
-
|
|
18158
|
+
this.#owner.shadowRoot.querySelector('ng-filter-panel');
|
|
18174
18159
|
|
|
18175
|
-
if (this.#owner.shadowRoot.querySelectorAll('ng-filter-panel').length > 1) throw "too many ng-filter-panel";
|
|
18176
|
-
if (!panel) throw 'ng-filter-panel is null';
|
|
18177
|
-
|
|
18178
|
-
var cell = e.target.closest("th,td");
|
|
18179
|
-
|
|
18180
|
-
var l = $(e.target).offset().left - $(this.#owner).offset().left;// - $(panel).width() + $(e.target).width() + 1;
|
|
18181
|
-
if (l < 0) l = 0;
|
|
18182
|
-
if (l + $(panel).width() > $(this.#owner).width()) l = $(this.#owner).width() - $(panel).width() - 5;
|
|
18183
18160
|
|
|
18184
18161
|
|
|
18185
18162
|
|
|
18186
|
-
|
|
18187
|
-
|
|
18188
|
-
//$(panel).offset({left: l, top: t});
|
|
18189
|
-
$(panel).css({left: l, top: t});
|
|
18190
|
-
|
|
18191
|
-
panel.refresh(this.#owner, this);
|
|
18163
|
+
return;
|
|
18192
18164
|
};
|
|
18193
18165
|
}
|
|
18194
18166
|
|
|
@@ -24379,11 +24351,16 @@ class ninegridContainer extends HTMLElement
|
|
|
24379
24351
|
//ninegrid.setCssPath("/css/nine-grid");
|
|
24380
24352
|
|
|
24381
24353
|
//console.log("ninegrid constructor()");
|
|
24354
|
+
|
|
24382
24355
|
|
|
24356
|
+
|
|
24383
24357
|
super();
|
|
24384
24358
|
|
|
24385
24359
|
this.attachShadow({ mode: 'open' });
|
|
24386
24360
|
|
|
24361
|
+
|
|
24362
|
+
ninegrid.extendElementPrototype();
|
|
24363
|
+
|
|
24387
24364
|
this.#layouts = [];
|
|
24388
24365
|
|
|
24389
24366
|
/**
|
package/dist/etc/ngFiltering.js
CHANGED
|
@@ -35,9 +35,31 @@ export class ngFiltering
|
|
|
35
35
|
|
|
36
36
|
on = (v) => {
|
|
37
37
|
|
|
38
|
-
this.#
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
this.#isFiltering = true;
|
|
39
|
+
const lastRowIndex = this.#getLastRowIndex();
|
|
40
|
+
|
|
41
|
+
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
42
|
+
const rowIndex = td.closest("tr")?.sectionRowIndex;
|
|
43
|
+
if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
44
|
+
const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
|
|
45
|
+
.map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
|
|
46
|
+
.filter(Boolean); // ✅ `null` 제거
|
|
47
|
+
|
|
48
|
+
if (options.length > 0) {
|
|
49
|
+
const filterButton = document.createElement("ng-filter-button");
|
|
50
|
+
td.appendChild(filterButton);
|
|
51
|
+
filterButton.filterOptions = options;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
off = () => {
|
|
58
|
+
this.#isFiltering = false;
|
|
59
|
+
|
|
60
|
+
this.#owner.body.querySelectorAll(".ng-table ng-filter-button").forEach((el) => {
|
|
61
|
+
el.remove(); // ✅ 요소 삭제
|
|
62
|
+
});
|
|
41
63
|
};
|
|
42
64
|
|
|
43
65
|
set = (oFilter) => {
|
|
@@ -151,58 +173,10 @@ export class ngFiltering
|
|
|
151
173
|
|
|
152
174
|
return index;
|
|
153
175
|
};
|
|
154
|
-
|
|
155
|
-
#on = () => {
|
|
156
|
-
this.#isFiltering = true;
|
|
157
|
-
const lastRowIndex = this.#getLastRowIndex();
|
|
158
176
|
|
|
159
|
-
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
160
|
-
const rowIndex = td.closest("tr")?.sectionRowIndex;
|
|
161
|
-
if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
162
|
-
const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
|
|
163
|
-
.map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
|
|
164
|
-
.filter(Boolean); // ✅ `null` 제거
|
|
165
|
-
console.log(options);
|
|
166
|
-
if (options.length > 0) {
|
|
167
|
-
const filterButton = document.createElement("ng-filter-button");
|
|
168
|
-
td.appendChild(filterButton);
|
|
169
|
-
filterButton.filterOptions = options;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
#on1 = () => {
|
|
176
|
-
this.#isFiltering = true;
|
|
177
|
-
|
|
178
|
-
const lastRowIndex = this.#getLastRowIndex();
|
|
179
|
-
|
|
180
|
-
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
181
|
-
if (td.closest("tr").sectionRowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
182
|
-
//let colnms = [];
|
|
183
|
-
const options = [];
|
|
184
|
-
this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((el) => {
|
|
185
|
-
if (el.dataset.bind) {
|
|
186
|
-
options.push({
|
|
187
|
-
colnm: el.dataset.bind,
|
|
188
|
-
data: [],
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
177
|
|
|
193
|
-
if (options.length > 0) {
|
|
194
|
-
const filterButton = document.createElement("ng-filter-button"); // ✅ `ng-filter-button` 생성
|
|
195
|
-
td.appendChild(filterButton);
|
|
196
|
-
filterButton.filterOptions = options; // ✅ 속성 설정
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
178
|
|
|
202
|
-
|
|
203
|
-
this.#isFiltering = false;
|
|
204
|
-
$(".ng-table ng-filter-button", this.#owner.body).remove();
|
|
205
|
-
};
|
|
179
|
+
|
|
206
180
|
|
|
207
181
|
#init = (option) => {
|
|
208
182
|
|
|
@@ -309,8 +283,15 @@ class ngFilterButton extends HTMLElement
|
|
|
309
283
|
|
|
310
284
|
var panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
|
|
311
285
|
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
return;
|
|
290
|
+
|
|
291
|
+
/**
|
|
312
292
|
if (this.#owner.shadowRoot.querySelectorAll('ng-filter-panel').length > 1) throw "too many ng-filter-panel";
|
|
313
293
|
if (!panel) throw 'ng-filter-panel is null';
|
|
294
|
+
*/
|
|
314
295
|
|
|
315
296
|
var cell = e.target.closest("th,td");
|
|
316
297
|
|
|
@@ -33,11 +33,16 @@ class ninegridContainer extends HTMLElement
|
|
|
33
33
|
//ninegrid.setCssPath("/css/nine-grid");
|
|
34
34
|
|
|
35
35
|
//console.log("ninegrid constructor()");
|
|
36
|
+
|
|
36
37
|
|
|
38
|
+
|
|
37
39
|
super();
|
|
38
40
|
|
|
39
41
|
this.attachShadow({ mode: 'open' });
|
|
40
42
|
|
|
43
|
+
|
|
44
|
+
ninegrid.extendElementPrototype();
|
|
45
|
+
|
|
41
46
|
this.#layouts = [];
|
|
42
47
|
|
|
43
48
|
/**
|
package/dist/utils/ninegrid.js
CHANGED
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
export class ninegrid {
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
constructor() {
|
|
7
|
+
console.log(`welcome nine-grid@${ninegrid.version}`, window.location.hostname);
|
|
8
|
+
//console.log(i18next);
|
|
9
|
+
}
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
static extendElementPrototype() {
|
|
12
|
+
console.log(1111);
|
|
13
|
+
if (!("isHidden" in Element.prototype)) { // ✅ 이미 존재하는 경우 중복 정의 방지
|
|
14
|
+
Object.defineProperty(Element.prototype, "isHidden", {
|
|
15
|
+
get: function () {
|
|
16
|
+
const style = window.getComputedStyle(this);
|
|
17
|
+
return style.display === "none" || style.visibility === "hidden" || style.opacity === "0";
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
10
21
|
}
|
|
11
22
|
|
|
12
23
|
static LOG = {
|
package/package.json
CHANGED
package/src/etc/ngFiltering.js
CHANGED
|
@@ -35,9 +35,31 @@ export class ngFiltering
|
|
|
35
35
|
|
|
36
36
|
on = (v) => {
|
|
37
37
|
|
|
38
|
-
this.#
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
this.#isFiltering = true;
|
|
39
|
+
const lastRowIndex = this.#getLastRowIndex();
|
|
40
|
+
|
|
41
|
+
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
42
|
+
const rowIndex = td.closest("tr")?.sectionRowIndex;
|
|
43
|
+
if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
44
|
+
const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
|
|
45
|
+
.map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
|
|
46
|
+
.filter(Boolean); // ✅ `null` 제거
|
|
47
|
+
|
|
48
|
+
if (options.length > 0) {
|
|
49
|
+
const filterButton = document.createElement("ng-filter-button");
|
|
50
|
+
td.appendChild(filterButton);
|
|
51
|
+
filterButton.filterOptions = options;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
off = () => {
|
|
58
|
+
this.#isFiltering = false;
|
|
59
|
+
|
|
60
|
+
this.#owner.body.querySelectorAll(".ng-table ng-filter-button").forEach((el) => {
|
|
61
|
+
el.remove(); // ✅ 요소 삭제
|
|
62
|
+
});
|
|
41
63
|
};
|
|
42
64
|
|
|
43
65
|
set = (oFilter) => {
|
|
@@ -151,58 +173,10 @@ export class ngFiltering
|
|
|
151
173
|
|
|
152
174
|
return index;
|
|
153
175
|
};
|
|
154
|
-
|
|
155
|
-
#on = () => {
|
|
156
|
-
this.#isFiltering = true;
|
|
157
|
-
const lastRowIndex = this.#getLastRowIndex();
|
|
158
176
|
|
|
159
|
-
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
160
|
-
const rowIndex = td.closest("tr")?.sectionRowIndex;
|
|
161
|
-
if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
162
|
-
const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
|
|
163
|
-
.map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
|
|
164
|
-
.filter(Boolean); // ✅ `null` 제거
|
|
165
|
-
console.log(options);
|
|
166
|
-
if (options.length > 0) {
|
|
167
|
-
const filterButton = document.createElement("ng-filter-button");
|
|
168
|
-
td.appendChild(filterButton);
|
|
169
|
-
filterButton.filterOptions = options;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
#on1 = () => {
|
|
176
|
-
this.#isFiltering = true;
|
|
177
|
-
|
|
178
|
-
const lastRowIndex = this.#getLastRowIndex();
|
|
179
|
-
|
|
180
|
-
this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
|
|
181
|
-
if (td.closest("tr").sectionRowIndex + td.rowSpan - 1 === lastRowIndex) {
|
|
182
|
-
//let colnms = [];
|
|
183
|
-
const options = [];
|
|
184
|
-
this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((el) => {
|
|
185
|
-
if (el.dataset.bind) {
|
|
186
|
-
options.push({
|
|
187
|
-
colnm: el.dataset.bind,
|
|
188
|
-
data: [],
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
177
|
|
|
193
|
-
if (options.length > 0) {
|
|
194
|
-
const filterButton = document.createElement("ng-filter-button"); // ✅ `ng-filter-button` 생성
|
|
195
|
-
td.appendChild(filterButton);
|
|
196
|
-
filterButton.filterOptions = options; // ✅ 속성 설정
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
178
|
|
|
202
|
-
|
|
203
|
-
this.#isFiltering = false;
|
|
204
|
-
$(".ng-table ng-filter-button", this.#owner.body).remove();
|
|
205
|
-
};
|
|
179
|
+
|
|
206
180
|
|
|
207
181
|
#init = (option) => {
|
|
208
182
|
|
|
@@ -309,8 +283,15 @@ class ngFilterButton extends HTMLElement
|
|
|
309
283
|
|
|
310
284
|
var panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
|
|
311
285
|
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
return;
|
|
290
|
+
|
|
291
|
+
/**
|
|
312
292
|
if (this.#owner.shadowRoot.querySelectorAll('ng-filter-panel').length > 1) throw "too many ng-filter-panel";
|
|
313
293
|
if (!panel) throw 'ng-filter-panel is null';
|
|
294
|
+
*/
|
|
314
295
|
|
|
315
296
|
var cell = e.target.closest("th,td");
|
|
316
297
|
|
|
@@ -33,11 +33,16 @@ class ninegridContainer extends HTMLElement
|
|
|
33
33
|
//ninegrid.setCssPath("/css/nine-grid");
|
|
34
34
|
|
|
35
35
|
//console.log("ninegrid constructor()");
|
|
36
|
+
|
|
36
37
|
|
|
38
|
+
|
|
37
39
|
super();
|
|
38
40
|
|
|
39
41
|
this.attachShadow({ mode: 'open' });
|
|
40
42
|
|
|
43
|
+
|
|
44
|
+
ninegrid.extendElementPrototype();
|
|
45
|
+
|
|
41
46
|
this.#layouts = [];
|
|
42
47
|
|
|
43
48
|
/**
|
package/src/utils/ninegrid.js
CHANGED
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
export class ninegrid {
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
constructor() {
|
|
7
|
+
console.log(`welcome nine-grid@${ninegrid.version}`, window.location.hostname);
|
|
8
|
+
//console.log(i18next);
|
|
9
|
+
}
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
static extendElementPrototype() {
|
|
12
|
+
console.log(1111);
|
|
13
|
+
if (!("isHidden" in Element.prototype)) { // ✅ 이미 존재하는 경우 중복 정의 방지
|
|
14
|
+
Object.defineProperty(Element.prototype, "isHidden", {
|
|
15
|
+
get: function () {
|
|
16
|
+
const style = window.getComputedStyle(this);
|
|
17
|
+
return style.display === "none" || style.visibility === "hidden" || style.opacity === "0";
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
10
21
|
}
|
|
11
22
|
|
|
12
23
|
static LOG = {
|