ngx-pk-ui 1.0.1 → 1.0.3
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/README.md +2 -0
- package/fesm2022/ngx-pk-ui.mjs +117 -79
- package/fesm2022/ngx-pk-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngx-pk-ui.d.ts +47 -33
package/README.md
CHANGED
package/fesm2022/ngx-pk-ui.mjs
CHANGED
|
@@ -265,6 +265,10 @@ const PK_ICONS = {
|
|
|
265
265
|
'plus': `<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>`,
|
|
266
266
|
'list': `<line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/>`,
|
|
267
267
|
'reload': `<polyline points="1 4 1 10 7 10"/><polyline points="23 20 23 14 17 14"/><path d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4-4.64 4.36A9 9 0 0 1 3.51 15"/>`,
|
|
268
|
+
'chevron-right': `<polyline points="9 18 15 12 9 6"/>`,
|
|
269
|
+
'chevron-left': `<polyline points="15 18 9 12 15 6"/>`,
|
|
270
|
+
'chevron-up': `<polyline points="18 15 12 9 6 15"/>`,
|
|
271
|
+
'chevron-down': `<polyline points="6 9 12 15 18 9"/>`,
|
|
268
272
|
// ── Users & Auth ─────────────────────────────────────────────────────────
|
|
269
273
|
'user': `<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`,
|
|
270
274
|
'users': `<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>`,
|
|
@@ -416,10 +420,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
416
420
|
`, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:1}:host span{display:inline-flex;align-items:center;justify-content:center}:host span svg{display:block}.pk-material-symbol{line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;direction:ltr}\n"] }]
|
|
417
421
|
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], iconSet: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSet", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], fillColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillColor", required: false }] }], viewBox: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewBox", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], weight: [{ type: i0.Input, args: [{ isSignal: true, alias: "weight", required: false }] }], grade: [{ type: i0.Input, args: [{ isSignal: true, alias: "grade", required: false }] }], opticalSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "opticalSize", required: false }] }] } });
|
|
418
422
|
|
|
419
|
-
class
|
|
423
|
+
class PkDgHeaderComponent {
|
|
420
424
|
el;
|
|
421
|
-
|
|
422
|
-
|
|
425
|
+
pkDgSort;
|
|
426
|
+
pkDgFilter;
|
|
423
427
|
widthPx;
|
|
424
428
|
width;
|
|
425
429
|
headerText = '';
|
|
@@ -427,11 +431,8 @@ class PkDgColumnComponent {
|
|
|
427
431
|
this.el = el;
|
|
428
432
|
}
|
|
429
433
|
ngAfterViewInit() {
|
|
430
|
-
// Extract text content for header
|
|
431
434
|
const nativeElement = this.el.nativeElement;
|
|
432
435
|
this.headerText = nativeElement.textContent?.trim() || '';
|
|
433
|
-
// @Input('style.width.px') is bypassed by Angular's style binding pipeline —
|
|
434
|
-
// read from the host element's actual inline style as the reliable source
|
|
435
436
|
if (!this.widthPx) {
|
|
436
437
|
const styleWidth = nativeElement.style.width;
|
|
437
438
|
if (styleWidth && styleWidth.endsWith('px')) {
|
|
@@ -439,22 +440,22 @@ class PkDgColumnComponent {
|
|
|
439
440
|
}
|
|
440
441
|
}
|
|
441
442
|
}
|
|
442
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
443
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type:
|
|
443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgHeaderComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
444
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: PkDgHeaderComponent, isStandalone: false, selector: "pk-dg-header", inputs: { pkDgSort: "pkDgSort", pkDgFilter: "pkDgFilter", widthPx: ["style.width.px", "widthPx"] }, host: { styleAttribute: "display: none" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
444
445
|
}
|
|
445
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgHeaderComponent, decorators: [{
|
|
446
447
|
type: Component,
|
|
447
448
|
args: [{
|
|
448
|
-
selector: 'pk-dg-
|
|
449
|
+
selector: 'pk-dg-header',
|
|
449
450
|
template: '<ng-content></ng-content>',
|
|
450
451
|
standalone: false,
|
|
451
452
|
host: {
|
|
452
453
|
'style': 'display: none'
|
|
453
454
|
}
|
|
454
455
|
}]
|
|
455
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: {
|
|
456
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { pkDgSort: [{
|
|
456
457
|
type: Input
|
|
457
|
-
}],
|
|
458
|
+
}], pkDgFilter: [{
|
|
458
459
|
type: Input
|
|
459
460
|
}], widthPx: [{
|
|
460
461
|
type: Input,
|
|
@@ -463,7 +464,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
463
464
|
|
|
464
465
|
class PkDgPageSizeComponent {
|
|
465
466
|
cdr;
|
|
466
|
-
|
|
467
|
+
pkPageSizeList = [10, 20, 50, 100];
|
|
467
468
|
pagination = null;
|
|
468
469
|
constructor(cdr) {
|
|
469
470
|
this.cdr = cdr;
|
|
@@ -473,26 +474,26 @@ class PkDgPageSizeComponent {
|
|
|
473
474
|
this.cdr.detectChanges();
|
|
474
475
|
}
|
|
475
476
|
get currentSize() {
|
|
476
|
-
return this.pagination?.pkDgPageSize ?? this.
|
|
477
|
+
return this.pagination?.pkDgPageSize ?? this.pkPageSizeList[0];
|
|
477
478
|
}
|
|
478
479
|
onChange(event) {
|
|
479
480
|
const value = +event.target.value;
|
|
480
481
|
this.pagination?.onPageSizeChange(value);
|
|
481
482
|
}
|
|
482
483
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgPageSizeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
483
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDgPageSizeComponent, isStandalone: false, selector: "pk-dg-page-size", inputs: {
|
|
484
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDgPageSizeComponent, isStandalone: false, selector: "pk-dg-page-size", inputs: { pkPageSizeList: "pkPageSizeList" }, ngImport: i0, template: "<span class=\"pk-dg-page-size\">\n <ng-content></ng-content>\n <select (change)=\"onChange($event)\">\n @for (opt of pkPageSizeList; track opt) {\n <option [value]=\"opt\" [selected]=\"opt === currentSize\">{{ opt }}</option>\n }\n </select>\n</span>\n", styles: [".pk-dg-page-size{display:inline-flex;align-items:center;gap:6px;margin-right:16px;font-size:13px;color:#555}.pk-dg-page-size select{padding:2px 6px;border:1px solid #ccc;border-radius:3px;font-size:13px;background:#fff;cursor:pointer}.pk-dg-page-size select:focus{outline:none;border-color:#0072a3}\n"], dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
484
485
|
}
|
|
485
486
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgPageSizeComponent, decorators: [{
|
|
486
487
|
type: Component,
|
|
487
|
-
args: [{ selector: 'pk-dg-page-size', standalone: false, template: "<span class=\"pk-dg-page-size\">\n <ng-content></ng-content>\n <select (change)=\"onChange($event)\">\n @for (opt of
|
|
488
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: {
|
|
488
|
+
args: [{ selector: 'pk-dg-page-size', standalone: false, template: "<span class=\"pk-dg-page-size\">\n <ng-content></ng-content>\n <select (change)=\"onChange($event)\">\n @for (opt of pkPageSizeList; track opt) {\n <option [value]=\"opt\" [selected]=\"opt === currentSize\">{{ opt }}</option>\n }\n </select>\n</span>\n", styles: [".pk-dg-page-size{display:inline-flex;align-items:center;gap:6px;margin-right:16px;font-size:13px;color:#555}.pk-dg-page-size select{padding:2px 6px;border:1px solid #ccc;border-radius:3px;font-size:13px;background:#fff;cursor:pointer}.pk-dg-page-size select:focus{outline:none;border-color:#0072a3}\n"] }]
|
|
489
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { pkPageSizeList: [{
|
|
489
490
|
type: Input
|
|
490
491
|
}] } });
|
|
491
492
|
|
|
492
493
|
class PkDgPaginationComponent {
|
|
493
494
|
pageSize;
|
|
494
495
|
pkDgPageSize = 10;
|
|
495
|
-
|
|
496
|
+
rowCount = 0;
|
|
496
497
|
pkDgPageChange = new EventEmitter();
|
|
497
498
|
pkDgPageSizeChange = new EventEmitter();
|
|
498
499
|
currentPage = 1;
|
|
@@ -511,10 +512,10 @@ class PkDgPaginationComponent {
|
|
|
511
512
|
}
|
|
512
513
|
updatePagination() {
|
|
513
514
|
this.firstItem = (this.currentPage - 1) * this.pkDgPageSize;
|
|
514
|
-
this.lastItem = Math.min(this.firstItem + this.pkDgPageSize, this.
|
|
515
|
+
this.lastItem = Math.min(this.firstItem + this.pkDgPageSize, this.rowCount);
|
|
515
516
|
}
|
|
516
517
|
get totalPages() {
|
|
517
|
-
return Math.ceil(this.
|
|
518
|
+
return Math.ceil(this.rowCount / this.pkDgPageSize);
|
|
518
519
|
}
|
|
519
520
|
goToPage(page) {
|
|
520
521
|
if (page >= 1 && page <= this.totalPages) {
|
|
@@ -543,7 +544,7 @@ class PkDgPaginationComponent {
|
|
|
543
544
|
return pages;
|
|
544
545
|
}
|
|
545
546
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
546
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDgPaginationComponent, isStandalone: false, selector: "pk-dg-pagination", inputs: { pkDgPageSize: "pkDgPageSize",
|
|
547
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDgPaginationComponent, isStandalone: false, selector: "pk-dg-pagination", inputs: { pkDgPageSize: "pkDgPageSize", rowCount: "rowCount" }, outputs: { pkDgPageChange: "pkDgPageChange", pkDgPageSizeChange: "pkDgPageSizeChange" }, queries: [{ propertyName: "pageSize", first: true, predicate: PkDgPageSizeComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"pk-dg-pagination\">\n <div class=\"pagination-info\">\n <ng-content></ng-content>\n </div>\n \n <div class=\"pagination-controls\">\n <button \n class=\"btn btn-sm btn-link\"\n [disabled]=\"currentPage === 1\"\n (click)=\"goToPage(currentPage - 1)\">\n \u2039\n </button>\n \n @for (page of pages; track page) {\n <button \n class=\"btn btn-sm\"\n [class.btn-primary]=\"page === currentPage\"\n [class.btn-link]=\"page !== currentPage\"\n (click)=\"goToPage(page)\">\n {{ page }}\n </button>\n }\n \n <button \n class=\"btn btn-sm btn-link\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"goToPage(currentPage + 1)\">\n \u203A\n </button>\n </div>\n</div>\n", styles: [".pk-dg-pagination{display:flex;align-items:center;justify-content:space-between;padding:12px;border-top:1px solid #e0e0e0;background:#fafafa}.pk-dg-pagination .pagination-info{color:#565656;font-size:14px}.pk-dg-pagination .pagination-controls{display:flex;gap:4px}.pk-dg-pagination .pagination-controls .btn{min-width:32px;padding:4px 8px}.pk-dg-pagination .pagination-controls .btn:disabled{opacity:.5;cursor:not-allowed}\n"] });
|
|
547
548
|
}
|
|
548
549
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgPaginationComponent, decorators: [{
|
|
549
550
|
type: Component,
|
|
@@ -553,7 +554,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
553
554
|
args: [PkDgPageSizeComponent]
|
|
554
555
|
}], pkDgPageSize: [{
|
|
555
556
|
type: Input
|
|
556
|
-
}],
|
|
557
|
+
}], rowCount: [{
|
|
557
558
|
type: Input
|
|
558
559
|
}], pkDgPageChange: [{
|
|
559
560
|
type: Output
|
|
@@ -562,26 +563,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
562
563
|
}] } });
|
|
563
564
|
|
|
564
565
|
class PkDgRowComponent {
|
|
565
|
-
|
|
566
|
+
pkDgRow;
|
|
566
567
|
detailTemplate;
|
|
567
568
|
isExpanded = false;
|
|
568
569
|
hasDetail = false;
|
|
569
570
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
570
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDgRowComponent, isStandalone: false, selector: "pk-dg-
|
|
571
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDgRowComponent, isStandalone: false, selector: "pk-dg-rows", inputs: { pkDgRow: "pkDgRow" }, host: { styleAttribute: "display: contents" }, queries: [{ propertyName: "detailTemplate", first: true, predicate: ["detail"], descendants: true }], ngImport: i0, template: "<tr class=\"pk-dg-row\">\n <ng-content select=\"pk-dg-action\"></ng-content>\n @if (hasDetail) {\n <td class=\"pk-dg-expand-btn-cell\">\n <button class=\"pk-dg-expand-btn\" [class.expanded]=\"isExpanded\" (click)=\"isExpanded=!isExpanded; $event.stopPropagation()\" title=\"\u0E02\u0E22\u0E32\u0E22/\u0E22\u0E48\u0E2D\">\n <pk-icon [name]=\"isExpanded ? 'chevron-down' : 'chevron-right'\" [size]=\"16\" color=\"currentColor\"></pk-icon>\n </button>\n </td>\n } @else {\n <td class=\"pk-dg-expand-btn-cell pk-dg-no-detail\"></td>\n }\n <ng-content></ng-content>\n</tr>\n@if (isExpanded) {\n <tr class=\"pk-dg-row-expand\">\n <td [attr.colspan]=\"999\">\n <ng-content select=\"pk-dg-row-expand\"></ng-content>\n </td>\n </tr>\n}\n", styles: [":host{display:contents}.pk-dg-expand-btn-cell{width:28px;min-width:28px;padding:0 2px;text-align:center;border:1px solid #e8e8e8;vertical-align:middle}.pk-dg-expand-btn-cell.pk-dg-no-detail{width:0;min-width:0;max-width:0;padding:0;border:none;overflow:hidden}.pk-dg-expand-btn{background:none;border:none;cursor:pointer;padding:2px;color:#aaa;display:flex;align-items:center;justify-content:center;border-radius:3px;transition:color .15s,background .15s;width:22px;height:22px;margin:auto}.pk-dg-expand-btn:hover{background:#e8f4ff;color:#0072a3}.pk-dg-expand-btn.expanded{color:#0072a3}.pk-dg-chevron{width:14px;height:14px;transition:transform .2s ease;transform:rotate(-90deg)}.pk-dg-expand-btn.expanded .pk-dg-chevron{transform:rotate(0)}\n"], dependencies: [{ kind: "component", type: PkIcon, selector: "pk-icon", inputs: ["name", "iconSet", "size", "color", "fillColor", "viewBox", "strokeWidth", "variant", "fill", "weight", "grade", "opticalSize"] }] });
|
|
571
572
|
}
|
|
572
573
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgRowComponent, decorators: [{
|
|
573
574
|
type: Component,
|
|
574
|
-
args: [{ selector: 'pk-dg-
|
|
575
|
+
args: [{ selector: 'pk-dg-rows', standalone: false, host: {
|
|
575
576
|
'style': 'display: contents'
|
|
576
|
-
}, template: "<tr class=\"pk-dg-row\">\n @if (hasDetail) {\n <td class=\"pk-dg-expand-btn-cell\">\n <button class=\"pk-dg-expand-btn\" [class.expanded]=\"isExpanded\" (click)=\"isExpanded=!isExpanded; $event.stopPropagation()\" title=\"\u0E02\u0E22\u0E32\u0E22/\u0E22\u0E48\u0E2D\">\n <pk-icon
|
|
577
|
-
}], propDecorators: {
|
|
577
|
+
}, template: "<tr class=\"pk-dg-row\">\n <ng-content select=\"pk-dg-action\"></ng-content>\n @if (hasDetail) {\n <td class=\"pk-dg-expand-btn-cell\">\n <button class=\"pk-dg-expand-btn\" [class.expanded]=\"isExpanded\" (click)=\"isExpanded=!isExpanded; $event.stopPropagation()\" title=\"\u0E02\u0E22\u0E32\u0E22/\u0E22\u0E48\u0E2D\">\n <pk-icon [name]=\"isExpanded ? 'chevron-down' : 'chevron-right'\" [size]=\"16\" color=\"currentColor\"></pk-icon>\n </button>\n </td>\n } @else {\n <td class=\"pk-dg-expand-btn-cell pk-dg-no-detail\"></td>\n }\n <ng-content></ng-content>\n</tr>\n@if (isExpanded) {\n <tr class=\"pk-dg-row-expand\">\n <td [attr.colspan]=\"999\">\n <ng-content select=\"pk-dg-row-expand\"></ng-content>\n </td>\n </tr>\n}\n", styles: [":host{display:contents}.pk-dg-expand-btn-cell{width:28px;min-width:28px;padding:0 2px;text-align:center;border:1px solid #e8e8e8;vertical-align:middle}.pk-dg-expand-btn-cell.pk-dg-no-detail{width:0;min-width:0;max-width:0;padding:0;border:none;overflow:hidden}.pk-dg-expand-btn{background:none;border:none;cursor:pointer;padding:2px;color:#aaa;display:flex;align-items:center;justify-content:center;border-radius:3px;transition:color .15s,background .15s;width:22px;height:22px;margin:auto}.pk-dg-expand-btn:hover{background:#e8f4ff;color:#0072a3}.pk-dg-expand-btn.expanded{color:#0072a3}.pk-dg-chevron{width:14px;height:14px;transition:transform .2s ease;transform:rotate(-90deg)}.pk-dg-expand-btn.expanded .pk-dg-chevron{transform:rotate(0)}\n"] }]
|
|
578
|
+
}], propDecorators: { pkDgRow: [{
|
|
578
579
|
type: Input
|
|
579
580
|
}], detailTemplate: [{
|
|
580
581
|
type: ContentChild,
|
|
581
582
|
args: ['detail']
|
|
582
583
|
}] } });
|
|
583
584
|
|
|
584
|
-
class
|
|
585
|
+
class PkDgRowExpandComponent {
|
|
585
586
|
row;
|
|
586
587
|
constructor(row) {
|
|
587
588
|
this.row = row;
|
|
@@ -591,13 +592,13 @@ class PkDgRowDetailComponent {
|
|
|
591
592
|
this.row.hasDetail = true;
|
|
592
593
|
}
|
|
593
594
|
}
|
|
594
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
595
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type:
|
|
595
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgRowExpandComponent, deps: [{ token: PkDgRowComponent, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
596
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: PkDgRowExpandComponent, isStandalone: false, selector: "pk-dg-row-expand", host: { styleAttribute: "display: contents" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
596
597
|
}
|
|
597
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgRowExpandComponent, decorators: [{
|
|
598
599
|
type: Component,
|
|
599
600
|
args: [{
|
|
600
|
-
selector: 'pk-dg-row-
|
|
601
|
+
selector: 'pk-dg-row-expand',
|
|
601
602
|
template: '<ng-content></ng-content>',
|
|
602
603
|
standalone: false,
|
|
603
604
|
host: {
|
|
@@ -610,7 +611,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
610
611
|
type: Optional
|
|
611
612
|
}] }] });
|
|
612
613
|
|
|
613
|
-
class
|
|
614
|
+
class PkDgRowsDirective {
|
|
614
615
|
templateRef;
|
|
615
616
|
viewContainer;
|
|
616
617
|
datagrid;
|
|
@@ -631,13 +632,13 @@ class PkDgItemsDirective {
|
|
|
631
632
|
}
|
|
632
633
|
}
|
|
633
634
|
}
|
|
634
|
-
set
|
|
635
|
+
set pkDgRowsOf(items) {
|
|
635
636
|
this._items = items || [];
|
|
636
637
|
// Push items to parent datagrid so it can handle pagination/sorting
|
|
637
638
|
if (this.datagrid) {
|
|
638
639
|
this.datagrid.items = this._items;
|
|
639
640
|
if (this.datagrid.pagination) {
|
|
640
|
-
this.datagrid.pagination.
|
|
641
|
+
this.datagrid.pagination.rowCount = this._items.length;
|
|
641
642
|
this.datagrid.pagination.updatePagination();
|
|
642
643
|
}
|
|
643
644
|
this.datagrid.updateDisplayedItems();
|
|
@@ -656,13 +657,13 @@ class PkDgItemsDirective {
|
|
|
656
657
|
});
|
|
657
658
|
}
|
|
658
659
|
}
|
|
659
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
660
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type:
|
|
660
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgRowsDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: forwardRef(() => PkDatagridComponent), optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
661
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: PkDgRowsDirective, isStandalone: false, selector: "[pkDgRows]", inputs: { pkDgRowsOf: "pkDgRowsOf" }, ngImport: i0 });
|
|
661
662
|
}
|
|
662
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgRowsDirective, decorators: [{
|
|
663
664
|
type: Directive,
|
|
664
665
|
args: [{
|
|
665
|
-
selector: '[
|
|
666
|
+
selector: '[pkDgRows]',
|
|
666
667
|
standalone: false
|
|
667
668
|
}]
|
|
668
669
|
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: PkDatagridComponent, decorators: [{
|
|
@@ -670,10 +671,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
670
671
|
}, {
|
|
671
672
|
type: Inject,
|
|
672
673
|
args: [forwardRef(() => PkDatagridComponent)]
|
|
673
|
-
}] }], propDecorators: {
|
|
674
|
+
}] }], propDecorators: { pkDgRowsOf: [{
|
|
674
675
|
type: Input
|
|
675
676
|
}] } });
|
|
676
|
-
class
|
|
677
|
+
class PkDgRowIsExpandDirective {
|
|
677
678
|
templateRef;
|
|
678
679
|
viewContainer;
|
|
679
680
|
row;
|
|
@@ -702,13 +703,13 @@ class PkIfExpandedDirective {
|
|
|
702
703
|
this.viewContainer.clear();
|
|
703
704
|
}
|
|
704
705
|
}
|
|
705
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
706
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type:
|
|
706
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgRowIsExpandDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: PkDgRowComponent, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
707
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: PkDgRowIsExpandDirective, isStandalone: false, selector: "[pkDgRowIsExpand]", ngImport: i0 });
|
|
707
708
|
}
|
|
708
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgRowIsExpandDirective, decorators: [{
|
|
709
710
|
type: Directive,
|
|
710
711
|
args: [{
|
|
711
|
-
selector: '[
|
|
712
|
+
selector: '[pkDgRowIsExpand]',
|
|
712
713
|
standalone: false
|
|
713
714
|
}]
|
|
714
715
|
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: PkDgRowComponent, decorators: [{
|
|
@@ -732,12 +733,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
732
733
|
}]
|
|
733
734
|
}] });
|
|
734
735
|
|
|
736
|
+
class PkDgActionComponent {
|
|
737
|
+
isOpen = false;
|
|
738
|
+
menuPos = { top: 0, left: 0 };
|
|
739
|
+
toggle(event) {
|
|
740
|
+
event.stopPropagation();
|
|
741
|
+
const btn = event.currentTarget;
|
|
742
|
+
const rect = btn.getBoundingClientRect();
|
|
743
|
+
this.menuPos = { top: rect.bottom + 4, left: rect.left };
|
|
744
|
+
this.isOpen = !this.isOpen;
|
|
745
|
+
}
|
|
746
|
+
onDocumentClick() {
|
|
747
|
+
this.isOpen = false;
|
|
748
|
+
}
|
|
749
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
750
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDgActionComponent, isStandalone: false, selector: "pk-dg-action", host: { listeners: { "document:click": "onDocumentClick()" }, styleAttribute: "display: contents" }, ngImport: i0, template: "<td class=\"pk-dg-action-cell\">\n <button class=\"pk-dg-action-btn\" [class.active]=\"isOpen\" (click)=\"toggle($event)\" title=\"Actions\">\n <pk-icon name=\"menu\" [size]=\"16\" color=\"currentColor\"></pk-icon>\n </button>\n @if (isOpen) {\n <div class=\"pk-dg-action-menu\"\n [style.top.px]=\"menuPos.top\"\n [style.left.px]=\"menuPos.left\"\n (click)=\"isOpen = false; $event.stopPropagation()\">\n <ng-content></ng-content>\n </div>\n }\n</td>\n", styles: [":host{display:contents}.pk-dg-action-cell{width:32px;min-width:32px;padding:0 2px;text-align:center;border:1px solid #e8e8e8;vertical-align:middle}.pk-dg-action-btn{background:none;border:none;cursor:pointer;padding:2px;color:#aaa;display:flex;align-items:center;justify-content:center;border-radius:3px;transition:color .15s,background .15s;width:28px;height:28px;margin:auto}.pk-dg-action-btn:hover,.pk-dg-action-btn.active{background:#e8f4ff;color:#0072a3}.pk-dg-action-menu{position:fixed;background:#fff;border:1px solid #d0d7de;border-radius:6px;box-shadow:0 8px 24px #00000026;z-index:9999;min-width:160px;padding:4px 0;overflow:hidden}.pk-dg-action-menu ::ng-deep .action-item{display:flex;align-items:center;gap:6px;width:100%;padding:8px 14px;text-align:left;background:none;border:none;cursor:pointer;font-size:13px;color:#333;box-sizing:border-box;transition:background .1s;white-space:nowrap}.pk-dg-action-menu ::ng-deep .action-item:hover:not([disabled]){background:#f0f6ff;color:#0072a3}.pk-dg-action-menu ::ng-deep .action-item[disabled]{color:#bbb;cursor:not-allowed}\n"], dependencies: [{ kind: "component", type: PkIcon, selector: "pk-icon", inputs: ["name", "iconSet", "size", "color", "fillColor", "viewBox", "strokeWidth", "variant", "fill", "weight", "grade", "opticalSize"] }] });
|
|
751
|
+
}
|
|
752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgActionComponent, decorators: [{
|
|
753
|
+
type: Component,
|
|
754
|
+
args: [{ selector: 'pk-dg-action', standalone: false, host: {
|
|
755
|
+
'style': 'display: contents'
|
|
756
|
+
}, template: "<td class=\"pk-dg-action-cell\">\n <button class=\"pk-dg-action-btn\" [class.active]=\"isOpen\" (click)=\"toggle($event)\" title=\"Actions\">\n <pk-icon name=\"menu\" [size]=\"16\" color=\"currentColor\"></pk-icon>\n </button>\n @if (isOpen) {\n <div class=\"pk-dg-action-menu\"\n [style.top.px]=\"menuPos.top\"\n [style.left.px]=\"menuPos.left\"\n (click)=\"isOpen = false; $event.stopPropagation()\">\n <ng-content></ng-content>\n </div>\n }\n</td>\n", styles: [":host{display:contents}.pk-dg-action-cell{width:32px;min-width:32px;padding:0 2px;text-align:center;border:1px solid #e8e8e8;vertical-align:middle}.pk-dg-action-btn{background:none;border:none;cursor:pointer;padding:2px;color:#aaa;display:flex;align-items:center;justify-content:center;border-radius:3px;transition:color .15s,background .15s;width:28px;height:28px;margin:auto}.pk-dg-action-btn:hover,.pk-dg-action-btn.active{background:#e8f4ff;color:#0072a3}.pk-dg-action-menu{position:fixed;background:#fff;border:1px solid #d0d7de;border-radius:6px;box-shadow:0 8px 24px #00000026;z-index:9999;min-width:160px;padding:4px 0;overflow:hidden}.pk-dg-action-menu ::ng-deep .action-item{display:flex;align-items:center;gap:6px;width:100%;padding:8px 14px;text-align:left;background:none;border:none;cursor:pointer;font-size:13px;color:#333;box-sizing:border-box;transition:background .1s;white-space:nowrap}.pk-dg-action-menu ::ng-deep .action-item:hover:not([disabled]){background:#f0f6ff;color:#0072a3}.pk-dg-action-menu ::ng-deep .action-item[disabled]{color:#bbb;cursor:not-allowed}\n"] }]
|
|
757
|
+
}], propDecorators: { onDocumentClick: [{
|
|
758
|
+
type: HostListener,
|
|
759
|
+
args: ['document:click']
|
|
760
|
+
}] } });
|
|
761
|
+
|
|
735
762
|
class PkDatagridComponent {
|
|
736
763
|
cdr;
|
|
737
764
|
columns;
|
|
738
765
|
pagination;
|
|
739
766
|
rowDetails;
|
|
740
767
|
expandDirectives;
|
|
768
|
+
actionComponents;
|
|
769
|
+
get hasActionCol() {
|
|
770
|
+
return this.actionComponents ? this.actionComponents.length > 0 : false;
|
|
771
|
+
}
|
|
741
772
|
get hasExpandCol() {
|
|
742
773
|
if (this.expandDirectives && this.expandDirectives.length > 0)
|
|
743
774
|
return true;
|
|
@@ -765,7 +796,7 @@ class PkDatagridComponent {
|
|
|
765
796
|
_resizeEndRef = () => this._onResizeEnd();
|
|
766
797
|
get totalWidth() {
|
|
767
798
|
const sum = this.columnWidths.reduce((acc, w) => acc + w, 0);
|
|
768
|
-
return sum + (this.hasExpandCol ? 32 : 0);
|
|
799
|
+
return sum + (this.hasExpandCol ? 32 : 0) + (this.hasActionCol ? 32 : 0);
|
|
769
800
|
}
|
|
770
801
|
_initColumnWidths() {
|
|
771
802
|
const cols = this.columns ? this.columns.toArray() : [];
|
|
@@ -799,7 +830,7 @@ class PkDatagridComponent {
|
|
|
799
830
|
// Also re-update displayed items to ensure pagination is initialized
|
|
800
831
|
setTimeout(() => {
|
|
801
832
|
if (this.pagination) {
|
|
802
|
-
this.pagination.
|
|
833
|
+
this.pagination.rowCount = this.items.length;
|
|
803
834
|
this.pagination.updatePagination();
|
|
804
835
|
}
|
|
805
836
|
this._initColumnWidths();
|
|
@@ -831,7 +862,7 @@ class PkDatagridComponent {
|
|
|
831
862
|
}
|
|
832
863
|
// Keep pagination counts in sync with filtered result
|
|
833
864
|
if (this.pagination) {
|
|
834
|
-
this.pagination.
|
|
865
|
+
this.pagination.rowCount = result.length;
|
|
835
866
|
if (this.pagination.currentPage > this.pagination.totalPages && this.pagination.totalPages > 0) {
|
|
836
867
|
this.pagination.currentPage = this.pagination.totalPages;
|
|
837
868
|
}
|
|
@@ -963,23 +994,26 @@ class PkDatagridComponent {
|
|
|
963
994
|
this._onResizeEnd();
|
|
964
995
|
}
|
|
965
996
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDatagridComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
966
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDatagridComponent, isStandalone: false, selector: "pk-datagrid", inputs: { pkDgLoading: "pkDgLoading", items: "items", filterValues: "filterValues" }, outputs: { pkDgRefresh: "pkDgRefresh", filterChange: "filterChange" }, host: { listeners: { "document:click": "onDocumentClick()" } }, queries: [{ propertyName: "pagination", first: true, predicate: PkDgPaginationComponent, descendants: true }, { propertyName: "columns", predicate:
|
|
997
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: PkDatagridComponent, isStandalone: false, selector: "pk-datagrid", inputs: { pkDgLoading: "pkDgLoading", items: "items", filterValues: "filterValues" }, outputs: { pkDgRefresh: "pkDgRefresh", filterChange: "filterChange" }, host: { listeners: { "document:click": "onDocumentClick()" } }, queries: [{ propertyName: "pagination", first: true, predicate: PkDgPaginationComponent, descendants: true }, { propertyName: "columns", predicate: PkDgHeaderComponent }, { propertyName: "rowDetails", predicate: PkDgRowExpandComponent, descendants: true }, { propertyName: "expandDirectives", predicate: PkDgRowIsExpandDirective, descendants: true }, { propertyName: "actionComponents", predicate: PkDgActionComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"pk-datagrid-container\">\n @if (pkDgLoading) {\n <div class=\"pk-datagrid-spinner\">\n <div class=\"spinner\"></div>\n <span>Loading...</span>\n </div>\n }\n \n <table class=\"pk-datagrid\" style=\"table-layout: fixed\" [style.min-width.px]=\"totalWidth\">\n <thead>\n <tr>\n @if (hasActionCol) {\n <th class=\"pk-dg-action-th\"></th>\n }\n @if (hasExpandCol) {\n <th class=\"pk-dg-expand-th\"></th>\n } @else {\n <th class=\"pk-dg-expand-th pk-dg-no-detail\"></th>\n }\n @for (column of columns; track column.pkDgSort; let i = $index) {\n <th [style.width.px]=\"columnWidths[i]\">\n <div class=\"th-content\">\n <span>{{ column.headerText }}</span>\n <div class=\"th-actions\">\n @if (column.pkDgSort) {\n <button class=\"sort-icon-btn\"\n [class.active]=\"sortColumn === column.pkDgSort\"\n (click)=\"onSort(column.pkDgSort)\"\n title=\"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E25\u0E33\u0E14\u0E31\u0E1A\">\n <pk-icon\n [name]=\"sortColumn === column.pkDgSort ? (sortDirection === 'asc' ? 'chevron-up' : 'chevron-down') : 'sort'\"\n [size]=\"12\" color=\"currentColor\">\n </pk-icon>\n </button>\n }\n @if (column.pkDgFilter) {\n <button class=\"filter-icon-btn\"\n [class.active]=\"filterValues[column.pkDgFilter]\"\n (click)=\"openFilter(column.pkDgFilter, $event, column.headerText)\"\n title=\"\u0E01\u0E23\u0E2D\u0E07\">\n <pk-icon name=\"search\" [size]=\"12\" color=\"currentColor\"></pk-icon>\n </button>\n }\n </div>\n </div>\n @if (column.pkDgFilter && activeFilterCol === column.pkDgFilter) {\n <div class=\"filter-popup\"\n [style.top.px]=\"filterPopupPos.top\"\n [style.left.px]=\"filterPopupPos.left\"\n (click)=\"$event.stopPropagation()\">\n <input type=\"text\"\n [value]=\"filterValues[column.pkDgFilter] || ''\"\n (input)=\"onFilterInput(column.pkDgFilter, $event)\"\n [placeholder]=\"'\u0E04\u0E49\u0E19\u0E2B\u0E32 ' + activeFilterHeader\"\n autofocus>\n </div>\n }\n <div class=\"resize-handle\" (mousedown)=\"startResize(i, $event)\"></div>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <ng-content select=\"pk-dg-rows\"></ng-content>\n </tbody>\n </table>\n \n <ng-content select=\"pk-dg-footer\"></ng-content>\n</div>\n", styles: [".pk-datagrid-container{position:relative;width:100%;overflow:auto}.pk-datagrid-spinner{position:absolute;inset:0;background:#fffc;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:1000}.pk-datagrid-spinner .spinner{border:4px solid #f3f3f3;border-top:4px solid #0072a3;border-radius:50%;width:40px;height:40px;animation:spin 1s linear infinite}.pk-datagrid-spinner span{margin-top:10px;color:#0072a3}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.pk-datagrid{width:100%;border-collapse:collapse;background:#fff;border:1px solid #cccccc}.pk-datagrid thead{background:#f8f8f8}.pk-datagrid thead th{padding:10px 8px;text-align:left;font-weight:600;color:#333;border:1px solid #cccccc;white-space:nowrap;position:sticky;top:0;background:#f8f8f8;z-index:10;overflow:hidden;box-sizing:border-box}.pk-datagrid thead th .th-content{display:flex;align-items:center;justify-content:space-between;gap:4px}.pk-datagrid thead th .th-content .th-actions{display:flex;align-items:center;gap:2px;flex-shrink:0}.pk-datagrid thead th .th-content .sort-icon-btn{background:none;border:none;padding:1px 2px;cursor:pointer;color:#ccc;border-radius:2px;display:flex;align-items:center;line-height:1}.pk-datagrid thead th .th-content .sort-icon-btn:hover{color:#0072a3;background:#0072a31a}.pk-datagrid thead th .th-content .sort-icon-btn.active{color:#0072a3}.pk-datagrid thead th .th-content .filter-icon-btn{background:none;border:none;padding:1px 2px;cursor:pointer;color:#bbb;border-radius:2px;display:flex;align-items:center;line-height:1}.pk-datagrid thead th .th-content .filter-icon-btn:hover{color:#0072a3;background:#0072a31a}.pk-datagrid thead th .th-content .filter-icon-btn.active{color:#0072a3}.pk-datagrid thead th .filter-popup{position:fixed;background:#fff;border:1px solid #0072a3;border-radius:5px;padding:8px;box-shadow:0 4px 14px #00000026;z-index:9999;min-width:180px}.pk-datagrid thead th .filter-popup input{width:100%;box-sizing:border-box;padding:5px 8px;border:1px solid #b8cfe0;border-radius:3px;outline:none}.pk-datagrid thead th .filter-popup input:focus{border-color:#0072a3;box-shadow:0 0 0 2px #0072a32e}.pk-datagrid thead th .resize-handle{position:absolute;top:0;right:0;width:5px;height:100%;cursor:col-resize;z-index:20}.pk-datagrid thead th .resize-handle:after{content:\"\";position:absolute;top:15%;right:2px;width:2px;height:70%;background:transparent;border-radius:1px;transition:background .15s}.pk-datagrid thead th .resize-handle:hover:after{background:#0072a3}.pk-datagrid tbody tr.pk-dg-row{border:1px solid #cccccc;transition:background-color .15s}.pk-datagrid tbody tr.pk-dg-row:hover{background:#f0f9ff;cursor:pointer}.pk-datagrid tbody tr.pk-dg-row-expand,.pk-datagrid tbody tr.pk-dg-row-expand:hover{background:#fafafa}.pk-datagrid tbody tr.pk-dg-row-expand td{padding:15px;border:1px solid #cccccc}.pk-datagrid .pk-dg-expand-th{width:32px;min-width:32px;padding:0}.pk-datagrid .pk-dg-expand-th.pk-dg-no-detail{width:0;min-width:0;max-width:0;padding:0;border:none;overflow:hidden}.pk-datagrid .pk-dg-action-th{width:32px;min-width:32px;padding:0}\n"], dependencies: [{ kind: "component", type: PkIcon, selector: "pk-icon", inputs: ["name", "iconSet", "size", "color", "fillColor", "viewBox", "strokeWidth", "variant", "fill", "weight", "grade", "opticalSize"] }] });
|
|
967
998
|
}
|
|
968
999
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDatagridComponent, decorators: [{
|
|
969
1000
|
type: Component,
|
|
970
|
-
args: [{ selector: 'pk-datagrid', standalone: false, template: "<div class=\"pk-datagrid-container\">\n @if (pkDgLoading) {\n <div class=\"pk-datagrid-spinner\">\n <div class=\"spinner\"></div>\n <span>Loading...</span>\n </div>\n }\n \n <table class=\"pk-datagrid\" style=\"table-layout: fixed\" [style.min-width.px]=\"totalWidth\">\n <thead>\n <tr>\n @if (hasExpandCol) {\n <th class=\"pk-dg-expand-th\"></th>\n } @else {\n <th class=\"pk-dg-expand-th pk-dg-no-detail\"></th>\n }\n @for (column of columns; track column.
|
|
1001
|
+
args: [{ selector: 'pk-datagrid', standalone: false, template: "<div class=\"pk-datagrid-container\">\n @if (pkDgLoading) {\n <div class=\"pk-datagrid-spinner\">\n <div class=\"spinner\"></div>\n <span>Loading...</span>\n </div>\n }\n \n <table class=\"pk-datagrid\" style=\"table-layout: fixed\" [style.min-width.px]=\"totalWidth\">\n <thead>\n <tr>\n @if (hasActionCol) {\n <th class=\"pk-dg-action-th\"></th>\n }\n @if (hasExpandCol) {\n <th class=\"pk-dg-expand-th\"></th>\n } @else {\n <th class=\"pk-dg-expand-th pk-dg-no-detail\"></th>\n }\n @for (column of columns; track column.pkDgSort; let i = $index) {\n <th [style.width.px]=\"columnWidths[i]\">\n <div class=\"th-content\">\n <span>{{ column.headerText }}</span>\n <div class=\"th-actions\">\n @if (column.pkDgSort) {\n <button class=\"sort-icon-btn\"\n [class.active]=\"sortColumn === column.pkDgSort\"\n (click)=\"onSort(column.pkDgSort)\"\n title=\"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E25\u0E33\u0E14\u0E31\u0E1A\">\n <pk-icon\n [name]=\"sortColumn === column.pkDgSort ? (sortDirection === 'asc' ? 'chevron-up' : 'chevron-down') : 'sort'\"\n [size]=\"12\" color=\"currentColor\">\n </pk-icon>\n </button>\n }\n @if (column.pkDgFilter) {\n <button class=\"filter-icon-btn\"\n [class.active]=\"filterValues[column.pkDgFilter]\"\n (click)=\"openFilter(column.pkDgFilter, $event, column.headerText)\"\n title=\"\u0E01\u0E23\u0E2D\u0E07\">\n <pk-icon name=\"search\" [size]=\"12\" color=\"currentColor\"></pk-icon>\n </button>\n }\n </div>\n </div>\n @if (column.pkDgFilter && activeFilterCol === column.pkDgFilter) {\n <div class=\"filter-popup\"\n [style.top.px]=\"filterPopupPos.top\"\n [style.left.px]=\"filterPopupPos.left\"\n (click)=\"$event.stopPropagation()\">\n <input type=\"text\"\n [value]=\"filterValues[column.pkDgFilter] || ''\"\n (input)=\"onFilterInput(column.pkDgFilter, $event)\"\n [placeholder]=\"'\u0E04\u0E49\u0E19\u0E2B\u0E32 ' + activeFilterHeader\"\n autofocus>\n </div>\n }\n <div class=\"resize-handle\" (mousedown)=\"startResize(i, $event)\"></div>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <ng-content select=\"pk-dg-rows\"></ng-content>\n </tbody>\n </table>\n \n <ng-content select=\"pk-dg-footer\"></ng-content>\n</div>\n", styles: [".pk-datagrid-container{position:relative;width:100%;overflow:auto}.pk-datagrid-spinner{position:absolute;inset:0;background:#fffc;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:1000}.pk-datagrid-spinner .spinner{border:4px solid #f3f3f3;border-top:4px solid #0072a3;border-radius:50%;width:40px;height:40px;animation:spin 1s linear infinite}.pk-datagrid-spinner span{margin-top:10px;color:#0072a3}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.pk-datagrid{width:100%;border-collapse:collapse;background:#fff;border:1px solid #cccccc}.pk-datagrid thead{background:#f8f8f8}.pk-datagrid thead th{padding:10px 8px;text-align:left;font-weight:600;color:#333;border:1px solid #cccccc;white-space:nowrap;position:sticky;top:0;background:#f8f8f8;z-index:10;overflow:hidden;box-sizing:border-box}.pk-datagrid thead th .th-content{display:flex;align-items:center;justify-content:space-between;gap:4px}.pk-datagrid thead th .th-content .th-actions{display:flex;align-items:center;gap:2px;flex-shrink:0}.pk-datagrid thead th .th-content .sort-icon-btn{background:none;border:none;padding:1px 2px;cursor:pointer;color:#ccc;border-radius:2px;display:flex;align-items:center;line-height:1}.pk-datagrid thead th .th-content .sort-icon-btn:hover{color:#0072a3;background:#0072a31a}.pk-datagrid thead th .th-content .sort-icon-btn.active{color:#0072a3}.pk-datagrid thead th .th-content .filter-icon-btn{background:none;border:none;padding:1px 2px;cursor:pointer;color:#bbb;border-radius:2px;display:flex;align-items:center;line-height:1}.pk-datagrid thead th .th-content .filter-icon-btn:hover{color:#0072a3;background:#0072a31a}.pk-datagrid thead th .th-content .filter-icon-btn.active{color:#0072a3}.pk-datagrid thead th .filter-popup{position:fixed;background:#fff;border:1px solid #0072a3;border-radius:5px;padding:8px;box-shadow:0 4px 14px #00000026;z-index:9999;min-width:180px}.pk-datagrid thead th .filter-popup input{width:100%;box-sizing:border-box;padding:5px 8px;border:1px solid #b8cfe0;border-radius:3px;outline:none}.pk-datagrid thead th .filter-popup input:focus{border-color:#0072a3;box-shadow:0 0 0 2px #0072a32e}.pk-datagrid thead th .resize-handle{position:absolute;top:0;right:0;width:5px;height:100%;cursor:col-resize;z-index:20}.pk-datagrid thead th .resize-handle:after{content:\"\";position:absolute;top:15%;right:2px;width:2px;height:70%;background:transparent;border-radius:1px;transition:background .15s}.pk-datagrid thead th .resize-handle:hover:after{background:#0072a3}.pk-datagrid tbody tr.pk-dg-row{border:1px solid #cccccc;transition:background-color .15s}.pk-datagrid tbody tr.pk-dg-row:hover{background:#f0f9ff;cursor:pointer}.pk-datagrid tbody tr.pk-dg-row-expand,.pk-datagrid tbody tr.pk-dg-row-expand:hover{background:#fafafa}.pk-datagrid tbody tr.pk-dg-row-expand td{padding:15px;border:1px solid #cccccc}.pk-datagrid .pk-dg-expand-th{width:32px;min-width:32px;padding:0}.pk-datagrid .pk-dg-expand-th.pk-dg-no-detail{width:0;min-width:0;max-width:0;padding:0;border:none;overflow:hidden}.pk-datagrid .pk-dg-action-th{width:32px;min-width:32px;padding:0}\n"] }]
|
|
971
1002
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { columns: [{
|
|
972
1003
|
type: ContentChildren,
|
|
973
|
-
args: [
|
|
1004
|
+
args: [PkDgHeaderComponent]
|
|
974
1005
|
}], pagination: [{
|
|
975
1006
|
type: ContentChild,
|
|
976
1007
|
args: [PkDgPaginationComponent]
|
|
977
1008
|
}], rowDetails: [{
|
|
978
1009
|
type: ContentChildren,
|
|
979
|
-
args: [
|
|
1010
|
+
args: [PkDgRowExpandComponent, { descendants: true }]
|
|
980
1011
|
}], expandDirectives: [{
|
|
981
1012
|
type: ContentChildren,
|
|
982
|
-
args: [
|
|
1013
|
+
args: [PkDgRowIsExpandDirective, { descendants: true }]
|
|
1014
|
+
}], actionComponents: [{
|
|
1015
|
+
type: ContentChildren,
|
|
1016
|
+
args: [PkDgActionComponent, { descendants: true }]
|
|
983
1017
|
}], pkDgLoading: [{
|
|
984
1018
|
type: Input
|
|
985
1019
|
}], items: [{
|
|
@@ -995,19 +1029,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
995
1029
|
args: ['document:click']
|
|
996
1030
|
}] } });
|
|
997
1031
|
|
|
998
|
-
class
|
|
1032
|
+
class PkDgColumnComponent {
|
|
999
1033
|
set nowrap(value) {
|
|
1000
1034
|
this._nowrap = value;
|
|
1001
1035
|
}
|
|
1002
1036
|
get nowrap() { return this._nowrap; }
|
|
1003
1037
|
_nowrap = true;
|
|
1004
1038
|
tdStyle = null;
|
|
1005
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
1006
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type:
|
|
1039
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1040
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: PkDgColumnComponent, isStandalone: false, selector: "pk-dg-column", inputs: { nowrap: "nowrap", tdStyle: "tdStyle" }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: '<td [class.wrap]="!_nowrap" [ngStyle]="tdStyle"><ng-content></ng-content></td>', isInline: true, styles: [":host{display:contents}:host td{padding:8px;color:#333;border:1px solid #e8e8e8;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host td.wrap{white-space:normal;overflow:visible;text-overflow:unset}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1007
1041
|
}
|
|
1008
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
1042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDgColumnComponent, decorators: [{
|
|
1009
1043
|
type: Component,
|
|
1010
|
-
args: [{ selector: 'pk-dg-
|
|
1044
|
+
args: [{ selector: 'pk-dg-column', template: '<td [class.wrap]="!_nowrap" [ngStyle]="tdStyle"><ng-content></ng-content></td>', standalone: false, host: {
|
|
1011
1045
|
'style': 'display: contents'
|
|
1012
1046
|
}, styles: [":host{display:contents}:host td{padding:8px;color:#333;border:1px solid #e8e8e8;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host td.wrap{white-space:normal;overflow:visible;text-overflow:unset}\n"] }]
|
|
1013
1047
|
}], propDecorators: { nowrap: [{
|
|
@@ -1028,27 +1062,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1028
1062
|
class PkDatagridModule {
|
|
1029
1063
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDatagridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1030
1064
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: PkDatagridModule, declarations: [PkDatagridComponent,
|
|
1031
|
-
|
|
1065
|
+
PkDgHeaderComponent,
|
|
1032
1066
|
PkDgRowComponent,
|
|
1033
|
-
|
|
1067
|
+
PkDgColumnComponent,
|
|
1034
1068
|
PkDgFooterComponent,
|
|
1035
1069
|
PkDgPaginationComponent,
|
|
1036
1070
|
PkDgPageSizeComponent,
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1071
|
+
PkDgRowExpandComponent,
|
|
1072
|
+
PkDgActionComponent,
|
|
1073
|
+
PkDgRowsDirective,
|
|
1074
|
+
PkDgRowIsExpandDirective,
|
|
1040
1075
|
NowrapDirective], imports: [CommonModule,
|
|
1041
1076
|
FormsModule,
|
|
1042
1077
|
PkIcon], exports: [PkDatagridComponent,
|
|
1043
|
-
|
|
1078
|
+
PkDgHeaderComponent,
|
|
1044
1079
|
PkDgRowComponent,
|
|
1045
|
-
|
|
1080
|
+
PkDgColumnComponent,
|
|
1046
1081
|
PkDgFooterComponent,
|
|
1047
1082
|
PkDgPaginationComponent,
|
|
1048
1083
|
PkDgPageSizeComponent,
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1084
|
+
PkDgRowExpandComponent,
|
|
1085
|
+
PkDgActionComponent,
|
|
1086
|
+
PkDgRowsDirective,
|
|
1087
|
+
PkDgRowIsExpandDirective,
|
|
1052
1088
|
NowrapDirective,
|
|
1053
1089
|
PkIcon] });
|
|
1054
1090
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PkDatagridModule, imports: [CommonModule,
|
|
@@ -1059,15 +1095,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1059
1095
|
args: [{
|
|
1060
1096
|
declarations: [
|
|
1061
1097
|
PkDatagridComponent,
|
|
1062
|
-
|
|
1098
|
+
PkDgHeaderComponent,
|
|
1063
1099
|
PkDgRowComponent,
|
|
1064
|
-
|
|
1100
|
+
PkDgColumnComponent,
|
|
1065
1101
|
PkDgFooterComponent,
|
|
1066
1102
|
PkDgPaginationComponent,
|
|
1067
1103
|
PkDgPageSizeComponent,
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1104
|
+
PkDgRowExpandComponent,
|
|
1105
|
+
PkDgActionComponent,
|
|
1106
|
+
PkDgRowsDirective,
|
|
1107
|
+
PkDgRowIsExpandDirective,
|
|
1071
1108
|
NowrapDirective
|
|
1072
1109
|
],
|
|
1073
1110
|
imports: [
|
|
@@ -1077,15 +1114,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1077
1114
|
],
|
|
1078
1115
|
exports: [
|
|
1079
1116
|
PkDatagridComponent,
|
|
1080
|
-
|
|
1117
|
+
PkDgHeaderComponent,
|
|
1081
1118
|
PkDgRowComponent,
|
|
1082
|
-
|
|
1119
|
+
PkDgColumnComponent,
|
|
1083
1120
|
PkDgFooterComponent,
|
|
1084
1121
|
PkDgPaginationComponent,
|
|
1085
1122
|
PkDgPageSizeComponent,
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1123
|
+
PkDgRowExpandComponent,
|
|
1124
|
+
PkDgActionComponent,
|
|
1125
|
+
PkDgRowsDirective,
|
|
1126
|
+
PkDgRowIsExpandDirective,
|
|
1089
1127
|
NowrapDirective,
|
|
1090
1128
|
PkIcon
|
|
1091
1129
|
]
|
|
@@ -3122,5 +3160,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
3122
3160
|
* Generated bundle index. Do not edit.
|
|
3123
3161
|
*/
|
|
3124
3162
|
|
|
3125
|
-
export { DatepickerService, HolidayService, NowrapDirective, PK_ICONS, PkAlert, PkAlertService, PkAutocompleteComponent, PkDatagridComponent, PkDatagridModule, PkDatepickerComponent,
|
|
3163
|
+
export { DatepickerService, HolidayService, NowrapDirective, PK_ICONS, PkAlert, PkAlertService, PkAutocompleteComponent, PkDatagridComponent, PkDatagridModule, PkDatepickerComponent, PkDgActionComponent, PkDgColumnComponent, PkDgFooterComponent, PkDgHeaderComponent, PkDgPageSizeComponent, PkDgPaginationComponent, PkDgRowComponent, PkDgRowExpandComponent, PkDgRowIsExpandDirective, PkDgRowsDirective, PkIcon, PkModal, PkModalBody, PkModalFooter, PkModalHeader, PkProgressComponent, PkSelectComponent, PkTab, PkTabs, PkToastr, PkToastrService, PkTreeviewComponent, PkTreeviewModule, PkTreeviewNodeComponent, PkTypeaheadComponent };
|
|
3126
3164
|
//# sourceMappingURL=ngx-pk-ui.mjs.map
|