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