ninegrid2 6.88.0 → 6.90.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 +697 -706
- package/dist/bundle.esm.js +697 -706
- package/dist/etc/_ngCell.js +3 -0
- package/dist/index.js +1 -1
- package/dist/utils/ninegrid.js +3 -3
- package/package.json +1 -1
- package/src/etc/_ngCell.js +3 -0
- package/src/index.js +1 -1
- package/src/utils/ninegrid.js +3 -3
package/dist/bundle.esm.js
CHANGED
|
@@ -10704,802 +10704,790 @@ function requireJquery () {
|
|
|
10704
10704
|
var jqueryExports = requireJquery();
|
|
10705
10705
|
var $$1 = /*@__PURE__*/getDefaultExportFromCjs(jqueryExports);
|
|
10706
10706
|
|
|
10707
|
-
|
|
10707
|
+
class ninegrid {
|
|
10708
10708
|
|
|
10709
|
-
var hasRequiredNinegrid;
|
|
10710
10709
|
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
hasRequiredNinegrid = 1;
|
|
10714
|
-
class ninegrid {
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
constructor() {
|
|
10718
|
-
console.log(`welcome nine-grid@${ninegrid.version}`, window.location.hostname);
|
|
10710
|
+
constructor() {
|
|
10711
|
+
console.log(`welcome nine-grid@${ninegrid.version}`, window.location.hostname);
|
|
10719
10712
|
|
|
10720
|
-
|
|
10721
|
-
|
|
10713
|
+
//console.log(i18next);
|
|
10714
|
+
}
|
|
10722
10715
|
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
};
|
|
10733
|
-
|
|
10734
|
-
static EVENT = {
|
|
10735
|
-
LOAD : "load",
|
|
10736
|
-
BUTTON_CLICK : "buttonclick",
|
|
10737
|
-
LINK_CLICK : "linklick",
|
|
10738
|
-
LAYOUT_CHANGED : "layoutchanged",
|
|
10739
|
-
CELL_CLICK : "cellclick",
|
|
10740
|
-
CELL_DBL_CLICK : "celldblclick",
|
|
10741
|
-
HEADCELL_CLICK : "headcellclick",
|
|
10742
|
-
HEADCELL_DBL_CLICK : "headcelldblclick",
|
|
10743
|
-
FOOTCELL_CLICK : "footcellclick",
|
|
10744
|
-
FOOTCELL_DBL_CLICK : "footcelldblclick",
|
|
10745
|
-
CELL_POS_CHANGED : "cellposchanged",
|
|
10746
|
-
ROW_POS_CHANGED : "rowposchanged",
|
|
10747
|
-
DATA_CHANGED : "datachanged",
|
|
10748
|
-
CAN_ROW_MOVE : "canrowmove",
|
|
10749
|
-
ROW_MOVED : "rowmoved",
|
|
10750
|
-
//CAN_FIXED_CHANGE : "canfixedchange",
|
|
10751
|
-
//FIXED_CHANGED : "fixedchanged",
|
|
10716
|
+
static LOG = {
|
|
10717
|
+
LEVEL : {
|
|
10718
|
+
ALL : 0,
|
|
10719
|
+
DEBUG : 1,
|
|
10720
|
+
INFO : 2,
|
|
10721
|
+
WARN : 3,
|
|
10722
|
+
ERROR : 4,
|
|
10723
|
+
OFF : 9,
|
|
10724
|
+
},
|
|
10752
10725
|
};
|
|
10726
|
+
|
|
10727
|
+
static EVENT = {
|
|
10728
|
+
LOAD : "load",
|
|
10729
|
+
BUTTON_CLICK : "buttonclick",
|
|
10730
|
+
LINK_CLICK : "linklick",
|
|
10731
|
+
LAYOUT_CHANGED : "layoutchanged",
|
|
10732
|
+
CELL_CLICK : "cellclick",
|
|
10733
|
+
CELL_DBL_CLICK : "celldblclick",
|
|
10734
|
+
HEADCELL_CLICK : "headcellclick",
|
|
10735
|
+
HEADCELL_DBL_CLICK : "headcelldblclick",
|
|
10736
|
+
FOOTCELL_CLICK : "footcellclick",
|
|
10737
|
+
FOOTCELL_DBL_CLICK : "footcelldblclick",
|
|
10738
|
+
CELL_POS_CHANGED : "cellposchanged",
|
|
10739
|
+
ROW_POS_CHANGED : "rowposchanged",
|
|
10740
|
+
DATA_CHANGED : "datachanged",
|
|
10741
|
+
CAN_ROW_MOVE : "canrowmove",
|
|
10742
|
+
ROW_MOVED : "rowmoved",
|
|
10743
|
+
//CAN_FIXED_CHANGE : "canfixedchange",
|
|
10744
|
+
//FIXED_CHANGED : "fixedchanged",
|
|
10745
|
+
};
|
|
10753
10746
|
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10747
|
+
static BAND = {
|
|
10748
|
+
BODY : "body",
|
|
10749
|
+
LEFT : "left",
|
|
10750
|
+
RIGHT : "right",
|
|
10751
|
+
};
|
|
10759
10752
|
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10753
|
+
/** .__ng._[ninegrid.ROW.ID] */
|
|
10754
|
+
static ROW = {
|
|
10755
|
+
ID : 0,
|
|
10756
|
+
INDEX : 1, /** 전체 INDEX */
|
|
10757
|
+
ORDER : 2, /** valid(collapse,pin,paging) ROW */
|
|
10758
|
+
VISIBLE_ROW : 3, /** visible INDEX */
|
|
10759
|
+
STATE : 4,
|
|
10760
|
+
FILTER : 5,
|
|
10761
|
+
PIN : 6,
|
|
10762
|
+
EXPAND : 7,
|
|
10763
|
+
COLLAPSE : 8,
|
|
10764
|
+
VISIBLE : 9,
|
|
10765
|
+
PAGING : 10,
|
|
10766
|
+
DELETED : 11,
|
|
10767
|
+
HEIGHT : 12,
|
|
10768
|
+
ORIGIN_ORDER: 13,
|
|
10769
|
+
ORIGIN_VALUE: 14,
|
|
10770
|
+
EXPAND_CHECK: 15,
|
|
10771
|
+
}
|
|
10779
10772
|
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10773
|
+
static ROW_STATE = {
|
|
10774
|
+
EMPTY : 0,
|
|
10775
|
+
NORMAL : 1,
|
|
10776
|
+
INSERT : 2,
|
|
10777
|
+
UPDATE : 4,
|
|
10778
|
+
DELETE : 8,
|
|
10779
|
+
GROUP : 16,
|
|
10780
|
+
}
|
|
10788
10781
|
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10782
|
+
static SELECTTYPE = {
|
|
10783
|
+
NONE : "none",
|
|
10784
|
+
ROW : "row",
|
|
10785
|
+
ROWS : "rows",
|
|
10786
|
+
COL : "col",
|
|
10787
|
+
COLS : "cols",
|
|
10788
|
+
CELL : "cell",
|
|
10789
|
+
AREA : "area",
|
|
10790
|
+
}
|
|
10798
10791
|
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10792
|
+
static COLINDICATORTYPE = {
|
|
10793
|
+
EXPAND : "expand",
|
|
10794
|
+
COLLAPSE: "collapse",
|
|
10795
|
+
}
|
|
10803
10796
|
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10797
|
+
static PAGINGTYPE = {
|
|
10798
|
+
NONE : "none",
|
|
10799
|
+
CLIENT : "client",
|
|
10800
|
+
SERVER : "server",
|
|
10801
|
+
}
|
|
10809
10802
|
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10803
|
+
static PAGINGCOUNT = {
|
|
10804
|
+
AUTO : "auto",
|
|
10805
|
+
NUM_1 : "1",
|
|
10806
|
+
NUM_5 : "5",
|
|
10807
|
+
NUM_10 : "10",
|
|
10808
|
+
NUM_20 : "20",
|
|
10809
|
+
NUM_30 : "30",
|
|
10810
|
+
NUM_50 : "50",
|
|
10811
|
+
NUM_100 : "100",
|
|
10812
|
+
NUM_1000 : "1000",
|
|
10813
|
+
NUM_10000 : "10000",
|
|
10814
|
+
}
|
|
10822
10815
|
|
|
10823
|
-
|
|
10816
|
+
static version = "1.1.1";
|
|
10817
|
+
|
|
10818
|
+
static options = {
|
|
10819
|
+
confirm : {
|
|
10820
|
+
"class" : "classic",
|
|
10821
|
+
"animation" : "run", //run,moveUp
|
|
10822
|
+
"true-text" : "Yes",
|
|
10823
|
+
"false-text" : "No",
|
|
10824
|
+
},
|
|
10825
|
+
alert : {
|
|
10826
|
+
"class" : "classic",
|
|
10827
|
+
"animation" : "zoom", //run, reverseRun, moveUp, moveDown, zoom, fade
|
|
10828
|
+
},
|
|
10829
|
+
};
|
|
10824
10830
|
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10831
|
+
static cssPath = null;
|
|
10832
|
+
|
|
10833
|
+
|
|
10834
|
+
static openFileDialog = (v) => {
|
|
10835
|
+
|
|
10836
|
+
return new Promise((resolve, reject) => {
|
|
10837
|
+
// 기존 input 요소 제거
|
|
10838
|
+
const existingInput = document.getElementById("ninegridFileInput");
|
|
10839
|
+
if (existingInput) {
|
|
10840
|
+
existingInput.remove();
|
|
10841
|
+
}
|
|
10842
|
+
|
|
10843
|
+
// 새로운 파일 입력 엘리먼트 생성
|
|
10844
|
+
const input = document.createElement("input");
|
|
10845
|
+
input.type = "file";
|
|
10846
|
+
input.accept = "*";
|
|
10847
|
+
input.id = "ninegridFileInput";
|
|
10848
|
+
|
|
10849
|
+
input.addEventListener("change", (event) => {
|
|
10850
|
+
const file = event.target.files[0];
|
|
10851
|
+
if (file) {
|
|
10852
|
+
resolve(file); // 파일 선택 시 Promise 해결
|
|
10853
|
+
} else {
|
|
10854
|
+
reject(new Error("파일이 선택되지 않았습니다."));
|
|
10855
|
+
}
|
|
10856
|
+
});
|
|
10857
|
+
|
|
10858
|
+
input.click(); // 파일 선택 창 열기
|
|
10859
|
+
});
|
|
10860
|
+
}
|
|
10861
|
+
|
|
10862
|
+
static getCustomPath = (c,v) => {
|
|
10837
10863
|
|
|
10838
|
-
static cssPath = null;
|
|
10839
10864
|
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
}
|
|
10849
|
-
|
|
10850
|
-
// 새로운 파일 입력 엘리먼트 생성
|
|
10851
|
-
const input = document.createElement("input");
|
|
10852
|
-
input.type = "file";
|
|
10853
|
-
input.accept = "*";
|
|
10854
|
-
input.id = "ninegridFileInput";
|
|
10855
|
-
|
|
10856
|
-
input.addEventListener("change", (event) => {
|
|
10857
|
-
const file = event.target.files[0];
|
|
10858
|
-
if (file) {
|
|
10859
|
-
resolve(file); // 파일 선택 시 Promise 해결
|
|
10860
|
-
} else {
|
|
10861
|
-
reject(new Error("파일이 선택되지 않았습니다."));
|
|
10862
|
-
}
|
|
10863
|
-
});
|
|
10864
|
-
|
|
10865
|
-
input.click(); // 파일 선택 창 열기
|
|
10866
|
-
});
|
|
10865
|
+
let cssPath;
|
|
10866
|
+
let host;
|
|
10867
|
+
if (c.tagName == "NINE-GRID") {
|
|
10868
|
+
host = c;
|
|
10869
|
+
}
|
|
10870
|
+
else {
|
|
10871
|
+
host = c.getRootNode().host;
|
|
10872
|
+
if (host && host.tagName != "NINE-GRID") host = host.getRootNode().host;
|
|
10867
10873
|
}
|
|
10868
|
-
|
|
10869
|
-
static getCustomPath = (c,v) => {
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
let cssPath;
|
|
10873
|
-
let host;
|
|
10874
|
-
if (c.tagName == "NINE-GRID") {
|
|
10875
|
-
host = c;
|
|
10876
|
-
}
|
|
10877
|
-
else {
|
|
10878
|
-
host = c.getRootNode().host;
|
|
10879
|
-
if (host && host.tagName != "NINE-GRID") host = host.getRootNode().host;
|
|
10880
|
-
}
|
|
10881
10874
|
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10875
|
+
if (host && host.tagName == "NINE-GRID") {
|
|
10876
|
+
cssPath = host.getAttribute("css-path");
|
|
10877
|
+
}
|
|
10878
|
+
|
|
10879
|
+
//console.log("========================", ninegrid.cssPath);
|
|
10887
10880
|
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10881
|
+
if (!cssPath) cssPath = ninegrid.cssPath;
|
|
10882
|
+
//console.log("================");
|
|
10883
|
+
//console.log(cssPath);
|
|
10884
|
+
|
|
10885
|
+
//console.log(cssPath ? `@import "${cssPath}/dist/${v}";` : null);
|
|
10893
10886
|
|
|
10894
|
-
|
|
10887
|
+
//console.log("========================", cssPath ? `@import "${cssPath}/${v}";` : "");
|
|
10895
10888
|
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10889
|
+
return cssPath ? `@import "${cssPath}/${v}";` : "";
|
|
10890
|
+
};
|
|
10891
|
+
|
|
10892
|
+
static closest = (selector, element) => {
|
|
10893
|
+
let currentElement = element;
|
|
10901
10894
|
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
}
|
|
10906
|
-
|
|
10907
|
-
currentElement = currentElement.getRootNode().host;
|
|
10895
|
+
while (currentElement) {
|
|
10896
|
+
if (currentElement.tagName.toLowerCase() === selector) {
|
|
10897
|
+
return currentElement;
|
|
10908
10898
|
}
|
|
10909
|
-
|
|
10910
|
-
return null;
|
|
10911
|
-
}
|
|
10912
10899
|
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10900
|
+
currentElement = currentElement.getRootNode().host;
|
|
10901
|
+
}
|
|
10902
|
+
|
|
10903
|
+
return null;
|
|
10904
|
+
}
|
|
10905
|
+
|
|
10906
|
+
static waitForInnerHTML = (element, maxAttempts = 3, intervalTime = 100) => {
|
|
10907
|
+
return new Promise((resolve, reject) => {
|
|
10908
|
+
let attempts = 0;
|
|
10909
|
+
const interval = setInterval(() => {
|
|
10910
|
+
if (element.innerHTML.trim() !== "") {
|
|
10911
|
+
//console.log("InnerHTML 확인됨, init() 실행 가능!");
|
|
10912
|
+
clearInterval(interval);
|
|
10913
|
+
resolve();
|
|
10914
|
+
} else {
|
|
10915
|
+
attempts++;
|
|
10916
|
+
//console.log(`InnerHTML이 비어 있음, ${attempts}/${maxAttempts}번 재시도`);
|
|
10917
|
+
|
|
10918
|
+
if (attempts >= maxAttempts) {
|
|
10919
10919
|
clearInterval(interval);
|
|
10920
|
-
|
|
10921
|
-
} else {
|
|
10922
|
-
attempts++;
|
|
10923
|
-
//console.log(`InnerHTML이 비어 있음, ${attempts}/${maxAttempts}번 재시도`);
|
|
10924
|
-
|
|
10925
|
-
if (attempts >= maxAttempts) {
|
|
10926
|
-
clearInterval(interval);
|
|
10927
|
-
reject("InnerHTML을 확인하지 못했습니다.");
|
|
10928
|
-
}
|
|
10920
|
+
reject("InnerHTML을 확인하지 못했습니다.");
|
|
10929
10921
|
}
|
|
10930
|
-
}, intervalTime);
|
|
10931
|
-
});
|
|
10932
|
-
};
|
|
10933
|
-
|
|
10934
|
-
static copyProperty = (target, source, properties) => {
|
|
10935
|
-
|
|
10936
|
-
if (!Array.isArray(properties)) properties = [properties];
|
|
10937
|
-
|
|
10938
|
-
for (var v in source) {
|
|
10939
|
-
if (properties.includes(v)) {
|
|
10940
|
-
target[v] = source[v];
|
|
10941
10922
|
}
|
|
10923
|
+
}, intervalTime);
|
|
10924
|
+
});
|
|
10925
|
+
};
|
|
10926
|
+
|
|
10927
|
+
static copyProperty = (target, source, properties) => {
|
|
10928
|
+
|
|
10929
|
+
if (!Array.isArray(properties)) properties = [properties];
|
|
10930
|
+
|
|
10931
|
+
for (var v in source) {
|
|
10932
|
+
if (properties.includes(v)) {
|
|
10933
|
+
target[v] = source[v];
|
|
10942
10934
|
}
|
|
10943
|
-
}
|
|
10944
|
-
|
|
10945
|
-
static decode = (args) => {
|
|
10946
|
-
for (var i = 1; i < args.length ; i+=2) {
|
|
10947
|
-
if (args[0] === args[i]) return args[i+1];
|
|
10948
|
-
}
|
|
10949
|
-
|
|
10950
|
-
return args.length % 2 == 0 ? args[args.length - 1] : null;
|
|
10951
|
-
};
|
|
10935
|
+
}
|
|
10936
|
+
};
|
|
10952
10937
|
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10938
|
+
static decode = (args) => {
|
|
10939
|
+
for (var i = 1; i < args.length ; i+=2) {
|
|
10940
|
+
if (args[0] === args[i]) return args[i+1];
|
|
10941
|
+
}
|
|
10956
10942
|
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
const characters ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
10961
|
-
let result = '';
|
|
10962
|
-
const charactersLength = characters.length;
|
|
10963
|
-
for (let i = 0; i < num; i++) {
|
|
10964
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
10965
|
-
}
|
|
10943
|
+
return args.length % 2 == 0 ? args[args.length - 1] : null;
|
|
10944
|
+
};
|
|
10966
10945
|
|
|
10967
|
-
|
|
10968
|
-
|
|
10946
|
+
static isMobile = () => {
|
|
10947
|
+
return /(iPhone|iPad|Android|BlackBerry|Windows Phone)/i.test(navigator.userAgent);
|
|
10948
|
+
};
|
|
10969
10949
|
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
};
|
|
10973
|
-
static isNull = (v) => {
|
|
10974
|
-
return ninegrid.isNvl(v);
|
|
10975
|
-
};
|
|
10976
|
-
static nvl = (v, v2) => {
|
|
10977
|
-
return ninegrid.isNvl(v) ? v2 : v;
|
|
10978
|
-
};
|
|
10950
|
+
static randomUUID = (num) => {
|
|
10951
|
+
if (!num) num = 10;
|
|
10979
10952
|
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
var c = uicolors.map((col) => {
|
|
10987
|
-
if (col <= 0.03928) {
|
|
10988
|
-
return col / 12.92;
|
|
10989
|
-
}
|
|
10990
|
-
|
|
10991
|
-
return Math.pow((col + 0.055) / 1.055, 2.4);
|
|
10992
|
-
});
|
|
10993
|
-
var L = (0.2126 * c[0]) + (0.7152 * c[1]) + (0.0722 * c[2]);
|
|
10994
|
-
return (L > 0.179) ? darkColor : lightColor;
|
|
10995
|
-
};
|
|
10953
|
+
const characters ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
10954
|
+
let result = '';
|
|
10955
|
+
const charactersLength = characters.length;
|
|
10956
|
+
for (let i = 0; i < num; i++) {
|
|
10957
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
10958
|
+
}
|
|
10996
10959
|
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
10960
|
+
return result;
|
|
10961
|
+
};
|
|
10962
|
+
|
|
10963
|
+
static isNvl = (v) => {
|
|
10964
|
+
return (v === null || v === undefined || v === '') ? true : false;
|
|
10965
|
+
};
|
|
10966
|
+
static isNull = (v) => {
|
|
10967
|
+
return ninegrid.isNvl(v);
|
|
10968
|
+
};
|
|
10969
|
+
static nvl = (v, v2) => {
|
|
10970
|
+
return ninegrid.isNvl(v) ? v2 : v;
|
|
10971
|
+
};
|
|
10972
|
+
|
|
10973
|
+
static oppositeColor = (bgColor, lightColor, darkColor) => {
|
|
10974
|
+
var color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;
|
|
10975
|
+
var r = parseInt(color.substring(0, 2), 16); // hexToR
|
|
10976
|
+
var g = parseInt(color.substring(2, 4), 16); // hexToG
|
|
10977
|
+
var b = parseInt(color.substring(4, 6), 16); // hexToB
|
|
10978
|
+
var uicolors = [r / 255, g / 255, b / 255];
|
|
10979
|
+
var c = uicolors.map((col) => {
|
|
10980
|
+
if (col <= 0.03928) {
|
|
10981
|
+
return col / 12.92;
|
|
11002
10982
|
}
|
|
11003
10983
|
|
|
11004
|
-
return
|
|
11005
|
-
};
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
var dateItems=_date.split(_delimiter);
|
|
11010
|
-
var monthIndex=formatItems.indexOf("mm");
|
|
11011
|
-
var dayIndex=formatItems.indexOf("dd");
|
|
11012
|
-
var yearIndex=formatItems.indexOf("yyyy");
|
|
11013
|
-
var month=parseInt(dateItems[monthIndex]);
|
|
11014
|
-
month-=1;
|
|
11015
|
-
var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);
|
|
11016
|
-
return formatedDate;
|
|
11017
|
-
};
|
|
10984
|
+
return Math.pow((col + 0.055) / 1.055, 2.4);
|
|
10985
|
+
});
|
|
10986
|
+
var L = (0.2126 * c[0]) + (0.7152 * c[1]) + (0.0722 * c[2]);
|
|
10987
|
+
return (L > 0.179) ? darkColor : lightColor;
|
|
10988
|
+
};
|
|
11018
10989
|
|
|
10990
|
+
static parseDate = (v) => {
|
|
10991
|
+
var date;
|
|
10992
|
+
|
|
10993
|
+
if (/[^0-9]/.test(v)) {
|
|
10994
|
+
date = new Date(v);
|
|
10995
|
+
}
|
|
10996
|
+
|
|
10997
|
+
return date;
|
|
10998
|
+
};
|
|
10999
|
+
static parseDate1 = (_date,_format,_delimiter) => {
|
|
11000
|
+
var formatLowerCase=_format.toLowerCase();
|
|
11001
|
+
var formatItems=formatLowerCase.split(_delimiter);
|
|
11002
|
+
var dateItems=_date.split(_delimiter);
|
|
11003
|
+
var monthIndex=formatItems.indexOf("mm");
|
|
11004
|
+
var dayIndex=formatItems.indexOf("dd");
|
|
11005
|
+
var yearIndex=formatItems.indexOf("yyyy");
|
|
11006
|
+
var month=parseInt(dateItems[monthIndex]);
|
|
11007
|
+
month-=1;
|
|
11008
|
+
var formatedDate = new Date(dateItems[yearIndex],month,dateItems[dayIndex]);
|
|
11009
|
+
return formatedDate;
|
|
11010
|
+
};
|
|
11019
11011
|
|
|
11020
|
-
static context;
|
|
11021
|
-
static measureTextSize = (_text, _font) => {
|
|
11022
|
-
if (typeof _text === 'number') _text = _text + "";
|
|
11023
|
-
|
|
11024
|
-
if (!_text) return {width:null,height:null};
|
|
11025
|
-
|
|
11026
|
-
_text = _text.replaceAll("\n", "<br>");
|
|
11027
11012
|
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11013
|
+
static context;
|
|
11014
|
+
static measureTextSize = (_text, _font) => {
|
|
11015
|
+
if (typeof _text === 'number') _text = _text + "";
|
|
11016
|
+
|
|
11017
|
+
if (!_text) return {width:null,height:null};
|
|
11018
|
+
|
|
11019
|
+
_text = _text.replaceAll("\n", "<br>");
|
|
11034
11020
|
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
w = Math.max(w, metrics.width);
|
|
11042
|
-
|
|
11043
|
-
//let fontHeight = metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent;
|
|
11044
|
-
//let actualHeight = metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent;
|
|
11021
|
+
// Set the font
|
|
11022
|
+
if (!ninegrid.context) {
|
|
11023
|
+
const canvas = document.createElement('canvas');
|
|
11024
|
+
ninegrid.context = canvas.getContext('2d');
|
|
11025
|
+
}
|
|
11026
|
+
ninegrid.context.font = _font;
|
|
11045
11027
|
|
|
11046
|
-
|
|
11047
|
-
|
|
11028
|
+
// Measure the text
|
|
11029
|
+
var w = 0;
|
|
11030
|
+
var h = 0;
|
|
11031
|
+
for (var v of _text.split("<br>")) {
|
|
11032
|
+
v = v.replace(/<(\/)?([a-zA-Z]*)(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/ig, "");
|
|
11033
|
+
const metrics = ninegrid.context.measureText(v);
|
|
11034
|
+
w = Math.max(w, metrics.width);
|
|
11035
|
+
|
|
11036
|
+
//let fontHeight = metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent;
|
|
11037
|
+
//let actualHeight = metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent;
|
|
11048
11038
|
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
width : w,
|
|
11052
|
-
height : h
|
|
11053
|
-
};
|
|
11054
|
-
};
|
|
11039
|
+
h += metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent;
|
|
11040
|
+
}
|
|
11055
11041
|
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
while (num !== -1) {
|
|
11061
|
-
result = String.fromCharCode('A'.charCodeAt(0) + (num % alpCount)) + result;
|
|
11062
|
-
num = Math.floor(num / alpCount) - 1;
|
|
11063
|
-
}
|
|
11064
|
-
|
|
11065
|
-
return result;
|
|
11042
|
+
// Return the width in pixels
|
|
11043
|
+
return {
|
|
11044
|
+
width : w,
|
|
11045
|
+
height : h
|
|
11066
11046
|
};
|
|
11047
|
+
};
|
|
11048
|
+
|
|
11049
|
+
static num2ExcelCol = (num) => {
|
|
11050
|
+
const alpCount = 'Z'.charCodeAt(0) - 'A'.charCodeAt(0) + 1;
|
|
11051
|
+
let result = '';
|
|
11067
11052
|
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11053
|
+
while (num !== -1) {
|
|
11054
|
+
result = String.fromCharCode('A'.charCodeAt(0) + (num % alpCount)) + result;
|
|
11055
|
+
num = Math.floor(num / alpCount) - 1;
|
|
11056
|
+
}
|
|
11057
|
+
|
|
11058
|
+
return result;
|
|
11059
|
+
};
|
|
11060
|
+
|
|
11061
|
+
static move = (arr, from, to) => {
|
|
11062
|
+
arr.splice(to, 0, arr.splice(from, 1)[0]);
|
|
11063
|
+
};
|
|
11071
11064
|
|
|
11072
11065
|
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11066
|
+
static binarySearchValue = (arr, searchProperty, searchValue, targetProperty, separator) => {
|
|
11067
|
+
if (!Array.isArray(searchValue)) searchValue = [searchValue];
|
|
11068
|
+
|
|
11069
|
+
var r = [];
|
|
11070
|
+
for (var v of searchValue) {
|
|
11071
|
+
var idx = arr.map(m => { return m[searchProperty]; }).nineBinarySearch(v);
|
|
11072
|
+
r.push( (idx < 0) ? v : arr[idx][targetProperty] );
|
|
11073
|
+
}
|
|
11074
|
+
|
|
11075
|
+
return r.join(separator || ",");
|
|
11076
|
+
};
|
|
11077
|
+
|
|
11078
|
+
static removeIf = (arr,callback) => {
|
|
11079
|
+
var i = 0;
|
|
11080
|
+
while (i < arr.length) {
|
|
11081
|
+
if (callback(arr[i], i)) {
|
|
11082
|
+
return arr.splice(i, 1);
|
|
11080
11083
|
}
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
};
|
|
11084
|
-
|
|
11085
|
-
static removeIf = (arr,callback) => {
|
|
11086
|
-
var i = 0;
|
|
11087
|
-
while (i < arr.length) {
|
|
11088
|
-
if (callback(arr[i], i)) {
|
|
11089
|
-
return arr.splice(i, 1);
|
|
11090
|
-
}
|
|
11091
|
-
else {
|
|
11092
|
-
++i;
|
|
11093
|
-
}
|
|
11084
|
+
else {
|
|
11085
|
+
++i;
|
|
11094
11086
|
}
|
|
11095
|
-
}
|
|
11087
|
+
}
|
|
11088
|
+
};
|
|
11096
11089
|
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11090
|
+
static sum = (arr,prop) => {
|
|
11091
|
+
return arr.map(m => { return m[prop]; }).reduce((a, b) => (a+b));
|
|
11092
|
+
};
|
|
11100
11093
|
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11094
|
+
static avg = (arr,prop) => {
|
|
11095
|
+
//console.log(arr, prop);
|
|
11096
|
+
if (arr.length == 0) return 0;
|
|
11097
|
+
|
|
11098
|
+
if (prop) arr = arr.getMap(prop);
|
|
11099
|
+
//console.log(arr);
|
|
11100
|
+
//if (prop) return (arr.map(m => { return m[v]; }).reduce((a,b) => (a+b)) / arr.length);
|
|
11101
|
+
|
|
11102
|
+
return (arr.reduce((a, b) => (a+b)) / arr.length);
|
|
11103
|
+
//return (arr.map(m => { return m[v]; }).reduce((a, b) => (a+b)) / arr.length);
|
|
11104
|
+
};
|
|
11112
11105
|
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11106
|
+
static lpad = (v,n,str) => {
|
|
11107
|
+
return Array(n - String(v).length + 1).join(str || '0') + v;
|
|
11108
|
+
};
|
|
11116
11109
|
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11110
|
+
static rpad = (v,n,str) => {
|
|
11111
|
+
return v + Array(n - String(v).length + 1).join(str || '0');
|
|
11112
|
+
};
|
|
11120
11113
|
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11114
|
+
static cut = (v,len) => {
|
|
11115
|
+
var str = v;
|
|
11116
|
+
var s = 0;
|
|
11117
|
+
for (var i=0; i<str.length; i++) {
|
|
11118
|
+
s += (str.charCodeAt(i) > 128) ? 2 : 1;
|
|
11119
|
+
if (s > len) return str.substring(0,i);
|
|
11120
|
+
}
|
|
11121
|
+
return str;
|
|
11122
|
+
};
|
|
11123
|
+
static getByteLength = (v) => {
|
|
11124
|
+
return v.replace(/[\0-\x7f]|([0-\u07ff]|(.))/g,"$&$1$2").length;
|
|
11125
|
+
};
|
|
11133
11126
|
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11127
|
+
static formatDate = (v, _format) => {
|
|
11128
|
+
return ninegrid.toDate(v, _format);
|
|
11129
|
+
};
|
|
11137
11130
|
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11131
|
+
static toDate = (v, format) => {
|
|
11132
|
+
var today = new Date();
|
|
11133
|
+
//20000101 yyyymmdd
|
|
11134
|
+
var yIndex = format.indexOf('yyyy');
|
|
11135
|
+
var mIndex = format.indexOf('mm');
|
|
11136
|
+
var dIndex = format.indexOf('dd');
|
|
11137
|
+
var hIndex = format.indexOf('hh');
|
|
11138
|
+
var iIndex = format.indexOf('mi');
|
|
11139
|
+
var sIndex = format.indexOf('ss');
|
|
11140
|
+
|
|
11141
|
+
var year = (yIndex > -1) ? v.substr(yIndex, 4) : today.getFullYear();
|
|
11142
|
+
var month = (mIndex > -1) ? v.substr(mIndex, 2)-1 : today.getMonth()-1;
|
|
11143
|
+
var day = (dIndex > -1) ? v.substr(dIndex, 2) : today.getDate();
|
|
11144
|
+
var hour = (hIndex > -1) ? v.substr(hIndex, 2) : today.getHours();
|
|
11145
|
+
var minute = (iIndex > -1) ? v.substr(iIndex, 2) : today.getMinutes();
|
|
11146
|
+
var second = (sIndex > -1) ? v.substr(sIndex, 2) : today.getSeconds();
|
|
11147
|
+
|
|
11148
|
+
return new Date(year,month,day,hour,minute,second);
|
|
11149
|
+
};
|
|
11157
11150
|
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11151
|
+
static formatString = (v, format, locale) => {
|
|
11152
|
+
if (isNaN(v)) return "";
|
|
11153
|
+
|
|
11154
|
+
locale = locale || "en-US";
|
|
11155
|
+
format = format.toLowerCase();
|
|
11156
|
+
|
|
11157
|
+
return format
|
|
11158
|
+
.replace("yyyy", v.getFullYear())
|
|
11159
|
+
.replace("yy", v.getYear())
|
|
11160
|
+
.replace("mon", v.toLocaleString(locale, { month: "short" }))
|
|
11161
|
+
.replace("mm", ninegrid.lpad(v.getMonth()+1, 2))
|
|
11162
|
+
.replace("dd", ninegrid.lpad(v.getDate(), 2))
|
|
11163
|
+
.replace("hh", ninegrid.lpad(v.getHours(), 2))
|
|
11164
|
+
.replace("mi", ninegrid.lpad(v.getMinutes(), 2))
|
|
11165
|
+
.replace("ss", ninegrid.lpad(v.getSeconds(), 2));
|
|
11166
|
+
};
|
|
11167
|
+
|
|
11168
|
+
|
|
11169
|
+
static log = {
|
|
11170
|
+
level : window.location.hostname == "localhost" ? ninegrid.LOG.LEVEL.DEBUG : ninegrid.LOG.LEVEL.WARN,
|
|
11171
|
+
//level : LOG.LEVEL.WARN,
|
|
11172
|
+
}
|
|
11173
|
+
static debug = (...args) => { if (ninegrid.log.level <= ninegrid.LOG.LEVEL.DEBUG) { console.trace(...args); } };
|
|
11174
|
+
static info = (...args) => { if (ninegrid.log.level <= ninegrid.LOG.LEVEL.INFO) { console.trace(...args); } };
|
|
11175
|
+
static warn = (...args) => { if (ninegrid.log.level <= ninegrid.LOG.LEVEL.WARN) { console.warn(...args); } };
|
|
11176
|
+
static error = (...args) => { if (ninegrid.log.level <= ninegrid.LOG.LEVEL.ERROR) { console.error(...args); } };
|
|
11177
|
+
|
|
11178
|
+
static global = {
|
|
11179
|
+
locale : (navigator.language || navigator.userLanguage || 'en').toLowerCase().substring(0, 2),
|
|
11180
|
+
lang : navigator.language,
|
|
11181
|
+
}
|
|
11182
|
+
|
|
11183
|
+
|
|
11184
|
+
static querySelectorAll = (selector, root) => {
|
|
11185
|
+
|
|
11186
|
+
root = root || document;
|
|
11174
11187
|
|
|
11188
|
+
const results = Array.from(root.querySelectorAll(selector));
|
|
11189
|
+
const pushNestedResults = function (root) {
|
|
11190
|
+
ninegrid.querySelectorAll(selector, root).forEach(elem => {
|
|
11191
|
+
if (!results.includes(elem)) {
|
|
11192
|
+
results.push(elem);
|
|
11193
|
+
}
|
|
11194
|
+
});
|
|
11195
|
+
};
|
|
11175
11196
|
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
//level : LOG.LEVEL.WARN,
|
|
11197
|
+
if (root.shadowRoot) {
|
|
11198
|
+
pushNestedResults(root.shadowRoot);
|
|
11179
11199
|
}
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
static global = {
|
|
11186
|
-
locale : (navigator.language || navigator.userLanguage || 'en').toLowerCase().substring(0, 2),
|
|
11187
|
-
lang : navigator.language,
|
|
11200
|
+
|
|
11201
|
+
for (const elem of root.querySelectorAll('*')) {
|
|
11202
|
+
if (elem.shadowRoot) {
|
|
11203
|
+
pushNestedResults(elem.shadowRoot);
|
|
11204
|
+
}
|
|
11188
11205
|
}
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11206
|
+
|
|
11207
|
+
return results;
|
|
11208
|
+
};
|
|
11209
|
+
|
|
11210
|
+
static i18n = {
|
|
11211
|
+
convertArrayToJSON : (arr) => {
|
|
11212
|
+
let result = {};
|
|
11194
11213
|
|
|
11195
|
-
const
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11214
|
+
for (const str of arr) {
|
|
11215
|
+
|
|
11216
|
+
if (!str) continue;
|
|
11217
|
+
|
|
11218
|
+
const index = str.indexOf("=");
|
|
11219
|
+
if (index <= 0) continue;
|
|
11220
|
+
|
|
11221
|
+
const keys = str.substring(0, index).split('.');
|
|
11222
|
+
const value = str.substring(index+1);
|
|
11223
|
+
let current = result;
|
|
11224
|
+
|
|
11225
|
+
for (let i = 0; i < keys.length; i++) {
|
|
11226
|
+
if (i === keys.length - 1) {
|
|
11227
|
+
current[keys[i]] = value;
|
|
11228
|
+
}
|
|
11229
|
+
else {
|
|
11230
|
+
if (!current[keys[i]]) {
|
|
11231
|
+
current[keys[i]] = {};
|
|
11232
|
+
}
|
|
11233
|
+
current = current[keys[i]];
|
|
11200
11234
|
}
|
|
11201
|
-
});
|
|
11202
|
-
};
|
|
11203
|
-
|
|
11204
|
-
if (root.shadowRoot) {
|
|
11205
|
-
pushNestedResults(root.shadowRoot);
|
|
11206
|
-
}
|
|
11207
|
-
|
|
11208
|
-
for (const elem of root.querySelectorAll('*')) {
|
|
11209
|
-
if (elem.shadowRoot) {
|
|
11210
|
-
pushNestedResults(elem.shadowRoot);
|
|
11211
11235
|
}
|
|
11212
11236
|
}
|
|
11213
|
-
|
|
11214
|
-
return results;
|
|
11215
|
-
};
|
|
11216
11237
|
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11238
|
+
return result;
|
|
11239
|
+
},
|
|
11240
|
+
updateContent : () => {
|
|
11241
|
+
ninegrid.querySelectorAll("nx-i18n,nx-span").forEach(v => {
|
|
11242
|
+
if (v.refresh) v.refresh();
|
|
11243
|
+
});
|
|
11244
|
+
ninegrid.querySelectorAll("nine-grid").forEach(v => {
|
|
11245
|
+
if (v.refresh) v.refreshData();
|
|
11246
|
+
});
|
|
11247
|
+
},
|
|
11248
|
+
addResourceBundle : (args) => {
|
|
11249
|
+
//console.log(args);
|
|
11250
|
+
|
|
11251
|
+
let count = Math.floor(args.length / 2);
|
|
11252
|
+
|
|
11253
|
+
for (var i=0; i < args.length; i+=2) {
|
|
11254
|
+
//console.log(i, args.length);
|
|
11255
|
+
if (i+1 >= args.length) break;
|
|
11220
11256
|
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
if (
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11257
|
+
const locale = args[i];
|
|
11258
|
+
const fileNm = args[i+1];
|
|
11259
|
+
|
|
11260
|
+
$.ajax({
|
|
11261
|
+
url: fileNm, // "/properties/message.ko.prop",
|
|
11262
|
+
dataType: "text",
|
|
11263
|
+
success: (text) => {
|
|
11264
|
+
i18next.addResourceBundle(locale, 'translation', ninegrid.i18n.convertArrayToJSON(text.split("\n")));
|
|
11265
|
+
|
|
11266
|
+
/**
|
|
11267
|
+
* 마지막 파일인 경우 화면갱신
|
|
11268
|
+
*/
|
|
11269
|
+
if (--count == 0) i18next.changeLanguage(ninegrid.global.locale);
|
|
11270
|
+
}
|
|
11271
|
+
});
|
|
11272
|
+
}
|
|
11273
|
+
|
|
11274
|
+
//console.log("=========")
|
|
11275
|
+
//ninegrid.i18n.updateContent();
|
|
11276
|
+
},
|
|
11277
|
+
init : () => {
|
|
11278
|
+
//console.log(ninegrid.global.locale);
|
|
11279
|
+
i18next.init(
|
|
11280
|
+
{
|
|
11281
|
+
lng: ninegrid.global.locale,//isKorean ? "ko" : "en", // 한국어인지, 영어인지 표시
|
|
11282
|
+
debug: window.location.hostname == "localhost" ? true : false,
|
|
11283
|
+
resources: {},
|
|
11284
|
+
},
|
|
11285
|
+
function(err, t) {
|
|
11286
|
+
if (err) {
|
|
11287
|
+
console.error(err);
|
|
11242
11288
|
}
|
|
11243
11289
|
}
|
|
11290
|
+
);
|
|
11244
11291
|
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11292
|
+
// 언어 변환 시 이벤트 (위의 select에서 onchange="i18next.changeLanguage(this.value)" 이벤트)
|
|
11293
|
+
i18next.on("languageChanged", () => {
|
|
11294
|
+
ninegrid.i18n.updateContent(); // 바뀐 언어에 따라 웹페이지 텍스트 재대입
|
|
11295
|
+
});
|
|
11296
|
+
},
|
|
11297
|
+
t : (v) => {
|
|
11298
|
+
console.log(i18next);
|
|
11299
|
+
return i18next.t(v);
|
|
11300
|
+
},
|
|
11301
|
+
}
|
|
11302
|
+
|
|
11303
|
+
static j = {
|
|
11304
|
+
copyEvents: (source, target) => {
|
|
11305
|
+
const events = getEventListeners(source);
|
|
11306
|
+
for (const [type, listeners] of Object.entries(events)) {
|
|
11307
|
+
listeners.forEach(listener => {
|
|
11308
|
+
target.addEventListener(type, listener.listener, listener.options);
|
|
11250
11309
|
});
|
|
11251
|
-
|
|
11252
|
-
|
|
11310
|
+
}
|
|
11311
|
+
},
|
|
11312
|
+
querySelectorAll: (selector, context = document) => {
|
|
11313
|
+
let elements = [];
|
|
11314
|
+
|
|
11315
|
+
if (context instanceof NodeList) {
|
|
11316
|
+
context.forEach(ctx => {
|
|
11317
|
+
if (selector instanceof NodeList) {
|
|
11318
|
+
selector.forEach(sel => {
|
|
11319
|
+
elements.push(...ctx.querySelectorAll(sel));
|
|
11320
|
+
});
|
|
11321
|
+
} else if (selector instanceof HTMLElement) {
|
|
11322
|
+
elements.push(...ctx.querySelectorAll(selector));
|
|
11323
|
+
} else {
|
|
11324
|
+
elements.push(...ctx.querySelectorAll(selector));
|
|
11325
|
+
}
|
|
11326
|
+
});
|
|
11327
|
+
} else {
|
|
11328
|
+
if (selector instanceof HTMLElement) {
|
|
11329
|
+
elements = [selector];
|
|
11330
|
+
} else if (selector instanceof NodeList) {
|
|
11331
|
+
selector.forEach(sel => {
|
|
11332
|
+
elements.push(...context.querySelectorAll(sel));
|
|
11333
|
+
});
|
|
11334
|
+
} else {
|
|
11335
|
+
elements = context.querySelectorAll(selector);
|
|
11336
|
+
}
|
|
11337
|
+
}
|
|
11338
|
+
|
|
11339
|
+
return {
|
|
11340
|
+
elements,
|
|
11341
|
+
elem() {
|
|
11342
|
+
return elements[0];
|
|
11343
|
+
},
|
|
11344
|
+
clone(withEvents = false) {
|
|
11345
|
+
const clones = [];
|
|
11346
|
+
elements.forEach(element => {
|
|
11347
|
+
const clone = element.cloneNode(true);
|
|
11348
|
+
if (withEvents) {
|
|
11349
|
+
ninegrid.j.copyEvents(element, clone);
|
|
11350
|
+
}
|
|
11351
|
+
clones.push(clone);
|
|
11253
11352
|
});
|
|
11353
|
+
this.elements = clones;
|
|
11354
|
+
return this;
|
|
11254
11355
|
},
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
for (var i=0; i < args.length; i+=2) {
|
|
11261
|
-
//console.log(i, args.length);
|
|
11262
|
-
if (i+1 >= args.length) break;
|
|
11263
|
-
|
|
11264
|
-
const locale = args[i];
|
|
11265
|
-
const fileNm = args[i+1];
|
|
11266
|
-
|
|
11267
|
-
$.ajax({
|
|
11268
|
-
url: fileNm, // "/properties/message.ko.prop",
|
|
11269
|
-
dataType: "text",
|
|
11270
|
-
success: (text) => {
|
|
11271
|
-
i18next.addResourceBundle(locale, 'translation', ninegrid.i18n.convertArrayToJSON(text.split("\n")));
|
|
11272
|
-
|
|
11273
|
-
/**
|
|
11274
|
-
* 마지막 파일인 경우 화면갱신
|
|
11275
|
-
*/
|
|
11276
|
-
if (--count == 0) i18next.changeLanguage(ninegrid.global.locale);
|
|
11277
|
-
}
|
|
11278
|
-
});
|
|
11279
|
-
}
|
|
11280
|
-
|
|
11281
|
-
//console.log("=========")
|
|
11282
|
-
//ninegrid.i18n.updateContent();
|
|
11283
|
-
},
|
|
11284
|
-
init : () => {
|
|
11285
|
-
//console.log(ninegrid.global.locale);
|
|
11286
|
-
i18next.init(
|
|
11287
|
-
{
|
|
11288
|
-
lng: ninegrid.global.locale,//isKorean ? "ko" : "en", // 한국어인지, 영어인지 표시
|
|
11289
|
-
debug: window.location.hostname == "localhost" ? true : false,
|
|
11290
|
-
resources: {},
|
|
11291
|
-
},
|
|
11292
|
-
function(err, t) {
|
|
11293
|
-
if (err) {
|
|
11294
|
-
console.error(err);
|
|
11295
|
-
}
|
|
11296
|
-
}
|
|
11297
|
-
);
|
|
11298
|
-
|
|
11299
|
-
// 언어 변환 시 이벤트 (위의 select에서 onchange="i18next.changeLanguage(this.value)" 이벤트)
|
|
11300
|
-
i18next.on("languageChanged", () => {
|
|
11301
|
-
ninegrid.i18n.updateContent(); // 바뀐 언어에 따라 웹페이지 텍스트 재대입
|
|
11356
|
+
children() {
|
|
11357
|
+
let childrenArray = [];
|
|
11358
|
+
elements.forEach(element => {
|
|
11359
|
+
childrenArray.push(...element.children);
|
|
11302
11360
|
});
|
|
11361
|
+
this.elements = childrenArray;
|
|
11362
|
+
return this;
|
|
11303
11363
|
},
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
},
|
|
11308
|
-
}
|
|
11309
|
-
|
|
11310
|
-
static j = {
|
|
11311
|
-
copyEvents: (source, target) => {
|
|
11312
|
-
const events = getEventListeners(source);
|
|
11313
|
-
for (const [type, listeners] of Object.entries(events)) {
|
|
11314
|
-
listeners.forEach(listener => {
|
|
11315
|
-
target.addEventListener(type, listener.listener, listener.options);
|
|
11316
|
-
});
|
|
11364
|
+
attr(attribute, value) {
|
|
11365
|
+
if (value === undefined) {
|
|
11366
|
+
return elements[0] ? elements[0].getAttribute(attribute) : null;
|
|
11317
11367
|
}
|
|
11318
|
-
|
|
11319
|
-
querySelectorAll: (selector, context = document) => {
|
|
11320
|
-
let elements = [];
|
|
11321
|
-
|
|
11322
|
-
if (context instanceof NodeList) {
|
|
11323
|
-
context.forEach(ctx => {
|
|
11324
|
-
if (selector instanceof NodeList) {
|
|
11325
|
-
selector.forEach(sel => {
|
|
11326
|
-
elements.push(...ctx.querySelectorAll(sel));
|
|
11327
|
-
});
|
|
11328
|
-
} else if (selector instanceof HTMLElement) {
|
|
11329
|
-
elements.push(...ctx.querySelectorAll(selector));
|
|
11330
|
-
} else {
|
|
11331
|
-
elements.push(...ctx.querySelectorAll(selector));
|
|
11332
|
-
}
|
|
11333
|
-
});
|
|
11334
|
-
} else {
|
|
11335
|
-
if (selector instanceof HTMLElement) {
|
|
11336
|
-
elements = [selector];
|
|
11337
|
-
} else if (selector instanceof NodeList) {
|
|
11338
|
-
selector.forEach(sel => {
|
|
11339
|
-
elements.push(...context.querySelectorAll(sel));
|
|
11340
|
-
});
|
|
11341
|
-
} else {
|
|
11342
|
-
elements = context.querySelectorAll(selector);
|
|
11343
|
-
}
|
|
11344
|
-
}
|
|
11345
|
-
|
|
11346
|
-
return {
|
|
11347
|
-
elements,
|
|
11348
|
-
elem() {
|
|
11349
|
-
return elements[0];
|
|
11350
|
-
},
|
|
11351
|
-
clone(withEvents = false) {
|
|
11352
|
-
const clones = [];
|
|
11368
|
+
else {
|
|
11353
11369
|
elements.forEach(element => {
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11370
|
+
//element.setAttribute(attribute, value);
|
|
11371
|
+
//element.setAttribute(attribute, value === true ? "true" : value);
|
|
11372
|
+
if (value === false) {
|
|
11373
|
+
element.removeAttribute(attribute);
|
|
11374
|
+
}
|
|
11375
|
+
else {
|
|
11376
|
+
element.setAttribute(attribute, value === true ? "true" : value);
|
|
11357
11377
|
}
|
|
11358
|
-
clones.push(clone);
|
|
11359
|
-
});
|
|
11360
|
-
this.elements = clones;
|
|
11361
|
-
return this;
|
|
11362
|
-
},
|
|
11363
|
-
children() {
|
|
11364
|
-
let childrenArray = [];
|
|
11365
|
-
elements.forEach(element => {
|
|
11366
|
-
childrenArray.push(...element.children);
|
|
11367
11378
|
});
|
|
11368
|
-
this.elements = childrenArray;
|
|
11369
11379
|
return this;
|
|
11370
|
-
}
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11380
|
+
}
|
|
11381
|
+
},
|
|
11382
|
+
removeAttr(...attributes) {
|
|
11383
|
+
attributes.forEach(attribute => {
|
|
11384
|
+
elements.forEach(element => {
|
|
11385
|
+
element.removeAttribute(attribute);
|
|
11386
|
+
});
|
|
11387
|
+
});
|
|
11388
|
+
return this;
|
|
11389
|
+
},
|
|
11390
|
+
css(property, value) {
|
|
11391
|
+
elements.forEach(element => {
|
|
11392
|
+
element.style[property] = value;
|
|
11393
|
+
});
|
|
11394
|
+
return this;
|
|
11395
|
+
},
|
|
11396
|
+
hasClass(className) {
|
|
11397
|
+
const elementsArray = Array.isArray(elements) ? elements : Array.from(elements);
|
|
11398
|
+
|
|
11399
|
+
return elementsArray.some(element => element.classList.contains(className));
|
|
11400
|
+
},
|
|
11401
|
+
addClass(className) {
|
|
11402
|
+
elements.forEach(element => {
|
|
11403
|
+
element.classList.add(className);
|
|
11404
|
+
});
|
|
11405
|
+
return this;
|
|
11406
|
+
},
|
|
11407
|
+
removeClass(className) {
|
|
11408
|
+
elements.forEach(element => {
|
|
11409
|
+
element.classList.remove(className);
|
|
11410
|
+
});
|
|
11411
|
+
return this;
|
|
11412
|
+
},
|
|
11413
|
+
show() {
|
|
11414
|
+
elements.forEach(element => {
|
|
11415
|
+
element.style.display = '';
|
|
11416
|
+
if (getComputedStyle(element).display === 'none') {
|
|
11417
|
+
element.style.display = 'block';
|
|
11387
11418
|
}
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
return this;
|
|
11419
|
-
},
|
|
11420
|
-
show() {
|
|
11421
|
-
elements.forEach(element => {
|
|
11422
|
-
element.style.display = '';
|
|
11423
|
-
if (getComputedStyle(element).display === 'none') {
|
|
11424
|
-
element.style.display = 'block';
|
|
11419
|
+
});
|
|
11420
|
+
return this;
|
|
11421
|
+
},
|
|
11422
|
+
hide() {
|
|
11423
|
+
elements.forEach(element => {
|
|
11424
|
+
element.style.display = 'none';
|
|
11425
|
+
});
|
|
11426
|
+
return this;
|
|
11427
|
+
},
|
|
11428
|
+
};
|
|
11429
|
+
}
|
|
11430
|
+
};
|
|
11431
|
+
|
|
11432
|
+
|
|
11433
|
+
|
|
11434
|
+
static x = {
|
|
11435
|
+
querySelectorAll :
|
|
11436
|
+
(selector, context = document) => {
|
|
11437
|
+
let elements = (selector instanceof HTMLElement) ? [selector] : context.querySelectorAll(selector);
|
|
11438
|
+
|
|
11439
|
+
//console.log(context, selector);
|
|
11440
|
+
//const elements = context.querySelectorAll(selector);
|
|
11441
|
+
return {
|
|
11442
|
+
elements,
|
|
11443
|
+
elem: function() {
|
|
11444
|
+
return elements[0];
|
|
11445
|
+
},
|
|
11446
|
+
attr: function(attribute, value) {
|
|
11447
|
+
if (value === undefined) {
|
|
11448
|
+
return elements[0] ? elements[0].getAttribute(attribute) : null;
|
|
11425
11449
|
}
|
|
11426
|
-
|
|
11427
|
-
return this;
|
|
11428
|
-
},
|
|
11429
|
-
hide() {
|
|
11430
|
-
elements.forEach(element => {
|
|
11431
|
-
element.style.display = 'none';
|
|
11432
|
-
});
|
|
11433
|
-
return this;
|
|
11434
|
-
},
|
|
11435
|
-
};
|
|
11436
|
-
}
|
|
11437
|
-
};
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
static x = {
|
|
11442
|
-
querySelectorAll :
|
|
11443
|
-
(selector, context = document) => {
|
|
11444
|
-
let elements = (selector instanceof HTMLElement) ? [selector] : context.querySelectorAll(selector);
|
|
11445
|
-
|
|
11446
|
-
//console.log(context, selector);
|
|
11447
|
-
//const elements = context.querySelectorAll(selector);
|
|
11448
|
-
return {
|
|
11449
|
-
elements,
|
|
11450
|
-
elem: function() {
|
|
11451
|
-
return elements[0];
|
|
11452
|
-
},
|
|
11453
|
-
attr: function(attribute, value) {
|
|
11454
|
-
if (value === undefined) {
|
|
11455
|
-
return elements[0] ? elements[0].getAttribute(attribute) : null;
|
|
11456
|
-
}
|
|
11457
|
-
else {
|
|
11458
|
-
elements.forEach(element => {
|
|
11459
|
-
//element.setAttribute(attribute, value);
|
|
11460
|
-
//element.setAttribute(attribute, value === true ? "true" : value);
|
|
11461
|
-
if (value === false) {
|
|
11462
|
-
element.removeAttribute(attribute);
|
|
11463
|
-
}
|
|
11464
|
-
else {
|
|
11465
|
-
element.setAttribute(attribute, value === true ? "true" : value);
|
|
11466
|
-
}
|
|
11467
|
-
});
|
|
11468
|
-
return this;
|
|
11469
|
-
}
|
|
11470
|
-
},
|
|
11471
|
-
css: function(property, value) {
|
|
11472
|
-
elements.forEach(element => {
|
|
11473
|
-
element.style[property] = value;
|
|
11474
|
-
});
|
|
11475
|
-
return this;
|
|
11476
|
-
},
|
|
11477
|
-
addClass: function(className) {
|
|
11450
|
+
else {
|
|
11478
11451
|
elements.forEach(element => {
|
|
11479
|
-
|
|
11480
|
-
|
|
11452
|
+
//element.setAttribute(attribute, value);
|
|
11453
|
+
//element.setAttribute(attribute, value === true ? "true" : value);
|
|
11454
|
+
if (value === false) {
|
|
11455
|
+
element.removeAttribute(attribute);
|
|
11481
11456
|
}
|
|
11482
|
-
|
|
11483
|
-
|
|
11484
|
-
},
|
|
11485
|
-
removeClass: function(className) {
|
|
11486
|
-
elements.forEach(element => {
|
|
11487
|
-
if (element.classList.contains(className)) {
|
|
11488
|
-
element.classList.remove(className);
|
|
11457
|
+
else {
|
|
11458
|
+
element.setAttribute(attribute, value === true ? "true" : value);
|
|
11489
11459
|
}
|
|
11490
11460
|
});
|
|
11491
11461
|
return this;
|
|
11492
|
-
}
|
|
11493
|
-
}
|
|
11494
|
-
|
|
11495
|
-
|
|
11462
|
+
}
|
|
11463
|
+
},
|
|
11464
|
+
css: function(property, value) {
|
|
11465
|
+
elements.forEach(element => {
|
|
11466
|
+
element.style[property] = value;
|
|
11467
|
+
});
|
|
11468
|
+
return this;
|
|
11469
|
+
},
|
|
11470
|
+
addClass: function(className) {
|
|
11471
|
+
elements.forEach(element => {
|
|
11472
|
+
if (!element.classList.contains(className)) {
|
|
11473
|
+
element.classList.add(className);
|
|
11474
|
+
}
|
|
11475
|
+
});
|
|
11476
|
+
return this;
|
|
11477
|
+
},
|
|
11478
|
+
removeClass: function(className) {
|
|
11479
|
+
elements.forEach(element => {
|
|
11480
|
+
if (element.classList.contains(className)) {
|
|
11481
|
+
element.classList.remove(className);
|
|
11482
|
+
}
|
|
11483
|
+
});
|
|
11484
|
+
return this;
|
|
11485
|
+
},
|
|
11486
|
+
}
|
|
11487
|
+
},
|
|
11496
11488
|
}
|
|
11497
|
-
return ninegrid$1;
|
|
11498
11489
|
}
|
|
11499
11490
|
|
|
11500
|
-
var ninegridExports = requireNinegrid();
|
|
11501
|
-
var ninegrid = /*@__PURE__*/getDefaultExportFromCjs(ninegridExports);
|
|
11502
|
-
|
|
11503
11491
|
class NgContainer4 extends HTMLElement {
|
|
11504
11492
|
constructor() {
|
|
11505
11493
|
super();
|
|
@@ -11827,8 +11815,11 @@ class ngCellEx extends HTMLElement
|
|
|
11827
11815
|
const row = parseInt(this.cell.dataset.row);
|
|
11828
11816
|
|
|
11829
11817
|
if (!rowData) return "";
|
|
11818
|
+
|
|
11819
|
+
console.log(this.cell.dataset.expr, this.cell.dataset.bind);
|
|
11830
11820
|
|
|
11831
11821
|
if (!ninegrid.isNull(this.cell.dataset.expr)) {
|
|
11822
|
+
|
|
11832
11823
|
try {
|
|
11833
11824
|
//console.log(this.cell.dataset.expr);
|
|
11834
11825
|
|