@kuzntsv/uikit 0.21.14 → 0.21.15
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.
|
@@ -1233,7 +1233,7 @@ class BasePageClass {
|
|
|
1233
1233
|
entityFactory(type) {
|
|
1234
1234
|
return new type();
|
|
1235
1235
|
}
|
|
1236
|
-
/**
|
|
1236
|
+
/** Событие изменение выбранных записей. */
|
|
1237
1237
|
onSelectionChange(selected) {
|
|
1238
1238
|
this.selected = selected;
|
|
1239
1239
|
this.editBtnDisabledUpdate(this.selected);
|
|
@@ -1247,11 +1247,11 @@ class BasePageClass {
|
|
|
1247
1247
|
removeBtnDisabledUpdate(selected) {
|
|
1248
1248
|
this.removeBtnDisabled = !(selected && selected.length > 0);
|
|
1249
1249
|
}
|
|
1250
|
-
/**
|
|
1250
|
+
/** Событие двойной клик. */
|
|
1251
1251
|
onRowDoubleClicked() {
|
|
1252
1252
|
this.editEvent();
|
|
1253
1253
|
}
|
|
1254
|
-
/**
|
|
1254
|
+
/** Событие создание. */
|
|
1255
1255
|
newEvent() {
|
|
1256
1256
|
if (this.entityEditComponent) {
|
|
1257
1257
|
const data = { action: Action.Add, entity: new this.entityType(null) };
|
|
@@ -1305,7 +1305,7 @@ class BasePageClass {
|
|
|
1305
1305
|
this.alertService.warning('Действие не доступно.');
|
|
1306
1306
|
}
|
|
1307
1307
|
}
|
|
1308
|
-
/**
|
|
1308
|
+
/** Событие редактирование. */
|
|
1309
1309
|
editEvent() {
|
|
1310
1310
|
if (this.selected && this.selected.length === 1) {
|
|
1311
1311
|
if (this.entityEditComponent) {
|
|
@@ -1361,7 +1361,7 @@ class BasePageClass {
|
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
1363
|
}
|
|
1364
|
-
/**
|
|
1364
|
+
/** Событие удаление. */
|
|
1365
1365
|
removeEvent() {
|
|
1366
1366
|
// если выбрана запись(и)
|
|
1367
1367
|
if (this.selected && this.selected.length > 0) {
|
|
@@ -1403,7 +1403,7 @@ class BasePageClass {
|
|
|
1403
1403
|
this.loadData$.next(null);
|
|
1404
1404
|
this.loadLength$.next(null);
|
|
1405
1405
|
}
|
|
1406
|
-
/**
|
|
1406
|
+
/** Событие очистки фильтра. */
|
|
1407
1407
|
clearEvent() {
|
|
1408
1408
|
this.clearFilter$.next(null);
|
|
1409
1409
|
this.clearFilter = {};
|
|
@@ -1443,7 +1443,7 @@ class BasePageClass {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
});
|
|
1445
1445
|
}
|
|
1446
|
-
// contextMenu:
|
|
1446
|
+
// contextMenu: При щелчке ПКМ открыть в новой вкладке.
|
|
1447
1447
|
onMiddleButton(baseUrl, queryParamName, queryParamValue) {
|
|
1448
1448
|
return ($event, item, contextMenu) => {
|
|
1449
1449
|
// Нажата средняя кнопка (в новой вкладке).
|
|
@@ -1460,6 +1460,22 @@ class BasePageClass {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
};
|
|
1462
1462
|
}
|
|
1463
|
+
// Action в таблице: При щелчке ПКМ открыть в новой вкладке.
|
|
1464
|
+
onActionMiddleButton(baseUrl, queryParamName, queryParamValue) {
|
|
1465
|
+
return ($event, item) => {
|
|
1466
|
+
// Нажата средняя кнопка (в новой вкладке).
|
|
1467
|
+
// 1 - Auxiliary button pressed (usually the middle button)
|
|
1468
|
+
if ($event.button === 1) {
|
|
1469
|
+
//$event.preventDefault();
|
|
1470
|
+
// Converts the route into a string that can be used
|
|
1471
|
+
// with the window.open() function
|
|
1472
|
+
const url = this.router.serializeUrl(queryParamName && queryParamValue ?
|
|
1473
|
+
this.router.createUrlTree([baseUrl], { queryParams: { [queryParamName]: item[queryParamValue] } })
|
|
1474
|
+
: this.router.createUrlTree([baseUrl]));
|
|
1475
|
+
window.open(url, '_blank');
|
|
1476
|
+
}
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1463
1479
|
dateToString(date) {
|
|
1464
1480
|
return date ? (new Date(date)).toLocaleString('ru-RU', { timeZone: 'Europe/Samara' }) : null; // MSK+01
|
|
1465
1481
|
}
|