zek 19.0.22 → 19.0.24
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/fesm2022/zek.mjs
CHANGED
|
@@ -1281,8 +1281,14 @@ class JwtHelper {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
|
|
1283
1283
|
class MathHelper {
|
|
1284
|
+
// static round(value: number, decimals: number = 0): number {
|
|
1285
|
+
// return Math.round(Number(value) * Math.pow(10, decimals)) / (Math.pow(10, decimals));
|
|
1286
|
+
// }
|
|
1284
1287
|
static round(value, decimals = 0) {
|
|
1285
|
-
|
|
1288
|
+
if (!Number.isFinite(value))
|
|
1289
|
+
return NaN;
|
|
1290
|
+
const factor = 10 ** decimals;
|
|
1291
|
+
return Math.round((value + Number.EPSILON) * factor) / factor;
|
|
1286
1292
|
}
|
|
1287
1293
|
static clamp(v, min, max) {
|
|
1288
1294
|
return Math.max(min, Math.min(max, v));
|
|
@@ -1297,6 +1303,22 @@ class MathHelper {
|
|
|
1297
1303
|
}
|
|
1298
1304
|
return sum;
|
|
1299
1305
|
}
|
|
1306
|
+
static format(num, digits = 2) {
|
|
1307
|
+
if (num === null || num === undefined || isNaN(num))
|
|
1308
|
+
return '0';
|
|
1309
|
+
// If less than 1000, display normally
|
|
1310
|
+
if (Math.abs(num) < 1000) {
|
|
1311
|
+
return num.toString();
|
|
1312
|
+
}
|
|
1313
|
+
const suffixes = ['k', 'M', 'G', 'T', 'P', 'E'];
|
|
1314
|
+
// Calculate the index of the suffix
|
|
1315
|
+
// e.g. 1,000 -> index 0 ('k'), 1,000,000 -> index 1 ('M')
|
|
1316
|
+
const exp = Math.floor(Math.log(Math.abs(num)) / Math.log(1000));
|
|
1317
|
+
const value = num / Math.pow(1000, exp);
|
|
1318
|
+
const rounded = this.round(value, digits);
|
|
1319
|
+
// Return with suffix (subtract 1 because index 0 is 'k', not '1')
|
|
1320
|
+
return rounded + suffixes[exp - 1];
|
|
1321
|
+
}
|
|
1300
1322
|
}
|
|
1301
1323
|
|
|
1302
1324
|
class PagerHelper {
|
|
@@ -6973,6 +6995,11 @@ class ZekSelect2 extends CoreComponent {
|
|
|
6973
6995
|
// }
|
|
6974
6996
|
}
|
|
6975
6997
|
inputUnfocused() {
|
|
6998
|
+
if (this._selectedItem !== undefined && this._selectedItem !== null) {
|
|
6999
|
+
this.setText();
|
|
7000
|
+
}
|
|
7001
|
+
this.filter = null;
|
|
7002
|
+
this.filterData();
|
|
6976
7003
|
// this.expanded = false;
|
|
6977
7004
|
}
|
|
6978
7005
|
setText() {
|
|
@@ -6993,7 +7020,10 @@ class ZekSelect2 extends CoreComponent {
|
|
|
6993
7020
|
this.setText();
|
|
6994
7021
|
//set value
|
|
6995
7022
|
let v;
|
|
6996
|
-
if (
|
|
7023
|
+
if (item === undefined || item === null) {
|
|
7024
|
+
v = null;
|
|
7025
|
+
}
|
|
7026
|
+
else if (this.valueField === undefined || this.valueField === null || this.valueField === '') {
|
|
6997
7027
|
// this.value = v
|
|
6998
7028
|
v = item;
|
|
6999
7029
|
}
|
|
@@ -7008,12 +7038,15 @@ class ZekSelect2 extends CoreComponent {
|
|
|
7008
7038
|
}
|
|
7009
7039
|
}
|
|
7010
7040
|
}
|
|
7041
|
+
clear() {
|
|
7042
|
+
this.selectItem(null);
|
|
7043
|
+
}
|
|
7011
7044
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ZekSelect2, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
7012
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: ZekSelect2, isStandalone: true, selector: "zek-select2,[zek-select2]", inputs: { disabled: "disabled", data: "data", textField: "textField", valueField: "valueField", placeholder: "placeholder", value: "value" }, outputs: { selectedItemChange: "selectedItemChange", valueChange: "valueChange" }, usesInheritance: true, ngImport: i0, template: "<div class=\"input-group position-relative\" id=\"dropdown-menu-container-{{uniqueId}}\">\r\n <input type=\"text\" class=\"form-control\" placeholder=\"{{placeholder}}\" data-bs-toggle=\"dropdown\"\r\n id=\"input-{{uniqueId}}\"
|
|
7045
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: ZekSelect2, isStandalone: true, selector: "zek-select2,[zek-select2]", inputs: { disabled: "disabled", data: "data", textField: "textField", valueField: "valueField", placeholder: "placeholder", value: "value" }, outputs: { selectedItemChange: "selectedItemChange", valueChange: "valueChange" }, usesInheritance: true, ngImport: i0, template: "<div class=\"input-group position-relative\" id=\"dropdown-menu-container-{{uniqueId}}\">\r\n <input type=\"text\" class=\"form-control\" placeholder=\"{{placeholder}}\" data-bs-toggle=\"dropdown\"\r\n id=\"input-{{uniqueId}}\" [disabled]=\"disabled\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange($event)\"\r\n (focus)=\"onFocus($event)\" (blur)=\"inputUnfocused()\">\r\n <button [disabled]=\"disabled\" class=\"btn btn-outline-secondary dropdown-toggle\" id=\"btn-{{uniqueId}}\" type=\"button\"\r\n data-bs-toggle=\"dropdown\" aria-expanded=\"false\" data-bs-reference=\"parent\"></button>\r\n <ul class=\"dropdown-menu dropdown-menu-start w-100 scrollable-menu\" id=\"dropdown-menu-{{uniqueId}}\">\r\n <ng-container *ngIf=\"textField\">\r\n <li *ngFor=\"let entry of filteredData\">\r\n <a href=\"javascript:void(0)\" (click)=\"selectItem(entry)\" class=\"dropdown-item\" [class.active]=\"entry === selectedItem\">\r\n {{entry[textField]}}\r\n </a>\r\n </li>\r\n </ng-container>\r\n <ng-container *ngIf=\"!textField\">\r\n <li *ngFor=\"let entry of filteredData\" >\r\n <a href=\"javascript:void(0)\" (click)=\"selectItem(entry)\" class=\"dropdown-item\" [class.active]=\"entry === selectedItem\">\r\n {{entry}}\r\n </a>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n</div>\r\n<!-- <kendo-autocomplete\r\n [data]=\"data\"\r\n [filterable]=\"true\"\r\n (valueChange)=\"valueChange($event)\"\r\n (filterChange)=\"filterChange($event)\"\r\n (open)=\"open()\"\r\n (close)=\"close()\"\r\n (focus)=\"focus()\"\r\n (blur)=\"blur()\">\r\n</kendo-autocomplete> -->", styles: [".scrollable-menu{max-height:400px;overflow-y:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
7013
7046
|
}
|
|
7014
7047
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ZekSelect2, decorators: [{
|
|
7015
7048
|
type: Component,
|
|
7016
|
-
args: [{ standalone: true, selector: 'zek-select2,[zek-select2]', imports: [CommonModule, FormsModule], template: "<div class=\"input-group position-relative\" id=\"dropdown-menu-container-{{uniqueId}}\">\r\n <input type=\"text\" class=\"form-control\" placeholder=\"{{placeholder}}\" data-bs-toggle=\"dropdown\"\r\n id=\"input-{{uniqueId}}\"
|
|
7049
|
+
args: [{ standalone: true, selector: 'zek-select2,[zek-select2]', imports: [CommonModule, FormsModule], template: "<div class=\"input-group position-relative\" id=\"dropdown-menu-container-{{uniqueId}}\">\r\n <input type=\"text\" class=\"form-control\" placeholder=\"{{placeholder}}\" data-bs-toggle=\"dropdown\"\r\n id=\"input-{{uniqueId}}\" [disabled]=\"disabled\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange($event)\"\r\n (focus)=\"onFocus($event)\" (blur)=\"inputUnfocused()\">\r\n <button [disabled]=\"disabled\" class=\"btn btn-outline-secondary dropdown-toggle\" id=\"btn-{{uniqueId}}\" type=\"button\"\r\n data-bs-toggle=\"dropdown\" aria-expanded=\"false\" data-bs-reference=\"parent\"></button>\r\n <ul class=\"dropdown-menu dropdown-menu-start w-100 scrollable-menu\" id=\"dropdown-menu-{{uniqueId}}\">\r\n <ng-container *ngIf=\"textField\">\r\n <li *ngFor=\"let entry of filteredData\">\r\n <a href=\"javascript:void(0)\" (click)=\"selectItem(entry)\" class=\"dropdown-item\" [class.active]=\"entry === selectedItem\">\r\n {{entry[textField]}}\r\n </a>\r\n </li>\r\n </ng-container>\r\n <ng-container *ngIf=\"!textField\">\r\n <li *ngFor=\"let entry of filteredData\" >\r\n <a href=\"javascript:void(0)\" (click)=\"selectItem(entry)\" class=\"dropdown-item\" [class.active]=\"entry === selectedItem\">\r\n {{entry}}\r\n </a>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n</div>\r\n<!-- <kendo-autocomplete\r\n [data]=\"data\"\r\n [filterable]=\"true\"\r\n (valueChange)=\"valueChange($event)\"\r\n (filterChange)=\"filterChange($event)\"\r\n (open)=\"open()\"\r\n (close)=\"close()\"\r\n (focus)=\"focus()\"\r\n (blur)=\"blur()\">\r\n</kendo-autocomplete> -->", styles: [".scrollable-menu{max-height:400px;overflow-y:auto}\n"] }]
|
|
7017
7050
|
}], propDecorators: { disabled: [{
|
|
7018
7051
|
type: Input
|
|
7019
7052
|
}], data: [{
|