Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbalganjjm committed May 20, 2024
1 parent 8de3ec8 commit 22ab03f
Show file tree
Hide file tree
Showing 6 changed files with 662 additions and 801 deletions.
167 changes: 3 additions & 164 deletions src/main/resources/static/html/com/app/sample/type0401.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<div class="criteria-panel">
<ul>
<li><input id="name" type="text" class="mdc-text-field" data-label="Name"></li>
<li><select id="age" class="mdc-njs-select" data-label="Age"><option value=""></option></select></li>
<li><select id="gender" class="mdc-njs-select" data-label="Gender"><option value=""></option></select></li>
<li><select id="eyeColor" class="mdc-njs-select" data-label="Eye Color"><option value=""></option></select></li>
</ul>
Expand Down Expand Up @@ -80,11 +79,11 @@
<input id="favoriteFruit" type="checkbox">
</li>
<li>
<input id="registered" type="text" class="mdc-text-field" data-label="Registered">
<input id="registered" type="text" class="mdc-text-field" data-label="Registered" data-format='[["date",8,"date"]]'>
</li>
<li>
<p class="mdc-njs-fixed-label">Company</p>
<select id="company" multiple="multiple" style="height: 100px;"></select>
<select id="company"></select>
</li>
<li>
<textarea id="about" rows="4" cols="34" class="mdc-text-field" data-label="About"></textarea>
Expand All @@ -105,164 +104,4 @@
</div>
</article>

<script type="text/javascript">
(function() {

var cont = N(".type0401").cont({
"p.select.gender" : [ "gender" ],
"p.select.eyeColor" : [ "eyeColor" ],
"p.select.company" : [ "company" ],
"p.select.favoriteFruit" : [ "favoriteFruit" ],
"p.select.age" : [ "c.getCommonCodeList", "age", "age", function(data) {
return N(N.array.deduplicate(data, "age")).datasort("age");
}],
"p.form.search" : {
"usage" : {
"search-box" : {
"defaultButton" : ".btnSearch",
"events" : [{
"event" : "focusin",
"target" : "#name",
"handler" : function(e) {
N.log(e);
}
}]
}
}
},
"p.form.detail" : {
revert : true,
autoUnbind : true
},
"p.grid.master" : {
height : 500,
select : true,
selectScroll : false,
onSelect : function(index, rowEle, data, beforeRow, e) {
// TODO 전처리

APP.comm.utils.selectNBind.call(this, {
cont : cont,
form : "p.form.detail"
});

// 파일 요약 목록 생성
if(data.length > 0) {
APP.comm.utils.getFileSummaryList(cont["p.form.detail"].val("fileId"), "fileName", 60, cont["e.btnFile.click"]);
}

// TODO 후처리
},
onBind : function(context, data, isFirstPage, isLastPage) {
if(isFirstPage) {
this.select(0);
}
}
},
"p.popup.dept" : {
url : "html/com/app/sample/type04P0.html",
onOpen : "onOpen",
onClose : function(onCloseData) {
if (onCloseData) {
cont["p.form.detail"]
.val("deptNm", onCloseData.deptNm)
.val("deptCd", onCloseData.deptCd);
}
}
},
/**
* 공통 파일 팝업.
*/
"p.popup.file" : {
onClose : function(onCloseData) {
if(onCloseData) {
cont["p.form.detail"].val("fileId", onCloseData.fileId);

// 파일 요약 목록 생성
APP.comm.utils.createFileSummaryList(onCloseData.downloadList, "fileName", 60, cont["e.btnFile.click"]);
}
}
},
"c.getCommonCodeList" : function() {
return N.comm("sample/getSampleList.json");
},
"c.getSampleList" : function() {
return cont["p.form.search"].data(false).comm("sample/getSampleList.json");
},
"c.saveSampleList" : function() {
return N(cont["p.grid.master"].data("modified")).comm({
dataIsArray : true, // Array 타입의 여러 행데이터가 1 개 일때는 자동으로 Object로 변환됩니다. 자동으로 변환되지 않게 하려면 dataIsArray 옵션을 true로 지정해 주세요.
url : "sample/saveSampleList.json"
});
},
"e.btnSearch.click" : function(e) {
e.preventDefault();

if (cont["p.form.search"].validate()) {
cont["c.getSampleList"]().submit(function(data) {
// N.grid bind
cont["p.grid.master"].bind(data);
});
}
},
"e.btnDeptCd.click" : function(e) {
e.preventDefault();
cont["p.popup.dept"].open(cont["p.form.detail"].data(true)[0]);
},
"e.btnSave.click" : function(e) {
e.preventDefault();

return APP.comm.utils.save.call(this, {
cont : cont,
comm : "c.saveSampleList",
changed : "p.grid.master",
validate : "p.form.detail",
before : function() {
// TODO
},
after : function(data) {
cont["e.btnSearch.click"].click();
}
});
},
"e.btnAdd.click" : function(e) {
e.preventDefault();

if (cont["p.form.detail"].validate()) {
cont["p.form.detail"].add();
}
},
"e.btnDelete.click" : function(e) {
e.preventDefault();

cont["p.form.detail"].remove();
},
"e.btnRevert.click" : function(e) {
e.preventDefault();

if (cont["p.grid.master"].data("modified").length === 0) {
N(window).alert(N.message.get(APP.comm.messages, "COMM-0001")).show();
return false;
}

cont["p.form.detail"].revert();
},
"e.btnFile.click" : function(e) {
e.preventDefault();

cont["p.popup.file"].open(cont["p.form.detail"].val("fileId"));
},
init : function(view, request) {
// cont.opener는 탭이 포함된 부모페이지의 Controller Object.
if(cont.opener) {
cont["p.form.search"].context().hide().prev("h3").hide().prev(".view-intro").hide();
// 부모 페이지 컨트롤러의 검색 버튼 클릭
cont.opener["e.btnSearch.click"].click();
} else {
cont["e.btnSearch.click"].click();
}
}
});

})();
</script>
<script type="text/javascript" src="html/com/app/sample/type0401.js"></script>
52 changes: 52 additions & 0 deletions src/main/resources/static/js/natural_js/css/dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
:root {
color-scheme: dark;
--md-sys-color-primary: rgb(165 211 150);
--md-sys-color-surface-tint: rgb(165 211 150);
--md-sys-color-on-primary: rgb(16 56 12);
--md-sys-color-primary-container: rgb(40 80 33);
--md-sys-color-on-primary-container: rgb(192 239 176);
--md-sys-color-secondary: rgb(187 203 178);
--md-sys-color-on-secondary: rgb(38 52 34);
--md-sys-color-secondary-container: rgb(60 75 55);
--md-sys-color-on-secondary-container: rgb(215 232 205);
--md-sys-color-tertiary: rgb(160 207 210);
--md-sys-color-on-tertiary: rgb(0 55 58);
--md-sys-color-tertiary-container: rgb(30 77 81);
--md-sys-color-on-tertiary-container: rgb(188 235 238);
--md-sys-color-error: rgb(255 180 171);
--md-sys-color-on-error: rgb(105 0 5);
--md-sys-color-error-container: rgb(147 0 10);
--md-sys-color-on-error-container: rgb(255 218 214);
--md-sys-color-background: rgb(17 20 15);
--md-sys-color-on-background: rgb(225 228 218);
--md-sys-color-surface: rgb(17 20 15);
--md-sys-color-on-surface: rgb(225 228 218);
--md-sys-color-surface-variant: rgb(67 72 63);
--md-sys-color-on-surface-variant: rgb(195 200 188);
--md-sys-color-outline: rgb(141 147 135);
--md-sys-color-outline-variant: rgb(67 72 63);
--md-sys-color-shadow: rgb(0 0 0);
--md-sys-color-scrim: rgb(0 0 0);
--md-sys-color-inverse-surface: rgb(225 228 218);
--md-sys-color-inverse-on-surface: rgb(46 50 43);
--md-sys-color-inverse-primary: rgb(63 104 54);
--md-sys-color-primary-fixed: rgb(192 239 176);
--md-sys-color-on-primary-fixed: rgb(0 34 0);
--md-sys-color-primary-fixed-dim: rgb(165 211 150);
--md-sys-color-on-primary-fixed-variant: rgb(40 80 33);
--md-sys-color-secondary-fixed: rgb(215 232 205);
--md-sys-color-on-secondary-fixed: rgb(18 31 14);
--md-sys-color-secondary-fixed-dim: rgb(187 203 178);
--md-sys-color-on-secondary-fixed-variant: rgb(60 75 55);
--md-sys-color-tertiary-fixed: rgb(188 235 238);
--md-sys-color-on-tertiary-fixed: rgb(0 32 34);
--md-sys-color-tertiary-fixed-dim: rgb(160 207 210);
--md-sys-color-on-tertiary-fixed-variant: rgb(30 77 81);
--md-sys-color-surface-dim: rgb(17 20 15);
--md-sys-color-surface-bright: rgb(54 58 52);
--md-sys-color-surface-container-lowest: rgb(11 15 10);
--md-sys-color-surface-container-low: rgb(25 29 23);
--md-sys-color-surface-container: rgb(29 33 27);
--md-sys-color-surface-container-high: rgb(39 43 37);
--md-sys-color-surface-container-highest: rgb(50 54 47);
}
52 changes: 52 additions & 0 deletions src/main/resources/static/js/natural_js/css/light.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
:root {
color-scheme: light;
--md-sys-color-primary: rgb(63 104 54);
--md-sys-color-surface-tint: rgb(63 104 54);
--md-sys-color-on-primary: rgb(255 255 255);
--md-sys-color-primary-container: rgb(192 239 176);
--md-sys-color-on-primary-container: rgb(0 34 0);
--md-sys-color-secondary: rgb(84 99 78);
--md-sys-color-on-secondary: rgb(255 255 255);
--md-sys-color-secondary-container: rgb(215 232 205);
--md-sys-color-on-secondary-container: rgb(18 31 14);
--md-sys-color-tertiary: rgb(56 101 105);
--md-sys-color-on-tertiary: rgb(255 255 255);
--md-sys-color-tertiary-container: rgb(188 235 238);
--md-sys-color-on-tertiary-container: rgb(0 32 34);
--md-sys-color-error: rgb(186 26 26);
--md-sys-color-on-error: rgb(255 255 255);
--md-sys-color-error-container: rgb(255 218 214);
--md-sys-color-on-error-container: rgb(65 0 2);
--md-sys-color-background: rgb(248 251 241);
--md-sys-color-on-background: rgb(25 29 23);
--md-sys-color-surface: rgb(248 251 241);
--md-sys-color-on-surface: rgb(25 29 23);
--md-sys-color-surface-variant: rgb(223 228 216);
--md-sys-color-on-surface-variant: rgb(67 72 63);
--md-sys-color-outline: rgb(115 121 110);
--md-sys-color-outline-variant: rgba(195, 200, 188, 0.8);
--md-sys-color-shadow: rgba(0, 0, 0, 0.25);
--md-sys-color-scrim: rgb(0 0 0);
--md-sys-color-inverse-surface: rgb(46 50 43);
--md-sys-color-inverse-on-surface: rgb(239 242 232);
--md-sys-color-inverse-primary: rgb(165 211 150);
--md-sys-color-primary-fixed: rgb(192 239 176);
--md-sys-color-on-primary-fixed: rgb(0 34 0);
--md-sys-color-primary-fixed-dim: rgb(165 211 150);
--md-sys-color-on-primary-fixed-variant: rgb(40 80 33);
--md-sys-color-secondary-fixed: rgb(215 232 205);
--md-sys-color-on-secondary-fixed: rgb(18 31 14);
--md-sys-color-secondary-fixed-dim: rgb(187 203 178);
--md-sys-color-on-secondary-fixed-variant: rgb(60 75 55);
--md-sys-color-tertiary-fixed: rgb(188 235 238);
--md-sys-color-on-tertiary-fixed: rgb(0 32 34);
--md-sys-color-tertiary-fixed-dim: rgb(160 207 210);
--md-sys-color-on-tertiary-fixed-variant: rgb(30 77 81);
--md-sys-color-surface-dim: rgb(216 219 210);
--md-sys-color-surface-bright: rgb(248 251 241);
--md-sys-color-surface-container-lowest: rgb(255 255 255);
--md-sys-color-surface-container-low: rgb(242 245 235);
--md-sys-color-surface-container: rgb(236 239 229);
--md-sys-color-surface-container-high: rgb(230 233 224);
--md-sys-color-surface-container-highest: rgb(225 228 218);
}
Loading

0 comments on commit 22ab03f

Please sign in to comment.