hqchart 1.1.13182 → 1.1.13194

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.
@@ -21,6 +21,7 @@ function JSPopMenu()
21
21
  this.ClickCallback=null; //点击回调
22
22
  this.CheckedClassName="UMyChart_MenuItem_Span_Checked iconfont icon-checked"; //选中图标
23
23
  this.RightArrowClassName="UMyChart_MenuItem_Span_Arrow iconfont icon-menu_arraw_right"; //右侧箭头
24
+ this.SelectedClassName="UMyChart_MenuItem_Tr_Selected";
24
25
 
25
26
  this.AryTDClassName=
26
27
  [
@@ -93,7 +94,7 @@ function JSPopMenu()
93
94
  {
94
95
  var trDom=document.createElement("tr");
95
96
  trDom.className='UMyChart_MenuItem_Tr';
96
-
97
+
97
98
  var prtTdDom=null;
98
99
  for(var i=0;i<this.AryTDClassName.length;++i)
99
100
  {
@@ -106,6 +107,7 @@ function JSPopMenu()
106
107
  {
107
108
  var spanDom=document.createElement("span");
108
109
  spanDom.className=this.CheckedClassName;
110
+ spanDom.style["font-size"]="10px";
109
111
  tdDom.appendChild(spanDom);
110
112
  }
111
113
  }
@@ -123,6 +125,7 @@ function JSPopMenu()
123
125
  {
124
126
  var spanDom=document.createElement("span");
125
127
  spanDom.className=this.RightArrowClassName;
128
+ spanDom.style["font-size"]="10px";
126
129
  tdDom.appendChild(spanDom);
127
130
  }
128
131
  }
@@ -150,7 +153,21 @@ function JSPopMenu()
150
153
  var subItem=item.SubMenu[i];
151
154
  if (subItem.Name==JSPopMenu.SEPARATOR_LINE_NAME)
152
155
  {
153
- if (preTrDom) preTrDom.classList.add("border");
156
+ var trSeparator=document.createElement("tr");
157
+ trSeparator.className='UMyChart_MenuItem_Tr_Separator';
158
+ var tdDom=document.createElement("td");
159
+ tdDom.className="UMyChart_MenuItem_Td_Status_Separator";
160
+ trSeparator.appendChild(tdDom);
161
+ var tdDom=document.createElement("td");
162
+ tdDom.className="UMyChart_MenuItem_Td_Separator";
163
+ trSeparator.appendChild(tdDom);
164
+ var tdDom=document.createElement("td");
165
+ tdDom.className="UMyChart_MenuItem_Td_Separator";
166
+ trSeparator.appendChild(tdDom);
167
+ var tdDom=document.createElement("td");
168
+ tdDom.className="UMyChart_MenuItem_Td_Separator";
169
+ trSeparator.appendChild(tdDom);
170
+ subTbody.appendChild(trSeparator);
154
171
  continue;
155
172
  }
156
173
 
@@ -192,11 +209,40 @@ function JSPopMenu()
192
209
  if (!this.RootDOM) return;
193
210
  if (!IFrameSplitOperator.IsNumber(x) || !IFrameSplitOperator.IsNumber(y)) return;
194
211
 
212
+ //菜单在当前屏幕无法显示需要调整
213
+ var menuHeight=this.RootDOM.offsetHeight;
214
+ var yMenuBottom=y+menuHeight;
215
+ var yBottom=window.innerHeight-15;
216
+ if (yMenuBottom>yBottom) y=yBottom-menuHeight;
217
+
218
+ var menuWidth=this.RootDOM.offsetWidth;
219
+ var yMenuRight=x+menuWidth;
220
+ var yRight=window.innerWidth-15;
221
+ if (yMenuRight>yRight) x=yRight-menuWidth;
222
+
195
223
  this.RootDOM.style.visibility='visible';
196
224
  this.RootDOM.style.top = y + "px";
197
225
  this.RootDOM.style.left = x + "px";
198
226
  }
199
227
 
228
+ //下拉菜单
229
+ this.PopupMenuByDrapdown=function(rtButton)
230
+ {
231
+ if (!this.RootDOM) return;
232
+ if (!rtButton) return;
233
+
234
+ var xLeft=rtButton.Left;
235
+ var yTop=rtButton.Bottom;
236
+ var menuHeight=this.RootDOM.offsetHeight;
237
+ var yMenuBottom=yTop+menuHeight;
238
+ var yBottom=window.innerHeight-15;
239
+ if (yMenuBottom>yBottom) yTop=rtButton.Top-menuHeight;
240
+
241
+ this.RootDOM.style.visibility='visible';
242
+ this.RootDOM.style.top = yTop + "px";
243
+ this.RootDOM.style.left = xLeft + "px";
244
+ }
245
+
200
246
  this.OnClickMenu=function(e, item, bSubMenu)
201
247
  {
202
248
  console.log("[JSPopMenu::OnClickMenu] e=, item=, bSubMenu", e, item, bSubMenu);
@@ -210,6 +256,8 @@ function JSPopMenu()
210
256
  if (parentItem && parentItem.PopMenu && parentItem.PopMenu!=subMenu)
211
257
  {
212
258
  parentItem.PopMenu.style.visibility="hidden";
259
+ if (parentItem.PopRow) parentItem.PopRow.classList.remove(this.SelectedClassName);
260
+
213
261
  parentItem.PopMenu=null;
214
262
  parentItem.PopRow=null;
215
263
  }
@@ -223,8 +271,23 @@ function JSPopMenu()
223
271
  else
224
272
  {
225
273
  var rtParent=trDom.getBoundingClientRect();
226
- subMenu.style.left=`${rtParent.right}px`;
227
- subMenu.style.top=`${rtParent.top}px`;
274
+ var x=rtParent.right, y=rtParent.top;
275
+
276
+ //菜单在当前屏幕无法显示需要调整
277
+ var yBottom=window.innerHeight-15;
278
+ var yRight=window.innerWidth-15;
279
+ var menuHeight=subMenu.offsetHeight;
280
+ var menuWidth=subMenu.offsetWidth;
281
+ var yMenuBottom=y+menuHeight;
282
+ var yMenuRight=x+menuWidth;
283
+
284
+ if (yMenuBottom>yBottom) y=yBottom-menuHeight;
285
+ if (yMenuRight>yRight) x=rtParent.left-menuWidth;
286
+
287
+ subMenu.style.left=`${x}px`;
288
+ subMenu.style.top=`${y}px`;
289
+
290
+ trDom.classList.add(this.SelectedClassName);
228
291
 
229
292
  /*
230
293
  if (this.Data.Position==JSPopMenu.POSITION_ID.TAB_MENU_ID)
@@ -1194,3 +1194,138 @@ input[type="color"] {
1194
1194
  .subtool-del{
1195
1195
  position: relative;
1196
1196
  }
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+ /*
1203
+ Copyright (c) 2018 jones
1204
+
1205
+ http://www.apache.org/licenses/LICENSE-2.0
1206
+
1207
+ 开源项目 https://github.com/jones2000/HQChart
1208
+
1209
+ jones_2000@163.com
1210
+
1211
+ 右键菜单
1212
+ */
1213
+ .UMyChart_PopMenu {
1214
+ position: absolute;
1215
+ z-index: 500;
1216
+ border: 1px solid;
1217
+ border-color:rgb(116, 112, 112);
1218
+ background-color: #fff;
1219
+ visibility:hidden;
1220
+ font-size: 12px;
1221
+ font-family: "微软雅黑";
1222
+ cursor: default;
1223
+ padding: 2px;
1224
+
1225
+ }
1226
+
1227
+ .UMyChart_PopMenu_Table
1228
+ {
1229
+ border-collapse: collapse;
1230
+ border-spacing: 2px;
1231
+ }
1232
+
1233
+ .UMyChart_PopMenu_Tbody
1234
+ {
1235
+
1236
+ }
1237
+
1238
+ .UMyChart_MenuItem_Tr
1239
+ {
1240
+ display: table-row;
1241
+ height:20px;
1242
+ }
1243
+
1244
+ .UMyChart_MenuItem_Tr_Separator
1245
+ {
1246
+ height:5px;
1247
+ }
1248
+
1249
+ .UMyChart_MenuItem_Td_Separator
1250
+ {
1251
+ border-top:1px solid;
1252
+ border-color:rgb(116, 112, 112);
1253
+ }
1254
+
1255
+ .UMyChart_MenuItem_Td_Status_Separator
1256
+ {
1257
+ height:5px;
1258
+ background: rgb(204,204,204);
1259
+ }
1260
+
1261
+ .UMyChart_MenuItem_Tr_Selected
1262
+ {
1263
+ background: rgb(172,172,221);
1264
+ border:0px solid;
1265
+ }
1266
+
1267
+ .UMyChart_MenuItem_Td_Status
1268
+ {
1269
+ width: 23px;
1270
+ background: rgb(204,204,204);
1271
+ }
1272
+
1273
+ .UMyChart_MenuItem_Td_Shortcut {
1274
+ width: 60px;
1275
+ text-align:right;
1276
+ }
1277
+
1278
+ .UMyChart_MenuItem_Td_Content
1279
+ {
1280
+ padding-left: 5px;
1281
+ text-align:left;
1282
+ }
1283
+
1284
+ .UMyChart_MenuItem_Td_Arrow
1285
+ {
1286
+ width: 25px;
1287
+ text-align:right;
1288
+ margin-right: 10px;
1289
+ }
1290
+
1291
+
1292
+ .UMyChart_MenuItem_Tr:hover
1293
+ {
1294
+ background: rgb(172,172,221);
1295
+ }
1296
+
1297
+ .UMyChart_PopSubMenu{
1298
+ position: absolute;
1299
+ left: 99px;
1300
+ top: 0;
1301
+ border: 1px solid;
1302
+ border-color:rgb(116, 112, 112);
1303
+ background-color: #fff;
1304
+ visibility:hidden;
1305
+ z-index: 501;
1306
+ font-size: 12px;
1307
+ font-family: "微软雅黑";
1308
+ cursor: default;
1309
+ padding: 2px;
1310
+ }
1311
+
1312
+ .UMyChart_MenuItem_Span_Checked
1313
+ {
1314
+ color:rgb(0,0,0);
1315
+ font-size: 10px;
1316
+ margin-left: 5px;
1317
+ text-align:left;
1318
+ }
1319
+
1320
+ .UMyChart_MenuItem_Span_Arrow
1321
+ {
1322
+ color:rgb(0,0,0);
1323
+ font-size: 10px;
1324
+ text-align:right;
1325
+ }
1326
+
1327
+
1328
+
1329
+
1330
+
1331
+
@@ -1,6 +1,14 @@
1
+ /*
2
+ Copyright (c) 2018 jones
3
+
4
+ http://www.apache.org/licenses/LICENSE-2.0
1
5
 
6
+ 开源项目 https://github.com/jones2000/HQChart
7
+
8
+ jones_2000@163.com
2
9
 
3
- /*右键菜单*/
10
+ 右键菜单
11
+ */
4
12
  .UMyChart_PopMenu {
5
13
  position: absolute;
6
14
  z-index: 500;
@@ -11,6 +19,8 @@
11
19
  font-size: 12px;
12
20
  font-family: "微软雅黑";
13
21
  cursor: default;
22
+ padding: 2px;
23
+
14
24
  }
15
25
 
16
26
  .UMyChart_PopMenu_Table
@@ -19,7 +29,8 @@
19
29
  border-spacing: 2px;
20
30
  }
21
31
 
22
- .UMyChart_PopMenu_Tbody {
32
+ .UMyChart_PopMenu_Tbody
33
+ {
23
34
 
24
35
  }
25
36
 
@@ -29,9 +40,33 @@
29
40
  height:20px;
30
41
  }
31
42
 
32
- .UMyChart_MenuItem_Td_Status {
33
- width: 25px;
34
-
43
+ .UMyChart_MenuItem_Tr_Separator
44
+ {
45
+ height:5px;
46
+ }
47
+
48
+ .UMyChart_MenuItem_Td_Separator
49
+ {
50
+ border-top:1px solid;
51
+ border-color:rgb(116, 112, 112);
52
+ }
53
+
54
+ .UMyChart_MenuItem_Td_Status_Separator
55
+ {
56
+ height:5px;
57
+ background: rgb(204,204,204);
58
+ }
59
+
60
+ .UMyChart_MenuItem_Tr_Selected
61
+ {
62
+ background: rgb(172,172,221);
63
+ border:0px solid;
64
+ }
65
+
66
+ .UMyChart_MenuItem_Td_Status
67
+ {
68
+ width: 23px;
69
+ background: rgb(204,204,204);
35
70
  }
36
71
 
37
72
  .UMyChart_MenuItem_Td_Shortcut {
@@ -41,7 +76,7 @@
41
76
 
42
77
  .UMyChart_MenuItem_Td_Content
43
78
  {
44
- margin-left: 3px;
79
+ padding-left: 5px;
45
80
  text-align:left;
46
81
  }
47
82
 
@@ -56,8 +91,6 @@
56
91
  .UMyChart_MenuItem_Tr:hover
57
92
  {
58
93
  background: rgb(172,172,221);
59
- border:1px solid;
60
- border-color:rgb(0, 120, 215);
61
94
  }
62
95
 
63
96
  .UMyChart_PopSubMenu{
@@ -72,11 +105,12 @@
72
105
  font-size: 12px;
73
106
  font-family: "微软雅黑";
74
107
  cursor: default;
108
+ padding: 2px;
75
109
  }
76
110
 
77
111
  .UMyChart_MenuItem_Span_Checked
78
112
  {
79
- color:rgb(105,105,105);
113
+ color:rgb(0,0,0);
80
114
  font-size: 10px;
81
115
  margin-left: 5px;
82
116
  text-align:left;
@@ -84,9 +118,12 @@
84
118
 
85
119
  .UMyChart_MenuItem_Span_Arrow
86
120
  {
87
- color:rgb(105,105,105);
121
+ color:rgb(0,0,0);
88
122
  font-size: 10px;
89
123
  text-align:right;
90
124
  }
91
125
 
92
126
 
127
+
128
+
129
+