@easyquery/ui 7.3.5-rc03 → 7.3.5-rc04
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.
package/dist/easyquery.ui.cjs.js
CHANGED
|
@@ -1378,13 +1378,14 @@ class MenuLevel {
|
|
|
1378
1378
|
});
|
|
1379
1379
|
}
|
|
1380
1380
|
const pos = ui.getElementAbsolutePos(menuItem.itemDiv);
|
|
1381
|
+
menuItem.itemDiv.getBoundingClientRect();
|
|
1381
1382
|
const scroll = ui.getScrollPos();
|
|
1382
1383
|
const winSize = ui.getWinSize();
|
|
1383
1384
|
//show menu to the side that have more space available
|
|
1384
1385
|
const leftSpace = pos.x - scroll.left;
|
|
1385
1386
|
const rightSpace = winSize.width - leftSpace - menuItem.itemDiv.offsetWidth;
|
|
1386
1387
|
pos.x += menuItem.itemDiv.offsetParent.offsetWidth;
|
|
1387
|
-
pos.y
|
|
1388
|
+
pos.y -= 5;
|
|
1388
1389
|
menuItem.subLevel.showAt(pos.x, pos.y, true, true);
|
|
1389
1390
|
menuItem.subLevel.levelDiv.style.width = '';
|
|
1390
1391
|
menuItem.subLevel.levelDiv.style.right = '';
|
|
@@ -1442,7 +1443,33 @@ class MenuLevel {
|
|
|
1442
1443
|
const anchorRect = anchor ? anchor.getBoundingClientRect() : null;
|
|
1443
1444
|
const anchorHeight = anchorRect ? anchorRect.height : 0;
|
|
1444
1445
|
const magic = 24;
|
|
1445
|
-
if (this.levelIndex > 0
|
|
1446
|
+
if (this.levelIndex > 0) {
|
|
1447
|
+
let maxHeight = viewportHeight - 30;
|
|
1448
|
+
if (this.searchDiv) {
|
|
1449
|
+
maxHeight -= this.searchDiv.scrollHeight;
|
|
1450
|
+
y -= this.searchDiv.scrollHeight;
|
|
1451
|
+
}
|
|
1452
|
+
if (this.closeDiv) {
|
|
1453
|
+
maxHeight -= this.closeDiv.offsetHeight;
|
|
1454
|
+
y -= this.closeDiv.offsetHeight;
|
|
1455
|
+
}
|
|
1456
|
+
this.scrollDiv.style.maxHeight = maxHeight + 'px';
|
|
1457
|
+
levelStyle.top = this.adjustTopPos(y) + 'px';
|
|
1458
|
+
/*
|
|
1459
|
+
|
|
1460
|
+
const levelDivRect = this.levelDiv.getBoundingClientRect();
|
|
1461
|
+
const levelDivHeight = levelDivRect.height;
|
|
1462
|
+
|
|
1463
|
+
if (levelDivHeight > winSize.height - y - 20) {
|
|
1464
|
+
y = winSize.height - levelDivHeight - 20;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
if (y < scrollY + 10) {
|
|
1468
|
+
y = scrollY + 10;
|
|
1469
|
+
}
|
|
1470
|
+
*/
|
|
1471
|
+
}
|
|
1472
|
+
else if (useMaxSpace) {
|
|
1446
1473
|
let maxHeight = viewportHeight - 30;
|
|
1447
1474
|
if (this.searchDiv) {
|
|
1448
1475
|
maxHeight -= this.searchDiv.scrollHeight;
|
|
@@ -1486,11 +1513,11 @@ class MenuLevel {
|
|
|
1486
1513
|
// Падаємо вверх
|
|
1487
1514
|
this.scrollDiv.style.maxHeight = maxHeight + 'px';
|
|
1488
1515
|
levelDivRect = this.levelDiv.getBoundingClientRect();
|
|
1489
|
-
levelStyle.top = y - levelDivRect.height + 'px';
|
|
1516
|
+
levelStyle.top = y - levelDivRect.height + 'px'; // - anchorHeight
|
|
1490
1517
|
}
|
|
1491
1518
|
else {
|
|
1492
1519
|
// Падаємо вниз
|
|
1493
|
-
this.scrollDiv.style.maxHeight = maxHeight - magic + 'px';
|
|
1520
|
+
this.scrollDiv.style.maxHeight = maxHeight - magic - anchorHeight + 'px';
|
|
1494
1521
|
levelStyle.top = y + anchorHeight + 'px';
|
|
1495
1522
|
}
|
|
1496
1523
|
}
|
|
@@ -2481,7 +2508,7 @@ class ColumnRendererCP {
|
|
|
2481
2508
|
items.push(item);
|
|
2482
2509
|
}
|
|
2483
2510
|
}
|
|
2484
|
-
if (!funcAllowed) {
|
|
2511
|
+
if (!funcAllowed && items.length > 0) {
|
|
2485
2512
|
this.column.expr.func = items[0].id;
|
|
2486
2513
|
}
|
|
2487
2514
|
//Add "Custom Expression" menu
|
|
@@ -2885,7 +2912,7 @@ class AttrColumnRendererCP extends ColumnRendererCP {
|
|
|
2885
2912
|
if (!funcs[idx])
|
|
2886
2913
|
continue;
|
|
2887
2914
|
}
|
|
2888
|
-
if (!funcAllowed) {
|
|
2915
|
+
if (!funcAllowed && items.length > 0) {
|
|
2889
2916
|
this.column.expr.func = items[0].id;
|
|
2890
2917
|
}
|
|
2891
2918
|
//Add "Custom Expression" menu
|
|
@@ -4434,7 +4461,7 @@ class ColumnRendererCB {
|
|
|
4434
4461
|
items.push(item);
|
|
4435
4462
|
}
|
|
4436
4463
|
}
|
|
4437
|
-
if (!funcAllowed) {
|
|
4464
|
+
if (!funcAllowed && items.length > 0) {
|
|
4438
4465
|
this.column.expr.func = items[0].id;
|
|
4439
4466
|
}
|
|
4440
4467
|
//Add "Custom Expression" menu
|
package/dist/easyquery.ui.esm.js
CHANGED
|
@@ -1376,13 +1376,14 @@ class MenuLevel {
|
|
|
1376
1376
|
});
|
|
1377
1377
|
}
|
|
1378
1378
|
const pos = getElementAbsolutePos(menuItem.itemDiv);
|
|
1379
|
+
menuItem.itemDiv.getBoundingClientRect();
|
|
1379
1380
|
const scroll = getScrollPos();
|
|
1380
1381
|
const winSize = getWinSize();
|
|
1381
1382
|
//show menu to the side that have more space available
|
|
1382
1383
|
const leftSpace = pos.x - scroll.left;
|
|
1383
1384
|
const rightSpace = winSize.width - leftSpace - menuItem.itemDiv.offsetWidth;
|
|
1384
1385
|
pos.x += menuItem.itemDiv.offsetParent.offsetWidth;
|
|
1385
|
-
pos.y
|
|
1386
|
+
pos.y -= 5;
|
|
1386
1387
|
menuItem.subLevel.showAt(pos.x, pos.y, true, true);
|
|
1387
1388
|
menuItem.subLevel.levelDiv.style.width = '';
|
|
1388
1389
|
menuItem.subLevel.levelDiv.style.right = '';
|
|
@@ -1440,7 +1441,33 @@ class MenuLevel {
|
|
|
1440
1441
|
const anchorRect = anchor ? anchor.getBoundingClientRect() : null;
|
|
1441
1442
|
const anchorHeight = anchorRect ? anchorRect.height : 0;
|
|
1442
1443
|
const magic = 24;
|
|
1443
|
-
if (this.levelIndex > 0
|
|
1444
|
+
if (this.levelIndex > 0) {
|
|
1445
|
+
let maxHeight = viewportHeight - 30;
|
|
1446
|
+
if (this.searchDiv) {
|
|
1447
|
+
maxHeight -= this.searchDiv.scrollHeight;
|
|
1448
|
+
y -= this.searchDiv.scrollHeight;
|
|
1449
|
+
}
|
|
1450
|
+
if (this.closeDiv) {
|
|
1451
|
+
maxHeight -= this.closeDiv.offsetHeight;
|
|
1452
|
+
y -= this.closeDiv.offsetHeight;
|
|
1453
|
+
}
|
|
1454
|
+
this.scrollDiv.style.maxHeight = maxHeight + 'px';
|
|
1455
|
+
levelStyle.top = this.adjustTopPos(y) + 'px';
|
|
1456
|
+
/*
|
|
1457
|
+
|
|
1458
|
+
const levelDivRect = this.levelDiv.getBoundingClientRect();
|
|
1459
|
+
const levelDivHeight = levelDivRect.height;
|
|
1460
|
+
|
|
1461
|
+
if (levelDivHeight > winSize.height - y - 20) {
|
|
1462
|
+
y = winSize.height - levelDivHeight - 20;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
if (y < scrollY + 10) {
|
|
1466
|
+
y = scrollY + 10;
|
|
1467
|
+
}
|
|
1468
|
+
*/
|
|
1469
|
+
}
|
|
1470
|
+
else if (useMaxSpace) {
|
|
1444
1471
|
let maxHeight = viewportHeight - 30;
|
|
1445
1472
|
if (this.searchDiv) {
|
|
1446
1473
|
maxHeight -= this.searchDiv.scrollHeight;
|
|
@@ -1484,11 +1511,11 @@ class MenuLevel {
|
|
|
1484
1511
|
// Падаємо вверх
|
|
1485
1512
|
this.scrollDiv.style.maxHeight = maxHeight + 'px';
|
|
1486
1513
|
levelDivRect = this.levelDiv.getBoundingClientRect();
|
|
1487
|
-
levelStyle.top = y - levelDivRect.height + 'px';
|
|
1514
|
+
levelStyle.top = y - levelDivRect.height + 'px'; // - anchorHeight
|
|
1488
1515
|
}
|
|
1489
1516
|
else {
|
|
1490
1517
|
// Падаємо вниз
|
|
1491
|
-
this.scrollDiv.style.maxHeight = maxHeight - magic + 'px';
|
|
1518
|
+
this.scrollDiv.style.maxHeight = maxHeight - magic - anchorHeight + 'px';
|
|
1492
1519
|
levelStyle.top = y + anchorHeight + 'px';
|
|
1493
1520
|
}
|
|
1494
1521
|
}
|
|
@@ -2479,7 +2506,7 @@ class ColumnRendererCP {
|
|
|
2479
2506
|
items.push(item);
|
|
2480
2507
|
}
|
|
2481
2508
|
}
|
|
2482
|
-
if (!funcAllowed) {
|
|
2509
|
+
if (!funcAllowed && items.length > 0) {
|
|
2483
2510
|
this.column.expr.func = items[0].id;
|
|
2484
2511
|
}
|
|
2485
2512
|
//Add "Custom Expression" menu
|
|
@@ -2883,7 +2910,7 @@ class AttrColumnRendererCP extends ColumnRendererCP {
|
|
|
2883
2910
|
if (!funcs[idx])
|
|
2884
2911
|
continue;
|
|
2885
2912
|
}
|
|
2886
|
-
if (!funcAllowed) {
|
|
2913
|
+
if (!funcAllowed && items.length > 0) {
|
|
2887
2914
|
this.column.expr.func = items[0].id;
|
|
2888
2915
|
}
|
|
2889
2916
|
//Add "Custom Expression" menu
|
|
@@ -4432,7 +4459,7 @@ class ColumnRendererCB {
|
|
|
4432
4459
|
items.push(item);
|
|
4433
4460
|
}
|
|
4434
4461
|
}
|
|
4435
|
-
if (!funcAllowed) {
|
|
4462
|
+
if (!funcAllowed && items.length > 0) {
|
|
4436
4463
|
this.column.expr.func = items[0].id;
|
|
4437
4464
|
}
|
|
4438
4465
|
//Add "Custom Expression" menu
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easyquery/ui",
|
|
3
|
-
"version": "7.3.5-
|
|
3
|
+
"version": "7.3.5-rc04",
|
|
4
4
|
"description": "EasyQuery.JS Community UI widgets",
|
|
5
5
|
"types": "./dist/types/public_api.d.ts",
|
|
6
6
|
"main": "./dist/easyquery.ui.cjs.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"bugs": "https://korzh.com/support",
|
|
31
31
|
"license": "LGPL-3.0",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@easyquery/core": "^7.3.5-
|
|
33
|
+
"@easyquery/core": "^7.3.5-rc04"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|