Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea6ff4b

Browse files
author
minjk-bl
committed
Test for DataSelector component
1 parenta772ba7 commitea6ff4b

File tree

3 files changed

+82
-21
lines changed

3 files changed

+82
-21
lines changed

‎css/component/dataSelector.css‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
11
/* Code Preview */
2+
.vp-dataselector {
3+
position: absolute;
4+
top:calc(50%-200px);
5+
left:calc(50%-200px);
6+
width:400px;
7+
height:400px;
8+
background: white;
9+
border:1px solidvar(--border-gray-color);
10+
z-index:999;
11+
/* font */
12+
font-family: AppleSDGothicNeo;
13+
font-size:14px;
14+
color:var(--font-primary);
15+
}
16+
.vp-ds-variable-box {
17+
border:1px solidvar(--border-gray-color);
18+
height:100px;
19+
grid-row-gap:0px;
20+
}
21+
.vp-ds-var-item {
22+
height:25px;
23+
border-bottom:1px solidvar(--border-gray-color);
24+
}
25+
.vp-ds-var-item:hover {
26+
background:var(--light-gray-color);
27+
color:var(--font-hightlight);
28+
cursor: pointer;
29+
}
30+
.vp-ds-var-item.selected {
31+
background:var(--light-gray-color);
32+
color:var(--font-hightlight);
33+
font-weight: bold;
34+
}
35+
.vp-ds-var-data {
36+
padding-left:5px;
37+
}
38+
.vp-ds-var-type {
39+
border-left:1px solidvar(--border-gray-color);
40+
padding-left:5px;
41+
}
42+
.vp-ds-option-box {
43+
44+
}
245
.vp-ds-preview {
346
width:100%;
447
height:35px;

‎html/component/dataSelector.html‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
<body>
2-
<div>
3-
<divclass="vp-grid-col-p50">
4-
<label>Variable</label>
5-
<label>Data Type</label>
2+
<divclass="vp-dataselector">
3+
<divclass="vp-inner-popup-header">
4+
<labelclass="vp-inner-popup-title">Data Selector</label>
5+
<imgclass="vp-inner-popup-close"src="/nbextensions/visualpython/img/close_big.svg"title="Close data selector"/>
66
</div>
7-
<divclass="vp-variable-box">
8-
<divclass="vp-grid-box">
7+
<divclass="vp-inner-popup-body vp-scrollbar">
8+
<divclass="vp-grid-col-p50">
9+
<labelclass="vp-bold">Data</label>
10+
<labelclass="vp-bold">Type</label>
11+
</div>
12+
<divclass="vp-ds-variable-box vp-grid-box vp-scrollbar">
913

1014
</div>
15+
<divclass="vp-ds-option-box">
16+
Option Page
17+
</div>
1118
</div>
12-
<divclass="vp-option-box">
13-
19+
<divclass="vp-inner-popup-footer">
20+
<inputtype="text"/><!-- CodeMirror needed -->
21+
<divclass="vp-inner-popup-button-box">
22+
<buttontype="button"class="vp-button activated"id="vp_dsOk">OK</button>
23+
</div>
1424
</div>
1525
</div>
1626
</body>

‎js/m_apps/SampleApp.js‎

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ define([
1616
'vp_base/js/com/com_util',
1717
'vp_base/js/com/com_Const',
1818
'vp_base/js/com/com_String',
19-
'vp_base/js/com/component/PopupComponent'
20-
],function(com_util,com_Const,com_String,PopupComponent){
19+
'vp_base/js/com/component/PopupComponent',
20+
'vp_base/js/com/component/DataSelector'
21+
],function(com_util,com_Const,com_String,PopupComponent,DataSelector){
2122

2223
/**
2324
* SampleApp
@@ -32,22 +33,29 @@ define([
3233
super._bindEvent();
3334
/** Implement binding events */
3435
varthat=this;
35-
this.$target.on('click',function(evt){
36-
vartarget=evt.target;
37-
if($(that.wrapSelector()).find(target).length>0){
38-
// Sample : getDataList from Kernel
39-
vpKernel.getDataList().then(function(resultObj){
40-
vpLog.display(VP_LOG_TYPE.DEVELOP,resultObj);
41-
}).catch(function(err){
42-
vpLog.display(VP_LOG_TYPE.DEVELOP,err);
43-
});
44-
}
36+
37+
$(this.wrapSelector('#sample')).on('click',function(){
38+
letdataSelector=newDataSelector({
39+
type:'data',
40+
target:$(that.wrapSelector('#sample')),
41+
finish:function(){
42+
43+
}
44+
});
45+
dataSelector.open();
4546
});
4647
}
4748

4849
templateForBody(){
4950
/** Implement generating template */
50-
return'This is sample.';
51+
return`This is sample.
52+
<input type="text" id="sample" class="vp-state vp-input" placeholder="Click to edit" readonly="" />`;
53+
}
54+
55+
render(){
56+
super.render();
57+
58+
5159
}
5260

5361
generateCode(){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp