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.
@@ -10704,802 +10704,790 @@ function requireJquery () {
10704
10704
  var jqueryExports = requireJquery();
10705
10705
  var $$1 = /*@__PURE__*/getDefaultExportFromCjs(jqueryExports);
10706
10706
 
10707
- var ninegrid$1 = {};
10707
+ class ninegrid {
10708
10708
 
10709
- var hasRequiredNinegrid;
10710
10709
 
10711
- function requireNinegrid () {
10712
- if (hasRequiredNinegrid) return ninegrid$1;
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
- //console.log(i18next);
10721
- }
10713
+ //console.log(i18next);
10714
+ }
10722
10715
 
10723
- static LOG = {
10724
- LEVEL : {
10725
- ALL : 0,
10726
- DEBUG : 1,
10727
- INFO : 2,
10728
- WARN : 3,
10729
- ERROR : 4,
10730
- OFF : 9,
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
- static BAND = {
10755
- BODY : "body",
10756
- LEFT : "left",
10757
- RIGHT : "right",
10758
- };
10747
+ static BAND = {
10748
+ BODY : "body",
10749
+ LEFT : "left",
10750
+ RIGHT : "right",
10751
+ };
10759
10752
 
10760
- /** .__ng._[ninegrid.ROW.ID] */
10761
- static ROW = {
10762
- ID : 0,
10763
- INDEX : 1, /** 전체 INDEX */
10764
- ORDER : 2, /** valid(collapse,pin,paging) ROW */
10765
- VISIBLE_ROW : 3, /** visible INDEX */
10766
- STATE : 4,
10767
- FILTER : 5,
10768
- PIN : 6,
10769
- EXPAND : 7,
10770
- COLLAPSE : 8,
10771
- VISIBLE : 9,
10772
- PAGING : 10,
10773
- DELETED : 11,
10774
- HEIGHT : 12,
10775
- ORIGIN_ORDER: 13,
10776
- ORIGIN_VALUE: 14,
10777
- EXPAND_CHECK: 15,
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
- static ROW_STATE = {
10781
- EMPTY : 0,
10782
- NORMAL : 1,
10783
- INSERT : 2,
10784
- UPDATE : 4,
10785
- DELETE : 8,
10786
- GROUP : 16,
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
- static SELECTTYPE = {
10790
- NONE : "none",
10791
- ROW : "row",
10792
- ROWS : "rows",
10793
- COL : "col",
10794
- COLS : "cols",
10795
- CELL : "cell",
10796
- AREA : "area",
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
- static COLINDICATORTYPE = {
10800
- EXPAND : "expand",
10801
- COLLAPSE: "collapse",
10802
- }
10792
+ static COLINDICATORTYPE = {
10793
+ EXPAND : "expand",
10794
+ COLLAPSE: "collapse",
10795
+ }
10803
10796
 
10804
- static PAGINGTYPE = {
10805
- NONE : "none",
10806
- CLIENT : "client",
10807
- SERVER : "server",
10808
- }
10797
+ static PAGINGTYPE = {
10798
+ NONE : "none",
10799
+ CLIENT : "client",
10800
+ SERVER : "server",
10801
+ }
10809
10802
 
10810
- static PAGINGCOUNT = {
10811
- AUTO : "auto",
10812
- NUM_1 : "1",
10813
- NUM_5 : "5",
10814
- NUM_10 : "10",
10815
- NUM_20 : "20",
10816
- NUM_30 : "30",
10817
- NUM_50 : "50",
10818
- NUM_100 : "100",
10819
- NUM_1000 : "1000",
10820
- NUM_10000 : "10000",
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
- static version = "1.1.1";
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
- static options = {
10826
- confirm : {
10827
- "class" : "classic",
10828
- "animation" : "run", //run,moveUp
10829
- "true-text" : "Yes",
10830
- "false-text" : "No",
10831
- },
10832
- alert : {
10833
- "class" : "classic",
10834
- "animation" : "zoom", //run, reverseRun, moveUp, moveDown, zoom, fade
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
- static openFileDialog = (v) => {
10842
-
10843
- return new Promise((resolve, reject) => {
10844
- // 기존 input 요소 제거
10845
- const existingInput = document.getElementById("ninegridFileInput");
10846
- if (existingInput) {
10847
- existingInput.remove();
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
- if (host && host.tagName == "NINE-GRID") {
10883
- cssPath = host.getAttribute("css-path");
10884
- }
10885
-
10886
- console.log("========================", ninegrid.cssPath);
10875
+ if (host && host.tagName == "NINE-GRID") {
10876
+ cssPath = host.getAttribute("css-path");
10877
+ }
10878
+
10879
+ //console.log("========================", ninegrid.cssPath);
10887
10880
 
10888
- if (!cssPath) cssPath = ninegrid.cssPath;
10889
- //console.log("================");
10890
- //console.log(cssPath);
10891
-
10892
- //console.log(cssPath ? `@import "${cssPath}/dist/${v}";` : null);
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
- console.log("========================", cssPath ? `@import "${cssPath}/${v}";` : "");
10887
+ //console.log("========================", cssPath ? `@import "${cssPath}/${v}";` : "");
10895
10888
 
10896
- return cssPath ? `@import "${cssPath}/${v}";` : "";
10897
- };
10898
-
10899
- static closest = (selector, element) => {
10900
- let currentElement = element;
10889
+ return cssPath ? `@import "${cssPath}/${v}";` : "";
10890
+ };
10891
+
10892
+ static closest = (selector, element) => {
10893
+ let currentElement = element;
10901
10894
 
10902
- while (currentElement) {
10903
- if (currentElement.tagName.toLowerCase() === selector) {
10904
- return currentElement;
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
- static waitForInnerHTML = (element, maxAttempts = 3, intervalTime = 100) => {
10914
- return new Promise((resolve, reject) => {
10915
- let attempts = 0;
10916
- const interval = setInterval(() => {
10917
- if (element.innerHTML.trim() !== "") {
10918
- //console.log("InnerHTML 확인됨, init() 실행 가능!");
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
- resolve();
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
- static isMobile = () => {
10954
- return /(iPhone|iPad|Android|BlackBerry|Windows Phone)/i.test(navigator.userAgent);
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
- static randomUUID = (num) => {
10958
- if (!num) num = 10;
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
- return result;
10968
- };
10946
+ static isMobile = () => {
10947
+ return /(iPhone|iPad|Android|BlackBerry|Windows Phone)/i.test(navigator.userAgent);
10948
+ };
10969
10949
 
10970
- static isNvl = (v) => {
10971
- return (v === null || v === undefined || v === '') ? true : false;
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
- static oppositeColor = (bgColor, lightColor, darkColor) => {
10981
- var color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;
10982
- var r = parseInt(color.substring(0, 2), 16); // hexToR
10983
- var g = parseInt(color.substring(2, 4), 16); // hexToG
10984
- var b = parseInt(color.substring(4, 6), 16); // hexToB
10985
- var uicolors = [r / 255, g / 255, b / 255];
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
- static parseDate = (v) => {
10998
- var date;
10999
-
11000
- if (/[^0-9]/.test(v)) {
11001
- date = new Date(v);
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 date;
11005
- };
11006
- static parseDate1 = (_date,_format,_delimiter) => {
11007
- var formatLowerCase=_format.toLowerCase();
11008
- var formatItems=formatLowerCase.split(_delimiter);
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
- // Set the font
11029
- if (!ninegrid.context) {
11030
- const canvas = document.createElement('canvas');
11031
- ninegrid.context = canvas.getContext('2d');
11032
- }
11033
- ninegrid.context.font = _font;
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
- // Measure the text
11036
- var w = 0;
11037
- var h = 0;
11038
- for (var v of _text.split("<br>")) {
11039
- v = v.replace(/<(\/)?([a-zA-Z]*)(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/ig, "");
11040
- const metrics = ninegrid.context.measureText(v);
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
- h += metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent;
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
- // Return the width in pixels
11050
- return {
11051
- width : w,
11052
- height : h
11053
- };
11054
- };
11039
+ h += metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent;
11040
+ }
11055
11041
 
11056
- static num2ExcelCol = (num) => {
11057
- const alpCount = 'Z'.charCodeAt(0) - 'A'.charCodeAt(0) + 1;
11058
- let result = '';
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
- static move = (arr, from, to) => {
11069
- arr.splice(to, 0, arr.splice(from, 1)[0]);
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
- static binarySearchValue = (arr, searchProperty, searchValue, targetProperty, separator) => {
11074
- if (!Array.isArray(searchValue)) searchValue = [searchValue];
11075
-
11076
- var r = [];
11077
- for (var v of searchValue) {
11078
- var idx = arr.map(m => { return m[searchProperty]; }).nineBinarySearch(v);
11079
- r.push( (idx < 0) ? v : arr[idx][targetProperty] );
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
- return r.join(separator || ",");
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
- static sum = (arr,prop) => {
11098
- return arr.map(m => { return m[prop]; }).reduce((a, b) => (a+b));
11099
- };
11090
+ static sum = (arr,prop) => {
11091
+ return arr.map(m => { return m[prop]; }).reduce((a, b) => (a+b));
11092
+ };
11100
11093
 
11101
- static avg = (arr,prop) => {
11102
- //console.log(arr, prop);
11103
- if (arr.length == 0) return 0;
11104
-
11105
- if (prop) arr = arr.getMap(prop);
11106
- //console.log(arr);
11107
- //if (prop) return (arr.map(m => { return m[v]; }).reduce((a,b) => (a+b)) / arr.length);
11108
-
11109
- return (arr.reduce((a, b) => (a+b)) / arr.length);
11110
- //return (arr.map(m => { return m[v]; }).reduce((a, b) => (a+b)) / arr.length);
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
- static lpad = (v,n,str) => {
11114
- return Array(n - String(v).length + 1).join(str || '0') + v;
11115
- };
11106
+ static lpad = (v,n,str) => {
11107
+ return Array(n - String(v).length + 1).join(str || '0') + v;
11108
+ };
11116
11109
 
11117
- static rpad = (v,n,str) => {
11118
- return v + Array(n - String(v).length + 1).join(str || '0');
11119
- };
11110
+ static rpad = (v,n,str) => {
11111
+ return v + Array(n - String(v).length + 1).join(str || '0');
11112
+ };
11120
11113
 
11121
- static cut = (v,len) => {
11122
- var str = v;
11123
- var s = 0;
11124
- for (var i=0; i<str.length; i++) {
11125
- s += (str.charCodeAt(i) > 128) ? 2 : 1;
11126
- if (s > len) return str.substring(0,i);
11127
- }
11128
- return str;
11129
- };
11130
- static getByteLength = (v) => {
11131
- return v.replace(/[\0-\x7f]|([0-\u07ff]|(.))/g,"$&$1$2").length;
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
- static formatDate = (v, _format) => {
11135
- return ninegrid.toDate(v, _format);
11136
- };
11127
+ static formatDate = (v, _format) => {
11128
+ return ninegrid.toDate(v, _format);
11129
+ };
11137
11130
 
11138
- static toDate = (v, format) => {
11139
- var today = new Date();
11140
- //20000101 yyyymmdd
11141
- var yIndex = format.indexOf('yyyy');
11142
- var mIndex = format.indexOf('mm');
11143
- var dIndex = format.indexOf('dd');
11144
- var hIndex = format.indexOf('hh');
11145
- var iIndex = format.indexOf('mi');
11146
- var sIndex = format.indexOf('ss');
11147
-
11148
- var year = (yIndex > -1) ? v.substr(yIndex, 4) : today.getFullYear();
11149
- var month = (mIndex > -1) ? v.substr(mIndex, 2)-1 : today.getMonth()-1;
11150
- var day = (dIndex > -1) ? v.substr(dIndex, 2) : today.getDate();
11151
- var hour = (hIndex > -1) ? v.substr(hIndex, 2) : today.getHours();
11152
- var minute = (iIndex > -1) ? v.substr(iIndex, 2) : today.getMinutes();
11153
- var second = (sIndex > -1) ? v.substr(sIndex, 2) : today.getSeconds();
11154
-
11155
- return new Date(year,month,day,hour,minute,second);
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
- static formatString = (v, format, locale) => {
11159
- if (isNaN(v)) return "";
11160
-
11161
- locale = locale || "en-US";
11162
- format = format.toLowerCase();
11163
-
11164
- return format
11165
- .replace("yyyy", v.getFullYear())
11166
- .replace("yy", v.getYear())
11167
- .replace("mon", v.toLocaleString(locale, { month: "short" }))
11168
- .replace("mm", ninegrid.lpad(v.getMonth()+1, 2))
11169
- .replace("dd", ninegrid.lpad(v.getDate(), 2))
11170
- .replace("hh", ninegrid.lpad(v.getHours(), 2))
11171
- .replace("mi", ninegrid.lpad(v.getMinutes(), 2))
11172
- .replace("ss", ninegrid.lpad(v.getSeconds(), 2));
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
- static log = {
11177
- level : window.location.hostname == "localhost" ? ninegrid.LOG.LEVEL.DEBUG : ninegrid.LOG.LEVEL.WARN,
11178
- //level : LOG.LEVEL.WARN,
11197
+ if (root.shadowRoot) {
11198
+ pushNestedResults(root.shadowRoot);
11179
11199
  }
11180
- static debug = (...args) => { if (ninegrid.log.level <= ninegrid.LOG.LEVEL.DEBUG) { console.trace(...args); } };
11181
- static info = (...args) => { if (ninegrid.log.level <= ninegrid.LOG.LEVEL.INFO) { console.trace(...args); } };
11182
- static warn = (...args) => { if (ninegrid.log.level <= ninegrid.LOG.LEVEL.WARN) { console.warn(...args); } };
11183
- static error = (...args) => { if (ninegrid.log.level <= ninegrid.LOG.LEVEL.ERROR) { console.error(...args); } };
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
- static querySelectorAll = (selector, root) => {
11192
-
11193
- root = root || document;
11206
+
11207
+ return results;
11208
+ };
11209
+
11210
+ static i18n = {
11211
+ convertArrayToJSON : (arr) => {
11212
+ let result = {};
11194
11213
 
11195
- const results = Array.from(root.querySelectorAll(selector));
11196
- const pushNestedResults = function (root) {
11197
- ninegrid.querySelectorAll(selector, root).forEach(elem => {
11198
- if (!results.includes(elem)) {
11199
- results.push(elem);
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
- static i18n = {
11218
- convertArrayToJSON : (arr) => {
11219
- let result = {};
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
- for (const str of arr) {
11222
-
11223
- if (!str) continue;
11224
-
11225
- const index = str.indexOf("=");
11226
- if (index <= 0) continue;
11227
-
11228
- const keys = str.substring(0, index).split('.');
11229
- const value = str.substring(index+1);
11230
- let current = result;
11231
-
11232
- for (let i = 0; i < keys.length; i++) {
11233
- if (i === keys.length - 1) {
11234
- current[keys[i]] = value;
11235
- }
11236
- else {
11237
- if (!current[keys[i]]) {
11238
- current[keys[i]] = {};
11239
- }
11240
- current = current[keys[i]];
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
- return result;
11246
- },
11247
- updateContent : () => {
11248
- ninegrid.querySelectorAll("nx-i18n,nx-span").forEach(v => {
11249
- if (v.refresh) v.refresh();
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
- ninegrid.querySelectorAll("nine-grid").forEach(v => {
11252
- if (v.refresh) v.refreshData();
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
- addResourceBundle : (args) => {
11256
- //console.log(args);
11257
-
11258
- let count = Math.floor(args.length / 2);
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
- t : (v) => {
11305
- console.log(i18next);
11306
- return i18next.t(v);
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
- const clone = element.cloneNode(true);
11355
- if (withEvents) {
11356
- ninegrid.j.copyEvents(element, clone);
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
- attr(attribute, value) {
11372
- if (value === undefined) {
11373
- return elements[0] ? elements[0].getAttribute(attribute) : null;
11374
- }
11375
- else {
11376
- elements.forEach(element => {
11377
- //element.setAttribute(attribute, value);
11378
- //element.setAttribute(attribute, value === true ? "true" : value);
11379
- if (value === false) {
11380
- element.removeAttribute(attribute);
11381
- }
11382
- else {
11383
- element.setAttribute(attribute, value === true ? "true" : value);
11384
- }
11385
- });
11386
- return this;
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
- removeAttr(...attributes) {
11390
- attributes.forEach(attribute => {
11391
- elements.forEach(element => {
11392
- element.removeAttribute(attribute);
11393
- });
11394
- });
11395
- return this;
11396
- },
11397
- css(property, value) {
11398
- elements.forEach(element => {
11399
- element.style[property] = value;
11400
- });
11401
- return this;
11402
- },
11403
- hasClass(className) {
11404
- const elementsArray = Array.isArray(elements) ? elements : Array.from(elements);
11405
-
11406
- return elementsArray.some(element => element.classList.contains(className));
11407
- },
11408
- addClass(className) {
11409
- elements.forEach(element => {
11410
- element.classList.add(className);
11411
- });
11412
- return this;
11413
- },
11414
- removeClass(className) {
11415
- elements.forEach(element => {
11416
- element.classList.remove(className);
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
- if (!element.classList.contains(className)) {
11480
- element.classList.add(className);
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
- return this;
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