@konce-pt/angular 0.7.6 → 0.7.7
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/CHANGELOG.md +92 -0
- package/fesm2022/konce-pt-angular-charts.mjs +2 -2
- package/fesm2022/konce-pt-angular-charts.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-map.mjs +51 -20
- package/fesm2022/konce-pt-angular-map.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-roadmap.mjs +5 -5
- package/fesm2022/konce-pt-angular-roadmap.mjs.map +1 -1
- package/fesm2022/konce-pt-angular.mjs +652 -232
- package/fesm2022/konce-pt-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/avatar/llms.txt +5 -0
- package/src/lib/avatar-group/llms.txt +3 -0
- package/src/lib/data-table/llms.txt +84 -4
- package/src/lib/datepicker/llms.txt +5 -0
- package/src/lib/icon/llms.txt +4 -1
- package/src/lib/input-number/llms.txt +11 -6
- package/src/lib/knob/llms.txt +5 -2
- package/src/lib/rich-text/llms.txt +3 -0
- package/src/lib/select/llms.txt +5 -0
- package/src/lib/slider/llms.txt +6 -1
- package/types/konce-pt-angular-map.d.ts +2 -1
- package/types/konce-pt-angular-map.d.ts.map +1 -1
- package/types/konce-pt-angular.d.ts +152 -18
- package/types/konce-pt-angular.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, model, output, signal, Injectable, inject, ElementRef, effect, InjectionToken, PLATFORM_ID, DestroyRef, makeEnvironmentProviders, contentChild, afterNextRender, forwardRef, numberAttribute, viewChild, Directive, TemplateRef, contentChildren, viewChildren, afterRenderEffect, linkedSignal } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, model, output, signal, Injectable, inject, ElementRef, effect, InjectionToken, PLATFORM_ID, DestroyRef, makeEnvironmentProviders, contentChild, afterNextRender, untracked, forwardRef, numberAttribute, viewChild, Directive, TemplateRef, contentChildren, viewChildren, afterRenderEffect, linkedSignal } from '@angular/core';
|
|
3
3
|
import { CdkOverlayOrigin, CdkConnectedOverlay, OverlayContainer } from '@angular/cdk/overlay';
|
|
4
4
|
import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
|
|
@@ -308,8 +308,48 @@ const KPT_ICONS = {
|
|
|
308
308
|
'share': '<path d="M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M8.7 10.7l6.6 -3.4" /> <path d="M8.7 13.3l6.6 3.4" />',
|
|
309
309
|
'external-link': '<path d="M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6" /> <path d="M11 13l9 -9" /> <path d="M15 4h5v5" />',
|
|
310
310
|
'crosshair': '<path d="M4 12h4" /> <path d="M16 12h4" /> <path d="M12 4v4" /> <path d="M12 16v4" /> <path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" />',
|
|
311
|
+
'adjustments-horizontal': '<path d="M12 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> <path d="M4 6l8 0" /> <path d="M16 6l4 0" /> <path d="M6 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> <path d="M4 12l2 0" /> <path d="M10 12l10 0" /> <path d="M15 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> <path d="M4 18l11 0" /> <path d="M19 18l1 0" />',
|
|
311
312
|
};
|
|
312
313
|
|
|
314
|
+
// Allowlist SVG dla treści przechodzącej przez `register()` — sam rejestr trafia bez sanitizera
|
|
315
|
+
// wprost do `innerHTML` (`icon.component.ts`, markery mapy), więc runtime'owe wywołanie `register()`
|
|
316
|
+
// z niezaufaną treścią (CMS/API/upload) byłoby DOM XSS. Wbudowany `KPT_ICONS` (build-time, zaufany)
|
|
317
|
+
// nie przechodzi przez ten filtr. Zestaw tagów/atrybutów pokrywa 100% wbudowanych ikon i pełnego
|
|
318
|
+
// zestawu Tabler (5130) — oba używają wyłącznie `<path d/fill/opacity/stroke>` — więc sanitizacja
|
|
319
|
+
// jest dla nich no-opem.
|
|
320
|
+
const ALLOWED_SVG_TAGS = new Set([
|
|
321
|
+
'path', 'circle', 'rect', 'g', 'line', 'polygon', 'polyline', 'ellipse',
|
|
322
|
+
]);
|
|
323
|
+
const ALLOWED_SVG_ATTRS = new Set([
|
|
324
|
+
'd', 'cx', 'cy', 'r', 'rx', 'ry', 'x', 'y', 'x1', 'y1', 'x2', 'y2', 'width', 'height', 'points',
|
|
325
|
+
'fill', 'stroke', 'stroke-width', 'stroke-linecap', 'stroke-linejoin', 'opacity', 'transform',
|
|
326
|
+
]);
|
|
327
|
+
/**
|
|
328
|
+
* Sanityzuje fragment SVG do allowlisty tagów/atrybutów geometrii — patrz komentarz wyżej.
|
|
329
|
+
*
|
|
330
|
+
* Fragment MUSI być parsowany owinięty w `<svg>` — parser HTML przełącza się w tryb „foreign
|
|
331
|
+
* content" dopiero po napotkaniu tagu `<svg>`, dopiero wtedy składnia samozamykająca (`<path .../>`)
|
|
332
|
+
* jest respektowana. Bez wrappera `<path d="…" />` zostaje w zwykłym trybie HTML, gdzie `path` nie
|
|
333
|
+
* jest elementem pustym — kolejne rodzeństwo trafiłoby jako jego DZIECKO zamiast obok niego.
|
|
334
|
+
*/
|
|
335
|
+
function sanitizeSvgFragment(svg) {
|
|
336
|
+
const tpl = document.createElement('template');
|
|
337
|
+
tpl.innerHTML = `<svg>${svg}</svg>`;
|
|
338
|
+
const root = tpl.content.firstElementChild;
|
|
339
|
+
if (!root)
|
|
340
|
+
return '';
|
|
341
|
+
for (const el of Array.from(root.querySelectorAll('*'))) {
|
|
342
|
+
if (!ALLOWED_SVG_TAGS.has(el.tagName.toLowerCase())) {
|
|
343
|
+
el.remove();
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
for (const attr of Array.from(el.attributes)) {
|
|
347
|
+
if (!ALLOWED_SVG_ATTRS.has(attr.name.toLowerCase()))
|
|
348
|
+
el.removeAttribute(attr.name);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return root.innerHTML;
|
|
352
|
+
}
|
|
313
353
|
/**
|
|
314
354
|
* Rejestr ikon dla `kpt-icon`. Zawiera wbudowany zestaw (używany przez komponenty).
|
|
315
355
|
* Aby dodać pełny zestaw Tabler (5130 ikon), użyj `provideKptTablerIcons()`
|
|
@@ -323,10 +363,17 @@ class KptIconRegistry {
|
|
|
323
363
|
/** Rośnie po każdej rejestracji — pozwala `kpt-icon` reagować na późne dodanie ikon. */
|
|
324
364
|
this.version = this._version.asReadonly();
|
|
325
365
|
}
|
|
326
|
-
/**
|
|
366
|
+
/**
|
|
367
|
+
* Rejestruje (lub nadpisuje) ikony: `{ nazwa: 'inner svg' }`.
|
|
368
|
+
*
|
|
369
|
+
* Treść jest sanityzowana do allowlisty geometrii SVG (`path`/`circle`/`rect`/`g`/`line`/
|
|
370
|
+
* `polygon`/`polyline`/`ellipse` i ich atrybutów kształtu/stylu) — mimo to `register()` wolno
|
|
371
|
+
* wołać wyłącznie z treścią kontrolowaną przez developera (build-time), nigdy bezpośrednio
|
|
372
|
+
* z danych runtime/CMS/uploadu bez własnej walidacji domenowej wyżej w stosie.
|
|
373
|
+
*/
|
|
327
374
|
register(icons) {
|
|
328
375
|
for (const [name, svg] of Object.entries(icons)) {
|
|
329
|
-
this.icons.set(name, svg);
|
|
376
|
+
this.icons.set(name, sanitizeSvgFragment(svg));
|
|
330
377
|
}
|
|
331
378
|
this._version.update((v) => v + 1);
|
|
332
379
|
}
|
|
@@ -425,6 +472,11 @@ function KptAvatar_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
425
472
|
/**
|
|
426
473
|
* Awatar — obraz, inicjały (z `name`) lub ikona.
|
|
427
474
|
*
|
|
475
|
+
* `name` trafia do natywnego `title` (podpowiedź spod kursora — inicjały same w sobie
|
|
476
|
+
* nie mówią, kto to jest). Bez `src` awatar dostaje dodatkowo `role="img"` i `aria-label`,
|
|
477
|
+
* a same inicjały są `aria-hidden`, żeby czytnik nie przeczytał „AK" litera po literze.
|
|
478
|
+
* Przy `src` etykietę niesie już `alt` obrazu — nie dublujemy jej.
|
|
479
|
+
*
|
|
428
480
|
* @example
|
|
429
481
|
* <kpt-avatar src="/u/anna.jpg" />
|
|
430
482
|
* <kpt-avatar name="Anna Kowalska" size="lg" />
|
|
@@ -451,12 +503,12 @@ class KptAvatar {
|
|
|
451
503
|
...(ngDevMode ? [{ debugName: "initials" }] : /* istanbul ignore next */ []));
|
|
452
504
|
}
|
|
453
505
|
static { this.ɵfac = function KptAvatar_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptAvatar)(); }; }
|
|
454
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptAvatar, selectors: [["kpt-avatar"]], hostAttrs: [1, "kpt-avatar-host"], inputs: { src: [1, "src"], name: [1, "name"], icon: [1, "icon"], size: [1, "size"], shape: [1, "shape"] }, decls: 4, vars:
|
|
506
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptAvatar, selectors: [["kpt-avatar"]], hostAttrs: [1, "kpt-avatar-host"], inputs: { src: [1, "src"], name: [1, "name"], icon: [1, "icon"], size: [1, "size"], shape: [1, "shape"] }, decls: 4, vars: 6, consts: [[1, "kpt-avatar"], [1, "kpt-avatar__img", 3, "src", "alt"], ["aria-hidden", "true", 1, "kpt-avatar__initials"], [3, "name"]], template: function KptAvatar_Template(rf, ctx) { if (rf & 1) {
|
|
455
507
|
i0.ɵɵelementStart(0, "span", 0);
|
|
456
508
|
i0.ɵɵconditionalCreate(1, KptAvatar_Conditional_1_Template, 1, 2, "img", 1)(2, KptAvatar_Conditional_2_Template, 2, 1, "span", 2)(3, KptAvatar_Conditional_3_Template, 1, 1, "kpt-icon", 3);
|
|
457
509
|
i0.ɵɵelementEnd();
|
|
458
510
|
} if (rf & 2) {
|
|
459
|
-
i0.ɵɵattribute("data-size", ctx.size())("data-shape", ctx.shape());
|
|
511
|
+
i0.ɵɵattribute("data-size", ctx.size())("data-shape", ctx.shape())("title", ctx.name() || null)("role", !ctx.src() && ctx.name() ? "img" : null)("aria-label", !ctx.src() && ctx.name() ? ctx.name() : null);
|
|
460
512
|
i0.ɵɵadvance();
|
|
461
513
|
i0.ɵɵconditional(ctx.src() ? 1 : ctx.name() ? 2 : ctx.icon() ? 3 : -1);
|
|
462
514
|
} }, dependencies: [KptIcon], styles: ["@layer kpt.components{.kpt-avatar-host{display:inline-flex;vertical-align:middle}.kpt-avatar{--%NS%_size: 2.5rem;display:inline-flex;align-items:center;justify-content:center;width:var(--%NS%_size);height:var(--%NS%_size);border-radius:var(--%NS%kpt-radius-full, 9999px);background:var(--%NS%kpt-color-muted);color:var(--%NS%kpt-color-on-muted);font-weight:var(--%NS%kpt-font-weight-semibold, 600);font-size:calc(var(--%NS%_size) * .4);overflow:hidden;-webkit-user-select:none;user-select:none}.kpt-avatar[data-size=sm]{--%NS%_size: 2rem}.kpt-avatar[data-size=md]{--%NS%_size: 2.5rem}.kpt-avatar[data-size=lg]{--%NS%_size: 3rem}.kpt-avatar[data-size=xl]{--%NS%_size: 4rem}.kpt-avatar[data-shape=square]{border-radius:var(--%NS%kpt-radius-md, .5rem)}.kpt-avatar__img{width:100%;height:100%;object-fit:cover}}\n"], encapsulation: 2 }); }
|
|
@@ -464,18 +516,25 @@ class KptAvatar {
|
|
|
464
516
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptAvatar, [{
|
|
465
517
|
type: Component,
|
|
466
518
|
args: [{ selector: 'kpt-avatar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptIcon], template: `
|
|
467
|
-
<span
|
|
519
|
+
<span
|
|
520
|
+
class="kpt-avatar"
|
|
521
|
+
[attr.data-size]="size()"
|
|
522
|
+
[attr.data-shape]="shape()"
|
|
523
|
+
[attr.title]="name() || null"
|
|
524
|
+
[attr.role]="!src() && name() ? 'img' : null"
|
|
525
|
+
[attr.aria-label]="!src() && name() ? name() : null"
|
|
526
|
+
>
|
|
468
527
|
@if (src()) {
|
|
469
528
|
<img class="kpt-avatar__img" [src]="src()" [alt]="name() || ''" />
|
|
470
529
|
} @else if (name()) {
|
|
471
|
-
<span class="kpt-avatar__initials">{{ initials() }}</span>
|
|
530
|
+
<span class="kpt-avatar__initials" aria-hidden="true">{{ initials() }}</span>
|
|
472
531
|
} @else if (icon()) {
|
|
473
532
|
<kpt-icon [name]="icon()!" />
|
|
474
533
|
}
|
|
475
534
|
</span>
|
|
476
535
|
`, host: { class: 'kpt-avatar-host' }, styles: ["@layer kpt.components{.kpt-avatar-host{display:inline-flex;vertical-align:middle}.kpt-avatar{--_size: 2.5rem;display:inline-flex;align-items:center;justify-content:center;width:var(--_size);height:var(--_size);border-radius:var(--kpt-radius-full, 9999px);background:var(--kpt-color-muted);color:var(--kpt-color-on-muted);font-weight:var(--kpt-font-weight-semibold, 600);font-size:calc(var(--_size) * .4);overflow:hidden;-webkit-user-select:none;user-select:none}.kpt-avatar[data-size=sm]{--_size: 2rem}.kpt-avatar[data-size=md]{--_size: 2.5rem}.kpt-avatar[data-size=lg]{--_size: 3rem}.kpt-avatar[data-size=xl]{--_size: 4rem}.kpt-avatar[data-shape=square]{border-radius:var(--kpt-radius-md, .5rem)}.kpt-avatar__img{width:100%;height:100%;object-fit:cover}}\n"] }]
|
|
477
536
|
}], null, { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }] }); })();
|
|
478
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptAvatar, { className: "KptAvatar", filePath: "lib/avatar/avatar.component.ts", lineNumber:
|
|
537
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptAvatar, { className: "KptAvatar", filePath: "lib/avatar/avatar.component.ts", lineNumber: 46 }); })();
|
|
479
538
|
|
|
480
539
|
const _c0$A = ["*"];
|
|
481
540
|
/**
|
|
@@ -675,6 +734,7 @@ const KPT_MESSAGES_EN = {
|
|
|
675
734
|
dateRange: 'Date range',
|
|
676
735
|
min: 'min',
|
|
677
736
|
max: 'max',
|
|
737
|
+
editCell: 'Edit: {column}',
|
|
678
738
|
},
|
|
679
739
|
confirm: {
|
|
680
740
|
header: 'Confirmation',
|
|
@@ -936,6 +996,7 @@ const KPT_MESSAGES_PL = {
|
|
|
936
996
|
dateRange: 'Zakres dat',
|
|
937
997
|
min: 'min',
|
|
938
998
|
max: 'max',
|
|
999
|
+
editCell: 'Edytuj: {column}',
|
|
939
1000
|
},
|
|
940
1001
|
confirm: {
|
|
941
1002
|
header: 'Potwierdzenie',
|
|
@@ -2499,7 +2560,11 @@ class KptSelect {
|
|
|
2499
2560
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2500
2561
|
this.touch = output();
|
|
2501
2562
|
this.i18n = inject(KptI18n);
|
|
2502
|
-
|
|
2563
|
+
/**
|
|
2564
|
+
* Stan panelu (dwukierunkowy). Pozwala otworzyć listę z zewnątrz i — co ważniejsze — wiedzieć,
|
|
2565
|
+
* kiedy user skończył wybierać. `touch` się do tego nie nadaje: leci też z blur triggera.
|
|
2566
|
+
*/
|
|
2567
|
+
this.open = model(false, /* @ts-ignore */
|
|
2503
2568
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
2504
2569
|
this.filterText = signal('', /* @ts-ignore */
|
|
2505
2570
|
...(ngDevMode ? [{ debugName: "filterText" }] : /* istanbul ignore next */ []));
|
|
@@ -2535,6 +2600,17 @@ class KptSelect {
|
|
|
2535
2600
|
*/
|
|
2536
2601
|
this.filled = computed(() => this.selectedOptions().length > 0, /* @ts-ignore */
|
|
2537
2602
|
...(ngDevMode ? [{ debugName: "filled" }] : /* istanbul ignore next */ []));
|
|
2603
|
+
// Panel może zostać otwarty także z zewnątrz (`[open]`), nie tylko klikiem w trigger —
|
|
2604
|
+
// filtr i aktywną pozycję resetujemy więc przy każdym otwarciu, nie w `toggleOpen()`.
|
|
2605
|
+
effect(() => {
|
|
2606
|
+
const isOpen = this.open();
|
|
2607
|
+
untracked(() => {
|
|
2608
|
+
if (!isOpen)
|
|
2609
|
+
return;
|
|
2610
|
+
this.filterText.set('');
|
|
2611
|
+
this.activeIndex.set(-1);
|
|
2612
|
+
});
|
|
2613
|
+
});
|
|
2538
2614
|
}
|
|
2539
2615
|
isSelected(opt) {
|
|
2540
2616
|
return this.selectedValues().includes(opt.value);
|
|
@@ -2543,10 +2619,6 @@ class KptSelect {
|
|
|
2543
2619
|
if (this.disabled())
|
|
2544
2620
|
return;
|
|
2545
2621
|
this.open.update((o) => !o);
|
|
2546
|
-
if (this.open()) {
|
|
2547
|
-
this.filterText.set('');
|
|
2548
|
-
this.activeIndex.set(-1);
|
|
2549
|
-
}
|
|
2550
2622
|
}
|
|
2551
2623
|
close() {
|
|
2552
2624
|
if (!this.open())
|
|
@@ -2609,7 +2681,7 @@ class KptSelect {
|
|
|
2609
2681
|
}
|
|
2610
2682
|
}
|
|
2611
2683
|
static { this.ɵfac = function KptSelect_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptSelect)(); }; }
|
|
2612
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSelect, selectors: [["kpt-select"]], hostAttrs: [1, "kpt-select-host"], inputs: { options: [1, "options"], placeholder: [1, "placeholder"], multiple: [1, "multiple"], filter: [1, "filter"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], value: [1, "value"] }, outputs: { value: "valueChange", touch: "touch" }, features: [i0.ɵɵProvidersFeature([{ provide: KPT_FORM_FIELD_CONTROL, useExisting: forwardRef(() => KptSelect) }])], decls: 8, vars: 14, consts: [["trigger", "cdkOverlayOrigin"], ["cdkOverlayOrigin", "", "role", "combobox", "tabindex", "0", 1, "kpt-select", 3, "click", "keydown", "blur"], [1, "kpt-select__value"], [1, "kpt-select__single"], [1, "kpt-select__placeholder"], ["name", "chevron-down", 1, "kpt-select__chevron"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayWidth"], [1, "kpt-select__chip"], ["type", "button", 1, "kpt-select__chip-remove", 3, "click"], ["name", "x"], [1, "kpt-select__panel", 3, "keydown"], [1, "kpt-select__search"], ["role", "listbox", 1, "kpt-select__list"], ["role", "option", 1, "kpt-select__option", 3, "kpt-select__option--selected", "kpt-select__option--active", "kpt-select__option--disabled"], [1, "kpt-select__empty"], ["name", "search"], ["type", "text", 1, "kpt-select__search-input", 3, "input", "value"], ["role", "option", 1, "kpt-select__option", 3, "click", "mouseenter"], [1, "kpt-select__check", 3, "is-on"], [1, "kpt-select__option-label"], ["name", "check", 1, "kpt-select__option-tick"], [1, "kpt-select__check"], ["name", "check"]], template: function KptSelect_Template(rf, ctx) { if (rf & 1) {
|
|
2684
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSelect, selectors: [["kpt-select"]], hostAttrs: [1, "kpt-select-host"], inputs: { options: [1, "options"], placeholder: [1, "placeholder"], multiple: [1, "multiple"], filter: [1, "filter"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], value: [1, "value"], open: [1, "open"] }, outputs: { value: "valueChange", touch: "touch", open: "openChange" }, features: [i0.ɵɵProvidersFeature([{ provide: KPT_FORM_FIELD_CONTROL, useExisting: forwardRef(() => KptSelect) }])], decls: 8, vars: 14, consts: [["trigger", "cdkOverlayOrigin"], ["cdkOverlayOrigin", "", "role", "combobox", "tabindex", "0", 1, "kpt-select", 3, "click", "keydown", "blur"], [1, "kpt-select__value"], [1, "kpt-select__single"], [1, "kpt-select__placeholder"], ["name", "chevron-down", 1, "kpt-select__chevron"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayWidth"], [1, "kpt-select__chip"], ["type", "button", 1, "kpt-select__chip-remove", 3, "click"], ["name", "x"], [1, "kpt-select__panel", 3, "keydown"], [1, "kpt-select__search"], ["role", "listbox", 1, "kpt-select__list"], ["role", "option", 1, "kpt-select__option", 3, "kpt-select__option--selected", "kpt-select__option--active", "kpt-select__option--disabled"], [1, "kpt-select__empty"], ["name", "search"], ["type", "text", 1, "kpt-select__search-input", 3, "input", "value"], ["role", "option", 1, "kpt-select__option", 3, "click", "mouseenter"], [1, "kpt-select__check", 3, "is-on"], [1, "kpt-select__option-label"], ["name", "check", 1, "kpt-select__option-tick"], [1, "kpt-select__check"], ["name", "check"]], template: function KptSelect_Template(rf, ctx) { if (rf & 1) {
|
|
2613
2685
|
i0.ɵɵelementStart(0, "div", 1, 0);
|
|
2614
2686
|
i0.ɵɵlistener("click", function KptSelect_Template_div_click_0_listener() { return ctx.toggleOpen(); })("keydown", function KptSelect_Template_div_keydown_0_listener($event) { return ctx.onTriggerKeydown($event); })("blur", function KptSelect_Template_div_blur_0_listener() { return ctx.touch.emit(); });
|
|
2615
2687
|
i0.ɵɵelementStart(2, "div", 2);
|
|
@@ -2632,8 +2704,8 @@ class KptSelect {
|
|
|
2632
2704
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptSelect, [{
|
|
2633
2705
|
type: Component,
|
|
2634
2706
|
args: [{ selector: 'kpt-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CdkOverlayOrigin, CdkConnectedOverlay, KptIcon], host: { class: 'kpt-select-host' }, providers: [{ provide: KPT_FORM_FIELD_CONTROL, useExisting: forwardRef(() => KptSelect) }], template: "<div\n class=\"kpt-select\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n role=\"combobox\"\n tabindex=\"0\"\n [class.kpt-select--open]=\"open()\"\n [class.kpt-select--disabled]=\"disabled()\"\n [class.kpt-select--invalid]=\"showInvalid()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-disabled]=\"disabled() || null\"\n (click)=\"toggleOpen()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (blur)=\"touch.emit()\"\n>\n <div class=\"kpt-select__value\">\n @if (multiple() && selectedOptions().length) {\n @for (opt of selectedOptions(); track opt.value) {\n <span class=\"kpt-select__chip\">\n {{ opt.label }}\n <button type=\"button\" class=\"kpt-select__chip-remove\" (click)=\"removeChip(opt, $event)\" [attr.aria-label]=\"i18n.t('select.removeChip')\">\n <kpt-icon name=\"x\" />\n </button>\n </span>\n }\n } @else if (!multiple() && filled()) {\n <span class=\"kpt-select__single\">{{ singleLabel() }}</span>\n } @else {\n <span class=\"kpt-select__placeholder\">{{ placeholder() }}</span>\n }\n </div>\n <kpt-icon class=\"kpt-select__chevron\" name=\"chevron-down\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div class=\"kpt-select__panel\" (keydown)=\"onPanelKeydown($event)\">\n @if (filter()) {\n <div class=\"kpt-select__search\">\n <kpt-icon name=\"search\" />\n <input\n type=\"text\"\n class=\"kpt-select__search-input\"\n [value]=\"filterText()\"\n (input)=\"onFilterInput($event)\"\n [attr.placeholder]=\"i18n.t('select.search')\"\n />\n </div>\n }\n <ul class=\"kpt-select__list\" role=\"listbox\" [attr.aria-multiselectable]=\"multiple()\">\n @for (opt of filteredOptions(); track opt.value; let i = $index) {\n <li\n class=\"kpt-select__option\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(opt)\"\n [class.kpt-select__option--selected]=\"isSelected(opt)\"\n [class.kpt-select__option--active]=\"i === activeIndex()\"\n [class.kpt-select__option--disabled]=\"opt.disabled\"\n (click)=\"pick(opt)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (multiple()) {\n <span class=\"kpt-select__check\" [class.is-on]=\"isSelected(opt)\"><kpt-icon name=\"check\" /></span>\n }\n <span class=\"kpt-select__option-label\">{{ opt.label }}</span>\n @if (!multiple() && isSelected(opt)) {\n <kpt-icon class=\"kpt-select__option-tick\" name=\"check\" />\n }\n </li>\n } @empty {\n <li class=\"kpt-select__empty\">{{ i18n.t('select.noResults') }}</li>\n }\n </ul>\n </div>\n</ng-template>\n", styles: ["@layer kpt.components{.kpt-select-host{display:block}.kpt-select{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);min-height:2.5rem;padding:.35rem var(--kpt-space-3, .75rem);box-sizing:border-box;border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-form-field-radius, .5rem);background:var(--kpt-form-field-bg);color:var(--kpt-form-field-text);font-size:var(--kpt-font-size-sm, .875rem);cursor:pointer;transition:border-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-select:hover:not(.kpt-select--disabled){border-color:var(--kpt-form-field-border-hover)}.kpt-select:focus-visible,.kpt-select.kpt-select--open{outline:none;border-color:var(--kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-focus) 30%,transparent)}.kpt-select.kpt-select--invalid{border-color:var(--kpt-form-field-border-error)}.kpt-select.kpt-select--disabled{cursor:not-allowed;opacity:.6;background:var(--kpt-color-surface-variant)}.kpt-select__value{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.kpt-select__placeholder{color:var(--kpt-form-field-placeholder)}.kpt-select__single{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kpt-select__chip{display:inline-flex;align-items:center;gap:.25rem;padding:.1rem .25rem .1rem .5rem;border-radius:var(--kpt-radius-sm, .25rem);background:var(--kpt-color-muted);color:var(--kpt-color-on-muted);font-size:var(--kpt-font-size-xs, .75rem)}.kpt-select__chip-remove{display:inline-flex;border:0;background:none;cursor:pointer;color:inherit;padding:0;opacity:.7}.kpt-select__chip-remove:hover{opacity:1}.kpt-select__chevron{color:var(--kpt-color-on-surface-muted);transition:transform var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-select.kpt-select--open .kpt-select__chevron{transform:rotate(180deg)}.kpt-select__panel{background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);box-shadow:var(--kpt-elevation-3);overflow:hidden;font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-color-on-surface)}.kpt-select__search{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);padding:var(--kpt-space-2, .5rem) var(--kpt-space-3, .75rem);border-bottom:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);color:var(--kpt-color-on-surface-muted)}.kpt-select__search-input{flex:1;min-width:0;border:0;background:none;outline:none;color:var(--kpt-color-on-surface);font:inherit}.kpt-select__search-input::placeholder{color:var(--kpt-color-on-surface-muted)}.kpt-select__list{list-style:none;margin:0;padding:.25rem;max-height:15rem;overflow-y:auto}.kpt-select__option{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);padding:.45rem .6rem;border-radius:var(--kpt-radius-sm, .25rem);cursor:pointer}.kpt-select__option--active{background:var(--kpt-color-surface-variant)}.kpt-select__option--selected{color:var(--kpt-color-on-surface);font-weight:var(--kpt-font-weight-medium, 500)}.kpt-select__option--disabled{opacity:.45;cursor:not-allowed}.kpt-select__option-label{flex:1;min-width:0}.kpt-select__option-tick{color:var(--kpt-color-primary)}.kpt-select__check{display:inline-flex;align-items:center;justify-content:center;width:1.05rem;height:1.05rem;flex-shrink:0;border:var(--kpt-border-width-medium, 2px) solid var(--kpt-form-field-border);border-radius:var(--kpt-radius-sm, .25rem);color:var(--kpt-color-on-primary);font-size:.7rem}.kpt-select__check kpt-icon{opacity:0}.kpt-select__check.is-on{background:var(--kpt-color-primary);border-color:var(--kpt-color-primary)}.kpt-select__check.is-on kpt-icon{opacity:1}.kpt-select__empty{list-style:none;padding:.75rem .6rem;color:var(--kpt-color-on-surface-muted);text-align:center}}\n"] }]
|
|
2635
|
-
}],
|
|
2636
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSelect, { className: "KptSelect", filePath: "lib/select/select.component.ts", lineNumber:
|
|
2707
|
+
}], () => [], { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], touch: [{ type: i0.Output, args: ["touch"] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }] }); })();
|
|
2708
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSelect, { className: "KptSelect", filePath: "lib/select/select.component.ts", lineNumber: 42 }); })();
|
|
2637
2709
|
|
|
2638
2710
|
/*
|
|
2639
2711
|
* Pomocniki nazw dni/miesięcy wyliczane z `Intl` — sterowane bieżącym locale i18n.
|
|
@@ -3374,7 +3446,11 @@ class KptDatepicker {
|
|
|
3374
3446
|
...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
|
|
3375
3447
|
this.months = computed(() => monthNames(this.i18n.locale()), /* @ts-ignore */
|
|
3376
3448
|
...(ngDevMode ? [{ debugName: "months" }] : /* istanbul ignore next */ []));
|
|
3377
|
-
|
|
3449
|
+
/**
|
|
3450
|
+
* Stan kalendarza (dwukierunkowy). Pozwala otworzyć go z zewnątrz i — co ważniejsze — wiedzieć,
|
|
3451
|
+
* kiedy user skończył wybierać. `touch` się do tego nie nadaje: leci też z blur triggera.
|
|
3452
|
+
*/
|
|
3453
|
+
this.open = model(false, /* @ts-ignore */
|
|
3378
3454
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
3379
3455
|
this.today = new Date();
|
|
3380
3456
|
this.view = signal({ y: this.today.getFullYear(), m: this.today.getMonth() }, /* @ts-ignore */
|
|
@@ -3510,6 +3586,18 @@ class KptDatepicker {
|
|
|
3510
3586
|
});
|
|
3511
3587
|
}, /* @ts-ignore */
|
|
3512
3588
|
...(ngDevMode ? [{ debugName: "yearCells" }] : /* istanbul ignore next */ []));
|
|
3589
|
+
// Kalendarz może zostać otwarty także z zewnątrz (`[open]`), nie tylko klikiem w trigger —
|
|
3590
|
+
// widok i bufor czasu ustawiamy więc przy każdym otwarciu, nie w `toggleOpen()`.
|
|
3591
|
+
effect(() => {
|
|
3592
|
+
const isOpen = this.open();
|
|
3593
|
+
untracked(() => {
|
|
3594
|
+
if (!isOpen)
|
|
3595
|
+
return;
|
|
3596
|
+
this.view.set(this.initialView());
|
|
3597
|
+
this.syncTimeFromValue();
|
|
3598
|
+
this.dtView.set(this.selectionMode() === 'time' ? 'clock' : 'calendar');
|
|
3599
|
+
});
|
|
3600
|
+
});
|
|
3513
3601
|
}
|
|
3514
3602
|
// ── Prezentacja czasu ──
|
|
3515
3603
|
formatTime(h, m) {
|
|
@@ -3593,11 +3681,6 @@ class KptDatepicker {
|
|
|
3593
3681
|
toggleOpen() {
|
|
3594
3682
|
if (this.disabled())
|
|
3595
3683
|
return;
|
|
3596
|
-
if (!this.open()) {
|
|
3597
|
-
this.view.set(this.initialView());
|
|
3598
|
-
this.syncTimeFromValue();
|
|
3599
|
-
this.dtView.set(this.selectionMode() === 'time' ? 'clock' : 'calendar');
|
|
3600
|
-
}
|
|
3601
3684
|
this.open.update((o) => !o);
|
|
3602
3685
|
}
|
|
3603
3686
|
close() {
|
|
@@ -3666,7 +3749,7 @@ class KptDatepicker {
|
|
|
3666
3749
|
this.pendingDate.set('');
|
|
3667
3750
|
}
|
|
3668
3751
|
static { this.ɵfac = function KptDatepicker_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptDatepicker)(); }; }
|
|
3669
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptDatepicker, selectors: [["kpt-datepicker"]], hostAttrs: [1, "kpt-datepicker-host"], inputs: { value: [1, "value"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], placeholder: [1, "placeholder"], ariaLabel: [1, "ariaLabel"], displayFormat: [1, "displayFormat"], selectionMode: [1, "selectionMode"], monthDisplay: [1, "monthDisplay"], hourFormat: [1, "hourFormat"], minuteStep: [1, "minuteStep"], minDate: [1, "minDate"], maxDate: [1, "maxDate"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 8, vars: 15, consts: [["trigger", "cdkOverlayOrigin"], ["cdkOverlayOrigin", "", "role", "button", "tabindex", "0", 1, "kpt-datepicker", 3, "click", "keydown.enter", "blur"], [1, "kpt-datepicker__value"], [1, "kpt-datepicker__placeholder"], [1, "kpt-datepicker__spacer"], ["type", "button", 1, "kpt-datepicker__clear"], [1, "kpt-datepicker__icon", 3, "name"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["type", "button", 1, "kpt-datepicker__clear", 3, "click"], ["name", "x"], [1, "kpt-calendar", 3, "keydown.escape"], [3, "valueChange", "value", "hourFormat", "minuteStep"], [1, "kpt-calendar__footer"], ["size", "sm", 3, "click"], [1, "kpt-calendar__header"], ["type", "button", 1, "kpt-calendar__nav", 3, "click"], ["name", "chevron-left"], [1, "kpt-calendar__title"], ["name", "chevron-right"], [1, "kpt-calendar__weekdays"], [1, "kpt-calendar__weekday"], [1, "kpt-calendar__grid"], ["type", "button", 1, "kpt-calendar__timebar", 3, "click"], ["name", "clock"], ["type", "button", 1, "kpt-calendar__day", 3, "kpt-calendar__day--muted", "kpt-calendar__day--today", "kpt-calendar__day--selected", "disabled"], ["type", "button", 1, "kpt-calendar__day", 3, "click", "disabled"], [1, "kpt-calendar__grid", "kpt-calendar__grid--cells"], ["type", "button", 1, "kpt-calendar__cell", 3, "kpt-calendar__cell--selected", "disabled"], ["type", "button", 1, "kpt-calendar__cell", 3, "click", "disabled"], ["type", "button", 1, "kpt-calendar__cell", 3, "kpt-calendar__cell--selected"], ["type", "button", 1, "kpt-calendar__cell", 3, "click"]], template: function KptDatepicker_Template(rf, ctx) { if (rf & 1) {
|
|
3752
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptDatepicker, selectors: [["kpt-datepicker"]], hostAttrs: [1, "kpt-datepicker-host"], inputs: { value: [1, "value"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], placeholder: [1, "placeholder"], ariaLabel: [1, "ariaLabel"], displayFormat: [1, "displayFormat"], selectionMode: [1, "selectionMode"], monthDisplay: [1, "monthDisplay"], hourFormat: [1, "hourFormat"], minuteStep: [1, "minuteStep"], minDate: [1, "minDate"], maxDate: [1, "maxDate"], open: [1, "open"] }, outputs: { value: "valueChange", touch: "touch", open: "openChange" }, decls: 8, vars: 15, consts: [["trigger", "cdkOverlayOrigin"], ["cdkOverlayOrigin", "", "role", "button", "tabindex", "0", 1, "kpt-datepicker", 3, "click", "keydown.enter", "blur"], [1, "kpt-datepicker__value"], [1, "kpt-datepicker__placeholder"], [1, "kpt-datepicker__spacer"], ["type", "button", 1, "kpt-datepicker__clear"], [1, "kpt-datepicker__icon", 3, "name"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["type", "button", 1, "kpt-datepicker__clear", 3, "click"], ["name", "x"], [1, "kpt-calendar", 3, "keydown.escape"], [3, "valueChange", "value", "hourFormat", "minuteStep"], [1, "kpt-calendar__footer"], ["size", "sm", 3, "click"], [1, "kpt-calendar__header"], ["type", "button", 1, "kpt-calendar__nav", 3, "click"], ["name", "chevron-left"], [1, "kpt-calendar__title"], ["name", "chevron-right"], [1, "kpt-calendar__weekdays"], [1, "kpt-calendar__weekday"], [1, "kpt-calendar__grid"], ["type", "button", 1, "kpt-calendar__timebar", 3, "click"], ["name", "clock"], ["type", "button", 1, "kpt-calendar__day", 3, "kpt-calendar__day--muted", "kpt-calendar__day--today", "kpt-calendar__day--selected", "disabled"], ["type", "button", 1, "kpt-calendar__day", 3, "click", "disabled"], [1, "kpt-calendar__grid", "kpt-calendar__grid--cells"], ["type", "button", 1, "kpt-calendar__cell", 3, "kpt-calendar__cell--selected", "disabled"], ["type", "button", 1, "kpt-calendar__cell", 3, "click", "disabled"], ["type", "button", 1, "kpt-calendar__cell", 3, "kpt-calendar__cell--selected"], ["type", "button", 1, "kpt-calendar__cell", 3, "click"]], template: function KptDatepicker_Template(rf, ctx) { if (rf & 1) {
|
|
3670
3753
|
i0.ɵɵelementStart(0, "div", 1, 0);
|
|
3671
3754
|
i0.ɵɵlistener("click", function KptDatepicker_Template_div_click_0_listener() { return ctx.toggleOpen(); })("keydown.enter", function KptDatepicker_Template_div_keydown_enter_0_listener() { return ctx.toggleOpen(); })("blur", function KptDatepicker_Template_div_blur_0_listener() { return ctx.touch.emit(); });
|
|
3672
3755
|
i0.ɵɵconditionalCreate(2, KptDatepicker_Conditional_2_Template, 2, 1, "span", 2)(3, KptDatepicker_Conditional_3_Template, 2, 1, "span", 3);
|
|
@@ -3693,8 +3776,8 @@ class KptDatepicker {
|
|
|
3693
3776
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptDatepicker, [{
|
|
3694
3777
|
type: Component,
|
|
3695
3778
|
args: [{ selector: 'kpt-datepicker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CdkOverlayOrigin, CdkConnectedOverlay, KptIcon, KptButton, KptClock], host: { class: 'kpt-datepicker-host' }, template: "<div\n class=\"kpt-datepicker\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n role=\"button\"\n tabindex=\"0\"\n [class.kpt-datepicker--open]=\"open()\"\n [class.kpt-datepicker--disabled]=\"disabled()\"\n [class.kpt-datepicker--invalid]=\"showInvalid()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-label]=\"ariaLabel()\"\n (click)=\"toggleOpen()\"\n (keydown.enter)=\"toggleOpen()\"\n (blur)=\"touch.emit()\"\n>\n @if (display()) {\n <span class=\"kpt-datepicker__value\">{{ display() }}</span>\n } @else {\n <span class=\"kpt-datepicker__placeholder\">{{ effectivePlaceholder() }}</span>\n }\n <span class=\"kpt-datepicker__spacer\"></span>\n @if (display()) {\n <button type=\"button\" class=\"kpt-datepicker__clear\" (click)=\"clear($event)\" [attr.aria-label]=\"i18n.t('common.clear')\"><kpt-icon name=\"x\" /></button>\n }\n <kpt-icon\n class=\"kpt-datepicker__icon\"\n [name]=\"selectionMode() === 'time' ? 'clock' : 'calendar'\"\n />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div class=\"kpt-calendar\" [class.kpt-calendar--clock]=\"selectionMode() === 'time' || (selectionMode() === 'datetime' && dtView() === 'clock')\" (keydown.escape)=\"close()\">\n @switch (selectionMode()) {\n @case ('time') {\n <kpt-clock [(value)]=\"timeStr\" [hourFormat]=\"hourFormat()\" [minuteStep]=\"minuteStep()\" />\n <div class=\"kpt-calendar__footer\">\n <kpt-button size=\"sm\" (click)=\"commit()\">{{ i18n.t('common.done') }}</kpt-button>\n </div>\n }\n @case ('datetime') {\n @if (dtView() === 'calendar') {\n <div class=\"kpt-calendar__header\">\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"prevMonth()\" [attr.aria-label]=\"i18n.t('datepicker.prevMonth')\"><kpt-icon name=\"chevron-left\" /></button>\n <span class=\"kpt-calendar__title\">{{ monthLabel() }}</span>\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"nextMonth()\" [attr.aria-label]=\"i18n.t('datepicker.nextMonth')\"><kpt-icon name=\"chevron-right\" /></button>\n </div>\n <div class=\"kpt-calendar__weekdays\">\n @for (wd of weekdays(); track wd) {\n <span class=\"kpt-calendar__weekday\">{{ wd }}</span>\n }\n </div>\n <div class=\"kpt-calendar__grid\">\n @for (week of weeks(); track $index) {\n @for (cell of week; track cell.iso) {\n <button\n type=\"button\"\n class=\"kpt-calendar__day\"\n [class.kpt-calendar__day--muted]=\"!cell.inMonth\"\n [class.kpt-calendar__day--today]=\"cell.today\"\n [class.kpt-calendar__day--selected]=\"cell.selected\"\n [disabled]=\"cell.disabled\"\n [attr.aria-pressed]=\"cell.selected\"\n (click)=\"selectDay(cell)\"\n >{{ cell.day }}</button>\n }\n }\n </div>\n <button type=\"button\" class=\"kpt-calendar__timebar\" (click)=\"openClock()\">\n <kpt-icon name=\"clock\" />\n <span>{{ timeBarLabel() }}</span>\n </button>\n } @else {\n <div class=\"kpt-calendar__header\">\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"backToCalendar()\" [attr.aria-label]=\"i18n.t('datepicker.calendar')\"><kpt-icon name=\"chevron-left\" /></button>\n <span class=\"kpt-calendar__title\">{{ i18n.t('datepicker.time') }}</span>\n </div>\n <kpt-clock [(value)]=\"timeStr\" [hourFormat]=\"hourFormat()\" [minuteStep]=\"minuteStep()\" />\n }\n <div class=\"kpt-calendar__footer\">\n <kpt-button size=\"sm\" (click)=\"commit()\">{{ i18n.t('common.done') }}</kpt-button>\n </div>\n }\n @case ('monthYear') {\n <div class=\"kpt-calendar__header\">\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"prevYear()\" [attr.aria-label]=\"i18n.t('datepicker.prevYear')\"><kpt-icon name=\"chevron-left\" /></button>\n <span class=\"kpt-calendar__title\">{{ viewYear() }}</span>\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"nextYear()\" [attr.aria-label]=\"i18n.t('datepicker.nextYear')\"><kpt-icon name=\"chevron-right\" /></button>\n </div>\n <div class=\"kpt-calendar__grid kpt-calendar__grid--cells\">\n @for (cell of monthCells(); track cell.value) {\n <button\n type=\"button\"\n class=\"kpt-calendar__cell\"\n [class.kpt-calendar__cell--selected]=\"cell.selected\"\n [disabled]=\"cell.disabled\"\n [attr.aria-pressed]=\"cell.selected\"\n (click)=\"selectCell(cell)\"\n >{{ cell.label }}</button>\n }\n </div>\n }\n @case ('year') {\n <div class=\"kpt-calendar__header\">\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"prevYearPage()\" [attr.aria-label]=\"i18n.t('datepicker.prevYears')\"><kpt-icon name=\"chevron-left\" /></button>\n <span class=\"kpt-calendar__title\">{{ yearRangeLabel() }}</span>\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"nextYearPage()\" [attr.aria-label]=\"i18n.t('datepicker.nextYears')\"><kpt-icon name=\"chevron-right\" /></button>\n </div>\n <div class=\"kpt-calendar__grid kpt-calendar__grid--cells\">\n @for (cell of yearCells(); track cell.value) {\n <button\n type=\"button\"\n class=\"kpt-calendar__cell\"\n [class.kpt-calendar__cell--selected]=\"cell.selected\"\n [disabled]=\"cell.disabled\"\n [attr.aria-pressed]=\"cell.selected\"\n (click)=\"selectCell(cell)\"\n >{{ cell.label }}</button>\n }\n </div>\n }\n @case ('month') {\n <div class=\"kpt-calendar__header\">\n <span class=\"kpt-calendar__title\">{{ i18n.t('datepicker.month') }}</span>\n </div>\n <div class=\"kpt-calendar__grid kpt-calendar__grid--cells\">\n @for (cell of monthCells(); track cell.value) {\n <button\n type=\"button\"\n class=\"kpt-calendar__cell\"\n [class.kpt-calendar__cell--selected]=\"cell.selected\"\n [attr.aria-pressed]=\"cell.selected\"\n (click)=\"selectCell(cell)\"\n >{{ cell.label }}</button>\n }\n </div>\n }\n @default {\n <div class=\"kpt-calendar__header\">\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"prevMonth()\" [attr.aria-label]=\"i18n.t('datepicker.prevMonth')\"><kpt-icon name=\"chevron-left\" /></button>\n <span class=\"kpt-calendar__title\">{{ monthLabel() }}</span>\n <button type=\"button\" class=\"kpt-calendar__nav\" (click)=\"nextMonth()\" [attr.aria-label]=\"i18n.t('datepicker.nextMonth')\"><kpt-icon name=\"chevron-right\" /></button>\n </div>\n <div class=\"kpt-calendar__weekdays\">\n @for (wd of weekdays(); track wd) {\n <span class=\"kpt-calendar__weekday\">{{ wd }}</span>\n }\n </div>\n <div class=\"kpt-calendar__grid\">\n @for (week of weeks(); track $index) {\n @for (cell of week; track cell.iso) {\n <button\n type=\"button\"\n class=\"kpt-calendar__day\"\n [class.kpt-calendar__day--muted]=\"!cell.inMonth\"\n [class.kpt-calendar__day--today]=\"cell.today\"\n [class.kpt-calendar__day--selected]=\"cell.selected\"\n [disabled]=\"cell.disabled\"\n [attr.aria-pressed]=\"cell.selected\"\n (click)=\"selectDay(cell)\"\n >{{ cell.day }}</button>\n }\n }\n </div>\n }\n }\n </div>\n</ng-template>\n", styles: ["@layer kpt.components{.kpt-datepicker-host{display:block}.kpt-datepicker{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);height:2.5rem;padding-inline:var(--kpt-space-3, .75rem);box-sizing:border-box;border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-form-field-radius, .5rem);background:var(--kpt-form-field-bg);color:var(--kpt-form-field-text);font-size:var(--kpt-font-size-sm, .875rem);cursor:pointer}.kpt-datepicker:hover:not(.kpt-datepicker--disabled){border-color:var(--kpt-form-field-border-hover)}.kpt-datepicker:focus-visible,.kpt-datepicker.kpt-datepicker--open{outline:none;border-color:var(--kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-focus) 30%,transparent)}.kpt-datepicker.kpt-datepicker--invalid{border-color:var(--kpt-form-field-border-error)}.kpt-datepicker.kpt-datepicker--disabled{cursor:not-allowed;opacity:.6;background:var(--kpt-color-surface-variant)}.kpt-datepicker__placeholder{color:var(--kpt-form-field-placeholder)}.kpt-datepicker__spacer{flex:1}.kpt-datepicker__icon{color:var(--kpt-color-on-surface-muted)}.kpt-datepicker__clear{display:inline-flex;border:0;background:none;cursor:pointer;color:var(--kpt-color-on-surface-muted);padding:0}.kpt-datepicker__clear:hover{color:var(--kpt-color-on-surface)}.kpt-calendar{width:17rem;padding:var(--kpt-space-3, .75rem);background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);box-shadow:var(--kpt-elevation-3);color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm, .875rem)}.kpt-calendar__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--kpt-space-2, .5rem)}.kpt-calendar__title{font-weight:var(--kpt-font-weight-semibold, 600);text-transform:capitalize}.kpt-calendar__nav{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:var(--kpt-radius-md, .5rem);background:none;color:var(--kpt-color-on-surface);cursor:pointer}.kpt-calendar__nav:hover{background:var(--kpt-color-muted)}.kpt-calendar__weekdays,.kpt-calendar__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}.kpt-calendar__weekday{text-align:center;font-size:var(--kpt-font-size-xs, .75rem);color:var(--kpt-color-on-surface-muted);padding:.25rem 0}.kpt-calendar__day{aspect-ratio:1;border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);cursor:pointer;font:inherit}.kpt-calendar__day:hover:not(:disabled){background:var(--kpt-color-muted)}.kpt-calendar__day--muted{color:var(--kpt-color-on-surface-muted);opacity:.5}.kpt-calendar__day--today{box-shadow:inset 0 0 0 1px var(--kpt-color-border-strong)}.kpt-calendar__day--selected{background:var(--kpt-color-primary)!important;color:var(--kpt-color-on-primary)}.kpt-calendar__day:disabled{opacity:.3;cursor:not-allowed}.kpt-calendar__grid--cells{grid-template-columns:repeat(3,1fr);gap:4px}.kpt-calendar__cell{padding:.6rem .25rem;border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);cursor:pointer;font:inherit;text-transform:capitalize}.kpt-calendar__cell:hover:not(:disabled){background:var(--kpt-color-muted)}.kpt-calendar__cell--selected{background:var(--kpt-color-primary)!important;color:var(--kpt-color-on-primary)}.kpt-calendar__cell:disabled{opacity:.3;cursor:not-allowed}.kpt-calendar__timebar{display:flex;align-items:center;justify-content:center;gap:var(--kpt-space-2, .5rem);width:100%;margin-top:var(--kpt-space-2, .5rem);padding:var(--kpt-space-2, .5rem);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);background:none;color:var(--kpt-color-on-surface);font:inherit;font-variant-numeric:tabular-nums;cursor:pointer}.kpt-calendar__timebar:hover{background:var(--kpt-color-muted)}.kpt-calendar__timebar kpt-icon{color:var(--kpt-color-on-surface-muted)}.kpt-calendar__footer{display:flex;justify-content:flex-end;margin-top:var(--kpt-space-3, .75rem)}.kpt-calendar--clock{width:16rem}}\n"] }]
|
|
3696
|
-
}],
|
|
3697
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDatepicker, { className: "KptDatepicker", filePath: "lib/datepicker/datepicker.component.ts", lineNumber:
|
|
3779
|
+
}], () => [], { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], displayFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFormat", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], monthDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "monthDisplay", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }] }); })();
|
|
3780
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDatepicker, { className: "KptDatepicker", filePath: "lib/datepicker/datepicker.component.ts", lineNumber: 68 }); })();
|
|
3698
3781
|
|
|
3699
3782
|
const _c0$u = ["ta"];
|
|
3700
3783
|
/**
|
|
@@ -4413,7 +4496,10 @@ const ALLOWED_STYLES = new Set([
|
|
|
4413
4496
|
'color', 'background-color', 'text-align', 'font-weight', 'font-style', 'text-decoration',
|
|
4414
4497
|
'width', 'height', 'border', 'border-color', 'border-width', 'border-style', 'vertical-align',
|
|
4415
4498
|
]);
|
|
4416
|
-
const ALLOWED_ATTRS = new Set(['colspan', 'rowspan', 'span', 'width', 'class']);
|
|
4499
|
+
const ALLOWED_ATTRS = new Set(['colspan', 'rowspan', 'span', 'width', 'class', 'target', 'rel', 'title']);
|
|
4500
|
+
// Schematy URL dopuszczone w `href` wstawianym narzędziem „link" (blocklista jest obchodzalna).
|
|
4501
|
+
const SAFE_URL_SCHEME = /^(https?:|mailto:|tel:)/i;
|
|
4502
|
+
const HAS_URL_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
4417
4503
|
/**
|
|
4418
4504
|
* Lekki edytor tekstu sformatowanego (contenteditable) z konfigurowalnym paskiem sekcji.
|
|
4419
4505
|
* Narzędzia: schowek (kopiuj / wklej / wklej bez formatowania), styl (nagłówki H1–H6 / paragraf),
|
|
@@ -4508,11 +4594,14 @@ class KptRichText {
|
|
|
4508
4594
|
}, /* @ts-ignore */
|
|
4509
4595
|
...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
|
|
4510
4596
|
// Synchronizuj tylko przy zmianie zewnętrznej (bez resetu kursora podczas pisania).
|
|
4597
|
+
// Porównanie `el.innerHTML !== v` działa na SUROWEJ wartości modelu (tej samej, którą ustawia
|
|
4598
|
+
// `onInput()`), więc pisanie w edytorze nadal nie odpala tej gałęzi — sanityzacja włącza się
|
|
4599
|
+
// wyłącznie przy zewnętrznym zapisie `value` (init, `[(value)]` z aplikacji, `onSource()`).
|
|
4511
4600
|
effect(() => {
|
|
4512
4601
|
const el = this.editor()?.nativeElement;
|
|
4513
4602
|
const v = this.value();
|
|
4514
4603
|
if (el && el.innerHTML !== v)
|
|
4515
|
-
el.innerHTML = v;
|
|
4604
|
+
el.innerHTML = this.sanitizeHtml(v);
|
|
4516
4605
|
});
|
|
4517
4606
|
// Odzwierciedlenie stanu aktywnego narzędzi na podstawie zaznaczenia.
|
|
4518
4607
|
const onSel = () => this.refreshState();
|
|
@@ -4611,8 +4700,11 @@ class KptRichText {
|
|
|
4611
4700
|
switch (item) {
|
|
4612
4701
|
case 'link': {
|
|
4613
4702
|
const url = window.prompt(this.i18n.t('richText.linkPrompt'));
|
|
4614
|
-
if (url)
|
|
4615
|
-
|
|
4703
|
+
if (url) {
|
|
4704
|
+
const safe = this.sanitizeUrl(url);
|
|
4705
|
+
if (safe)
|
|
4706
|
+
document.execCommand('createLink', false, safe);
|
|
4707
|
+
}
|
|
4616
4708
|
break;
|
|
4617
4709
|
}
|
|
4618
4710
|
case 'copy':
|
|
@@ -5177,6 +5269,21 @@ class KptRichText {
|
|
|
5177
5269
|
canSplit() {
|
|
5178
5270
|
return this.canSplitCtx;
|
|
5179
5271
|
}
|
|
5272
|
+
/**
|
|
5273
|
+
* Waliduje URL z narzędzia „link" (blocklista jest obchodzalna, np. `javascript:`).
|
|
5274
|
+
* Brak schematu → dopisz `https://` (spójne z zachowaniem `normalizeUrl` w mapie); `#`/`/`
|
|
5275
|
+
* przechodzą bez zmian; schemat spoza `SAFE_URL_SCHEME` → `null` (link nie zostaje wstawiony).
|
|
5276
|
+
*/
|
|
5277
|
+
sanitizeUrl(url) {
|
|
5278
|
+
const trimmed = url.trim().replace(/[\x00-\x1f]/g, '');
|
|
5279
|
+
if (!trimmed)
|
|
5280
|
+
return null;
|
|
5281
|
+
if (trimmed.startsWith('#') || trimmed.startsWith('/'))
|
|
5282
|
+
return trimmed;
|
|
5283
|
+
if (!HAS_URL_SCHEME.test(trimmed))
|
|
5284
|
+
return `https://${trimmed}`;
|
|
5285
|
+
return SAFE_URL_SCHEME.test(trimmed) ? trimmed : null;
|
|
5286
|
+
}
|
|
5180
5287
|
sanitizeHtml(html) {
|
|
5181
5288
|
const tpl = document.createElement('template');
|
|
5182
5289
|
tpl.innerHTML = html;
|
|
@@ -5192,7 +5299,9 @@ class KptRichText {
|
|
|
5192
5299
|
el.removeAttribute(attr.name);
|
|
5193
5300
|
}
|
|
5194
5301
|
else if (name === 'href' || name === 'src') {
|
|
5195
|
-
|
|
5302
|
+
// Usuń znaki kontrolne przed testem schematu — przeglądarka i tak je ignoruje przy
|
|
5303
|
+
// parsowaniu URL-a (WHATWG URL spec), więc `jav\tascript:` obchodziłby sam blocklisting.
|
|
5304
|
+
if (/^\s*javascript:/i.test(attr.value.replace(/[\x00-\x1f]/g, '')))
|
|
5196
5305
|
el.removeAttribute(attr.name);
|
|
5197
5306
|
}
|
|
5198
5307
|
else if (name === 'style') {
|
|
@@ -5205,7 +5314,7 @@ class KptRichText {
|
|
|
5205
5314
|
else
|
|
5206
5315
|
el.removeAttribute('style');
|
|
5207
5316
|
}
|
|
5208
|
-
else if (!ALLOWED_ATTRS.has(name) && name !== 'color'
|
|
5317
|
+
else if (!ALLOWED_ATTRS.has(name) && name !== 'color') {
|
|
5209
5318
|
el.removeAttribute(attr.name);
|
|
5210
5319
|
}
|
|
5211
5320
|
}
|
|
@@ -5250,7 +5359,7 @@ class KptRichText {
|
|
|
5250
5359
|
type: Component,
|
|
5251
5360
|
args: [{ selector: 'kpt-rich-text', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptIcon, CdkOverlayOrigin, CdkConnectedOverlay, NgTemplateOutlet, KptTooltip], host: { class: 'kpt-rich-text-host' }, template: "<div class=\"kpt-rich-text\" [class.kpt-rich-text--invalid]=\"showInvalid()\" [class.kpt-rich-text--disabled]=\"disabled()\">\n <div class=\"kpt-rich-text__toolbar\" role=\"toolbar\">\n @for (section of sections(); track $index; let firstSection = $first) {\n @if (!firstSection) {\n <span class=\"kpt-rich-text__divider\" aria-hidden=\"true\"></span>\n }\n @for (item of section; track item) {\n @switch (item) {\n @case ('heading') {\n <button\n type=\"button\"\n class=\"kpt-rich-text__style\"\n cdkOverlayOrigin\n #styleOrigin=\"cdkOverlayOrigin\"\n [class.is-open]=\"styleOpen()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"aria(item)\"\n [attr.aria-expanded]=\"styleOpen()\"\n [kptTooltip]=\"aria(item)\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"openStyle()\"\n >\n <span>{{ styleLabel() }}</span>\n <kpt-icon name=\"chevron-down\" class=\"kpt-rich-text__style-caret\" />\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"styleOrigin\"\n [cdkConnectedOverlayOpen]=\"styleOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeStyle()\"\n (detach)=\"closeStyle()\"\n >\n <ul class=\"kpt-rich-text__style-panel\" role=\"listbox\">\n @for (o of styleOptions(); track o.tag) {\n <li\n class=\"kpt-rich-text__style-opt\"\n [class]=\"'kpt-rich-text__style-opt kpt-rich-text__style-opt--' + o.tag\"\n role=\"option\"\n [attr.aria-selected]=\"currentBlock() === o.tag\"\n [class.is-selected]=\"currentBlock() === o.tag\"\n (click)=\"pickStyle(o.tag)\"\n >{{ o.label }}</li>\n }\n </ul>\n </ng-template>\n }\n @case ('foreColor') {\n <button\n type=\"button\"\n class=\"kpt-rich-text__tool kpt-rich-text__tool--color\"\n cdkOverlayOrigin\n #foreOrigin=\"cdkOverlayOrigin\"\n [attr.aria-label]=\"aria(item)\"\n [kptTooltip]=\"aria(item)\"\n [disabled]=\"disabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"openColor('foreColor')\"\n >\n <kpt-icon [name]=\"icon(item)\" />\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"foreOrigin\"\n [cdkConnectedOverlayOpen]=\"colorOpen() && colorKind() === 'foreColor'\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeColor()\"\n (detach)=\"closeColor()\"\n >\n <ng-container [ngTemplateOutlet]=\"paletteTpl\" />\n </ng-template>\n }\n @case ('backColor') {\n <button\n type=\"button\"\n class=\"kpt-rich-text__tool kpt-rich-text__tool--color\"\n cdkOverlayOrigin\n #backOrigin=\"cdkOverlayOrigin\"\n [attr.aria-label]=\"aria(item)\"\n [kptTooltip]=\"aria(item)\"\n [disabled]=\"disabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"openColor('backColor')\"\n >\n <kpt-icon [name]=\"icon(item)\" />\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"backOrigin\"\n [cdkConnectedOverlayOpen]=\"colorOpen() && colorKind() === 'backColor'\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeColor()\"\n (detach)=\"closeColor()\"\n >\n <ng-container [ngTemplateOutlet]=\"paletteTpl\" />\n </ng-template>\n }\n @case ('table') {\n <button\n type=\"button\"\n class=\"kpt-rich-text__tool\"\n cdkOverlayOrigin\n #tableOrigin=\"cdkOverlayOrigin\"\n [class.is-active]=\"tableOpen()\"\n [attr.aria-label]=\"aria(item)\"\n [kptTooltip]=\"aria(item)\"\n [disabled]=\"disabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"exec(item)\"\n >\n <kpt-icon [name]=\"icon(item)\" />\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"tableOrigin\"\n [cdkConnectedOverlayOpen]=\"tableOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeTable()\"\n (detach)=\"closeTable()\"\n >\n <div class=\"kpt-rt-grid-pop\" (mousedown)=\"$event.preventDefault()\">\n <div class=\"kpt-rt-grid\" (mouseleave)=\"gridHover(0, 0)\">\n @for (r of gridRows; track r) {\n <div class=\"kpt-rt-grid__row\">\n @for (c of gridCols; track c) {\n <span\n class=\"kpt-rt-grid__cell\"\n [class.is-on]=\"r <= gridR() && c <= gridC()\"\n (mouseenter)=\"gridHover(r, c)\"\n (click)=\"insertTable(r, c)\"\n ></span>\n }\n </div>\n }\n </div>\n <div class=\"kpt-rt-grid__label\">{{ gridR() }} \u00D7 {{ gridC() }}</div>\n </div>\n </ng-template>\n }\n @default {\n <button\n type=\"button\"\n class=\"kpt-rich-text__tool\"\n [class.is-active]=\"isActive(item)\"\n [attr.aria-label]=\"aria(item)\"\n [attr.aria-pressed]=\"isActive(item)\"\n [kptTooltip]=\"aria(item)\"\n [disabled]=\"disabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"exec(item)\"\n >\n <kpt-icon [name]=\"icon(item)\" />\n </button>\n }\n }\n }\n }\n </div>\n @if (sourceView()) {\n <textarea\n class=\"kpt-rich-text__source\"\n [value]=\"value()\"\n [disabled]=\"disabled()\"\n spellcheck=\"false\"\n [attr.aria-label]=\"i18n.t('richText.htmlSource')\"\n (input)=\"onSource($event)\"\n (blur)=\"touch.emit()\"\n ></textarea>\n } @else {\n <div\n #editor\n class=\"kpt-rich-text__editor\"\n [attr.contenteditable]=\"disabled() ? 'false' : 'true'\"\n [attr.data-placeholder]=\"placeholder()\"\n [attr.aria-invalid]=\"showInvalid() ? 'true' : null\"\n role=\"textbox\"\n aria-multiline=\"true\"\n (input)=\"onInput()\"\n (paste)=\"onPaste($event)\"\n (contextmenu)=\"onContextMenu($event)\"\n (mousedown)=\"onEditorMouseDown($event)\"\n (mousemove)=\"onEditorMouseMove($event)\"\n (blur)=\"touch.emit()\"\n ></div>\n }\n\n <!-- Menu kontekstowe tabeli (origin punktowy = pozycja kursora) -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"menuPoint()\"\n [cdkConnectedOverlayOpen]=\"menuOpen()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeMenu()\"\n (detach)=\"closeMenu()\"\n >\n <div class=\"kpt-rt-menu\" (contextmenu)=\"$event.preventDefault()\">\n <div class=\"kpt-rt-menu__group\">{{ i18n.t('richText.menu.column') }}</div>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"insertColumn('left')\"><kpt-icon name=\"plus\" /> {{ i18n.t('richText.menu.insertLeft') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"insertColumn('right')\"><kpt-icon name=\"plus\" /> {{ i18n.t('richText.menu.insertRight') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"toggleHeaderColumn()\"><kpt-icon name=\"table\" /> {{ i18n.t('richText.menu.headerColumn') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"deleteColumn()\"><kpt-icon name=\"trash\" /> {{ i18n.t('richText.menu.deleteColumn') }}</button>\n <div class=\"kpt-rt-menu__sep\"></div>\n <div class=\"kpt-rt-menu__group\">{{ i18n.t('richText.menu.row') }}</div>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"insertRow('above')\"><kpt-icon name=\"plus\" /> {{ i18n.t('richText.menu.insertAbove') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"insertRow('below')\"><kpt-icon name=\"plus\" /> {{ i18n.t('richText.menu.insertBelow') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"toggleHeaderRow()\"><kpt-icon name=\"table\" /> {{ i18n.t('richText.menu.headerRow') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"deleteRow()\"><kpt-icon name=\"trash\" /> {{ i18n.t('richText.menu.deleteRow') }}</button>\n <div class=\"kpt-rt-menu__sep\"></div>\n <div class=\"kpt-rt-menu__group\">{{ i18n.t('richText.menu.cell') }}</div>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"openCellBg()\"><kpt-icon name=\"palette\" /> {{ i18n.t('richText.menu.cellBackground') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"alignCell('left')\"><kpt-icon name=\"align-left\" /> {{ i18n.t('richText.menu.alignLeft') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"alignCell('center')\"><kpt-icon name=\"align-center\" /> {{ i18n.t('richText.menu.alignCenter') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"alignCell('right')\"><kpt-icon name=\"align-right\" /> {{ i18n.t('richText.menu.alignRight') }}</button>\n <div class=\"kpt-rt-menu__sep\"></div>\n <button type=\"button\" class=\"kpt-rt-menu__item\" [class.is-disabled]=\"!canMerge()\" (click)=\"mergeCells()\"><kpt-icon name=\"table\" /> {{ i18n.t('richText.menu.mergeCells') }}</button>\n <button type=\"button\" class=\"kpt-rt-menu__item\" [class.is-disabled]=\"!canSplit()\" (click)=\"splitCell()\"><kpt-icon name=\"grip-vertical\" /> {{ i18n.t('richText.menu.splitCell') }}</button>\n <div class=\"kpt-rt-menu__sep\"></div>\n <button type=\"button\" class=\"kpt-rt-menu__item\" (click)=\"openBorder()\"><kpt-icon name=\"table\" /> {{ i18n.t('richText.menu.border') }}</button>\n <div class=\"kpt-rt-menu__sep\"></div>\n <button type=\"button\" class=\"kpt-rt-menu__item kpt-rt-menu__item--danger\" (click)=\"deleteTable()\"><kpt-icon name=\"trash\" /> {{ i18n.t('richText.menu.deleteTable') }}</button>\n </div>\n </ng-template>\n\n <!-- Popover obramowania (tabela / kom\u00F3rka) -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"menuPoint()\"\n [cdkConnectedOverlayOpen]=\"borderOpen()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeBorder()\"\n (detach)=\"closeBorder()\"\n >\n <div class=\"kpt-rt-border\" (mousedown)=\"$event.preventDefault()\">\n <div class=\"kpt-rt-border__seg\">\n <button type=\"button\" [class.is-active]=\"borderTarget() === 'table'\" (click)=\"borderTarget.set('table')\">{{ i18n.t('richText.border.table') }}</button>\n <button type=\"button\" [class.is-active]=\"borderTarget() === 'cell'\" (click)=\"borderTarget.set('cell')\">{{ i18n.t('richText.border.cell') }}</button>\n </div>\n <div class=\"kpt-rt-border__widths\">\n <button type=\"button\" (click)=\"setBorderWidth('none')\">{{ i18n.t('richText.border.none') }}</button>\n <button type=\"button\" (click)=\"setBorderWidth('thin')\">{{ i18n.t('richText.border.thin') }}</button>\n <button type=\"button\" (click)=\"setBorderWidth('medium')\">{{ i18n.t('richText.border.medium') }}</button>\n <button type=\"button\" (click)=\"setBorderWidth('thick')\">{{ i18n.t('richText.border.thick') }}</button>\n </div>\n <div class=\"kpt-rich-text__swatches\">\n @for (c of swatches; track c) {\n <button type=\"button\" class=\"kpt-rich-text__swatch\" [style.background]=\"c\" [attr.aria-label]=\"c\" (click)=\"setBorderColor(c)\"></button>\n }\n </div>\n <label class=\"kpt-rich-text__picker\">\n <span>{{ i18n.t('richText.border.customColor') }}</span>\n <input type=\"color\" (input)=\"onBorderColorInput($event)\" />\n </label>\n </div>\n </ng-template>\n\n <!-- Popover koloru t\u0142a kom\u00F3rki (z menu kontekstowego) -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"menuPoint()\"\n [cdkConnectedOverlayOpen]=\"colorOpen() && colorKind() === 'cellBg'\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"closeColor()\"\n (detach)=\"closeColor()\"\n >\n <ng-container [ngTemplateOutlet]=\"paletteTpl\" />\n </ng-template>\n</div>\n\n<ng-template #paletteTpl>\n <div class=\"kpt-rich-text__palette\" (mousedown)=\"$event.preventDefault()\">\n <div class=\"kpt-rich-text__swatches\">\n @for (c of swatches; track c) {\n <button\n type=\"button\"\n class=\"kpt-rich-text__swatch\"\n [style.background]=\"c\"\n [attr.aria-label]=\"c\"\n (click)=\"applyColor(c)\"\n ></button>\n }\n </div>\n <label class=\"kpt-rich-text__picker\">\n <span>{{ i18n.t('richText.paletteCustom') }}</span>\n <input type=\"color\" (input)=\"onColorInput($event)\" />\n </label>\n </div>\n</ng-template>\n", styles: ["@layer kpt.components{.kpt-rich-text-host{display:block}.kpt-rich-text{border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-form-field-radius, .5rem);overflow:hidden;background:var(--kpt-form-field-bg)}.kpt-rich-text:focus-within{border-color:var(--kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-focus) 30%,transparent)}.kpt-rich-text--invalid{border-color:var(--kpt-form-field-border-error)}.kpt-rich-text--disabled{opacity:.6}.kpt-rich-text__toolbar{display:flex;flex-wrap:wrap;gap:.15rem;padding:.3rem;border-bottom:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);background:var(--kpt-color-surface-variant)}.kpt-rich-text__tool{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);cursor:pointer;font-size:1.05rem}.kpt-rich-text__tool:hover:not(:disabled){background:var(--kpt-color-muted)}.kpt-rich-text__tool:disabled{opacity:.5;cursor:not-allowed}.kpt-rich-text__tool.is-active{background:var(--kpt-color-muted);color:var(--kpt-color-primary)}.kpt-rich-text__divider{width:var(--kpt-border-width-thin, 1px);align-self:stretch;margin-inline:.2rem;background:var(--kpt-color-border)}.kpt-rich-text__style{display:inline-flex;align-items:center;gap:var(--kpt-space-1, .25rem);height:2rem;min-width:8rem;border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-radius-sm, .25rem);background:var(--kpt-form-field-bg);color:var(--kpt-form-field-text);font:inherit;font-size:var(--kpt-font-size-sm, .875rem);padding-inline:.5rem;cursor:pointer}.kpt-rich-text__style span{flex:1;text-align:start}.kpt-rich-text__style:hover:not(:disabled){border-color:var(--kpt-form-field-border-hover)}.kpt-rich-text__style.is-open{border-color:var(--kpt-form-field-border-focus)}.kpt-rich-text__style:disabled{opacity:.5;cursor:not-allowed}.kpt-rich-text__style-caret{opacity:.6}.kpt-rich-text__editor{min-height:6rem;padding:var(--kpt-space-3, .75rem);font-size:var(--kpt-font-size-sm, .875rem);line-height:var(--kpt-font-line-height-normal, 1.5);color:var(--kpt-form-field-text);outline:none;overflow-y:auto}.kpt-rich-text__editor:empty:before{content:attr(data-placeholder);color:var(--kpt-form-field-placeholder)}.kpt-rich-text__editor a{color:var(--kpt-color-primary)}.kpt-rich-text__editor ul,.kpt-rich-text__editor ol{padding-inline-start:1.5rem}.kpt-rich-text__editor h1{font-size:1.6em;font-weight:700;margin:.4em 0}.kpt-rich-text__editor h2{font-size:1.4em;font-weight:700;margin:.4em 0}.kpt-rich-text__editor h3{font-size:1.2em;font-weight:600;margin:.4em 0}.kpt-rich-text__editor h4{font-size:1.05em;font-weight:600;margin:.4em 0}.kpt-rich-text__editor h5{font-size:.95em;font-weight:600;margin:.4em 0}.kpt-rich-text__editor h6{font-size:.85em;font-weight:600;margin:.4em 0;text-transform:uppercase}.kpt-rich-text__editor blockquote{margin:.4em 0;padding-inline-start:.75rem;border-inline-start:3px solid var(--kpt-color-border-strong);color:var(--kpt-color-on-surface-muted)}.kpt-rich-text__editor .kpt-rt-table{border-collapse:collapse;table-layout:fixed;width:100%;margin:.5em 0}.kpt-rich-text__editor .kpt-rt-table td,.kpt-rich-text__editor .kpt-rt-table th{border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);padding:.35rem .5rem;min-width:2rem;vertical-align:top;overflow-wrap:anywhere}.kpt-rich-text__editor .kpt-rt-table th{background:var(--kpt-color-surface-variant);font-weight:var(--kpt-font-weight-semibold, 600)}.kpt-rich-text__editor .kpt-rt-table .kpt-rt-cell-sel{box-shadow:inset 0 0 0 2px var(--kpt-color-primary);background:color-mix(in oklch,var(--kpt-color-primary) 12%,transparent)}.kpt-rich-text__editor.is-col-resize{cursor:col-resize}.kpt-rich-text__source{display:block;width:100%;box-sizing:border-box;min-height:6rem;padding:var(--kpt-space-3, .75rem);border:0;background:var(--kpt-color-surface-variant);color:var(--kpt-form-field-text);font-family:var(--kpt-font-family-mono, ui-monospace, monospace);font-size:var(--kpt-font-size-xs, .75rem);line-height:var(--kpt-font-line-height-normal, 1.5);resize:vertical;outline:none}.kpt-rich-text__style-panel{min-width:11rem;margin:0;padding:.25rem;list-style:none;background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);box-shadow:var(--kpt-elevation-3);max-height:20rem;overflow-y:auto}.kpt-rich-text__style-opt{padding:.35rem .6rem;border-radius:var(--kpt-radius-sm, .25rem);color:var(--kpt-color-on-surface);cursor:pointer;line-height:1.2}.kpt-rich-text__style-opt:hover{background:var(--kpt-color-muted)}.kpt-rich-text__style-opt.is-selected{background:var(--kpt-color-muted);color:var(--kpt-color-primary)}.kpt-rich-text__style-opt--p{font-size:.95rem}.kpt-rich-text__style-opt--h1{font-size:1.7rem;font-weight:700}.kpt-rich-text__style-opt--h2{font-size:1.45rem;font-weight:700}.kpt-rich-text__style-opt--h3{font-size:1.25rem;font-weight:600}.kpt-rich-text__style-opt--h4{font-size:1.1rem;font-weight:600}.kpt-rich-text__style-opt--h5{font-size:1rem;font-weight:600}.kpt-rich-text__style-opt--h6{font-size:.85rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em}.kpt-rich-text__palette{padding:var(--kpt-space-3, .75rem);background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);box-shadow:var(--kpt-elevation-3)}.kpt-rich-text__swatches{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.kpt-rich-text__swatch{width:1.4rem;height:1.4rem;border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-sm, .25rem);cursor:pointer}.kpt-rich-text__swatch:hover{transform:scale(1.1)}.kpt-rich-text__picker{display:flex;align-items:center;justify-content:space-between;gap:var(--kpt-space-2, .5rem);margin-top:var(--kpt-space-2, .5rem);font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-color-on-surface-muted)}.kpt-rich-text__picker input[type=color]{width:2rem;height:1.6rem;padding:0;border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-sm, .25rem);background:none;cursor:pointer}.kpt-rt-grid-pop{padding:var(--kpt-space-2, .5rem);background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);box-shadow:var(--kpt-elevation-3)}.kpt-rt-grid{display:flex;flex-direction:column;gap:3px}.kpt-rt-grid__row{display:flex;gap:3px}.kpt-rt-grid__cell{width:1rem;height:1rem;border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:2px;cursor:pointer}.kpt-rt-grid__cell.is-on{background:var(--kpt-color-primary);border-color:var(--kpt-color-primary)}.kpt-rt-grid__label{margin-top:var(--kpt-space-2, .5rem);text-align:center;font-size:var(--kpt-font-size-xs, .75rem);color:var(--kpt-color-on-surface-muted)}.kpt-rt-menu{min-width:12rem;padding:.25rem;background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);box-shadow:var(--kpt-elevation-3);font-size:var(--kpt-font-size-sm, .875rem)}.kpt-rt-menu__group{padding:.3rem .6rem .15rem;font-size:var(--kpt-font-size-xs, .75rem);font-weight:var(--kpt-font-weight-semibold, 600);text-transform:uppercase;letter-spacing:.03em;color:var(--kpt-color-on-surface-muted)}.kpt-rt-menu__item{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);width:100%;padding:.4rem .6rem;border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);font:inherit;text-align:start;cursor:pointer}.kpt-rt-menu__item:hover{background:var(--kpt-color-muted)}.kpt-rt-menu__item kpt-icon{color:var(--kpt-color-on-surface-muted)}.kpt-rt-menu__item--danger{color:var(--kpt-color-danger)}.kpt-rt-menu__item--danger kpt-icon{color:var(--kpt-color-danger)}.kpt-rt-menu__item.is-disabled{opacity:.4;pointer-events:none}.kpt-rt-menu__sep{height:1px;margin:.25rem 0;background:var(--kpt-color-border)}.kpt-rt-border{display:flex;flex-direction:column;gap:var(--kpt-space-2, .5rem);padding:var(--kpt-space-3, .75rem);background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);box-shadow:var(--kpt-elevation-3)}.kpt-rt-border__seg{display:flex;gap:2px;padding:2px;background:var(--kpt-color-surface-variant);border-radius:var(--kpt-radius-md, .5rem)}.kpt-rt-border__seg button{flex:1;border:0;background:none;padding:.25rem .5rem;border-radius:var(--kpt-radius-sm, .25rem);color:var(--kpt-color-on-surface-muted);font:inherit;font-size:var(--kpt-font-size-sm, .875rem);cursor:pointer}.kpt-rt-border__seg button.is-active{background:var(--kpt-color-surface-raised);color:var(--kpt-color-on-surface);font-weight:var(--kpt-font-weight-medium, 500);box-shadow:var(--kpt-elevation-1)}.kpt-rt-border__widths{display:flex;gap:.25rem}.kpt-rt-border__widths button{flex:1;border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);background:none;padding:.25rem .3rem;border-radius:var(--kpt-radius-sm, .25rem);color:var(--kpt-color-on-surface);font:inherit;font-size:var(--kpt-font-size-xs, .75rem);cursor:pointer}.kpt-rt-border__widths button:hover{background:var(--kpt-color-muted)}}\n"] }]
|
|
5252
5361
|
}], () => [], { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], toolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbar", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], editor: [{ type: i0.ViewChild, args: ['editor', { isSignal: true }] }] }); })();
|
|
5253
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptRichText, { className: "KptRichText", filePath: "lib/rich-text/rich-text.component.ts", lineNumber:
|
|
5362
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptRichText, { className: "KptRichText", filePath: "lib/rich-text/rich-text.component.ts", lineNumber: 121 }); })();
|
|
5254
5363
|
|
|
5255
5364
|
function KptSlider_Conditional_0_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
5256
5365
|
i0.ɵɵdomElementStart(0, "span", 5);
|
|
@@ -5311,8 +5420,13 @@ function KptSlider_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
5311
5420
|
* Suwak wartości (slider) na Signal Forms.
|
|
5312
5421
|
* W trybie `range` udostępnia dwa uchwyty, a wartość jest parą `[min, max]`.
|
|
5313
5422
|
*
|
|
5423
|
+
* Pod `[formField]` zakres bierze się ze schematu (`min(path.volume, 0)`,
|
|
5424
|
+
* `max(path.volume, 100)`) — `[min]`/`[max]` obok `[formField]` to błąd kompilacji.
|
|
5425
|
+
* Tryb `range` (wartość `[number, number]`) łączy się więc tylko z `[(value)]`.
|
|
5426
|
+
*
|
|
5314
5427
|
* @example
|
|
5315
|
-
* <kpt-slider [formField]="f.volume" [
|
|
5428
|
+
* <kpt-slider [formField]="f.volume" [step]="5" showValue />
|
|
5429
|
+
* <kpt-slider [(value)]="volume" [min]="0" [max]="100" [step]="5" showValue />
|
|
5316
5430
|
* <kpt-slider range [(value)]="zakres" [min]="0" [max]="100" showValue />
|
|
5317
5431
|
*/
|
|
5318
5432
|
class KptSlider {
|
|
@@ -5439,7 +5553,7 @@ class KptSlider {
|
|
|
5439
5553
|
}
|
|
5440
5554
|
`, host: { class: 'kpt-slider-host' }, styles: ["@layer kpt.components{.kpt-slider-host{display:flex;align-items:center;gap:var(--kpt-space-3, .75rem)}.kpt-slider__input{--_pct: 0%;flex:1;height:1.25rem;appearance:none;background:none;cursor:pointer}.kpt-slider__input::-webkit-slider-runnable-track{height:.4rem;border-radius:var(--kpt-radius-full, 9999px);background:linear-gradient(to right,var(--kpt-color-primary) var(--_pct),var(--kpt-color-surface-variant) var(--_pct))}.kpt-slider__input::-moz-range-track{height:.4rem;border-radius:var(--kpt-radius-full, 9999px);background:var(--kpt-color-surface-variant)}.kpt-slider__input::-moz-range-progress{height:.4rem;border-radius:var(--kpt-radius-full, 9999px);background:var(--kpt-color-primary)}.kpt-slider__input::-webkit-slider-thumb{appearance:none;width:1.1rem;height:1.1rem;margin-top:-.35rem;border-radius:50%;background:var(--kpt-color-primary);box-shadow:var(--kpt-elevation-1)}.kpt-slider__input::-moz-range-thumb{width:1.1rem;height:1.1rem;border:0;border-radius:50%;background:var(--kpt-color-primary);box-shadow:var(--kpt-elevation-1)}.kpt-slider__input:focus-visible{outline:none}.kpt-slider__input:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px color-mix(in oklch,var(--kpt-color-focus-ring) 30%,transparent)}.kpt-slider__input:focus-visible::-moz-range-thumb{box-shadow:0 0 0 4px color-mix(in oklch,var(--kpt-color-focus-ring) 30%,transparent)}.kpt-slider__input:disabled{opacity:.5;cursor:not-allowed}.kpt-slider__value{min-width:2.5rem;text-align:end;font-size:var(--kpt-font-size-sm, .875rem);font-variant-numeric:tabular-nums;color:var(--kpt-color-on-surface)}.kpt-slider__range{position:relative;flex:1;height:1.25rem;display:flex;align-items:center}.kpt-slider__rail{position:absolute;inset-inline:0;height:.4rem;border-radius:var(--kpt-radius-full, 9999px);background:var(--kpt-color-surface-variant)}.kpt-slider__fill{position:absolute;height:.4rem;border-radius:var(--kpt-radius-full, 9999px);background:var(--kpt-color-primary)}.kpt-slider__thumb{position:absolute;inset-inline:0;width:100%;height:1.25rem;margin:0;appearance:none;background:none;pointer-events:none}.kpt-slider__thumb::-webkit-slider-runnable-track{height:.4rem;background:none}.kpt-slider__thumb::-moz-range-track{height:.4rem;background:none}.kpt-slider__thumb::-webkit-slider-thumb{pointer-events:auto;appearance:none;width:1.1rem;height:1.1rem;margin-top:-.35rem;border-radius:50%;background:var(--kpt-color-primary);box-shadow:var(--kpt-elevation-1);cursor:pointer}.kpt-slider__thumb::-moz-range-thumb{pointer-events:auto;width:1.1rem;height:1.1rem;border:0;border-radius:50%;background:var(--kpt-color-primary);box-shadow:var(--kpt-elevation-1);cursor:pointer}.kpt-slider__thumb:focus-visible{outline:none}.kpt-slider__thumb:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px color-mix(in oklch,var(--kpt-color-focus-ring) 30%,transparent)}.kpt-slider__thumb:focus-visible::-moz-range-thumb{box-shadow:0 0 0 4px color-mix(in oklch,var(--kpt-color-focus-ring) 30%,transparent)}.kpt-slider__thumb--high{z-index:1}.kpt-slider__thumb:disabled{opacity:.5;cursor:not-allowed}}\n"] }]
|
|
5441
5555
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] }); })();
|
|
5442
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSlider, { className: "KptSlider", filePath: "lib/slider/slider.component.ts", lineNumber:
|
|
5556
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSlider, { className: "KptSlider", filePath: "lib/slider/slider.component.ts", lineNumber: 87 }); })();
|
|
5443
5557
|
|
|
5444
5558
|
function KptRating_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
5445
5559
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
@@ -5458,7 +5572,7 @@ function KptRating_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
5458
5572
|
* Ocena gwiazdkami (rating) na Signal Forms.
|
|
5459
5573
|
*
|
|
5460
5574
|
* @example
|
|
5461
|
-
* <kpt-rating [formField]="f.score" [
|
|
5575
|
+
* <kpt-rating [formField]="f.score" [count]="5" />
|
|
5462
5576
|
* <kpt-rating [value]="4" readonly />
|
|
5463
5577
|
*/
|
|
5464
5578
|
class KptRating {
|
|
@@ -5676,7 +5790,7 @@ function KptColorPicker_For_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
5676
5790
|
} if (rf & 2) {
|
|
5677
5791
|
const color_r2 = ctx.$implicit;
|
|
5678
5792
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
5679
|
-
i0.ɵɵstyleProp("background", color_r2);
|
|
5793
|
+
i0.ɵɵstyleProp("background-color", color_r2);
|
|
5680
5794
|
i0.ɵɵclassProp("is-active", color_r2 === ctx_r2.value());
|
|
5681
5795
|
i0.ɵɵdomProperty("disabled", ctx_r2.disabled());
|
|
5682
5796
|
i0.ɵɵattribute("aria-label", color_r2);
|
|
@@ -5704,7 +5818,7 @@ class KptColorPicker {
|
|
|
5704
5818
|
this.value.set(event.target.value);
|
|
5705
5819
|
}
|
|
5706
5820
|
static { this.ɵfac = function KptColorPicker_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptColorPicker)(); }; }
|
|
5707
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptColorPicker, selectors: [["kpt-color-picker"]], hostAttrs: [1, "kpt-color-picker-host"], inputs: { value: [1, "value"], presets: [1, "presets"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 7, vars: 6, consts: [[1, "kpt-color-picker"], [1, "kpt-color-picker__swatch"], ["type", "color", 3, "input", "blur", "value", "disabled"], ["type", "text", "maxlength", "7", 1, "kpt-color-picker__hex", 3, "input", "blur", "value", "disabled"], [1, "kpt-color-picker__presets"], ["type", "button", 1, "kpt-color-picker__preset", 3, "is-active", "background", "disabled"], ["type", "button", 1, "kpt-color-picker__preset", 3, "click", "disabled"]], template: function KptColorPicker_Template(rf, ctx) { if (rf & 1) {
|
|
5821
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptColorPicker, selectors: [["kpt-color-picker"]], hostAttrs: [1, "kpt-color-picker-host"], inputs: { value: [1, "value"], presets: [1, "presets"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 7, vars: 6, consts: [[1, "kpt-color-picker"], [1, "kpt-color-picker__swatch"], ["type", "color", 3, "input", "blur", "value", "disabled"], ["type", "text", "maxlength", "7", 1, "kpt-color-picker__hex", 3, "input", "blur", "value", "disabled"], [1, "kpt-color-picker__presets"], ["type", "button", 1, "kpt-color-picker__preset", 3, "is-active", "background-color", "disabled"], ["type", "button", 1, "kpt-color-picker__preset", 3, "click", "disabled"]], template: function KptColorPicker_Template(rf, ctx) { if (rf & 1) {
|
|
5708
5822
|
i0.ɵɵdomElementStart(0, "div", 0)(1, "label", 1)(2, "input", 2);
|
|
5709
5823
|
i0.ɵɵdomListener("input", function KptColorPicker_Template_input_input_2_listener($event) { return ctx.value.set($event.target.value); })("blur", function KptColorPicker_Template_input_blur_2_listener() { return ctx.touch.emit(); });
|
|
5710
5824
|
i0.ɵɵdomElementEnd()();
|
|
@@ -5716,7 +5830,7 @@ class KptColorPicker {
|
|
|
5716
5830
|
i0.ɵɵdomElementEnd()();
|
|
5717
5831
|
} if (rf & 2) {
|
|
5718
5832
|
i0.ɵɵadvance();
|
|
5719
|
-
i0.ɵɵstyleProp("background", ctx.value());
|
|
5833
|
+
i0.ɵɵstyleProp("background-color", ctx.value());
|
|
5720
5834
|
i0.ɵɵadvance();
|
|
5721
5835
|
i0.ɵɵdomProperty("value", ctx.value())("disabled", ctx.disabled());
|
|
5722
5836
|
i0.ɵɵadvance();
|
|
@@ -5729,7 +5843,7 @@ class KptColorPicker {
|
|
|
5729
5843
|
type: Component,
|
|
5730
5844
|
args: [{ selector: 'kpt-color-picker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: `
|
|
5731
5845
|
<div class="kpt-color-picker">
|
|
5732
|
-
<label class="kpt-color-picker__swatch" [style.background]="value()">
|
|
5846
|
+
<label class="kpt-color-picker__swatch" [style.background-color]="value()">
|
|
5733
5847
|
<input
|
|
5734
5848
|
type="color"
|
|
5735
5849
|
[value]="value()"
|
|
@@ -5753,7 +5867,7 @@ class KptColorPicker {
|
|
|
5753
5867
|
type="button"
|
|
5754
5868
|
class="kpt-color-picker__preset"
|
|
5755
5869
|
[class.is-active]="color === value()"
|
|
5756
|
-
[style.background]="color"
|
|
5870
|
+
[style.background-color]="color"
|
|
5757
5871
|
[disabled]="disabled()"
|
|
5758
5872
|
(click)="value.set(color)"
|
|
5759
5873
|
[attr.aria-label]="color"
|
|
@@ -6246,8 +6360,13 @@ function KptInputNumber_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
6246
6360
|
* `showButtons="false"` chowa strzałki — wariant do zakresów „od–do", gdzie krokowanie
|
|
6247
6361
|
* nie ma sensu, a pole ma wyglądać jak zwykłe `kpt-input` obok.
|
|
6248
6362
|
*
|
|
6363
|
+
* Pod `[formField]` granic NIE bindujemy w szablonie — `[min]`/`[max]` obok `[formField]`
|
|
6364
|
+
* to błąd kompilacji. Deklaruje je schemat (`min(path.qty, 0)`, `max(path.qty, 99)`),
|
|
6365
|
+
* a dyrektywa `FormField` sama wstrzykuje je w wejścia `min`/`max`.
|
|
6366
|
+
*
|
|
6249
6367
|
* @example
|
|
6250
|
-
* <kpt-input-number [formField]="f.qty" [
|
|
6368
|
+
* <kpt-input-number [formField]="f.qty" [step]="1" />
|
|
6369
|
+
* <kpt-input-number [(value)]="qty" [min]="0" [max]="99" suffix=" szt." />
|
|
6251
6370
|
* <kpt-input-number [formField]="f.priceFrom" [showButtons]="false" suffix=" zł" />
|
|
6252
6371
|
*/
|
|
6253
6372
|
class KptInputNumber {
|
|
@@ -6363,7 +6482,7 @@ class KptInputNumber {
|
|
|
6363
6482
|
</div>
|
|
6364
6483
|
`, host: { class: 'kpt-input-number-host' }, styles: ["@layer kpt.components{.kpt-input-number-host{display:block}.kpt-input-number{display:inline-flex;align-items:stretch;width:100%;height:2.5rem;box-sizing:border-box;border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-form-field-radius, .5rem);background:var(--kpt-form-field-bg);overflow:hidden}.kpt-input-number:focus-within:not(.kpt-input-number--disabled){border-color:var(--kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-focus) 30%,transparent)}.kpt-input-number--invalid{border-color:var(--kpt-form-field-border-error)}.kpt-input-number--disabled{opacity:.6;background:var(--kpt-color-surface-variant)}.kpt-input-number--plain .kpt-input-number__input{text-align:left;padding-inline:var(--kpt-space-3, .75rem)}.kpt-input-number__input{flex:1;min-width:0;border:0;background:none;text-align:center;color:var(--kpt-form-field-text);font-size:var(--kpt-font-size-sm, .875rem)}.kpt-input-number__input:focus{outline:none}.kpt-input-number__input::placeholder{color:var(--kpt-form-field-placeholder)}.kpt-input-number__btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;border:0;background:var(--kpt-color-muted);color:var(--kpt-color-on-surface);cursor:pointer}.kpt-input-number__btn:hover:not(:disabled){background:var(--kpt-color-surface-variant)}.kpt-input-number__btn:disabled{cursor:not-allowed;opacity:.5}}\n"] }]
|
|
6365
6484
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] }); })();
|
|
6366
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptInputNumber, { className: "KptInputNumber", filePath: "lib/input-number/input-number.component.ts", lineNumber:
|
|
6485
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptInputNumber, { className: "KptInputNumber", filePath: "lib/input-number/input-number.component.ts", lineNumber: 53 }); })();
|
|
6367
6486
|
|
|
6368
6487
|
const _c0$s = () => [0, 1, 2, 3];
|
|
6369
6488
|
function KptPassword_Conditional_4_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -6936,8 +7055,12 @@ const GAP = Math.PI / 4; // przerwa u dołu (kąt „otwarcia" łuku)
|
|
|
6936
7055
|
/**
|
|
6937
7056
|
* Pokrętło (knob) — wybór wartości po łuku, myszką lub strzałkami. Signal Forms.
|
|
6938
7057
|
*
|
|
7058
|
+
* Pod `[formField]` zakres bierze się ze schematu (`min(path.level, 0)`,
|
|
7059
|
+
* `max(path.level, 100)`) — `[min]`/`[max]` obok `[formField]` to błąd kompilacji.
|
|
7060
|
+
*
|
|
6939
7061
|
* @example
|
|
6940
|
-
* <kpt-knob [formField]="f.level" [
|
|
7062
|
+
* <kpt-knob [formField]="f.level" [step]="1" />
|
|
7063
|
+
* <kpt-knob [(value)]="level" [min]="0" [max]="100" [step]="1" />
|
|
6941
7064
|
*/
|
|
6942
7065
|
class KptKnob {
|
|
6943
7066
|
constructor() {
|
|
@@ -7089,7 +7212,7 @@ class KptKnob {
|
|
|
7089
7212
|
</div>
|
|
7090
7213
|
`, host: { class: 'kpt-knob-host' }, styles: ["@layer kpt.components{.kpt-knob-host{display:inline-block}.kpt-knob{display:inline-flex;cursor:pointer;touch-action:none;outline:none;border-radius:50%}.kpt-knob:focus-visible{box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-color-primary) 40%,transparent)}.kpt-knob[aria-disabled=true]{cursor:not-allowed;opacity:.6}.kpt-knob__range{stroke:var(--kpt-color-border)}.kpt-knob__value{stroke:var(--kpt-color-primary);transition:stroke-dashoffset .1s}.kpt-knob__text{fill:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-lg, 1.125rem);font-weight:var(--kpt-font-weight-semibold, 600)}}\n"] }]
|
|
7091
7214
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], stroke: [{ type: i0.Input, args: [{ isSignal: true, alias: "stroke", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] }); })();
|
|
7092
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptKnob, { className: "KptKnob", filePath: "lib/knob/knob.component.ts", lineNumber:
|
|
7215
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptKnob, { className: "KptKnob", filePath: "lib/knob/knob.component.ts", lineNumber: 45 }); })();
|
|
7093
7216
|
|
|
7094
7217
|
const _c0$r = ["*", [["", "kptCardFooter", ""]]];
|
|
7095
7218
|
const _c1$a = ["*", "[kptCardFooter]"];
|
|
@@ -7900,7 +8023,7 @@ function KptMeterGroup_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
7900
8023
|
const item_r1 = ctx.$implicit;
|
|
7901
8024
|
const ɵ$index_5_r2 = ctx.$index;
|
|
7902
8025
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
7903
|
-
i0.ɵɵstyleProp("width", ctx_r2.percent(item_r1), "%")("background", item_r1.color || ctx_r2.fallback(ɵ$index_5_r2));
|
|
8026
|
+
i0.ɵɵstyleProp("width", ctx_r2.percent(item_r1), "%")("background-color", item_r1.color || ctx_r2.fallback(ɵ$index_5_r2));
|
|
7904
8027
|
i0.ɵɵattribute("title", item_r1.label);
|
|
7905
8028
|
} }
|
|
7906
8029
|
function KptMeterGroup_Conditional_4_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -7917,7 +8040,7 @@ function KptMeterGroup_Conditional_4_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
7917
8040
|
const ɵ$index_11_r5 = ctx.$index;
|
|
7918
8041
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
7919
8042
|
i0.ɵɵadvance();
|
|
7920
|
-
i0.ɵɵstyleProp("background", item_r4.color || ctx_r2.fallback(ɵ$index_11_r5));
|
|
8043
|
+
i0.ɵɵstyleProp("background-color", item_r4.color || ctx_r2.fallback(ɵ$index_11_r5));
|
|
7921
8044
|
i0.ɵɵadvance(2);
|
|
7922
8045
|
i0.ɵɵtextInterpolate(item_r4.label);
|
|
7923
8046
|
i0.ɵɵadvance(2);
|
|
@@ -7963,7 +8086,7 @@ class KptMeterGroup {
|
|
|
7963
8086
|
return Math.round(n);
|
|
7964
8087
|
}
|
|
7965
8088
|
static { this.ɵfac = function KptMeterGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptMeterGroup)(); }; }
|
|
7966
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMeterGroup, selectors: [["kpt-meter-group"]], hostAttrs: [1, "kpt-meter-group-host"], inputs: { values: [1, "values"], max: [1, "max"], showLegend: [1, "showLegend"] }, decls: 5, vars: 3, consts: [[1, "kpt-meter-group"], ["role", "meter", 1, "kpt-meter-group__track"], [1, "kpt-meter-group__segment", 3, "width", "background"], [1, "kpt-meter-group__legend"], [1, "kpt-meter-group__segment"], [1, "kpt-meter-group__legend-item"], [1, "kpt-meter-group__dot"], [1, "kpt-meter-group__val"]], template: function KptMeterGroup_Template(rf, ctx) { if (rf & 1) {
|
|
8089
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMeterGroup, selectors: [["kpt-meter-group"]], hostAttrs: [1, "kpt-meter-group-host"], inputs: { values: [1, "values"], max: [1, "max"], showLegend: [1, "showLegend"] }, decls: 5, vars: 3, consts: [[1, "kpt-meter-group"], ["role", "meter", 1, "kpt-meter-group__track"], [1, "kpt-meter-group__segment", 3, "width", "background-color"], [1, "kpt-meter-group__legend"], [1, "kpt-meter-group__segment"], [1, "kpt-meter-group__legend-item"], [1, "kpt-meter-group__dot"], [1, "kpt-meter-group__val"]], template: function KptMeterGroup_Template(rf, ctx) { if (rf & 1) {
|
|
7967
8090
|
i0.ɵɵdomElementStart(0, "div", 0)(1, "div", 1);
|
|
7968
8091
|
i0.ɵɵrepeaterCreate(2, KptMeterGroup_For_3_Template, 1, 5, "span", 2, i0.ɵɵrepeaterTrackByIndex);
|
|
7969
8092
|
i0.ɵɵdomElementEnd();
|
|
@@ -7987,7 +8110,7 @@ class KptMeterGroup {
|
|
|
7987
8110
|
<span
|
|
7988
8111
|
class="kpt-meter-group__segment"
|
|
7989
8112
|
[style.width.%]="percent(item)"
|
|
7990
|
-
[style.background]="item.color || fallback(i)"
|
|
8113
|
+
[style.background-color]="item.color || fallback(i)"
|
|
7991
8114
|
[attr.title]="item.label"
|
|
7992
8115
|
></span>
|
|
7993
8116
|
}
|
|
@@ -7996,7 +8119,7 @@ class KptMeterGroup {
|
|
|
7996
8119
|
<ul class="kpt-meter-group__legend">
|
|
7997
8120
|
@for (item of values(); track $index; let i = $index) {
|
|
7998
8121
|
<li class="kpt-meter-group__legend-item">
|
|
7999
|
-
<span class="kpt-meter-group__dot" [style.background]="item.color || fallback(i)"></span>
|
|
8122
|
+
<span class="kpt-meter-group__dot" [style.background-color]="item.color || fallback(i)"></span>
|
|
8000
8123
|
<span>{{ item.label }}</span>
|
|
8001
8124
|
<span class="kpt-meter-group__val">{{ round(percent(item)) }}%</span>
|
|
8002
8125
|
</li>
|
|
@@ -8852,6 +8975,68 @@ class KptCellDef {
|
|
|
8852
8975
|
}]
|
|
8853
8976
|
}], null, { kptCell: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptCell", required: true }] }] }); })();
|
|
8854
8977
|
|
|
8978
|
+
/**
|
|
8979
|
+
* Własny szablon edytora komórki dla kolumny `kpt-data-table` (gdy wbudowane typy
|
|
8980
|
+
* `KptColumnEdit.type` nie wystarczają). Kontekst: `$implicit` = bieżąca wartość edycji,
|
|
8981
|
+
* `row` = wiersz, `commit(value)` = zatwierdź wartość i zamknij edytor, `cancel()` = odrzuć.
|
|
8982
|
+
*
|
|
8983
|
+
* @example
|
|
8984
|
+
* <kpt-data-table [columns]="cols" [data]="rows">
|
|
8985
|
+
* <ng-template kptCellEdit="team" let-value let-commit="commit">
|
|
8986
|
+
* <my-custom-picker [value]="value" (valueChange)="commit($event)" />
|
|
8987
|
+
* </ng-template>
|
|
8988
|
+
* </kpt-data-table>
|
|
8989
|
+
*/
|
|
8990
|
+
class KptCellEditDef {
|
|
8991
|
+
constructor() {
|
|
8992
|
+
/** Nazwa pola kolumny, dla której obowiązuje szablon edytora. */
|
|
8993
|
+
this.kptCellEdit = input.required(/* @ts-ignore */
|
|
8994
|
+
...(ngDevMode ? [{ debugName: "kptCellEdit" }] : /* istanbul ignore next */ []));
|
|
8995
|
+
this.template = inject(TemplateRef);
|
|
8996
|
+
}
|
|
8997
|
+
static { this.ɵfac = function KptCellEditDef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptCellEditDef)(); }; }
|
|
8998
|
+
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: KptCellEditDef, selectors: [["ng-template", "kptCellEdit", ""]], inputs: { kptCellEdit: [1, "kptCellEdit"] } }); }
|
|
8999
|
+
}
|
|
9000
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptCellEditDef, [{
|
|
9001
|
+
type: Directive,
|
|
9002
|
+
args: [{
|
|
9003
|
+
selector: 'ng-template[kptCellEdit]',
|
|
9004
|
+
}]
|
|
9005
|
+
}], null, { kptCellEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptCellEdit", required: true }] }] }); })();
|
|
9006
|
+
|
|
9007
|
+
/*
|
|
9008
|
+
* Escapowanie komórek CSV dla `exportCsv()` — pure TS, wydzielone żeby dało się
|
|
9009
|
+
* testować `node --test` bez ciągnięcia Angulara.
|
|
9010
|
+
*/
|
|
9011
|
+
// Znak startowy, który arkusz kalkulacyjny czyta jako początek formuły (CWE-1236).
|
|
9012
|
+
const FORMULA_PREFIX = /^[=+\-@\t\r]/;
|
|
9013
|
+
function stringifyCsvValue(value) {
|
|
9014
|
+
switch (typeof value) {
|
|
9015
|
+
case 'undefined':
|
|
9016
|
+
return '';
|
|
9017
|
+
case 'string':
|
|
9018
|
+
return value;
|
|
9019
|
+
case 'number':
|
|
9020
|
+
case 'boolean':
|
|
9021
|
+
case 'bigint':
|
|
9022
|
+
return String(value);
|
|
9023
|
+
default:
|
|
9024
|
+
if (value === null)
|
|
9025
|
+
return '';
|
|
9026
|
+
if (value instanceof Date)
|
|
9027
|
+
return value.toISOString();
|
|
9028
|
+
return JSON.stringify(value);
|
|
9029
|
+
}
|
|
9030
|
+
}
|
|
9031
|
+
/** Escapuje pojedynczą wartość komórki/nagłówka do bezpiecznego pola CSV (separator `;`). */
|
|
9032
|
+
function escapeCsvCell(value) {
|
|
9033
|
+
let text = stringifyCsvValue(value);
|
|
9034
|
+
// Wiodący `'` każe arkuszowi traktować komórkę jako tekst — sam znak nie jest wyświetlany.
|
|
9035
|
+
if (FORMULA_PREFIX.test(text))
|
|
9036
|
+
text = `'${text}`;
|
|
9037
|
+
return /[",\n;]/.test(text) ? `"${text.replaceAll('"', '""')}"` : text;
|
|
9038
|
+
}
|
|
9039
|
+
|
|
8855
9040
|
/**
|
|
8856
9041
|
* Szablon rozwijanego wiersza (row detail) dla `kpt-data-table`. Renderowany pod
|
|
8857
9042
|
* wierszem po rozwinięciu. Kontekst: `$implicit` = wiersz. Wymaga `expandable`.
|
|
@@ -8879,17 +9064,21 @@ class KptRowDetailDef {
|
|
|
8879
9064
|
|
|
8880
9065
|
const _c0$e = ["scrollEl"];
|
|
8881
9066
|
const _c1$5 = ["theadEl"];
|
|
8882
|
-
const _c2$2 =
|
|
8883
|
-
const _c3 =
|
|
8884
|
-
const _c4 =
|
|
8885
|
-
const _c5 =
|
|
8886
|
-
const _c6 =
|
|
9067
|
+
const _c2$2 = ["editorHost"];
|
|
9068
|
+
const _c3 = [[["", "kptPaginatorActions", ""]]];
|
|
9069
|
+
const _c4 = ["[kptPaginatorActions]"];
|
|
9070
|
+
const _c5 = a0 => ({ $implicit: a0 });
|
|
9071
|
+
const _c6 = a0 => ({ column: a0 });
|
|
9072
|
+
const _c7 = (a0, a1, a2, a3) => ({ $implicit: a0, row: a1, commit: a2, cancel: a3 });
|
|
9073
|
+
const _c8 = () => [];
|
|
9074
|
+
const _c9 = (a0, a1) => ({ $implicit: a0, value: a1 });
|
|
9075
|
+
const _c10 = () => ({ start: "", end: "" });
|
|
8887
9076
|
const _forTrack0$1 = ($index, $item) => $item.field;
|
|
8888
9077
|
function _forTrack1($index, $item) { /* @ts-ignore */
|
|
8889
9078
|
return this.trackRow($item); }
|
|
8890
9079
|
function KptDataTable_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
8891
9080
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
8892
|
-
i0.ɵɵelementStart(0, "input",
|
|
9081
|
+
i0.ɵɵelementStart(0, "input", 15);
|
|
8893
9082
|
i0.ɵɵlistener("input", function KptDataTable_Conditional_0_Conditional_1_Template_input_input_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onFilter($event)); });
|
|
8894
9083
|
i0.ɵɵelementEnd();
|
|
8895
9084
|
} if (rf & 2) {
|
|
@@ -8899,7 +9088,7 @@ function KptDataTable_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1
|
|
|
8899
9088
|
} }
|
|
8900
9089
|
function KptDataTable_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
8901
9090
|
const _r3 = i0.ɵɵgetCurrentView();
|
|
8902
|
-
i0.ɵɵelementStart(0, "kpt-button",
|
|
9091
|
+
i0.ɵɵelementStart(0, "kpt-button", 16);
|
|
8903
9092
|
i0.ɵɵlistener("click", function KptDataTable_Conditional_0_Conditional_2_Template_kpt_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.exportCsv()); });
|
|
8904
9093
|
i0.ɵɵtext(1);
|
|
8905
9094
|
i0.ɵɵelementEnd();
|
|
@@ -8909,9 +9098,9 @@ function KptDataTable_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1
|
|
|
8909
9098
|
i0.ɵɵtextInterpolate(ctx_r1.i18n.t("dataTable.exportCsv"));
|
|
8910
9099
|
} }
|
|
8911
9100
|
function KptDataTable_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
8912
|
-
i0.ɵɵelementStart(0, "div",
|
|
8913
|
-
i0.ɵɵconditionalCreate(1, KptDataTable_Conditional_0_Conditional_1_Template, 1, 2, "input",
|
|
8914
|
-
i0.ɵɵconditionalCreate(2, KptDataTable_Conditional_0_Conditional_2_Template, 2, 1, "kpt-button",
|
|
9101
|
+
i0.ɵɵelementStart(0, "div", 5);
|
|
9102
|
+
i0.ɵɵconditionalCreate(1, KptDataTable_Conditional_0_Conditional_1_Template, 1, 2, "input", 13);
|
|
9103
|
+
i0.ɵɵconditionalCreate(2, KptDataTable_Conditional_0_Conditional_2_Template, 2, 1, "kpt-button", 14);
|
|
8915
9104
|
i0.ɵɵelementEnd();
|
|
8916
9105
|
} if (rf & 2) {
|
|
8917
9106
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -8921,14 +9110,14 @@ function KptDataTable_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
8921
9110
|
i0.ɵɵconditional(ctx_r1.exportable() ? 2 : -1);
|
|
8922
9111
|
} }
|
|
8923
9112
|
function KptDataTable_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
8924
|
-
i0.ɵɵelementContainer(0,
|
|
9113
|
+
i0.ɵɵelementContainer(0, 8);
|
|
8925
9114
|
} if (rf & 2) {
|
|
8926
9115
|
i0.ɵɵnextContext();
|
|
8927
9116
|
const filterRowTpl_r4 = i0.ɵɵreference(22);
|
|
8928
9117
|
i0.ɵɵproperty("ngTemplateOutlet", filterRowTpl_r4);
|
|
8929
9118
|
} }
|
|
8930
9119
|
function KptDataTable_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
8931
|
-
i0.ɵɵelement(0, "th",
|
|
9120
|
+
i0.ɵɵelement(0, "th", 17);
|
|
8932
9121
|
} if (rf & 2) {
|
|
8933
9122
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
8934
9123
|
i0.ɵɵstyleProp("left", ctx_r1.expanderStickyLeft(), "px");
|
|
@@ -8936,7 +9125,7 @@ function KptDataTable_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
|
8936
9125
|
} }
|
|
8937
9126
|
function KptDataTable_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
8938
9127
|
const _r5 = i0.ɵɵgetCurrentView();
|
|
8939
|
-
i0.ɵɵelementStart(0, "th",
|
|
9128
|
+
i0.ɵɵelementStart(0, "th", 18)(1, "input", 19);
|
|
8940
9129
|
i0.ɵɵlistener("change", function KptDataTable_Conditional_9_Template_input_change_1_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleAllOnPage()); });
|
|
8941
9130
|
i0.ɵɵelementEnd()();
|
|
8942
9131
|
} if (rf & 2) {
|
|
@@ -8948,17 +9137,17 @@ function KptDataTable_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
|
8948
9137
|
i0.ɵɵattribute("aria-label", ctx_r1.i18n.t("dataTable.selectAll"));
|
|
8949
9138
|
} }
|
|
8950
9139
|
function KptDataTable_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
8951
|
-
i0.ɵɵelement(0, "th",
|
|
9140
|
+
i0.ɵɵelement(0, "th", 18);
|
|
8952
9141
|
} if (rf & 2) {
|
|
8953
9142
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
8954
9143
|
i0.ɵɵstyleProp("left", ctx_r1.checkboxStickyLeft(), "px");
|
|
8955
9144
|
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.hasFrozen());
|
|
8956
9145
|
} }
|
|
8957
9146
|
function KptDataTable_For_12_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
8958
|
-
i0.ɵɵelement(0, "kpt-icon",
|
|
9147
|
+
i0.ɵɵelement(0, "kpt-icon", 21);
|
|
8959
9148
|
} }
|
|
8960
9149
|
function KptDataTable_For_12_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
8961
|
-
i0.ɵɵelement(0, "kpt-icon",
|
|
9150
|
+
i0.ɵɵelement(0, "kpt-icon", 23);
|
|
8962
9151
|
} if (rf & 2) {
|
|
8963
9152
|
const col_r7 = i0.ɵɵnextContext().$implicit;
|
|
8964
9153
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -8967,20 +9156,19 @@ function KptDataTable_For_12_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
8967
9156
|
} }
|
|
8968
9157
|
function KptDataTable_For_12_Template(rf, ctx) { if (rf & 1) {
|
|
8969
9158
|
const _r6 = i0.ɵɵgetCurrentView();
|
|
8970
|
-
i0.ɵɵelementStart(0, "th",
|
|
8971
|
-
i0.ɵɵlistener("click", function KptDataTable_For_12_Template_th_click_0_listener() { const col_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleSort(col_r7)); })("dragstart", function KptDataTable_For_12_Template_th_dragstart_0_listener($event) { const
|
|
8972
|
-
i0.ɵɵconditionalCreate(1, KptDataTable_For_12_Conditional_1_Template, 1, 0, "kpt-icon",
|
|
9159
|
+
i0.ɵɵelementStart(0, "th", 20);
|
|
9160
|
+
i0.ɵɵlistener("click", function KptDataTable_For_12_Template_th_click_0_listener() { const col_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleSort(col_r7)); })("dragstart", function KptDataTable_For_12_Template_th_dragstart_0_listener($event) { const col_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onColDragStart(col_r7.field, $event)); })("dragover", function KptDataTable_For_12_Template_th_dragover_0_listener($event) { const col_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.reorderable() ? ctx_r1.onColDragOver(col_r7.field, $event) : null); })("drop", function KptDataTable_For_12_Template_th_drop_0_listener($event) { const col_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.reorderable() ? ctx_r1.onColDrop(col_r7.field, $event) : null); })("dragend", function KptDataTable_For_12_Template_th_dragend_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onColDragEnd()); });
|
|
9161
|
+
i0.ɵɵconditionalCreate(1, KptDataTable_For_12_Conditional_1_Template, 1, 0, "kpt-icon", 21);
|
|
8973
9162
|
i0.ɵɵelementStart(2, "span");
|
|
8974
9163
|
i0.ɵɵtext(3);
|
|
8975
9164
|
i0.ɵɵelementEnd();
|
|
8976
|
-
i0.ɵɵconditionalCreate(4, KptDataTable_For_12_Conditional_4_Template, 1, 3, "kpt-icon",
|
|
9165
|
+
i0.ɵɵconditionalCreate(4, KptDataTable_For_12_Conditional_4_Template, 1, 3, "kpt-icon", 22);
|
|
8977
9166
|
i0.ɵɵelementEnd();
|
|
8978
9167
|
} if (rf & 2) {
|
|
8979
9168
|
const col_r7 = ctx.$implicit;
|
|
8980
|
-
const ɵ$index_33_r8 = ctx.$index;
|
|
8981
9169
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
8982
9170
|
i0.ɵɵstyleProp("width", col_r7.width)("left", ctx_r1.frozenLeft(col_r7.field), "px");
|
|
8983
|
-
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.isFrozen(col_r7.field))("kpt-data-table__th--sortable", col_r7.sortable)("kpt-data-table__th--draggable", ctx_r1.isColDraggable(col_r7))("kpt-data-table__th--dragover", ctx_r1.
|
|
9171
|
+
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.isFrozen(col_r7.field))("kpt-data-table__th--sortable", col_r7.sortable)("kpt-data-table__th--draggable", ctx_r1.isColDraggable(col_r7))("kpt-data-table__th--dragover", ctx_r1.dragField() !== null && ctx_r1.dragField() !== col_r7.field && !col_r7.frozen);
|
|
8984
9172
|
i0.ɵɵattribute("draggable", ctx_r1.isColDraggable(col_r7) ? true : null)("data-align", col_r7.align ?? "start")("aria-sort", ctx_r1.ariaSort(col_r7));
|
|
8985
9173
|
i0.ɵɵadvance();
|
|
8986
9174
|
i0.ɵɵconditional(ctx_r1.isColDraggable(col_r7) ? 1 : -1);
|
|
@@ -8990,14 +9178,14 @@ function KptDataTable_For_12_Template(rf, ctx) { if (rf & 1) {
|
|
|
8990
9178
|
i0.ɵɵconditional(col_r7.sortable ? 4 : -1);
|
|
8991
9179
|
} }
|
|
8992
9180
|
function KptDataTable_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
8993
|
-
i0.ɵɵelementContainer(0,
|
|
9181
|
+
i0.ɵɵelementContainer(0, 8);
|
|
8994
9182
|
} if (rf & 2) {
|
|
8995
9183
|
i0.ɵɵnextContext();
|
|
8996
9184
|
const filterRowTpl_r4 = i0.ɵɵreference(22);
|
|
8997
9185
|
i0.ɵɵproperty("ngTemplateOutlet", filterRowTpl_r4);
|
|
8998
9186
|
} }
|
|
8999
9187
|
function KptDataTable_Conditional_15_Template(rf, ctx) { if (rf & 1) {
|
|
9000
|
-
i0.ɵɵelementStart(0, "tr")(1, "td",
|
|
9188
|
+
i0.ɵɵelementStart(0, "tr")(1, "td", 24);
|
|
9001
9189
|
i0.ɵɵtext(2);
|
|
9002
9190
|
i0.ɵɵelementEnd()();
|
|
9003
9191
|
} if (rf & 2) {
|
|
@@ -9008,7 +9196,7 @@ function KptDataTable_Conditional_15_Template(rf, ctx) { if (rf & 1) {
|
|
|
9008
9196
|
i0.ɵɵtextInterpolate(ctx_r1.i18n.t("dataTable.loading"));
|
|
9009
9197
|
} }
|
|
9010
9198
|
function KptDataTable_Conditional_16_Template(rf, ctx) { if (rf & 1) {
|
|
9011
|
-
i0.ɵɵelementStart(0, "tr")(1, "td",
|
|
9199
|
+
i0.ɵɵelementStart(0, "tr")(1, "td", 24);
|
|
9012
9200
|
i0.ɵɵtext(2);
|
|
9013
9201
|
i0.ɵɵelementEnd()();
|
|
9014
9202
|
} if (rf & 2) {
|
|
@@ -9019,7 +9207,7 @@ function KptDataTable_Conditional_16_Template(rf, ctx) { if (rf & 1) {
|
|
|
9019
9207
|
i0.ɵɵtextInterpolate(ctx_r1.emptyText());
|
|
9020
9208
|
} }
|
|
9021
9209
|
function KptDataTable_Conditional_17_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
9022
|
-
i0.ɵɵelementStart(0, "tr",
|
|
9210
|
+
i0.ɵɵelementStart(0, "tr", 25);
|
|
9023
9211
|
i0.ɵɵelement(1, "td");
|
|
9024
9212
|
i0.ɵɵelementEnd();
|
|
9025
9213
|
} if (rf & 2) {
|
|
@@ -9029,15 +9217,15 @@ function KptDataTable_Conditional_17_Conditional_0_Template(rf, ctx) { if (rf &
|
|
|
9029
9217
|
i0.ɵɵattribute("colspan", ctx_r1.colspan());
|
|
9030
9218
|
} }
|
|
9031
9219
|
function KptDataTable_Conditional_17_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
9032
|
-
i0.ɵɵelementContainer(0,
|
|
9220
|
+
i0.ɵɵelementContainer(0, 26);
|
|
9033
9221
|
} if (rf & 2) {
|
|
9034
|
-
const
|
|
9222
|
+
const row_r8 = ctx.$implicit;
|
|
9035
9223
|
i0.ɵɵnextContext(2);
|
|
9036
|
-
const
|
|
9037
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
9224
|
+
const rowTpl_r9 = i0.ɵɵreference(20);
|
|
9225
|
+
i0.ɵɵproperty("ngTemplateOutlet", rowTpl_r9)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c5, row_r8));
|
|
9038
9226
|
} }
|
|
9039
9227
|
function KptDataTable_Conditional_17_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
9040
|
-
i0.ɵɵelementStart(0, "tr",
|
|
9228
|
+
i0.ɵɵelementStart(0, "tr", 25);
|
|
9041
9229
|
i0.ɵɵelement(1, "td");
|
|
9042
9230
|
i0.ɵɵelementEnd();
|
|
9043
9231
|
} if (rf & 2) {
|
|
@@ -9047,9 +9235,9 @@ function KptDataTable_Conditional_17_Conditional_3_Template(rf, ctx) { if (rf &
|
|
|
9047
9235
|
i0.ɵɵattribute("colspan", ctx_r1.colspan());
|
|
9048
9236
|
} }
|
|
9049
9237
|
function KptDataTable_Conditional_17_Template(rf, ctx) { if (rf & 1) {
|
|
9050
|
-
i0.ɵɵconditionalCreate(0, KptDataTable_Conditional_17_Conditional_0_Template, 2, 3, "tr",
|
|
9051
|
-
i0.ɵɵrepeaterCreate(1, KptDataTable_Conditional_17_For_2_Template, 1, 4, "ng-container",
|
|
9052
|
-
i0.ɵɵconditionalCreate(3, KptDataTable_Conditional_17_Conditional_3_Template, 2, 3, "tr",
|
|
9238
|
+
i0.ɵɵconditionalCreate(0, KptDataTable_Conditional_17_Conditional_0_Template, 2, 3, "tr", 25);
|
|
9239
|
+
i0.ɵɵrepeaterCreate(1, KptDataTable_Conditional_17_For_2_Template, 1, 4, "ng-container", 26, _forTrack1, true);
|
|
9240
|
+
i0.ɵɵconditionalCreate(3, KptDataTable_Conditional_17_Conditional_3_Template, 2, 3, "tr", 25);
|
|
9053
9241
|
} if (rf & 2) {
|
|
9054
9242
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
9055
9243
|
i0.ɵɵconditional(ctx_r1.topPad() > 0 ? 0 : -1);
|
|
@@ -9059,219 +9247,298 @@ function KptDataTable_Conditional_17_Template(rf, ctx) { if (rf & 1) {
|
|
|
9059
9247
|
i0.ɵɵconditional(ctx_r1.bottomPad() > 0 ? 3 : -1);
|
|
9060
9248
|
} }
|
|
9061
9249
|
function KptDataTable_Conditional_18_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
9062
|
-
i0.ɵɵelementContainer(0,
|
|
9250
|
+
i0.ɵɵelementContainer(0, 26);
|
|
9063
9251
|
} if (rf & 2) {
|
|
9064
|
-
const
|
|
9252
|
+
const row_r10 = ctx.$implicit;
|
|
9065
9253
|
i0.ɵɵnextContext(2);
|
|
9066
|
-
const
|
|
9067
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
9254
|
+
const rowTpl_r9 = i0.ɵɵreference(20);
|
|
9255
|
+
i0.ɵɵproperty("ngTemplateOutlet", rowTpl_r9)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c5, row_r10));
|
|
9068
9256
|
} }
|
|
9069
9257
|
function KptDataTable_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
9070
|
-
i0.ɵɵrepeaterCreate(0, KptDataTable_Conditional_18_For_1_Template, 1, 4, "ng-container",
|
|
9258
|
+
i0.ɵɵrepeaterCreate(0, KptDataTable_Conditional_18_For_1_Template, 1, 4, "ng-container", 26, _forTrack1, true);
|
|
9071
9259
|
} if (rf & 2) {
|
|
9072
9260
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
9073
9261
|
i0.ɵɵrepeater(ctx_r1.paged());
|
|
9074
9262
|
} }
|
|
9075
9263
|
function KptDataTable_ng_template_19_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
9076
|
-
const
|
|
9077
|
-
i0.ɵɵelementStart(0, "td",
|
|
9078
|
-
i0.ɵɵlistener("click", function KptDataTable_ng_template_19_Conditional_1_Template_button_click_1_listener($event) { i0.ɵɵrestoreView(
|
|
9079
|
-
i0.ɵɵelement(2, "kpt-icon",
|
|
9264
|
+
const _r13 = i0.ɵɵgetCurrentView();
|
|
9265
|
+
i0.ɵɵelementStart(0, "td", 17)(1, "button", 30);
|
|
9266
|
+
i0.ɵɵlistener("click", function KptDataTable_ng_template_19_Conditional_1_Template_button_click_1_listener($event) { i0.ɵɵrestoreView(_r13); const row_r12 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); $event.stopPropagation(); return i0.ɵɵresetView(ctx_r1.toggleExpand(row_r12)); });
|
|
9267
|
+
i0.ɵɵelement(2, "kpt-icon", 31);
|
|
9080
9268
|
i0.ɵɵelementEnd()();
|
|
9081
9269
|
} if (rf & 2) {
|
|
9082
|
-
const
|
|
9270
|
+
const row_r12 = i0.ɵɵnextContext().$implicit;
|
|
9083
9271
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
9084
9272
|
i0.ɵɵstyleProp("left", ctx_r1.expanderStickyLeft(), "px");
|
|
9085
9273
|
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.hasFrozen());
|
|
9086
9274
|
i0.ɵɵadvance();
|
|
9087
|
-
i0.ɵɵclassProp("kpt-data-table__expander-btn--open", ctx_r1.isExpanded(
|
|
9088
|
-
i0.ɵɵattribute("aria-expanded", ctx_r1.isExpanded(
|
|
9275
|
+
i0.ɵɵclassProp("kpt-data-table__expander-btn--open", ctx_r1.isExpanded(row_r12));
|
|
9276
|
+
i0.ɵɵattribute("aria-expanded", ctx_r1.isExpanded(row_r12))("aria-label", ctx_r1.i18n.t("dataTable.expandRow"));
|
|
9089
9277
|
} }
|
|
9090
9278
|
function KptDataTable_ng_template_19_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
9091
|
-
const
|
|
9092
|
-
i0.ɵɵelementStart(0, "td",
|
|
9093
|
-
i0.ɵɵlistener("click", function KptDataTable_ng_template_19_Conditional_2_Template_input_click_1_listener($event) { return $event.stopPropagation(); })("change", function KptDataTable_ng_template_19_Conditional_2_Template_input_change_1_listener() { i0.ɵɵrestoreView(
|
|
9279
|
+
const _r14 = i0.ɵɵgetCurrentView();
|
|
9280
|
+
i0.ɵɵelementStart(0, "td", 18)(1, "input", 32);
|
|
9281
|
+
i0.ɵɵlistener("click", function KptDataTable_ng_template_19_Conditional_2_Template_input_click_1_listener($event) { return $event.stopPropagation(); })("change", function KptDataTable_ng_template_19_Conditional_2_Template_input_change_1_listener() { i0.ɵɵrestoreView(_r14); const row_r12 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleRow(row_r12)); });
|
|
9094
9282
|
i0.ɵɵelementEnd()();
|
|
9095
9283
|
} if (rf & 2) {
|
|
9096
|
-
const
|
|
9284
|
+
const row_r12 = i0.ɵɵnextContext().$implicit;
|
|
9097
9285
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
9098
9286
|
i0.ɵɵstyleProp("left", ctx_r1.checkboxStickyLeft(), "px");
|
|
9099
9287
|
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.hasFrozen());
|
|
9100
9288
|
i0.ɵɵadvance();
|
|
9101
|
-
i0.ɵɵproperty("checked", ctx_r1.isSelected(
|
|
9289
|
+
i0.ɵɵproperty("checked", ctx_r1.isSelected(row_r12));
|
|
9102
9290
|
i0.ɵɵattribute("aria-label", ctx_r1.i18n.t("dataTable.selectRow"));
|
|
9103
9291
|
} }
|
|
9292
|
+
function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
9293
|
+
i0.ɵɵelementContainer(0, 26);
|
|
9294
|
+
} if (rf & 2) {
|
|
9295
|
+
const row_r12 = i0.ɵɵnextContext(3).$implicit;
|
|
9296
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
9297
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx)("ngTemplateOutletContext", i0.ɵɵpureFunction4(2, _c7, ctx_r1.editingValue(), row_r12, ctx_r1.commitEditValue, ctx_r1.cancelEdit));
|
|
9298
|
+
} }
|
|
9299
|
+
function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_0_Template(rf, ctx) { if (rf & 1) {
|
|
9300
|
+
const _r18 = i0.ɵɵgetCurrentView();
|
|
9301
|
+
i0.ɵɵelementStart(0, "kpt-input", 41);
|
|
9302
|
+
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_0_Template_kpt_input_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r18); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.editingValue.set($event)); })("keydown.enter", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_0_Template_kpt_input_keydown_enter_0_listener() { i0.ɵɵrestoreView(_r18); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.commitEdit()); })("keydown.escape", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_0_Template_kpt_input_keydown_escape_0_listener() { i0.ɵɵrestoreView(_r18); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.cancelEdit()); });
|
|
9303
|
+
i0.ɵɵelementEnd();
|
|
9304
|
+
} if (rf & 2) {
|
|
9305
|
+
const col_r16 = i0.ɵɵnextContext(3).$implicit;
|
|
9306
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9307
|
+
i0.ɵɵproperty("value", ctx_r1.editingValue() ?? "")("placeholder", col_r16.edit.placeholder ?? "");
|
|
9308
|
+
} }
|
|
9309
|
+
function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_1_Template(rf, ctx) { if (rf & 1) {
|
|
9310
|
+
const _r19 = i0.ɵɵgetCurrentView();
|
|
9311
|
+
i0.ɵɵelementStart(0, "kpt-input-number", 42);
|
|
9312
|
+
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_1_Template_kpt_input_number_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r19); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.editingValue.set($event)); })("keydown.enter", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_1_Template_kpt_input_number_keydown_enter_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.commitEdit()); })("keydown.escape", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_1_Template_kpt_input_number_keydown_escape_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.cancelEdit()); });
|
|
9313
|
+
i0.ɵɵelementEnd();
|
|
9314
|
+
} if (rf & 2) {
|
|
9315
|
+
const col_r16 = i0.ɵɵnextContext(3).$implicit;
|
|
9316
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9317
|
+
i0.ɵɵproperty("value", ctx_r1.editingValue())("min", col_r16.edit.min)("max", col_r16.edit.max)("step", col_r16.edit.step ?? 1);
|
|
9318
|
+
} }
|
|
9319
|
+
function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
9320
|
+
const _r20 = i0.ɵɵgetCurrentView();
|
|
9321
|
+
i0.ɵɵelementStart(0, "kpt-datepicker", 43);
|
|
9322
|
+
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_2_Template_kpt_datepicker_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.editingValue.set($event)); })("openChange", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_2_Template_kpt_datepicker_openChange_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.onEditorPanelToggle($event)); });
|
|
9323
|
+
i0.ɵɵelementEnd();
|
|
9324
|
+
} if (rf & 2) {
|
|
9325
|
+
const ctx_r1 = i0.ɵɵnextContext(5);
|
|
9326
|
+
i0.ɵɵproperty("value", ctx_r1.editingValue() ?? "")("open", ctx_r1.editorPanelOpen());
|
|
9327
|
+
} }
|
|
9328
|
+
function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_3_Template(rf, ctx) { if (rf & 1) {
|
|
9329
|
+
const _r21 = i0.ɵɵgetCurrentView();
|
|
9330
|
+
i0.ɵɵelementStart(0, "kpt-select", 44);
|
|
9331
|
+
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_3_Template_kpt_select_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r21); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.editingValue.set($event)); })("openChange", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_3_Template_kpt_select_openChange_0_listener($event) { i0.ɵɵrestoreView(_r21); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.onEditorPanelToggle($event)); });
|
|
9332
|
+
i0.ɵɵelementEnd();
|
|
9333
|
+
} if (rf & 2) {
|
|
9334
|
+
const col_r16 = i0.ɵɵnextContext(3).$implicit;
|
|
9335
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9336
|
+
i0.ɵɵproperty("options", col_r16.edit.options ?? i0.ɵɵpureFunction0(4, _c8))("placeholder", col_r16.edit.placeholder ?? "")("value", ctx_r1.editingValue())("open", ctx_r1.editorPanelOpen());
|
|
9337
|
+
} }
|
|
9338
|
+
function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_4_Template(rf, ctx) { if (rf & 1) {
|
|
9339
|
+
const _r22 = i0.ɵɵgetCurrentView();
|
|
9340
|
+
i0.ɵɵelementStart(0, "kpt-select", 45);
|
|
9341
|
+
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_4_Template_kpt_select_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.editingValue.set($event)); })("openChange", function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_4_Template_kpt_select_openChange_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.onEditorPanelToggle($event)); });
|
|
9342
|
+
i0.ɵɵelementEnd();
|
|
9343
|
+
} if (rf & 2) {
|
|
9344
|
+
const col_r16 = i0.ɵɵnextContext(3).$implicit;
|
|
9345
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9346
|
+
i0.ɵɵproperty("options", col_r16.edit.options ?? i0.ɵɵpureFunction0(4, _c8))("placeholder", col_r16.edit.placeholder ?? "")("value", ctx_r1.editingValue())("open", ctx_r1.editorPanelOpen());
|
|
9347
|
+
} }
|
|
9348
|
+
function KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
9349
|
+
i0.ɵɵconditionalCreate(0, KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_0_Template, 1, 2, "kpt-input", 36)(1, KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_1_Template, 1, 4, "kpt-input-number", 37)(2, KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_2_Template, 1, 2, "kpt-datepicker", 38)(3, KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_3_Template, 1, 5, "kpt-select", 39)(4, KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Case_4_Template, 1, 5, "kpt-select", 40);
|
|
9350
|
+
} if (rf & 2) {
|
|
9351
|
+
let tmp_19_0;
|
|
9352
|
+
const col_r16 = i0.ɵɵnextContext(2).$implicit;
|
|
9353
|
+
i0.ɵɵconditional((tmp_19_0 = col_r16.edit?.type) === "text" ? 0 : tmp_19_0 === "number" ? 1 : tmp_19_0 === "date" ? 2 : tmp_19_0 === "select" ? 3 : tmp_19_0 === "multiselect" ? 4 : -1);
|
|
9354
|
+
} }
|
|
9104
9355
|
function KptDataTable_ng_template_19_For_4_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
9105
|
-
i0.ɵɵ
|
|
9356
|
+
const _r17 = i0.ɵɵgetCurrentView();
|
|
9357
|
+
i0.ɵɵelementStart(0, "div", 35, 4);
|
|
9358
|
+
i0.ɵɵlistener("click", function KptDataTable_ng_template_19_For_4_Conditional_1_Template_div_click_0_listener($event) { return $event.stopPropagation(); })("focusout", function KptDataTable_ng_template_19_For_4_Conditional_1_Template_div_focusout_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onEditorFocusOut($event)); });
|
|
9359
|
+
i0.ɵɵconditionalCreate(2, KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_2_Template, 1, 7, "ng-container", 26)(3, KptDataTable_ng_template_19_For_4_Conditional_1_Conditional_3_Template, 5, 1);
|
|
9360
|
+
i0.ɵɵelementEnd();
|
|
9106
9361
|
} if (rf & 2) {
|
|
9362
|
+
let tmp_18_0;
|
|
9107
9363
|
const col_r16 = i0.ɵɵnextContext().$implicit;
|
|
9108
|
-
const
|
|
9109
|
-
|
|
9110
|
-
i0.ɵɵ
|
|
9364
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9365
|
+
i0.ɵɵadvance(2);
|
|
9366
|
+
i0.ɵɵconditional((tmp_18_0 = ctx_r1.cellEditTemplate(col_r16.field)) ? 2 : 3, tmp_18_0);
|
|
9111
9367
|
} }
|
|
9112
9368
|
function KptDataTable_ng_template_19_For_4_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
9369
|
+
i0.ɵɵelementContainer(0, 26);
|
|
9370
|
+
} if (rf & 2) {
|
|
9371
|
+
const col_r16 = i0.ɵɵnextContext().$implicit;
|
|
9372
|
+
const row_r12 = i0.ɵɵnextContext().$implicit;
|
|
9373
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
9374
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c9, row_r12, ctx_r1.getValue(row_r12, col_r16.field)));
|
|
9375
|
+
} }
|
|
9376
|
+
function KptDataTable_ng_template_19_For_4_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
9113
9377
|
i0.ɵɵtext(0);
|
|
9114
9378
|
} if (rf & 2) {
|
|
9115
9379
|
const col_r16 = i0.ɵɵnextContext().$implicit;
|
|
9116
|
-
const
|
|
9380
|
+
const row_r12 = i0.ɵɵnextContext().$implicit;
|
|
9117
9381
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
9118
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r1.getValue(
|
|
9382
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.getValue(row_r12, col_r16.field), " ");
|
|
9119
9383
|
} }
|
|
9120
9384
|
function KptDataTable_ng_template_19_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
9121
|
-
i0.ɵɵ
|
|
9122
|
-
i0.ɵɵ
|
|
9385
|
+
const _r15 = i0.ɵɵgetCurrentView();
|
|
9386
|
+
i0.ɵɵelementStart(0, "td", 33);
|
|
9387
|
+
i0.ɵɵlistener("click", function KptDataTable_ng_template_19_For_4_Template_td_click_0_listener($event) { const col_r16 = i0.ɵɵrestoreView(_r15).$implicit; const row_r12 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.isEditable(col_r16) ? ctx_r1.startEdit(row_r12, col_r16, $event) : null); })("keydown.enter", function KptDataTable_ng_template_19_For_4_Template_td_keydown_enter_0_listener($event) { const col_r16 = i0.ɵɵrestoreView(_r15).$implicit; const row_r12 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.isEditable(col_r16) && !ctx_r1.isEditingCell(row_r12, col_r16.field) ? ctx_r1.startEdit(row_r12, col_r16, $event) : null); });
|
|
9388
|
+
i0.ɵɵconditionalCreate(1, KptDataTable_ng_template_19_For_4_Conditional_1_Template, 4, 1, "div", 34)(2, KptDataTable_ng_template_19_For_4_Conditional_2_Template, 1, 5, "ng-container", 26)(3, KptDataTable_ng_template_19_For_4_Conditional_3_Template, 1, 1);
|
|
9123
9389
|
i0.ɵɵelementEnd();
|
|
9124
9390
|
} if (rf & 2) {
|
|
9125
|
-
let
|
|
9391
|
+
let tmp_22_0;
|
|
9126
9392
|
const col_r16 = ctx.$implicit;
|
|
9127
|
-
const
|
|
9393
|
+
const row_r12 = i0.ɵɵnextContext().$implicit;
|
|
9394
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
9128
9395
|
i0.ɵɵstyleProp("left", ctx_r1.frozenLeft(col_r16.field), "px");
|
|
9129
|
-
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.isFrozen(col_r16.field));
|
|
9130
|
-
i0.ɵɵattribute("data-align", col_r16.align ?? "start");
|
|
9396
|
+
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.isFrozen(col_r16.field))("kpt-data-table__cell--editable", ctx_r1.isEditable(col_r16) && !ctx_r1.isEditingCell(row_r12, col_r16.field));
|
|
9397
|
+
i0.ɵɵattribute("data-align", col_r16.align ?? "start")("tabindex", ctx_r1.isEditable(col_r16) && !ctx_r1.isEditingCell(row_r12, col_r16.field) ? 0 : null)("aria-label", ctx_r1.isEditable(col_r16) && !ctx_r1.isEditingCell(row_r12, col_r16.field) ? ctx_r1.i18n.t("dataTable.editCell", i0.ɵɵpureFunction1(10, _c6, col_r16.header)) : null);
|
|
9131
9398
|
i0.ɵɵadvance();
|
|
9132
|
-
i0.ɵɵconditional((
|
|
9399
|
+
i0.ɵɵconditional(ctx_r1.isEditingCell(row_r12, col_r16.field) ? 1 : (tmp_22_0 = ctx_r1.cellTemplate(col_r16.field)) ? 2 : 3, tmp_22_0);
|
|
9133
9400
|
} }
|
|
9134
9401
|
function KptDataTable_ng_template_19_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
9135
|
-
i0.ɵɵelementStart(0, "tr",
|
|
9136
|
-
i0.ɵɵelementContainer(2,
|
|
9402
|
+
i0.ɵɵelementStart(0, "tr", 29)(1, "td", 46);
|
|
9403
|
+
i0.ɵɵelementContainer(2, 26);
|
|
9137
9404
|
i0.ɵɵelementEnd()();
|
|
9138
9405
|
} if (rf & 2) {
|
|
9139
|
-
const
|
|
9406
|
+
const row_r12 = i0.ɵɵnextContext().$implicit;
|
|
9140
9407
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
9141
9408
|
i0.ɵɵadvance();
|
|
9142
9409
|
i0.ɵɵattribute("colspan", ctx_r1.colspan());
|
|
9143
9410
|
i0.ɵɵadvance();
|
|
9144
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r1.rowDetailTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction1(3,
|
|
9411
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r1.rowDetailTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction1(3, _c5, row_r12));
|
|
9145
9412
|
} }
|
|
9146
9413
|
function KptDataTable_ng_template_19_Template(rf, ctx) { if (rf & 1) {
|
|
9147
|
-
const
|
|
9148
|
-
i0.ɵɵelementStart(0, "tr",
|
|
9149
|
-
i0.ɵɵlistener("click", function KptDataTable_ng_template_19_Template_tr_click_0_listener() { const
|
|
9150
|
-
i0.ɵɵconditionalCreate(1, KptDataTable_ng_template_19_Conditional_1_Template, 3, 8, "td",
|
|
9151
|
-
i0.ɵɵconditionalCreate(2, KptDataTable_ng_template_19_Conditional_2_Template, 2, 6, "td",
|
|
9152
|
-
i0.ɵɵrepeaterCreate(3, KptDataTable_ng_template_19_For_4_Template,
|
|
9414
|
+
const _r11 = i0.ɵɵgetCurrentView();
|
|
9415
|
+
i0.ɵɵelementStart(0, "tr", 27);
|
|
9416
|
+
i0.ɵɵlistener("click", function KptDataTable_ng_template_19_Template_tr_click_0_listener() { const row_r12 = i0.ɵɵrestoreView(_r11).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onRowClick(row_r12)); });
|
|
9417
|
+
i0.ɵɵconditionalCreate(1, KptDataTable_ng_template_19_Conditional_1_Template, 3, 8, "td", 9);
|
|
9418
|
+
i0.ɵɵconditionalCreate(2, KptDataTable_ng_template_19_Conditional_2_Template, 2, 6, "td", 10);
|
|
9419
|
+
i0.ɵɵrepeaterCreate(3, KptDataTable_ng_template_19_For_4_Template, 4, 12, "td", 28, _forTrack0$1);
|
|
9153
9420
|
i0.ɵɵelementEnd();
|
|
9154
|
-
i0.ɵɵconditionalCreate(5, KptDataTable_ng_template_19_Conditional_5_Template, 3, 5, "tr",
|
|
9421
|
+
i0.ɵɵconditionalCreate(5, KptDataTable_ng_template_19_Conditional_5_Template, 3, 5, "tr", 29);
|
|
9155
9422
|
} if (rf & 2) {
|
|
9156
|
-
const
|
|
9423
|
+
const row_r12 = ctx.$implicit;
|
|
9157
9424
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
9158
9425
|
i0.ɵɵstyleProp("height", ctx_r1.virtualScroll() ? ctx_r1.rowHeight() : null, "px");
|
|
9159
|
-
i0.ɵɵclassProp("kpt-data-table__row--selected", ctx_r1.isSelected(
|
|
9426
|
+
i0.ɵɵclassProp("kpt-data-table__row--selected", ctx_r1.isSelected(row_r12))("kpt-data-table__row--expanded", ctx_r1.hasRowDetail() && ctx_r1.isExpanded(row_r12));
|
|
9160
9427
|
i0.ɵɵadvance();
|
|
9161
9428
|
i0.ɵɵconditional(ctx_r1.hasRowDetail() ? 1 : -1);
|
|
9162
9429
|
i0.ɵɵadvance();
|
|
9163
9430
|
i0.ɵɵconditional(ctx_r1.selectable() !== "none" ? 2 : -1);
|
|
9164
9431
|
i0.ɵɵadvance();
|
|
9165
|
-
i0.ɵɵrepeater(ctx_r1.
|
|
9432
|
+
i0.ɵɵrepeater(ctx_r1.visibleOrderedColumns());
|
|
9166
9433
|
i0.ɵɵadvance(2);
|
|
9167
|
-
i0.ɵɵconditional(ctx_r1.hasRowDetail() && ctx_r1.isExpanded(
|
|
9434
|
+
i0.ɵɵconditional(ctx_r1.hasRowDetail() && ctx_r1.isExpanded(row_r12) && !ctx_r1.virtualScroll() ? 5 : -1);
|
|
9168
9435
|
} }
|
|
9169
9436
|
function KptDataTable_ng_template_21_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
9170
|
-
i0.ɵɵelement(0, "th",
|
|
9437
|
+
i0.ɵɵelement(0, "th", 17);
|
|
9171
9438
|
} if (rf & 2) {
|
|
9172
9439
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9173
9440
|
i0.ɵɵstyleProp("left", ctx_r1.expanderStickyLeft(), "px");
|
|
9174
9441
|
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.hasFrozen());
|
|
9175
9442
|
} }
|
|
9176
9443
|
function KptDataTable_ng_template_21_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
9177
|
-
i0.ɵɵelement(0, "th",
|
|
9444
|
+
i0.ɵɵelement(0, "th", 18);
|
|
9178
9445
|
} if (rf & 2) {
|
|
9179
9446
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9180
9447
|
i0.ɵɵstyleProp("left", ctx_r1.checkboxStickyLeft(), "px");
|
|
9181
9448
|
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.hasFrozen());
|
|
9182
9449
|
} }
|
|
9183
9450
|
function KptDataTable_ng_template_21_For_4_Case_1_Template(rf, ctx) { if (rf & 1) {
|
|
9184
|
-
const
|
|
9185
|
-
i0.ɵɵelementStart(0, "input",
|
|
9186
|
-
i0.ɵɵlistener("input", function KptDataTable_ng_template_21_For_4_Case_1_Template_input_input_0_listener($event) { i0.ɵɵrestoreView(
|
|
9451
|
+
const _r23 = i0.ɵɵgetCurrentView();
|
|
9452
|
+
i0.ɵɵelementStart(0, "input", 55);
|
|
9453
|
+
i0.ɵɵlistener("input", function KptDataTable_ng_template_21_For_4_Case_1_Template_input_input_0_listener($event) { i0.ɵɵrestoreView(_r23); const col_r24 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.setColumnFilter(col_r24.field, $event.target.value)); })("click", function KptDataTable_ng_template_21_For_4_Case_1_Template_input_click_0_listener($event) { return $event.stopPropagation(); });
|
|
9187
9454
|
i0.ɵɵelementEnd();
|
|
9188
9455
|
} if (rf & 2) {
|
|
9189
|
-
const
|
|
9456
|
+
const col_r24 = i0.ɵɵnextContext().$implicit;
|
|
9190
9457
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9191
|
-
i0.ɵɵproperty("value", ctx_r1.columnFilters()[
|
|
9192
|
-
i0.ɵɵattribute("placeholder",
|
|
9458
|
+
i0.ɵɵproperty("value", ctx_r1.columnFilters()[col_r24.field] || "");
|
|
9459
|
+
i0.ɵɵattribute("placeholder", col_r24.filter.placeholder || "")("aria-label", ctx_r1.i18n.t("dataTable.filter", i0.ɵɵpureFunction1(3, _c6, col_r24.header)));
|
|
9193
9460
|
} }
|
|
9194
9461
|
function KptDataTable_ng_template_21_For_4_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
9195
|
-
const
|
|
9196
|
-
i0.ɵɵelementStart(0, "input",
|
|
9197
|
-
i0.ɵɵlistener("input", function KptDataTable_ng_template_21_For_4_Case_2_Template_input_input_0_listener($event) { i0.ɵɵrestoreView(
|
|
9462
|
+
const _r25 = i0.ɵɵgetCurrentView();
|
|
9463
|
+
i0.ɵɵelementStart(0, "input", 56);
|
|
9464
|
+
i0.ɵɵlistener("input", function KptDataTable_ng_template_21_For_4_Case_2_Template_input_input_0_listener($event) { i0.ɵɵrestoreView(_r25); const col_r24 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onNumberFilter(col_r24.field, $event)); })("click", function KptDataTable_ng_template_21_For_4_Case_2_Template_input_click_0_listener($event) { return $event.stopPropagation(); });
|
|
9198
9465
|
i0.ɵɵelementEnd();
|
|
9199
9466
|
} if (rf & 2) {
|
|
9200
|
-
const
|
|
9467
|
+
const col_r24 = i0.ɵɵnextContext().$implicit;
|
|
9201
9468
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9202
|
-
i0.ɵɵproperty("value", ctx_r1.columnFilters()[
|
|
9203
|
-
i0.ɵɵattribute("placeholder",
|
|
9469
|
+
i0.ɵɵproperty("value", ctx_r1.columnFilters()[col_r24.field] || "");
|
|
9470
|
+
i0.ɵɵattribute("placeholder", col_r24.filter.placeholder || "")("aria-label", ctx_r1.i18n.t("dataTable.filter", i0.ɵɵpureFunction1(3, _c6, col_r24.header)));
|
|
9204
9471
|
} }
|
|
9205
9472
|
function KptDataTable_ng_template_21_For_4_Case_3_Template(rf, ctx) { if (rf & 1) {
|
|
9206
|
-
const
|
|
9207
|
-
i0.ɵɵelementStart(0, "kpt-select",
|
|
9208
|
-
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_21_For_4_Case_3_Template_kpt_select_valueChange_0_listener($event) { i0.ɵɵrestoreView(
|
|
9473
|
+
const _r26 = i0.ɵɵgetCurrentView();
|
|
9474
|
+
i0.ɵɵelementStart(0, "kpt-select", 57);
|
|
9475
|
+
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_21_For_4_Case_3_Template_kpt_select_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r26); const col_r24 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.setColumnFilter(col_r24.field, $event)); });
|
|
9209
9476
|
i0.ɵɵelementEnd();
|
|
9210
9477
|
} if (rf & 2) {
|
|
9211
|
-
const
|
|
9478
|
+
const col_r24 = i0.ɵɵnextContext().$implicit;
|
|
9212
9479
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9213
|
-
i0.ɵɵproperty("options",
|
|
9480
|
+
i0.ɵɵproperty("options", col_r24.filter.options || i0.ɵɵpureFunction0(4, _c8))("multiple", !!col_r24.filter.multiple)("placeholder", col_r24.filter.placeholder || ctx_r1.i18n.t("dataTable.all"))("value", ctx_r1.columnFilters()[col_r24.field] ?? null);
|
|
9214
9481
|
} }
|
|
9215
9482
|
function KptDataTable_ng_template_21_For_4_Case_4_Template(rf, ctx) { if (rf & 1) {
|
|
9216
|
-
const
|
|
9217
|
-
i0.ɵɵelementStart(0, "div",
|
|
9218
|
-
i0.ɵɵlistener("input", function KptDataTable_ng_template_21_For_4_Case_4_Template_input_input_1_listener($event) { i0.ɵɵrestoreView(
|
|
9483
|
+
const _r27 = i0.ɵɵgetCurrentView();
|
|
9484
|
+
i0.ɵɵelementStart(0, "div", 52)(1, "input", 56);
|
|
9485
|
+
i0.ɵɵlistener("input", function KptDataTable_ng_template_21_For_4_Case_4_Template_input_input_1_listener($event) { i0.ɵɵrestoreView(_r27); const col_r24 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.setRangeFilter(col_r24.field, "min", $event)); })("click", function KptDataTable_ng_template_21_For_4_Case_4_Template_input_click_1_listener($event) { return $event.stopPropagation(); });
|
|
9219
9486
|
i0.ɵɵelementEnd();
|
|
9220
|
-
i0.ɵɵelementStart(2, "input",
|
|
9221
|
-
i0.ɵɵlistener("input", function KptDataTable_ng_template_21_For_4_Case_4_Template_input_input_2_listener($event) { i0.ɵɵrestoreView(
|
|
9487
|
+
i0.ɵɵelementStart(2, "input", 56);
|
|
9488
|
+
i0.ɵɵlistener("input", function KptDataTable_ng_template_21_For_4_Case_4_Template_input_input_2_listener($event) { i0.ɵɵrestoreView(_r27); const col_r24 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.setRangeFilter(col_r24.field, "max", $event)); })("click", function KptDataTable_ng_template_21_For_4_Case_4_Template_input_click_2_listener($event) { return $event.stopPropagation(); });
|
|
9222
9489
|
i0.ɵɵelementEnd()();
|
|
9223
9490
|
} if (rf & 2) {
|
|
9224
|
-
const
|
|
9491
|
+
const col_r24 = i0.ɵɵnextContext().$implicit;
|
|
9225
9492
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9226
9493
|
i0.ɵɵadvance();
|
|
9227
|
-
i0.ɵɵproperty("value", ctx_r1.rangeVal(
|
|
9228
|
-
i0.ɵɵattribute("placeholder", ctx_r1.i18n.t("dataTable.min"))("aria-label", ctx_r1.i18n.t("dataTable.filterMin", i0.ɵɵpureFunction1(6,
|
|
9494
|
+
i0.ɵɵproperty("value", ctx_r1.rangeVal(col_r24.field).min);
|
|
9495
|
+
i0.ɵɵattribute("placeholder", ctx_r1.i18n.t("dataTable.min"))("aria-label", ctx_r1.i18n.t("dataTable.filterMin", i0.ɵɵpureFunction1(6, _c6, col_r24.header)));
|
|
9229
9496
|
i0.ɵɵadvance();
|
|
9230
|
-
i0.ɵɵproperty("value", ctx_r1.rangeVal(
|
|
9231
|
-
i0.ɵɵattribute("placeholder", ctx_r1.i18n.t("dataTable.max"))("aria-label", ctx_r1.i18n.t("dataTable.filterMax", i0.ɵɵpureFunction1(8,
|
|
9497
|
+
i0.ɵɵproperty("value", ctx_r1.rangeVal(col_r24.field).max);
|
|
9498
|
+
i0.ɵɵattribute("placeholder", ctx_r1.i18n.t("dataTable.max"))("aria-label", ctx_r1.i18n.t("dataTable.filterMax", i0.ɵɵpureFunction1(8, _c6, col_r24.header)));
|
|
9232
9499
|
} }
|
|
9233
9500
|
function KptDataTable_ng_template_21_For_4_Case_5_Template(rf, ctx) { if (rf & 1) {
|
|
9234
|
-
const
|
|
9235
|
-
i0.ɵɵelementStart(0, "div",
|
|
9501
|
+
const _r28 = i0.ɵɵgetCurrentView();
|
|
9502
|
+
i0.ɵɵelementStart(0, "div", 58);
|
|
9236
9503
|
i0.ɵɵlistener("click", function KptDataTable_ng_template_21_For_4_Case_5_Template_div_click_0_listener($event) { return $event.stopPropagation(); });
|
|
9237
|
-
i0.ɵɵelementStart(1, "kpt-slider",
|
|
9238
|
-
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_21_For_4_Case_5_Template_kpt_slider_valueChange_1_listener($event) { i0.ɵɵrestoreView(
|
|
9504
|
+
i0.ɵɵelementStart(1, "kpt-slider", 59);
|
|
9505
|
+
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_21_For_4_Case_5_Template_kpt_slider_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r28); const col_r24 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.setColumnFilter(col_r24.field, $event)); });
|
|
9239
9506
|
i0.ɵɵelementEnd()();
|
|
9240
9507
|
} if (rf & 2) {
|
|
9241
|
-
const
|
|
9508
|
+
const col_r24 = i0.ɵɵnextContext().$implicit;
|
|
9242
9509
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9243
9510
|
i0.ɵɵadvance();
|
|
9244
|
-
i0.ɵɵproperty("min",
|
|
9511
|
+
i0.ɵɵproperty("min", col_r24.filter.min ?? 0)("max", col_r24.filter.max ?? 100)("step", col_r24.filter.step ?? 1)("value", ctx_r1.sliderVal(col_r24));
|
|
9245
9512
|
} }
|
|
9246
9513
|
function KptDataTable_ng_template_21_For_4_Case_6_Template(rf, ctx) { if (rf & 1) {
|
|
9247
|
-
const
|
|
9248
|
-
i0.ɵɵelementStart(0, "kpt-date-range",
|
|
9249
|
-
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_21_For_4_Case_6_Template_kpt_date_range_valueChange_0_listener($event) { i0.ɵɵrestoreView(
|
|
9514
|
+
const _r29 = i0.ɵɵgetCurrentView();
|
|
9515
|
+
i0.ɵɵelementStart(0, "kpt-date-range", 60);
|
|
9516
|
+
i0.ɵɵlistener("valueChange", function KptDataTable_ng_template_21_For_4_Case_6_Template_kpt_date_range_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r29); const col_r24 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.setColumnFilter(col_r24.field, $event)); });
|
|
9250
9517
|
i0.ɵɵelementEnd();
|
|
9251
9518
|
} if (rf & 2) {
|
|
9252
|
-
const
|
|
9519
|
+
const col_r24 = i0.ɵɵnextContext().$implicit;
|
|
9253
9520
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9254
|
-
i0.ɵɵproperty("placeholder",
|
|
9521
|
+
i0.ɵɵproperty("placeholder", col_r24.filter.placeholder || ctx_r1.i18n.t("dataTable.dateRange"))("value", ctx_r1.columnFilters()[col_r24.field] || i0.ɵɵpureFunction0(2, _c10));
|
|
9255
9522
|
} }
|
|
9256
9523
|
function KptDataTable_ng_template_21_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
9257
9524
|
i0.ɵɵelementStart(0, "th");
|
|
9258
|
-
i0.ɵɵconditionalCreate(1, KptDataTable_ng_template_21_For_4_Case_1_Template, 1, 5, "input",
|
|
9525
|
+
i0.ɵɵconditionalCreate(1, KptDataTable_ng_template_21_For_4_Case_1_Template, 1, 5, "input", 49)(2, KptDataTable_ng_template_21_For_4_Case_2_Template, 1, 5, "input", 50)(3, KptDataTable_ng_template_21_For_4_Case_3_Template, 1, 5, "kpt-select", 51)(4, KptDataTable_ng_template_21_For_4_Case_4_Template, 3, 10, "div", 52)(5, KptDataTable_ng_template_21_For_4_Case_5_Template, 2, 4, "div", 53)(6, KptDataTable_ng_template_21_For_4_Case_6_Template, 1, 3, "kpt-date-range", 54);
|
|
9259
9526
|
i0.ɵɵelementEnd();
|
|
9260
9527
|
} if (rf & 2) {
|
|
9261
9528
|
let tmp_19_0;
|
|
9262
|
-
const
|
|
9529
|
+
const col_r24 = ctx.$implicit;
|
|
9263
9530
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
9264
|
-
i0.ɵɵstyleProp("width",
|
|
9265
|
-
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.isFrozen(
|
|
9266
|
-
i0.ɵɵattribute("data-align",
|
|
9531
|
+
i0.ɵɵstyleProp("width", col_r24.width)("left", ctx_r1.frozenLeft(col_r24.field), "px");
|
|
9532
|
+
i0.ɵɵclassProp("kpt-data-table__cell--frozen", ctx_r1.isFrozen(col_r24.field));
|
|
9533
|
+
i0.ɵɵattribute("data-align", col_r24.align ?? "start");
|
|
9267
9534
|
i0.ɵɵadvance();
|
|
9268
|
-
i0.ɵɵconditional((tmp_19_0 =
|
|
9535
|
+
i0.ɵɵconditional((tmp_19_0 = col_r24.filter?.type) === "text" ? 1 : tmp_19_0 === "number" ? 2 : tmp_19_0 === "select" ? 3 : tmp_19_0 === "numberRange" ? 4 : tmp_19_0 === "slider" ? 5 : tmp_19_0 === "dateRange" ? 6 : -1);
|
|
9269
9536
|
} }
|
|
9270
9537
|
function KptDataTable_ng_template_21_Template(rf, ctx) { if (rf & 1) {
|
|
9271
|
-
i0.ɵɵelementStart(0, "tr",
|
|
9272
|
-
i0.ɵɵconditionalCreate(1, KptDataTable_ng_template_21_Conditional_1_Template, 1, 4, "th",
|
|
9273
|
-
i0.ɵɵconditionalCreate(2, KptDataTable_ng_template_21_Conditional_2_Template, 1, 4, "th",
|
|
9274
|
-
i0.ɵɵrepeaterCreate(3, KptDataTable_ng_template_21_For_4_Template, 7, 8, "th",
|
|
9538
|
+
i0.ɵɵelementStart(0, "tr", 47);
|
|
9539
|
+
i0.ɵɵconditionalCreate(1, KptDataTable_ng_template_21_Conditional_1_Template, 1, 4, "th", 9);
|
|
9540
|
+
i0.ɵɵconditionalCreate(2, KptDataTable_ng_template_21_Conditional_2_Template, 1, 4, "th", 10);
|
|
9541
|
+
i0.ɵɵrepeaterCreate(3, KptDataTable_ng_template_21_For_4_Template, 7, 8, "th", 48, _forTrack0$1);
|
|
9275
9542
|
i0.ɵɵelementEnd();
|
|
9276
9543
|
} if (rf & 2) {
|
|
9277
9544
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -9280,20 +9547,34 @@ function KptDataTable_ng_template_21_Template(rf, ctx) { if (rf & 1) {
|
|
|
9280
9547
|
i0.ɵɵadvance();
|
|
9281
9548
|
i0.ɵɵconditional(ctx_r1.selectable() !== "none" ? 2 : -1);
|
|
9282
9549
|
i0.ɵɵadvance();
|
|
9283
|
-
i0.ɵɵrepeater(ctx_r1.
|
|
9550
|
+
i0.ɵɵrepeater(ctx_r1.visibleOrderedColumns());
|
|
9284
9551
|
} }
|
|
9285
9552
|
function KptDataTable_Conditional_23_Template(rf, ctx) { if (rf & 1) {
|
|
9286
|
-
const
|
|
9287
|
-
i0.ɵɵelementStart(0, "
|
|
9288
|
-
i0.ɵɵ
|
|
9289
|
-
i0.ɵɵ
|
|
9553
|
+
const _r30 = i0.ɵɵgetCurrentView();
|
|
9554
|
+
i0.ɵɵelementStart(0, "div", 12);
|
|
9555
|
+
i0.ɵɵprojection(1);
|
|
9556
|
+
i0.ɵɵelementStart(2, "kpt-paginator", 61);
|
|
9557
|
+
i0.ɵɵlistener("pageIndexChange", function KptDataTable_Conditional_23_Template_kpt_paginator_pageIndexChange_2_listener($event) { i0.ɵɵrestoreView(_r30); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.pageIndex.set($event)); })("pageSizeChange", function KptDataTable_Conditional_23_Template_kpt_paginator_pageSizeChange_2_listener($event) { i0.ɵɵrestoreView(_r30); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.pageSizeState.set($event)); });
|
|
9558
|
+
i0.ɵɵelementEnd()();
|
|
9290
9559
|
} if (rf & 2) {
|
|
9291
9560
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
9561
|
+
i0.ɵɵadvance(2);
|
|
9292
9562
|
i0.ɵɵproperty("length", ctx_r1.filteredCount())("pageIndex", ctx_r1.pageIndex())("pageSize", ctx_r1.pageSizeState())("pageSizeOptions", ctx_r1.pageSizeOptions());
|
|
9293
9563
|
} }
|
|
9294
9564
|
const REM_PX = 16;
|
|
9295
9565
|
const CHECKBOX_FROZEN_W = 3; // rem
|
|
9296
9566
|
const EXPANDER_FROZEN_W = 2.5; // rem
|
|
9567
|
+
/** Edytory renderujące panel w CDK Overlay — otwierane od razu i zatwierdzane na zamknięciu panelu. */
|
|
9568
|
+
const OVERLAY_EDITORS = ['date', 'select', 'multiselect'];
|
|
9569
|
+
/** Tablice (multiselect) porównujemy po zawartości, resztę po referencji. */
|
|
9570
|
+
function sameEditValue(a, b) {
|
|
9571
|
+
if (a === b)
|
|
9572
|
+
return true;
|
|
9573
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
9574
|
+
return a.length === b.length && a.every((v, i) => v === b[i]);
|
|
9575
|
+
}
|
|
9576
|
+
return false;
|
|
9577
|
+
}
|
|
9297
9578
|
/**
|
|
9298
9579
|
* Flagowa tabela danych Koncept UI: kolumny konfiguracją, sortowanie,
|
|
9299
9580
|
* filtr globalny, paginacja, zaznaczanie wierszy i własne szablony komórek (`kptCell`).
|
|
@@ -9362,9 +9643,18 @@ class KptDataTable {
|
|
|
9362
9643
|
/** Rozwinięte wiersze (dwukierunkowo). */
|
|
9363
9644
|
this.expandedRows = model([], /* @ts-ignore */
|
|
9364
9645
|
...(ngDevMode ? [{ debugName: "expandedRows" }] : /* istanbul ignore next */ []));
|
|
9646
|
+
/**
|
|
9647
|
+
* Pola (`KptColumn.field`) aktualnie ukrytych kolumn (dwukierunkowo). Sam komponent nie
|
|
9648
|
+
* dostarcza UI do zarządzania tym stanem — to hak do podpięcia zewnętrznego przełącznika
|
|
9649
|
+
* kolumn (patrz przykład „Dostosowywanie kolumn" w playground).
|
|
9650
|
+
*/
|
|
9651
|
+
this.hiddenFields = model([], /* @ts-ignore */
|
|
9652
|
+
...(ngDevMode ? [{ debugName: "hiddenFields" }] : /* istanbul ignore next */ []));
|
|
9365
9653
|
this.rowClick = output();
|
|
9366
9654
|
/** Emitowane w trybie lazy przy zmianie sortowania/filtra/strony. */
|
|
9367
9655
|
this.lazyLoad = output();
|
|
9656
|
+
/** Emitowane po zatwierdzeniu edycji komórki (tylko gdy wartość faktycznie się zmieniła). */
|
|
9657
|
+
this.cellEdit = output();
|
|
9368
9658
|
this.i18n = inject(KptI18n);
|
|
9369
9659
|
/** Komunikat pustej tabeli (input albo domyślny z i18n). */
|
|
9370
9660
|
this.emptyText = computed(() => this.emptyMessage() ?? this.i18n.t('dataTable.empty'), /* @ts-ignore */
|
|
@@ -9372,6 +9662,9 @@ class KptDataTable {
|
|
|
9372
9662
|
/** Kolumny w bieżącej kolejności (po ewentualnym przestawieniu). */
|
|
9373
9663
|
this.orderedColumns = linkedSignal(() => this.columns(), /* @ts-ignore */
|
|
9374
9664
|
...(ngDevMode ? [{ debugName: "orderedColumns" }] : /* istanbul ignore next */ []));
|
|
9665
|
+
/** Kolumny w bieżącej kolejności, bez tych ukrytych przez `hiddenFields` — do renderowania i eksportu. */
|
|
9666
|
+
this.visibleOrderedColumns = computed(() => this.orderedColumns().filter((c) => !this.hiddenFields().includes(c.field)), /* @ts-ignore */
|
|
9667
|
+
...(ngDevMode ? [{ debugName: "visibleOrderedColumns" }] : /* istanbul ignore next */ []));
|
|
9375
9668
|
// ── Wirtualizacja (ręczne okno wierszy) ──
|
|
9376
9669
|
this.scrollEl = viewChild('scrollEl', /* @ts-ignore */
|
|
9377
9670
|
...(ngDevMode ? [{ debugName: "scrollEl" }] : /* istanbul ignore next */ []));
|
|
@@ -9385,6 +9678,16 @@ class KptDataTable {
|
|
|
9385
9678
|
...(ngDevMode ? [{ debugName: "theadEl" }] : /* istanbul ignore next */ []));
|
|
9386
9679
|
this.theadOffset = signal(0, /* @ts-ignore */
|
|
9387
9680
|
...(ngDevMode ? [{ debugName: "theadOffset" }] : /* istanbul ignore next */ []));
|
|
9681
|
+
// ── Edycja inline komórek ──
|
|
9682
|
+
this.editingCell = signal(null, /* @ts-ignore */
|
|
9683
|
+
...(ngDevMode ? [{ debugName: "editingCell" }] : /* istanbul ignore next */ []));
|
|
9684
|
+
this.editingValue = signal(null, /* @ts-ignore */
|
|
9685
|
+
...(ngDevMode ? [{ debugName: "editingValue" }] : /* istanbul ignore next */ []));
|
|
9686
|
+
/** Czy panel edytora overlayowego (date/select/multiselect) jest otwarty. */
|
|
9687
|
+
this.editorPanelOpen = signal(false, /* @ts-ignore */
|
|
9688
|
+
...(ngDevMode ? [{ debugName: "editorPanelOpen" }] : /* istanbul ignore next */ []));
|
|
9689
|
+
this.editorHost = viewChild('editorHost', /* @ts-ignore */
|
|
9690
|
+
...(ngDevMode ? [{ debugName: "editorHost" }] : /* istanbul ignore next */ []));
|
|
9388
9691
|
this.virtualStart = computed(() => Math.max(0, Math.floor(this.scrollTop() / this.rowHeight()) - this.buffer), /* @ts-ignore */
|
|
9389
9692
|
...(ngDevMode ? [{ debugName: "virtualStart" }] : /* istanbul ignore next */ []));
|
|
9390
9693
|
this.virtualEnd = computed(() => {
|
|
@@ -9400,8 +9703,12 @@ class KptDataTable {
|
|
|
9400
9703
|
this.bottomPad = computed(() => (this.sorted().length - this.virtualEnd()) * this.rowHeight(), /* @ts-ignore */
|
|
9401
9704
|
...(ngDevMode ? [{ debugName: "bottomPad" }] : /* istanbul ignore next */ []));
|
|
9402
9705
|
// ── Przestawianie kolumn (natywny HTML5 drag-and-drop; działa w trybie zoneless) ──
|
|
9403
|
-
|
|
9404
|
-
|
|
9706
|
+
/**
|
|
9707
|
+
* Pole przeciąganej kolumny (nie indeks — przy ukrytych kolumnach `$index` z pętli
|
|
9708
|
+
* `visibleOrderedColumns()` nie odpowiada pozycji w pełnej `orderedColumns()`).
|
|
9709
|
+
*/
|
|
9710
|
+
this.dragField = signal(null, /* @ts-ignore */
|
|
9711
|
+
...(ngDevMode ? [{ debugName: "dragField" }] : /* istanbul ignore next */ []));
|
|
9405
9712
|
// ── Szablony komórek ──
|
|
9406
9713
|
this.cellDefs = contentChildren(KptCellDef, /* @ts-ignore */
|
|
9407
9714
|
...(ngDevMode ? [{ debugName: "cellDefs" }] : /* istanbul ignore next */ []));
|
|
@@ -9412,6 +9719,21 @@ class KptDataTable {
|
|
|
9412
9719
|
return map;
|
|
9413
9720
|
}, /* @ts-ignore */
|
|
9414
9721
|
...(ngDevMode ? [{ debugName: "cellMap" }] : /* istanbul ignore next */ []));
|
|
9722
|
+
// ── Własne edytory komórek (furtka poza wbudowane typy `column.edit.type`) ──
|
|
9723
|
+
this.cellEditDefs = contentChildren(KptCellEditDef, /* @ts-ignore */
|
|
9724
|
+
...(ngDevMode ? [{ debugName: "cellEditDefs" }] : /* istanbul ignore next */ []));
|
|
9725
|
+
this.cellEditMap = computed(() => {
|
|
9726
|
+
const map = new Map();
|
|
9727
|
+
for (const def of this.cellEditDefs())
|
|
9728
|
+
map.set(def.kptCellEdit(), def.template);
|
|
9729
|
+
return map;
|
|
9730
|
+
}, /* @ts-ignore */
|
|
9731
|
+
...(ngDevMode ? [{ debugName: "cellEditMap" }] : /* istanbul ignore next */ []));
|
|
9732
|
+
/** Dla własnych szablonów (`kptCellEdit`): ustaw wartość i od razu zatwierdź. */
|
|
9733
|
+
this.commitEditValue = (value) => {
|
|
9734
|
+
this.editingValue.set(value);
|
|
9735
|
+
this.commitEdit();
|
|
9736
|
+
};
|
|
9415
9737
|
// ── Rozwijane wiersze ──
|
|
9416
9738
|
this.rowDetailDef = contentChild(KptRowDetailDef, /* @ts-ignore */
|
|
9417
9739
|
...(ngDevMode ? [{ debugName: "rowDetailDef" }] : /* istanbul ignore next */ []));
|
|
@@ -9482,7 +9804,7 @@ class KptDataTable {
|
|
|
9482
9804
|
return rows.slice(start, start + size);
|
|
9483
9805
|
}, /* @ts-ignore */
|
|
9484
9806
|
...(ngDevMode ? [{ debugName: "paged" }] : /* istanbul ignore next */ []));
|
|
9485
|
-
this.colspan = computed(() => this.
|
|
9807
|
+
this.colspan = computed(() => this.visibleOrderedColumns().length +
|
|
9486
9808
|
(this.selectable() !== 'none' ? 1 : 0) +
|
|
9487
9809
|
(this.hasRowDetail() ? 1 : 0), /* @ts-ignore */
|
|
9488
9810
|
...(ngDevMode ? [{ debugName: "colspan" }] : /* istanbul ignore next */ []));
|
|
@@ -9502,7 +9824,7 @@ class KptDataTable {
|
|
|
9502
9824
|
this.frozenOffsets = computed(() => {
|
|
9503
9825
|
const map = new Map();
|
|
9504
9826
|
let acc = this.leadingStickyWidth();
|
|
9505
|
-
for (const col of this.
|
|
9827
|
+
for (const col of this.visibleOrderedColumns()) {
|
|
9506
9828
|
if (!col.frozen)
|
|
9507
9829
|
break; // tylko wiodące, sąsiadujące
|
|
9508
9830
|
map.set(col.field, acc);
|
|
@@ -9560,11 +9882,19 @@ class KptDataTable {
|
|
|
9560
9882
|
afterRenderEffect(() => {
|
|
9561
9883
|
this.filterRowPosition();
|
|
9562
9884
|
this.hasColumnFilters();
|
|
9563
|
-
this.
|
|
9885
|
+
this.visibleOrderedColumns();
|
|
9564
9886
|
const first = this.theadEl()?.nativeElement?.rows?.[0];
|
|
9565
9887
|
if (first)
|
|
9566
9888
|
this.theadOffset.set(first.offsetHeight);
|
|
9567
9889
|
});
|
|
9890
|
+
// Wejście w edycję komórki → przenieś fokus na jej edytor.
|
|
9891
|
+
afterRenderEffect(() => {
|
|
9892
|
+
if (!this.editingCell())
|
|
9893
|
+
return;
|
|
9894
|
+
this.editorHost()
|
|
9895
|
+
?.nativeElement.querySelector('input, .kpt-select, [tabindex]')
|
|
9896
|
+
?.focus();
|
|
9897
|
+
});
|
|
9568
9898
|
}
|
|
9569
9899
|
onScroll(event) {
|
|
9570
9900
|
if (!this.virtualScroll())
|
|
@@ -9577,10 +9907,10 @@ class KptDataTable {
|
|
|
9577
9907
|
isColDraggable(col) {
|
|
9578
9908
|
return this.reorderable() && !col.frozen;
|
|
9579
9909
|
}
|
|
9580
|
-
/** Liczba wiodących kolumn zamrożonych — poza nie wolno upuszczać ani ich przesuwać. */
|
|
9910
|
+
/** Liczba wiodących widocznych kolumn zamrożonych — poza nie wolno upuszczać ani ich przesuwać. */
|
|
9581
9911
|
frozenLeadCount() {
|
|
9582
9912
|
let n = 0;
|
|
9583
|
-
for (const col of this.
|
|
9913
|
+
for (const col of this.visibleOrderedColumns()) {
|
|
9584
9914
|
if (col.frozen)
|
|
9585
9915
|
n++;
|
|
9586
9916
|
else
|
|
@@ -9588,45 +9918,48 @@ class KptDataTable {
|
|
|
9588
9918
|
}
|
|
9589
9919
|
return n;
|
|
9590
9920
|
}
|
|
9591
|
-
onColDragStart(
|
|
9592
|
-
|
|
9921
|
+
onColDragStart(field, event) {
|
|
9922
|
+
const col = this.orderedColumns().find((c) => c.field === field);
|
|
9923
|
+
if (col?.frozen)
|
|
9593
9924
|
return; // frozen nieprzeciągalne
|
|
9594
|
-
this.
|
|
9595
|
-
event.dataTransfer?.setData('text/plain',
|
|
9925
|
+
this.dragField.set(field);
|
|
9926
|
+
event.dataTransfer?.setData('text/plain', field);
|
|
9596
9927
|
if (event.dataTransfer)
|
|
9597
9928
|
event.dataTransfer.effectAllowed = 'move';
|
|
9598
9929
|
}
|
|
9599
|
-
onColDragOver(
|
|
9930
|
+
onColDragOver(field, event) {
|
|
9600
9931
|
// Zezwól na upuszczenie tylko poza obszarem kolumn zamrożonych.
|
|
9601
|
-
|
|
9932
|
+
const visIndex = this.visibleOrderedColumns().findIndex((c) => c.field === field);
|
|
9933
|
+
if (this.dragField() !== null && visIndex >= this.frozenLeadCount())
|
|
9602
9934
|
event.preventDefault();
|
|
9603
9935
|
}
|
|
9604
|
-
onColDrop(
|
|
9936
|
+
onColDrop(field, event) {
|
|
9605
9937
|
event.preventDefault();
|
|
9606
|
-
const from = this.
|
|
9607
|
-
if (from === null || from ===
|
|
9938
|
+
const from = this.dragField();
|
|
9939
|
+
if (from === null || from === field)
|
|
9608
9940
|
return;
|
|
9609
|
-
|
|
9941
|
+
const visIndex = this.visibleOrderedColumns().findIndex((c) => c.field === field);
|
|
9942
|
+
if (visIndex < this.frozenLeadCount())
|
|
9610
9943
|
return; // nie wsuwaj przed/pomiędzy kolumny zamrożone
|
|
9611
9944
|
const cols = [...this.orderedColumns()];
|
|
9612
|
-
const
|
|
9613
|
-
cols.
|
|
9945
|
+
const fromIdx = cols.findIndex((c) => c.field === from);
|
|
9946
|
+
const toIdx = cols.findIndex((c) => c.field === field);
|
|
9947
|
+
if (fromIdx === -1 || toIdx === -1)
|
|
9948
|
+
return;
|
|
9949
|
+
const [moved] = cols.splice(fromIdx, 1);
|
|
9950
|
+
cols.splice(toIdx, 0, moved);
|
|
9614
9951
|
this.orderedColumns.set(cols);
|
|
9615
|
-
this.
|
|
9952
|
+
this.dragField.set(null);
|
|
9616
9953
|
}
|
|
9617
9954
|
onColDragEnd() {
|
|
9618
|
-
this.
|
|
9955
|
+
this.dragField.set(null);
|
|
9619
9956
|
}
|
|
9620
9957
|
exportCsv() {
|
|
9621
|
-
const cols = this.
|
|
9958
|
+
const cols = this.visibleOrderedColumns();
|
|
9622
9959
|
const rows = this.lazy() ? this.data() : this.sorted();
|
|
9623
|
-
const
|
|
9624
|
-
const text = String(value ?? '');
|
|
9625
|
-
return /[",\n;]/.test(text) ? `"${text.replace(/"/g, '""')}"` : text;
|
|
9626
|
-
};
|
|
9627
|
-
const header = cols.map((c) => escape(c.header)).join(';');
|
|
9960
|
+
const header = cols.map((c) => escapeCsvCell(c.header)).join(';');
|
|
9628
9961
|
const body = rows
|
|
9629
|
-
.map((row) => cols.map((c) =>
|
|
9962
|
+
.map((row) => cols.map((c) => escapeCsvCell(row[c.field])).join(';'))
|
|
9630
9963
|
.join('\n');
|
|
9631
9964
|
// BOM () — poprawne polskie znaki w Excelu.
|
|
9632
9965
|
const csv = `${header}\n${body}`;
|
|
@@ -9641,6 +9974,72 @@ class KptDataTable {
|
|
|
9641
9974
|
cellTemplate(field) {
|
|
9642
9975
|
return this.cellMap().get(field) ?? null;
|
|
9643
9976
|
}
|
|
9977
|
+
cellEditTemplate(field) {
|
|
9978
|
+
return this.cellEditMap().get(field) ?? null;
|
|
9979
|
+
}
|
|
9980
|
+
// ── Edycja inline komórek ──
|
|
9981
|
+
isEditable(col) {
|
|
9982
|
+
return !!col.edit || !!this.cellEditTemplate(col.field);
|
|
9983
|
+
}
|
|
9984
|
+
isEditingCell(row, field) {
|
|
9985
|
+
const e = this.editingCell();
|
|
9986
|
+
return !!e && e.field === field && this.sameRow(e.row, row);
|
|
9987
|
+
}
|
|
9988
|
+
startEdit(row, col, event) {
|
|
9989
|
+
event.stopPropagation();
|
|
9990
|
+
if (!this.isEditable(col) || this.isEditingCell(row, col.field))
|
|
9991
|
+
return;
|
|
9992
|
+
this.editingCell.set({ row, field: col.field });
|
|
9993
|
+
this.editingValue.set(this.getValue(row, col.field));
|
|
9994
|
+
// Edytory na overlayu otwieramy od razu. To nie kosmetyka: backdrop CDK sprawia, że każdy klik
|
|
9995
|
+
// poza edytorem zamyka panel, a więc zatwierdza i zamyka edycję — bez tego edytor z zamkniętym
|
|
9996
|
+
// panelem potrafiłby zostać otwarty w nieskończoność.
|
|
9997
|
+
const type = col.edit?.type;
|
|
9998
|
+
this.editorPanelOpen.set(!!type && OVERLAY_EDITORS.includes(type));
|
|
9999
|
+
}
|
|
10000
|
+
/**
|
|
10001
|
+
* Panel edytora zamknięty (wybór, klik poza, Esc) → zatwierdź. Celowo NIE wieszamy tego na
|
|
10002
|
+
* `touch`: ten leci też z blur triggera, czyli już przy naciśnięciu myszy na opcji w panelu —
|
|
10003
|
+
* edytor ginąłby, zanim kliknięcie zdąży wybrać wartość.
|
|
10004
|
+
*/
|
|
10005
|
+
onEditorPanelToggle(open) {
|
|
10006
|
+
this.editorPanelOpen.set(open);
|
|
10007
|
+
if (!open)
|
|
10008
|
+
this.commitEdit();
|
|
10009
|
+
}
|
|
10010
|
+
/**
|
|
10011
|
+
* Edytory bez overlaya (text/number, własne `kptCellEdit`) zatwierdza dopiero wyjście fokusu
|
|
10012
|
+
* **poza cały edytor**. Nie wystarczy `touch`/blur samej kontrolki: `kpt-input-number` ma
|
|
10013
|
+
* fokusowalne strzałki `+`/`-` obok pola (i dodatkowo emituje `touch` w `step_()`), więc każde
|
|
10014
|
+
* kliknięcie strzałki zamykałoby edycję, zanim zdąży zmienić wartość.
|
|
10015
|
+
*/
|
|
10016
|
+
onEditorFocusOut(event) {
|
|
10017
|
+
if (this.editorPanelOpen())
|
|
10018
|
+
return; // edytory overlayowe zatwierdza zamknięcie panelu
|
|
10019
|
+
const host = this.editorHost()?.nativeElement;
|
|
10020
|
+
const next = event.relatedTarget;
|
|
10021
|
+
if (host && next && host.contains(next))
|
|
10022
|
+
return; // fokus został w edytorze (np. strzałki +/-)
|
|
10023
|
+
this.commitEdit();
|
|
10024
|
+
}
|
|
10025
|
+
/** Zatwierdza bieżącą edycję — emituje `cellEdit` tylko gdy wartość faktycznie się zmieniła. */
|
|
10026
|
+
commitEdit() {
|
|
10027
|
+
const editing = this.editingCell();
|
|
10028
|
+
if (!editing)
|
|
10029
|
+
return;
|
|
10030
|
+
const { row, field } = editing;
|
|
10031
|
+
const value = this.editingValue();
|
|
10032
|
+
this.editingCell.set(null);
|
|
10033
|
+
this.editorPanelOpen.set(false);
|
|
10034
|
+
if (sameEditValue(value, this.getValue(row, field)))
|
|
10035
|
+
return;
|
|
10036
|
+
const updatedRow = { ...row, [field]: value };
|
|
10037
|
+
this.cellEdit.emit({ row, field, value, updatedRow });
|
|
10038
|
+
}
|
|
10039
|
+
cancelEdit() {
|
|
10040
|
+
this.editingCell.set(null);
|
|
10041
|
+
this.editorPanelOpen.set(false);
|
|
10042
|
+
}
|
|
9644
10043
|
isExpanded(row) {
|
|
9645
10044
|
return this.expandedRows().some((r) => this.sameRow(r, row));
|
|
9646
10045
|
}
|
|
@@ -9837,33 +10236,34 @@ class KptDataTable {
|
|
|
9837
10236
|
}
|
|
9838
10237
|
static { this.ɵfac = function KptDataTable_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptDataTable)(); }; }
|
|
9839
10238
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptDataTable, selectors: [["kpt-data-table"]], contentQueries: function KptDataTable_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
|
|
9840
|
-
i0.ɵɵcontentQuerySignal(dirIndex, ctx.cellDefs, KptCellDef, 4)(dirIndex, ctx.rowDetailDef, KptRowDetailDef, 5);
|
|
10239
|
+
i0.ɵɵcontentQuerySignal(dirIndex, ctx.cellDefs, KptCellDef, 4)(dirIndex, ctx.cellEditDefs, KptCellEditDef, 4)(dirIndex, ctx.rowDetailDef, KptRowDetailDef, 5);
|
|
9841
10240
|
} if (rf & 2) {
|
|
9842
|
-
i0.ɵɵqueryAdvance(
|
|
10241
|
+
i0.ɵɵqueryAdvance(3);
|
|
9843
10242
|
} }, viewQuery: function KptDataTable_Query(rf, ctx) { if (rf & 1) {
|
|
9844
|
-
i0.ɵɵviewQuerySignal(ctx.scrollEl, _c0$e, 5)(ctx.theadEl, _c1$5, 5);
|
|
10243
|
+
i0.ɵɵviewQuerySignal(ctx.scrollEl, _c0$e, 5)(ctx.theadEl, _c1$5, 5)(ctx.editorHost, _c2$2, 5);
|
|
9845
10244
|
} if (rf & 2) {
|
|
9846
|
-
i0.ɵɵqueryAdvance(
|
|
10245
|
+
i0.ɵɵqueryAdvance(3);
|
|
9847
10246
|
} }, hostAttrs: [1, "kpt-data-table"], hostVars: 2, hostBindings: function KptDataTable_HostBindings(rf, ctx) { if (rf & 2) {
|
|
9848
10247
|
i0.ɵɵstyleProp("--%NS%kpt-thead-offset", ctx.theadOffset() + "px");
|
|
9849
|
-
} }, inputs: { columns: [1, "columns"], data: [1, "data"], filterable: [1, "filterable"], filterRowPosition: [1, "filterRowPosition"], pageSize: [1, "pageSize"], pageSizeOptions: [1, "pageSizeOptions"], selectable: [1, "selectable"], loading: [1, "loading"], emptyMessage: [1, "emptyMessage"], rowKey: [1, "rowKey"], scrollHeight: [1, "scrollHeight"], virtualScroll: [1, "virtualScroll"], rowHeight: [1, "rowHeight"], reorderable: [1, "reorderable"], exportable: [1, "exportable"], exportFilename: [1, "exportFilename"], lazy: [1, "lazy"], totalRecords: [1, "totalRecords"], expandable: [1, "expandable"], multiExpand: [1, "multiExpand"], selection: [1, "selection"], expandedRows: [1, "expandedRows"] }, outputs: { selection: "selectionChange", expandedRows: "expandedRowsChange", rowClick: "rowClick", lazyLoad: "lazyLoad" }, decls: 24, vars: 13, consts: [["scrollEl", ""], ["theadEl", ""], ["rowTpl", ""], ["filterRowTpl", ""], [1, "kpt-data-table__toolbar"], [1, "kpt-data-table__scroll", 3, "scroll"], [1, "kpt-data-table__table"], [3, "ngTemplateOutlet"], [1, "kpt-data-table__expander", 3, "kpt-data-table__cell--frozen", "left"], [1, "kpt-data-table__checkbox", 3, "kpt-data-table__cell--frozen", "left"], [3, "width", "left", "kpt-data-table__cell--frozen", "kpt-data-table__th--sortable", "kpt-data-table__th--draggable", "kpt-data-table__th--dragover"], [
|
|
9850
|
-
i0.ɵɵ
|
|
9851
|
-
i0.ɵɵ
|
|
10248
|
+
} }, inputs: { columns: [1, "columns"], data: [1, "data"], filterable: [1, "filterable"], filterRowPosition: [1, "filterRowPosition"], pageSize: [1, "pageSize"], pageSizeOptions: [1, "pageSizeOptions"], selectable: [1, "selectable"], loading: [1, "loading"], emptyMessage: [1, "emptyMessage"], rowKey: [1, "rowKey"], scrollHeight: [1, "scrollHeight"], virtualScroll: [1, "virtualScroll"], rowHeight: [1, "rowHeight"], reorderable: [1, "reorderable"], exportable: [1, "exportable"], exportFilename: [1, "exportFilename"], lazy: [1, "lazy"], totalRecords: [1, "totalRecords"], expandable: [1, "expandable"], multiExpand: [1, "multiExpand"], selection: [1, "selection"], expandedRows: [1, "expandedRows"], hiddenFields: [1, "hiddenFields"] }, outputs: { selection: "selectionChange", expandedRows: "expandedRowsChange", hiddenFields: "hiddenFieldsChange", rowClick: "rowClick", lazyLoad: "lazyLoad", cellEdit: "cellEdit" }, ngContentSelectors: _c4, decls: 24, vars: 13, consts: [["scrollEl", ""], ["theadEl", ""], ["rowTpl", ""], ["filterRowTpl", ""], ["editorHost", ""], [1, "kpt-data-table__toolbar"], [1, "kpt-data-table__scroll", 3, "scroll"], [1, "kpt-data-table__table"], [3, "ngTemplateOutlet"], [1, "kpt-data-table__expander", 3, "kpt-data-table__cell--frozen", "left"], [1, "kpt-data-table__checkbox", 3, "kpt-data-table__cell--frozen", "left"], [3, "width", "left", "kpt-data-table__cell--frozen", "kpt-data-table__th--sortable", "kpt-data-table__th--draggable", "kpt-data-table__th--dragover"], [1, "kpt-data-table__pager"], ["type", "search", 1, "kpt-data-table__filter", 3, "value"], ["variant", "outline", "size", "sm"], ["type", "search", 1, "kpt-data-table__filter", 3, "input", "value"], ["variant", "outline", "size", "sm", 3, "click"], [1, "kpt-data-table__expander"], [1, "kpt-data-table__checkbox"], ["type", "checkbox", 3, "change", "checked", "indeterminate"], [3, "click", "dragstart", "dragover", "drop", "dragend"], ["name", "grip-vertical", 1, "kpt-data-table__grip"], [1, "kpt-data-table__sort", 3, "kpt-data-table__sort--active", "name"], [1, "kpt-data-table__sort", 3, "name"], [1, "kpt-data-table__state"], ["aria-hidden", "true", 1, "kpt-data-table__spacer"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [3, "click"], [3, "left", "kpt-data-table__cell--frozen", "kpt-data-table__cell--editable"], [1, "kpt-data-table__detail-row"], ["type", "button", 1, "kpt-data-table__expander-btn", 3, "click"], ["name", "chevron-right"], ["type", "checkbox", 3, "click", "change", "checked"], [3, "click", "keydown.enter"], [1, "kpt-data-table__editor"], [1, "kpt-data-table__editor", 3, "click", "focusout"], [3, "value", "placeholder"], [3, "value", "min", "max", "step"], [3, "value", "open"], [3, "options", "placeholder", "value", "open"], ["multiple", "", "filter", "", 3, "options", "placeholder", "value", "open"], [3, "valueChange", "keydown.enter", "keydown.escape", "value", "placeholder"], [3, "valueChange", "keydown.enter", "keydown.escape", "value", "min", "max", "step"], [3, "valueChange", "openChange", "value", "open"], [3, "valueChange", "openChange", "options", "placeholder", "value", "open"], ["multiple", "", "filter", "", 3, "valueChange", "openChange", "options", "placeholder", "value", "open"], [1, "kpt-data-table__detail"], [1, "kpt-data-table__filter-row"], [3, "width", "left", "kpt-data-table__cell--frozen"], ["type", "search", 1, "kpt-data-table__fcell", 3, "value"], ["type", "text", "inputmode", "numeric", 1, "kpt-data-table__fcell", 3, "value"], ["filter", "", 3, "options", "multiple", "placeholder", "value"], [1, "kpt-data-table__frange"], [1, "kpt-data-table__fslider"], [3, "placeholder", "value"], ["type", "search", 1, "kpt-data-table__fcell", 3, "input", "click", "value"], ["type", "text", "inputmode", "numeric", 1, "kpt-data-table__fcell", 3, "input", "click", "value"], ["filter", "", 3, "valueChange", "options", "multiple", "placeholder", "value"], [1, "kpt-data-table__fslider", 3, "click"], ["range", "", "showValue", "", 3, "valueChange", "min", "max", "step", "value"], [3, "valueChange", "placeholder", "value"], [3, "pageIndexChange", "pageSizeChange", "length", "pageIndex", "pageSize", "pageSizeOptions"]], template: function KptDataTable_Template(rf, ctx) { if (rf & 1) {
|
|
10249
|
+
i0.ɵɵprojectionDef(_c3);
|
|
10250
|
+
i0.ɵɵconditionalCreate(0, KptDataTable_Conditional_0_Template, 3, 2, "div", 5);
|
|
10251
|
+
i0.ɵɵelementStart(1, "div", 6, 0);
|
|
9852
10252
|
i0.ɵɵlistener("scroll", function KptDataTable_Template_div_scroll_1_listener($event) { return ctx.onScroll($event); });
|
|
9853
|
-
i0.ɵɵelementStart(3, "table",
|
|
9854
|
-
i0.ɵɵconditionalCreate(6, KptDataTable_Conditional_6_Template, 1, 1, "ng-container",
|
|
10253
|
+
i0.ɵɵelementStart(3, "table", 7)(4, "thead", null, 1);
|
|
10254
|
+
i0.ɵɵconditionalCreate(6, KptDataTable_Conditional_6_Template, 1, 1, "ng-container", 8);
|
|
9855
10255
|
i0.ɵɵelementStart(7, "tr");
|
|
9856
|
-
i0.ɵɵconditionalCreate(8, KptDataTable_Conditional_8_Template, 1, 4, "th",
|
|
9857
|
-
i0.ɵɵconditionalCreate(9, KptDataTable_Conditional_9_Template, 2, 7, "th",
|
|
9858
|
-
i0.ɵɵrepeaterCreate(11, KptDataTable_For_12_Template, 5, 18, "th",
|
|
10256
|
+
i0.ɵɵconditionalCreate(8, KptDataTable_Conditional_8_Template, 1, 4, "th", 9);
|
|
10257
|
+
i0.ɵɵconditionalCreate(9, KptDataTable_Conditional_9_Template, 2, 7, "th", 10)(10, KptDataTable_Conditional_10_Template, 1, 4, "th", 10);
|
|
10258
|
+
i0.ɵɵrepeaterCreate(11, KptDataTable_For_12_Template, 5, 18, "th", 11, _forTrack0$1);
|
|
9859
10259
|
i0.ɵɵelementEnd();
|
|
9860
|
-
i0.ɵɵconditionalCreate(13, KptDataTable_Conditional_13_Template, 1, 1, "ng-container",
|
|
10260
|
+
i0.ɵɵconditionalCreate(13, KptDataTable_Conditional_13_Template, 1, 1, "ng-container", 8);
|
|
9861
10261
|
i0.ɵɵelementEnd();
|
|
9862
10262
|
i0.ɵɵelementStart(14, "tbody");
|
|
9863
10263
|
i0.ɵɵconditionalCreate(15, KptDataTable_Conditional_15_Template, 3, 2, "tr")(16, KptDataTable_Conditional_16_Template, 3, 2, "tr")(17, KptDataTable_Conditional_17_Template, 4, 2)(18, KptDataTable_Conditional_18_Template, 2, 0);
|
|
9864
10264
|
i0.ɵɵelementEnd()()();
|
|
9865
10265
|
i0.ɵɵtemplate(19, KptDataTable_ng_template_19_Template, 6, 9, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor)(21, KptDataTable_ng_template_21_Template, 5, 2, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
|
|
9866
|
-
i0.ɵɵconditionalCreate(23, KptDataTable_Conditional_23_Template,
|
|
10266
|
+
i0.ɵɵconditionalCreate(23, KptDataTable_Conditional_23_Template, 3, 4, "div", 12);
|
|
9867
10267
|
} if (rf & 2) {
|
|
9868
10268
|
i0.ɵɵconditional(ctx.filterable() || ctx.exportable() ? 0 : -1);
|
|
9869
10269
|
i0.ɵɵadvance();
|
|
@@ -9877,23 +10277,43 @@ class KptDataTable {
|
|
|
9877
10277
|
i0.ɵɵadvance();
|
|
9878
10278
|
i0.ɵɵconditional(ctx.selectable() === "multiple" ? 9 : ctx.selectable() === "single" ? 10 : -1);
|
|
9879
10279
|
i0.ɵɵadvance(2);
|
|
9880
|
-
i0.ɵɵrepeater(ctx.
|
|
10280
|
+
i0.ɵɵrepeater(ctx.visibleOrderedColumns());
|
|
9881
10281
|
i0.ɵɵadvance(2);
|
|
9882
10282
|
i0.ɵɵconditional(ctx.hasColumnFilters() && ctx.filterRowPosition() === "bottom" ? 13 : -1);
|
|
9883
10283
|
i0.ɵɵadvance(2);
|
|
9884
10284
|
i0.ɵɵconditional(ctx.loading() ? 15 : ctx.displayCount() === 0 ? 16 : ctx.virtualScroll() ? 17 : 18);
|
|
9885
10285
|
i0.ɵɵadvance(8);
|
|
9886
10286
|
i0.ɵɵconditional(ctx.pageSize() > 0 && !ctx.virtualScroll() ? 23 : -1);
|
|
9887
|
-
} }, dependencies: [NgTemplateOutlet,
|
|
10287
|
+
} }, dependencies: [NgTemplateOutlet,
|
|
10288
|
+
KptButton,
|
|
10289
|
+
KptIcon,
|
|
10290
|
+
KptPaginator,
|
|
10291
|
+
KptSelect,
|
|
10292
|
+
KptDateRange,
|
|
10293
|
+
KptSlider,
|
|
10294
|
+
KptInput,
|
|
10295
|
+
KptInputNumber,
|
|
10296
|
+
KptDatepicker], styles: ["@layer kpt.components{.kpt-data-table{display:flex;flex-direction:column;background:var(--%NS%kpt-table-bg);color:var(--%NS%kpt-table-fg);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-table-border);border-radius:var(--%NS%kpt-table-radius, .75rem);overflow:hidden;flex-grow:1}.kpt-data-table__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--%NS%kpt-space-3, .75rem);padding:var(--%NS%kpt-space-3, .75rem);border-bottom:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-table-border)}.kpt-data-table__filter{width:100%;max-width:20rem;height:2.25rem;padding-inline:var(--%NS%kpt-space-3, .75rem);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-form-field-border);border-radius:var(--%NS%kpt-form-field-radius, .5rem);background:var(--%NS%kpt-form-field-bg);color:var(--%NS%kpt-form-field-text)}.kpt-data-table__filter:focus-visible{outline:none;border-color:var(--%NS%kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--%NS%kpt-form-field-border-focus) 30%,transparent)}.kpt-data-table__scroll{overflow:auto}.kpt-data-table__pager{display:flex;align-items:center;gap:var(--%NS%kpt-space-2, .5rem)}.kpt-data-table__pager [kptPaginatorActions]{margin-inline-start:.5rem}.kpt-data-table__pager kpt-paginator{flex:1 1 auto;min-width:0}.kpt-data-table__table{width:100%;border-collapse:collapse;font-size:var(--%NS%kpt-font-size-sm, .875rem)}.kpt-data-table__table--frozen{width:max-content;min-width:100%}.kpt-data-table__table th,.kpt-data-table__table td{padding:var(--%NS%kpt-table-cell-padding, .75rem);text-align:start;border-bottom:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-table-border)}.kpt-data-table__table th[data-align=center],.kpt-data-table__table td[data-align=center]{text-align:center}.kpt-data-table__table th[data-align=end],.kpt-data-table__table td[data-align=end]{text-align:end}.kpt-data-table__table thead th{position:sticky;top:0;z-index:1;background:var(--%NS%kpt-table-header-bg);color:var(--%NS%kpt-table-header-fg);font-weight:var(--%NS%kpt-font-weight-semibold, 600);white-space:nowrap;-webkit-user-select:none;user-select:none}.kpt-data-table__table thead tr:nth-child(2) th{top:var(--%NS%kpt-thead-offset, 0px)}.kpt-data-table__filter-row th{padding:var(--%NS%kpt-space-2, .5rem);font-weight:var(--%NS%kpt-font-weight-normal, 400);cursor:auto}.kpt-data-table__fcell{width:100%;height:2rem;padding-inline:var(--%NS%kpt-space-2, .5rem);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-form-field-border);border-radius:var(--%NS%kpt-form-field-radius, .5rem);background:var(--%NS%kpt-form-field-bg);color:var(--%NS%kpt-form-field-text);font:inherit}.kpt-data-table__fcell:focus-visible{outline:none;border-color:var(--%NS%kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--%NS%kpt-form-field-border-focus) 30%,transparent)}.kpt-data-table__filter-row kpt-select,.kpt-data-table__filter-row kpt-date-range{display:block;width:100%;font-weight:var(--%NS%kpt-font-weight-normal, 400)}.kpt-data-table__frange{display:flex;gap:var(--%NS%kpt-space-2, .5rem)}.kpt-data-table__frange .kpt-data-table__fcell{min-width:0}.kpt-data-table__fslider .kpt-slider-host{width:100%}.kpt-data-table__fslider .kpt-slider__value{min-width:auto;font-size:var(--%NS%kpt-font-size-xs, .75rem);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-data-table__th--sortable{cursor:pointer}.kpt-data-table__th--%NS%sortable:hover{color:var(--%NS%kpt-color-on-surface)}.kpt-data-table__cell--editable{cursor:pointer}.kpt-data-table__cell--%NS%editable:hover{background:var(--%NS%kpt-table-row-hover)}.kpt-data-table__cell--%NS%editable:focus-visible{outline:var(--%NS%kpt-border-width-medium, 2px) solid var(--%NS%kpt-color-focus-ring);outline-offset:-2px}.kpt-data-table__editor{display:block;min-width:8rem}.kpt-data-table__editor .kpt-input-number-host{max-width:6.5rem}.kpt-data-table__editor .kpt-input-number__btn{width:1.75rem}.kpt-data-table__sort{margin-inline-start:.35em;opacity:.35}.kpt-data-table__sort--active{opacity:1}.kpt-data-table__th--draggable{cursor:grab}.kpt-data-table__th--%NS%draggable:active{cursor:grabbing}.kpt-data-table__th--dragover{box-shadow:inset 2px 0 0 0 var(--%NS%kpt-color-primary)}.kpt-data-table__grip{margin-inline-end:.4em;opacity:.45}.kpt-data-table__checkbox{width:1px;white-space:nowrap;text-align:center}.kpt-data-table__checkbox input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;display:inline-block;width:1.15rem;height:1.15rem;margin:0;vertical-align:middle;cursor:pointer;border:var(--%NS%kpt-border-width-medium, 2px) solid var(--%NS%kpt-form-field-border);border-radius:var(--%NS%kpt-radius-sm, .25rem);background:var(--%NS%kpt-form-field-bg);transition:background-color var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard),border-color var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard)}.kpt-data-table__checkbox input[type=checkbox]:after{content:\"\";position:absolute;inset:0;opacity:0;background-color:var(--%NS%kpt-color-on-primary);transition:opacity var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard);-webkit-mask:no-repeat center/.85rem;mask:no-repeat center/.85rem}.kpt-data-table__checkbox input[type=checkbox]:checked,.kpt-data-table__checkbox input[type=checkbox]:indeterminate{background:var(--%NS%kpt-color-primary);border-color:var(--%NS%kpt-color-primary)}.kpt-data-table__checkbox input[type=checkbox]:checked:after{opacity:1;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13 4.5 6.5 11 3 7.5' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13 4.5 6.5 11 3 7.5' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")}.kpt-data-table__checkbox input[type=checkbox]:indeterminate:after{opacity:1;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8h9' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8h9' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round'/%3E%3C/svg%3E\")}.kpt-data-table__checkbox input[type=checkbox]:focus-visible{outline:var(--%NS%kpt-border-width-medium, 2px) solid var(--%NS%kpt-color-focus-ring);outline-offset:2px}.kpt-data-table__expander{width:2.5rem;min-width:2.5rem;text-align:center;white-space:nowrap}.kpt-data-table__expander-btn{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;border:none;border-radius:var(--%NS%kpt-radius-sm, .25rem);background:transparent;color:var(--%NS%kpt-color-on-surface-muted);cursor:pointer;transition:background-color var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard),color var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard)}.kpt-data-table__expander-btn kpt-icon{display:inline-flex;transition:transform var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard)}.kpt-data-table__expander-btn:hover{background:var(--%NS%kpt-table-row-hover);color:var(--%NS%kpt-color-on-surface)}.kpt-data-table__expander-btn:focus-visible{outline:var(--%NS%kpt-border-width-medium, 2px) solid var(--%NS%kpt-color-focus-ring);outline-offset:2px}.kpt-data-table__expander-btn--open{color:var(--%NS%kpt-color-primary)}.kpt-data-table__expander-btn--open kpt-icon{transform:rotate(90deg)}.kpt-data-table__detail-row>.kpt-data-table__detail{padding:var(--%NS%kpt-space-4, 1rem);background:var(--%NS%kpt-table-detail-bg, var(--%NS%kpt-color-surface-variant, var(--%NS%kpt-table-row-hover)));border-bottom:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-table-border);box-shadow:inset 3px 0 0 0 var(--%NS%kpt-color-primary)}.kpt-data-table tbody tr{transition:background-color var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard)}.kpt-data-table tbody tr:hover{background:var(--%NS%kpt-table-row-hover)}.kpt-data-table tbody tr.kpt-data-table__detail-row:hover{background:transparent}.kpt-data-table__row--selected{background:var(--%NS%kpt-table-row-selected)!important}.kpt-data-table__row--expanded{background:var(--%NS%kpt-table-row-hover)}.kpt-data-table__table--frozen .kpt-data-table__checkbox{width:3rem;min-width:3rem}.kpt-data-table__table--frozen .kpt-data-table__expander{width:2.5rem;min-width:2.5rem}.kpt-data-table__cell--frozen{position:sticky;z-index:1;background:var(--%NS%kpt-table-bg);border-inline-end:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-table-border)}.kpt-data-table thead th.kpt-data-table__cell--frozen{z-index:3;background:var(--%NS%kpt-table-header-bg)}.kpt-data-table tbody tr:hover .kpt-data-table__cell--frozen{background:var(--%NS%kpt-table-row-hover)}.kpt-data-table__row--selected.kpt-data-table__row--selected .kpt-data-table__cell--frozen,.kpt-data-table tbody tr.kpt-data-table__row--selected .kpt-data-table__cell--frozen{background:var(--%NS%kpt-table-row-selected)}.kpt-data-table__state{padding:var(--%NS%kpt-space-8, 2rem)!important;text-align:center!important;color:var(--%NS%kpt-color-on-surface-muted)}.kpt-data-table__table--virtual td{padding-block:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.kpt-data-table__spacer td{padding:0!important;border:0!important}.kpt-data-table tbody tr:last-child td{border-bottom:0}}\n"], encapsulation: 2 }); }
|
|
9888
10297
|
}
|
|
9889
10298
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptDataTable, [{
|
|
9890
10299
|
type: Component,
|
|
9891
|
-
args: [{ selector: 'kpt-data-table', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
10300
|
+
args: [{ selector: 'kpt-data-table', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
10301
|
+
NgTemplateOutlet,
|
|
10302
|
+
KptButton,
|
|
10303
|
+
KptIcon,
|
|
10304
|
+
KptPaginator,
|
|
10305
|
+
KptSelect,
|
|
10306
|
+
KptDateRange,
|
|
10307
|
+
KptSlider,
|
|
10308
|
+
KptInput,
|
|
10309
|
+
KptInputNumber,
|
|
10310
|
+
KptDatepicker,
|
|
10311
|
+
], host: {
|
|
9892
10312
|
'class': 'kpt-data-table',
|
|
9893
10313
|
'[style.--kpt-thead-offset]': "theadOffset() + 'px'",
|
|
9894
|
-
}, template: "@if (filterable() || exportable()) {\n <div class=\"kpt-data-table__toolbar\">\n @if (filterable()) {\n <input\n class=\"kpt-data-table__filter\"\n type=\"search\"\n [attr.placeholder]=\"i18n.t('dataTable.search')\"\n [value]=\"filterText()\"\n (input)=\"onFilter($event)\"\n />\n }\n @if (exportable()) {\n <kpt-button variant=\"outline\" size=\"sm\" (click)=\"exportCsv()\">{{ i18n.t('dataTable.exportCsv') }}</kpt-button>\n }\n </div>\n}\n\n<div class=\"kpt-data-table__scroll\" #scrollEl [style.max-height]=\"scrollHeight()\" (scroll)=\"onScroll($event)\">\n <table\n class=\"kpt-data-table__table\"\n [class.kpt-data-table__table--frozen]=\"hasFrozen()\"\n [class.kpt-data-table__table--virtual]=\"virtualScroll()\"\n >\n <thead #theadEl>\n @if (hasColumnFilters() && filterRowPosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"filterRowTpl\" />\n }\n <tr>\n @if (hasRowDetail()) {\n <th class=\"kpt-data-table__expander\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"expanderStickyLeft()\"></th>\n }\n @if (selectable() === 'multiple') {\n <th class=\"kpt-data-table__checkbox\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"checkboxStickyLeft()\">\n <input\n type=\"checkbox\"\n [checked]=\"pageAllSelected()\"\n [indeterminate]=\"pageSomeSelected()\"\n (change)=\"toggleAllOnPage()\"\n [attr.aria-label]=\"i18n.t('dataTable.selectAll')\"\n />\n </th>\n } @else if (selectable() === 'single') {\n <th class=\"kpt-data-table__checkbox\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"checkboxStickyLeft()\"></th>\n }\n @for (col of orderedColumns(); track col.field; let i = $index) {\n <th\n [attr.draggable]=\"isColDraggable(col) ? true : null\"\n [style.width]=\"col.width\"\n [style.left.px]=\"frozenLeft(col.field)\"\n [attr.data-align]=\"col.align ?? 'start'\"\n [class.kpt-data-table__cell--frozen]=\"isFrozen(col.field)\"\n [class.kpt-data-table__th--sortable]=\"col.sortable\"\n [class.kpt-data-table__th--draggable]=\"isColDraggable(col)\"\n [class.kpt-data-table__th--dragover]=\"dragIndex() !== null && dragIndex() !== i && !col.frozen\"\n [attr.aria-sort]=\"ariaSort(col)\"\n (click)=\"toggleSort(col)\"\n (dragstart)=\"onColDragStart(i, $event)\"\n (dragover)=\"reorderable() ? onColDragOver(i, $event) : null\"\n (drop)=\"reorderable() ? onColDrop(i, $event) : null\"\n (dragend)=\"onColDragEnd()\"\n >\n @if (isColDraggable(col)) {\n <kpt-icon class=\"kpt-data-table__grip\" name=\"grip-vertical\" />\n }\n <span>{{ col.header }}</span>\n @if (col.sortable) {\n <kpt-icon\n class=\"kpt-data-table__sort\"\n [class.kpt-data-table__sort--active]=\"ariaSort(col) !== 'none'\"\n [name]=\"sortIconName(col)\"\n />\n }\n </th>\n }\n </tr>\n @if (hasColumnFilters() && filterRowPosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"filterRowTpl\" />\n }\n </thead>\n <tbody>\n @if (loading()) {\n <tr><td class=\"kpt-data-table__state\" [attr.colspan]=\"colspan()\">{{ i18n.t('dataTable.loading') }}</td></tr>\n } @else if (displayCount() === 0) {\n <tr><td class=\"kpt-data-table__state\" [attr.colspan]=\"colspan()\">{{ emptyText() }}</td></tr>\n } @else if (virtualScroll()) {\n @if (topPad() > 0) {\n <tr class=\"kpt-data-table__spacer\" aria-hidden=\"true\"><td [attr.colspan]=\"colspan()\" [style.height.px]=\"topPad()\"></td></tr>\n }\n @for (row of virtualRows(); track trackRow(row)) {\n <ng-container [ngTemplateOutlet]=\"rowTpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n }\n @if (bottomPad() > 0) {\n <tr class=\"kpt-data-table__spacer\" aria-hidden=\"true\"><td [attr.colspan]=\"colspan()\" [style.height.px]=\"bottomPad()\"></td></tr>\n }\n } @else {\n @for (row of paged(); track trackRow(row)) {\n <ng-container [ngTemplateOutlet]=\"rowTpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n }\n }\n </tbody>\n </table>\n</div>\n\n<ng-template #rowTpl let-row>\n <tr\n [class.kpt-data-table__row--selected]=\"isSelected(row)\"\n [class.kpt-data-table__row--expanded]=\"hasRowDetail() && isExpanded(row)\"\n [style.height.px]=\"virtualScroll() ? rowHeight() : null\"\n (click)=\"onRowClick(row)\"\n >\n @if (hasRowDetail()) {\n <td class=\"kpt-data-table__expander\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"expanderStickyLeft()\">\n <button\n type=\"button\"\n class=\"kpt-data-table__expander-btn\"\n [class.kpt-data-table__expander-btn--open]=\"isExpanded(row)\"\n [attr.aria-expanded]=\"isExpanded(row)\"\n [attr.aria-label]=\"i18n.t('dataTable.expandRow')\"\n (click)=\"$event.stopPropagation(); toggleExpand(row)\"\n >\n <kpt-icon name=\"chevron-right\" />\n </button>\n </td>\n }\n @if (selectable() !== 'none') {\n <td class=\"kpt-data-table__checkbox\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"checkboxStickyLeft()\">\n <input\n type=\"checkbox\"\n [checked]=\"isSelected(row)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"toggleRow(row)\"\n [attr.aria-label]=\"i18n.t('dataTable.selectRow')\"\n />\n </td>\n }\n @for (col of orderedColumns(); track col.field) {\n <td\n [attr.data-align]=\"col.align ?? 'start'\"\n [style.left.px]=\"frozenLeft(col.field)\"\n [class.kpt-data-table__cell--frozen]=\"isFrozen(col.field)\"\n >\n @if (cellTemplate(col.field); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row, value: getValue(row, col.field) }\"\n />\n } @else {\n {{ getValue(row, col.field) }}\n }\n </td>\n }\n </tr>\n @if (hasRowDetail() && isExpanded(row) && !virtualScroll()) {\n <tr class=\"kpt-data-table__detail-row\">\n <td class=\"kpt-data-table__detail\" [attr.colspan]=\"colspan()\">\n <ng-container [ngTemplateOutlet]=\"rowDetailTpl()\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </td>\n </tr>\n }\n</ng-template>\n\n<ng-template #filterRowTpl>\n <tr class=\"kpt-data-table__filter-row\">\n @if (hasRowDetail()) {\n <th class=\"kpt-data-table__expander\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"expanderStickyLeft()\"></th>\n }\n @if (selectable() !== 'none') {\n <th class=\"kpt-data-table__checkbox\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"checkboxStickyLeft()\"></th>\n }\n @for (col of orderedColumns(); track col.field) {\n <th\n [style.width]=\"col.width\"\n [style.left.px]=\"frozenLeft(col.field)\"\n [attr.data-align]=\"col.align ?? 'start'\"\n [class.kpt-data-table__cell--frozen]=\"isFrozen(col.field)\"\n >\n @switch (col.filter?.type) {\n @case ('text') {\n <input\n class=\"kpt-data-table__fcell\"\n type=\"search\"\n [attr.placeholder]=\"col.filter.placeholder || ''\"\n [attr.aria-label]=\"i18n.t('dataTable.filter', { column: col.header })\"\n [value]=\"$any(columnFilters()[col.field]) || ''\"\n (input)=\"setColumnFilter(col.field, $any($event.target).value)\"\n (click)=\"$event.stopPropagation()\"\n />\n }\n @case ('number') {\n <input\n class=\"kpt-data-table__fcell\"\n type=\"text\"\n inputmode=\"numeric\"\n [attr.placeholder]=\"col.filter.placeholder || ''\"\n [attr.aria-label]=\"i18n.t('dataTable.filter', { column: col.header })\"\n [value]=\"$any(columnFilters()[col.field]) || ''\"\n (input)=\"onNumberFilter(col.field, $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n }\n @case ('select') {\n <kpt-select\n [options]=\"col.filter.options || []\"\n [multiple]=\"!!col.filter.multiple\"\n filter\n [placeholder]=\"col.filter.placeholder || i18n.t('dataTable.all')\"\n [value]=\"columnFilters()[col.field] ?? null\"\n (valueChange)=\"setColumnFilter(col.field, $event)\"\n />\n }\n @case ('numberRange') {\n <div class=\"kpt-data-table__frange\">\n <input\n class=\"kpt-data-table__fcell\"\n type=\"text\"\n inputmode=\"numeric\"\n [attr.placeholder]=\"i18n.t('dataTable.min')\"\n [attr.aria-label]=\"i18n.t('dataTable.filterMin', { column: col.header })\"\n [value]=\"rangeVal(col.field).min\"\n (input)=\"setRangeFilter(col.field, 'min', $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n <input\n class=\"kpt-data-table__fcell\"\n type=\"text\"\n inputmode=\"numeric\"\n [attr.placeholder]=\"i18n.t('dataTable.max')\"\n [attr.aria-label]=\"i18n.t('dataTable.filterMax', { column: col.header })\"\n [value]=\"rangeVal(col.field).max\"\n (input)=\"setRangeFilter(col.field, 'max', $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n </div>\n }\n @case ('slider') {\n <div class=\"kpt-data-table__fslider\" (click)=\"$event.stopPropagation()\">\n <kpt-slider\n range\n [min]=\"col.filter.min ?? 0\"\n [max]=\"col.filter.max ?? 100\"\n [step]=\"col.filter.step ?? 1\"\n [value]=\"sliderVal(col)\"\n (valueChange)=\"setColumnFilter(col.field, $event)\"\n showValue\n />\n </div>\n }\n @case ('dateRange') {\n <kpt-date-range\n [placeholder]=\"col.filter.placeholder || i18n.t('dataTable.dateRange')\"\n [value]=\"$any(columnFilters()[col.field]) || { start: '', end: '' }\"\n (valueChange)=\"setColumnFilter(col.field, $event)\"\n />\n }\n }\n </th>\n }\n </tr>\n</ng-template>\n\n@if (pageSize() > 0 && !virtualScroll()) {\n <kpt-paginator\n [length]=\"filteredCount()\"\n [pageIndex]=\"pageIndex()\"\n (pageIndexChange)=\"pageIndex.set($event)\"\n [pageSize]=\"pageSizeState()\"\n (pageSizeChange)=\"pageSizeState.set($event)\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n />\n}\n", styles: ["@layer kpt.components{.kpt-data-table{display:flex;flex-direction:column;background:var(--kpt-table-bg);color:var(--kpt-table-fg);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border);border-radius:var(--kpt-table-radius, .75rem);overflow:hidden}.kpt-data-table__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--kpt-space-3, .75rem);padding:var(--kpt-space-3, .75rem);border-bottom:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border)}.kpt-data-table__filter{width:100%;max-width:20rem;height:2.25rem;padding-inline:var(--kpt-space-3, .75rem);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-form-field-radius, .5rem);background:var(--kpt-form-field-bg);color:var(--kpt-form-field-text)}.kpt-data-table__filter:focus-visible{outline:none;border-color:var(--kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-focus) 30%,transparent)}.kpt-data-table__scroll{overflow:auto}.kpt-data-table__table{width:100%;border-collapse:collapse;font-size:var(--kpt-font-size-sm, .875rem)}.kpt-data-table__table--frozen{width:max-content;min-width:100%}.kpt-data-table__table th,.kpt-data-table__table td{padding:var(--kpt-table-cell-padding, .75rem);text-align:start;border-bottom:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border)}.kpt-data-table__table th[data-align=center],.kpt-data-table__table td[data-align=center]{text-align:center}.kpt-data-table__table th[data-align=end],.kpt-data-table__table td[data-align=end]{text-align:end}.kpt-data-table__table thead th{position:sticky;top:0;z-index:1;background:var(--kpt-table-header-bg);color:var(--kpt-table-header-fg);font-weight:var(--kpt-font-weight-semibold, 600);white-space:nowrap;-webkit-user-select:none;user-select:none}.kpt-data-table__table thead tr:nth-child(2) th{top:var(--kpt-thead-offset, 0px)}.kpt-data-table__filter-row th{padding:var(--kpt-space-2, .5rem);font-weight:var(--kpt-font-weight-normal, 400);cursor:auto}.kpt-data-table__fcell{width:100%;height:2rem;padding-inline:var(--kpt-space-2, .5rem);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-form-field-radius, .5rem);background:var(--kpt-form-field-bg);color:var(--kpt-form-field-text);font:inherit}.kpt-data-table__fcell:focus-visible{outline:none;border-color:var(--kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-focus) 30%,transparent)}.kpt-data-table__filter-row kpt-select,.kpt-data-table__filter-row kpt-date-range{display:block;width:100%;font-weight:var(--kpt-font-weight-normal, 400)}.kpt-data-table__frange{display:flex;gap:var(--kpt-space-2, .5rem)}.kpt-data-table__frange .kpt-data-table__fcell{min-width:0}.kpt-data-table__fslider .kpt-slider-host{width:100%}.kpt-data-table__fslider .kpt-slider__value{min-width:auto;font-size:var(--kpt-font-size-xs, .75rem);color:var(--kpt-color-on-surface-muted)}.kpt-data-table__th--sortable{cursor:pointer}.kpt-data-table__th--sortable:hover{color:var(--kpt-color-on-surface)}.kpt-data-table__sort{margin-inline-start:.35em;opacity:.35}.kpt-data-table__sort--active{opacity:1}.kpt-data-table__th--draggable{cursor:grab}.kpt-data-table__th--draggable:active{cursor:grabbing}.kpt-data-table__th--dragover{box-shadow:inset 2px 0 0 0 var(--kpt-color-primary)}.kpt-data-table__grip{margin-inline-end:.4em;opacity:.45}.kpt-data-table__checkbox{width:1px;white-space:nowrap;text-align:center}.kpt-data-table__checkbox input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;display:inline-block;width:1.15rem;height:1.15rem;margin:0;vertical-align:middle;cursor:pointer;border:var(--kpt-border-width-medium, 2px) solid var(--kpt-form-field-border);border-radius:var(--kpt-radius-sm, .25rem);background:var(--kpt-form-field-bg);transition:background-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard),border-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-data-table__checkbox input[type=checkbox]:after{content:\"\";position:absolute;inset:0;opacity:0;background-color:var(--kpt-color-on-primary);transition:opacity var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard);-webkit-mask:no-repeat center/.85rem;mask:no-repeat center/.85rem}.kpt-data-table__checkbox input[type=checkbox]:checked,.kpt-data-table__checkbox input[type=checkbox]:indeterminate{background:var(--kpt-color-primary);border-color:var(--kpt-color-primary)}.kpt-data-table__checkbox input[type=checkbox]:checked:after{opacity:1;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13 4.5 6.5 11 3 7.5' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13 4.5 6.5 11 3 7.5' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")}.kpt-data-table__checkbox input[type=checkbox]:indeterminate:after{opacity:1;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8h9' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8h9' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round'/%3E%3C/svg%3E\")}.kpt-data-table__checkbox input[type=checkbox]:focus-visible{outline:var(--kpt-border-width-medium, 2px) solid var(--kpt-color-focus-ring);outline-offset:2px}.kpt-data-table__expander{width:2.5rem;min-width:2.5rem;text-align:center;white-space:nowrap}.kpt-data-table__expander-btn{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;border:none;border-radius:var(--kpt-radius-sm, .25rem);background:transparent;color:var(--kpt-color-on-surface-muted);cursor:pointer;transition:background-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard),color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-data-table__expander-btn kpt-icon{display:inline-flex;transition:transform var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-data-table__expander-btn:hover{background:var(--kpt-table-row-hover);color:var(--kpt-color-on-surface)}.kpt-data-table__expander-btn:focus-visible{outline:var(--kpt-border-width-medium, 2px) solid var(--kpt-color-focus-ring);outline-offset:2px}.kpt-data-table__expander-btn--open{color:var(--kpt-color-primary)}.kpt-data-table__expander-btn--open kpt-icon{transform:rotate(90deg)}.kpt-data-table__detail-row>.kpt-data-table__detail{padding:var(--kpt-space-4, 1rem);background:var(--kpt-table-detail-bg, var(--kpt-color-surface-variant, var(--kpt-table-row-hover)));border-bottom:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border);box-shadow:inset 3px 0 0 0 var(--kpt-color-primary)}.kpt-data-table tbody tr{transition:background-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-data-table tbody tr:hover{background:var(--kpt-table-row-hover)}.kpt-data-table tbody tr.kpt-data-table__detail-row:hover{background:transparent}.kpt-data-table__row--selected{background:var(--kpt-table-row-selected)!important}.kpt-data-table__row--expanded{background:var(--kpt-table-row-hover)}.kpt-data-table__table--frozen .kpt-data-table__checkbox{width:3rem;min-width:3rem}.kpt-data-table__table--frozen .kpt-data-table__expander{width:2.5rem;min-width:2.5rem}.kpt-data-table__cell--frozen{position:sticky;z-index:1;background:var(--kpt-table-bg);border-inline-end:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border)}.kpt-data-table thead th.kpt-data-table__cell--frozen{z-index:3;background:var(--kpt-table-header-bg)}.kpt-data-table tbody tr:hover .kpt-data-table__cell--frozen{background:var(--kpt-table-row-hover)}.kpt-data-table__row--selected.kpt-data-table__row--selected .kpt-data-table__cell--frozen,.kpt-data-table tbody tr.kpt-data-table__row--selected .kpt-data-table__cell--frozen{background:var(--kpt-table-row-selected)}.kpt-data-table__state{padding:var(--kpt-space-8, 2rem)!important;text-align:center!important;color:var(--kpt-color-on-surface-muted)}.kpt-data-table__table--virtual td{padding-block:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.kpt-data-table__spacer td{padding:0!important;border:0!important}.kpt-data-table tbody tr:last-child td{border-bottom:0}}\n"] }]
|
|
9895
|
-
}], () => [], { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], filterRowPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterRowPosition", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], rowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHeight", required: false }] }], reorderable: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderable", required: false }] }], exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], expandable: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandable", required: false }] }], multiExpand: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiExpand", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], expandedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedRows", required: false }] }, { type: i0.Output, args: ["expandedRowsChange"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], scrollEl: [{ type: i0.ViewChild, args: ['scrollEl', { isSignal: true }] }], theadEl: [{ type: i0.ViewChild, args: ['theadEl', { isSignal: true }] }], cellDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KptCellDef), { isSignal: true }] }], rowDetailDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KptRowDetailDef), { isSignal: true }] }] }); })();
|
|
9896
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDataTable, { className: "KptDataTable", filePath: "lib/data-table/data-table.component.ts", lineNumber:
|
|
10314
|
+
}, template: "@if (filterable() || exportable()) {\n <div class=\"kpt-data-table__toolbar\">\n @if (filterable()) {\n <input\n class=\"kpt-data-table__filter\"\n type=\"search\"\n [attr.placeholder]=\"i18n.t('dataTable.search')\"\n [value]=\"filterText()\"\n (input)=\"onFilter($event)\"\n />\n }\n @if (exportable()) {\n <kpt-button variant=\"outline\" size=\"sm\" (click)=\"exportCsv()\">{{ i18n.t('dataTable.exportCsv') }}</kpt-button>\n }\n </div>\n}\n\n<div class=\"kpt-data-table__scroll\" #scrollEl [style.max-height]=\"scrollHeight()\" (scroll)=\"onScroll($event)\">\n <table\n class=\"kpt-data-table__table\"\n [class.kpt-data-table__table--frozen]=\"hasFrozen()\"\n [class.kpt-data-table__table--virtual]=\"virtualScroll()\"\n >\n <thead #theadEl>\n @if (hasColumnFilters() && filterRowPosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"filterRowTpl\" />\n }\n <tr>\n @if (hasRowDetail()) {\n <th class=\"kpt-data-table__expander\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"expanderStickyLeft()\"></th>\n }\n @if (selectable() === 'multiple') {\n <th class=\"kpt-data-table__checkbox\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"checkboxStickyLeft()\">\n <input\n type=\"checkbox\"\n [checked]=\"pageAllSelected()\"\n [indeterminate]=\"pageSomeSelected()\"\n (change)=\"toggleAllOnPage()\"\n [attr.aria-label]=\"i18n.t('dataTable.selectAll')\"\n />\n </th>\n } @else if (selectable() === 'single') {\n <th class=\"kpt-data-table__checkbox\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"checkboxStickyLeft()\"></th>\n }\n @for (col of visibleOrderedColumns(); track col.field) {\n <th\n [attr.draggable]=\"isColDraggable(col) ? true : null\"\n [style.width]=\"col.width\"\n [style.left.px]=\"frozenLeft(col.field)\"\n [attr.data-align]=\"col.align ?? 'start'\"\n [class.kpt-data-table__cell--frozen]=\"isFrozen(col.field)\"\n [class.kpt-data-table__th--sortable]=\"col.sortable\"\n [class.kpt-data-table__th--draggable]=\"isColDraggable(col)\"\n [class.kpt-data-table__th--dragover]=\"dragField() !== null && dragField() !== col.field && !col.frozen\"\n [attr.aria-sort]=\"ariaSort(col)\"\n (click)=\"toggleSort(col)\"\n (dragstart)=\"onColDragStart(col.field, $event)\"\n (dragover)=\"reorderable() ? onColDragOver(col.field, $event) : null\"\n (drop)=\"reorderable() ? onColDrop(col.field, $event) : null\"\n (dragend)=\"onColDragEnd()\"\n >\n @if (isColDraggable(col)) {\n <kpt-icon class=\"kpt-data-table__grip\" name=\"grip-vertical\" />\n }\n <span>{{ col.header }}</span>\n @if (col.sortable) {\n <kpt-icon\n class=\"kpt-data-table__sort\"\n [class.kpt-data-table__sort--active]=\"ariaSort(col) !== 'none'\"\n [name]=\"sortIconName(col)\"\n />\n }\n </th>\n }\n </tr>\n @if (hasColumnFilters() && filterRowPosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"filterRowTpl\" />\n }\n </thead>\n <tbody>\n @if (loading()) {\n <tr><td class=\"kpt-data-table__state\" [attr.colspan]=\"colspan()\">{{ i18n.t('dataTable.loading') }}</td></tr>\n } @else if (displayCount() === 0) {\n <tr><td class=\"kpt-data-table__state\" [attr.colspan]=\"colspan()\">{{ emptyText() }}</td></tr>\n } @else if (virtualScroll()) {\n @if (topPad() > 0) {\n <tr class=\"kpt-data-table__spacer\" aria-hidden=\"true\"><td [attr.colspan]=\"colspan()\" [style.height.px]=\"topPad()\"></td></tr>\n }\n @for (row of virtualRows(); track trackRow(row)) {\n <ng-container [ngTemplateOutlet]=\"rowTpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n }\n @if (bottomPad() > 0) {\n <tr class=\"kpt-data-table__spacer\" aria-hidden=\"true\"><td [attr.colspan]=\"colspan()\" [style.height.px]=\"bottomPad()\"></td></tr>\n }\n } @else {\n @for (row of paged(); track trackRow(row)) {\n <ng-container [ngTemplateOutlet]=\"rowTpl\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n }\n }\n </tbody>\n </table>\n</div>\n\n<ng-template #rowTpl let-row>\n <tr\n [class.kpt-data-table__row--selected]=\"isSelected(row)\"\n [class.kpt-data-table__row--expanded]=\"hasRowDetail() && isExpanded(row)\"\n [style.height.px]=\"virtualScroll() ? rowHeight() : null\"\n (click)=\"onRowClick(row)\"\n >\n @if (hasRowDetail()) {\n <td class=\"kpt-data-table__expander\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"expanderStickyLeft()\">\n <button\n type=\"button\"\n class=\"kpt-data-table__expander-btn\"\n [class.kpt-data-table__expander-btn--open]=\"isExpanded(row)\"\n [attr.aria-expanded]=\"isExpanded(row)\"\n [attr.aria-label]=\"i18n.t('dataTable.expandRow')\"\n (click)=\"$event.stopPropagation(); toggleExpand(row)\"\n >\n <kpt-icon name=\"chevron-right\" />\n </button>\n </td>\n }\n @if (selectable() !== 'none') {\n <td class=\"kpt-data-table__checkbox\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"checkboxStickyLeft()\">\n <input\n type=\"checkbox\"\n [checked]=\"isSelected(row)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"toggleRow(row)\"\n [attr.aria-label]=\"i18n.t('dataTable.selectRow')\"\n />\n </td>\n }\n @for (col of visibleOrderedColumns(); track col.field) {\n <td\n [attr.data-align]=\"col.align ?? 'start'\"\n [style.left.px]=\"frozenLeft(col.field)\"\n [class.kpt-data-table__cell--frozen]=\"isFrozen(col.field)\"\n [class.kpt-data-table__cell--editable]=\"isEditable(col) && !isEditingCell(row, col.field)\"\n [attr.tabindex]=\"isEditable(col) && !isEditingCell(row, col.field) ? 0 : null\"\n [attr.aria-label]=\"isEditable(col) && !isEditingCell(row, col.field) ? i18n.t('dataTable.editCell', { column: col.header }) : null\"\n (click)=\"isEditable(col) ? startEdit(row, col, $event) : null\"\n (keydown.enter)=\"isEditable(col) && !isEditingCell(row, col.field) ? startEdit(row, col, $event) : null\"\n >\n @if (isEditingCell(row, col.field)) {\n <div\n class=\"kpt-data-table__editor\"\n #editorHost\n (click)=\"$event.stopPropagation()\"\n (focusout)=\"onEditorFocusOut($event)\"\n >\n @if (cellEditTemplate(col.field); as etpl) {\n <ng-container\n [ngTemplateOutlet]=\"etpl\"\n [ngTemplateOutletContext]=\"{ $implicit: editingValue(), row, commit: commitEditValue, cancel: cancelEdit }\"\n />\n } @else {\n @switch (col.edit?.type) {\n @case ('text') {\n <kpt-input\n [value]=\"$any(editingValue()) ?? ''\"\n [placeholder]=\"col.edit.placeholder ?? ''\"\n (valueChange)=\"editingValue.set($event)\"\n (keydown.enter)=\"commitEdit()\"\n (keydown.escape)=\"cancelEdit()\"\n />\n }\n @case ('number') {\n <kpt-input-number\n [value]=\"$any(editingValue())\"\n [min]=\"col.edit.min\"\n [max]=\"col.edit.max\"\n [step]=\"col.edit.step ?? 1\"\n (valueChange)=\"editingValue.set($event)\"\n (keydown.enter)=\"commitEdit()\"\n (keydown.escape)=\"cancelEdit()\"\n />\n }\n @case ('date') {\n <kpt-datepicker\n [value]=\"$any(editingValue()) ?? ''\"\n (valueChange)=\"editingValue.set($event)\"\n [open]=\"editorPanelOpen()\"\n (openChange)=\"onEditorPanelToggle($event)\"\n />\n }\n @case ('select') {\n <kpt-select\n [options]=\"col.edit.options ?? []\"\n [placeholder]=\"col.edit.placeholder ?? ''\"\n [value]=\"editingValue()\"\n (valueChange)=\"editingValue.set($event)\"\n [open]=\"editorPanelOpen()\"\n (openChange)=\"onEditorPanelToggle($event)\"\n />\n }\n @case ('multiselect') {\n <kpt-select\n multiple\n filter\n [options]=\"col.edit.options ?? []\"\n [placeholder]=\"col.edit.placeholder ?? ''\"\n [value]=\"editingValue()\"\n (valueChange)=\"editingValue.set($event)\"\n [open]=\"editorPanelOpen()\"\n (openChange)=\"onEditorPanelToggle($event)\"\n />\n }\n }\n }\n </div>\n } @else if (cellTemplate(col.field); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row, value: getValue(row, col.field) }\"\n />\n } @else {\n {{ getValue(row, col.field) }}\n }\n </td>\n }\n </tr>\n @if (hasRowDetail() && isExpanded(row) && !virtualScroll()) {\n <tr class=\"kpt-data-table__detail-row\">\n <td class=\"kpt-data-table__detail\" [attr.colspan]=\"colspan()\">\n <ng-container [ngTemplateOutlet]=\"rowDetailTpl()\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </td>\n </tr>\n }\n</ng-template>\n\n<ng-template #filterRowTpl>\n <tr class=\"kpt-data-table__filter-row\">\n @if (hasRowDetail()) {\n <th class=\"kpt-data-table__expander\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"expanderStickyLeft()\"></th>\n }\n @if (selectable() !== 'none') {\n <th class=\"kpt-data-table__checkbox\" [class.kpt-data-table__cell--frozen]=\"hasFrozen()\" [style.left.px]=\"checkboxStickyLeft()\"></th>\n }\n @for (col of visibleOrderedColumns(); track col.field) {\n <th\n [style.width]=\"col.width\"\n [style.left.px]=\"frozenLeft(col.field)\"\n [attr.data-align]=\"col.align ?? 'start'\"\n [class.kpt-data-table__cell--frozen]=\"isFrozen(col.field)\"\n >\n @switch (col.filter?.type) {\n @case ('text') {\n <input\n class=\"kpt-data-table__fcell\"\n type=\"search\"\n [attr.placeholder]=\"col.filter.placeholder || ''\"\n [attr.aria-label]=\"i18n.t('dataTable.filter', { column: col.header })\"\n [value]=\"$any(columnFilters()[col.field]) || ''\"\n (input)=\"setColumnFilter(col.field, $any($event.target).value)\"\n (click)=\"$event.stopPropagation()\"\n />\n }\n @case ('number') {\n <input\n class=\"kpt-data-table__fcell\"\n type=\"text\"\n inputmode=\"numeric\"\n [attr.placeholder]=\"col.filter.placeholder || ''\"\n [attr.aria-label]=\"i18n.t('dataTable.filter', { column: col.header })\"\n [value]=\"$any(columnFilters()[col.field]) || ''\"\n (input)=\"onNumberFilter(col.field, $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n }\n @case ('select') {\n <kpt-select\n [options]=\"col.filter.options || []\"\n [multiple]=\"!!col.filter.multiple\"\n filter\n [placeholder]=\"col.filter.placeholder || i18n.t('dataTable.all')\"\n [value]=\"columnFilters()[col.field] ?? null\"\n (valueChange)=\"setColumnFilter(col.field, $event)\"\n />\n }\n @case ('numberRange') {\n <div class=\"kpt-data-table__frange\">\n <input\n class=\"kpt-data-table__fcell\"\n type=\"text\"\n inputmode=\"numeric\"\n [attr.placeholder]=\"i18n.t('dataTable.min')\"\n [attr.aria-label]=\"i18n.t('dataTable.filterMin', { column: col.header })\"\n [value]=\"rangeVal(col.field).min\"\n (input)=\"setRangeFilter(col.field, 'min', $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n <input\n class=\"kpt-data-table__fcell\"\n type=\"text\"\n inputmode=\"numeric\"\n [attr.placeholder]=\"i18n.t('dataTable.max')\"\n [attr.aria-label]=\"i18n.t('dataTable.filterMax', { column: col.header })\"\n [value]=\"rangeVal(col.field).max\"\n (input)=\"setRangeFilter(col.field, 'max', $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n </div>\n }\n @case ('slider') {\n <div class=\"kpt-data-table__fslider\" (click)=\"$event.stopPropagation()\">\n <kpt-slider\n range\n [min]=\"col.filter.min ?? 0\"\n [max]=\"col.filter.max ?? 100\"\n [step]=\"col.filter.step ?? 1\"\n [value]=\"sliderVal(col)\"\n (valueChange)=\"setColumnFilter(col.field, $event)\"\n showValue\n />\n </div>\n }\n @case ('dateRange') {\n <kpt-date-range\n [placeholder]=\"col.filter.placeholder || i18n.t('dataTable.dateRange')\"\n [value]=\"$any(columnFilters()[col.field]) || { start: '', end: '' }\"\n (valueChange)=\"setColumnFilter(col.field, $event)\"\n />\n }\n }\n </th>\n }\n </tr>\n</ng-template>\n\n@if (pageSize() > 0 && !virtualScroll()) {\n <div class=\"kpt-data-table__pager\">\n <ng-content select=\"[kptPaginatorActions]\" />\n <kpt-paginator\n [length]=\"filteredCount()\"\n [pageIndex]=\"pageIndex()\"\n (pageIndexChange)=\"pageIndex.set($event)\"\n [pageSize]=\"pageSizeState()\"\n (pageSizeChange)=\"pageSizeState.set($event)\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n />\n </div>\n}\n", styles: ["@layer kpt.components{.kpt-data-table{display:flex;flex-direction:column;background:var(--kpt-table-bg);color:var(--kpt-table-fg);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border);border-radius:var(--kpt-table-radius, .75rem);overflow:hidden;flex-grow:1}.kpt-data-table__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--kpt-space-3, .75rem);padding:var(--kpt-space-3, .75rem);border-bottom:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border)}.kpt-data-table__filter{width:100%;max-width:20rem;height:2.25rem;padding-inline:var(--kpt-space-3, .75rem);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-form-field-radius, .5rem);background:var(--kpt-form-field-bg);color:var(--kpt-form-field-text)}.kpt-data-table__filter:focus-visible{outline:none;border-color:var(--kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-focus) 30%,transparent)}.kpt-data-table__scroll{overflow:auto}.kpt-data-table__pager{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem)}.kpt-data-table__pager [kptPaginatorActions]{margin-inline-start:.5rem}.kpt-data-table__pager kpt-paginator{flex:1 1 auto;min-width:0}.kpt-data-table__table{width:100%;border-collapse:collapse;font-size:var(--kpt-font-size-sm, .875rem)}.kpt-data-table__table--frozen{width:max-content;min-width:100%}.kpt-data-table__table th,.kpt-data-table__table td{padding:var(--kpt-table-cell-padding, .75rem);text-align:start;border-bottom:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border)}.kpt-data-table__table th[data-align=center],.kpt-data-table__table td[data-align=center]{text-align:center}.kpt-data-table__table th[data-align=end],.kpt-data-table__table td[data-align=end]{text-align:end}.kpt-data-table__table thead th{position:sticky;top:0;z-index:1;background:var(--kpt-table-header-bg);color:var(--kpt-table-header-fg);font-weight:var(--kpt-font-weight-semibold, 600);white-space:nowrap;-webkit-user-select:none;user-select:none}.kpt-data-table__table thead tr:nth-child(2) th{top:var(--kpt-thead-offset, 0px)}.kpt-data-table__filter-row th{padding:var(--kpt-space-2, .5rem);font-weight:var(--kpt-font-weight-normal, 400);cursor:auto}.kpt-data-table__fcell{width:100%;height:2rem;padding-inline:var(--kpt-space-2, .5rem);border:var(--kpt-border-width-thin, 1px) solid var(--kpt-form-field-border);border-radius:var(--kpt-form-field-radius, .5rem);background:var(--kpt-form-field-bg);color:var(--kpt-form-field-text);font:inherit}.kpt-data-table__fcell:focus-visible{outline:none;border-color:var(--kpt-form-field-border-focus);box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-focus) 30%,transparent)}.kpt-data-table__filter-row kpt-select,.kpt-data-table__filter-row kpt-date-range{display:block;width:100%;font-weight:var(--kpt-font-weight-normal, 400)}.kpt-data-table__frange{display:flex;gap:var(--kpt-space-2, .5rem)}.kpt-data-table__frange .kpt-data-table__fcell{min-width:0}.kpt-data-table__fslider .kpt-slider-host{width:100%}.kpt-data-table__fslider .kpt-slider__value{min-width:auto;font-size:var(--kpt-font-size-xs, .75rem);color:var(--kpt-color-on-surface-muted)}.kpt-data-table__th--sortable{cursor:pointer}.kpt-data-table__th--sortable:hover{color:var(--kpt-color-on-surface)}.kpt-data-table__cell--editable{cursor:pointer}.kpt-data-table__cell--editable:hover{background:var(--kpt-table-row-hover)}.kpt-data-table__cell--editable:focus-visible{outline:var(--kpt-border-width-medium, 2px) solid var(--kpt-color-focus-ring);outline-offset:-2px}.kpt-data-table__editor{display:block;min-width:8rem}.kpt-data-table__editor .kpt-input-number-host{max-width:6.5rem}.kpt-data-table__editor .kpt-input-number__btn{width:1.75rem}.kpt-data-table__sort{margin-inline-start:.35em;opacity:.35}.kpt-data-table__sort--active{opacity:1}.kpt-data-table__th--draggable{cursor:grab}.kpt-data-table__th--draggable:active{cursor:grabbing}.kpt-data-table__th--dragover{box-shadow:inset 2px 0 0 0 var(--kpt-color-primary)}.kpt-data-table__grip{margin-inline-end:.4em;opacity:.45}.kpt-data-table__checkbox{width:1px;white-space:nowrap;text-align:center}.kpt-data-table__checkbox input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;display:inline-block;width:1.15rem;height:1.15rem;margin:0;vertical-align:middle;cursor:pointer;border:var(--kpt-border-width-medium, 2px) solid var(--kpt-form-field-border);border-radius:var(--kpt-radius-sm, .25rem);background:var(--kpt-form-field-bg);transition:background-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard),border-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-data-table__checkbox input[type=checkbox]:after{content:\"\";position:absolute;inset:0;opacity:0;background-color:var(--kpt-color-on-primary);transition:opacity var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard);-webkit-mask:no-repeat center/.85rem;mask:no-repeat center/.85rem}.kpt-data-table__checkbox input[type=checkbox]:checked,.kpt-data-table__checkbox input[type=checkbox]:indeterminate{background:var(--kpt-color-primary);border-color:var(--kpt-color-primary)}.kpt-data-table__checkbox input[type=checkbox]:checked:after{opacity:1;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13 4.5 6.5 11 3 7.5' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13 4.5 6.5 11 3 7.5' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")}.kpt-data-table__checkbox input[type=checkbox]:indeterminate:after{opacity:1;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8h9' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8h9' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round'/%3E%3C/svg%3E\")}.kpt-data-table__checkbox input[type=checkbox]:focus-visible{outline:var(--kpt-border-width-medium, 2px) solid var(--kpt-color-focus-ring);outline-offset:2px}.kpt-data-table__expander{width:2.5rem;min-width:2.5rem;text-align:center;white-space:nowrap}.kpt-data-table__expander-btn{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;border:none;border-radius:var(--kpt-radius-sm, .25rem);background:transparent;color:var(--kpt-color-on-surface-muted);cursor:pointer;transition:background-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard),color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-data-table__expander-btn kpt-icon{display:inline-flex;transition:transform var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-data-table__expander-btn:hover{background:var(--kpt-table-row-hover);color:var(--kpt-color-on-surface)}.kpt-data-table__expander-btn:focus-visible{outline:var(--kpt-border-width-medium, 2px) solid var(--kpt-color-focus-ring);outline-offset:2px}.kpt-data-table__expander-btn--open{color:var(--kpt-color-primary)}.kpt-data-table__expander-btn--open kpt-icon{transform:rotate(90deg)}.kpt-data-table__detail-row>.kpt-data-table__detail{padding:var(--kpt-space-4, 1rem);background:var(--kpt-table-detail-bg, var(--kpt-color-surface-variant, var(--kpt-table-row-hover)));border-bottom:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border);box-shadow:inset 3px 0 0 0 var(--kpt-color-primary)}.kpt-data-table tbody tr{transition:background-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-data-table tbody tr:hover{background:var(--kpt-table-row-hover)}.kpt-data-table tbody tr.kpt-data-table__detail-row:hover{background:transparent}.kpt-data-table__row--selected{background:var(--kpt-table-row-selected)!important}.kpt-data-table__row--expanded{background:var(--kpt-table-row-hover)}.kpt-data-table__table--frozen .kpt-data-table__checkbox{width:3rem;min-width:3rem}.kpt-data-table__table--frozen .kpt-data-table__expander{width:2.5rem;min-width:2.5rem}.kpt-data-table__cell--frozen{position:sticky;z-index:1;background:var(--kpt-table-bg);border-inline-end:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border)}.kpt-data-table thead th.kpt-data-table__cell--frozen{z-index:3;background:var(--kpt-table-header-bg)}.kpt-data-table tbody tr:hover .kpt-data-table__cell--frozen{background:var(--kpt-table-row-hover)}.kpt-data-table__row--selected.kpt-data-table__row--selected .kpt-data-table__cell--frozen,.kpt-data-table tbody tr.kpt-data-table__row--selected .kpt-data-table__cell--frozen{background:var(--kpt-table-row-selected)}.kpt-data-table__state{padding:var(--kpt-space-8, 2rem)!important;text-align:center!important;color:var(--kpt-color-on-surface-muted)}.kpt-data-table__table--virtual td{padding-block:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.kpt-data-table__spacer td{padding:0!important;border:0!important}.kpt-data-table tbody tr:last-child td{border-bottom:0}}\n"] }]
|
|
10315
|
+
}], () => [], { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], filterRowPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterRowPosition", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], rowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHeight", required: false }] }], reorderable: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderable", required: false }] }], exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], expandable: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandable", required: false }] }], multiExpand: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiExpand", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], expandedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedRows", required: false }] }, { type: i0.Output, args: ["expandedRowsChange"] }], hiddenFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenFields", required: false }] }, { type: i0.Output, args: ["hiddenFieldsChange"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], cellEdit: [{ type: i0.Output, args: ["cellEdit"] }], scrollEl: [{ type: i0.ViewChild, args: ['scrollEl', { isSignal: true }] }], theadEl: [{ type: i0.ViewChild, args: ['theadEl', { isSignal: true }] }], editorHost: [{ type: i0.ViewChild, args: ['editorHost', { isSignal: true }] }], cellDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KptCellDef), { isSignal: true }] }], cellEditDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KptCellEditDef), { isSignal: true }] }], rowDetailDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KptRowDetailDef), { isSignal: true }] }] }); })();
|
|
10316
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDataTable, { className: "KptDataTable", filePath: "lib/data-table/data-table.component.ts", lineNumber: 168 }); })();
|
|
9897
10317
|
|
|
9898
10318
|
const _c0$d = a0 => ({ $implicit: a0, level: 0 });
|
|
9899
10319
|
const _c1$4 = (a0, a1) => ({ $implicit: a0, level: a1 });
|
|
@@ -12611,5 +13031,5 @@ class KptSpeedDial {
|
|
|
12611
13031
|
* Generated bundle index. Do not edit.
|
|
12612
13032
|
*/
|
|
12613
13033
|
|
|
12614
|
-
export { KPT_BREAKPOINTS, KPT_FORM_FIELD_CONTROL, KPT_I18N_CONFIG, KPT_MESSAGES_EN, KPT_MESSAGES_PL, KptAccordion, KptAccordionPanel, KptAlert, KptAppShell, KptAutocomplete, KptAvatar, KptAvatarGroup, KptBadge, KptBottomSheet, KptBreadcrumb, KptBreakpointObserver, KptButton, KptButtonGroup, KptCard, KptCarousel, KptCellDef, KptCheckbox, KptChip, KptChipsInput, KptClock, KptColorPicker, KptConfirmContainer, KptConfirmService, KptContextMenu, KptDataTable, KptDataView, KptDateRange, KptDatepicker, KptDialog, KptDivider, KptDrawer, KptEmpty, KptFab, KptFieldset, KptFileUpload, KptFormField, KptGalleria, KptI18n, KptIcon, KptIconButton, KptIconRegistry, KptImage, KptInput, KptInputMask, KptInputNumber, KptInputOtp, KptKnob, KptListbox, KptMegamenu, KptMenu, KptMenubar, KptMeterGroup, KptOrderList, KptPaginator, KptPanel, KptPassword, KptPickList, KptPopover, KptProgress, KptRadioGroup, KptRating, KptRichText, KptRowDetailDef, KptScrollTop, KptSelect, KptShellNavToggle, KptSidenav, KptSkeleton, KptSlider, KptSpeedDial, KptSpinner, KptSplitButton, KptSplitter, KptStep, KptStepper, KptSwitch, KptSwitchGroup, KptTab, KptTabs, KptTextarea, KptTimeline, KptToastContainer, KptToastService, KptToolbar, KptTooltip, KptTree, provideKptI18n, renderKptIconSvg };
|
|
13034
|
+
export { KPT_BREAKPOINTS, KPT_FORM_FIELD_CONTROL, KPT_I18N_CONFIG, KPT_MESSAGES_EN, KPT_MESSAGES_PL, KptAccordion, KptAccordionPanel, KptAlert, KptAppShell, KptAutocomplete, KptAvatar, KptAvatarGroup, KptBadge, KptBottomSheet, KptBreadcrumb, KptBreakpointObserver, KptButton, KptButtonGroup, KptCard, KptCarousel, KptCellDef, KptCellEditDef, KptCheckbox, KptChip, KptChipsInput, KptClock, KptColorPicker, KptConfirmContainer, KptConfirmService, KptContextMenu, KptDataTable, KptDataView, KptDateRange, KptDatepicker, KptDialog, KptDivider, KptDrawer, KptEmpty, KptFab, KptFieldset, KptFileUpload, KptFormField, KptGalleria, KptI18n, KptIcon, KptIconButton, KptIconRegistry, KptImage, KptInput, KptInputMask, KptInputNumber, KptInputOtp, KptKnob, KptListbox, KptMegamenu, KptMenu, KptMenubar, KptMeterGroup, KptOrderList, KptPaginator, KptPanel, KptPassword, KptPickList, KptPopover, KptProgress, KptRadioGroup, KptRating, KptRichText, KptRowDetailDef, KptScrollTop, KptSelect, KptShellNavToggle, KptSidenav, KptSkeleton, KptSlider, KptSpeedDial, KptSpinner, KptSplitButton, KptSplitter, KptStep, KptStepper, KptSwitch, KptSwitchGroup, KptTab, KptTabs, KptTextarea, KptTimeline, KptToastContainer, KptToastService, KptToolbar, KptTooltip, KptTree, provideKptI18n, renderKptIconSvg };
|
|
12615
13035
|
//# sourceMappingURL=konce-pt-angular.mjs.map
|