@konce-pt/angular 0.7.9 → 0.7.11
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 +63 -0
- package/fesm2022/konce-pt-angular-charts.mjs +8 -8
- package/fesm2022/konce-pt-angular-charts.mjs.map +1 -1
- package/fesm2022/konce-pt-angular.mjs +1680 -587
- package/fesm2022/konce-pt-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/auth/llms.txt +104 -0
- package/src/lib/context-menu/llms.txt +2 -2
- package/src/lib/i18n/llms.txt +2 -2
- package/src/lib/input/llms.txt +2 -0
- package/src/lib/megamenu/llms.txt +1 -1
- package/src/lib/menu/llms.txt +2 -2
- package/src/lib/menubar/llms.txt +2 -2
- package/src/lib/password/llms.txt +3 -0
- package/src/lib/rich-text/llms.txt +20 -1
- package/src/lib/speed-dial/llms.txt +2 -2
- package/src/lib/split-button/llms.txt +2 -2
- package/types/konce-pt-angular.d.ts +367 -38
- package/types/konce-pt-angular.d.ts.map +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
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, untracked, forwardRef, numberAttribute, viewChild, Directive, TemplateRef,
|
|
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, Injector, viewChildren, contentChildren, afterRenderEffect, linkedSignal } from '@angular/core';
|
|
3
3
|
import { CdkOverlayOrigin, CdkConnectedOverlay, OverlayContainer } from '@angular/cdk/overlay';
|
|
4
4
|
import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
5
|
+
import { form, required, email, minLength, validateTree, submit, FormField, FormRoot } from '@angular/forms/signals';
|
|
5
6
|
|
|
6
|
-
const _c0$
|
|
7
|
+
const _c0$E = ["*"];
|
|
7
8
|
function KptButton_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
8
9
|
i0.ɵɵdomElement(0, "span", 1);
|
|
9
10
|
} }
|
|
@@ -38,7 +39,7 @@ class KptButton {
|
|
|
38
39
|
static { this.ɵfac = function KptButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptButton)(); }; }
|
|
39
40
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptButton, selectors: [["kpt-button"]], hostAttrs: [1, "kpt-button-host"], hostVars: 2, hostBindings: function KptButton_HostBindings(rf, ctx) { if (rf & 2) {
|
|
40
41
|
i0.ɵɵclassProp("kpt-button-host--full", ctx.fullWidth());
|
|
41
|
-
} }, inputs: { variant: [1, "variant"], size: [1, "size"], type: [1, "type"], disabled: [1, "disabled"], loading: [1, "loading"], fullWidth: [1, "fullWidth"] }, ngContentSelectors: _c0$
|
|
42
|
+
} }, inputs: { variant: [1, "variant"], size: [1, "size"], type: [1, "type"], disabled: [1, "disabled"], loading: [1, "loading"], fullWidth: [1, "fullWidth"] }, ngContentSelectors: _c0$E, decls: 4, vars: 8, consts: [[1, "kpt-button", 3, "type", "disabled"], ["aria-hidden", "true", 1, "kpt-button__spinner"], [1, "kpt-button__content"]], template: function KptButton_Template(rf, ctx) { if (rf & 1) {
|
|
42
43
|
i0.ɵɵprojectionDef();
|
|
43
44
|
i0.ɵɵdomElementStart(0, "button", 0);
|
|
44
45
|
i0.ɵɵconditionalCreate(1, KptButton_Conditional_1_Template, 1, 0, "span", 1);
|
|
@@ -62,7 +63,7 @@ class KptButton {
|
|
|
62
63
|
}], null, { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }] }); })();
|
|
63
64
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptButton, { className: "KptButton", filePath: "lib/button/button.component.ts", lineNumber: 32 }); })();
|
|
64
65
|
|
|
65
|
-
const _c0$
|
|
66
|
+
const _c0$D = ["*"];
|
|
66
67
|
function KptIconButton_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
67
68
|
i0.ɵɵdomElement(0, "span", 1);
|
|
68
69
|
} }
|
|
@@ -95,7 +96,7 @@ class KptIconButton {
|
|
|
95
96
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
96
97
|
}
|
|
97
98
|
static { this.ɵfac = function KptIconButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptIconButton)(); }; }
|
|
98
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptIconButton, selectors: [["kpt-icon-button"]], hostAttrs: [1, "kpt-icon-button-host"], inputs: { variant: [1, "variant"], size: [1, "size"], shape: [1, "shape"], type: [1, "type"], disabled: [1, "disabled"], loading: [1, "loading"], ariaLabel: [1, "ariaLabel"] }, ngContentSelectors: _c0$
|
|
99
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptIconButton, selectors: [["kpt-icon-button"]], hostAttrs: [1, "kpt-icon-button-host"], inputs: { variant: [1, "variant"], size: [1, "size"], shape: [1, "shape"], type: [1, "type"], disabled: [1, "disabled"], loading: [1, "loading"], ariaLabel: [1, "ariaLabel"] }, ngContentSelectors: _c0$D, decls: 3, vars: 8, consts: [[1, "kpt-icon-button", 3, "type", "disabled"], ["aria-hidden", "true", 1, "kpt-icon-button__spinner"]], template: function KptIconButton_Template(rf, ctx) { if (rf & 1) {
|
|
99
100
|
i0.ɵɵprojectionDef();
|
|
100
101
|
i0.ɵɵdomElementStart(0, "button", 0);
|
|
101
102
|
i0.ɵɵconditionalCreate(1, KptIconButton_Conditional_1_Template, 1, 0, "span", 1)(2, KptIconButton_Conditional_2_Template, 1, 0);
|
|
@@ -130,7 +131,7 @@ class KptIconButton {
|
|
|
130
131
|
}], null, { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: true }] }] }); })();
|
|
131
132
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptIconButton, { className: "KptIconButton", filePath: "lib/icon-button/icon-button.component.ts", lineNumber: 36 }); })();
|
|
132
133
|
|
|
133
|
-
const _forTrack0$
|
|
134
|
+
const _forTrack0$e = ($index, $item) => $item.value;
|
|
134
135
|
function KptButtonGroup_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
135
136
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
136
137
|
i0.ɵɵdomElementStart(0, "button", 2);
|
|
@@ -175,7 +176,7 @@ class KptButtonGroup {
|
|
|
175
176
|
static { this.ɵfac = function KptButtonGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptButtonGroup)(); }; }
|
|
176
177
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptButtonGroup, selectors: [["kpt-button-group"]], hostAttrs: [1, "kpt-button-group-host"], inputs: { options: [1, "options"], value: [1, "value"], size: [1, "size"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 3, vars: 1, consts: [["role", "group", 1, "kpt-button-group"], ["type", "button", 1, "kpt-button-group__item", 3, "is-active", "disabled"], ["type", "button", 1, "kpt-button-group__item", 3, "click", "disabled"]], template: function KptButtonGroup_Template(rf, ctx) { if (rf & 1) {
|
|
177
178
|
i0.ɵɵdomElementStart(0, "div", 0);
|
|
178
|
-
i0.ɵɵrepeaterCreate(1, KptButtonGroup_For_2_Template, 2, 5, "button", 1, _forTrack0$
|
|
179
|
+
i0.ɵɵrepeaterCreate(1, KptButtonGroup_For_2_Template, 2, 5, "button", 1, _forTrack0$e);
|
|
179
180
|
i0.ɵɵdomElementEnd();
|
|
180
181
|
} if (rf & 2) {
|
|
181
182
|
i0.ɵɵattribute("data-size", ctx.size());
|
|
@@ -202,7 +203,7 @@ class KptButtonGroup {
|
|
|
202
203
|
}], null, { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", 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"] }] }); })();
|
|
203
204
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptButtonGroup, { className: "KptButtonGroup", filePath: "lib/button-group/button-group.component.ts", lineNumber: 41 }); })();
|
|
204
205
|
|
|
205
|
-
const _c0$
|
|
206
|
+
const _c0$C = ["*"];
|
|
206
207
|
/**
|
|
207
208
|
* Floating Action Button (FAB) — okrągły, wyniesiony przycisk akcji. Wariant `extended` = pigułka z tekstem.
|
|
208
209
|
*
|
|
@@ -225,7 +226,7 @@ class KptFab {
|
|
|
225
226
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
226
227
|
}
|
|
227
228
|
static { this.ɵfac = function KptFab_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptFab)(); }; }
|
|
228
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptFab, selectors: [["kpt-fab"]], hostAttrs: [1, "kpt-fab-host"], inputs: { variant: [1, "variant"], size: [1, "size"], extended: [1, "extended"], disabled: [1, "disabled"], type: [1, "type"], ariaLabel: [1, "ariaLabel"] }, ngContentSelectors: _c0$
|
|
229
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptFab, selectors: [["kpt-fab"]], hostAttrs: [1, "kpt-fab-host"], inputs: { variant: [1, "variant"], size: [1, "size"], extended: [1, "extended"], disabled: [1, "disabled"], type: [1, "type"], ariaLabel: [1, "ariaLabel"] }, ngContentSelectors: _c0$C, decls: 2, vars: 7, consts: [[1, "kpt-fab", 3, "type", "disabled"]], template: function KptFab_Template(rf, ctx) { if (rf & 1) {
|
|
229
230
|
i0.ɵɵprojectionDef();
|
|
230
231
|
i0.ɵɵdomElementStart(0, "button", 0);
|
|
231
232
|
i0.ɵɵprojection(1);
|
|
@@ -276,6 +277,8 @@ const KPT_ICONS = {
|
|
|
276
277
|
'strikethrough': '<path d="M5 12l14 0" /> <path d="M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5" />',
|
|
277
278
|
'list': '<path d="M9 6l11 0" /> <path d="M9 12l11 0" /> <path d="M9 18l11 0" /> <path d="M5 6l0 .01" /> <path d="M5 12l0 .01" /> <path d="M5 18l0 .01" />',
|
|
278
279
|
'list-numbers': '<path d="M11 6h9" /> <path d="M11 12h9" /> <path d="M12 18h8" /> <path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" /> <path d="M6 10v-6l-2 2" />',
|
|
280
|
+
'indent-increase': '<path d="M20 6l-11 0" /> <path d="M20 12l-7 0" /> <path d="M20 18l-11 0" /> <path d="M4 8l4 4l-4 4" />',
|
|
281
|
+
'indent-decrease': '<path d="M20 6l-7 0" /> <path d="M20 12l-9 0" /> <path d="M20 18l-7 0" /> <path d="M8 8l-4 4l4 4" />',
|
|
279
282
|
'clear-formatting': '<path d="M17 15l4 4m0 -4l-4 4" /> <path d="M7 6v-1h11v1" /> <path d="M7 19l4 0" /> <path d="M13 5l-4 14" />',
|
|
280
283
|
'star': '<path d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245" />',
|
|
281
284
|
'plus': '<path d="M12 5l0 14" /> <path d="M5 12l14 0" />',
|
|
@@ -536,7 +539,7 @@ class KptAvatar {
|
|
|
536
539
|
}], 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 }] }] }); })();
|
|
537
540
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptAvatar, { className: "KptAvatar", filePath: "lib/avatar/avatar.component.ts", lineNumber: 46 }); })();
|
|
538
541
|
|
|
539
|
-
const _c0$
|
|
542
|
+
const _c0$B = ["*"];
|
|
540
543
|
/**
|
|
541
544
|
* Znacznik (badge) — licznik lub kropka statusu. Standalone lub nałożony na treść (`overlay`).
|
|
542
545
|
*
|
|
@@ -568,7 +571,7 @@ class KptBadge {
|
|
|
568
571
|
...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
|
|
569
572
|
}
|
|
570
573
|
static { this.ɵfac = function KptBadge_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptBadge)(); }; }
|
|
571
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptBadge, selectors: [["kpt-badge"]], hostAttrs: [1, "kpt-badge-host"], inputs: { value: [1, "value"], variant: [1, "variant"], size: [1, "size"], dot: [1, "dot"], overlay: [1, "overlay"], max: [1, "max"] }, ngContentSelectors: _c0$
|
|
574
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptBadge, selectors: [["kpt-badge"]], hostAttrs: [1, "kpt-badge-host"], inputs: { value: [1, "value"], variant: [1, "variant"], size: [1, "size"], dot: [1, "dot"], overlay: [1, "overlay"], max: [1, "max"] }, ngContentSelectors: _c0$B, decls: 3, vars: 7, consts: [[1, "kpt-badge"]], template: function KptBadge_Template(rf, ctx) { if (rf & 1) {
|
|
572
575
|
i0.ɵɵprojectionDef();
|
|
573
576
|
i0.ɵɵprojection(0);
|
|
574
577
|
i0.ɵɵdomElementStart(1, "span", 0);
|
|
@@ -832,6 +835,8 @@ const KPT_MESSAGES_EN = {
|
|
|
832
835
|
strike: 'Strikethrough',
|
|
833
836
|
ul: 'Bulleted list',
|
|
834
837
|
ol: 'Numbered list',
|
|
838
|
+
indent: 'Increase indent',
|
|
839
|
+
outdent: 'Decrease indent',
|
|
835
840
|
foreColor: 'Text color',
|
|
836
841
|
backColor: 'Text background color',
|
|
837
842
|
alignLeft: 'Align left',
|
|
@@ -878,6 +883,44 @@ const KPT_MESSAGES_EN = {
|
|
|
878
883
|
customColor: 'Color…',
|
|
879
884
|
},
|
|
880
885
|
},
|
|
886
|
+
auth: {
|
|
887
|
+
signInTitle: 'Sign in',
|
|
888
|
+
signInSubtitle: 'Use your e-mail and password.',
|
|
889
|
+
signUpTitle: 'Create account',
|
|
890
|
+
signUpSubtitle: 'It takes less than a minute.',
|
|
891
|
+
forgotTitle: 'Reset password',
|
|
892
|
+
forgotSubtitle: 'We will send a reset link to your e-mail.',
|
|
893
|
+
name: 'Full name',
|
|
894
|
+
email: 'E-mail',
|
|
895
|
+
emailPlaceholder: 'you@company.com',
|
|
896
|
+
password: 'Password',
|
|
897
|
+
passwordHint: 'At least {min} characters.',
|
|
898
|
+
confirmPassword: 'Repeat password',
|
|
899
|
+
remember: 'Remember me',
|
|
900
|
+
terms: 'I accept the terms of service',
|
|
901
|
+
forgotLink: 'Forgot password?',
|
|
902
|
+
backToSignIn: 'Back to sign in',
|
|
903
|
+
signInSubmit: 'Sign in',
|
|
904
|
+
signUpSubmit: 'Create account',
|
|
905
|
+
resetSubmit: 'Send reset link',
|
|
906
|
+
orContinueWith: 'or continue with',
|
|
907
|
+
continueWith: 'Continue with {provider}',
|
|
908
|
+
noAccount: 'No account yet?',
|
|
909
|
+
haveAccount: 'Already have an account?',
|
|
910
|
+
signInSwitch: 'Sign in',
|
|
911
|
+
signUpSwitch: 'Sign up',
|
|
912
|
+
errorRequired: 'This field is required',
|
|
913
|
+
errorEmail: 'Enter a valid e-mail address',
|
|
914
|
+
errorMinLength: 'Use at least {min} characters',
|
|
915
|
+
errorMismatch: 'Passwords do not match',
|
|
916
|
+
errorInvalid: 'Invalid value',
|
|
917
|
+
promo: {
|
|
918
|
+
signInTitle: 'Welcome back',
|
|
919
|
+
signInText: 'Sign in to pick up where you left off.',
|
|
920
|
+
signUpTitle: 'New here?',
|
|
921
|
+
signUpText: 'Create an account and start in a minute.',
|
|
922
|
+
},
|
|
923
|
+
},
|
|
881
924
|
};
|
|
882
925
|
const KPT_MESSAGES_PL = {
|
|
883
926
|
common: {
|
|
@@ -1100,6 +1143,8 @@ const KPT_MESSAGES_PL = {
|
|
|
1100
1143
|
strike: 'Przekreślenie',
|
|
1101
1144
|
ul: 'Lista punktowana',
|
|
1102
1145
|
ol: 'Lista numerowana',
|
|
1146
|
+
indent: 'Dodaj wcięcie',
|
|
1147
|
+
outdent: 'Usuń wcięcie',
|
|
1103
1148
|
foreColor: 'Kolor tekstu',
|
|
1104
1149
|
backColor: 'Kolor tła tekstu',
|
|
1105
1150
|
alignLeft: 'Wyrównaj do lewej',
|
|
@@ -1146,6 +1191,44 @@ const KPT_MESSAGES_PL = {
|
|
|
1146
1191
|
customColor: 'Kolor…',
|
|
1147
1192
|
},
|
|
1148
1193
|
},
|
|
1194
|
+
auth: {
|
|
1195
|
+
signInTitle: 'Zaloguj się',
|
|
1196
|
+
signInSubtitle: 'Użyj adresu e-mail i hasła.',
|
|
1197
|
+
signUpTitle: 'Załóż konto',
|
|
1198
|
+
signUpSubtitle: 'Zajmie mniej niż minutę.',
|
|
1199
|
+
forgotTitle: 'Zresetuj hasło',
|
|
1200
|
+
forgotSubtitle: 'Wyślemy link do zmiany hasła na podany adres.',
|
|
1201
|
+
name: 'Imię i nazwisko',
|
|
1202
|
+
email: 'E-mail',
|
|
1203
|
+
emailPlaceholder: 'jan@firma.pl',
|
|
1204
|
+
password: 'Hasło',
|
|
1205
|
+
passwordHint: 'Co najmniej {min} znaków.',
|
|
1206
|
+
confirmPassword: 'Powtórz hasło',
|
|
1207
|
+
remember: 'Zapamiętaj mnie',
|
|
1208
|
+
terms: 'Akceptuję regulamin',
|
|
1209
|
+
forgotLink: 'Nie pamiętasz hasła?',
|
|
1210
|
+
backToSignIn: 'Wróć do logowania',
|
|
1211
|
+
signInSubmit: 'Zaloguj się',
|
|
1212
|
+
signUpSubmit: 'Załóż konto',
|
|
1213
|
+
resetSubmit: 'Wyślij link',
|
|
1214
|
+
orContinueWith: 'lub kontynuuj przez',
|
|
1215
|
+
continueWith: 'Kontynuuj przez {provider}',
|
|
1216
|
+
noAccount: 'Nie masz jeszcze konta?',
|
|
1217
|
+
haveAccount: 'Masz już konto?',
|
|
1218
|
+
signInSwitch: 'Zaloguj się',
|
|
1219
|
+
signUpSwitch: 'Załóż konto',
|
|
1220
|
+
errorRequired: 'To pole jest wymagane',
|
|
1221
|
+
errorEmail: 'Podaj poprawny adres e-mail',
|
|
1222
|
+
errorMinLength: 'Użyj co najmniej {min} znaków',
|
|
1223
|
+
errorMismatch: 'Hasła nie są takie same',
|
|
1224
|
+
errorInvalid: 'Nieprawidłowa wartość',
|
|
1225
|
+
promo: {
|
|
1226
|
+
signInTitle: 'Witaj ponownie',
|
|
1227
|
+
signInText: 'Zaloguj się, by wrócić do pracy.',
|
|
1228
|
+
signUpTitle: 'Pierwszy raz u nas?',
|
|
1229
|
+
signUpText: 'Załóż konto i zacznij w minutę.',
|
|
1230
|
+
},
|
|
1231
|
+
},
|
|
1149
1232
|
};
|
|
1150
1233
|
|
|
1151
1234
|
/** Deep-merge `patch` na kopię `base` (łączy tylko obiekty, wartości nadpisuje). */
|
|
@@ -1235,7 +1318,7 @@ class KptI18n {
|
|
|
1235
1318
|
args: [{ providedIn: 'root' }]
|
|
1236
1319
|
}], () => [], null); })();
|
|
1237
1320
|
|
|
1238
|
-
const _c0$
|
|
1321
|
+
const _c0$A = ["*"];
|
|
1239
1322
|
function KptSplitButton_ng_template_6_For_2_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
1240
1323
|
i0.ɵɵelement(0, "div", 7);
|
|
1241
1324
|
} }
|
|
@@ -1351,7 +1434,7 @@ function KptSplitButton_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
1351
1434
|
* Wymaga `import '@angular/cdk/overlay-prebuilt.css';`
|
|
1352
1435
|
*
|
|
1353
1436
|
* @example
|
|
1354
|
-
* <kpt-split-button [items]="items" (primaryClick)="save()" (
|
|
1437
|
+
* <kpt-split-button [items]="items" (primaryClick)="save()" (selected)="onItem($event)">Zapisz</kpt-split-button>
|
|
1355
1438
|
*/
|
|
1356
1439
|
class KptSplitButton {
|
|
1357
1440
|
constructor() {
|
|
@@ -1361,7 +1444,7 @@ class KptSplitButton {
|
|
|
1361
1444
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
1362
1445
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1363
1446
|
this.primaryClick = output();
|
|
1364
|
-
this.
|
|
1447
|
+
this.selected = output();
|
|
1365
1448
|
this.i18n = inject(KptI18n);
|
|
1366
1449
|
this.open = signal(false, /* @ts-ignore */
|
|
1367
1450
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
@@ -1373,11 +1456,11 @@ class KptSplitButton {
|
|
|
1373
1456
|
pick(item) {
|
|
1374
1457
|
if (item.disabled)
|
|
1375
1458
|
return;
|
|
1376
|
-
this.
|
|
1459
|
+
this.selected.emit(item);
|
|
1377
1460
|
this.open.set(false);
|
|
1378
1461
|
}
|
|
1379
1462
|
static { this.ɵfac = function KptSplitButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptSplitButton)(); }; }
|
|
1380
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSplitButton, selectors: [["kpt-split-button"]], hostAttrs: [1, "kpt-split-button-host"], inputs: { variant: [1, "variant"], items: [1, "items"], disabled: [1, "disabled"] }, outputs: { primaryClick: "primaryClick",
|
|
1463
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSplitButton, selectors: [["kpt-split-button"]], hostAttrs: [1, "kpt-split-button-host"], inputs: { variant: [1, "variant"], items: [1, "items"], disabled: [1, "disabled"] }, outputs: { primaryClick: "primaryClick", selected: "selected" }, ngContentSelectors: _c0$A, decls: 7, vars: 8, consts: [["origin", "cdkOverlayOrigin"], [1, "kpt-split-button"], ["type", "button", 1, "kpt-split-button__main", 3, "click", "disabled"], ["type", "button", "cdkOverlayOrigin", "", 1, "kpt-split-button__toggle", 3, "click", "disabled"], ["name", "chevron-down"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["role", "menu", 1, "kpt-split-button__panel"], ["role", "separator", 1, "kpt-split-button__separator"], ["role", "presentation", 1, "kpt-split-button__header"], ["type", "button", 1, "kpt-split-button__item", 3, "kpt-split-button__item--danger", "disabled"], ["size", "sm", 3, "src", "name", "icon"], [3, "name"], [1, "kpt-split-button__text"], [1, "kpt-split-button__label"], [1, "kpt-split-button__description"], ["type", "button", 1, "kpt-split-button__item", 3, "click", "disabled"], [1, "kpt-split-button__badge", 3, "value", "variant"]], template: function KptSplitButton_Template(rf, ctx) { if (rf & 1) {
|
|
1381
1464
|
i0.ɵɵprojectionDef();
|
|
1382
1465
|
i0.ɵɵelementStart(0, "div", 1)(1, "button", 2);
|
|
1383
1466
|
i0.ɵɵlistener("click", function KptSplitButton_Template_button_click_1_listener() { return ctx.primaryClick.emit(); });
|
|
@@ -1479,7 +1562,7 @@ class KptSplitButton {
|
|
|
1479
1562
|
</div>
|
|
1480
1563
|
</ng-template>
|
|
1481
1564
|
`, host: { class: 'kpt-split-button-host' }, styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-split-button-host{display:inline-flex}.kpt-split-button{--_bg: var(--kpt-color-primary);--_fg: var(--kpt-color-on-primary);--_bg-hover: var(--kpt-color-primary-hover);display:inline-flex;border-radius:var(--kpt-button-radius, .5rem);overflow:hidden}.kpt-split-button[data-variant=tonal]{--_bg: var(--kpt-color-muted);--_fg: var(--kpt-color-on-muted);--_bg-hover: var(--kpt-color-muted-hover)}.kpt-split-button__main,.kpt-split-button__toggle{border:0;background:var(--_bg);color:var(--_fg);cursor:pointer;font:inherit;font-size:var(--kpt-font-size-sm, .875rem);font-weight:var(--kpt-font-weight-medium, 500);height:2.5rem;position:relative;isolation:isolate}.kpt-split-button__main:after,.kpt-split-button__toggle:after{content:\"\";position:absolute;inset:0;z-index:-1;background-color:var(--_bg-hover);opacity:0;pointer-events:none;transition:opacity var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-split-button__main:hover:not(:disabled):after,.kpt-split-button__toggle:hover:not(:disabled):after{opacity:1}.kpt-split-button__main:disabled,.kpt-split-button__toggle:disabled{opacity:.5;cursor:not-allowed}@media(prefers-reduced-motion:reduce){.kpt-split-button__main:after,.kpt-split-button__toggle:after{transition:none}}.kpt-split-button__main{padding-inline:var(--kpt-space-4, 1rem)}.kpt-split-button__toggle{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;border-inline-start:1px solid color-mix(in oklch,var(--_fg) 25%,transparent)}.kpt-split-button__panel{min-width:11rem;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)}.kpt-split-button__item{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);width:100%;padding:.5rem .6rem;border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);font:inherit;font-size:var(--kpt-font-size-sm, .875rem);text-align:start;cursor:pointer}.kpt-split-button__item:hover:not(:disabled){background:var(--kpt-color-surface-variant)}.kpt-split-button__item:disabled{opacity:.45;cursor:not-allowed}.kpt-split-button__item--danger{color:var(--kpt-color-danger)}.kpt-split-button__item kpt-icon{color:var(--kpt-color-on-surface-muted)}.kpt-split-button__header{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);padding:.5rem .6rem;font-size:var(--kpt-font-size-sm, .875rem);cursor:default}.kpt-split-button__header .kpt-split-button__label{font-weight:var(--kpt-font-weight-semibold, 600)}.kpt-split-button__header kpt-icon{color:var(--kpt-color-on-surface-muted)}.kpt-split-button__text{display:flex;flex-direction:column;min-width:0}.kpt-split-button__label,.kpt-split-button__description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kpt-split-button__description{color:var(--kpt-color-on-surface-muted);font-size:var(--kpt-font-size-xs, .75rem)}.kpt-split-button__badge{margin-inline-start:auto}.kpt-split-button__separator{height:1px;margin:.25rem 0;background:var(--kpt-color-border)}}\n"] }]
|
|
1482
|
-
}], null, { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], primaryClick: [{ type: i0.Output, args: ["primaryClick"] }],
|
|
1565
|
+
}], null, { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], primaryClick: [{ type: i0.Output, args: ["primaryClick"] }], selected: [{ type: i0.Output, args: ["selected"] }] }); })();
|
|
1483
1566
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSplitButton, { className: "KptSplitButton", filePath: "lib/split-button/split-button.component.ts", lineNumber: 101 }); })();
|
|
1484
1567
|
|
|
1485
1568
|
// Do not edit directly — generated by scripts/gen-tokens.mjs
|
|
@@ -1575,7 +1658,7 @@ function provideKptI18n(config = {}) {
|
|
|
1575
1658
|
return makeEnvironmentProviders([{ provide: KPT_I18N_CONFIG, useValue: config }]);
|
|
1576
1659
|
}
|
|
1577
1660
|
|
|
1578
|
-
const _c0$
|
|
1661
|
+
const _c0$z = ["*"];
|
|
1579
1662
|
function KptChip_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
1580
1663
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
1581
1664
|
i0.ɵɵelementStart(0, "button", 2);
|
|
@@ -1604,7 +1687,7 @@ class KptChip {
|
|
|
1604
1687
|
this.i18n = inject(KptI18n);
|
|
1605
1688
|
}
|
|
1606
1689
|
static { this.ɵfac = function KptChip_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptChip)(); }; }
|
|
1607
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptChip, selectors: [["kpt-chip"]], hostAttrs: [1, "kpt-chip-host"], inputs: { variant: [1, "variant"], removable: [1, "removable"], disabled: [1, "disabled"] }, outputs: { removed: "removed" }, ngContentSelectors: _c0$
|
|
1690
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptChip, selectors: [["kpt-chip"]], hostAttrs: [1, "kpt-chip-host"], inputs: { variant: [1, "variant"], removable: [1, "removable"], disabled: [1, "disabled"] }, outputs: { removed: "removed" }, ngContentSelectors: _c0$z, decls: 3, vars: 4, consts: [[1, "kpt-chip"], ["type", "button", 1, "kpt-chip__remove", 3, "disabled"], ["type", "button", 1, "kpt-chip__remove", 3, "click", "disabled"], ["name", "x"]], template: function KptChip_Template(rf, ctx) { if (rf & 1) {
|
|
1608
1691
|
i0.ɵɵprojectionDef();
|
|
1609
1692
|
i0.ɵɵelementStart(0, "span", 0);
|
|
1610
1693
|
i0.ɵɵprojection(1);
|
|
@@ -1825,7 +1908,7 @@ class KptSkeleton {
|
|
|
1825
1908
|
/** Token DI, przez który kontrolka zgłasza `kpt-form-field` swój stan wypełnienia. */
|
|
1826
1909
|
const KPT_FORM_FIELD_CONTROL = new InjectionToken('KPT_FORM_FIELD_CONTROL');
|
|
1827
1910
|
|
|
1828
|
-
const _c0$
|
|
1911
|
+
const _c0$y = ["*"];
|
|
1829
1912
|
function KptFormField_Conditional_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
1830
1913
|
i0.ɵɵdomElementStart(0, "span", 6);
|
|
1831
1914
|
i0.ɵɵtext(1, "*");
|
|
@@ -1934,7 +2017,7 @@ class KptFormField {
|
|
|
1934
2017
|
i0.ɵɵqueryAdvance();
|
|
1935
2018
|
} }, hostAttrs: [1, "kpt-form-field-host"], hostBindings: function KptFormField_HostBindings(rf, ctx) { if (rf & 1) {
|
|
1936
2019
|
i0.ɵɵlistener("input", function KptFormField_input_HostBindingHandler() { return ctx.updateFilled(); })("change", function KptFormField_change_HostBindingHandler() { return ctx.updateFilled(); });
|
|
1937
|
-
} }, inputs: { label: [1, "label"], hint: [1, "hint"], error: [1, "error"], required: [1, "required"], controlId: [1, "controlId"], labelType: [1, "labelType"] }, ngContentSelectors: _c0$
|
|
2020
|
+
} }, inputs: { label: [1, "label"], hint: [1, "hint"], error: [1, "error"], required: [1, "required"], controlId: [1, "controlId"], labelType: [1, "labelType"] }, ngContentSelectors: _c0$y, decls: 7, vars: 10, consts: [[1, "kpt-form-field"], [1, "kpt-form-field__box"], [1, "kpt-form-field__label"], [1, "kpt-form-field__control"], ["role", "alert", 1, "kpt-form-field__message", "kpt-form-field__message--error"], [1, "kpt-form-field__message", "kpt-form-field__message--hint"], ["aria-hidden", "true", 1, "kpt-form-field__required"]], template: function KptFormField_Template(rf, ctx) { if (rf & 1) {
|
|
1938
2021
|
i0.ɵɵprojectionDef();
|
|
1939
2022
|
i0.ɵɵdomElementStart(0, "div", 0)(1, "div", 1);
|
|
1940
2023
|
i0.ɵɵconditionalCreate(2, KptFormField_Conditional_2_Template, 3, 3, "label", 2);
|
|
@@ -1964,7 +2047,7 @@ class KptFormField {
|
|
|
1964
2047
|
}], () => [], { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], labelType: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelType", required: false }] }], control: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KPT_FORM_FIELD_CONTROL), { ...{ descendants: true }, isSignal: true }] }] }); })();
|
|
1965
2048
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptFormField, { className: "KptFormField", filePath: "lib/form-field/form-field.component.ts", lineNumber: 50 }); })();
|
|
1966
2049
|
|
|
1967
|
-
let nextUniqueId = 0;
|
|
2050
|
+
let nextUniqueId$2 = 0;
|
|
1968
2051
|
/**
|
|
1969
2052
|
* Pole tekstowe Koncept UI zintegrowane z Angular Signal Forms.
|
|
1970
2053
|
* Implementuje `FormValueControl<string>` — wiąż je dyrektywą `FormField`:
|
|
@@ -2002,10 +2085,13 @@ class KptInput {
|
|
|
2002
2085
|
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
2003
2086
|
this.placeholder = input('', /* @ts-ignore */
|
|
2004
2087
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2005
|
-
this.id = input(`kpt-input-${++nextUniqueId}`, /* @ts-ignore */
|
|
2088
|
+
this.id = input(`kpt-input-${++nextUniqueId$2}`, /* @ts-ignore */
|
|
2006
2089
|
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
2007
2090
|
this.ariaLabel = input(null, /* @ts-ignore */
|
|
2008
2091
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2092
|
+
/** Podpowiedź autouzupełniania dla przeglądarki i menedżera haseł (np. 'email', 'current-password'). */
|
|
2093
|
+
this.autocomplete = input(null, /* @ts-ignore */
|
|
2094
|
+
...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
2009
2095
|
}
|
|
2010
2096
|
onInput(event) {
|
|
2011
2097
|
this.value.set(event.target.value);
|
|
@@ -2013,13 +2099,13 @@ class KptInput {
|
|
|
2013
2099
|
static { this.ɵfac = function KptInput_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptInput)(); }; }
|
|
2014
2100
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptInput, selectors: [["kpt-input"]], hostAttrs: [1, "kpt-input-host"], hostVars: 1, hostBindings: function KptInput_HostBindings(rf, ctx) { if (rf & 2) {
|
|
2015
2101
|
i0.ɵɵattribute("id", null);
|
|
2016
|
-
} }, inputs: { value: [1, "value"], disabled: [1, "disabled"], readonly: [1, "readonly"], required: [1, "required"], invalid: [1, "invalid"], errors: [1, "errors"], touched: [1, "touched"], type: [1, "type"], placeholder: [1, "placeholder"], id: [1, "id"], ariaLabel: [1, "ariaLabel"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 1, vars:
|
|
2102
|
+
} }, inputs: { value: [1, "value"], disabled: [1, "disabled"], readonly: [1, "readonly"], required: [1, "required"], invalid: [1, "invalid"], errors: [1, "errors"], touched: [1, "touched"], type: [1, "type"], placeholder: [1, "placeholder"], id: [1, "id"], ariaLabel: [1, "ariaLabel"], autocomplete: [1, "autocomplete"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 1, vars: 10, consts: [[1, "kpt-input__field", 3, "input", "blur", "id", "type", "value", "placeholder", "disabled", "readOnly"]], template: function KptInput_Template(rf, ctx) { if (rf & 1) {
|
|
2017
2103
|
i0.ɵɵdomElementStart(0, "input", 0);
|
|
2018
2104
|
i0.ɵɵdomListener("input", function KptInput_Template_input_input_0_listener($event) { return ctx.onInput($event); })("blur", function KptInput_Template_input_blur_0_listener() { return ctx.touch.emit(); });
|
|
2019
2105
|
i0.ɵɵdomElementEnd();
|
|
2020
2106
|
} if (rf & 2) {
|
|
2021
2107
|
i0.ɵɵdomProperty("id", ctx.id())("type", ctx.type())("value", ctx.value())("placeholder", ctx.placeholder())("disabled", ctx.disabled())("readOnly", ctx.readonly());
|
|
2022
|
-
i0.ɵɵattribute("aria-required", ctx.required() ? "true" : null)("aria-label", ctx.ariaLabel())("aria-invalid", ctx.showInvalid() ? "true" : null);
|
|
2108
|
+
i0.ɵɵattribute("aria-required", ctx.required() ? "true" : null)("aria-label", ctx.ariaLabel())("autocomplete", ctx.autocomplete())("aria-invalid", ctx.showInvalid() ? "true" : null);
|
|
2023
2109
|
} }, styles: ["@layer kpt.components{.kpt-input-host{display:block}.kpt-input__field{display:block;width:100%;box-sizing:border-box;height:2.5rem;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);font-family:inherit;font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-form-field-text);background-color:var(--%NS%kpt-form-field-bg);transition:border-color var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard),box-shadow var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard)}.kpt-input__field::placeholder{color:var(--%NS%kpt-form-field-placeholder)}.kpt-input__field:hover:not(:disabled):not([aria-invalid=true]){border-color:var(--%NS%kpt-form-field-border-hover)}.kpt-input__field: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-input__field[aria-invalid=true]{border-color:var(--%NS%kpt-form-field-border-error)}.kpt-input__field[aria-invalid=true]:focus-visible{box-shadow:0 0 0 2px color-mix(in oklch,var(--%NS%kpt-form-field-border-error) 30%,transparent)}.kpt-input__field:disabled{cursor:not-allowed;opacity:.6;background-color:var(--%NS%kpt-color-surface-variant)}}\n"], encapsulation: 2 }); }
|
|
2024
2110
|
}
|
|
2025
2111
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptInput, [{
|
|
@@ -2028,11 +2114,11 @@ class KptInput {
|
|
|
2028
2114
|
class: 'kpt-input-host',
|
|
2029
2115
|
// id należy wyłącznie do wewnętrznego <input> (powiązanie label[for]); host go nie nosi
|
|
2030
2116
|
'[attr.id]': 'null',
|
|
2031
|
-
}, template: "<input\n class=\"kpt-input__field\"\n [id]=\"id()\"\n [type]=\"type()\"\n [value]=\"value()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"showInvalid() ? 'true' : null\"\n (input)=\"onInput($event)\"\n (blur)=\"touch.emit()\"\n/>\n", styles: ["@layer kpt.components{.kpt-input-host{display:block}.kpt-input__field{display:block;width:100%;box-sizing:border-box;height:2.5rem;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);font-family:inherit;font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-form-field-text);background-color:var(--kpt-form-field-bg);transition:border-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard),box-shadow var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-input__field::placeholder{color:var(--kpt-form-field-placeholder)}.kpt-input__field:hover:not(:disabled):not([aria-invalid=true]){border-color:var(--kpt-form-field-border-hover)}.kpt-input__field: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-input__field[aria-invalid=true]{border-color:var(--kpt-form-field-border-error)}.kpt-input__field[aria-invalid=true]:focus-visible{box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-error) 30%,transparent)}.kpt-input__field:disabled{cursor:not-allowed;opacity:.6;background-color:var(--kpt-color-surface-variant)}}\n"] }]
|
|
2032
|
-
}], null, { 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 }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] }); })();
|
|
2117
|
+
}, template: "<input\n class=\"kpt-input__field\"\n [id]=\"id()\"\n [type]=\"type()\"\n [value]=\"value()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.aria-invalid]=\"showInvalid() ? 'true' : null\"\n (input)=\"onInput($event)\"\n (blur)=\"touch.emit()\"\n/>\n", styles: ["@layer kpt.components{.kpt-input-host{display:block}.kpt-input__field{display:block;width:100%;box-sizing:border-box;height:2.5rem;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);font-family:inherit;font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-form-field-text);background-color:var(--kpt-form-field-bg);transition:border-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard),box-shadow var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-input__field::placeholder{color:var(--kpt-form-field-placeholder)}.kpt-input__field:hover:not(:disabled):not([aria-invalid=true]){border-color:var(--kpt-form-field-border-hover)}.kpt-input__field: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-input__field[aria-invalid=true]{border-color:var(--kpt-form-field-border-error)}.kpt-input__field[aria-invalid=true]:focus-visible{box-shadow:0 0 0 2px color-mix(in oklch,var(--kpt-form-field-border-error) 30%,transparent)}.kpt-input__field:disabled{cursor:not-allowed;opacity:.6;background-color:var(--kpt-color-surface-variant)}}\n"] }]
|
|
2118
|
+
}], null, { 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 }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }] }); })();
|
|
2033
2119
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptInput, { className: "KptInput", filePath: "lib/input/input.component.ts", lineNumber: 49 }); })();
|
|
2034
2120
|
|
|
2035
|
-
const _c0$
|
|
2121
|
+
const _c0$x = ["*"];
|
|
2036
2122
|
function KptCheckbox_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
2037
2123
|
i0.ɵɵdomElementStart(0, "span", 5);
|
|
2038
2124
|
i0.ɵɵtext(1);
|
|
@@ -2063,7 +2149,7 @@ class KptCheckbox {
|
|
|
2063
2149
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2064
2150
|
}
|
|
2065
2151
|
static { this.ɵfac = function KptCheckbox_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptCheckbox)(); }; }
|
|
2066
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptCheckbox, selectors: [["kpt-checkbox"]], hostAttrs: [1, "kpt-checkbox-host"], inputs: { checked: [1, "checked"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], label: [1, "label"] }, outputs: { checked: "checkedChange", touch: "touch" }, ngContentSelectors: _c0$
|
|
2152
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptCheckbox, selectors: [["kpt-checkbox"]], hostAttrs: [1, "kpt-checkbox-host"], inputs: { checked: [1, "checked"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], label: [1, "label"] }, outputs: { checked: "checkedChange", touch: "touch" }, ngContentSelectors: _c0$x, decls: 7, vars: 6, consts: [[1, "kpt-checkbox"], ["type", "checkbox", 1, "kpt-checkbox__input", 3, "change", "blur", "checked", "disabled"], ["aria-hidden", "true", 1, "kpt-checkbox__box"], ["viewBox", "0 0 16 16", 1, "kpt-checkbox__check"], ["d", "M13 4.5 6.5 11 3 7.5"], [1, "kpt-checkbox__label"]], template: function KptCheckbox_Template(rf, ctx) { if (rf & 1) {
|
|
2067
2153
|
i0.ɵɵprojectionDef();
|
|
2068
2154
|
i0.ɵɵdomElementStart(0, "label", 0)(1, "input", 1);
|
|
2069
2155
|
i0.ɵɵdomListener("change", function KptCheckbox_Template_input_change_1_listener($event) { return ctx.checked.set($event.target.checked); })("blur", function KptCheckbox_Template_input_blur_1_listener() { return ctx.touch.emit(); });
|
|
@@ -2110,7 +2196,7 @@ class KptCheckbox {
|
|
|
2110
2196
|
}], null, { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], 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"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] }); })();
|
|
2111
2197
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptCheckbox, { className: "KptCheckbox", filePath: "lib/checkbox/checkbox.component.ts", lineNumber: 44 }); })();
|
|
2112
2198
|
|
|
2113
|
-
const _c0$
|
|
2199
|
+
const _c0$w = ["*"];
|
|
2114
2200
|
function KptSwitch_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
2115
2201
|
i0.ɵɵdomElementStart(0, "span", 1);
|
|
2116
2202
|
i0.ɵɵtext(1);
|
|
@@ -2176,7 +2262,7 @@ class KptSwitch {
|
|
|
2176
2262
|
...(ngDevMode ? [{ debugName: "stateLabel" }] : /* istanbul ignore next */ []));
|
|
2177
2263
|
}
|
|
2178
2264
|
static { this.ɵfac = function KptSwitch_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptSwitch)(); }; }
|
|
2179
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSwitch, selectors: [["kpt-switch"]], hostAttrs: [1, "kpt-switch-host"], inputs: { checked: [1, "checked"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], label: [1, "label"], labelPosition: [1, "labelPosition"], onLabel: [1, "onLabel"], offLabel: [1, "offLabel"] }, outputs: { checked: "checkedChange", touch: "touch" }, ngContentSelectors: _c0$
|
|
2265
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSwitch, selectors: [["kpt-switch"]], hostAttrs: [1, "kpt-switch-host"], inputs: { checked: [1, "checked"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], label: [1, "label"], labelPosition: [1, "labelPosition"], onLabel: [1, "onLabel"], offLabel: [1, "offLabel"] }, outputs: { checked: "checkedChange", touch: "touch" }, ngContentSelectors: _c0$w, decls: 8, vars: 8, consts: [[1, "kpt-switch"], [1, "kpt-switch__label", "kpt-switch__label--start"], ["type", "checkbox", "role", "switch", 1, "kpt-switch__input", 3, "change", "blur", "checked", "disabled"], ["aria-hidden", "true", 1, "kpt-switch__track"], [1, "kpt-switch__thumb"], [1, "kpt-switch__label"], [1, "kpt-switch__state", 3, "kpt-switch__state--on"], [1, "kpt-switch__state"]], template: function KptSwitch_Template(rf, ctx) { if (rf & 1) {
|
|
2180
2266
|
i0.ɵɵprojectionDef();
|
|
2181
2267
|
i0.ɵɵdomElementStart(0, "label", 0);
|
|
2182
2268
|
i0.ɵɵconditionalCreate(1, KptSwitch_Conditional_1_Template, 2, 1, "span", 1);
|
|
@@ -2233,7 +2319,7 @@ class KptSwitch {
|
|
|
2233
2319
|
}], null, { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], 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"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], onLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onLabel", required: false }] }], offLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offLabel", required: false }] }] }); })();
|
|
2234
2320
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSwitch, { className: "KptSwitch", filePath: "lib/switch/switch.component.ts", lineNumber: 53 }); })();
|
|
2235
2321
|
|
|
2236
|
-
const _forTrack0$
|
|
2322
|
+
const _forTrack0$d = ($index, $item) => $item.value;
|
|
2237
2323
|
function KptSwitchGroup_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
2238
2324
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
2239
2325
|
i0.ɵɵelementStart(0, "kpt-switch", 2);
|
|
@@ -2321,7 +2407,7 @@ class KptSwitchGroup {
|
|
|
2321
2407
|
static { this.ɵfac = function KptSwitchGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptSwitchGroup)(); }; }
|
|
2322
2408
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSwitchGroup, selectors: [["kpt-switch-group"]], hostAttrs: [1, "kpt-switch-group-host"], inputs: { value: [1, "value"], options: [1, "options"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], orientation: [1, "orientation"], multiple: [1, "multiple"], allowDeselect: [1, "allowDeselect"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 3, vars: 3, consts: [["role", "group", 1, "kpt-switch-group"], [1, "kpt-switch-group__item", 3, "checked", "label", "disabled"], [1, "kpt-switch-group__item", 3, "checkedChange", "touch", "checked", "label", "disabled"]], template: function KptSwitchGroup_Template(rf, ctx) { if (rf & 1) {
|
|
2323
2409
|
i0.ɵɵelementStart(0, "div", 0);
|
|
2324
|
-
i0.ɵɵrepeaterCreate(1, KptSwitchGroup_For_2_Template, 1, 3, "kpt-switch", 1, _forTrack0$
|
|
2410
|
+
i0.ɵɵrepeaterCreate(1, KptSwitchGroup_For_2_Template, 1, 3, "kpt-switch", 1, _forTrack0$d);
|
|
2325
2411
|
i0.ɵɵelementEnd();
|
|
2326
2412
|
} if (rf & 2) {
|
|
2327
2413
|
i0.ɵɵclassProp("kpt-switch-group--horizontal", ctx.orientation() === "horizontal");
|
|
@@ -2354,7 +2440,7 @@ class KptSwitchGroup {
|
|
|
2354
2440
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", 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"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], allowDeselect: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowDeselect", required: false }] }] }); })();
|
|
2355
2441
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSwitchGroup, { className: "KptSwitchGroup", filePath: "lib/switch-group/switch-group.component.ts", lineNumber: 52 }); })();
|
|
2356
2442
|
|
|
2357
|
-
const _forTrack0$
|
|
2443
|
+
const _forTrack0$c = ($index, $item) => $item.value;
|
|
2358
2444
|
function KptRadioGroup_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
2359
2445
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
2360
2446
|
i0.ɵɵdomElementStart(0, "label", 2)(1, "input", 3);
|
|
@@ -2397,7 +2483,7 @@ class KptRadioGroup {
|
|
|
2397
2483
|
static { this.ɵfac = function KptRadioGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptRadioGroup)(); }; }
|
|
2398
2484
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptRadioGroup, selectors: [["kpt-radio-group"]], hostAttrs: [1, "kpt-radio-group-host"], inputs: { value: [1, "value"], options: [1, "options"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"], name: [1, "name"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 3, vars: 1, consts: [["role", "radiogroup", 1, "kpt-radio-group"], [1, "kpt-radio", 3, "kpt-radio--disabled"], [1, "kpt-radio"], ["type", "radio", 1, "kpt-radio__input", 3, "change", "blur", "name", "checked", "disabled"], ["aria-hidden", "true", 1, "kpt-radio__dot"], [1, "kpt-radio__label"]], template: function KptRadioGroup_Template(rf, ctx) { if (rf & 1) {
|
|
2399
2485
|
i0.ɵɵdomElementStart(0, "div", 0);
|
|
2400
|
-
i0.ɵɵrepeaterCreate(1, KptRadioGroup_For_2_Template, 5, 6, "label", 1, _forTrack0$
|
|
2486
|
+
i0.ɵɵrepeaterCreate(1, KptRadioGroup_For_2_Template, 5, 6, "label", 1, _forTrack0$c);
|
|
2401
2487
|
i0.ɵɵdomElementEnd();
|
|
2402
2488
|
} if (rf & 2) {
|
|
2403
2489
|
i0.ɵɵattribute("aria-invalid", ctx.showInvalid() ? "true" : null);
|
|
@@ -2429,7 +2515,7 @@ class KptRadioGroup {
|
|
|
2429
2515
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", 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"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] }); })();
|
|
2430
2516
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptRadioGroup, { className: "KptRadioGroup", filePath: "lib/radio-group/radio-group.component.ts", lineNumber: 46 }); })();
|
|
2431
2517
|
|
|
2432
|
-
const _forTrack0$
|
|
2518
|
+
const _forTrack0$b = ($index, $item) => $item.value;
|
|
2433
2519
|
function KptSelect_Conditional_3_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
2434
2520
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
2435
2521
|
i0.ɵɵelementStart(0, "span", 7);
|
|
@@ -2447,7 +2533,7 @@ function KptSelect_Conditional_3_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
2447
2533
|
i0.ɵɵattribute("aria-label", ctx_r2.i18n.t("select.removeChip"));
|
|
2448
2534
|
} }
|
|
2449
2535
|
function KptSelect_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
2450
|
-
i0.ɵɵrepeaterCreate(0, KptSelect_Conditional_3_For_1_Template, 4, 2, "span", 7, _forTrack0$
|
|
2536
|
+
i0.ɵɵrepeaterCreate(0, KptSelect_Conditional_3_For_1_Template, 4, 2, "span", 7, _forTrack0$b);
|
|
2451
2537
|
} if (rf & 2) {
|
|
2452
2538
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
2453
2539
|
i0.ɵɵrepeater(ctx_r2.selectedOptions());
|
|
@@ -2533,7 +2619,7 @@ function KptSelect_ng_template_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
2533
2619
|
i0.ɵɵlistener("keydown", function KptSelect_ng_template_7_Template_div_keydown_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onPanelKeydown($event)); });
|
|
2534
2620
|
i0.ɵɵconditionalCreate(1, KptSelect_ng_template_7_Conditional_1_Template, 3, 2, "div", 11);
|
|
2535
2621
|
i0.ɵɵelementStart(2, "ul", 12);
|
|
2536
|
-
i0.ɵɵrepeaterCreate(3, KptSelect_ng_template_7_For_4_Template, 5, 10, "li", 13, _forTrack0$
|
|
2622
|
+
i0.ɵɵrepeaterCreate(3, KptSelect_ng_template_7_For_4_Template, 5, 10, "li", 13, _forTrack0$b, false, KptSelect_ng_template_7_ForEmpty_5_Template, 2, 1, "li", 14);
|
|
2537
2623
|
i0.ɵɵelementEnd()();
|
|
2538
2624
|
} if (rf & 2) {
|
|
2539
2625
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
@@ -2736,7 +2822,7 @@ function monthNames(locale) {
|
|
|
2736
2822
|
return Array.from({ length: 12 }, (_, i) => fmt.format(new Date(Date.UTC(2024, i, 1))));
|
|
2737
2823
|
}
|
|
2738
2824
|
|
|
2739
|
-
const _forTrack0$
|
|
2825
|
+
const _forTrack0$a = ($index, $item) => $item.hour24;
|
|
2740
2826
|
function KptClock_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
2741
2827
|
const _r2 = i0.ɵɵgetCurrentView();
|
|
2742
2828
|
i0.ɵɵdomElementStart(0, "div", 5)(1, "button", 9);
|
|
@@ -2768,7 +2854,7 @@ function KptClock_Conditional_13_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
2768
2854
|
i0.ɵɵtextInterpolate(mark_r6.label);
|
|
2769
2855
|
} }
|
|
2770
2856
|
function KptClock_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
2771
|
-
i0.ɵɵrepeaterCreate(0, KptClock_Conditional_13_For_1_Template, 2, 9, "button", 10, _forTrack0$
|
|
2857
|
+
i0.ɵɵrepeaterCreate(0, KptClock_Conditional_13_For_1_Template, 2, 9, "button", 10, _forTrack0$a);
|
|
2772
2858
|
} if (rf & 2) {
|
|
2773
2859
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
2774
2860
|
i0.ɵɵrepeater(ctx_r2.hourMarks());
|
|
@@ -2787,7 +2873,7 @@ function KptClock_Conditional_14_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
2787
2873
|
i0.ɵɵtextInterpolate(mark_r8.label);
|
|
2788
2874
|
} }
|
|
2789
2875
|
function KptClock_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
2790
|
-
i0.ɵɵrepeaterCreate(0, KptClock_Conditional_14_For_1_Template, 2, 7, "button", 12, _forTrack0$
|
|
2876
|
+
i0.ɵɵrepeaterCreate(0, KptClock_Conditional_14_For_1_Template, 2, 7, "button", 12, _forTrack0$a);
|
|
2791
2877
|
} if (rf & 2) {
|
|
2792
2878
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
2793
2879
|
i0.ɵɵrepeater(ctx_r2.minuteMarks());
|
|
@@ -2795,6 +2881,11 @@ function KptClock_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
|
2795
2881
|
const R_OUTER = 40;
|
|
2796
2882
|
const R_INNER = 26;
|
|
2797
2883
|
const pad$2 = (n) => String(n).padStart(2, '0');
|
|
2884
|
+
/** Pozycja znacznika (% tarczy) na pierścieniu o promieniu `radius`: 12 na górze, zegarowo. */
|
|
2885
|
+
function markPos(index, radius) {
|
|
2886
|
+
const theta = (index / 12) * 2 * Math.PI;
|
|
2887
|
+
return { x: 50 + radius * Math.sin(theta), y: 50 - radius * Math.cos(theta) };
|
|
2888
|
+
}
|
|
2798
2889
|
/**
|
|
2799
2890
|
* Tarcza zegara (wybór godziny) — dwa etapy: godziny → minuty, klik lub przeciąganie.
|
|
2800
2891
|
* Format 12/24h (`hourFormat`); w 24h dodatkowy wewnętrzny pierścień 13–00, w 12h AM/PM.
|
|
@@ -2826,66 +2917,14 @@ class KptClock {
|
|
|
2826
2917
|
...(ngDevMode ? [{ debugName: "hourLabel" }] : /* istanbul ignore next */ []));
|
|
2827
2918
|
this.minuteLabel = computed(() => pad$2(this.minute()), /* @ts-ignore */
|
|
2828
2919
|
...(ngDevMode ? [{ debugName: "minuteLabel" }] : /* istanbul ignore next */ []));
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
if (this.hourFormat() === 12) {
|
|
2832
|
-
const ap = this.ampm();
|
|
2833
|
-
const curH12 = this.hour12();
|
|
2834
|
-
for (let i = 0; i < 12; i++) {
|
|
2835
|
-
const theta = (i / 12) * 2 * Math.PI;
|
|
2836
|
-
const h12 = i === 0 ? 12 : i;
|
|
2837
|
-
marks.push({
|
|
2838
|
-
label: String(h12),
|
|
2839
|
-
hour24: this.from12h(h12, ap),
|
|
2840
|
-
x: 50 + R_OUTER * Math.sin(theta),
|
|
2841
|
-
y: 50 - R_OUTER * Math.cos(theta),
|
|
2842
|
-
inner: false,
|
|
2843
|
-
selected: curH12 === h12,
|
|
2844
|
-
});
|
|
2845
|
-
}
|
|
2846
|
-
return marks;
|
|
2847
|
-
}
|
|
2848
|
-
const cur = this.hour();
|
|
2849
|
-
for (let i = 0; i < 12; i++) {
|
|
2850
|
-
const theta = (i / 12) * 2 * Math.PI;
|
|
2851
|
-
const hour24 = i === 0 ? 12 : i;
|
|
2852
|
-
marks.push({
|
|
2853
|
-
label: i === 0 ? '12' : String(i),
|
|
2854
|
-
hour24,
|
|
2855
|
-
x: 50 + R_OUTER * Math.sin(theta),
|
|
2856
|
-
y: 50 - R_OUTER * Math.cos(theta),
|
|
2857
|
-
inner: false,
|
|
2858
|
-
selected: cur === hour24,
|
|
2859
|
-
});
|
|
2860
|
-
}
|
|
2861
|
-
for (let i = 0; i < 12; i++) {
|
|
2862
|
-
const theta = (i / 12) * 2 * Math.PI;
|
|
2863
|
-
const hour24 = i === 0 ? 0 : i + 12;
|
|
2864
|
-
marks.push({
|
|
2865
|
-
label: i === 0 ? '00' : String(i + 12),
|
|
2866
|
-
hour24,
|
|
2867
|
-
x: 50 + R_INNER * Math.sin(theta),
|
|
2868
|
-
y: 50 - R_INNER * Math.cos(theta),
|
|
2869
|
-
inner: true,
|
|
2870
|
-
selected: cur === hour24,
|
|
2871
|
-
});
|
|
2872
|
-
}
|
|
2873
|
-
return marks;
|
|
2874
|
-
}, /* @ts-ignore */
|
|
2920
|
+
/** W 12h jeden pierścień; w 24h zewnętrzny (12, 1–11) i wewnętrzny (00, 13–23). */
|
|
2921
|
+
this.hourMarks = computed(() => this.hourFormat() === 12 ? this.marks12h() : [...this.marks24hOuter(), ...this.marks24hInner()], /* @ts-ignore */
|
|
2875
2922
|
...(ngDevMode ? [{ debugName: "hourMarks" }] : /* istanbul ignore next */ []));
|
|
2876
2923
|
this.minuteMarks = computed(() => {
|
|
2877
2924
|
const cur = this.minute();
|
|
2878
2925
|
return Array.from({ length: 12 }, (_, i) => {
|
|
2879
2926
|
const val = i * 5;
|
|
2880
|
-
|
|
2881
|
-
return {
|
|
2882
|
-
label: pad$2(val),
|
|
2883
|
-
hour24: val,
|
|
2884
|
-
x: 50 + R_OUTER * Math.sin(theta),
|
|
2885
|
-
y: 50 - R_OUTER * Math.cos(theta),
|
|
2886
|
-
inner: false,
|
|
2887
|
-
selected: cur === val,
|
|
2888
|
-
};
|
|
2927
|
+
return { label: pad$2(val), hour24: val, ...markPos(i, R_OUTER), inner: false, selected: cur === val };
|
|
2889
2928
|
});
|
|
2890
2929
|
}, /* @ts-ignore */
|
|
2891
2930
|
...(ngDevMode ? [{ debugName: "minuteMarks" }] : /* istanbul ignore next */ []));
|
|
@@ -2911,6 +2950,31 @@ class KptClock {
|
|
|
2911
2950
|
const base = h12 % 12; // 12 → 0
|
|
2912
2951
|
return ap === 'PM' ? base + 12 : base;
|
|
2913
2952
|
}
|
|
2953
|
+
marks12h() {
|
|
2954
|
+
const ap = this.ampm();
|
|
2955
|
+
const cur = this.hour();
|
|
2956
|
+
return Array.from({ length: 12 }, (_, i) => {
|
|
2957
|
+
const h12 = i === 0 ? 12 : i;
|
|
2958
|
+
// Wartość docelowa bierze bieżące AM/PM — tarcza pokazuje tylko jedną połowę doby.
|
|
2959
|
+
const hour24 = this.from12h(h12, ap);
|
|
2960
|
+
return { label: String(h12), hour24, ...markPos(i, R_OUTER), inner: false, selected: cur === hour24 };
|
|
2961
|
+
});
|
|
2962
|
+
}
|
|
2963
|
+
marks24hOuter() {
|
|
2964
|
+
const cur = this.hour();
|
|
2965
|
+
return Array.from({ length: 12 }, (_, i) => {
|
|
2966
|
+
const hour24 = i === 0 ? 12 : i;
|
|
2967
|
+
return { label: String(hour24), hour24, ...markPos(i, R_OUTER), inner: false, selected: cur === hour24 };
|
|
2968
|
+
});
|
|
2969
|
+
}
|
|
2970
|
+
marks24hInner() {
|
|
2971
|
+
const cur = this.hour();
|
|
2972
|
+
return Array.from({ length: 12 }, (_, i) => {
|
|
2973
|
+
const hour24 = i === 0 ? 0 : i + 12;
|
|
2974
|
+
// `pad` daje '00' dla północy; 13–23 są już dwucyfrowe.
|
|
2975
|
+
return { label: pad$2(hour24), hour24, ...markPos(i, R_INNER), inner: true, selected: cur === hour24 };
|
|
2976
|
+
});
|
|
2977
|
+
}
|
|
2914
2978
|
setPhase(phase) {
|
|
2915
2979
|
this.clockPhase.set(phase);
|
|
2916
2980
|
}
|
|
@@ -2939,24 +3003,32 @@ class KptClock {
|
|
|
2939
3003
|
if (deg < 0)
|
|
2940
3004
|
deg += 360;
|
|
2941
3005
|
if (this.clockPhase() === 'hours') {
|
|
2942
|
-
|
|
2943
|
-
if (this.hourFormat() === 12) {
|
|
2944
|
-
const h12 = idx === 0 ? 12 : idx;
|
|
2945
|
-
this.hour.set(this.from12h(h12, this.ampm()));
|
|
2946
|
-
}
|
|
2947
|
-
else {
|
|
2948
|
-
const radius = Math.hypot(dx, dy) / (rect.width / 2);
|
|
2949
|
-
const inner = radius < (R_OUTER + R_INNER) / 2 / 50;
|
|
2950
|
-
this.hour.set(inner ? (idx === 0 ? 0 : idx + 12) : idx === 0 ? 12 : idx);
|
|
2951
|
-
}
|
|
3006
|
+
this.setHourFromAngle(deg, Math.hypot(dx, dy) / (rect.width / 2));
|
|
2952
3007
|
}
|
|
2953
3008
|
else {
|
|
2954
|
-
|
|
2955
|
-
const raw = Math.round(deg / 6) % 60;
|
|
2956
|
-
this.minute.set((Math.round(raw / step) * step) % 60);
|
|
3009
|
+
this.setMinuteFromAngle(deg);
|
|
2957
3010
|
}
|
|
2958
3011
|
this.emit();
|
|
2959
3012
|
}
|
|
3013
|
+
/** Godzina z kąta; w 24h o pierścieniu (a więc o 12–23 vs 0–11) decyduje promień kliknięcia. */
|
|
3014
|
+
setHourFromAngle(deg, radius) {
|
|
3015
|
+
const idx = Math.round(deg / 30) % 12;
|
|
3016
|
+
if (this.hourFormat() === 12) {
|
|
3017
|
+
this.hour.set(this.from12h(idx === 0 ? 12 : idx, this.ampm()));
|
|
3018
|
+
return;
|
|
3019
|
+
}
|
|
3020
|
+
const inner = radius < (R_OUTER + R_INNER) / 2 / 50;
|
|
3021
|
+
if (inner)
|
|
3022
|
+
this.hour.set(idx === 0 ? 0 : idx + 12);
|
|
3023
|
+
else
|
|
3024
|
+
this.hour.set(idx === 0 ? 12 : idx);
|
|
3025
|
+
}
|
|
3026
|
+
/** Minuta z kąta, dociągnięta do `minuteStep`. */
|
|
3027
|
+
setMinuteFromAngle(deg) {
|
|
3028
|
+
const step = Math.max(1, this.minuteStep());
|
|
3029
|
+
const raw = Math.round(deg / 6) % 60;
|
|
3030
|
+
this.minute.set((Math.round(raw / step) * step) % 60);
|
|
3031
|
+
}
|
|
2960
3032
|
onDialUp() {
|
|
2961
3033
|
if (this.clockPhase() === 'hours')
|
|
2962
3034
|
this.clockPhase.set('minutes');
|
|
@@ -3056,9 +3128,9 @@ class KptClock {
|
|
|
3056
3128
|
</div>
|
|
3057
3129
|
`, host: { class: 'kpt-clock-host' }, styles: ["@layer kpt.components{.kpt-clock-host{display:block}.kpt-clock__time{display:flex;align-items:center;justify-content:center;gap:var(--kpt-space-1, .25rem);margin-bottom:var(--kpt-space-3, .75rem);font-variant-numeric:tabular-nums}.kpt-clock__seg{border:0;background:none;padding:.1rem .4rem;border-radius:var(--kpt-radius-sm, .25rem);font-size:var(--kpt-font-size-2xl, 1.5rem);font-weight:var(--kpt-font-weight-semibold, 600);color:var(--kpt-color-on-surface-muted);cursor:pointer}.kpt-clock__seg.is-active{color:var(--kpt-color-primary);background:var(--kpt-color-muted)}.kpt-clock__colon{font-size:var(--kpt-font-size-2xl, 1.5rem);font-weight:var(--kpt-font-weight-semibold, 600);color:var(--kpt-color-on-surface-muted)}.kpt-clock__ampm{display:flex;flex-direction:column;gap:2px;margin-inline-start:var(--kpt-space-2, .5rem)}.kpt-clock__ampm button{border:var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);background:none;padding:.1rem .4rem;border-radius:var(--kpt-radius-sm, .25rem);font-size:var(--kpt-font-size-xs, .75rem);font-weight:var(--kpt-font-weight-semibold, 600);color:var(--kpt-color-on-surface-muted);cursor:pointer}.kpt-clock__ampm button.is-active{background:var(--kpt-color-primary);border-color:var(--kpt-color-primary);color:var(--kpt-color-on-primary)}.kpt-clock__face{position:relative;width:13rem;max-width:100%;aspect-ratio:1;margin:0 auto;border-radius:50%;background:var(--kpt-color-surface-variant);touch-action:none;-webkit-user-select:none;user-select:none}.kpt-clock__center{position:absolute;left:50%;top:50%;width:8px;height:8px;transform:translate(-50%,-50%);border-radius:50%;background:var(--kpt-color-primary);z-index:2}.kpt-clock__hand{position:absolute;left:50%;bottom:50%;width:2px;height:40%;margin-left:-1px;transform-origin:bottom center;background:var(--kpt-color-primary);z-index:1}.kpt-clock__hand--inner{height:26%}.kpt-clock__hand:before{content:\"\";position:absolute;top:-3px;left:50%;width:8px;height:8px;transform:translate(-50%);border-radius:50%;background:var(--kpt-color-primary)}.kpt-clock__num{position:absolute;transform:translate(-50%,-50%);display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:50%;background:none;color:var(--kpt-color-on-surface);font:inherit;font-size:var(--kpt-font-size-sm, .875rem);cursor:pointer;z-index:2}.kpt-clock__num:hover{background:var(--kpt-color-muted)}.kpt-clock__num--inner{width:1.6rem;height:1.6rem;font-size:var(--kpt-font-size-xs, .75rem);color:var(--kpt-color-on-surface-muted)}.kpt-clock__num--selected{background:var(--kpt-color-primary)!important;color:var(--kpt-color-on-primary)}}\n"] }]
|
|
3058
3130
|
}], () => [], { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }] }); })();
|
|
3059
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptClock, { className: "KptClock", filePath: "lib/datepicker/clock.component.ts", lineNumber:
|
|
3131
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptClock, { className: "KptClock", filePath: "lib/datepicker/clock.component.ts", lineNumber: 100 }); })();
|
|
3060
3132
|
|
|
3061
|
-
const _forTrack0$
|
|
3133
|
+
const _forTrack0$9 = ($index, $item) => $item.iso;
|
|
3062
3134
|
const _forTrack1$2 = ($index, $item) => $item.label;
|
|
3063
3135
|
function KptDatepicker_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
3064
3136
|
i0.ɵɵelementStart(0, "span", 2);
|
|
@@ -3231,7 +3303,7 @@ function KptDatepicker_ng_template_7_Conditional_2_Case_8_For_5_For_1_Template(r
|
|
|
3231
3303
|
i0.ɵɵtextInterpolate(cell_r13.day);
|
|
3232
3304
|
} }
|
|
3233
3305
|
function KptDatepicker_ng_template_7_Conditional_2_Case_8_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
3234
|
-
i0.ɵɵrepeaterCreate(0, KptDatepicker_ng_template_7_Conditional_2_Case_8_For_5_For_1_Template, 2, 9, "button", 28, _forTrack0$
|
|
3306
|
+
i0.ɵɵrepeaterCreate(0, KptDatepicker_ng_template_7_Conditional_2_Case_8_For_5_For_1_Template, 2, 9, "button", 28, _forTrack0$9);
|
|
3235
3307
|
} if (rf & 2) {
|
|
3236
3308
|
const week_r14 = ctx.$implicit;
|
|
3237
3309
|
i0.ɵɵrepeater(week_r14);
|
|
@@ -3536,42 +3608,29 @@ class KptDatepicker {
|
|
|
3536
3608
|
return this.formatTime(t?.h ?? 0, t?.m ?? 0);
|
|
3537
3609
|
}, /* @ts-ignore */
|
|
3538
3610
|
...(ngDevMode ? [{ debugName: "timeBarLabel" }] : /* istanbul ignore next */ []));
|
|
3611
|
+
/**
|
|
3612
|
+
* Tekst w triggerze. Każdy tryb ma własny format wartości, więc `display` tylko rozdziela
|
|
3613
|
+
* robotę — formatowanie siedzi w metodach `display*` niżej. Wartość niepasująca do formatu
|
|
3614
|
+
* trybu daje pusty string (trigger nie pokazuje śmieci, np. po ręcznej podmianie modelu).
|
|
3615
|
+
*/
|
|
3539
3616
|
this.display = computed(() => {
|
|
3540
3617
|
const v = this.value();
|
|
3541
3618
|
if (!v)
|
|
3542
3619
|
return '';
|
|
3543
3620
|
const iso = this.displayFormat() === 'iso';
|
|
3544
3621
|
switch (this.selectionMode()) {
|
|
3545
|
-
case 'monthYear':
|
|
3546
|
-
|
|
3547
|
-
return m ? (iso ? v : `${m[2]}.${m[1]}`) : '';
|
|
3548
|
-
}
|
|
3622
|
+
case 'monthYear':
|
|
3623
|
+
return this.displayMonthYear(v, iso);
|
|
3549
3624
|
case 'year':
|
|
3550
3625
|
return /^\d{4}$/.test(v) ? v : '';
|
|
3551
|
-
case 'month':
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
return t ? this.formatTime(t.h, t.m) : '';
|
|
3560
|
-
}
|
|
3561
|
-
case 'datetime': {
|
|
3562
|
-
const dt = this.parseDateTime(v);
|
|
3563
|
-
if (!dt)
|
|
3564
|
-
return '';
|
|
3565
|
-
const datePart = iso ? dt.date : `${dt.date.slice(8, 10)}.${dt.date.slice(5, 7)}.${dt.date.slice(0, 4)}`;
|
|
3566
|
-
const sep = iso ? 'T' : ' ';
|
|
3567
|
-
return `${datePart}${sep}${this.formatTime(dt.h, dt.m)}`;
|
|
3568
|
-
}
|
|
3569
|
-
default: {
|
|
3570
|
-
const d = this.parseDate(v);
|
|
3571
|
-
if (!d)
|
|
3572
|
-
return '';
|
|
3573
|
-
return iso ? toIso$1(d) : `${pad$1(d.getDate())}.${pad$1(d.getMonth() + 1)}.${d.getFullYear()}`;
|
|
3574
|
-
}
|
|
3626
|
+
case 'month':
|
|
3627
|
+
return this.displayMonth(v);
|
|
3628
|
+
case 'time':
|
|
3629
|
+
return this.displayTime(v);
|
|
3630
|
+
case 'datetime':
|
|
3631
|
+
return this.displayDateTime(v, iso);
|
|
3632
|
+
default:
|
|
3633
|
+
return this.displayDate(v, iso);
|
|
3575
3634
|
}
|
|
3576
3635
|
}, /* @ts-ignore */
|
|
3577
3636
|
...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
|
|
@@ -3720,6 +3779,36 @@ class KptDatepicker {
|
|
|
3720
3779
|
}
|
|
3721
3780
|
return `${pad$1(h)}:${pad$1(m)}`;
|
|
3722
3781
|
}
|
|
3782
|
+
displayMonthYear(v, iso) {
|
|
3783
|
+
const m = /^(\d{4})-(\d{2})$/.exec(v);
|
|
3784
|
+
if (!m)
|
|
3785
|
+
return '';
|
|
3786
|
+
return iso ? v : `${m[2]}.${m[1]}`;
|
|
3787
|
+
}
|
|
3788
|
+
displayMonth(v) {
|
|
3789
|
+
const m = /^(\d{2})$/.exec(v);
|
|
3790
|
+
if (!m)
|
|
3791
|
+
return '';
|
|
3792
|
+
return this.monthDisplay() === 'number' ? m[1] : (this.months()[+m[1] - 1] ?? '');
|
|
3793
|
+
}
|
|
3794
|
+
displayTime(v) {
|
|
3795
|
+
const t = this.parseTime(v);
|
|
3796
|
+
return t ? this.formatTime(t.h, t.m) : '';
|
|
3797
|
+
}
|
|
3798
|
+
displayDateTime(v, iso) {
|
|
3799
|
+
const dt = this.parseDateTime(v);
|
|
3800
|
+
if (!dt)
|
|
3801
|
+
return '';
|
|
3802
|
+
const datePart = iso ? dt.date : `${dt.date.slice(8, 10)}.${dt.date.slice(5, 7)}.${dt.date.slice(0, 4)}`;
|
|
3803
|
+
const sep = iso ? 'T' : ' ';
|
|
3804
|
+
return `${datePart}${sep}${this.formatTime(dt.h, dt.m)}`;
|
|
3805
|
+
}
|
|
3806
|
+
displayDate(v, iso) {
|
|
3807
|
+
const d = this.parseDate(v);
|
|
3808
|
+
if (!d)
|
|
3809
|
+
return '';
|
|
3810
|
+
return iso ? toIso$1(d) : `${pad$1(d.getDate())}.${pad$1(d.getMonth() + 1)}.${d.getFullYear()}`;
|
|
3811
|
+
}
|
|
3723
3812
|
// ── Parsowanie ──
|
|
3724
3813
|
parseDate(iso) {
|
|
3725
3814
|
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso ?? '');
|
|
@@ -3920,7 +4009,7 @@ class KptDatepicker {
|
|
|
3920
4009
|
}], () => [], { 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 }] }], startView: [{ type: i0.Input, args: [{ isSignal: true, alias: "startView", 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"] }] }); })();
|
|
3921
4010
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDatepicker, { className: "KptDatepicker", filePath: "lib/datepicker/datepicker.component.ts", lineNumber: 81 }); })();
|
|
3922
4011
|
|
|
3923
|
-
const _c0$
|
|
4012
|
+
const _c0$v = ["ta"];
|
|
3924
4013
|
/**
|
|
3925
4014
|
* Pole wieloliniowe (textarea) na Signal Forms, z opcjonalnym auto-resize.
|
|
3926
4015
|
*
|
|
@@ -3965,7 +4054,7 @@ class KptTextarea {
|
|
|
3965
4054
|
}
|
|
3966
4055
|
static { this.ɵfac = function KptTextarea_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptTextarea)(); }; }
|
|
3967
4056
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptTextarea, selectors: [["kpt-textarea"]], viewQuery: function KptTextarea_Query(rf, ctx) { if (rf & 1) {
|
|
3968
|
-
i0.ɵɵviewQuerySignal(ctx.ta, _c0$
|
|
4057
|
+
i0.ɵɵviewQuerySignal(ctx.ta, _c0$v, 5);
|
|
3969
4058
|
} if (rf & 2) {
|
|
3970
4059
|
i0.ɵɵqueryAdvance();
|
|
3971
4060
|
} }, hostAttrs: [1, "kpt-textarea-host"], inputs: { value: [1, "value"], placeholder: [1, "placeholder"], rows: [1, "rows"], autoResize: [1, "autoResize"], disabled: [1, "disabled"], readonly: [1, "readonly"], invalid: [1, "invalid"], touched: [1, "touched"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 2, vars: 6, consts: [["ta", ""], [1, "kpt-textarea__field", 3, "input", "blur", "value", "placeholder", "disabled", "readOnly", "rows"]], template: function KptTextarea_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -4117,8 +4206,8 @@ class KptTooltip {
|
|
|
4117
4206
|
}]
|
|
4118
4207
|
}], null, { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptTooltip", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptTooltipPosition", required: false }] }], onlyWhenTruncated: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptTooltipOnlyWhenTruncated", required: false }] }] }); })();
|
|
4119
4208
|
|
|
4120
|
-
const _c0$
|
|
4121
|
-
const _forTrack0$
|
|
4209
|
+
const _c0$u = ["editor"];
|
|
4210
|
+
const _forTrack0$8 = ($index, $item) => $item.tag;
|
|
4122
4211
|
function KptRichText_For_3_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
4123
4212
|
i0.ɵɵelement(0, "span", 11);
|
|
4124
4213
|
} }
|
|
@@ -4139,7 +4228,7 @@ function KptRichText_For_3_For_2_Case_0_ng_template_5_For_2_Template(rf, ctx) {
|
|
|
4139
4228
|
} }
|
|
4140
4229
|
function KptRichText_For_3_For_2_Case_0_ng_template_5_Template(rf, ctx) { if (rf & 1) {
|
|
4141
4230
|
i0.ɵɵelementStart(0, "ul", 16);
|
|
4142
|
-
i0.ɵɵrepeaterCreate(1, KptRichText_For_3_For_2_Case_0_ng_template_5_For_2_Template, 2, 6, "li", 17, _forTrack0$
|
|
4231
|
+
i0.ɵɵrepeaterCreate(1, KptRichText_For_3_For_2_Case_0_ng_template_5_For_2_Template, 2, 6, "li", 17, _forTrack0$8);
|
|
4143
4232
|
i0.ɵɵelementEnd();
|
|
4144
4233
|
} if (rf & 2) {
|
|
4145
4234
|
const ctx_r1 = i0.ɵɵnextContext(4);
|
|
@@ -4289,8 +4378,8 @@ function KptRichText_For_3_For_2_Case_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
4289
4378
|
const item_r6 = i0.ɵɵnextContext().$implicit;
|
|
4290
4379
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
4291
4380
|
i0.ɵɵclassProp("is-active", ctx_r1.isActive(item_r6));
|
|
4292
|
-
i0.ɵɵproperty("kptTooltip", ctx_r1.aria(item_r6))("disabled", ctx_r1.disabled());
|
|
4293
|
-
i0.ɵɵattribute("aria-label", ctx_r1.aria(item_r6))("aria-pressed", ctx_r1.
|
|
4381
|
+
i0.ɵɵproperty("kptTooltip", ctx_r1.aria(item_r6))("disabled", ctx_r1.disabled() || !ctx_r1.enabled(item_r6));
|
|
4382
|
+
i0.ɵɵattribute("aria-label", ctx_r1.aria(item_r6))("aria-pressed", ctx_r1.pressed(item_r6));
|
|
4294
4383
|
i0.ɵɵadvance();
|
|
4295
4384
|
i0.ɵɵproperty("name", ctx_r1.icon(item_r6));
|
|
4296
4385
|
} }
|
|
@@ -4324,7 +4413,7 @@ function KptRichText_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
4324
4413
|
function KptRichText_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
4325
4414
|
const _r22 = i0.ɵɵgetCurrentView();
|
|
4326
4415
|
i0.ɵɵelementStart(0, "div", 31, 5);
|
|
4327
|
-
i0.ɵɵlistener("input", function KptRichText_Conditional_5_Template_div_input_0_listener() { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onInput()); })("paste", function KptRichText_Conditional_5_Template_div_paste_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onPaste($event)); })("contextmenu", function KptRichText_Conditional_5_Template_div_contextmenu_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onContextMenu($event)); })("mousedown", function KptRichText_Conditional_5_Template_div_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEditorMouseDown($event)); })("mousemove", function KptRichText_Conditional_5_Template_div_mousemove_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEditorMouseMove($event)); })("blur", function KptRichText_Conditional_5_Template_div_blur_0_listener() { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.touch.emit()); });
|
|
4416
|
+
i0.ɵɵlistener("input", function KptRichText_Conditional_5_Template_div_input_0_listener() { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onInput()); })("keydown", function KptRichText_Conditional_5_Template_div_keydown_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onKeydown($event)); })("paste", function KptRichText_Conditional_5_Template_div_paste_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onPaste($event)); })("contextmenu", function KptRichText_Conditional_5_Template_div_contextmenu_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onContextMenu($event)); })("mousedown", function KptRichText_Conditional_5_Template_div_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEditorMouseDown($event)); })("mousemove", function KptRichText_Conditional_5_Template_div_mousemove_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEditorMouseMove($event)); })("blur", function KptRichText_Conditional_5_Template_div_blur_0_listener() { i0.ɵɵrestoreView(_r22); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.touch.emit()); });
|
|
4328
4417
|
i0.ɵɵelementEnd();
|
|
4329
4418
|
} if (rf & 2) {
|
|
4330
4419
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -4591,6 +4680,8 @@ const ICON = {
|
|
|
4591
4680
|
strike: 'strikethrough',
|
|
4592
4681
|
ul: 'list',
|
|
4593
4682
|
ol: 'list-numbers',
|
|
4683
|
+
indent: 'indent-increase',
|
|
4684
|
+
outdent: 'indent-decrease',
|
|
4594
4685
|
foreColor: 'palette',
|
|
4595
4686
|
backColor: 'highlight',
|
|
4596
4687
|
alignLeft: 'align-left',
|
|
@@ -4622,7 +4713,7 @@ const SWATCHES = [
|
|
|
4622
4713
|
];
|
|
4623
4714
|
const DEFAULT_TOOLBAR = [
|
|
4624
4715
|
['copy', 'paste', 'pasteText'],
|
|
4625
|
-
['heading', 'bold', 'italic', 'underline', 'strike', 'ul', 'ol'],
|
|
4716
|
+
['heading', 'bold', 'italic', 'underline', 'strike', 'ul', 'ol', 'indent', 'outdent'],
|
|
4626
4717
|
['foreColor', 'backColor'],
|
|
4627
4718
|
['alignLeft', 'alignCenter', 'alignRight', 'alignJustify'],
|
|
4628
4719
|
['link', 'table', 'clear', 'html'],
|
|
@@ -4660,6 +4751,8 @@ class KptRichText {
|
|
|
4660
4751
|
...(ngDevMode ? [{ debugName: "toolbar" }] : /* istanbul ignore next */ []));
|
|
4661
4752
|
this.placeholder = input('', /* @ts-ignore */
|
|
4662
4753
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
4754
|
+
/** Maksymalna głębokość zagnieżdżenia list (Tab / „Dodaj wcięcie"). */
|
|
4755
|
+
this.maxListLevel = input(6, { ...(ngDevMode ? { debugName: "maxListLevel" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
4663
4756
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4664
4757
|
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4665
4758
|
this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -4720,6 +4813,10 @@ class KptRichText {
|
|
|
4720
4813
|
...(ngDevMode ? [{ debugName: "styleLabel" }] : /* istanbul ignore next */ []));
|
|
4721
4814
|
this.activeCmds = signal(new Set(), /* @ts-ignore */
|
|
4722
4815
|
...(ngDevMode ? [{ debugName: "activeCmds" }] : /* istanbul ignore next */ []));
|
|
4816
|
+
this.canIndent = signal(false, /* @ts-ignore */
|
|
4817
|
+
...(ngDevMode ? [{ debugName: "canIndent" }] : /* istanbul ignore next */ []));
|
|
4818
|
+
this.canOutdent = signal(false, /* @ts-ignore */
|
|
4819
|
+
...(ngDevMode ? [{ debugName: "canOutdent" }] : /* istanbul ignore next */ []));
|
|
4723
4820
|
this.currentBlock = signal('p', /* @ts-ignore */
|
|
4724
4821
|
...(ngDevMode ? [{ debugName: "currentBlock" }] : /* istanbul ignore next */ []));
|
|
4725
4822
|
this.positions = [
|
|
@@ -4769,39 +4866,69 @@ class KptRichText {
|
|
|
4769
4866
|
const cmd = COMMAND[item];
|
|
4770
4867
|
return !!cmd && this.activeCmds().has(cmd);
|
|
4771
4868
|
}
|
|
4869
|
+
/** `aria-pressed` tylko dla przełączników — wcięcia są akcjami, nie stanem. */
|
|
4870
|
+
pressed(item) {
|
|
4871
|
+
return item === 'indent' || item === 'outdent' ? null : this.isActive(item);
|
|
4872
|
+
}
|
|
4873
|
+
/** Wcięcia są aktywne wyłącznie tam, gdzie faktycznie coś zrobią (kursor w liście). */
|
|
4874
|
+
enabled(item) {
|
|
4875
|
+
if (item === 'indent')
|
|
4876
|
+
return this.canIndent();
|
|
4877
|
+
if (item === 'outdent')
|
|
4878
|
+
return this.canOutdent();
|
|
4879
|
+
return true;
|
|
4880
|
+
}
|
|
4772
4881
|
inEditor() {
|
|
4773
4882
|
const el = this.editor()?.nativeElement;
|
|
4774
4883
|
const sel = window.getSelection();
|
|
4775
4884
|
return !!el && !!sel && sel.rangeCount > 0 && el.contains(sel.anchorNode);
|
|
4776
4885
|
}
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4886
|
+
/**
|
|
4887
|
+
* Jedyne wywołanie `document.execCommand` w komponencie. API jest formalnie deprecated, ale nie
|
|
4888
|
+
* ma zamiennika: to jedyny sposób formatowania, który trafia do natywnego stosu undo przeglądarki
|
|
4889
|
+
* (Ctrl+Z). Własna implementacja komend wymagałaby własnej historii — czyli przepisania edytora.
|
|
4890
|
+
*/
|
|
4891
|
+
legacyExec(cmd, value) {
|
|
4892
|
+
return document.execCommand(cmd, false, value); // NOSONAR: brak zamiennika, patrz JSDoc
|
|
4893
|
+
}
|
|
4894
|
+
/** Stan komendy dla podświetlenia narzędzi; nieobsługiwana komenda → `false`. */
|
|
4895
|
+
legacyState(cmd) {
|
|
4896
|
+
try {
|
|
4897
|
+
return document.queryCommandState(cmd); // NOSONAR: brak zamiennika, patrz `legacyExec`
|
|
4898
|
+
}
|
|
4899
|
+
catch {
|
|
4900
|
+
return false;
|
|
4901
|
+
}
|
|
4902
|
+
}
|
|
4903
|
+
/** Komendy aktywne dla bieżącego zaznaczenia (podświetlenie narzędzi). */
|
|
4904
|
+
activeCommands() {
|
|
4780
4905
|
const active = new Set();
|
|
4781
4906
|
for (const cmd of Object.values(COMMAND)) {
|
|
4782
|
-
if (cmd && cmd !== 'removeFormat')
|
|
4783
|
-
|
|
4784
|
-
if (document.queryCommandState(cmd))
|
|
4785
|
-
active.add(cmd);
|
|
4786
|
-
}
|
|
4787
|
-
catch {
|
|
4788
|
-
/* nieobsługiwana komenda */
|
|
4789
|
-
}
|
|
4790
|
-
}
|
|
4907
|
+
if (cmd && cmd !== 'removeFormat' && this.legacyState(cmd))
|
|
4908
|
+
active.add(cmd);
|
|
4791
4909
|
}
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4910
|
+
return active;
|
|
4911
|
+
}
|
|
4912
|
+
/** Tag bloku, w którym stoi kursor (dla selecta stylu); domyślnie paragraf. */
|
|
4913
|
+
blockTag() {
|
|
4914
|
+
let node = window.getSelection()?.anchorNode;
|
|
4796
4915
|
while (node && node !== this.editor()?.nativeElement) {
|
|
4797
4916
|
const tag = node.tagName?.toLowerCase();
|
|
4798
|
-
if (tag && /^(h[1-6]|p|blockquote)$/.test(tag))
|
|
4799
|
-
|
|
4800
|
-
return;
|
|
4801
|
-
}
|
|
4917
|
+
if (tag && /^(h[1-6]|p|blockquote)$/.test(tag))
|
|
4918
|
+
return tag;
|
|
4802
4919
|
node = node.parentElement;
|
|
4803
4920
|
}
|
|
4804
|
-
|
|
4921
|
+
return 'p';
|
|
4922
|
+
}
|
|
4923
|
+
refreshState() {
|
|
4924
|
+
if (this.disabled() || !this.inEditor())
|
|
4925
|
+
return;
|
|
4926
|
+
this.activeCmds.set(this.activeCommands());
|
|
4927
|
+
// Stan wcięć — te same warunki, których użyje sama operacja.
|
|
4928
|
+
const items = this.listItems();
|
|
4929
|
+
this.canIndent.set(items.some((li) => this.canIndentItem(li)));
|
|
4930
|
+
this.canOutdent.set(items.some((li) => this.canOutdentItem(li)));
|
|
4931
|
+
this.currentBlock.set(this.blockTag());
|
|
4805
4932
|
}
|
|
4806
4933
|
onInput() {
|
|
4807
4934
|
const el = this.editor()?.nativeElement;
|
|
@@ -4844,27 +4971,211 @@ class KptRichText {
|
|
|
4844
4971
|
if (url) {
|
|
4845
4972
|
const safe = this.sanitizeUrl(url);
|
|
4846
4973
|
if (safe)
|
|
4847
|
-
|
|
4974
|
+
this.legacyExec('createLink', safe);
|
|
4848
4975
|
}
|
|
4849
4976
|
break;
|
|
4850
4977
|
}
|
|
4851
4978
|
case 'copy':
|
|
4852
|
-
|
|
4853
|
-
|
|
4979
|
+
void this.copySelection();
|
|
4980
|
+
return;
|
|
4854
4981
|
case 'paste':
|
|
4855
4982
|
void this.pasteRich();
|
|
4856
4983
|
return;
|
|
4857
4984
|
case 'pasteText':
|
|
4858
4985
|
void this.pastePlain();
|
|
4859
4986
|
return;
|
|
4987
|
+
case 'indent':
|
|
4988
|
+
case 'outdent':
|
|
4989
|
+
this.shiftItems(item);
|
|
4990
|
+
return; // shiftItems sam odświeża wartość i stan
|
|
4860
4991
|
default: {
|
|
4861
4992
|
const cmd = COMMAND[item];
|
|
4862
4993
|
if (cmd)
|
|
4863
|
-
|
|
4994
|
+
this.legacyExec(cmd);
|
|
4995
|
+
}
|
|
4996
|
+
}
|
|
4997
|
+
this.onInput();
|
|
4998
|
+
this.refreshState();
|
|
4999
|
+
}
|
|
5000
|
+
// ── Listy: wcięcia (Tab / narzędzia „Dodaj/Usuń wcięcie") ──
|
|
5001
|
+
/** Najbliższy punkt listy zawierający węzeł (tylko wewnątrz edytora). */
|
|
5002
|
+
closestItem(node) {
|
|
5003
|
+
const editor = this.editor()?.nativeElement;
|
|
5004
|
+
const el = node instanceof Element ? node : (node?.parentElement ?? null);
|
|
5005
|
+
const li = el?.closest('li') ?? null;
|
|
5006
|
+
return li instanceof HTMLLIElement && editor?.contains(li) ? li : null;
|
|
5007
|
+
}
|
|
5008
|
+
/** Poziom punktu w obrębie edytora (1 = najwyższy). */
|
|
5009
|
+
level(li) {
|
|
5010
|
+
const editor = this.editor()?.nativeElement;
|
|
5011
|
+
let depth = 1;
|
|
5012
|
+
let parent = li.parentElement?.closest('li') ?? null;
|
|
5013
|
+
while (parent && editor?.contains(parent)) {
|
|
5014
|
+
depth++;
|
|
5015
|
+
parent = parent.parentElement?.closest('li') ?? null;
|
|
5016
|
+
}
|
|
5017
|
+
return depth;
|
|
5018
|
+
}
|
|
5019
|
+
/** Najgłębszy poziom w poddrzewie punktu — wcięcie przenosi podpunkty razem z rodzicem. */
|
|
5020
|
+
deepest(li) {
|
|
5021
|
+
const base = this.level(li);
|
|
5022
|
+
let max = base;
|
|
5023
|
+
for (const nested of li.querySelectorAll('li'))
|
|
5024
|
+
max = Math.max(max, this.level(nested));
|
|
5025
|
+
return max;
|
|
5026
|
+
}
|
|
5027
|
+
canIndentItem(li) {
|
|
5028
|
+
return li.previousElementSibling instanceof HTMLLIElement && this.deepest(li) < this.maxListLevel();
|
|
5029
|
+
}
|
|
5030
|
+
canOutdentItem(li) {
|
|
5031
|
+
return li.parentElement?.parentElement instanceof HTMLLIElement;
|
|
5032
|
+
}
|
|
5033
|
+
/**
|
|
5034
|
+
* Punkty listy objęte zaznaczeniem. Przy zaznaczeniu wielu punktów operujemy na ich wspólnym
|
|
5035
|
+
* poziomie zagnieżdżenia — inaczej podpunkt dostałby wcięcie dwa razy (raz sam, raz z rodzicem).
|
|
5036
|
+
*/
|
|
5037
|
+
listItems() {
|
|
5038
|
+
const editor = this.editor()?.nativeElement;
|
|
5039
|
+
const sel = window.getSelection();
|
|
5040
|
+
if (!editor || !sel || sel.rangeCount === 0)
|
|
5041
|
+
return [];
|
|
5042
|
+
const range = sel.getRangeAt(0);
|
|
5043
|
+
if (!editor.contains(range.commonAncestorContainer))
|
|
5044
|
+
return [];
|
|
5045
|
+
const start = this.closestItem(range.startContainer);
|
|
5046
|
+
const end = this.closestItem(range.endContainer);
|
|
5047
|
+
if (!start)
|
|
5048
|
+
return [];
|
|
5049
|
+
if (!end || start === end)
|
|
5050
|
+
return [start];
|
|
5051
|
+
// Podnieś głębszy koniec, aż oba będą rodzeństwem w tej samej liście.
|
|
5052
|
+
let a = start;
|
|
5053
|
+
let b = end;
|
|
5054
|
+
while (a && b && a.parentElement !== b.parentElement) {
|
|
5055
|
+
if (this.level(a) >= this.level(b))
|
|
5056
|
+
a = this.closestItem(a.parentElement);
|
|
5057
|
+
else
|
|
5058
|
+
b = this.closestItem(b.parentElement);
|
|
5059
|
+
}
|
|
5060
|
+
if (!a || !b || !a.parentElement)
|
|
5061
|
+
return [start];
|
|
5062
|
+
const siblings = [...a.parentElement.children].filter((el) => el instanceof HTMLLIElement);
|
|
5063
|
+
const from = siblings.indexOf(a);
|
|
5064
|
+
const to = siblings.indexOf(b);
|
|
5065
|
+
if (from < 0 || to < 0)
|
|
5066
|
+
return [start];
|
|
5067
|
+
return siblings.slice(Math.min(from, to), Math.max(from, to) + 1);
|
|
5068
|
+
}
|
|
5069
|
+
/** Zagnieżdża punkt w podliście poprzedniego punktu (poprawne `li > ul > li`). */
|
|
5070
|
+
indentItem(li) {
|
|
5071
|
+
if (!this.canIndentItem(li))
|
|
5072
|
+
return false;
|
|
5073
|
+
const prev = li.previousElementSibling;
|
|
5074
|
+
let sub = prev.lastElementChild;
|
|
5075
|
+
if (!(sub instanceof HTMLUListElement || sub instanceof HTMLOListElement)) {
|
|
5076
|
+
sub = document.createElement(li.parentElement?.tagName ?? 'UL'); // ta sama numeracja co poziom wyżej
|
|
5077
|
+
prev.append(sub);
|
|
5078
|
+
}
|
|
5079
|
+
sub.append(li);
|
|
5080
|
+
return true;
|
|
5081
|
+
}
|
|
5082
|
+
/** Wyciąga punkt poziom wyżej; rodzeństwo po nim trafia do jego podlisty (kolejność bez zmian). */
|
|
5083
|
+
outdentItem(li) {
|
|
5084
|
+
const list = li.parentElement;
|
|
5085
|
+
const host = list?.parentElement;
|
|
5086
|
+
if (!list || !(host instanceof HTMLLIElement))
|
|
5087
|
+
return false;
|
|
5088
|
+
const children = [...list.children];
|
|
5089
|
+
const after = children.slice(children.indexOf(li) + 1);
|
|
5090
|
+
if (after.length > 0) {
|
|
5091
|
+
let own = li.lastElementChild;
|
|
5092
|
+
if (!(own instanceof HTMLUListElement || own instanceof HTMLOListElement)) {
|
|
5093
|
+
own = document.createElement(list.tagName);
|
|
5094
|
+
li.append(own);
|
|
5095
|
+
}
|
|
5096
|
+
own.append(...after);
|
|
5097
|
+
}
|
|
5098
|
+
host.after(li);
|
|
5099
|
+
if (list.children.length === 0)
|
|
5100
|
+
list.remove();
|
|
5101
|
+
return true;
|
|
5102
|
+
}
|
|
5103
|
+
/** Zwraca `true`, gdy DOM faktycznie się zmienił — od tego zależy `preventDefault()` dla Taba. */
|
|
5104
|
+
shiftItems(dir) {
|
|
5105
|
+
if (this.disabled())
|
|
5106
|
+
return false;
|
|
5107
|
+
const items = this.listItems();
|
|
5108
|
+
if (items.length === 0)
|
|
5109
|
+
return false;
|
|
5110
|
+
// Migawka granic kursora: przy usunięciu węzła spec DOM przestawia *żywy* Range na starego
|
|
5111
|
+
// rodzica, więc `saveSelection()` wyprowadziłby kursor poza przenoszony punkt. Same węzły
|
|
5112
|
+
// jadą razem z `li`, więc odtwarzamy z nich zaznaczenie po mutacji.
|
|
5113
|
+
const sel = window.getSelection();
|
|
5114
|
+
const range = sel && sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
|
|
5115
|
+
const caret = range
|
|
5116
|
+
? { sc: range.startContainer, so: range.startOffset, ec: range.endContainer, eo: range.endOffset }
|
|
5117
|
+
: null;
|
|
5118
|
+
// Outdent od końca — inaczej `host.after()` odwróciłby kolejność przenoszonych punktów.
|
|
5119
|
+
const order = dir === 'outdent' ? [...items].reverse() : items;
|
|
5120
|
+
let changed = false;
|
|
5121
|
+
for (const li of order) {
|
|
5122
|
+
const done = dir === 'indent' ? this.indentItem(li) : this.outdentItem(li);
|
|
5123
|
+
changed = done || changed;
|
|
5124
|
+
}
|
|
5125
|
+
if (!changed)
|
|
5126
|
+
return false;
|
|
5127
|
+
if (caret && sel && caret.sc.isConnected && caret.ec.isConnected) {
|
|
5128
|
+
try {
|
|
5129
|
+
const restored = document.createRange();
|
|
5130
|
+
restored.setStart(caret.sc, caret.so);
|
|
5131
|
+
restored.setEnd(caret.ec, caret.eo);
|
|
5132
|
+
sel.removeAllRanges();
|
|
5133
|
+
sel.addRange(restored);
|
|
5134
|
+
}
|
|
5135
|
+
catch {
|
|
5136
|
+
/* offset przestał pasować po przeniesieniu rodzeństwa — zostaw kursor tam, gdzie jest */
|
|
4864
5137
|
}
|
|
4865
5138
|
}
|
|
4866
5139
|
this.onInput();
|
|
4867
5140
|
this.refreshState();
|
|
5141
|
+
return true;
|
|
5142
|
+
}
|
|
5143
|
+
/**
|
|
5144
|
+
* Tab: wcięcie w liście, przeskok komórki w tabeli (lista w komórce ma pierwszeństwo; gdy nie da
|
|
5145
|
+
* się już wciąć — przechodzimy do sąsiedniej komórki). Poza nimi i na krawędziach zostawiamy Tab
|
|
5146
|
+
* natywny — inaczej edytor byłby pułapką klawiaturową (WCAG 2.1.2).
|
|
5147
|
+
*/
|
|
5148
|
+
onKeydown(event) {
|
|
5149
|
+
if (this.disabled() || event.key !== 'Tab' || event.ctrlKey || event.altKey || event.metaKey)
|
|
5150
|
+
return;
|
|
5151
|
+
if (this.shiftItems(event.shiftKey ? 'outdent' : 'indent')) {
|
|
5152
|
+
event.preventDefault();
|
|
5153
|
+
return;
|
|
5154
|
+
}
|
|
5155
|
+
const node = window.getSelection()?.anchorNode ?? null;
|
|
5156
|
+
const el = node instanceof Element ? node : (node?.parentElement ?? null);
|
|
5157
|
+
const cell = el?.closest('td, th');
|
|
5158
|
+
if (cell && this.editor()?.nativeElement.contains(cell) && this.moveCell(cell, event.shiftKey)) {
|
|
5159
|
+
event.preventDefault();
|
|
5160
|
+
}
|
|
5161
|
+
}
|
|
5162
|
+
/** Przeskok do sąsiedniej komórki z zaznaczeniem jej treści; `false` = koniec tabeli. */
|
|
5163
|
+
moveCell(cell, back) {
|
|
5164
|
+
const table = cell.closest('table');
|
|
5165
|
+
if (!table)
|
|
5166
|
+
return false;
|
|
5167
|
+
const cells = [...table.querySelectorAll('td, th')];
|
|
5168
|
+
const next = cells[cells.indexOf(cell) + (back ? -1 : 1)];
|
|
5169
|
+
if (!next)
|
|
5170
|
+
return false;
|
|
5171
|
+
const range = document.createRange();
|
|
5172
|
+
range.selectNodeContents(next);
|
|
5173
|
+
const sel = window.getSelection();
|
|
5174
|
+
sel?.removeAllRanges();
|
|
5175
|
+
sel?.addRange(range);
|
|
5176
|
+
this.clearSelection();
|
|
5177
|
+
this.refreshState();
|
|
5178
|
+
return true;
|
|
4868
5179
|
}
|
|
4869
5180
|
// ── Styl bloku (dropdown w stylu kpt-select, z podglądem wielkości) ──
|
|
4870
5181
|
openStyle() {
|
|
@@ -4880,7 +5191,7 @@ class KptRichText {
|
|
|
4880
5191
|
this.styleOpen.set(false);
|
|
4881
5192
|
this.focusEditor();
|
|
4882
5193
|
this.restoreSelection();
|
|
4883
|
-
|
|
5194
|
+
this.legacyExec('formatBlock', `<${tag}>`);
|
|
4884
5195
|
this.onInput();
|
|
4885
5196
|
this.refreshState();
|
|
4886
5197
|
}
|
|
@@ -4906,10 +5217,10 @@ class KptRichText {
|
|
|
4906
5217
|
this.focusEditor();
|
|
4907
5218
|
this.restoreSelection();
|
|
4908
5219
|
if (this.colorKind() === 'foreColor') {
|
|
4909
|
-
|
|
5220
|
+
this.legacyExec('foreColor', color);
|
|
4910
5221
|
}
|
|
4911
|
-
else if (!
|
|
4912
|
-
|
|
5222
|
+
else if (!this.legacyExec('hiliteColor', color)) {
|
|
5223
|
+
this.legacyExec('backColor', color);
|
|
4913
5224
|
}
|
|
4914
5225
|
this.onInput();
|
|
4915
5226
|
}
|
|
@@ -4917,6 +5228,25 @@ class KptRichText {
|
|
|
4917
5228
|
this.applyColor(event.target.value);
|
|
4918
5229
|
}
|
|
4919
5230
|
// ── Schowek ──
|
|
5231
|
+
/** Kopiowanie przez async Clipboard API (jak wklejanie); fallback na starą komendę. */
|
|
5232
|
+
async copySelection() {
|
|
5233
|
+
const sel = window.getSelection();
|
|
5234
|
+
if (!sel || sel.rangeCount === 0 || sel.isCollapsed)
|
|
5235
|
+
return;
|
|
5236
|
+
const holder = document.createElement('div');
|
|
5237
|
+
holder.append(sel.getRangeAt(0).cloneContents());
|
|
5238
|
+
try {
|
|
5239
|
+
await navigator.clipboard.write([
|
|
5240
|
+
new ClipboardItem({
|
|
5241
|
+
'text/html': new Blob([holder.innerHTML], { type: 'text/html' }),
|
|
5242
|
+
'text/plain': new Blob([sel.toString()], { type: 'text/plain' }),
|
|
5243
|
+
}),
|
|
5244
|
+
]);
|
|
5245
|
+
}
|
|
5246
|
+
catch {
|
|
5247
|
+
this.legacyExec('copy'); // brak uprawnień / starsza przeglądarka
|
|
5248
|
+
}
|
|
5249
|
+
}
|
|
4920
5250
|
async pasteRich() {
|
|
4921
5251
|
try {
|
|
4922
5252
|
const items = await navigator.clipboard.read();
|
|
@@ -4925,14 +5255,14 @@ class KptRichText {
|
|
|
4925
5255
|
const blob = await it.getType('text/html');
|
|
4926
5256
|
const html = this.sanitizeHtml(await blob.text());
|
|
4927
5257
|
this.focusEditor();
|
|
4928
|
-
|
|
5258
|
+
this.legacyExec('insertHTML', html);
|
|
4929
5259
|
this.onInput();
|
|
4930
5260
|
return;
|
|
4931
5261
|
}
|
|
4932
5262
|
}
|
|
4933
5263
|
const text = await navigator.clipboard.readText();
|
|
4934
5264
|
this.focusEditor();
|
|
4935
|
-
|
|
5265
|
+
this.legacyExec('insertText', text);
|
|
4936
5266
|
this.onInput();
|
|
4937
5267
|
}
|
|
4938
5268
|
catch {
|
|
@@ -4943,7 +5273,7 @@ class KptRichText {
|
|
|
4943
5273
|
try {
|
|
4944
5274
|
const text = await navigator.clipboard.readText();
|
|
4945
5275
|
this.focusEditor();
|
|
4946
|
-
|
|
5276
|
+
this.legacyExec('insertText', text);
|
|
4947
5277
|
this.onInput();
|
|
4948
5278
|
}
|
|
4949
5279
|
catch {
|
|
@@ -4958,10 +5288,10 @@ class KptRichText {
|
|
|
4958
5288
|
const text = event.clipboardData?.getData('text/plain') ?? '';
|
|
4959
5289
|
event.preventDefault();
|
|
4960
5290
|
if (html) {
|
|
4961
|
-
|
|
5291
|
+
this.legacyExec('insertHTML', this.sanitizeHtml(html));
|
|
4962
5292
|
}
|
|
4963
5293
|
else {
|
|
4964
|
-
|
|
5294
|
+
this.legacyExec('insertText', text);
|
|
4965
5295
|
}
|
|
4966
5296
|
this.onInput();
|
|
4967
5297
|
}
|
|
@@ -4980,11 +5310,13 @@ class KptRichText {
|
|
|
4980
5310
|
this.focusEditor();
|
|
4981
5311
|
this.restoreSelection();
|
|
4982
5312
|
const w = (100 / cols).toFixed(4);
|
|
4983
|
-
const
|
|
4984
|
-
const
|
|
4985
|
-
const
|
|
5313
|
+
const col = `<col style="width:${w}%">`;
|
|
5314
|
+
const cell = '<td><br></td>';
|
|
5315
|
+
const row = `<tr>${cell.repeat(cols)}</tr>`;
|
|
5316
|
+
const colgroup = `<colgroup>${col.repeat(cols)}</colgroup>`;
|
|
5317
|
+
const body = `<tbody>${row.repeat(rows)}</tbody>`;
|
|
4986
5318
|
const table = `<table class="kpt-rt-table">${colgroup}${body}</table>`;
|
|
4987
|
-
|
|
5319
|
+
this.legacyExec('insertHTML', `${table}<p><br></p>`);
|
|
4988
5320
|
this.onInput();
|
|
4989
5321
|
}
|
|
4990
5322
|
// ── Tabele: menu kontekstowe ──
|
|
@@ -5222,7 +5554,7 @@ class KptRichText {
|
|
|
5222
5554
|
if (!(target instanceof Element))
|
|
5223
5555
|
return;
|
|
5224
5556
|
const focus = target.closest('td, th');
|
|
5225
|
-
if (
|
|
5557
|
+
if (focus?.closest('table') !== this.selAnchor.closest('table'))
|
|
5226
5558
|
return;
|
|
5227
5559
|
if (focus === this.selAnchor && !this.selecting)
|
|
5228
5560
|
return;
|
|
@@ -5265,6 +5597,42 @@ class KptRichText {
|
|
|
5265
5597
|
});
|
|
5266
5598
|
return { grid, pos };
|
|
5267
5599
|
}
|
|
5600
|
+
/** Jeden przebieg rozszerzania granic o komórki wystające poza region; `true` = coś się zmieniło. */
|
|
5601
|
+
growBounds(grid, pos, b) {
|
|
5602
|
+
let changed = false;
|
|
5603
|
+
for (const cell of this.cellsInRegion(grid, b)) {
|
|
5604
|
+
const p = pos.get(cell);
|
|
5605
|
+
if (p.r < b.r0) {
|
|
5606
|
+
b.r0 = p.r;
|
|
5607
|
+
changed = true;
|
|
5608
|
+
}
|
|
5609
|
+
if (p.c < b.c0) {
|
|
5610
|
+
b.c0 = p.c;
|
|
5611
|
+
changed = true;
|
|
5612
|
+
}
|
|
5613
|
+
if (p.r + p.rowspan - 1 > b.r1) {
|
|
5614
|
+
b.r1 = p.r + p.rowspan - 1;
|
|
5615
|
+
changed = true;
|
|
5616
|
+
}
|
|
5617
|
+
if (p.c + p.colspan - 1 > b.c1) {
|
|
5618
|
+
b.c1 = p.c + p.colspan - 1;
|
|
5619
|
+
changed = true;
|
|
5620
|
+
}
|
|
5621
|
+
}
|
|
5622
|
+
return changed;
|
|
5623
|
+
}
|
|
5624
|
+
/** Komórki leżące w prostokącie siatki (scalone trafiają raz — to `Set`). */
|
|
5625
|
+
cellsInRegion(grid, b) {
|
|
5626
|
+
const set = new Set();
|
|
5627
|
+
for (let r = b.r0; r <= b.r1; r++) {
|
|
5628
|
+
for (let c = b.c0; c <= b.c1; c++) {
|
|
5629
|
+
const cell = grid[r]?.[c];
|
|
5630
|
+
if (cell)
|
|
5631
|
+
set.add(cell);
|
|
5632
|
+
}
|
|
5633
|
+
}
|
|
5634
|
+
return set;
|
|
5635
|
+
}
|
|
5268
5636
|
selectRegion(anchor, focus) {
|
|
5269
5637
|
const table = anchor.closest('table');
|
|
5270
5638
|
if (!table)
|
|
@@ -5274,46 +5642,17 @@ class KptRichText {
|
|
|
5274
5642
|
const f = pos.get(focus);
|
|
5275
5643
|
if (!a || !f)
|
|
5276
5644
|
return;
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
const cell = grid[r]?.[c];
|
|
5287
|
-
if (!cell)
|
|
5288
|
-
continue;
|
|
5289
|
-
const p = pos.get(cell);
|
|
5290
|
-
if (p.r < r0) {
|
|
5291
|
-
r0 = p.r;
|
|
5292
|
-
changed = true;
|
|
5293
|
-
}
|
|
5294
|
-
if (p.c < c0) {
|
|
5295
|
-
c0 = p.c;
|
|
5296
|
-
changed = true;
|
|
5297
|
-
}
|
|
5298
|
-
if (p.r + p.rowspan - 1 > r1) {
|
|
5299
|
-
r1 = p.r + p.rowspan - 1;
|
|
5300
|
-
changed = true;
|
|
5301
|
-
}
|
|
5302
|
-
if (p.c + p.colspan - 1 > c1) {
|
|
5303
|
-
c1 = p.c + p.colspan - 1;
|
|
5304
|
-
changed = true;
|
|
5305
|
-
}
|
|
5306
|
-
}
|
|
5307
|
-
}
|
|
5308
|
-
}
|
|
5309
|
-
const set = new Set();
|
|
5310
|
-
for (let r = r0; r <= r1; r++) {
|
|
5311
|
-
for (let c = c0; c <= c1; c++) {
|
|
5312
|
-
const cell = grid[r]?.[c];
|
|
5313
|
-
if (cell)
|
|
5314
|
-
set.add(cell);
|
|
5315
|
-
}
|
|
5645
|
+
const bounds = {
|
|
5646
|
+
r0: Math.min(a.r, f.r),
|
|
5647
|
+
c0: Math.min(a.c, f.c),
|
|
5648
|
+
r1: Math.max(a.r + a.rowspan - 1, f.r + f.rowspan - 1),
|
|
5649
|
+
c1: Math.max(a.c + a.colspan - 1, f.c + f.colspan - 1),
|
|
5650
|
+
};
|
|
5651
|
+
// Rozszerzaj, aż region w pełni obejmie scalone komórki na brzegach.
|
|
5652
|
+
while (this.growBounds(grid, pos, bounds)) {
|
|
5653
|
+
/* granice rosną do skutku */
|
|
5316
5654
|
}
|
|
5655
|
+
const set = this.cellsInRegion(grid, bounds);
|
|
5317
5656
|
this.clearSelection();
|
|
5318
5657
|
for (const cell of set)
|
|
5319
5658
|
cell.classList.add('kpt-rt-cell-sel');
|
|
@@ -5379,8 +5718,7 @@ class KptRichText {
|
|
|
5379
5718
|
cell.removeAttribute('rowspan');
|
|
5380
5719
|
// Uzupełnij brakujące pozycje siatki pustymi komórkami (dla każdego pokrytego wiersza).
|
|
5381
5720
|
for (let dr = 0; dr < p.rowspan; dr++) {
|
|
5382
|
-
const
|
|
5383
|
-
const count = dr === 0 ? p.colspan - 1 : p.colspan;
|
|
5721
|
+
const count = dr === 0 ? p.colspan - 1 : p.colspan; // origin zostaje w pierwszym wierszu
|
|
5384
5722
|
if (count <= 0)
|
|
5385
5723
|
continue;
|
|
5386
5724
|
const row = table.rows[p.r + dr];
|
|
@@ -5388,7 +5726,10 @@ class KptRichText {
|
|
|
5388
5726
|
for (let i = 0; i < count; i++) {
|
|
5389
5727
|
const el = document.createElement(tag);
|
|
5390
5728
|
el.innerHTML = '<br>';
|
|
5391
|
-
|
|
5729
|
+
if (before)
|
|
5730
|
+
before.before(el);
|
|
5731
|
+
else
|
|
5732
|
+
row.append(el); // brak komórki o większym origin-col → na koniec wiersza
|
|
5392
5733
|
}
|
|
5393
5734
|
}
|
|
5394
5735
|
this.menuOpen.set(false);
|
|
@@ -5428,48 +5769,55 @@ class KptRichText {
|
|
|
5428
5769
|
sanitizeHtml(html) {
|
|
5429
5770
|
const tpl = document.createElement('template');
|
|
5430
5771
|
tpl.innerHTML = html;
|
|
5431
|
-
const
|
|
5432
|
-
|
|
5433
|
-
if (!ALLOWED_TAGS.has(el.tagName)) {
|
|
5434
|
-
el.replaceWith(...Array.from(el.childNodes));
|
|
5435
|
-
continue;
|
|
5436
|
-
}
|
|
5437
|
-
for (const attr of Array.from(el.attributes)) {
|
|
5438
|
-
const name = attr.name.toLowerCase();
|
|
5439
|
-
if (name.startsWith('on')) {
|
|
5440
|
-
el.removeAttribute(attr.name);
|
|
5441
|
-
}
|
|
5442
|
-
else if (name === 'href' || name === 'src') {
|
|
5443
|
-
// Usuń znaki kontrolne przed testem schematu — przeglądarka i tak je ignoruje przy
|
|
5444
|
-
// parsowaniu URL-a (WHATWG URL spec), więc `jav\tascript:` obchodziłby sam blocklisting.
|
|
5445
|
-
if (/^\s*javascript:/i.test(attr.value.replace(/[\x00-\x1f]/g, '')))
|
|
5446
|
-
el.removeAttribute(attr.name);
|
|
5447
|
-
}
|
|
5448
|
-
else if (name === 'style') {
|
|
5449
|
-
const kept = attr.value
|
|
5450
|
-
.split(';')
|
|
5451
|
-
.map((s) => s.trim())
|
|
5452
|
-
.filter((s) => ALLOWED_STYLES.has(s.split(':')[0]?.trim().toLowerCase()));
|
|
5453
|
-
if (kept.length)
|
|
5454
|
-
el.setAttribute('style', kept.join('; '));
|
|
5455
|
-
else
|
|
5456
|
-
el.removeAttribute('style');
|
|
5457
|
-
}
|
|
5458
|
-
else if (!ALLOWED_ATTRS.has(name) && name !== 'color') {
|
|
5459
|
-
el.removeAttribute(attr.name);
|
|
5460
|
-
}
|
|
5461
|
-
}
|
|
5462
|
-
}
|
|
5463
|
-
};
|
|
5464
|
-
walk(tpl.content);
|
|
5772
|
+
for (const el of Array.from(tpl.content.querySelectorAll('*')))
|
|
5773
|
+
this.sanitizeElement(el);
|
|
5465
5774
|
return tpl.innerHTML;
|
|
5466
5775
|
}
|
|
5776
|
+
/** Tag spoza allowlisty rozwijamy do dzieci; atrybuty czyścimy po kolei. */
|
|
5777
|
+
sanitizeElement(el) {
|
|
5778
|
+
if (!ALLOWED_TAGS.has(el.tagName)) {
|
|
5779
|
+
el.replaceWith(...Array.from(el.childNodes));
|
|
5780
|
+
return;
|
|
5781
|
+
}
|
|
5782
|
+
for (const attr of Array.from(el.attributes))
|
|
5783
|
+
this.sanitizeAttribute(el, attr);
|
|
5784
|
+
}
|
|
5785
|
+
sanitizeAttribute(el, attr) {
|
|
5786
|
+
const name = attr.name.toLowerCase();
|
|
5787
|
+
if (name.startsWith('on')) {
|
|
5788
|
+
el.removeAttribute(attr.name);
|
|
5789
|
+
}
|
|
5790
|
+
else if (name === 'href' || name === 'src') {
|
|
5791
|
+
// Usuń znaki kontrolne przed testem schematu — przeglądarka i tak je ignoruje przy
|
|
5792
|
+
// parsowaniu URL-a (WHATWG URL spec), więc `jav\tascript:` obchodziłby sam blocklisting.
|
|
5793
|
+
if (/^\s*javascript:/i.test(attr.value.replace(/[\x00-\x1f]/g, '')))
|
|
5794
|
+
el.removeAttribute(attr.name);
|
|
5795
|
+
}
|
|
5796
|
+
else if (name === 'style') {
|
|
5797
|
+
const kept = this.sanitizeStyleAttr(attr.value);
|
|
5798
|
+
if (kept)
|
|
5799
|
+
el.setAttribute('style', kept);
|
|
5800
|
+
else
|
|
5801
|
+
el.removeAttribute('style');
|
|
5802
|
+
}
|
|
5803
|
+
else if (!ALLOWED_ATTRS.has(name) && name !== 'color') {
|
|
5804
|
+
el.removeAttribute(attr.name);
|
|
5805
|
+
}
|
|
5806
|
+
}
|
|
5807
|
+
/** Deklaracje `style` z allowlisty; `null`, gdy nie zostaje nic. */
|
|
5808
|
+
sanitizeStyleAttr(value) {
|
|
5809
|
+
const kept = value
|
|
5810
|
+
.split(';')
|
|
5811
|
+
.map((decl) => decl.trim())
|
|
5812
|
+
.filter((decl) => ALLOWED_STYLES.has(decl.split(':')[0]?.trim().toLowerCase()));
|
|
5813
|
+
return kept.length ? kept.join('; ') : null;
|
|
5814
|
+
}
|
|
5467
5815
|
static { this.ɵfac = function KptRichText_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptRichText)(); }; }
|
|
5468
5816
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptRichText, selectors: [["kpt-rich-text"]], viewQuery: function KptRichText_Query(rf, ctx) { if (rf & 1) {
|
|
5469
|
-
i0.ɵɵviewQuerySignal(ctx.editor, _c0$
|
|
5817
|
+
i0.ɵɵviewQuerySignal(ctx.editor, _c0$u, 5);
|
|
5470
5818
|
} if (rf & 2) {
|
|
5471
5819
|
i0.ɵɵqueryAdvance();
|
|
5472
|
-
} }, hostAttrs: [1, "kpt-rich-text-host"], inputs: { value: [1, "value"], toolbar: [1, "toolbar"], placeholder: [1, "placeholder"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 11, vars: 14, consts: [["paletteTpl", ""], ["styleOrigin", "cdkOverlayOrigin"], ["foreOrigin", "cdkOverlayOrigin"], ["backOrigin", "cdkOverlayOrigin"], ["tableOrigin", "cdkOverlayOrigin"], ["editor", ""], [1, "kpt-rich-text"], ["role", "toolbar", 1, "kpt-rich-text__toolbar"], ["spellcheck", "false", 1, "kpt-rich-text__source", 3, "value", "disabled"], ["role", "textbox", "aria-multiline", "true", 1, "kpt-rich-text__editor"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayHasBackdrop"], ["aria-hidden", "true", 1, "kpt-rich-text__divider"], ["type", "button", 1, "kpt-rich-text__tool", 3, "is-active", "kptTooltip", "disabled"], ["type", "button", "cdkOverlayOrigin", "", 1, "kpt-rich-text__style", 3, "mousedown", "click", "disabled", "kptTooltip"], ["name", "chevron-down", 1, "kpt-rich-text__style-caret"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["role", "listbox", 1, "kpt-rich-text__style-panel"], ["role", "option", 1, "kpt-rich-text__style-opt", 3, "class", "is-selected"], ["role", "option", 1, "kpt-rich-text__style-opt", 3, "click"], ["type", "button", "cdkOverlayOrigin", "", 1, "kpt-rich-text__tool", "kpt-rich-text__tool--color", 3, "mousedown", "click", "kptTooltip", "disabled"], [3, "name"], [3, "ngTemplateOutlet"], ["type", "button", "cdkOverlayOrigin", "", 1, "kpt-rich-text__tool", 3, "mousedown", "click", "kptTooltip", "disabled"], [1, "kpt-rt-grid-pop", 3, "mousedown"], [1, "kpt-rt-grid", 3, "mouseleave"], [1, "kpt-rt-grid__row"], [1, "kpt-rt-grid__label"], [1, "kpt-rt-grid__cell", 3, "is-on"], [1, "kpt-rt-grid__cell", 3, "mouseenter", "click"], ["type", "button", 1, "kpt-rich-text__tool", 3, "mousedown", "click", "kptTooltip", "disabled"], ["spellcheck", "false", 1, "kpt-rich-text__source", 3, "input", "blur", "value", "disabled"], ["role", "textbox", "aria-multiline", "true", 1, "kpt-rich-text__editor", 3, "input", "paste", "contextmenu", "mousedown", "mousemove", "blur"], [1, "kpt-rt-menu", 3, "contextmenu"], [1, "kpt-rt-menu__group"], ["type", "button", 1, "kpt-rt-menu__item", 3, "click"], ["name", "plus"], ["name", "table"], ["name", "trash"], [1, "kpt-rt-menu__sep"], ["name", "palette"], ["name", "align-left"], ["name", "align-center"], ["name", "align-right"], ["name", "grip-vertical"], ["type", "button", 1, "kpt-rt-menu__item", "kpt-rt-menu__item--danger", 3, "click"], [1, "kpt-rt-border", 3, "mousedown"], [1, "kpt-rt-border__seg"], ["type", "button", 3, "click"], [1, "kpt-rt-border__widths"], [1, "kpt-rich-text__swatches"], ["type", "button", 1, "kpt-rich-text__swatch", 3, "background"], [1, "kpt-rich-text__picker"], ["type", "color", 3, "input"], ["type", "button", 1, "kpt-rich-text__swatch", 3, "click"], [1, "kpt-rich-text__palette", 3, "mousedown"]], template: function KptRichText_Template(rf, ctx) { if (rf & 1) {
|
|
5820
|
+
} }, hostAttrs: [1, "kpt-rich-text-host"], inputs: { value: [1, "value"], toolbar: [1, "toolbar"], placeholder: [1, "placeholder"], maxListLevel: [1, "maxListLevel"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 11, vars: 14, consts: [["paletteTpl", ""], ["styleOrigin", "cdkOverlayOrigin"], ["foreOrigin", "cdkOverlayOrigin"], ["backOrigin", "cdkOverlayOrigin"], ["tableOrigin", "cdkOverlayOrigin"], ["editor", ""], [1, "kpt-rich-text"], ["role", "toolbar", 1, "kpt-rich-text__toolbar"], ["spellcheck", "false", 1, "kpt-rich-text__source", 3, "value", "disabled"], ["role", "textbox", "aria-multiline", "true", 1, "kpt-rich-text__editor"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayHasBackdrop"], ["aria-hidden", "true", 1, "kpt-rich-text__divider"], ["type", "button", 1, "kpt-rich-text__tool", 3, "is-active", "kptTooltip", "disabled"], ["type", "button", "cdkOverlayOrigin", "", 1, "kpt-rich-text__style", 3, "mousedown", "click", "disabled", "kptTooltip"], ["name", "chevron-down", 1, "kpt-rich-text__style-caret"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["role", "listbox", 1, "kpt-rich-text__style-panel"], ["role", "option", 1, "kpt-rich-text__style-opt", 3, "class", "is-selected"], ["role", "option", 1, "kpt-rich-text__style-opt", 3, "click"], ["type", "button", "cdkOverlayOrigin", "", 1, "kpt-rich-text__tool", "kpt-rich-text__tool--color", 3, "mousedown", "click", "kptTooltip", "disabled"], [3, "name"], [3, "ngTemplateOutlet"], ["type", "button", "cdkOverlayOrigin", "", 1, "kpt-rich-text__tool", 3, "mousedown", "click", "kptTooltip", "disabled"], [1, "kpt-rt-grid-pop", 3, "mousedown"], [1, "kpt-rt-grid", 3, "mouseleave"], [1, "kpt-rt-grid__row"], [1, "kpt-rt-grid__label"], [1, "kpt-rt-grid__cell", 3, "is-on"], [1, "kpt-rt-grid__cell", 3, "mouseenter", "click"], ["type", "button", 1, "kpt-rich-text__tool", 3, "mousedown", "click", "kptTooltip", "disabled"], ["spellcheck", "false", 1, "kpt-rich-text__source", 3, "input", "blur", "value", "disabled"], ["role", "textbox", "aria-multiline", "true", 1, "kpt-rich-text__editor", 3, "input", "keydown", "paste", "contextmenu", "mousedown", "mousemove", "blur"], [1, "kpt-rt-menu", 3, "contextmenu"], [1, "kpt-rt-menu__group"], ["type", "button", 1, "kpt-rt-menu__item", 3, "click"], ["name", "plus"], ["name", "table"], ["name", "trash"], [1, "kpt-rt-menu__sep"], ["name", "palette"], ["name", "align-left"], ["name", "align-center"], ["name", "align-right"], ["name", "grip-vertical"], ["type", "button", 1, "kpt-rt-menu__item", "kpt-rt-menu__item--danger", 3, "click"], [1, "kpt-rt-border", 3, "mousedown"], [1, "kpt-rt-border__seg"], ["type", "button", 3, "click"], [1, "kpt-rt-border__widths"], [1, "kpt-rich-text__swatches"], ["type", "button", 1, "kpt-rich-text__swatch", 3, "background"], [1, "kpt-rich-text__picker"], ["type", "color", 3, "input"], ["type", "button", 1, "kpt-rich-text__swatch", 3, "click"], [1, "kpt-rich-text__palette", 3, "mousedown"]], template: function KptRichText_Template(rf, ctx) { if (rf & 1) {
|
|
5473
5821
|
i0.ɵɵelementStart(0, "div", 6)(1, "div", 7);
|
|
5474
5822
|
i0.ɵɵrepeaterCreate(2, KptRichText_For_3_Template, 3, 1, null, null, i0.ɵɵrepeaterTrackByIndex);
|
|
5475
5823
|
i0.ɵɵelementEnd();
|
|
@@ -5494,13 +5842,13 @@ class KptRichText {
|
|
|
5494
5842
|
i0.ɵɵproperty("cdkConnectedOverlayOrigin", ctx.menuPoint())("cdkConnectedOverlayOpen", ctx.borderOpen())("cdkConnectedOverlayHasBackdrop", true);
|
|
5495
5843
|
i0.ɵɵadvance();
|
|
5496
5844
|
i0.ɵɵproperty("cdkConnectedOverlayOrigin", ctx.menuPoint())("cdkConnectedOverlayOpen", ctx.colorOpen() && ctx.colorKind() === "cellBg")("cdkConnectedOverlayHasBackdrop", true);
|
|
5497
|
-
} }, dependencies: [KptIcon, CdkOverlayOrigin, CdkConnectedOverlay, NgTemplateOutlet, KptTooltip], styles: ["@layer kpt.components{.kpt-rich-text-host{display:block}.kpt-rich-text{border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-form-field-border);border-radius:var(--%NS%kpt-form-field-radius, .5rem);overflow:hidden;background:var(--%NS%kpt-form-field-bg)}.kpt-rich-text:focus-within{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-rich-text--invalid{border-color:var(--%NS%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(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);background:var(--%NS%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(--%NS%kpt-radius-sm, .25rem);background:none;color:var(--%NS%kpt-color-on-surface);cursor:pointer;font-size:1.05rem}.kpt-rich-text__tool:hover:not(:disabled){background:var(--%NS%kpt-color-muted)}.kpt-rich-text__tool:disabled{opacity:.5;cursor:not-allowed}.kpt-rich-text__tool.is-active{background:var(--%NS%kpt-color-muted);color:var(--%NS%kpt-color-primary)}.kpt-rich-text__divider{width:var(--%NS%kpt-border-width-thin, 1px);align-self:stretch;margin-inline:.2rem;background:var(--%NS%kpt-color-border)}.kpt-rich-text__style{display:inline-flex;align-items:center;gap:var(--%NS%kpt-space-1, .25rem);height:2rem;min-width:8rem;border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-form-field-border);border-radius:var(--%NS%kpt-radius-sm, .25rem);background:var(--%NS%kpt-form-field-bg);color:var(--%NS%kpt-form-field-text);font:inherit;font-size:var(--%NS%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(--%NS%kpt-form-field-border-hover)}.kpt-rich-text__style.is-open{border-color:var(--%NS%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(--%NS%kpt-space-3, .75rem);font-size:var(--%NS%kpt-font-size-sm, .875rem);line-height:var(--%NS%kpt-font-line-height-normal, 1.5);color:var(--%NS%kpt-form-field-text);outline:none;overflow-y:auto}.kpt-rich-text__editor:empty:before{content:attr(data-placeholder);color:var(--%NS%kpt-form-field-placeholder)}.kpt-rich-text__editor a{color:var(--%NS%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(--%NS%kpt-color-border-strong);color:var(--%NS%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(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%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(--%NS%kpt-color-surface-variant);font-weight:var(--%NS%kpt-font-weight-semibold, 600)}.kpt-rich-text__editor .kpt-rt-table .kpt-rt-cell-sel{box-shadow:inset 0 0 0 2px var(--%NS%kpt-color-primary);background:color-mix(in oklch,var(--%NS%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(--%NS%kpt-space-3, .75rem);border:0;background:var(--%NS%kpt-color-surface-variant);color:var(--%NS%kpt-form-field-text);font-family:var(--%NS%kpt-font-family-mono, ui-monospace, monospace);font-size:var(--%NS%kpt-font-size-xs, .75rem);line-height:var(--%NS%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(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%kpt-elevation-3);max-height:20rem;overflow-y:auto}.kpt-rich-text__style-opt{padding:.35rem .6rem;border-radius:var(--%NS%kpt-radius-sm, .25rem);color:var(--%NS%kpt-color-on-surface);cursor:pointer;line-height:1.2}.kpt-rich-text__style-opt:hover{background:var(--%NS%kpt-color-muted)}.kpt-rich-text__style-opt.is-selected{background:var(--%NS%kpt-color-muted);color:var(--%NS%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(--%NS%kpt-space-3, .75rem);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%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(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%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(--%NS%kpt-space-2, .5rem);margin-top:var(--%NS%kpt-space-2, .5rem);font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-rich-text__picker input[type=color]{width:2rem;height:1.6rem;padding:0;border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-sm, .25rem);background:none;cursor:pointer}.kpt-rt-grid-pop{padding:var(--%NS%kpt-space-2, .5rem);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%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(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:2px;cursor:pointer}.kpt-rt-grid__cell.is-on{background:var(--%NS%kpt-color-primary);border-color:var(--%NS%kpt-color-primary)}.kpt-rt-grid__label{margin-top:var(--%NS%kpt-space-2, .5rem);text-align:center;font-size:var(--%NS%kpt-font-size-xs, .75rem);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-rt-menu{min-width:12rem;padding:.25rem;background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%kpt-elevation-3);font-size:var(--%NS%kpt-font-size-sm, .875rem)}.kpt-rt-menu__group{padding:.3rem .6rem .15rem;font-size:var(--%NS%kpt-font-size-xs, .75rem);font-weight:var(--%NS%kpt-font-weight-semibold, 600);text-transform:uppercase;letter-spacing:.03em;color:var(--%NS%kpt-color-on-surface-muted)}.kpt-rt-menu__item{display:flex;align-items:center;gap:var(--%NS%kpt-space-2, .5rem);width:100%;padding:.4rem .6rem;border:0;border-radius:var(--%NS%kpt-radius-sm, .25rem);background:none;color:var(--%NS%kpt-color-on-surface);font:inherit;text-align:start;cursor:pointer}.kpt-rt-menu__item:hover{background:var(--%NS%kpt-color-muted)}.kpt-rt-menu__item kpt-icon{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-rt-menu__item--danger{color:var(--%NS%kpt-color-danger)}.kpt-rt-menu__item--danger kpt-icon{color:var(--%NS%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(--%NS%kpt-color-border)}.kpt-rt-border{display:flex;flex-direction:column;gap:var(--%NS%kpt-space-2, .5rem);padding:var(--%NS%kpt-space-3, .75rem);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%kpt-elevation-3)}.kpt-rt-border__seg{display:flex;gap:2px;padding:2px;background:var(--%NS%kpt-color-surface-variant);border-radius:var(--%NS%kpt-radius-md, .5rem)}.kpt-rt-border__seg button{flex:1;border:0;background:none;padding:.25rem .5rem;border-radius:var(--%NS%kpt-radius-sm, .25rem);color:var(--%NS%kpt-color-on-surface-muted);font:inherit;font-size:var(--%NS%kpt-font-size-sm, .875rem);cursor:pointer}.kpt-rt-border__seg button.is-active{background:var(--%NS%kpt-color-surface-raised);color:var(--%NS%kpt-color-on-surface);font-weight:var(--%NS%kpt-font-weight-medium, 500);box-shadow:var(--%NS%kpt-elevation-1)}.kpt-rt-border__widths{display:flex;gap:.25rem}.kpt-rt-border__widths button{flex:1;border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);background:none;padding:.25rem .3rem;border-radius:var(--%NS%kpt-radius-sm, .25rem);color:var(--%NS%kpt-color-on-surface);font:inherit;font-size:var(--%NS%kpt-font-size-xs, .75rem);cursor:pointer}.kpt-rt-border__widths button:hover{background:var(--%NS%kpt-color-muted)}}\n"], encapsulation: 2 }); }
|
|
5845
|
+
} }, dependencies: [KptIcon, CdkOverlayOrigin, CdkConnectedOverlay, NgTemplateOutlet, KptTooltip], styles: ["@layer kpt.components{.kpt-rich-text-host{display:block}.kpt-rich-text{border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-form-field-border);border-radius:var(--%NS%kpt-form-field-radius, .5rem);overflow:hidden;background:var(--%NS%kpt-form-field-bg)}.kpt-rich-text:focus-within{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-rich-text--invalid{border-color:var(--%NS%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(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);background:var(--%NS%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(--%NS%kpt-radius-sm, .25rem);background:none;color:var(--%NS%kpt-color-on-surface);cursor:pointer;font-size:1.05rem}.kpt-rich-text__tool:hover:not(:disabled){background:var(--%NS%kpt-color-muted)}.kpt-rich-text__tool:disabled{opacity:.5;cursor:not-allowed}.kpt-rich-text__tool.is-active{background:var(--%NS%kpt-color-muted);color:var(--%NS%kpt-color-primary)}.kpt-rich-text__divider{width:var(--%NS%kpt-border-width-thin, 1px);align-self:stretch;margin-inline:.2rem;background:var(--%NS%kpt-color-border)}.kpt-rich-text__style{display:inline-flex;align-items:center;gap:var(--%NS%kpt-space-1, .25rem);height:2rem;min-width:8rem;border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-form-field-border);border-radius:var(--%NS%kpt-radius-sm, .25rem);background:var(--%NS%kpt-form-field-bg);color:var(--%NS%kpt-form-field-text);font:inherit;font-size:var(--%NS%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(--%NS%kpt-form-field-border-hover)}.kpt-rich-text__style.is-open{border-color:var(--%NS%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(--%NS%kpt-space-3, .75rem);font-size:var(--%NS%kpt-font-size-sm, .875rem);line-height:var(--%NS%kpt-font-line-height-normal, 1.5);color:var(--%NS%kpt-form-field-text);outline:none;overflow-y:auto}.kpt-rich-text__editor:empty:before{content:attr(data-placeholder);color:var(--%NS%kpt-form-field-placeholder)}.kpt-rich-text__editor a{color:var(--%NS%kpt-color-primary)}.kpt-rich-text__editor ul,.kpt-rich-text__editor ol{padding-inline-start:1.5rem}.kpt-rich-text__editor ul{list-style-type:disc}.kpt-rich-text__editor ul ul{list-style-type:circle}.kpt-rich-text__editor ul ul ul{list-style-type:square}.kpt-rich-text__editor ul ul ul ul{list-style-type:disc}.kpt-rich-text__editor ul ul ul ul ul{list-style-type:circle}.kpt-rich-text__editor ul ul ul ul ul ul{list-style-type:square}.kpt-rich-text__editor ol{list-style-type:decimal}.kpt-rich-text__editor ol ol{list-style-type:lower-alpha}.kpt-rich-text__editor ol ol ol{list-style-type:lower-roman}.kpt-rich-text__editor ol ol ol ol{list-style-type:decimal}.kpt-rich-text__editor ol ol ol ol ol{list-style-type:lower-alpha}.kpt-rich-text__editor ol ol ol ol ol ol{list-style-type:lower-roman}.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(--%NS%kpt-color-border-strong);color:var(--%NS%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(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%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(--%NS%kpt-color-surface-variant);font-weight:var(--%NS%kpt-font-weight-semibold, 600)}.kpt-rich-text__editor .kpt-rt-table .kpt-rt-cell-sel{box-shadow:inset 0 0 0 2px var(--%NS%kpt-color-primary);background:color-mix(in oklch,var(--%NS%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(--%NS%kpt-space-3, .75rem);border:0;background:var(--%NS%kpt-color-surface-variant);color:var(--%NS%kpt-form-field-text);font-family:var(--%NS%kpt-font-family-mono, ui-monospace, monospace);font-size:var(--%NS%kpt-font-size-xs, .75rem);line-height:var(--%NS%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(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%kpt-elevation-3);max-height:20rem;overflow-y:auto}.kpt-rich-text__style-opt{padding:.35rem .6rem;border-radius:var(--%NS%kpt-radius-sm, .25rem);color:var(--%NS%kpt-color-on-surface);cursor:pointer;line-height:1.2}.kpt-rich-text__style-opt:hover{background:var(--%NS%kpt-color-muted)}.kpt-rich-text__style-opt.is-selected{background:var(--%NS%kpt-color-muted);color:var(--%NS%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(--%NS%kpt-space-3, .75rem);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%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(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%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(--%NS%kpt-space-2, .5rem);margin-top:var(--%NS%kpt-space-2, .5rem);font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-rich-text__picker input[type=color]{width:2rem;height:1.6rem;padding:0;border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-sm, .25rem);background:none;cursor:pointer}.kpt-rt-grid-pop{padding:var(--%NS%kpt-space-2, .5rem);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%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(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:2px;cursor:pointer}.kpt-rt-grid__cell.is-on{background:var(--%NS%kpt-color-primary);border-color:var(--%NS%kpt-color-primary)}.kpt-rt-grid__label{margin-top:var(--%NS%kpt-space-2, .5rem);text-align:center;font-size:var(--%NS%kpt-font-size-xs, .75rem);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-rt-menu{min-width:12rem;padding:.25rem;background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%kpt-elevation-3);font-size:var(--%NS%kpt-font-size-sm, .875rem)}.kpt-rt-menu__group{padding:.3rem .6rem .15rem;font-size:var(--%NS%kpt-font-size-xs, .75rem);font-weight:var(--%NS%kpt-font-weight-semibold, 600);text-transform:uppercase;letter-spacing:.03em;color:var(--%NS%kpt-color-on-surface-muted)}.kpt-rt-menu__item{display:flex;align-items:center;gap:var(--%NS%kpt-space-2, .5rem);width:100%;padding:.4rem .6rem;border:0;border-radius:var(--%NS%kpt-radius-sm, .25rem);background:none;color:var(--%NS%kpt-color-on-surface);font:inherit;text-align:start;cursor:pointer}.kpt-rt-menu__item:hover{background:var(--%NS%kpt-color-muted)}.kpt-rt-menu__item kpt-icon{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-rt-menu__item--danger{color:var(--%NS%kpt-color-danger)}.kpt-rt-menu__item--danger kpt-icon{color:var(--%NS%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(--%NS%kpt-color-border)}.kpt-rt-border{display:flex;flex-direction:column;gap:var(--%NS%kpt-space-2, .5rem);padding:var(--%NS%kpt-space-3, .75rem);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);box-shadow:var(--%NS%kpt-elevation-3)}.kpt-rt-border__seg{display:flex;gap:2px;padding:2px;background:var(--%NS%kpt-color-surface-variant);border-radius:var(--%NS%kpt-radius-md, .5rem)}.kpt-rt-border__seg button{flex:1;border:0;background:none;padding:.25rem .5rem;border-radius:var(--%NS%kpt-radius-sm, .25rem);color:var(--%NS%kpt-color-on-surface-muted);font:inherit;font-size:var(--%NS%kpt-font-size-sm, .875rem);cursor:pointer}.kpt-rt-border__seg button.is-active{background:var(--%NS%kpt-color-surface-raised);color:var(--%NS%kpt-color-on-surface);font-weight:var(--%NS%kpt-font-weight-medium, 500);box-shadow:var(--%NS%kpt-elevation-1)}.kpt-rt-border__widths{display:flex;gap:.25rem}.kpt-rt-border__widths button{flex:1;border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);background:none;padding:.25rem .3rem;border-radius:var(--%NS%kpt-radius-sm, .25rem);color:var(--%NS%kpt-color-on-surface);font:inherit;font-size:var(--%NS%kpt-font-size-xs, .75rem);cursor:pointer}.kpt-rt-border__widths button:hover{background:var(--%NS%kpt-color-muted)}}\n"], encapsulation: 2 }); }
|
|
5498
5846
|
}
|
|
5499
5847
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptRichText, [{
|
|
5500
5848
|
type: Component,
|
|
5501
|
-
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"] }]
|
|
5502
|
-
}], () => [], { 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 }] }] }); })();
|
|
5503
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptRichText, { className: "KptRichText", filePath: "lib/rich-text/rich-text.component.ts", lineNumber:
|
|
5849
|
+
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]=\"pressed(item)\"\n [kptTooltip]=\"aria(item)\"\n [disabled]=\"disabled() || !enabled(item)\"\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 (keydown)=\"onKeydown($event)\"\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 ul{list-style-type:disc}.kpt-rich-text__editor ul ul{list-style-type:circle}.kpt-rich-text__editor ul ul ul{list-style-type:square}.kpt-rich-text__editor ul ul ul ul{list-style-type:disc}.kpt-rich-text__editor ul ul ul ul ul{list-style-type:circle}.kpt-rich-text__editor ul ul ul ul ul ul{list-style-type:square}.kpt-rich-text__editor ol{list-style-type:decimal}.kpt-rich-text__editor ol ol{list-style-type:lower-alpha}.kpt-rich-text__editor ol ol ol{list-style-type:lower-roman}.kpt-rich-text__editor ol ol ol ol{list-style-type:decimal}.kpt-rich-text__editor ol ol ol ol ol{list-style-type:lower-alpha}.kpt-rich-text__editor ol ol ol ol ol ol{list-style-type:lower-roman}.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"] }]
|
|
5850
|
+
}], () => [], { 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 }] }], maxListLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxListLevel", 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 }] }] }); })();
|
|
5851
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptRichText, { className: "KptRichText", filePath: "lib/rich-text/rich-text.component.ts", lineNumber: 135 }); })();
|
|
5504
5852
|
|
|
5505
5853
|
function KptSlider_Conditional_0_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
5506
5854
|
i0.ɵɵdomElementStart(0, "span", 5);
|
|
@@ -5770,7 +6118,7 @@ class KptRating {
|
|
|
5770
6118
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] }); })();
|
|
5771
6119
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptRating, { className: "KptRating", filePath: "lib/rating/rating.component.ts", lineNumber: 46 }); })();
|
|
5772
6120
|
|
|
5773
|
-
const _forTrack0$
|
|
6121
|
+
const _forTrack0$7 = ($index, $item) => $item.name;
|
|
5774
6122
|
function KptFileUpload_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
5775
6123
|
i0.ɵɵelementStart(0, "div", 5);
|
|
5776
6124
|
i0.ɵɵtext(1);
|
|
@@ -5806,7 +6154,7 @@ function KptFileUpload_Conditional_6_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
5806
6154
|
} }
|
|
5807
6155
|
function KptFileUpload_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
5808
6156
|
i0.ɵɵelementStart(0, "ul", 6);
|
|
5809
|
-
i0.ɵɵrepeaterCreate(1, KptFileUpload_Conditional_6_For_2_Template, 8, 3, "li", 7, _forTrack0$
|
|
6157
|
+
i0.ɵɵrepeaterCreate(1, KptFileUpload_Conditional_6_For_2_Template, 8, 3, "li", 7, _forTrack0$7);
|
|
5810
6158
|
i0.ɵɵelementEnd();
|
|
5811
6159
|
} if (rf & 2) {
|
|
5812
6160
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
@@ -6020,7 +6368,7 @@ class KptColorPicker {
|
|
|
6020
6368
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", 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"] }] }); })();
|
|
6021
6369
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptColorPicker, { className: "KptColorPicker", filePath: "lib/color-picker/color-picker.component.ts", lineNumber: 52 }); })();
|
|
6022
6370
|
|
|
6023
|
-
const _forTrack0$
|
|
6371
|
+
const _forTrack0$6 = ($index, $item) => $item.key;
|
|
6024
6372
|
const _forTrack1$1 = ($index, $item) => $item.iso;
|
|
6025
6373
|
function KptDateRange_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
6026
6374
|
i0.ɵɵelementStart(0, "span", 2);
|
|
@@ -6240,7 +6588,7 @@ function KptDateRange_ng_template_7_Conditional_2_Conditional_3_Template(rf, ctx
|
|
|
6240
6588
|
} }
|
|
6241
6589
|
function KptDateRange_ng_template_7_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
6242
6590
|
i0.ɵɵelementStart(0, "div", 17);
|
|
6243
|
-
i0.ɵɵrepeaterCreate(1, KptDateRange_ng_template_7_Conditional_2_For_2_Template, 14, 3, "div", 18, _forTrack0$
|
|
6591
|
+
i0.ɵɵrepeaterCreate(1, KptDateRange_ng_template_7_Conditional_2_For_2_Template, 14, 3, "div", 18, _forTrack0$6);
|
|
6244
6592
|
i0.ɵɵelementEnd();
|
|
6245
6593
|
i0.ɵɵconditionalCreate(3, KptDateRange_ng_template_7_Conditional_2_Conditional_3_Template, 10, 8);
|
|
6246
6594
|
} if (rf & 2) {
|
|
@@ -6703,7 +7051,7 @@ class KptInputNumber {
|
|
|
6703
7051
|
}], 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"] }] }); })();
|
|
6704
7052
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptInputNumber, { className: "KptInputNumber", filePath: "lib/input-number/input-number.component.ts", lineNumber: 53 }); })();
|
|
6705
7053
|
|
|
6706
|
-
const _c0$
|
|
7054
|
+
const _c0$t = () => [0, 1, 2, 3];
|
|
6707
7055
|
function KptPassword_Conditional_4_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
6708
7056
|
i0.ɵɵelement(0, "span", 8);
|
|
6709
7057
|
} if (rf & 2) {
|
|
@@ -6722,10 +7070,11 @@ function KptPassword_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
6722
7070
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
6723
7071
|
i0.ɵɵattribute("data-score", ctx_r1.strength().score);
|
|
6724
7072
|
i0.ɵɵadvance(2);
|
|
6725
|
-
i0.ɵɵrepeater(i0.ɵɵpureFunction0(2, _c0$
|
|
7073
|
+
i0.ɵɵrepeater(i0.ɵɵpureFunction0(2, _c0$t));
|
|
6726
7074
|
i0.ɵɵadvance(3);
|
|
6727
7075
|
i0.ɵɵtextInterpolate(ctx_r1.strength().label);
|
|
6728
7076
|
} }
|
|
7077
|
+
let nextUniqueId$1 = 0;
|
|
6729
7078
|
/**
|
|
6730
7079
|
* Pole hasła z przełącznikiem widoczności i opcjonalnym miernikiem siły. Signal Forms.
|
|
6731
7080
|
*
|
|
@@ -6738,6 +7087,15 @@ class KptPassword {
|
|
|
6738
7087
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
6739
7088
|
this.placeholder = input('', /* @ts-ignore */
|
|
6740
7089
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
7090
|
+
/** Id natywnego pola — pozwala związać etykietę przez `kpt-form-field [controlId]`. */
|
|
7091
|
+
this.id = input(`kpt-password-${++nextUniqueId$1}`, /* @ts-ignore */
|
|
7092
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
7093
|
+
/**
|
|
7094
|
+
* Podpowiedź autouzupełniania. Rejestracja i reset hasła wymagają `new-password` — inaczej
|
|
7095
|
+
* menedżer haseł podstawia stare hasło zamiast zaproponować nowe.
|
|
7096
|
+
*/
|
|
7097
|
+
this.autocomplete = input('current-password', /* @ts-ignore */
|
|
7098
|
+
...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
6741
7099
|
this.feedback = input(false, { ...(ngDevMode ? { debugName: "feedback" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
6742
7100
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
6743
7101
|
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -6766,7 +7124,7 @@ class KptPassword {
|
|
|
6766
7124
|
...(ngDevMode ? [{ debugName: "strength" }] : /* istanbul ignore next */ []));
|
|
6767
7125
|
}
|
|
6768
7126
|
static { this.ɵfac = function KptPassword_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptPassword)(); }; }
|
|
6769
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptPassword, selectors: [["kpt-password"]], hostAttrs: [1, "kpt-password-host"], inputs: { value: [1, "value"], placeholder: [1, "placeholder"], feedback: [1, "feedback"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 5, vars:
|
|
7127
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptPassword, selectors: [["kpt-password"]], hostAttrs: [1, "kpt-password-host"], inputs: { value: [1, "value"], placeholder: [1, "placeholder"], id: [1, "id"], autocomplete: [1, "autocomplete"], feedback: [1, "feedback"], disabled: [1, "disabled"], invalid: [1, "invalid"], touched: [1, "touched"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 5, vars: 14, consts: [[1, "kpt-password"], [1, "kpt-password__input", 3, "input", "blur", "id", "type", "value", "disabled", "placeholder"], ["type", "button", 1, "kpt-password__toggle", 3, "click", "disabled"], [3, "name"], [1, "kpt-password__meter"], [1, "kpt-password__bars"], [1, "kpt-password__bar", 3, "is-on"], [1, "kpt-password__hint"], [1, "kpt-password__bar"]], template: function KptPassword_Template(rf, ctx) { if (rf & 1) {
|
|
6770
7128
|
i0.ɵɵelementStart(0, "div", 0)(1, "input", 1);
|
|
6771
7129
|
i0.ɵɵlistener("input", function KptPassword_Template_input_input_1_listener($event) { return ctx.value.set($event.target.value); })("blur", function KptPassword_Template_input_blur_1_listener() { return ctx.touch.emit(); });
|
|
6772
7130
|
i0.ɵɵelementEnd();
|
|
@@ -6778,7 +7136,8 @@ class KptPassword {
|
|
|
6778
7136
|
} if (rf & 2) {
|
|
6779
7137
|
i0.ɵɵclassProp("kpt-password--disabled", ctx.disabled())("kpt-password--invalid", ctx.showInvalid());
|
|
6780
7138
|
i0.ɵɵadvance();
|
|
6781
|
-
i0.ɵɵproperty("type", ctx.visible() ? "text" : "password")("value", ctx.value())("disabled", ctx.disabled())("placeholder", ctx.placeholder());
|
|
7139
|
+
i0.ɵɵproperty("id", ctx.id())("type", ctx.visible() ? "text" : "password")("value", ctx.value())("disabled", ctx.disabled())("placeholder", ctx.placeholder());
|
|
7140
|
+
i0.ɵɵattribute("autocomplete", ctx.autocomplete());
|
|
6782
7141
|
i0.ɵɵadvance();
|
|
6783
7142
|
i0.ɵɵproperty("disabled", ctx.disabled());
|
|
6784
7143
|
i0.ɵɵattribute("aria-label", ctx.visible() ? ctx.i18n.t("password.hide") : ctx.i18n.t("password.show"));
|
|
@@ -6794,11 +7153,12 @@ class KptPassword {
|
|
|
6794
7153
|
<div class="kpt-password" [class.kpt-password--disabled]="disabled()" [class.kpt-password--invalid]="showInvalid()">
|
|
6795
7154
|
<input
|
|
6796
7155
|
class="kpt-password__input"
|
|
7156
|
+
[id]="id()"
|
|
6797
7157
|
[type]="visible() ? 'text' : 'password'"
|
|
6798
7158
|
[value]="value()"
|
|
6799
7159
|
[disabled]="disabled()"
|
|
6800
7160
|
[placeholder]="placeholder()"
|
|
6801
|
-
autocomplete="
|
|
7161
|
+
[attr.autocomplete]="autocomplete()"
|
|
6802
7162
|
(input)="value.set($any($event.target).value)"
|
|
6803
7163
|
(blur)="touch.emit()"
|
|
6804
7164
|
/>
|
|
@@ -6817,8 +7177,8 @@ class KptPassword {
|
|
|
6817
7177
|
</div>
|
|
6818
7178
|
}
|
|
6819
7179
|
`, host: { class: 'kpt-password-host' }, styles: ["@layer kpt.components{.kpt-password-host{display:block}.kpt-password{display:flex;align-items:center;width:100%;height:2.5rem;box-sizing:border-box;padding-inline:var(--kpt-space-3, .75rem);gap: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)}.kpt-password:focus-within:not(.kpt-password--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-password--invalid{border-color:var(--kpt-form-field-border-error)}.kpt-password--disabled{opacity:.6;background:var(--kpt-color-surface-variant)}.kpt-password__input{flex:1;min-width:0;border:0;background:none;color:var(--kpt-form-field-text);font-size:var(--kpt-font-size-sm, .875rem)}.kpt-password__input:focus{outline:none}.kpt-password__input::placeholder{color:var(--kpt-form-field-placeholder)}.kpt-password__toggle{display:inline-flex;border:0;background:none;padding:0;cursor:pointer;color:var(--kpt-color-on-surface-muted)}.kpt-password__toggle:hover:not(:disabled){color:var(--kpt-color-on-surface)}.kpt-password__meter{margin-top:var(--kpt-space-2, .5rem);display:flex;align-items:center;gap:var(--kpt-space-2, .5rem)}.kpt-password__bars{display:flex;gap:4px;flex:1}.kpt-password__bar{height:4px;flex:1;border-radius:2px;background:var(--kpt-color-border);transition:background .15s}.kpt-password__hint{font-size:var(--kpt-font-size-xs, .75rem);color:var(--kpt-color-on-surface-muted)}.kpt-password__meter[data-score=\"1\"] .kpt-password__bar.is-on{background:var(--kpt-color-danger)}.kpt-password__meter[data-score=\"2\"] .kpt-password__bar.is-on{background:var(--kpt-color-warning)}.kpt-password__meter[data-score=\"3\"] .kpt-password__bar.is-on{background:var(--kpt-color-info)}.kpt-password__meter[data-score=\"4\"] .kpt-password__bar.is-on{background:var(--kpt-color-success)}}\n"] }]
|
|
6820
|
-
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], feedback: [{ type: i0.Input, args: [{ isSignal: true, alias: "feedback", 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"] }] }); })();
|
|
6821
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptPassword, { className: "KptPassword", filePath: "lib/password/password.component.ts", lineNumber:
|
|
7180
|
+
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], feedback: [{ type: i0.Input, args: [{ isSignal: true, alias: "feedback", 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"] }] }); })();
|
|
7181
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptPassword, { className: "KptPassword", filePath: "lib/password/password.component.ts", lineNumber: 55 }); })();
|
|
6822
7182
|
|
|
6823
7183
|
function KptInputOtp_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
6824
7184
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
@@ -7117,7 +7477,7 @@ class KptInputMask {
|
|
|
7117
7477
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", 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"] }] }); })();
|
|
7118
7478
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptInputMask, { className: "KptInputMask", filePath: "lib/input-mask/input-mask.component.ts", lineNumber: 36 }); })();
|
|
7119
7479
|
|
|
7120
|
-
const _forTrack0$
|
|
7480
|
+
const _forTrack0$5 = ($index, $item) => $item.value;
|
|
7121
7481
|
function KptListbox_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
7122
7482
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
7123
7483
|
i0.ɵɵelementStart(0, "div", 1);
|
|
@@ -7214,7 +7574,7 @@ class KptListbox {
|
|
|
7214
7574
|
i0.ɵɵelementStart(0, "div", 0);
|
|
7215
7575
|
i0.ɵɵconditionalCreate(1, KptListbox_Conditional_1_Template, 3, 2, "div", 1);
|
|
7216
7576
|
i0.ɵɵelementStart(2, "div", 2);
|
|
7217
|
-
i0.ɵɵrepeaterCreate(3, KptListbox_For_4_Template, 4, 6, "button", 3, _forTrack0$
|
|
7577
|
+
i0.ɵɵrepeaterCreate(3, KptListbox_For_4_Template, 4, 6, "button", 3, _forTrack0$5, false, KptListbox_ForEmpty_5_Template, 2, 1, "div", 4);
|
|
7218
7578
|
i0.ɵɵelementEnd()();
|
|
7219
7579
|
} if (rf & 2) {
|
|
7220
7580
|
i0.ɵɵclassProp("kpt-listbox--invalid", ctx.showInvalid());
|
|
@@ -7433,8 +7793,8 @@ class KptKnob {
|
|
|
7433
7793
|
}], 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"] }] }); })();
|
|
7434
7794
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptKnob, { className: "KptKnob", filePath: "lib/knob/knob.component.ts", lineNumber: 45 }); })();
|
|
7435
7795
|
|
|
7436
|
-
const _c0$
|
|
7437
|
-
const _c1$
|
|
7796
|
+
const _c0$s = ["*", [["", "kptCardFooter", ""]]];
|
|
7797
|
+
const _c1$b = ["*", "[kptCardFooter]"];
|
|
7438
7798
|
function KptCard_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
7439
7799
|
i0.ɵɵdomElementStart(0, "div", 0);
|
|
7440
7800
|
i0.ɵɵtext(1);
|
|
@@ -7471,8 +7831,8 @@ class KptCard {
|
|
|
7471
7831
|
static { this.ɵfac = function KptCard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptCard)(); }; }
|
|
7472
7832
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptCard, selectors: [["kpt-card"]], hostAttrs: [1, "kpt-card"], hostVars: 1, hostBindings: function KptCard_HostBindings(rf, ctx) { if (rf & 2) {
|
|
7473
7833
|
i0.ɵɵattribute("data-variant", ctx.variant());
|
|
7474
|
-
} }, inputs: { variant: [1, "variant"], header: [1, "header"], flush: [1, "flush"] }, ngContentSelectors: _c1$
|
|
7475
|
-
i0.ɵɵprojectionDef(_c0$
|
|
7834
|
+
} }, inputs: { variant: [1, "variant"], header: [1, "header"], flush: [1, "flush"] }, ngContentSelectors: _c1$b, decls: 4, vars: 3, consts: [[1, "kpt-card__header"], [1, "kpt-card__body"]], template: function KptCard_Template(rf, ctx) { if (rf & 1) {
|
|
7835
|
+
i0.ɵɵprojectionDef(_c0$s);
|
|
7476
7836
|
i0.ɵɵconditionalCreate(0, KptCard_Conditional_0_Template, 2, 1, "div", 0);
|
|
7477
7837
|
i0.ɵɵdomElementStart(1, "div", 1);
|
|
7478
7838
|
i0.ɵɵprojection(2);
|
|
@@ -7527,7 +7887,7 @@ class KptDivider {
|
|
|
7527
7887
|
}], null, { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], inset: [{ type: i0.Input, args: [{ isSignal: true, alias: "inset", required: false }] }] }); })();
|
|
7528
7888
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDivider, { className: "KptDivider", filePath: "lib/divider/divider.component.ts", lineNumber: 27 }); })();
|
|
7529
7889
|
|
|
7530
|
-
const _c0$
|
|
7890
|
+
const _c0$r = ["*"];
|
|
7531
7891
|
/**
|
|
7532
7892
|
* Górny pasek (toolbar) — pozioma belka na treść aplikacji (logo, akcje).
|
|
7533
7893
|
* Elementowi z atrybutem `kptToolbarSpacer` nadaj elastyczny odstęp, aby rozepchnąć zawartość.
|
|
@@ -7555,7 +7915,7 @@ class KptToolbar {
|
|
|
7555
7915
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptToolbar, selectors: [["kpt-toolbar"]], hostAttrs: [1, "kpt-toolbar"], hostVars: 3, hostBindings: function KptToolbar_HostBindings(rf, ctx) { if (rf & 2) {
|
|
7556
7916
|
i0.ɵɵattribute("data-wrap", ctx.wrap() ? "" : null);
|
|
7557
7917
|
i0.ɵɵclassProp("kpt-toolbar--elevated", ctx.elevated());
|
|
7558
|
-
} }, inputs: { elevated: [1, "elevated"], wrap: [1, "wrap"] }, ngContentSelectors: _c0$
|
|
7918
|
+
} }, inputs: { elevated: [1, "elevated"], wrap: [1, "wrap"] }, ngContentSelectors: _c0$r, decls: 1, vars: 0, template: function KptToolbar_Template(rf, ctx) { if (rf & 1) {
|
|
7559
7919
|
i0.ɵɵprojectionDef();
|
|
7560
7920
|
i0.ɵɵprojection(0);
|
|
7561
7921
|
} }, styles: ["@layer kpt.components{.kpt-toolbar{--%NS%_kpt-toolbar-height: var(--%NS%kpt-toolbar-height, 3.5rem);--%NS%_kpt-toolbar-padding-inline: var(--%NS%kpt-space-4, 1rem);--%NS%_kpt-toolbar-gap: var(--%NS%kpt-space-3, .75rem);display:flex;align-items:center;gap:var(--%NS%_kpt-toolbar-gap);min-height:var(--%NS%_kpt-toolbar-height);padding-inline:var(--%NS%_kpt-toolbar-padding-inline);background:var(--%NS%kpt-toolbar-bg);color:var(--%NS%kpt-toolbar-fg);border-bottom:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-toolbar-border);min-inline-size:0}.kpt-toolbar--elevated{box-shadow:var(--%NS%kpt-elevation-1)}.kpt-toolbar [kptToolbarSpacer]{flex:1 1 auto;min-inline-size:0}.kpt-toolbar[data-wrap]{flex-wrap:wrap;row-gap:var(--%NS%kpt-space-2, .5rem);padding-block:var(--%NS%kpt-space-2, .5rem)}@media(max-width:639.98px){.kpt-toolbar{--%NS%_kpt-toolbar-height: var(--%NS%kpt-toolbar-height-compact, 3rem);--%NS%_kpt-toolbar-padding-inline: var(--%NS%kpt-space-3, .75rem);--%NS%_kpt-toolbar-gap: var(--%NS%kpt-space-2, .5rem)}}}\n"], encapsulation: 2 }); }
|
|
@@ -7570,8 +7930,8 @@ class KptToolbar {
|
|
|
7570
7930
|
}], null, { elevated: [{ type: i0.Input, args: [{ isSignal: true, alias: "elevated", required: false }] }], wrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrap", required: false }] }] }); })();
|
|
7571
7931
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptToolbar, { className: "KptToolbar", filePath: "lib/toolbar/toolbar.component.ts", lineNumber: 27 }); })();
|
|
7572
7932
|
|
|
7573
|
-
const _c0$
|
|
7574
|
-
const _c1$
|
|
7933
|
+
const _c0$q = ["*", [["", "kptSidenavFooter", ""]]];
|
|
7934
|
+
const _c1$a = ["*", "[kptSidenavFooter]"];
|
|
7575
7935
|
/**
|
|
7576
7936
|
* Panel boczny (sidenav) — stylowany kontener nawigacji, zwykle umieszczany w slocie
|
|
7577
7937
|
* `kptShellSidenav` komponentu `kpt-app-shell`.
|
|
@@ -7591,8 +7951,8 @@ const _c1$9 = ["*", "[kptSidenavFooter]"];
|
|
|
7591
7951
|
*/
|
|
7592
7952
|
class KptSidenav {
|
|
7593
7953
|
static { this.ɵfac = function KptSidenav_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptSidenav)(); }; }
|
|
7594
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSidenav, selectors: [["kpt-sidenav"]], hostAttrs: [1, "kpt-sidenav"], ngContentSelectors: _c1$
|
|
7595
|
-
i0.ɵɵprojectionDef(_c0$
|
|
7954
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSidenav, selectors: [["kpt-sidenav"]], hostAttrs: [1, "kpt-sidenav"], ngContentSelectors: _c1$a, decls: 3, vars: 0, consts: [[1, "kpt-sidenav__scroll"]], template: function KptSidenav_Template(rf, ctx) { if (rf & 1) {
|
|
7955
|
+
i0.ɵɵprojectionDef(_c0$q);
|
|
7596
7956
|
i0.ɵɵdomElementStart(0, "div", 0);
|
|
7597
7957
|
i0.ɵɵprojection(1);
|
|
7598
7958
|
i0.ɵɵdomElementEnd();
|
|
@@ -7605,8 +7965,8 @@ class KptSidenav {
|
|
|
7605
7965
|
}], null, null); })();
|
|
7606
7966
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSidenav, { className: "KptSidenav", filePath: "lib/sidenav/sidenav.component.ts", lineNumber: 30 }); })();
|
|
7607
7967
|
|
|
7608
|
-
const _c0$
|
|
7609
|
-
const _c1$
|
|
7968
|
+
const _c0$p = [[["", "kptShellToolbar", ""]], [["", "kptShellSidenav", ""]], "*"];
|
|
7969
|
+
const _c1$9 = ["[kptShellToolbar]", "[kptShellSidenav]", "*"];
|
|
7610
7970
|
/**
|
|
7611
7971
|
* Szkielet aplikacji: pasek u góry, panel boczny i treść. Sloty projekcji:
|
|
7612
7972
|
* `[kptShellToolbar]`, `[kptShellSidenav]` oraz treść domyślna.
|
|
@@ -7726,8 +8086,8 @@ class KptAppShell {
|
|
|
7726
8086
|
} if (rf & 2) {
|
|
7727
8087
|
i0.ɵɵattribute("data-sidenav-mode", ctx.sidenavMode())("data-sidenav-breakpoint", ctx.sidenavBreakpoint())("data-sidenav-rail", ctx.sidenavRailBreakpoint());
|
|
7728
8088
|
i0.ɵɵclassProp("kpt-app-shell--nav-open", ctx.sidenavOpen())("kpt-app-shell--nav-compact-open", ctx.sidenavCompactOpen());
|
|
7729
|
-
} }, inputs: { sidenavOpen: [1, "sidenavOpen"], sidenavCompactOpen: [1, "sidenavCompactOpen"], sidenavMode: [1, "sidenavMode"], sidenavBreakpoint: [1, "sidenavBreakpoint"], sidenavRailBreakpoint: [1, "sidenavRailBreakpoint"], sidenavLabel: [1, "sidenavLabel"] }, outputs: { sidenavOpen: "sidenavOpenChange", sidenavCompactOpen: "sidenavCompactOpenChange" }, ngContentSelectors: _c1$
|
|
7730
|
-
i0.ɵɵprojectionDef(_c0$
|
|
8089
|
+
} }, inputs: { sidenavOpen: [1, "sidenavOpen"], sidenavCompactOpen: [1, "sidenavCompactOpen"], sidenavMode: [1, "sidenavMode"], sidenavBreakpoint: [1, "sidenavBreakpoint"], sidenavRailBreakpoint: [1, "sidenavRailBreakpoint"], sidenavLabel: [1, "sidenavLabel"] }, outputs: { sidenavOpen: "sidenavOpenChange", sidenavCompactOpen: "sidenavCompactOpenChange" }, ngContentSelectors: _c1$9, decls: 7, vars: 3, consts: [[1, "kpt-app-shell__body"], ["role", "navigation", "tabindex", "-1", 1, "kpt-app-shell__sidenav", 3, "id"], ["aria-hidden", "true", 1, "kpt-app-shell__scrim", 3, "click"], [1, "kpt-app-shell__content"]], template: function KptAppShell_Template(rf, ctx) { if (rf & 1) {
|
|
8090
|
+
i0.ɵɵprojectionDef(_c0$p);
|
|
7731
8091
|
i0.ɵɵprojection(0);
|
|
7732
8092
|
i0.ɵɵdomElementStart(1, "div", 0)(2, "aside", 1);
|
|
7733
8093
|
i0.ɵɵprojection(3, 1);
|
|
@@ -7810,43 +8170,809 @@ class KptShellNavToggle {
|
|
|
7810
8170
|
}]
|
|
7811
8171
|
}], null, { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptShellNavToggle", required: false }] }] }); })();
|
|
7812
8172
|
|
|
7813
|
-
const _c0$
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
i0.ɵɵelementStart(0, "button", 8);
|
|
7818
|
-
i0.ɵɵlistener("click", function KptPanel_Conditional_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.collapsed.set(!ctx_r1.collapsed())); });
|
|
7819
|
-
i0.ɵɵelement(1, "kpt-icon", 9);
|
|
8173
|
+
const _c0$o = ["*"];
|
|
8174
|
+
function KptAlert_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
8175
|
+
i0.ɵɵelementStart(0, "div", 3);
|
|
8176
|
+
i0.ɵɵtext(1);
|
|
7820
8177
|
i0.ɵɵelementEnd();
|
|
7821
8178
|
} if (rf & 2) {
|
|
7822
|
-
const
|
|
7823
|
-
i0.ɵɵattribute("aria-expanded", !ctx_r1.collapsed())("aria-label", ctx_r1.i18n.t("panel.toggle"));
|
|
8179
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
7824
8180
|
i0.ɵɵadvance();
|
|
7825
|
-
i0.ɵɵ
|
|
8181
|
+
i0.ɵɵtextInterpolate(ctx_r0.title());
|
|
8182
|
+
} }
|
|
8183
|
+
function KptAlert_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
8184
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
8185
|
+
i0.ɵɵelementStart(0, "button", 6);
|
|
8186
|
+
i0.ɵɵlistener("click", function KptAlert_Conditional_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.dismiss()); });
|
|
8187
|
+
i0.ɵɵelement(1, "kpt-icon", 7);
|
|
8188
|
+
i0.ɵɵelementEnd();
|
|
8189
|
+
} if (rf & 2) {
|
|
8190
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8191
|
+
i0.ɵɵattribute("aria-label", ctx_r0.i18n.t("common.close"));
|
|
7826
8192
|
} }
|
|
7827
8193
|
/**
|
|
7828
|
-
*
|
|
8194
|
+
* Komunikat inline (alert). Warianty info/success/warning/danger, opcjonalny tytuł i zamykanie.
|
|
7829
8195
|
*
|
|
7830
8196
|
* @example
|
|
7831
|
-
* <kpt-
|
|
8197
|
+
* <kpt-alert variant="success" title="Zapisano">Zmiany zostały zapisane.</kpt-alert>
|
|
7832
8198
|
*/
|
|
7833
|
-
class
|
|
8199
|
+
class KptAlert {
|
|
7834
8200
|
constructor() {
|
|
7835
|
-
this.
|
|
7836
|
-
...(ngDevMode ? [{ debugName: "
|
|
7837
|
-
this.
|
|
7838
|
-
|
|
7839
|
-
...(ngDevMode ?
|
|
7840
|
-
this.
|
|
7841
|
-
this.animationDuration = input(500, /* @ts-ignore */
|
|
7842
|
-
...(ngDevMode ? [{ debugName: "animationDuration" }] : /* istanbul ignore next */ []));
|
|
8201
|
+
this.variant = input('info', /* @ts-ignore */
|
|
8202
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
8203
|
+
this.title = input('', /* @ts-ignore */
|
|
8204
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
8205
|
+
this.dismissible = input(false, { ...(ngDevMode ? { debugName: "dismissible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8206
|
+
this.closed = output();
|
|
7843
8207
|
this.i18n = inject(KptI18n);
|
|
8208
|
+
this.visible = signal(true, /* @ts-ignore */
|
|
8209
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
7844
8210
|
}
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
8211
|
+
iconName() {
|
|
8212
|
+
return { info: 'info', success: 'circle-check', warning: 'alert-triangle', danger: 'circle-x' }[this.variant()];
|
|
8213
|
+
}
|
|
8214
|
+
dismiss() {
|
|
8215
|
+
this.visible.set(false);
|
|
8216
|
+
this.closed.emit();
|
|
8217
|
+
}
|
|
8218
|
+
static { this.ɵfac = function KptAlert_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptAlert)(); }; }
|
|
8219
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptAlert, selectors: [["kpt-alert"]], hostAttrs: [1, "kpt-alert-host"], hostVars: 1, hostBindings: function KptAlert_HostBindings(rf, ctx) { if (rf & 2) {
|
|
8220
|
+
i0.ɵɵdomProperty("hidden", !ctx.visible());
|
|
8221
|
+
} }, inputs: { variant: [1, "variant"], title: [1, "title"], dismissible: [1, "dismissible"] }, outputs: { closed: "closed" }, ngContentSelectors: _c0$o, decls: 7, vars: 4, consts: [["role", "alert", 1, "kpt-alert"], [1, "kpt-alert__icon", 3, "name"], [1, "kpt-alert__content"], [1, "kpt-alert__title"], [1, "kpt-alert__message"], ["type", "button", 1, "kpt-alert__close"], ["type", "button", 1, "kpt-alert__close", 3, "click"], ["name", "x"]], template: function KptAlert_Template(rf, ctx) { if (rf & 1) {
|
|
8222
|
+
i0.ɵɵprojectionDef();
|
|
8223
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
8224
|
+
i0.ɵɵelement(1, "kpt-icon", 1);
|
|
8225
|
+
i0.ɵɵelementStart(2, "div", 2);
|
|
8226
|
+
i0.ɵɵconditionalCreate(3, KptAlert_Conditional_3_Template, 2, 1, "div", 3);
|
|
8227
|
+
i0.ɵɵelementStart(4, "div", 4);
|
|
8228
|
+
i0.ɵɵprojection(5);
|
|
8229
|
+
i0.ɵɵelementEnd()();
|
|
8230
|
+
i0.ɵɵconditionalCreate(6, KptAlert_Conditional_6_Template, 2, 1, "button", 5);
|
|
8231
|
+
i0.ɵɵelementEnd();
|
|
8232
|
+
} if (rf & 2) {
|
|
8233
|
+
i0.ɵɵattribute("data-variant", ctx.variant());
|
|
8234
|
+
i0.ɵɵadvance();
|
|
8235
|
+
i0.ɵɵproperty("name", ctx.iconName());
|
|
8236
|
+
i0.ɵɵadvance(2);
|
|
8237
|
+
i0.ɵɵconditional(ctx.title() ? 3 : -1);
|
|
8238
|
+
i0.ɵɵadvance(3);
|
|
8239
|
+
i0.ɵɵconditional(ctx.dismissible() ? 6 : -1);
|
|
8240
|
+
} }, dependencies: [KptIcon], styles: ["@layer kpt.components{.kpt-alert{--%NS%_accent: var(--%NS%kpt-color-info);display:flex;align-items:flex-start;gap:var(--%NS%kpt-space-3, .75rem);padding:var(--%NS%kpt-space-3, .75rem) var(--%NS%kpt-space-4, 1rem);border:var(--%NS%kpt-border-width-thin, 1px) solid color-mix(in oklch,var(--%NS%_accent) 35%,transparent);border-inline-start:3px solid var(--%NS%_accent);border-radius:var(--%NS%kpt-radius-md, .5rem);background:color-mix(in oklch,var(--%NS%_accent) 10%,var(--%NS%kpt-color-surface));color:var(--%NS%kpt-color-on-surface);font-size:var(--%NS%kpt-font-size-sm, .875rem)}.kpt-alert[data-variant=success]{--%NS%_accent: var(--%NS%kpt-color-success)}.kpt-alert[data-variant=warning]{--%NS%_accent: var(--%NS%kpt-color-warning)}.kpt-alert[data-variant=danger]{--%NS%_accent: var(--%NS%kpt-color-danger)}.kpt-alert__icon{color:var(--%NS%_accent);font-weight:700;line-height:1.5}.kpt-alert__content{flex:1;min-width:0}.kpt-alert__title{font-weight:var(--%NS%kpt-font-weight-semibold, 600);margin-bottom:.15rem}.kpt-alert__close{background:none;border:0;cursor:pointer;color:var(--%NS%kpt-color-on-surface-muted);font-size:1.15rem;line-height:1;padding:0}.kpt-alert__close:hover{color:var(--%NS%kpt-color-on-surface)}}\n"], encapsulation: 2 }); }
|
|
8241
|
+
}
|
|
8242
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptAlert, [{
|
|
8243
|
+
type: Component,
|
|
8244
|
+
args: [{ selector: 'kpt-alert', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptIcon], template: `
|
|
8245
|
+
<div class="kpt-alert" [attr.data-variant]="variant()" role="alert">
|
|
8246
|
+
<kpt-icon class="kpt-alert__icon" [name]="iconName()" />
|
|
8247
|
+
<div class="kpt-alert__content">
|
|
8248
|
+
@if (title()) {
|
|
8249
|
+
<div class="kpt-alert__title">{{ title() }}</div>
|
|
8250
|
+
}
|
|
8251
|
+
<div class="kpt-alert__message"><ng-content /></div>
|
|
8252
|
+
</div>
|
|
8253
|
+
@if (dismissible()) {
|
|
8254
|
+
<button class="kpt-alert__close" type="button" (click)="dismiss()" [attr.aria-label]="i18n.t('common.close')"><kpt-icon name="x" /></button>
|
|
8255
|
+
}
|
|
8256
|
+
</div>
|
|
8257
|
+
`, host: { class: 'kpt-alert-host', '[hidden]': '!visible()' }, styles: ["@layer kpt.components{.kpt-alert{--_accent: var(--kpt-color-info);display:flex;align-items:flex-start;gap:var(--kpt-space-3, .75rem);padding:var(--kpt-space-3, .75rem) var(--kpt-space-4, 1rem);border:var(--kpt-border-width-thin, 1px) solid color-mix(in oklch,var(--_accent) 35%,transparent);border-inline-start:3px solid var(--_accent);border-radius:var(--kpt-radius-md, .5rem);background:color-mix(in oklch,var(--_accent) 10%,var(--kpt-color-surface));color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm, .875rem)}.kpt-alert[data-variant=success]{--_accent: var(--kpt-color-success)}.kpt-alert[data-variant=warning]{--_accent: var(--kpt-color-warning)}.kpt-alert[data-variant=danger]{--_accent: var(--kpt-color-danger)}.kpt-alert__icon{color:var(--_accent);font-weight:700;line-height:1.5}.kpt-alert__content{flex:1;min-width:0}.kpt-alert__title{font-weight:var(--kpt-font-weight-semibold, 600);margin-bottom:.15rem}.kpt-alert__close{background:none;border:0;cursor:pointer;color:var(--kpt-color-on-surface-muted);font-size:1.15rem;line-height:1;padding:0}.kpt-alert__close:hover{color:var(--kpt-color-on-surface)}}\n"] }]
|
|
8258
|
+
}], null, { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] }); })();
|
|
8259
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptAlert, { className: "KptAlert", filePath: "lib/alert/alert.component.ts", lineNumber: 45 }); })();
|
|
8260
|
+
|
|
8261
|
+
/**
|
|
8262
|
+
* Własny szablon przycisku jednego dostawcy logowania w `kpt-auth`. Kontekst: `$implicit` =
|
|
8263
|
+
* obiekt dostawcy, `select` = funkcja zgłaszająca wybór (emituje `providerSelect`).
|
|
8264
|
+
*
|
|
8265
|
+
* Przydatne, gdy logo marki nie przechodzi przez rejestr ikon (gradienty i `fill-rule` są
|
|
8266
|
+
* wycinane przy sanityzacji) albo gdy przycisk ma mieć inny układ niż wbudowany.
|
|
8267
|
+
*
|
|
8268
|
+
* @example
|
|
8269
|
+
* <kpt-auth [providers]="providers">
|
|
8270
|
+
* <ng-template kptAuthProvider="google" let-p let-select="select">
|
|
8271
|
+
* <button type="button" class="my-google" (click)="select()">
|
|
8272
|
+
* <img src="/google.svg" alt="" /> {{ p.label }}
|
|
8273
|
+
* </button>
|
|
8274
|
+
* </ng-template>
|
|
8275
|
+
* </kpt-auth>
|
|
8276
|
+
*/
|
|
8277
|
+
class KptAuthProviderDef {
|
|
8278
|
+
constructor() {
|
|
8279
|
+
/** Identyfikator dostawcy, dla którego obowiązuje szablon. */
|
|
8280
|
+
this.kptAuthProvider = input.required(/* @ts-ignore */
|
|
8281
|
+
...(ngDevMode ? [{ debugName: "kptAuthProvider" }] : /* istanbul ignore next */ []));
|
|
8282
|
+
this.template = inject(TemplateRef);
|
|
8283
|
+
}
|
|
8284
|
+
static { this.ɵfac = function KptAuthProviderDef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptAuthProviderDef)(); }; }
|
|
8285
|
+
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: KptAuthProviderDef, selectors: [["ng-template", "kptAuthProvider", ""]], inputs: { kptAuthProvider: [1, "kptAuthProvider"] } }); }
|
|
8286
|
+
}
|
|
8287
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptAuthProviderDef, [{
|
|
8288
|
+
type: Directive,
|
|
8289
|
+
args: [{
|
|
8290
|
+
selector: 'ng-template[kptAuthProvider]',
|
|
8291
|
+
}]
|
|
8292
|
+
}], null, { kptAuthProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptAuthProvider", required: true }] }] }); })();
|
|
8293
|
+
|
|
8294
|
+
const _c0$n = ["heading"];
|
|
8295
|
+
const _c1$8 = [[["", "kptAuthBrand", ""]], [["", "kptAuthFooter", ""]], [["", "kptAuthPromo", ""]], [["", "kptAuthFields", ""]], [["", "kptAuthFields", ""]], [["", "kptAuthSso", ""]]];
|
|
8296
|
+
const _c2$3 = ["[kptAuthBrand]", "[kptAuthFooter]", "[kptAuthPromo]", "[kptAuthFields]", "[kptAuthFields]", "[kptAuthSso]"];
|
|
8297
|
+
const _c3$1 = () => ({ min: 8 });
|
|
8298
|
+
const _c4$1 = a0 => ({ provider: a0 });
|
|
8299
|
+
const _forTrack0$4 = ($index, $item) => $item.id;
|
|
8300
|
+
function KptAuth_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
8301
|
+
i0.ɵɵelementStart(0, "kpt-alert", 8);
|
|
8302
|
+
i0.ɵɵtext(1);
|
|
8303
|
+
i0.ɵɵelementEnd();
|
|
8304
|
+
} if (rf & 2) {
|
|
8305
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8306
|
+
i0.ɵɵadvance();
|
|
8307
|
+
i0.ɵɵtextInterpolate(ctx_r0.error());
|
|
8308
|
+
} }
|
|
8309
|
+
function KptAuth_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
8310
|
+
i0.ɵɵelementStart(0, "kpt-alert", 9);
|
|
8311
|
+
i0.ɵɵtext(1);
|
|
8312
|
+
i0.ɵɵelementEnd();
|
|
8313
|
+
} if (rf & 2) {
|
|
8314
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8315
|
+
i0.ɵɵadvance();
|
|
8316
|
+
i0.ɵɵtextInterpolate(ctx_r0.notice());
|
|
8317
|
+
} }
|
|
8318
|
+
function KptAuth_Case_13_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
8319
|
+
i0.ɵɵelement(0, "kpt-checkbox", 22);
|
|
8320
|
+
i0.ɵɵcontrolCreate();
|
|
8321
|
+
} if (rf & 2) {
|
|
8322
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
8323
|
+
i0.ɵɵproperty("formField", ctx_r0.signInForm.remember)("label", ctx_r0.i18n.t("auth.remember"));
|
|
8324
|
+
i0.ɵɵcontrol();
|
|
8325
|
+
} }
|
|
8326
|
+
function KptAuth_Case_13_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
8327
|
+
i0.ɵɵelement(0, "span");
|
|
8328
|
+
} }
|
|
8329
|
+
function KptAuth_Case_13_Template(rf, ctx) { if (rf & 1) {
|
|
8330
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
8331
|
+
i0.ɵɵelementStart(0, "form", 17);
|
|
8332
|
+
i0.ɵɵlistener("submit", function KptAuth_Case_13_Template_form_submit_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onSignIn()); });
|
|
8333
|
+
i0.ɵɵelementStart(1, "kpt-form-field", 18);
|
|
8334
|
+
i0.ɵɵelement(2, "kpt-input", 19);
|
|
8335
|
+
i0.ɵɵcontrolCreate();
|
|
8336
|
+
i0.ɵɵelementEnd();
|
|
8337
|
+
i0.ɵɵelementStart(3, "kpt-form-field", 18);
|
|
8338
|
+
i0.ɵɵelement(4, "kpt-password", 20);
|
|
8339
|
+
i0.ɵɵcontrolCreate();
|
|
8340
|
+
i0.ɵɵelementEnd();
|
|
8341
|
+
i0.ɵɵprojection(5, 3);
|
|
8342
|
+
i0.ɵɵelementStart(6, "div", 21);
|
|
8343
|
+
i0.ɵɵconditionalCreate(7, KptAuth_Case_13_Conditional_7_Template, 1, 2, "kpt-checkbox", 22)(8, KptAuth_Case_13_Conditional_8_Template, 1, 0, "span");
|
|
8344
|
+
i0.ɵɵelementStart(9, "button", 23);
|
|
8345
|
+
i0.ɵɵlistener("click", function KptAuth_Case_13_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.setMode("forgot")); });
|
|
8346
|
+
i0.ɵɵtext(10);
|
|
8347
|
+
i0.ɵɵelementEnd()();
|
|
8348
|
+
i0.ɵɵelementStart(11, "kpt-button", 24);
|
|
8349
|
+
i0.ɵɵtext(12);
|
|
8350
|
+
i0.ɵɵelementEnd()();
|
|
8351
|
+
} if (rf & 2) {
|
|
8352
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8353
|
+
i0.ɵɵproperty("formRoot", ctx_r0.signInForm);
|
|
8354
|
+
i0.ɵɵattribute("aria-labelledby", ctx_r0.ids.signIn);
|
|
8355
|
+
i0.ɵɵadvance();
|
|
8356
|
+
i0.ɵɵproperty("label", ctx_r0.i18n.t("auth.email"))("error", ctx_r0.signInEmailError())("controlId", ctx_r0.ids.email);
|
|
8357
|
+
i0.ɵɵadvance();
|
|
8358
|
+
i0.ɵɵproperty("formField", ctx_r0.signInForm.email)("id", ctx_r0.ids.email)("placeholder", ctx_r0.i18n.t("auth.emailPlaceholder"));
|
|
8359
|
+
i0.ɵɵcontrol();
|
|
8360
|
+
i0.ɵɵadvance();
|
|
8361
|
+
i0.ɵɵproperty("label", ctx_r0.i18n.t("auth.password"))("error", ctx_r0.signInPasswordError())("controlId", ctx_r0.ids.password);
|
|
8362
|
+
i0.ɵɵadvance();
|
|
8363
|
+
i0.ɵɵproperty("formField", ctx_r0.signInForm.password)("id", ctx_r0.ids.password);
|
|
8364
|
+
i0.ɵɵcontrol();
|
|
8365
|
+
i0.ɵɵadvance(3);
|
|
8366
|
+
i0.ɵɵconditional(ctx_r0.showRemember() ? 7 : 8);
|
|
8367
|
+
i0.ɵɵadvance(3);
|
|
8368
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.i18n.t("auth.forgotLink"), " ");
|
|
8369
|
+
i0.ɵɵadvance();
|
|
8370
|
+
i0.ɵɵproperty("loading", ctx_r0.busy())("disabled", ctx_r0.signInInvalid());
|
|
8371
|
+
i0.ɵɵadvance();
|
|
8372
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.i18n.t("auth.signInSubmit"), " ");
|
|
8373
|
+
} }
|
|
8374
|
+
function KptAuth_Case_14_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
8375
|
+
i0.ɵɵelementStart(0, "kpt-form-field", 18);
|
|
8376
|
+
i0.ɵɵelement(1, "kpt-input", 29);
|
|
8377
|
+
i0.ɵɵcontrolCreate();
|
|
8378
|
+
i0.ɵɵelementEnd();
|
|
8379
|
+
} if (rf & 2) {
|
|
8380
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
8381
|
+
i0.ɵɵproperty("label", ctx_r0.i18n.t("auth.name"))("error", ctx_r0.signUpNameError())("controlId", ctx_r0.ids.name);
|
|
8382
|
+
i0.ɵɵadvance();
|
|
8383
|
+
i0.ɵɵproperty("formField", ctx_r0.signUpForm.name)("id", ctx_r0.ids.name);
|
|
8384
|
+
i0.ɵɵcontrol();
|
|
8385
|
+
} }
|
|
8386
|
+
function KptAuth_Case_14_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
8387
|
+
i0.ɵɵelementStart(0, "kpt-form-field", 28);
|
|
8388
|
+
i0.ɵɵelement(1, "kpt-checkbox", 22);
|
|
8389
|
+
i0.ɵɵcontrolCreate();
|
|
8390
|
+
i0.ɵɵelementEnd();
|
|
8391
|
+
} if (rf & 2) {
|
|
8392
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
8393
|
+
i0.ɵɵproperty("error", ctx_r0.signUpTermsError());
|
|
8394
|
+
i0.ɵɵadvance();
|
|
8395
|
+
i0.ɵɵproperty("formField", ctx_r0.signUpForm.terms)("label", ctx_r0.i18n.t("auth.terms"));
|
|
8396
|
+
i0.ɵɵcontrol();
|
|
8397
|
+
} }
|
|
8398
|
+
function KptAuth_Case_14_Template(rf, ctx) { if (rf & 1) {
|
|
8399
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
8400
|
+
i0.ɵɵelementStart(0, "form", 17);
|
|
8401
|
+
i0.ɵɵlistener("submit", function KptAuth_Case_14_Template_form_submit_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onSignUp()); });
|
|
8402
|
+
i0.ɵɵconditionalCreate(1, KptAuth_Case_14_Conditional_1_Template, 2, 5, "kpt-form-field", 18);
|
|
8403
|
+
i0.ɵɵelementStart(2, "kpt-form-field", 18);
|
|
8404
|
+
i0.ɵɵelement(3, "kpt-input", 19);
|
|
8405
|
+
i0.ɵɵcontrolCreate();
|
|
8406
|
+
i0.ɵɵelementEnd();
|
|
8407
|
+
i0.ɵɵelementStart(4, "kpt-form-field", 25);
|
|
8408
|
+
i0.ɵɵelement(5, "kpt-password", 26);
|
|
8409
|
+
i0.ɵɵcontrolCreate();
|
|
8410
|
+
i0.ɵɵelementEnd();
|
|
8411
|
+
i0.ɵɵelementStart(6, "kpt-form-field", 18);
|
|
8412
|
+
i0.ɵɵelement(7, "kpt-password", 27);
|
|
8413
|
+
i0.ɵɵcontrolCreate();
|
|
8414
|
+
i0.ɵɵelementEnd();
|
|
8415
|
+
i0.ɵɵprojection(8, 4);
|
|
8416
|
+
i0.ɵɵconditionalCreate(9, KptAuth_Case_14_Conditional_9_Template, 2, 3, "kpt-form-field", 28);
|
|
8417
|
+
i0.ɵɵelementStart(10, "kpt-button", 24);
|
|
8418
|
+
i0.ɵɵtext(11);
|
|
8419
|
+
i0.ɵɵelementEnd()();
|
|
8420
|
+
} if (rf & 2) {
|
|
8421
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8422
|
+
i0.ɵɵproperty("formRoot", ctx_r0.signUpForm);
|
|
8423
|
+
i0.ɵɵattribute("aria-labelledby", ctx_r0.ids.signUp);
|
|
8424
|
+
i0.ɵɵadvance();
|
|
8425
|
+
i0.ɵɵconditional(ctx_r0.showName() ? 1 : -1);
|
|
8426
|
+
i0.ɵɵadvance();
|
|
8427
|
+
i0.ɵɵproperty("label", ctx_r0.i18n.t("auth.email"))("error", ctx_r0.signUpEmailError())("controlId", ctx_r0.ids.regEmail);
|
|
8428
|
+
i0.ɵɵadvance();
|
|
8429
|
+
i0.ɵɵproperty("formField", ctx_r0.signUpForm.email)("id", ctx_r0.ids.regEmail)("placeholder", ctx_r0.i18n.t("auth.emailPlaceholder"));
|
|
8430
|
+
i0.ɵɵcontrol();
|
|
8431
|
+
i0.ɵɵadvance();
|
|
8432
|
+
i0.ɵɵproperty("label", ctx_r0.i18n.t("auth.password"))("error", ctx_r0.signUpPasswordError())("hint", ctx_r0.i18n.t("auth.passwordHint", i0.ɵɵpureFunction0(24, _c3$1)))("controlId", ctx_r0.ids.regPassword);
|
|
8433
|
+
i0.ɵɵadvance();
|
|
8434
|
+
i0.ɵɵproperty("formField", ctx_r0.signUpForm.password)("id", ctx_r0.ids.regPassword);
|
|
8435
|
+
i0.ɵɵcontrol();
|
|
8436
|
+
i0.ɵɵadvance();
|
|
8437
|
+
i0.ɵɵproperty("label", ctx_r0.i18n.t("auth.confirmPassword"))("error", ctx_r0.signUpConfirmError())("controlId", ctx_r0.ids.regConfirm);
|
|
8438
|
+
i0.ɵɵadvance();
|
|
8439
|
+
i0.ɵɵproperty("formField", ctx_r0.signUpForm.confirm)("id", ctx_r0.ids.regConfirm);
|
|
8440
|
+
i0.ɵɵcontrol();
|
|
8441
|
+
i0.ɵɵadvance(2);
|
|
8442
|
+
i0.ɵɵconditional(ctx_r0.requireTerms() ? 9 : -1);
|
|
8443
|
+
i0.ɵɵadvance();
|
|
8444
|
+
i0.ɵɵproperty("loading", ctx_r0.busy())("disabled", ctx_r0.signUpInvalid());
|
|
8445
|
+
i0.ɵɵadvance();
|
|
8446
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.i18n.t("auth.signUpSubmit"), " ");
|
|
8447
|
+
} }
|
|
8448
|
+
function KptAuth_Case_15_Template(rf, ctx) { if (rf & 1) {
|
|
8449
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
8450
|
+
i0.ɵɵelementStart(0, "form", 17);
|
|
8451
|
+
i0.ɵɵlistener("submit", function KptAuth_Case_15_Template_form_submit_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onReset()); });
|
|
8452
|
+
i0.ɵɵelementStart(1, "kpt-form-field", 18);
|
|
8453
|
+
i0.ɵɵelement(2, "kpt-input", 19);
|
|
8454
|
+
i0.ɵɵcontrolCreate();
|
|
8455
|
+
i0.ɵɵelementEnd();
|
|
8456
|
+
i0.ɵɵelementStart(3, "kpt-button", 24);
|
|
8457
|
+
i0.ɵɵtext(4);
|
|
8458
|
+
i0.ɵɵelementEnd();
|
|
8459
|
+
i0.ɵɵelementStart(5, "button", 30);
|
|
8460
|
+
i0.ɵɵlistener("click", function KptAuth_Case_15_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.setMode("signIn")); });
|
|
8461
|
+
i0.ɵɵtext(6);
|
|
8462
|
+
i0.ɵɵelementEnd()();
|
|
8463
|
+
} if (rf & 2) {
|
|
8464
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8465
|
+
i0.ɵɵproperty("formRoot", ctx_r0.resetForm);
|
|
8466
|
+
i0.ɵɵattribute("aria-labelledby", ctx_r0.ids.forgot);
|
|
8467
|
+
i0.ɵɵadvance();
|
|
8468
|
+
i0.ɵɵproperty("label", ctx_r0.i18n.t("auth.email"))("error", ctx_r0.resetEmailError())("controlId", ctx_r0.ids.resetEmail);
|
|
8469
|
+
i0.ɵɵadvance();
|
|
8470
|
+
i0.ɵɵproperty("formField", ctx_r0.resetForm.email)("id", ctx_r0.ids.resetEmail)("placeholder", ctx_r0.i18n.t("auth.emailPlaceholder"));
|
|
8471
|
+
i0.ɵɵcontrol();
|
|
8472
|
+
i0.ɵɵadvance();
|
|
8473
|
+
i0.ɵɵproperty("loading", ctx_r0.busy())("disabled", ctx_r0.resetInvalid());
|
|
8474
|
+
i0.ɵɵadvance();
|
|
8475
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.i18n.t("auth.resetSubmit"), " ");
|
|
8476
|
+
i0.ɵɵadvance(2);
|
|
8477
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.i18n.t("auth.backToSignIn"), " ");
|
|
8478
|
+
} }
|
|
8479
|
+
function KptAuth_Conditional_16_Conditional_2_For_5_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
8480
|
+
i0.ɵɵelementContainer(0, 36);
|
|
8481
|
+
} if (rf & 2) {
|
|
8482
|
+
const provider_r6 = i0.ɵɵnextContext().$implicit;
|
|
8483
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
8484
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx)("ngTemplateOutletContext", ctx_r0.providerContext(provider_r6));
|
|
8485
|
+
} }
|
|
8486
|
+
function KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
8487
|
+
i0.ɵɵelement(0, "img", 39);
|
|
8488
|
+
} if (rf & 2) {
|
|
8489
|
+
const provider_r6 = i0.ɵɵnextContext(2).$implicit;
|
|
8490
|
+
i0.ɵɵproperty("src", provider_r6.iconUrl, i0.ɵɵsanitizeUrl);
|
|
8491
|
+
} }
|
|
8492
|
+
function KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
8493
|
+
i0.ɵɵelement(0, "kpt-icon", 40);
|
|
8494
|
+
} if (rf & 2) {
|
|
8495
|
+
const provider_r6 = i0.ɵɵnextContext(2).$implicit;
|
|
8496
|
+
i0.ɵɵproperty("name", provider_r6.icon);
|
|
8497
|
+
} }
|
|
8498
|
+
function KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
8499
|
+
i0.ɵɵelementStart(0, "span", 42);
|
|
8500
|
+
i0.ɵɵtext(1);
|
|
8501
|
+
i0.ɵɵelementEnd();
|
|
8502
|
+
} if (rf & 2) {
|
|
8503
|
+
const provider_r6 = i0.ɵɵnextContext(2).$implicit;
|
|
8504
|
+
i0.ɵɵadvance();
|
|
8505
|
+
i0.ɵɵtextInterpolate(provider_r6.description);
|
|
8506
|
+
} }
|
|
8507
|
+
function KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
8508
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
8509
|
+
i0.ɵɵelementStart(0, "button", 38);
|
|
8510
|
+
i0.ɵɵlistener("click", function KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const provider_r6 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.selectProvider(provider_r6)); });
|
|
8511
|
+
i0.ɵɵconditionalCreate(1, KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Conditional_1_Template, 1, 1, "img", 39)(2, KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Conditional_2_Template, 1, 1, "kpt-icon", 40);
|
|
8512
|
+
i0.ɵɵelementStart(3, "span", 41);
|
|
8513
|
+
i0.ɵɵtext(4);
|
|
8514
|
+
i0.ɵɵelementEnd();
|
|
8515
|
+
i0.ɵɵconditionalCreate(5, KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Conditional_5_Template, 2, 1, "span", 42);
|
|
8516
|
+
i0.ɵɵelementEnd();
|
|
8517
|
+
} if (rf & 2) {
|
|
8518
|
+
const provider_r6 = i0.ɵɵnextContext().$implicit;
|
|
8519
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
8520
|
+
i0.ɵɵproperty("disabled", ctx_r0.busy());
|
|
8521
|
+
i0.ɵɵattribute("aria-label", ctx_r0.i18n.t("auth.continueWith", i0.ɵɵpureFunction1(5, _c4$1, provider_r6.label)));
|
|
8522
|
+
i0.ɵɵadvance();
|
|
8523
|
+
i0.ɵɵconditional(provider_r6.iconUrl ? 1 : provider_r6.icon ? 2 : -1);
|
|
8524
|
+
i0.ɵɵadvance(3);
|
|
8525
|
+
i0.ɵɵtextInterpolate(provider_r6.label);
|
|
8526
|
+
i0.ɵɵadvance();
|
|
8527
|
+
i0.ɵɵconditional(provider_r6.description && ctx_r0.providerLayout() === "list" ? 5 : -1);
|
|
8528
|
+
} }
|
|
8529
|
+
function KptAuth_Conditional_16_Conditional_2_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
8530
|
+
i0.ɵɵconditionalCreate(0, KptAuth_Conditional_16_Conditional_2_For_5_Conditional_0_Template, 1, 2, "ng-container", 36)(1, KptAuth_Conditional_16_Conditional_2_For_5_Conditional_1_Template, 6, 7, "button", 37);
|
|
8531
|
+
} if (rf & 2) {
|
|
8532
|
+
let tmp_13_0;
|
|
8533
|
+
const provider_r6 = ctx.$implicit;
|
|
8534
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
8535
|
+
i0.ɵɵconditional((tmp_13_0 = ctx_r0.templateFor(provider_r6)) ? 0 : 1, tmp_13_0);
|
|
8536
|
+
} }
|
|
8537
|
+
function KptAuth_Conditional_16_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
8538
|
+
i0.ɵɵelementStart(0, "div", 33)(1, "span", 34);
|
|
8539
|
+
i0.ɵɵtext(2);
|
|
8540
|
+
i0.ɵɵelementEnd()();
|
|
8541
|
+
i0.ɵɵelementStart(3, "div", 35);
|
|
8542
|
+
i0.ɵɵrepeaterCreate(4, KptAuth_Conditional_16_Conditional_2_For_5_Template, 2, 1, null, null, _forTrack0$4);
|
|
8543
|
+
i0.ɵɵelementEnd();
|
|
8544
|
+
} if (rf & 2) {
|
|
8545
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
8546
|
+
i0.ɵɵattribute("aria-label", ctx_r0.i18n.t("auth.orContinueWith"));
|
|
8547
|
+
i0.ɵɵadvance(2);
|
|
8548
|
+
i0.ɵɵtextInterpolate(ctx_r0.i18n.t("auth.orContinueWith"));
|
|
8549
|
+
i0.ɵɵadvance();
|
|
8550
|
+
i0.ɵɵattribute("data-layout", ctx_r0.providerLayout());
|
|
8551
|
+
i0.ɵɵadvance();
|
|
8552
|
+
i0.ɵɵrepeater(ctx_r0.providers());
|
|
8553
|
+
} }
|
|
8554
|
+
function KptAuth_Conditional_16_Template(rf, ctx) { if (rf & 1) {
|
|
8555
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
8556
|
+
i0.ɵɵelementStart(0, "div", 31);
|
|
8557
|
+
i0.ɵɵprojection(1, 5);
|
|
8558
|
+
i0.ɵɵelementEnd();
|
|
8559
|
+
i0.ɵɵconditionalCreate(2, KptAuth_Conditional_16_Conditional_2_Template, 6, 3);
|
|
8560
|
+
i0.ɵɵelementStart(3, "p", 32);
|
|
8561
|
+
i0.ɵɵtext(4);
|
|
8562
|
+
i0.ɵɵelementStart(5, "button", 23);
|
|
8563
|
+
i0.ɵɵlistener("click", function KptAuth_Conditional_16_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.setMode(ctx_r0.signUpActive() ? "signIn" : "signUp")); });
|
|
8564
|
+
i0.ɵɵtext(6);
|
|
8565
|
+
i0.ɵɵelementEnd()();
|
|
8566
|
+
} if (rf & 2) {
|
|
8567
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8568
|
+
i0.ɵɵadvance(2);
|
|
8569
|
+
i0.ɵɵconditional(ctx_r0.providers().length > 0 ? 2 : -1);
|
|
8570
|
+
i0.ɵɵadvance(2);
|
|
8571
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.signUpActive() ? ctx_r0.i18n.t("auth.haveAccount") : ctx_r0.i18n.t("auth.noAccount"), " ");
|
|
8572
|
+
i0.ɵɵadvance(2);
|
|
8573
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.signUpActive() ? ctx_r0.i18n.t("auth.signInSwitch") : ctx_r0.i18n.t("auth.signUpSwitch"), " ");
|
|
8574
|
+
} }
|
|
8575
|
+
function KptAuth_Conditional_21_Template(rf, ctx) { if (rf & 1) {
|
|
8576
|
+
i0.ɵɵelementStart(0, "p", 14);
|
|
8577
|
+
i0.ɵɵtext(1);
|
|
8578
|
+
i0.ɵɵelementEnd();
|
|
8579
|
+
} if (rf & 2) {
|
|
8580
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8581
|
+
i0.ɵɵadvance();
|
|
8582
|
+
i0.ɵɵtextInterpolate(ctx_r0.promoHeading());
|
|
8583
|
+
} }
|
|
8584
|
+
function KptAuth_Conditional_22_Template(rf, ctx) { if (rf & 1) {
|
|
8585
|
+
i0.ɵɵelementStart(0, "p", 15);
|
|
8586
|
+
i0.ɵɵtext(1);
|
|
8587
|
+
i0.ɵɵelementEnd();
|
|
8588
|
+
} if (rf & 2) {
|
|
8589
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8590
|
+
i0.ɵɵadvance();
|
|
8591
|
+
i0.ɵɵtextInterpolate(ctx_r0.promoBody());
|
|
8592
|
+
} }
|
|
8593
|
+
function KptAuth_Conditional_24_Template(rf, ctx) { if (rf & 1) {
|
|
8594
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
8595
|
+
i0.ɵɵelementStart(0, "kpt-button", 43);
|
|
8596
|
+
i0.ɵɵlistener("click", function KptAuth_Conditional_24_Template_kpt_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.setMode(ctx_r0.promoMode())); });
|
|
8597
|
+
i0.ɵɵtext(1);
|
|
8598
|
+
i0.ɵɵelementEnd();
|
|
8599
|
+
} if (rf & 2) {
|
|
8600
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
8601
|
+
i0.ɵɵadvance();
|
|
8602
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.promoMode() === "signUp" ? ctx_r0.i18n.t("auth.signUpSwitch") : ctx_r0.i18n.t("auth.signInSwitch"), " ");
|
|
8603
|
+
} }
|
|
8604
|
+
/** Minimalna długość hasła w rejestracji. */
|
|
8605
|
+
const MIN_PASSWORD = 8;
|
|
8606
|
+
let nextUniqueId = 0;
|
|
8607
|
+
/**
|
|
8608
|
+
* Ekran uwierzytelniania: logowanie, rejestracja i odzyskiwanie hasła w jednym komponencie,
|
|
8609
|
+
* z panelem promocyjnym i listą dostawców zewnętrznych (OAuth/SSO).
|
|
8610
|
+
*
|
|
8611
|
+
* Komponent jest prezentacyjny — nie woła API ani nie nawiguje. Wywołania backendu podpina
|
|
8612
|
+
* aplikacja pod `signIn` / `signUp` / `resetPassword` / `providerSelect`, a stan operacji
|
|
8613
|
+
* podaje z powrotem przez `busy`, `error` i `notice`.
|
|
8614
|
+
*
|
|
8615
|
+
* Układ `slider` przesuwa panel promocyjny nad formularzami przy zmianie trybu; `split`
|
|
8616
|
+
* zostawia go nieruchomo i przełącza sam formularz. Poniżej breakpointu `md` oba układy
|
|
8617
|
+
* schodzą do jednej kolumny.
|
|
8618
|
+
*
|
|
8619
|
+
* @example
|
|
8620
|
+
* <kpt-auth
|
|
8621
|
+
* [providers]="[{ id: 'google', label: 'Google', icon: 'brand-google' }]"
|
|
8622
|
+
* [busy]="loading()"
|
|
8623
|
+
* [error]="serverError()"
|
|
8624
|
+
* (signIn)="login($event)"
|
|
8625
|
+
* (providerSelect)="oauth($event.id)"
|
|
8626
|
+
* >
|
|
8627
|
+
* <img kptAuthBrand src="/logo.svg" alt="Konce" />
|
|
8628
|
+
* <div kptAuthPromo><h3>Witaj ponownie</h3><p>Zaloguj się, by wrócić do pracy.</p></div>
|
|
8629
|
+
* </kpt-auth>
|
|
8630
|
+
*/
|
|
8631
|
+
class KptAuth {
|
|
8632
|
+
constructor() {
|
|
8633
|
+
/** Aktywny tryb ekranu (dwukierunkowy — aplikacja może go wymusić po nawigacji). */
|
|
8634
|
+
this.mode = model('signIn', /* @ts-ignore */
|
|
8635
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
8636
|
+
/** Układ: przesuwany panel promocyjny albo nieruchomy split-screen. */
|
|
8637
|
+
this.layout = input('slider', /* @ts-ignore */
|
|
8638
|
+
...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
8639
|
+
/** Dostawcy logowania zewnętrznego. */
|
|
8640
|
+
this.providers = input([], /* @ts-ignore */
|
|
8641
|
+
...(ngDevMode ? [{ debugName: "providers" }] : /* istanbul ignore next */ []));
|
|
8642
|
+
/** Układ przycisków dostawców: lista pełnej szerokości albo siatka ikon. */
|
|
8643
|
+
this.providerLayout = input('list', /* @ts-ignore */
|
|
8644
|
+
...(ngDevMode ? [{ debugName: "providerLayout" }] : /* istanbul ignore next */ []));
|
|
8645
|
+
/** Pole „imię i nazwisko" w rejestracji. */
|
|
8646
|
+
this.showName = input(true, { ...(ngDevMode ? { debugName: "showName" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8647
|
+
/** Wymagana zgoda na regulamin w rejestracji. */
|
|
8648
|
+
this.requireTerms = input(true, { ...(ngDevMode ? { debugName: "requireTerms" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8649
|
+
/** Przełącznik „zapamiętaj mnie" przy logowaniu. */
|
|
8650
|
+
this.showRemember = input(true, { ...(ngDevMode ? { debugName: "showRemember" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8651
|
+
/** Operacja w toku — przyciski w stanie ładowania, pola zablokowane. */
|
|
8652
|
+
this.busy = input(false, { ...(ngDevMode ? { debugName: "busy" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8653
|
+
/** Komunikat błędu z serwera (np. „nieprawidłowe dane logowania"). */
|
|
8654
|
+
this.error = input(null, /* @ts-ignore */
|
|
8655
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
8656
|
+
/** Komunikat powodzenia (np. „wysłaliśmy link na podany adres"). */
|
|
8657
|
+
this.notice = input(null, /* @ts-ignore */
|
|
8658
|
+
...(ngDevMode ? [{ debugName: "notice" }] : /* istanbul ignore next */ []));
|
|
8659
|
+
/**
|
|
8660
|
+
* Tytuł panelu promocyjnego. `null` (domyślnie) = tekst z i18n zależny od trybu,
|
|
8661
|
+
* `''` = brak tytułu (miejsce dla slotu `[kptAuthPromo]`).
|
|
8662
|
+
*/
|
|
8663
|
+
this.promoTitle = input(null, /* @ts-ignore */
|
|
8664
|
+
...(ngDevMode ? [{ debugName: "promoTitle" }] : /* istanbul ignore next */ []));
|
|
8665
|
+
/** Tekst panelu promocyjnego; zasady jak w `promoTitle`. */
|
|
8666
|
+
this.promoText = input(null, /* @ts-ignore */
|
|
8667
|
+
...(ngDevMode ? [{ debugName: "promoText" }] : /* istanbul ignore next */ []));
|
|
8668
|
+
/** Animacja przejścia między trybami. */
|
|
8669
|
+
this.animated = input(true, { ...(ngDevMode ? { debugName: "animated" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8670
|
+
/** Czas animacji w ms. */
|
|
8671
|
+
this.animationDuration = input(320, { ...(ngDevMode ? { debugName: "animationDuration" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
8672
|
+
this.signIn = output();
|
|
8673
|
+
this.signUp = output();
|
|
8674
|
+
this.resetPassword = output();
|
|
8675
|
+
this.providerSelect = output();
|
|
8676
|
+
this.i18n = inject(KptI18n);
|
|
8677
|
+
this.injector = inject(Injector);
|
|
8678
|
+
this.uid = ++nextUniqueId;
|
|
8679
|
+
/** Nagłówek panelu dostaje fokus po zmianie trybu — inaczej zmiana nie zostaje ogłoszona. */
|
|
8680
|
+
this.headings = viewChildren('heading', /* @ts-ignore */
|
|
8681
|
+
...(ngDevMode ? [{ debugName: "headings" }] : /* istanbul ignore next */ []));
|
|
8682
|
+
this.providerDefs = contentChildren(KptAuthProviderDef, /* @ts-ignore */
|
|
8683
|
+
...(ngDevMode ? [{ debugName: "providerDefs" }] : /* istanbul ignore next */ []));
|
|
8684
|
+
this.ids = {
|
|
8685
|
+
signIn: `kpt-auth-${this.uid}-signin`,
|
|
8686
|
+
signUp: `kpt-auth-${this.uid}-signup`,
|
|
8687
|
+
forgot: `kpt-auth-${this.uid}-forgot`,
|
|
8688
|
+
email: `kpt-auth-${this.uid}-email`,
|
|
8689
|
+
password: `kpt-auth-${this.uid}-password`,
|
|
8690
|
+
name: `kpt-auth-${this.uid}-name`,
|
|
8691
|
+
regEmail: `kpt-auth-${this.uid}-reg-email`,
|
|
8692
|
+
regPassword: `kpt-auth-${this.uid}-reg-password`,
|
|
8693
|
+
regConfirm: `kpt-auth-${this.uid}-reg-confirm`,
|
|
8694
|
+
resetEmail: `kpt-auth-${this.uid}-reset-email`,
|
|
8695
|
+
};
|
|
8696
|
+
/** W trybie `signUp` formularz i panel promocyjny zamieniają się stronami. */
|
|
8697
|
+
this.signUpActive = computed(() => this.mode() === 'signUp', /* @ts-ignore */
|
|
8698
|
+
...(ngDevMode ? [{ debugName: "signUpActive" }] : /* istanbul ignore next */ []));
|
|
8699
|
+
this.headingId = computed(() => this.ids[this.mode()], /* @ts-ignore */
|
|
8700
|
+
...(ngDevMode ? [{ debugName: "headingId" }] : /* istanbul ignore next */ []));
|
|
8701
|
+
this.title = computed(() => this.i18n.t(`auth.${this.mode()}Title`), /* @ts-ignore */
|
|
8702
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
8703
|
+
this.subtitle = computed(() => this.i18n.t(`auth.${this.mode()}Subtitle`), /* @ts-ignore */
|
|
8704
|
+
...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
8705
|
+
/** Panel promocyjny zachęca do trybu przeciwnego do bieżącego. */
|
|
8706
|
+
this.promoMode = computed(() => (this.signUpActive() ? 'signIn' : 'signUp'), /* @ts-ignore */
|
|
8707
|
+
...(ngDevMode ? [{ debugName: "promoMode" }] : /* istanbul ignore next */ []));
|
|
8708
|
+
this.promoHeading = computed(() => {
|
|
8709
|
+
const custom = this.promoTitle();
|
|
8710
|
+
return custom === null ? this.i18n.t(`auth.promo.${this.promoMode()}Title`) : custom;
|
|
8711
|
+
}, /* @ts-ignore */
|
|
8712
|
+
...(ngDevMode ? [{ debugName: "promoHeading" }] : /* istanbul ignore next */ []));
|
|
8713
|
+
this.promoBody = computed(() => {
|
|
8714
|
+
const custom = this.promoText();
|
|
8715
|
+
return custom === null ? this.i18n.t(`auth.promo.${this.promoMode()}Text`) : custom;
|
|
8716
|
+
}, /* @ts-ignore */
|
|
8717
|
+
...(ngDevMode ? [{ debugName: "promoBody" }] : /* istanbul ignore next */ []));
|
|
8718
|
+
// ── Formularze (po jednym na tryb; walidatory bezwarunkowe) ──
|
|
8719
|
+
this.signInModel = signal({ email: '', password: '', remember: false }, /* @ts-ignore */
|
|
8720
|
+
...(ngDevMode ? [{ debugName: "signInModel" }] : /* istanbul ignore next */ []));
|
|
8721
|
+
this.signInForm = form(this.signInModel, (p) => {
|
|
8722
|
+
required(p.email);
|
|
8723
|
+
email(p.email);
|
|
8724
|
+
required(p.password);
|
|
8725
|
+
});
|
|
8726
|
+
this.signUpModel = signal({ name: '', email: '', password: '', confirm: '', terms: false }, /* @ts-ignore */
|
|
8727
|
+
...(ngDevMode ? [{ debugName: "signUpModel" }] : /* istanbul ignore next */ []));
|
|
8728
|
+
this.signUpForm = form(this.signUpModel, (p) => {
|
|
8729
|
+
// `when` zależy od konfiguracji komponentu (czy pole w ogóle istnieje), nie od stanu UI —
|
|
8730
|
+
// ukryte pole nie może blokować formularza, a `valid()` nadal mówi prawdę.
|
|
8731
|
+
required(p.name, { when: () => this.showName() });
|
|
8732
|
+
required(p.email);
|
|
8733
|
+
email(p.email);
|
|
8734
|
+
required(p.password);
|
|
8735
|
+
minLength(p.password, MIN_PASSWORD);
|
|
8736
|
+
required(p.terms, { when: () => this.requireTerms() });
|
|
8737
|
+
// Zgodność haseł jako błąd pola „powtórz hasło" — walidacja par idzie przez validateTree.
|
|
8738
|
+
validateTree(p, (ctx) => {
|
|
8739
|
+
const pass = ctx.valueOf(p.password);
|
|
8740
|
+
const confirm = ctx.valueOf(p.confirm);
|
|
8741
|
+
if (!confirm || pass === confirm)
|
|
8742
|
+
return null;
|
|
8743
|
+
return { kind: 'mismatch', fieldTree: ctx.fieldTreeOf(p.confirm) };
|
|
8744
|
+
});
|
|
8745
|
+
});
|
|
8746
|
+
this.resetModel = signal({ email: '' }, /* @ts-ignore */
|
|
8747
|
+
...(ngDevMode ? [{ debugName: "resetModel" }] : /* istanbul ignore next */ []));
|
|
8748
|
+
this.resetForm = form(this.resetModel, (p) => {
|
|
8749
|
+
required(p.email);
|
|
8750
|
+
email(p.email);
|
|
8751
|
+
});
|
|
8752
|
+
this.signInInvalid = computed(() => this.signInForm().invalid(), /* @ts-ignore */
|
|
8753
|
+
...(ngDevMode ? [{ debugName: "signInInvalid" }] : /* istanbul ignore next */ []));
|
|
8754
|
+
this.signUpInvalid = computed(() => this.signUpForm().invalid(), /* @ts-ignore */
|
|
8755
|
+
...(ngDevMode ? [{ debugName: "signUpInvalid" }] : /* istanbul ignore next */ []));
|
|
8756
|
+
this.resetInvalid = computed(() => this.resetForm().invalid(), /* @ts-ignore */
|
|
8757
|
+
...(ngDevMode ? [{ debugName: "resetInvalid" }] : /* istanbul ignore next */ []));
|
|
8758
|
+
this.signInEmailError = computed(() => this.errorText(this.signInForm.email().errors(), this.signInForm.email().touched()), /* @ts-ignore */
|
|
8759
|
+
...(ngDevMode ? [{ debugName: "signInEmailError" }] : /* istanbul ignore next */ []));
|
|
8760
|
+
this.signInPasswordError = computed(() => this.errorText(this.signInForm.password().errors(), this.signInForm.password().touched()), /* @ts-ignore */
|
|
8761
|
+
...(ngDevMode ? [{ debugName: "signInPasswordError" }] : /* istanbul ignore next */ []));
|
|
8762
|
+
this.signUpNameError = computed(() => this.errorText(this.signUpForm.name().errors(), this.signUpForm.name().touched()), /* @ts-ignore */
|
|
8763
|
+
...(ngDevMode ? [{ debugName: "signUpNameError" }] : /* istanbul ignore next */ []));
|
|
8764
|
+
this.signUpEmailError = computed(() => this.errorText(this.signUpForm.email().errors(), this.signUpForm.email().touched()), /* @ts-ignore */
|
|
8765
|
+
...(ngDevMode ? [{ debugName: "signUpEmailError" }] : /* istanbul ignore next */ []));
|
|
8766
|
+
this.signUpPasswordError = computed(() => this.errorText(this.signUpForm.password().errors(), this.signUpForm.password().touched()), /* @ts-ignore */
|
|
8767
|
+
...(ngDevMode ? [{ debugName: "signUpPasswordError" }] : /* istanbul ignore next */ []));
|
|
8768
|
+
this.signUpConfirmError = computed(() => this.errorText(this.signUpForm.confirm().errors(), this.signUpForm.confirm().touched()), /* @ts-ignore */
|
|
8769
|
+
...(ngDevMode ? [{ debugName: "signUpConfirmError" }] : /* istanbul ignore next */ []));
|
|
8770
|
+
this.signUpTermsError = computed(() => this.errorText(this.signUpForm.terms().errors(), this.signUpForm.terms().touched()), /* @ts-ignore */
|
|
8771
|
+
...(ngDevMode ? [{ debugName: "signUpTermsError" }] : /* istanbul ignore next */ []));
|
|
8772
|
+
this.resetEmailError = computed(() => this.errorText(this.resetForm.email().errors(), this.resetForm.email().touched()), /* @ts-ignore */
|
|
8773
|
+
...(ngDevMode ? [{ debugName: "resetEmailError" }] : /* istanbul ignore next */ []));
|
|
8774
|
+
}
|
|
8775
|
+
/**
|
|
8776
|
+
* Komunikat błędu składamy z `kind` w chwili renderowania, a nie w walidatorze — dzięki temu
|
|
8777
|
+
* zmiana języka w runtime przerysowuje komunikaty (walidatory tworzą się raz, przy starcie).
|
|
8778
|
+
* Bramka „nie strasz czerwienią świeżego pola" żyje tu, w prezentacji.
|
|
8779
|
+
*/
|
|
8780
|
+
errorText(errors, touched) {
|
|
8781
|
+
if (!touched || errors.length === 0)
|
|
8782
|
+
return null;
|
|
8783
|
+
switch (errors[0].kind) {
|
|
8784
|
+
case 'required':
|
|
8785
|
+
return this.i18n.t('auth.errorRequired');
|
|
8786
|
+
case 'email':
|
|
8787
|
+
return this.i18n.t('auth.errorEmail');
|
|
8788
|
+
case 'minLength':
|
|
8789
|
+
return this.i18n.t('auth.errorMinLength', { min: MIN_PASSWORD });
|
|
8790
|
+
case 'mismatch':
|
|
8791
|
+
return this.i18n.t('auth.errorMismatch');
|
|
8792
|
+
default:
|
|
8793
|
+
return this.i18n.t('auth.errorInvalid');
|
|
8794
|
+
}
|
|
8795
|
+
}
|
|
8796
|
+
// ── Tryby ──
|
|
8797
|
+
setMode(mode) {
|
|
8798
|
+
if (mode === this.mode())
|
|
8799
|
+
return;
|
|
8800
|
+
this.mode.set(mode);
|
|
8801
|
+
// Fokus na nagłówku nowego trybu: bez tego czytnik nie ogłosi zmiany, a fokus zostaje
|
|
8802
|
+
// na przycisku, który właśnie zjechał z ekranu. Musi to być `afterNextRender` —
|
|
8803
|
+
// mikrozadanie wykonałoby się jeszcze przed przerysowaniem, na starym nagłówku.
|
|
8804
|
+
afterNextRender(() => {
|
|
8805
|
+
const heading = this.headings().find((h) => h.nativeElement.dataset['mode'] === mode);
|
|
8806
|
+
heading?.nativeElement.focus();
|
|
8807
|
+
}, { injector: this.injector });
|
|
8808
|
+
}
|
|
8809
|
+
// ── Submit ──
|
|
8810
|
+
onSignIn() {
|
|
8811
|
+
void submit(this.signInForm, {
|
|
8812
|
+
action: async () => {
|
|
8813
|
+
this.signIn.emit({ ...this.signInModel() });
|
|
8814
|
+
},
|
|
8815
|
+
});
|
|
8816
|
+
}
|
|
8817
|
+
onSignUp() {
|
|
8818
|
+
void submit(this.signUpForm, {
|
|
8819
|
+
action: async () => {
|
|
8820
|
+
const { name, email: mail, password, terms } = this.signUpModel();
|
|
8821
|
+
this.signUp.emit({ name, email: mail, password, terms });
|
|
8822
|
+
},
|
|
8823
|
+
});
|
|
8824
|
+
}
|
|
8825
|
+
onReset() {
|
|
8826
|
+
void submit(this.resetForm, {
|
|
8827
|
+
action: async () => {
|
|
8828
|
+
this.resetPassword.emit({ ...this.resetModel() });
|
|
8829
|
+
},
|
|
8830
|
+
});
|
|
8831
|
+
}
|
|
8832
|
+
// ── Dostawcy ──
|
|
8833
|
+
templateFor(provider) {
|
|
8834
|
+
return this.providerDefs().find((def) => def.kptAuthProvider() === provider.id)?.template ?? null;
|
|
8835
|
+
}
|
|
8836
|
+
selectProvider(provider) {
|
|
8837
|
+
if (this.busy())
|
|
8838
|
+
return;
|
|
8839
|
+
this.providerSelect.emit(provider);
|
|
8840
|
+
}
|
|
8841
|
+
/** Kontekst szablonu własnego dostawcy: `$implicit` = dostawca, `select` = zgłoszenie wyboru. */
|
|
8842
|
+
providerContext(provider) {
|
|
8843
|
+
return { $implicit: provider, select: () => this.selectProvider(provider) };
|
|
8844
|
+
}
|
|
8845
|
+
static { this.ɵfac = function KptAuth_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptAuth)(); }; }
|
|
8846
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptAuth, selectors: [["kpt-auth"]], contentQueries: function KptAuth_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
|
|
8847
|
+
i0.ɵɵcontentQuerySignal(dirIndex, ctx.providerDefs, KptAuthProviderDef, 4);
|
|
8848
|
+
} if (rf & 2) {
|
|
8849
|
+
i0.ɵɵqueryAdvance();
|
|
8850
|
+
} }, viewQuery: function KptAuth_Query(rf, ctx) { if (rf & 1) {
|
|
8851
|
+
i0.ɵɵviewQuerySignal(ctx.headings, _c0$n, 5);
|
|
8852
|
+
} if (rf & 2) {
|
|
8853
|
+
i0.ɵɵqueryAdvance();
|
|
8854
|
+
} }, hostAttrs: [1, "kpt-auth-host"], hostVars: 4, hostBindings: function KptAuth_HostBindings(rf, ctx) { if (rf & 2) {
|
|
8855
|
+
i0.ɵɵattribute("data-layout", ctx.layout())("data-mode", ctx.mode());
|
|
8856
|
+
i0.ɵɵstyleProp("--%NS%kpt-anim-duration", (ctx.animated() ? ctx.animationDuration() : 0) + "ms");
|
|
8857
|
+
} }, inputs: { mode: [1, "mode"], layout: [1, "layout"], providers: [1, "providers"], providerLayout: [1, "providerLayout"], showName: [1, "showName"], requireTerms: [1, "requireTerms"], showRemember: [1, "showRemember"], busy: [1, "busy"], error: [1, "error"], notice: [1, "notice"], promoTitle: [1, "promoTitle"], promoText: [1, "promoText"], animated: [1, "animated"], animationDuration: [1, "animationDuration"] }, outputs: { mode: "modeChange", signIn: "signIn", signUp: "signUp", resetPassword: "resetPassword", providerSelect: "providerSelect" }, ngContentSelectors: _c2$3, decls: 25, vars: 12, consts: [["heading", ""], [1, "kpt-auth"], [1, "kpt-auth__card"], [1, "kpt-auth__form-side"], [1, "kpt-auth__inner"], [1, "kpt-auth__brand"], ["tabindex", "-1", 1, "kpt-auth__title", 3, "id"], [1, "kpt-auth__subtitle"], ["variant", "danger"], ["variant", "success"], [1, "kpt-auth__form", 3, "formRoot"], [1, "kpt-auth__footer"], [1, "kpt-auth__promo"], [1, "kpt-auth__promo-inner"], [1, "kpt-auth__promo-title"], [1, "kpt-auth__promo-text"], ["variant", "outline", 1, "kpt-auth__promo-cta"], [1, "kpt-auth__form", 3, "submit", "formRoot"], ["required", "", 3, "label", "error", "controlId"], ["type", "email", "autocomplete", "email", 3, "formField", "id", "placeholder"], ["autocomplete", "current-password", 3, "formField", "id"], [1, "kpt-auth__row"], [3, "formField", "label"], ["type", "button", 1, "kpt-auth__link", 3, "click"], ["type", "submit", "fullWidth", "", 3, "loading", "disabled"], ["required", "", 3, "label", "error", "hint", "controlId"], ["autocomplete", "new-password", "feedback", "", 3, "formField", "id"], ["autocomplete", "new-password", 3, "formField", "id"], [3, "error"], ["autocomplete", "name", 3, "formField", "id"], ["type", "button", 1, "kpt-auth__link", "kpt-auth__link--center", 3, "click"], [1, "kpt-auth__sso"], [1, "kpt-auth__switch"], ["role", "separator", 1, "kpt-auth__separator"], [1, "kpt-auth__separator-text"], [1, "kpt-auth__providers"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], ["type", "button", 1, "kpt-auth__provider", 3, "disabled"], ["type", "button", 1, "kpt-auth__provider", 3, "click", "disabled"], ["alt", "", 1, "kpt-auth__provider-logo", 3, "src"], [1, "kpt-auth__provider-logo", 3, "name"], [1, "kpt-auth__provider-label"], [1, "kpt-auth__provider-desc"], ["variant", "outline", 1, "kpt-auth__promo-cta", 3, "click"]], template: function KptAuth_Template(rf, ctx) { if (rf & 1) {
|
|
8858
|
+
i0.ɵɵprojectionDef(_c1$8);
|
|
8859
|
+
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "div", 3)(3, "div", 4)(4, "div", 5);
|
|
8860
|
+
i0.ɵɵprojection(5);
|
|
8861
|
+
i0.ɵɵelementEnd();
|
|
8862
|
+
i0.ɵɵelementStart(6, "h2", 6, 0);
|
|
8863
|
+
i0.ɵɵtext(8);
|
|
8864
|
+
i0.ɵɵelementEnd();
|
|
8865
|
+
i0.ɵɵelementStart(9, "p", 7);
|
|
8866
|
+
i0.ɵɵtext(10);
|
|
8867
|
+
i0.ɵɵelementEnd();
|
|
8868
|
+
i0.ɵɵconditionalCreate(11, KptAuth_Conditional_11_Template, 2, 1, "kpt-alert", 8);
|
|
8869
|
+
i0.ɵɵconditionalCreate(12, KptAuth_Conditional_12_Template, 2, 1, "kpt-alert", 9);
|
|
8870
|
+
i0.ɵɵconditionalCreate(13, KptAuth_Case_13_Template, 13, 18, "form", 10)(14, KptAuth_Case_14_Template, 12, 25, "form", 10)(15, KptAuth_Case_15_Template, 7, 12, "form", 10);
|
|
8871
|
+
i0.ɵɵconditionalCreate(16, KptAuth_Conditional_16_Template, 7, 3);
|
|
8872
|
+
i0.ɵɵelementStart(17, "div", 11);
|
|
8873
|
+
i0.ɵɵprojection(18, 1);
|
|
8874
|
+
i0.ɵɵelementEnd()()();
|
|
8875
|
+
i0.ɵɵelementStart(19, "aside", 12)(20, "div", 13);
|
|
8876
|
+
i0.ɵɵconditionalCreate(21, KptAuth_Conditional_21_Template, 2, 1, "p", 14);
|
|
8877
|
+
i0.ɵɵconditionalCreate(22, KptAuth_Conditional_22_Template, 2, 1, "p", 15);
|
|
8878
|
+
i0.ɵɵprojection(23, 2);
|
|
8879
|
+
i0.ɵɵconditionalCreate(24, KptAuth_Conditional_24_Template, 2, 1, "kpt-button", 16);
|
|
8880
|
+
i0.ɵɵelementEnd()()()();
|
|
8881
|
+
} if (rf & 2) {
|
|
8882
|
+
let tmp_8_0;
|
|
8883
|
+
i0.ɵɵadvance(3);
|
|
8884
|
+
i0.ɵɵattribute("data-mode", ctx.mode());
|
|
8885
|
+
i0.ɵɵadvance(3);
|
|
8886
|
+
i0.ɵɵproperty("id", ctx.headingId());
|
|
8887
|
+
i0.ɵɵattribute("data-mode", ctx.mode());
|
|
8888
|
+
i0.ɵɵadvance(2);
|
|
8889
|
+
i0.ɵɵtextInterpolate1(" ", ctx.title(), " ");
|
|
8890
|
+
i0.ɵɵadvance(2);
|
|
8891
|
+
i0.ɵɵtextInterpolate(ctx.subtitle());
|
|
8892
|
+
i0.ɵɵadvance();
|
|
8893
|
+
i0.ɵɵconditional(ctx.error() ? 11 : -1);
|
|
8894
|
+
i0.ɵɵadvance();
|
|
8895
|
+
i0.ɵɵconditional(ctx.notice() ? 12 : -1);
|
|
8896
|
+
i0.ɵɵadvance();
|
|
8897
|
+
i0.ɵɵconditional((tmp_8_0 = ctx.mode()) === "signIn" ? 13 : tmp_8_0 === "signUp" ? 14 : tmp_8_0 === "forgot" ? 15 : -1);
|
|
8898
|
+
i0.ɵɵadvance(3);
|
|
8899
|
+
i0.ɵɵconditional(ctx.mode() !== "forgot" ? 16 : -1);
|
|
8900
|
+
i0.ɵɵadvance(5);
|
|
8901
|
+
i0.ɵɵconditional(ctx.promoHeading() ? 21 : -1);
|
|
8902
|
+
i0.ɵɵadvance();
|
|
8903
|
+
i0.ɵɵconditional(ctx.promoBody() ? 22 : -1);
|
|
8904
|
+
i0.ɵɵadvance(2);
|
|
8905
|
+
i0.ɵɵconditional(ctx.mode() !== "forgot" ? 24 : -1);
|
|
8906
|
+
} }, dependencies: [FormField,
|
|
8907
|
+
FormRoot,
|
|
8908
|
+
KptAlert,
|
|
8909
|
+
KptButton,
|
|
8910
|
+
KptCheckbox,
|
|
8911
|
+
KptFormField,
|
|
8912
|
+
KptIcon,
|
|
8913
|
+
KptInput,
|
|
8914
|
+
KptPassword,
|
|
8915
|
+
NgTemplateOutlet], styles: ["@layer kpt.components{.kpt-auth-host{display:block;--%NS%_kpt-auth-duration: var(--%NS%kpt-anim-duration, var(--%NS%kpt-motion-duration-slow, .32s));--%NS%_kpt-auth-easing: var(--%NS%kpt-motion-easing-emphasized, cubic-bezier(.3, 0, 0, 1));--%NS%_kpt-auth-dir: 1}[dir=rtl] .kpt-auth-host{--%NS%_kpt-auth-dir: -1}.kpt-auth{display:flex;align-items:center;justify-content:center;min-block-size:var(--%NS%kpt-auth-min-height, 100vh);min-block-size:var(--%NS%kpt-auth-min-height, 100dvh);padding:var(--%NS%kpt-auth-padding, var(--%NS%kpt-space-4, 1rem));background:var(--%NS%kpt-color-surface)}.kpt-auth__card{position:relative;display:grid;inline-size:min(var(--%NS%kpt-auth-width, 64rem),100%);min-block-size:var(--%NS%kpt-auth-card-height, 34rem);overflow:hidden;background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-auth-card-border, 1px solid var(--%NS%kpt-color-border));border-radius:var(--%NS%kpt-auth-card-radius, var(--%NS%kpt-radius-lg, .75rem));box-shadow:var(--%NS%kpt-auth-card-shadow, var(--%NS%kpt-elevation-3));grid-template-columns:1fr 1fr;grid-template-areas:\"form promo\"}.kpt-auth__form-side{grid-area:form;display:flex;align-items:center;justify-content:center;padding:var(--%NS%kpt-space-6, 1.5rem);overflow-y:auto}.kpt-auth__inner{inline-size:min(24rem,100%);display:flex;flex-direction:column;gap:var(--%NS%kpt-space-3, .75rem)}.kpt-auth__brand:empty,.kpt-auth__sso:empty,.kpt-auth__footer:empty{display:none}.kpt-auth__title{margin:0;font-size:var(--%NS%kpt-font-size-xl, 1.5rem);font-weight:var(--%NS%kpt-font-weight-bold, 700);color:var(--%NS%kpt-color-on-surface);outline:none}.kpt-auth__subtitle{margin:0;font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-auth__form{display:flex;flex-direction:column;gap:var(--%NS%kpt-space-3, .75rem);margin-block-start:var(--%NS%kpt-space-2, .5rem)}.kpt-auth__row{display:flex;align-items:center;justify-content:space-between;gap:var(--%NS%kpt-space-2, .5rem);flex-wrap:wrap}.kpt-auth__link{padding:0;font:inherit;font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-color-primary);background:none;border:0;text-decoration:underline;text-underline-offset:.15em;cursor:pointer}.kpt-auth__link:hover{color:var(--%NS%kpt-color-primary-hover)}.kpt-auth__link--center{align-self:center}.kpt-auth__separator{display:flex;align-items:center;gap:var(--%NS%kpt-space-3, .75rem);margin-block:var(--%NS%kpt-space-2, .5rem);font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-auth__separator:before,.kpt-auth__separator:after{content:\"\";flex:1;block-size:1px;background:var(--%NS%kpt-color-border)}.kpt-auth__providers{display:grid;gap:var(--%NS%kpt-space-2, .5rem)}.kpt-auth__providers[data-layout=grid]{grid-template-columns:repeat(auto-fit,minmax(4.5rem,1fr))}.kpt-auth__provider{display:flex;align-items:center;gap:var(--%NS%kpt-space-2, .5rem);padding:var(--%NS%kpt-space-3, .75rem);font:inherit;font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-color-on-surface);background:var(--%NS%kpt-color-surface-raised);border:1px solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md, .5rem);cursor:pointer;transition:background-color var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard)}.kpt-auth__provider:hover:not(:disabled){background:var(--%NS%kpt-color-surface-hover)}.kpt-auth__provider:disabled{opacity:.6;cursor:not-allowed}.kpt-auth__provider-logo{font-size:1.25rem;inline-size:1.25rem;block-size:1.25rem;flex-shrink:0}.kpt-auth__provider-desc{margin-inline-start:auto;font-size:var(--%NS%kpt-font-size-xs, .75rem);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-auth__providers[data-layout=grid] .kpt-auth__provider{flex-direction:column;gap:var(--%NS%kpt-space-1, .25rem);text-align:center}.kpt-auth__switch{margin:0;font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-color-on-surface-muted);text-align:center}.kpt-auth__promo{grid-area:promo;display:flex;align-items:center;justify-content:center;padding:var(--%NS%kpt-space-8, 2rem);color:var(--%NS%kpt-color-primary-contrast);background:var(--%NS%kpt-auth-promo-bg, linear-gradient(135deg, var(--%NS%kpt-color-primary), var(--%NS%kpt-color-primary-hover)))}.kpt-auth__promo-inner{display:flex;flex-direction:column;align-items:center;gap:var(--%NS%kpt-space-3, .75rem);text-align:center}.kpt-auth__promo-title{margin:0;font-size:var(--%NS%kpt-font-size-lg, 1.25rem);font-weight:var(--%NS%kpt-font-weight-bold, 700)}.kpt-auth__promo-text{margin:0;font-size:var(--%NS%kpt-font-size-sm, .875rem);opacity:.85}.kpt-auth__promo-cta .kpt-button{color:var(--%NS%kpt-color-primary-contrast);border-color:color-mix(in oklch,var(--%NS%kpt-color-primary-contrast) 60%,transparent);background:transparent}.kpt-auth__promo-cta .kpt-button:hover:not(:disabled){background:color-mix(in oklch,var(--%NS%kpt-color-primary-contrast) 12%,transparent)}.kpt-auth-host[data-layout=slider] .kpt-auth__promo,.kpt-auth-host[data-layout=slider] .kpt-auth__form-side{transition:transform var(--%NS%_kpt-auth-duration) var(--%NS%_kpt-auth-easing)}.kpt-auth-host[data-layout=slider][data-mode=signUp] .kpt-auth__promo{transform:translate(calc(var(--%NS%_kpt-auth-dir) * -100%))}.kpt-auth-host[data-layout=slider][data-mode=signUp] .kpt-auth__form-side{transform:translate(calc(var(--%NS%_kpt-auth-dir) * 100%))}.kpt-auth-host[data-layout=slider][data-mode=signIn] .kpt-auth__promo-inner{animation:kpt-auth-promo-start var(--%NS%_kpt-auth-duration) var(--%NS%_kpt-auth-easing)}.kpt-auth-host[data-layout=slider][data-mode=signUp] .kpt-auth__promo-inner{animation:kpt-auth-promo-end var(--%NS%_kpt-auth-duration) var(--%NS%_kpt-auth-easing)}@keyframes kpt-auth-promo-start{0%{transform:translate(calc(var(--%NS%_kpt-auth-dir) * -14%))}to{transform:none}}@keyframes kpt-auth-promo-end{0%{transform:translate(calc(var(--%NS%_kpt-auth-dir) * 14%))}to{transform:none}}@keyframes kpt-auth-enter{0%{opacity:0;transform:translate(calc(var(--%NS%_kpt-auth-dir) * 1.25rem))}to{opacity:1;transform:none}}.kpt-auth__inner{animation:kpt-auth-enter var(--%NS%_kpt-auth-duration) var(--%NS%kpt-motion-easing-standard, cubic-bezier(.2, 0, 0, 1))}.kpt-auth__card{grid-template-columns:1fr;grid-template-areas:\"promo\" \"form\";min-block-size:0}.kpt-auth__promo{padding:var(--%NS%kpt-space-6, 1.5rem)}@media(min-width:768px){.kpt-auth__card{grid-template-columns:1fr 1fr;grid-template-areas:\"form promo\";min-block-size:var(--%NS%kpt-auth-card-height, 34rem)}.kpt-auth__promo{padding:var(--%NS%kpt-space-8, 2rem)}}@media(max-width:767px){.kpt-auth-host[data-layout=slider][data-mode] .kpt-auth__promo,.kpt-auth-host[data-layout=slider][data-mode] .kpt-auth__form-side{transform:none}.kpt-auth-host[data-layout=slider][data-mode] .kpt-auth__promo-inner{animation:none;transform:none}}@media(prefers-reduced-motion:reduce){.kpt-auth-host[data-layout][data-mode] .kpt-auth__promo,.kpt-auth-host[data-layout][data-mode] .kpt-auth__form-side,.kpt-auth-host[data-layout][data-mode] .kpt-auth__promo-inner,.kpt-auth-host[data-layout][data-mode] .kpt-auth__provider{transition:none}.kpt-auth-host[data-layout][data-mode] .kpt-auth__inner,.kpt-auth-host[data-layout][data-mode] .kpt-auth__promo-inner{animation:none}}}\n"], encapsulation: 2 }); }
|
|
8916
|
+
}
|
|
8917
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptAuth, [{
|
|
8918
|
+
type: Component,
|
|
8919
|
+
args: [{ selector: 'kpt-auth', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
8920
|
+
FormField,
|
|
8921
|
+
FormRoot,
|
|
8922
|
+
KptAlert,
|
|
8923
|
+
KptButton,
|
|
8924
|
+
KptCheckbox,
|
|
8925
|
+
KptFormField,
|
|
8926
|
+
KptIcon,
|
|
8927
|
+
KptInput,
|
|
8928
|
+
KptPassword,
|
|
8929
|
+
NgTemplateOutlet,
|
|
8930
|
+
], host: {
|
|
8931
|
+
class: 'kpt-auth-host',
|
|
8932
|
+
'[attr.data-layout]': 'layout()',
|
|
8933
|
+
'[attr.data-mode]': 'mode()',
|
|
8934
|
+
'[style.--kpt-anim-duration]': "(animated() ? animationDuration() : 0) + 'ms'",
|
|
8935
|
+
}, template: "<div class=\"kpt-auth\">\n <div class=\"kpt-auth__card\">\n <!--\n W drzewie \u017Cyje wy\u0142\u0105cznie formularz aktywnego trybu. Dzi\u0119ki temu nie ma element\u00F3w\n niewidocznych, ale wci\u0105\u017C fokusowalnych \u2014 najcz\u0119stsza wada ekran\u00F3w logowania z animacj\u0105,\n w kt\u00F3rych oba formularze zostaj\u0105 w DOM i wygasza si\u0119 je sam\u0105 przezroczysto\u015Bci\u0105.\n -->\n <div class=\"kpt-auth__form-side\">\n <div class=\"kpt-auth__inner\" [attr.data-mode]=\"mode()\">\n <div class=\"kpt-auth__brand\"><ng-content select=\"[kptAuthBrand]\" /></div>\n\n <h2 #heading class=\"kpt-auth__title\" [id]=\"headingId()\" [attr.data-mode]=\"mode()\" tabindex=\"-1\">\n {{ title() }}\n </h2>\n <p class=\"kpt-auth__subtitle\">{{ subtitle() }}</p>\n\n @if (error()) {\n <kpt-alert variant=\"danger\">{{ error() }}</kpt-alert>\n }\n @if (notice()) {\n <kpt-alert variant=\"success\">{{ notice() }}</kpt-alert>\n }\n\n @switch (mode()) {\n @case ('signIn') {\n <form class=\"kpt-auth__form\" [formRoot]=\"signInForm\" (submit)=\"onSignIn()\" [attr.aria-labelledby]=\"ids.signIn\">\n <kpt-form-field [label]=\"i18n.t('auth.email')\" [error]=\"signInEmailError()\" required [controlId]=\"ids.email\">\n <kpt-input\n [formField]=\"signInForm.email\"\n type=\"email\"\n autocomplete=\"email\"\n [id]=\"ids.email\"\n [placeholder]=\"i18n.t('auth.emailPlaceholder')\"\n />\n </kpt-form-field>\n\n <kpt-form-field [label]=\"i18n.t('auth.password')\" [error]=\"signInPasswordError()\" required [controlId]=\"ids.password\">\n <kpt-password [formField]=\"signInForm.password\" autocomplete=\"current-password\" [id]=\"ids.password\" />\n </kpt-form-field>\n\n <ng-content select=\"[kptAuthFields]\" />\n\n <div class=\"kpt-auth__row\">\n @if (showRemember()) {\n <kpt-checkbox [formField]=\"signInForm.remember\" [label]=\"i18n.t('auth.remember')\" />\n } @else {\n <span></span>\n }\n <button type=\"button\" class=\"kpt-auth__link\" (click)=\"setMode('forgot')\">\n {{ i18n.t('auth.forgotLink') }}\n </button>\n </div>\n\n <kpt-button type=\"submit\" fullWidth [loading]=\"busy()\" [disabled]=\"signInInvalid()\">\n {{ i18n.t('auth.signInSubmit') }}\n </kpt-button>\n </form>\n }\n\n @case ('signUp') {\n <form class=\"kpt-auth__form\" [formRoot]=\"signUpForm\" (submit)=\"onSignUp()\" [attr.aria-labelledby]=\"ids.signUp\">\n @if (showName()) {\n <kpt-form-field [label]=\"i18n.t('auth.name')\" [error]=\"signUpNameError()\" required [controlId]=\"ids.name\">\n <kpt-input [formField]=\"signUpForm.name\" autocomplete=\"name\" [id]=\"ids.name\" />\n </kpt-form-field>\n }\n\n <kpt-form-field [label]=\"i18n.t('auth.email')\" [error]=\"signUpEmailError()\" required [controlId]=\"ids.regEmail\">\n <kpt-input\n [formField]=\"signUpForm.email\"\n type=\"email\"\n autocomplete=\"email\"\n [id]=\"ids.regEmail\"\n [placeholder]=\"i18n.t('auth.emailPlaceholder')\"\n />\n </kpt-form-field>\n\n <kpt-form-field\n [label]=\"i18n.t('auth.password')\"\n [error]=\"signUpPasswordError()\"\n [hint]=\"i18n.t('auth.passwordHint', { min: 8 })\"\n required\n [controlId]=\"ids.regPassword\"\n >\n <kpt-password [formField]=\"signUpForm.password\" autocomplete=\"new-password\" feedback [id]=\"ids.regPassword\" />\n </kpt-form-field>\n\n <kpt-form-field [label]=\"i18n.t('auth.confirmPassword')\" [error]=\"signUpConfirmError()\" required [controlId]=\"ids.regConfirm\">\n <kpt-password [formField]=\"signUpForm.confirm\" autocomplete=\"new-password\" [id]=\"ids.regConfirm\" />\n </kpt-form-field>\n\n <ng-content select=\"[kptAuthFields]\" />\n\n @if (requireTerms()) {\n <kpt-form-field [error]=\"signUpTermsError()\">\n <kpt-checkbox [formField]=\"signUpForm.terms\" [label]=\"i18n.t('auth.terms')\" />\n </kpt-form-field>\n }\n\n <kpt-button type=\"submit\" fullWidth [loading]=\"busy()\" [disabled]=\"signUpInvalid()\">\n {{ i18n.t('auth.signUpSubmit') }}\n </kpt-button>\n </form>\n }\n\n @case ('forgot') {\n <form class=\"kpt-auth__form\" [formRoot]=\"resetForm\" (submit)=\"onReset()\" [attr.aria-labelledby]=\"ids.forgot\">\n <kpt-form-field [label]=\"i18n.t('auth.email')\" [error]=\"resetEmailError()\" required [controlId]=\"ids.resetEmail\">\n <kpt-input\n [formField]=\"resetForm.email\"\n type=\"email\"\n autocomplete=\"email\"\n [id]=\"ids.resetEmail\"\n [placeholder]=\"i18n.t('auth.emailPlaceholder')\"\n />\n </kpt-form-field>\n\n <kpt-button type=\"submit\" fullWidth [loading]=\"busy()\" [disabled]=\"resetInvalid()\">\n {{ i18n.t('auth.resetSubmit') }}\n </kpt-button>\n <button type=\"button\" class=\"kpt-auth__link kpt-auth__link--center\" (click)=\"setMode('signIn')\">\n {{ i18n.t('auth.backToSignIn') }}\n </button>\n </form>\n }\n }\n\n @if (mode() !== 'forgot') {\n <div class=\"kpt-auth__sso\"><ng-content select=\"[kptAuthSso]\" /></div>\n\n @if (providers().length > 0) {\n <div class=\"kpt-auth__separator\" role=\"separator\" [attr.aria-label]=\"i18n.t('auth.orContinueWith')\">\n <span class=\"kpt-auth__separator-text\">{{ i18n.t('auth.orContinueWith') }}</span>\n </div>\n\n <div class=\"kpt-auth__providers\" [attr.data-layout]=\"providerLayout()\">\n @for (provider of providers(); track provider.id) {\n @if (templateFor(provider); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"providerContext(provider)\" />\n } @else {\n <button\n type=\"button\"\n class=\"kpt-auth__provider\"\n [disabled]=\"busy()\"\n [attr.aria-label]=\"i18n.t('auth.continueWith', { provider: provider.label })\"\n (click)=\"selectProvider(provider)\"\n >\n @if (provider.iconUrl) {\n <img class=\"kpt-auth__provider-logo\" [src]=\"provider.iconUrl\" alt=\"\" />\n } @else if (provider.icon) {\n <kpt-icon class=\"kpt-auth__provider-logo\" [name]=\"provider.icon\" />\n }\n <span class=\"kpt-auth__provider-label\">{{ provider.label }}</span>\n @if (provider.description && providerLayout() === 'list') {\n <span class=\"kpt-auth__provider-desc\">{{ provider.description }}</span>\n }\n </button>\n }\n }\n </div>\n }\n\n <p class=\"kpt-auth__switch\">\n {{ signUpActive() ? i18n.t('auth.haveAccount') : i18n.t('auth.noAccount') }}\n <button type=\"button\" class=\"kpt-auth__link\" (click)=\"setMode(signUpActive() ? 'signIn' : 'signUp')\">\n {{ signUpActive() ? i18n.t('auth.signInSwitch') : i18n.t('auth.signUpSwitch') }}\n </button>\n </p>\n }\n\n <div class=\"kpt-auth__footer\"><ng-content select=\"[kptAuthFooter]\" /></div>\n </div>\n </div>\n\n <aside class=\"kpt-auth__promo\">\n <div class=\"kpt-auth__promo-inner\">\n @if (promoHeading()) {\n <p class=\"kpt-auth__promo-title\">{{ promoHeading() }}</p>\n }\n @if (promoBody()) {\n <p class=\"kpt-auth__promo-text\">{{ promoBody() }}</p>\n }\n <ng-content select=\"[kptAuthPromo]\" />\n @if (mode() !== 'forgot') {\n <kpt-button class=\"kpt-auth__promo-cta\" variant=\"outline\" (click)=\"setMode(promoMode())\">\n {{ promoMode() === 'signUp' ? i18n.t('auth.signUpSwitch') : i18n.t('auth.signInSwitch') }}\n </kpt-button>\n }\n </div>\n </aside>\n </div>\n</div>\n", styles: ["@layer kpt.components{.kpt-auth-host{display:block;--_kpt-auth-duration: var(--kpt-anim-duration, var(--kpt-motion-duration-slow, .32s));--_kpt-auth-easing: var(--kpt-motion-easing-emphasized, cubic-bezier(.3, 0, 0, 1));--_kpt-auth-dir: 1}[dir=rtl] .kpt-auth-host{--_kpt-auth-dir: -1}.kpt-auth{display:flex;align-items:center;justify-content:center;min-block-size:var(--kpt-auth-min-height, 100vh);min-block-size:var(--kpt-auth-min-height, 100dvh);padding:var(--kpt-auth-padding, var(--kpt-space-4, 1rem));background:var(--kpt-color-surface)}.kpt-auth__card{position:relative;display:grid;inline-size:min(var(--kpt-auth-width, 64rem),100%);min-block-size:var(--kpt-auth-card-height, 34rem);overflow:hidden;background:var(--kpt-color-surface-raised);border:var(--kpt-auth-card-border, 1px solid var(--kpt-color-border));border-radius:var(--kpt-auth-card-radius, var(--kpt-radius-lg, .75rem));box-shadow:var(--kpt-auth-card-shadow, var(--kpt-elevation-3));grid-template-columns:1fr 1fr;grid-template-areas:\"form promo\"}.kpt-auth__form-side{grid-area:form;display:flex;align-items:center;justify-content:center;padding:var(--kpt-space-6, 1.5rem);overflow-y:auto}.kpt-auth__inner{inline-size:min(24rem,100%);display:flex;flex-direction:column;gap:var(--kpt-space-3, .75rem)}.kpt-auth__brand:empty,.kpt-auth__sso:empty,.kpt-auth__footer:empty{display:none}.kpt-auth__title{margin:0;font-size:var(--kpt-font-size-xl, 1.5rem);font-weight:var(--kpt-font-weight-bold, 700);color:var(--kpt-color-on-surface);outline:none}.kpt-auth__subtitle{margin:0;font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-color-on-surface-muted)}.kpt-auth__form{display:flex;flex-direction:column;gap:var(--kpt-space-3, .75rem);margin-block-start:var(--kpt-space-2, .5rem)}.kpt-auth__row{display:flex;align-items:center;justify-content:space-between;gap:var(--kpt-space-2, .5rem);flex-wrap:wrap}.kpt-auth__link{padding:0;font:inherit;font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-color-primary);background:none;border:0;text-decoration:underline;text-underline-offset:.15em;cursor:pointer}.kpt-auth__link:hover{color:var(--kpt-color-primary-hover)}.kpt-auth__link--center{align-self:center}.kpt-auth__separator{display:flex;align-items:center;gap:var(--kpt-space-3, .75rem);margin-block:var(--kpt-space-2, .5rem);font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-color-on-surface-muted)}.kpt-auth__separator:before,.kpt-auth__separator:after{content:\"\";flex:1;block-size:1px;background:var(--kpt-color-border)}.kpt-auth__providers{display:grid;gap:var(--kpt-space-2, .5rem)}.kpt-auth__providers[data-layout=grid]{grid-template-columns:repeat(auto-fit,minmax(4.5rem,1fr))}.kpt-auth__provider{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);padding:var(--kpt-space-3, .75rem);font:inherit;font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-color-on-surface);background:var(--kpt-color-surface-raised);border:1px solid var(--kpt-color-border);border-radius:var(--kpt-radius-md, .5rem);cursor:pointer;transition:background-color var(--kpt-motion-duration-fast, .12s) var(--kpt-motion-easing-standard)}.kpt-auth__provider:hover:not(:disabled){background:var(--kpt-color-surface-hover)}.kpt-auth__provider:disabled{opacity:.6;cursor:not-allowed}.kpt-auth__provider-logo{font-size:1.25rem;inline-size:1.25rem;block-size:1.25rem;flex-shrink:0}.kpt-auth__provider-desc{margin-inline-start:auto;font-size:var(--kpt-font-size-xs, .75rem);color:var(--kpt-color-on-surface-muted)}.kpt-auth__providers[data-layout=grid] .kpt-auth__provider{flex-direction:column;gap:var(--kpt-space-1, .25rem);text-align:center}.kpt-auth__switch{margin:0;font-size:var(--kpt-font-size-sm, .875rem);color:var(--kpt-color-on-surface-muted);text-align:center}.kpt-auth__promo{grid-area:promo;display:flex;align-items:center;justify-content:center;padding:var(--kpt-space-8, 2rem);color:var(--kpt-color-primary-contrast);background:var(--kpt-auth-promo-bg, linear-gradient(135deg, var(--kpt-color-primary), var(--kpt-color-primary-hover)))}.kpt-auth__promo-inner{display:flex;flex-direction:column;align-items:center;gap:var(--kpt-space-3, .75rem);text-align:center}.kpt-auth__promo-title{margin:0;font-size:var(--kpt-font-size-lg, 1.25rem);font-weight:var(--kpt-font-weight-bold, 700)}.kpt-auth__promo-text{margin:0;font-size:var(--kpt-font-size-sm, .875rem);opacity:.85}.kpt-auth__promo-cta .kpt-button{color:var(--kpt-color-primary-contrast);border-color:color-mix(in oklch,var(--kpt-color-primary-contrast) 60%,transparent);background:transparent}.kpt-auth__promo-cta .kpt-button:hover:not(:disabled){background:color-mix(in oklch,var(--kpt-color-primary-contrast) 12%,transparent)}.kpt-auth-host[data-layout=slider] .kpt-auth__promo,.kpt-auth-host[data-layout=slider] .kpt-auth__form-side{transition:transform var(--_kpt-auth-duration) var(--_kpt-auth-easing)}.kpt-auth-host[data-layout=slider][data-mode=signUp] .kpt-auth__promo{transform:translate(calc(var(--_kpt-auth-dir) * -100%))}.kpt-auth-host[data-layout=slider][data-mode=signUp] .kpt-auth__form-side{transform:translate(calc(var(--_kpt-auth-dir) * 100%))}.kpt-auth-host[data-layout=slider][data-mode=signIn] .kpt-auth__promo-inner{animation:kpt-auth-promo-start var(--_kpt-auth-duration) var(--_kpt-auth-easing)}.kpt-auth-host[data-layout=slider][data-mode=signUp] .kpt-auth__promo-inner{animation:kpt-auth-promo-end var(--_kpt-auth-duration) var(--_kpt-auth-easing)}@keyframes kpt-auth-promo-start{0%{transform:translate(calc(var(--_kpt-auth-dir) * -14%))}to{transform:none}}@keyframes kpt-auth-promo-end{0%{transform:translate(calc(var(--_kpt-auth-dir) * 14%))}to{transform:none}}@keyframes kpt-auth-enter{0%{opacity:0;transform:translate(calc(var(--_kpt-auth-dir) * 1.25rem))}to{opacity:1;transform:none}}.kpt-auth__inner{animation:kpt-auth-enter var(--_kpt-auth-duration) var(--kpt-motion-easing-standard, cubic-bezier(.2, 0, 0, 1))}.kpt-auth__card{grid-template-columns:1fr;grid-template-areas:\"promo\" \"form\";min-block-size:0}.kpt-auth__promo{padding:var(--kpt-space-6, 1.5rem)}@media(min-width:768px){.kpt-auth__card{grid-template-columns:1fr 1fr;grid-template-areas:\"form promo\";min-block-size:var(--kpt-auth-card-height, 34rem)}.kpt-auth__promo{padding:var(--kpt-space-8, 2rem)}}@media(max-width:767px){.kpt-auth-host[data-layout=slider][data-mode] .kpt-auth__promo,.kpt-auth-host[data-layout=slider][data-mode] .kpt-auth__form-side{transform:none}.kpt-auth-host[data-layout=slider][data-mode] .kpt-auth__promo-inner{animation:none;transform:none}}@media(prefers-reduced-motion:reduce){.kpt-auth-host[data-layout][data-mode] .kpt-auth__promo,.kpt-auth-host[data-layout][data-mode] .kpt-auth__form-side,.kpt-auth-host[data-layout][data-mode] .kpt-auth__promo-inner,.kpt-auth-host[data-layout][data-mode] .kpt-auth__provider{transition:none}.kpt-auth-host[data-layout][data-mode] .kpt-auth__inner,.kpt-auth-host[data-layout][data-mode] .kpt-auth__promo-inner{animation:none}}}\n"] }]
|
|
8936
|
+
}], null, { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }, { type: i0.Output, args: ["modeChange"] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], providers: [{ type: i0.Input, args: [{ isSignal: true, alias: "providers", required: false }] }], providerLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "providerLayout", required: false }] }], showName: [{ type: i0.Input, args: [{ isSignal: true, alias: "showName", required: false }] }], requireTerms: [{ type: i0.Input, args: [{ isSignal: true, alias: "requireTerms", required: false }] }], showRemember: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRemember", required: false }] }], busy: [{ type: i0.Input, args: [{ isSignal: true, alias: "busy", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], notice: [{ type: i0.Input, args: [{ isSignal: true, alias: "notice", required: false }] }], promoTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "promoTitle", required: false }] }], promoText: [{ type: i0.Input, args: [{ isSignal: true, alias: "promoText", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: false }] }], signIn: [{ type: i0.Output, args: ["signIn"] }], signUp: [{ type: i0.Output, args: ["signUp"] }], resetPassword: [{ type: i0.Output, args: ["resetPassword"] }], providerSelect: [{ type: i0.Output, args: ["providerSelect"] }], headings: [{ type: i0.ViewChildren, args: ['heading', { isSignal: true }] }], providerDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KptAuthProviderDef), { isSignal: true }] }] }); })();
|
|
8937
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptAuth, { className: "KptAuth", filePath: "lib/auth/auth.component.ts", lineNumber: 94 }); })();
|
|
8938
|
+
|
|
8939
|
+
const _c0$m = [[["", "kptPanelActions", ""]], "*"];
|
|
8940
|
+
const _c1$7 = ["[kptPanelActions]", "*"];
|
|
8941
|
+
function KptPanel_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
8942
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
8943
|
+
i0.ɵɵelementStart(0, "button", 8);
|
|
8944
|
+
i0.ɵɵlistener("click", function KptPanel_Conditional_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.collapsed.set(!ctx_r1.collapsed())); });
|
|
8945
|
+
i0.ɵɵelement(1, "kpt-icon", 9);
|
|
8946
|
+
i0.ɵɵelementEnd();
|
|
8947
|
+
} if (rf & 2) {
|
|
8948
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
8949
|
+
i0.ɵɵattribute("aria-expanded", !ctx_r1.collapsed())("aria-label", ctx_r1.i18n.t("panel.toggle"));
|
|
8950
|
+
i0.ɵɵadvance();
|
|
8951
|
+
i0.ɵɵproperty("name", ctx_r1.collapsed() ? "chevron-down" : "chevron-up");
|
|
8952
|
+
} }
|
|
8953
|
+
/**
|
|
8954
|
+
* Panel z nagłówkiem i opcjonalnym zwijaniem. Akcje nagłówka: atrybut `kptPanelActions`.
|
|
8955
|
+
*
|
|
8956
|
+
* @example
|
|
8957
|
+
* <kpt-panel header="Ustawienia" toggleable>Treść…</kpt-panel>
|
|
8958
|
+
*/
|
|
8959
|
+
class KptPanel {
|
|
8960
|
+
constructor() {
|
|
8961
|
+
this.header = input('', /* @ts-ignore */
|
|
8962
|
+
...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
8963
|
+
this.toggleable = input(false, { ...(ngDevMode ? { debugName: "toggleable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8964
|
+
this.collapsed = model(false, /* @ts-ignore */
|
|
8965
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
8966
|
+
this.animated = input(true, { ...(ngDevMode ? { debugName: "animated" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8967
|
+
this.animationDuration = input(500, /* @ts-ignore */
|
|
8968
|
+
...(ngDevMode ? [{ debugName: "animationDuration" }] : /* istanbul ignore next */ []));
|
|
8969
|
+
this.i18n = inject(KptI18n);
|
|
8970
|
+
}
|
|
8971
|
+
static { this.ɵfac = function KptPanel_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptPanel)(); }; }
|
|
8972
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptPanel, selectors: [["kpt-panel"]], hostAttrs: [1, "kpt-panel-host"], hostVars: 2, hostBindings: function KptPanel_HostBindings(rf, ctx) { if (rf & 2) {
|
|
8973
|
+
i0.ɵɵstyleProp("--%NS%kpt-anim-duration", (ctx.animated() ? ctx.animationDuration() : 0) + "ms");
|
|
7848
8974
|
} }, inputs: { header: [1, "header"], toggleable: [1, "toggleable"], collapsed: [1, "collapsed"], animated: [1, "animated"], animationDuration: [1, "animationDuration"] }, outputs: { collapsed: "collapsedChange" }, ngContentSelectors: _c1$7, decls: 11, vars: 6, consts: [[1, "kpt-panel"], [1, "kpt-panel__header"], [1, "kpt-panel__title"], [1, "kpt-panel__actions"], ["type", "button", 1, "kpt-panel__toggle"], [1, "kpt-panel__collapse"], [1, "kpt-panel__collapse-inner"], [1, "kpt-panel__body"], ["type", "button", 1, "kpt-panel__toggle", 3, "click"], [3, "name"]], template: function KptPanel_Template(rf, ctx) { if (rf & 1) {
|
|
7849
|
-
i0.ɵɵprojectionDef(_c0$
|
|
8975
|
+
i0.ɵɵprojectionDef(_c0$m);
|
|
7850
8976
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "span", 2);
|
|
7851
8977
|
i0.ɵɵtext(3);
|
|
7852
8978
|
i0.ɵɵelementEnd();
|
|
@@ -7899,7 +9025,7 @@ class KptPanel {
|
|
|
7899
9025
|
}], null, { header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], toggleable: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleable", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: false }] }] }); })();
|
|
7900
9026
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptPanel, { className: "KptPanel", filePath: "lib/panel/panel.component.ts", lineNumber: 45 }); })();
|
|
7901
9027
|
|
|
7902
|
-
const _c0$
|
|
9028
|
+
const _c0$l = ["*"];
|
|
7903
9029
|
function KptFieldset_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
7904
9030
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
7905
9031
|
i0.ɵɵelementStart(0, "button", 6);
|
|
@@ -7945,7 +9071,7 @@ class KptFieldset {
|
|
|
7945
9071
|
static { this.ɵfac = function KptFieldset_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptFieldset)(); }; }
|
|
7946
9072
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptFieldset, selectors: [["kpt-fieldset"]], hostAttrs: [1, "kpt-fieldset-host"], hostVars: 2, hostBindings: function KptFieldset_HostBindings(rf, ctx) { if (rf & 2) {
|
|
7947
9073
|
i0.ɵɵstyleProp("--%NS%kpt-anim-duration", (ctx.animated() ? ctx.animationDuration() : 0) + "ms");
|
|
7948
|
-
} }, inputs: { legend: [1, "legend"], toggleable: [1, "toggleable"], collapsed: [1, "collapsed"], animated: [1, "animated"], animationDuration: [1, "animationDuration"] }, outputs: { collapsed: "collapsedChange" }, ngContentSelectors: _c0$
|
|
9074
|
+
} }, inputs: { legend: [1, "legend"], toggleable: [1, "toggleable"], collapsed: [1, "collapsed"], animated: [1, "animated"], animationDuration: [1, "animationDuration"] }, outputs: { collapsed: "collapsedChange" }, ngContentSelectors: _c0$l, decls: 8, vars: 5, consts: [[1, "kpt-fieldset"], [1, "kpt-fieldset__legend"], ["type", "button", 1, "kpt-fieldset__toggle"], [1, "kpt-fieldset__collapse"], [1, "kpt-fieldset__collapse-inner"], [1, "kpt-fieldset__body"], ["type", "button", 1, "kpt-fieldset__toggle", 3, "click"], [3, "name"]], template: function KptFieldset_Template(rf, ctx) { if (rf & 1) {
|
|
7949
9075
|
i0.ɵɵprojectionDef();
|
|
7950
9076
|
i0.ɵɵelementStart(0, "fieldset", 0)(1, "legend", 1);
|
|
7951
9077
|
i0.ɵɵconditionalCreate(2, KptFieldset_Conditional_2_Template, 4, 3, "button", 2)(3, KptFieldset_Conditional_3_Template, 2, 1, "span");
|
|
@@ -7993,7 +9119,7 @@ class KptFieldset {
|
|
|
7993
9119
|
}], null, { legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: false }] }], toggleable: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleable", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: false }] }] }); })();
|
|
7994
9120
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptFieldset, { className: "KptFieldset", filePath: "lib/fieldset/fieldset.component.ts", lineNumber: 45 }); })();
|
|
7995
9121
|
|
|
7996
|
-
const _c0$
|
|
9122
|
+
const _c0$k = [[["", "kptSplitStart", ""]], [["", "kptSplitEnd", ""]]];
|
|
7997
9123
|
const _c1$6 = ["[kptSplitStart]", "[kptSplitEnd]"];
|
|
7998
9124
|
/**
|
|
7999
9125
|
* Splitter — dwa panele z przeciąganym uchwytem. Panele przez sloty `[kptSplitStart]` i `[kptSplitEnd]`.
|
|
@@ -8048,7 +9174,7 @@ class KptSplitter {
|
|
|
8048
9174
|
}
|
|
8049
9175
|
static { this.ɵfac = function KptSplitter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptSplitter)(); }; }
|
|
8050
9176
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSplitter, selectors: [["kpt-splitter"]], hostAttrs: [1, "kpt-splitter-host"], inputs: { orientation: [1, "orientation"], startSize: [1, "startSize"], minSize: [1, "minSize"] }, outputs: { startSize: "startSizeChange" }, ngContentSelectors: _c1$6, decls: 6, vars: 7, consts: [[1, "kpt-splitter"], [1, "kpt-splitter__pane"], ["role", "separator", "tabindex", "0", 1, "kpt-splitter__gutter", 3, "pointerdown", "keydown"]], template: function KptSplitter_Template(rf, ctx) { if (rf & 1) {
|
|
8051
|
-
i0.ɵɵprojectionDef(_c0$
|
|
9177
|
+
i0.ɵɵprojectionDef(_c0$k);
|
|
8052
9178
|
i0.ɵɵdomElementStart(0, "div", 0)(1, "div", 1);
|
|
8053
9179
|
i0.ɵɵprojection(2);
|
|
8054
9180
|
i0.ɵɵdomElementEnd();
|
|
@@ -8420,7 +9546,7 @@ class KptAvatarGroup {
|
|
|
8420
9546
|
}], null, { avatars: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatars", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] }); })();
|
|
8421
9547
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptAvatarGroup, { className: "KptAvatarGroup", filePath: "lib/avatar-group/avatar-group.component.ts", lineNumber: 36 }); })();
|
|
8422
9548
|
|
|
8423
|
-
const _c0$
|
|
9549
|
+
const _c0$j = ["*"];
|
|
8424
9550
|
function KptEmpty_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
8425
9551
|
i0.ɵɵelementStart(0, "div", 1);
|
|
8426
9552
|
i0.ɵɵelement(1, "kpt-icon", 5);
|
|
@@ -8466,7 +9592,7 @@ class KptEmpty {
|
|
|
8466
9592
|
...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
8467
9593
|
}
|
|
8468
9594
|
static { this.ɵfac = function KptEmpty_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptEmpty)(); }; }
|
|
8469
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptEmpty, selectors: [["kpt-empty"]], hostAttrs: [1, "kpt-empty-host"], inputs: { icon: [1, "icon"], title: [1, "title"], description: [1, "description"] }, ngContentSelectors: _c0$
|
|
9595
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptEmpty, selectors: [["kpt-empty"]], hostAttrs: [1, "kpt-empty-host"], inputs: { icon: [1, "icon"], title: [1, "title"], description: [1, "description"] }, ngContentSelectors: _c0$j, decls: 6, vars: 3, consts: [[1, "kpt-empty"], [1, "kpt-empty__icon"], [1, "kpt-empty__title"], [1, "kpt-empty__desc"], [1, "kpt-empty__actions"], [3, "name"]], template: function KptEmpty_Template(rf, ctx) { if (rf & 1) {
|
|
8470
9596
|
i0.ɵɵprojectionDef();
|
|
8471
9597
|
i0.ɵɵelementStart(0, "div", 0);
|
|
8472
9598
|
i0.ɵɵconditionalCreate(1, KptEmpty_Conditional_1_Template, 2, 1, "div", 1);
|
|
@@ -8497,7 +9623,7 @@ class KptEmpty {
|
|
|
8497
9623
|
}], null, { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }] }); })();
|
|
8498
9624
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptEmpty, { className: "KptEmpty", filePath: "lib/empty/empty.component.ts", lineNumber: 28 }); })();
|
|
8499
9625
|
|
|
8500
|
-
const _c0$
|
|
9626
|
+
const _c0$i = ["*"];
|
|
8501
9627
|
function KptTab_ng_template_0_Template(rf, ctx) { if (rf & 1) {
|
|
8502
9628
|
i0.ɵɵprojection(0);
|
|
8503
9629
|
} }
|
|
@@ -8520,7 +9646,7 @@ class KptTab {
|
|
|
8520
9646
|
i0.ɵɵviewQuerySignal(ctx.content, TemplateRef, 5);
|
|
8521
9647
|
} if (rf & 2) {
|
|
8522
9648
|
i0.ɵɵqueryAdvance();
|
|
8523
|
-
} }, inputs: { label: [1, "label"], disabled: [1, "disabled"] }, ngContentSelectors: _c0$
|
|
9649
|
+
} }, inputs: { label: [1, "label"], disabled: [1, "disabled"] }, ngContentSelectors: _c0$i, decls: 1, vars: 0, template: function KptTab_Template(rf, ctx) { if (rf & 1) {
|
|
8524
9650
|
i0.ɵɵprojectionDef();
|
|
8525
9651
|
i0.ɵɵdomTemplate(0, KptTab_ng_template_0_Template, 1, 0, "ng-template");
|
|
8526
9652
|
} }, encapsulation: 2 }); }
|
|
@@ -8535,7 +9661,7 @@ class KptTab {
|
|
|
8535
9661
|
}], null, { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], content: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] }); })();
|
|
8536
9662
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptTab, { className: "KptTab", filePath: "lib/tabs/tab.component.ts", lineNumber: 14 }); })();
|
|
8537
9663
|
|
|
8538
|
-
const _c0$
|
|
9664
|
+
const _c0$h = ["tabBtn"];
|
|
8539
9665
|
function _forTrack0$3($index, $item) { /* @ts-ignore */
|
|
8540
9666
|
return this.activeIndex(); }
|
|
8541
9667
|
function KptTabs_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -8617,7 +9743,7 @@ class KptTabs {
|
|
|
8617
9743
|
} if (rf & 2) {
|
|
8618
9744
|
i0.ɵɵqueryAdvance();
|
|
8619
9745
|
} }, viewQuery: function KptTabs_Query(rf, ctx) { if (rf & 1) {
|
|
8620
|
-
i0.ɵɵviewQuerySignal(ctx.tabBtns, _c0$
|
|
9746
|
+
i0.ɵɵviewQuerySignal(ctx.tabBtns, _c0$h, 5);
|
|
8621
9747
|
} if (rf & 2) {
|
|
8622
9748
|
i0.ɵɵqueryAdvance();
|
|
8623
9749
|
} }, hostAttrs: [1, "kpt-tabs-host"], hostVars: 4, hostBindings: function KptTabs_HostBindings(rf, ctx) { if (rf & 1) {
|
|
@@ -8673,7 +9799,7 @@ class KptTabs {
|
|
|
8673
9799
|
}], () => [], { tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KptTab), { isSignal: true }] }], activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }, { type: i0.Output, args: ["activeIndexChange"] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: false }] }], tabBtns: [{ type: i0.ViewChildren, args: ['tabBtn', { isSignal: true }] }] }); })();
|
|
8674
9800
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptTabs, { className: "KptTabs", filePath: "lib/tabs/tabs.component.ts", lineNumber: 62 }); })();
|
|
8675
9801
|
|
|
8676
|
-
const _c0$
|
|
9802
|
+
const _c0$g = ["*"];
|
|
8677
9803
|
/**
|
|
8678
9804
|
* Panel akordeonu. Umieszczaj w `kpt-accordion`. Stan `expanded` jest dwukierunkowy.
|
|
8679
9805
|
*/
|
|
@@ -8703,7 +9829,7 @@ class KptAccordionPanel {
|
|
|
8703
9829
|
static { this.ɵfac = function KptAccordionPanel_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptAccordionPanel)(); }; }
|
|
8704
9830
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptAccordionPanel, selectors: [["kpt-accordion-panel"]], hostAttrs: [1, "kpt-accordion-panel-host"], hostVars: 2, hostBindings: function KptAccordionPanel_HostBindings(rf, ctx) { if (rf & 2) {
|
|
8705
9831
|
i0.ɵɵstyleProp("--%NS%kpt-anim-duration", ctx.animMs());
|
|
8706
|
-
} }, inputs: { title: [1, "title"], disabled: [1, "disabled"], expanded: [1, "expanded"] }, outputs: { expanded: "expandedChange" }, ngContentSelectors: _c0$
|
|
9832
|
+
} }, inputs: { title: [1, "title"], disabled: [1, "disabled"], expanded: [1, "expanded"] }, outputs: { expanded: "expandedChange" }, ngContentSelectors: _c0$g, decls: 9, vars: 11, consts: [[1, "kpt-accordion-panel"], ["type", "button", 1, "kpt-accordion-panel__header", 3, "click", "disabled"], [1, "kpt-accordion-panel__title"], ["name", "chevron-down", 1, "kpt-accordion-panel__chevron"], [1, "kpt-accordion-panel__collapse"], [1, "kpt-accordion-panel__collapse-inner"], [1, "kpt-accordion-panel__body"]], template: function KptAccordionPanel_Template(rf, ctx) { if (rf & 1) {
|
|
8707
9833
|
i0.ɵɵprojectionDef();
|
|
8708
9834
|
i0.ɵɵelementStart(0, "div", 0)(1, "button", 1);
|
|
8709
9835
|
i0.ɵɵlistener("click", function KptAccordionPanel_Template_button_click_1_listener() { return ctx.toggle(); });
|
|
@@ -8761,7 +9887,7 @@ class KptAccordionPanel {
|
|
|
8761
9887
|
}], null, { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }] }); })();
|
|
8762
9888
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptAccordionPanel, { className: "KptAccordionPanel", filePath: "lib/accordion/accordion-panel.component.ts", lineNumber: 52 }); })();
|
|
8763
9889
|
|
|
8764
|
-
const _c0$
|
|
9890
|
+
const _c0$f = ["*"];
|
|
8765
9891
|
/**
|
|
8766
9892
|
* Akordeon — grupa rozwijanych paneli. `multi` pozwala otworzyć wiele naraz.
|
|
8767
9893
|
*
|
|
@@ -8794,7 +9920,7 @@ class KptAccordion {
|
|
|
8794
9920
|
i0.ɵɵcontentQuerySignal(dirIndex, ctx.panels, KptAccordionPanel, 4);
|
|
8795
9921
|
} if (rf & 2) {
|
|
8796
9922
|
i0.ɵɵqueryAdvance();
|
|
8797
|
-
} }, hostAttrs: [1, "kpt-accordion-host"], inputs: { multi: [1, "multi"], animated: [1, "animated"], animationDuration: [1, "animationDuration"] }, ngContentSelectors: _c0$
|
|
9923
|
+
} }, hostAttrs: [1, "kpt-accordion-host"], inputs: { multi: [1, "multi"], animated: [1, "animated"], animationDuration: [1, "animationDuration"] }, ngContentSelectors: _c0$f, decls: 1, vars: 0, template: function KptAccordion_Template(rf, ctx) { if (rf & 1) {
|
|
8798
9924
|
i0.ɵɵprojectionDef();
|
|
8799
9925
|
i0.ɵɵprojection(0);
|
|
8800
9926
|
} }, styles: ["@layer kpt.components{.kpt-accordion-host{display:block;border:var(--%NS%kpt-border-width-thin, 1px) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-lg, .75rem);overflow:hidden}}\n"], encapsulation: 2 }); }
|
|
@@ -8884,7 +10010,7 @@ class KptBreadcrumb {
|
|
|
8884
10010
|
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }] }); })();
|
|
8885
10011
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptBreadcrumb, { className: "KptBreadcrumb", filePath: "lib/breadcrumb/breadcrumb.component.ts", lineNumber: 38 }); })();
|
|
8886
10012
|
|
|
8887
|
-
const _c0$
|
|
10013
|
+
const _c0$e = ["*"];
|
|
8888
10014
|
function KptStep_ng_template_0_Template(rf, ctx) { if (rf & 1) {
|
|
8889
10015
|
i0.ɵɵprojection(0);
|
|
8890
10016
|
} }
|
|
@@ -8906,7 +10032,7 @@ class KptStep {
|
|
|
8906
10032
|
i0.ɵɵviewQuerySignal(ctx.content, TemplateRef, 5);
|
|
8907
10033
|
} if (rf & 2) {
|
|
8908
10034
|
i0.ɵɵqueryAdvance();
|
|
8909
|
-
} }, inputs: { label: [1, "label"] }, ngContentSelectors: _c0$
|
|
10035
|
+
} }, inputs: { label: [1, "label"] }, ngContentSelectors: _c0$e, decls: 1, vars: 0, template: function KptStep_Template(rf, ctx) { if (rf & 1) {
|
|
8910
10036
|
i0.ɵɵprojectionDef();
|
|
8911
10037
|
i0.ɵɵdomTemplate(0, KptStep_ng_template_0_Template, 1, 0, "ng-template");
|
|
8912
10038
|
} }, encapsulation: 2 }); }
|
|
@@ -9224,62 +10350,35 @@ class KptCellEditDef {
|
|
|
9224
10350
|
}], null, { kptCellEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptCellEdit", required: true }] }] }); })();
|
|
9225
10351
|
|
|
9226
10352
|
/*
|
|
9227
|
-
*
|
|
9228
|
-
* testować `node --test` bez ciągnięcia Angulara.
|
|
10353
|
+
* Zamiana wartości komórki na tekst dla filtrowania, sortowania i podsumowań — pure TS,
|
|
10354
|
+
* wydzielone żeby dało się testować `node --test` bez ciągnięcia Angulara (jak `csv-export.ts`).
|
|
9229
10355
|
*/
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
10356
|
+
/**
|
|
10357
|
+
* Tekst z dowolnej wartości komórki. Prymitywy, `Date` i tablice zachowują się jak `String()`,
|
|
10358
|
+
* natomiast zwykły obiekt daje **pusty string**, nie `'[object Object]'`: ten drugi udawałby
|
|
10359
|
+
* sensowną zawartość — filtr tekstowy „obj" dopasowywałby każdy wiersz z obiektem w komórce,
|
|
10360
|
+
* a sortowanie uznawało je wszystkie za równe.
|
|
10361
|
+
*/
|
|
10362
|
+
function toText(value) {
|
|
9233
10363
|
switch (typeof value) {
|
|
9234
|
-
case 'undefined':
|
|
9235
|
-
return '';
|
|
9236
10364
|
case 'string':
|
|
9237
10365
|
return value;
|
|
9238
10366
|
case 'number':
|
|
9239
10367
|
case 'boolean':
|
|
9240
10368
|
case 'bigint':
|
|
9241
10369
|
return String(value);
|
|
9242
|
-
|
|
10370
|
+
case 'object':
|
|
9243
10371
|
if (value === null)
|
|
9244
10372
|
return '';
|
|
9245
10373
|
if (value instanceof Date)
|
|
9246
|
-
return value.
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
let text = stringifyCsvValue(value);
|
|
9253
|
-
// Wiodący `'` każe arkuszowi traktować komórkę jako tekst — sam znak nie jest wyświetlany.
|
|
9254
|
-
if (FORMULA_PREFIX.test(text))
|
|
9255
|
-
text = `'${text}`;
|
|
9256
|
-
return /[",\n;]/.test(text) ? `"${text.replaceAll('"', '""')}"` : text;
|
|
9257
|
-
}
|
|
9258
|
-
|
|
9259
|
-
/**
|
|
9260
|
-
* Szablon rozwijanego wiersza (row detail) dla `kpt-data-table`. Renderowany pod
|
|
9261
|
-
* wierszem po rozwinięciu. Kontekst: `$implicit` = wiersz. Wymaga `expandable`.
|
|
9262
|
-
*
|
|
9263
|
-
* @example
|
|
9264
|
-
* <kpt-data-table [columns]="cols" [data]="rows" expandable>
|
|
9265
|
-
* <ng-template kptRowDetail let-row>
|
|
9266
|
-
* <div class="szczegoly">{{ row.opis }}</div>
|
|
9267
|
-
* </ng-template>
|
|
9268
|
-
* </kpt-data-table>
|
|
9269
|
-
*/
|
|
9270
|
-
class KptRowDetailDef {
|
|
9271
|
-
constructor() {
|
|
9272
|
-
this.template = inject(TemplateRef);
|
|
10374
|
+
return value.toString();
|
|
10375
|
+
if (Array.isArray(value))
|
|
10376
|
+
return value.map(toText).join(',');
|
|
10377
|
+
return '';
|
|
10378
|
+
default:
|
|
10379
|
+
return '';
|
|
9273
10380
|
}
|
|
9274
|
-
static { this.ɵfac = function KptRowDetailDef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptRowDetailDef)(); }; }
|
|
9275
|
-
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: KptRowDetailDef, selectors: [["ng-template", "kptRowDetail", ""]] }); }
|
|
9276
10381
|
}
|
|
9277
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptRowDetailDef, [{
|
|
9278
|
-
type: Directive,
|
|
9279
|
-
args: [{
|
|
9280
|
-
selector: 'ng-template[kptRowDetail]',
|
|
9281
|
-
}]
|
|
9282
|
-
}], null, null); })();
|
|
9283
10382
|
|
|
9284
10383
|
/*
|
|
9285
10384
|
* Agregacje wiersza podsumowania (`<tfoot>`) — pure TS, wydzielone żeby dało się
|
|
@@ -9297,8 +10396,8 @@ function toNumber(value) {
|
|
|
9297
10396
|
if (typeof value === 'number')
|
|
9298
10397
|
return value;
|
|
9299
10398
|
if (typeof value === 'string' && value.trim() !== '')
|
|
9300
|
-
return parseFloat(value);
|
|
9301
|
-
return NaN;
|
|
10399
|
+
return Number.parseFloat(value);
|
|
10400
|
+
return Number.NaN;
|
|
9302
10401
|
}
|
|
9303
10402
|
/**
|
|
9304
10403
|
* Agreguje jedno pole po wierszach. `count` liczy wiersze; pozostałe funkcje pomijają
|
|
@@ -9328,7 +10427,138 @@ function aggregate(rows, field, fn) {
|
|
|
9328
10427
|
}
|
|
9329
10428
|
}
|
|
9330
10429
|
|
|
9331
|
-
|
|
10430
|
+
/*
|
|
10431
|
+
* Dopasowanie wiersza do filtrów kolumn tabeli — pure TS, wydzielone żeby dało się
|
|
10432
|
+
* testować `node --test` bez ciągnięcia Angulara (jak `csv-export.ts` i `summary.ts`).
|
|
10433
|
+
* Komponent trzyma tylko stan filtrów; cała semantyka „czy komórka pasuje" jest tutaj.
|
|
10434
|
+
*/
|
|
10435
|
+
/** Data komórki w formacie `YYYY-MM-DD` — do porównań leksykograficznych z granicami zakresu. */
|
|
10436
|
+
function toIsoDate(value) {
|
|
10437
|
+
if (value instanceof Date) {
|
|
10438
|
+
const p = (n) => String(n).padStart(2, '0');
|
|
10439
|
+
return `${value.getFullYear()}-${p(value.getMonth() + 1)}-${p(value.getDate())}`;
|
|
10440
|
+
}
|
|
10441
|
+
return toText(value);
|
|
10442
|
+
}
|
|
10443
|
+
/** Filtr „pusty" (nie wybrano nic) przepuszcza każdy wiersz. */
|
|
10444
|
+
function isEmptyFilterValue(value) {
|
|
10445
|
+
return value == null || value === '' || (Array.isArray(value) && value.length === 0);
|
|
10446
|
+
}
|
|
10447
|
+
const matchesText = (cell, value) => toText(cell).toLowerCase().includes(toText(value).toLowerCase());
|
|
10448
|
+
const matchesNumber = (cell, value) => toText(cell).includes(toText(value));
|
|
10449
|
+
const matchesSelect = (cell, value) => {
|
|
10450
|
+
const picked = Array.isArray(value) ? value : [value];
|
|
10451
|
+
// Komórka-tablica (np. lista tagów/członków) → dopasuj, gdy zawiera dowolną z wybranych wartości.
|
|
10452
|
+
if (Array.isArray(cell))
|
|
10453
|
+
return cell.some((c) => picked.includes(c));
|
|
10454
|
+
return picked.includes(cell);
|
|
10455
|
+
};
|
|
10456
|
+
const matchesNumberRange = (cell, value) => {
|
|
10457
|
+
const { min, max } = value ?? {};
|
|
10458
|
+
const lo = min == null || min === '' ? null : Number.parseFloat(min);
|
|
10459
|
+
const hi = max == null || max === '' ? null : Number.parseFloat(max);
|
|
10460
|
+
if (lo === null && hi === null)
|
|
10461
|
+
return true;
|
|
10462
|
+
const num = toNumber(cell);
|
|
10463
|
+
if (Number.isNaN(num))
|
|
10464
|
+
return false;
|
|
10465
|
+
if (lo !== null && num < lo)
|
|
10466
|
+
return false;
|
|
10467
|
+
if (hi !== null && num > hi)
|
|
10468
|
+
return false;
|
|
10469
|
+
return true;
|
|
10470
|
+
};
|
|
10471
|
+
const matchesSlider = (cell, value) => {
|
|
10472
|
+
const [lo, hi] = value;
|
|
10473
|
+
const num = toNumber(cell);
|
|
10474
|
+
if (Number.isNaN(num))
|
|
10475
|
+
return false;
|
|
10476
|
+
return num >= lo && num <= hi;
|
|
10477
|
+
};
|
|
10478
|
+
const matchesDateRange = (cell, value) => {
|
|
10479
|
+
const { start, end } = value ?? {};
|
|
10480
|
+
if (!start && !end)
|
|
10481
|
+
return true;
|
|
10482
|
+
const iso = toIsoDate(cell);
|
|
10483
|
+
if (start && iso < start)
|
|
10484
|
+
return false;
|
|
10485
|
+
if (end && iso > end)
|
|
10486
|
+
return false;
|
|
10487
|
+
return true;
|
|
10488
|
+
};
|
|
10489
|
+
/** Mapa zamiast `switch` — `Record` po unii typów wymusza komplet, więc nie ma martwego `default`. */
|
|
10490
|
+
const MATCHERS = {
|
|
10491
|
+
text: matchesText,
|
|
10492
|
+
number: matchesNumber,
|
|
10493
|
+
select: matchesSelect,
|
|
10494
|
+
numberRange: matchesNumberRange,
|
|
10495
|
+
slider: matchesSlider,
|
|
10496
|
+
dateRange: matchesDateRange,
|
|
10497
|
+
};
|
|
10498
|
+
/** Czy komórka przechodzi filtr kolumny. Wartości pustych filtrów odsiewa `isEmptyFilterValue`. */
|
|
10499
|
+
function matchesColumnFilter(filter, cell, value) {
|
|
10500
|
+
return MATCHERS[filter.type](cell, value);
|
|
10501
|
+
}
|
|
10502
|
+
|
|
10503
|
+
/*
|
|
10504
|
+
* Escapowanie komórek CSV dla `exportCsv()` — pure TS, wydzielone żeby dało się
|
|
10505
|
+
* testować `node --test` bez ciągnięcia Angulara.
|
|
10506
|
+
*/
|
|
10507
|
+
// Znak startowy, który arkusz kalkulacyjny czyta jako początek formuły (CWE-1236).
|
|
10508
|
+
const FORMULA_PREFIX = /^[=+\-@\t\r]/;
|
|
10509
|
+
function stringifyCsvValue(value) {
|
|
10510
|
+
switch (typeof value) {
|
|
10511
|
+
case 'undefined':
|
|
10512
|
+
return '';
|
|
10513
|
+
case 'string':
|
|
10514
|
+
return value;
|
|
10515
|
+
case 'number':
|
|
10516
|
+
case 'boolean':
|
|
10517
|
+
case 'bigint':
|
|
10518
|
+
return String(value);
|
|
10519
|
+
default:
|
|
10520
|
+
if (value === null)
|
|
10521
|
+
return '';
|
|
10522
|
+
if (value instanceof Date)
|
|
10523
|
+
return value.toISOString();
|
|
10524
|
+
return JSON.stringify(value);
|
|
10525
|
+
}
|
|
10526
|
+
}
|
|
10527
|
+
/** Escapuje pojedynczą wartość komórki/nagłówka do bezpiecznego pola CSV (separator `;`). */
|
|
10528
|
+
function escapeCsvCell(value) {
|
|
10529
|
+
let text = stringifyCsvValue(value);
|
|
10530
|
+
// Wiodący `'` każe arkuszowi traktować komórkę jako tekst — sam znak nie jest wyświetlany.
|
|
10531
|
+
if (FORMULA_PREFIX.test(text))
|
|
10532
|
+
text = `'${text}`;
|
|
10533
|
+
return /[",\n;]/.test(text) ? `"${text.replaceAll('"', '""')}"` : text;
|
|
10534
|
+
}
|
|
10535
|
+
|
|
10536
|
+
/**
|
|
10537
|
+
* Szablon rozwijanego wiersza (row detail) dla `kpt-data-table`. Renderowany pod
|
|
10538
|
+
* wierszem po rozwinięciu. Kontekst: `$implicit` = wiersz. Wymaga `expandable`.
|
|
10539
|
+
*
|
|
10540
|
+
* @example
|
|
10541
|
+
* <kpt-data-table [columns]="cols" [data]="rows" expandable>
|
|
10542
|
+
* <ng-template kptRowDetail let-row>
|
|
10543
|
+
* <div class="szczegoly">{{ row.opis }}</div>
|
|
10544
|
+
* </ng-template>
|
|
10545
|
+
* </kpt-data-table>
|
|
10546
|
+
*/
|
|
10547
|
+
class KptRowDetailDef {
|
|
10548
|
+
constructor() {
|
|
10549
|
+
this.template = inject(TemplateRef);
|
|
10550
|
+
}
|
|
10551
|
+
static { this.ɵfac = function KptRowDetailDef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptRowDetailDef)(); }; }
|
|
10552
|
+
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: KptRowDetailDef, selectors: [["ng-template", "kptRowDetail", ""]] }); }
|
|
10553
|
+
}
|
|
10554
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptRowDetailDef, [{
|
|
10555
|
+
type: Directive,
|
|
10556
|
+
args: [{
|
|
10557
|
+
selector: 'ng-template[kptRowDetail]',
|
|
10558
|
+
}]
|
|
10559
|
+
}], null, null); })();
|
|
10560
|
+
|
|
10561
|
+
const _c0$d = ["scrollEl"];
|
|
9332
10562
|
const _c1$5 = ["theadEl"];
|
|
9333
10563
|
const _c2$2 = ["editorHost"];
|
|
9334
10564
|
const _c3 = [[["", "kptPaginatorActions", ""]]];
|
|
@@ -9875,7 +11105,7 @@ const REM_PX = 16;
|
|
|
9875
11105
|
const CHECKBOX_FROZEN_W = 3; // rem
|
|
9876
11106
|
const EXPANDER_FROZEN_W = 2.5; // rem
|
|
9877
11107
|
/** Edytory renderujące panel w CDK Overlay — otwierane od razu i zatwierdzane na zamknięciu panelu. */
|
|
9878
|
-
const OVERLAY_EDITORS = ['date', 'select', 'multiselect'];
|
|
11108
|
+
const OVERLAY_EDITORS = new Set(['date', 'select', 'multiselect']);
|
|
9879
11109
|
/** Tablice (multiselect) porównujemy po zawartości, resztę po referencji. */
|
|
9880
11110
|
function sameEditValue(a, b) {
|
|
9881
11111
|
if (a === b)
|
|
@@ -10082,7 +11312,7 @@ class KptDataTable {
|
|
|
10082
11312
|
const cols = this.columns();
|
|
10083
11313
|
let rows = this.data();
|
|
10084
11314
|
if (query) {
|
|
10085
|
-
rows = rows.filter((row) => cols.some((col) =>
|
|
11315
|
+
rows = rows.filter((row) => cols.some((col) => toText(row[col.field]).toLowerCase().includes(query)));
|
|
10086
11316
|
}
|
|
10087
11317
|
if (this.hasColumnFilters()) {
|
|
10088
11318
|
rows = rows.filter((row) => this.matchesColumnFilters(row));
|
|
@@ -10106,7 +11336,7 @@ class KptDataTable {
|
|
|
10106
11336
|
return -1;
|
|
10107
11337
|
if (typeof av === 'number' && typeof bv === 'number')
|
|
10108
11338
|
return (av - bv) * sign;
|
|
10109
|
-
return
|
|
11339
|
+
return toText(av).localeCompare(toText(bv)) * sign;
|
|
10110
11340
|
});
|
|
10111
11341
|
}, /* @ts-ignore */
|
|
10112
11342
|
...(ngDevMode ? [{ debugName: "sorted" }] : /* istanbul ignore next */ []));
|
|
@@ -10169,15 +11399,16 @@ class KptDataTable {
|
|
|
10169
11399
|
const overrides = this.summaryValues() ?? {};
|
|
10170
11400
|
const map = new Map();
|
|
10171
11401
|
for (const col of this.visibleOrderedColumns()) {
|
|
10172
|
-
|
|
11402
|
+
const summary = col.summary;
|
|
11403
|
+
// Gotowa wartość z `summaryValues` wygrywa z wyliczeniem — i wystarcza sama w sobie.
|
|
11404
|
+
if (col.field in overrides) {
|
|
11405
|
+
map.set(col.field, this.formatSummary(overrides[col.field], summary?.format));
|
|
11406
|
+
continue;
|
|
11407
|
+
}
|
|
11408
|
+
if (!summary)
|
|
10173
11409
|
continue;
|
|
10174
|
-
const raw = col.field
|
|
10175
|
-
|
|
10176
|
-
: typeof col.summary.fn === 'function'
|
|
10177
|
-
? col.summary.fn(rows)
|
|
10178
|
-
: aggregate(rows, col.field, col.summary.fn);
|
|
10179
|
-
const format = col.summary?.format;
|
|
10180
|
-
map.set(col.field, format ? format(raw) : raw == null ? '' : String(raw));
|
|
11410
|
+
const raw = typeof summary.fn === 'function' ? summary.fn(rows) : aggregate(rows, col.field, summary.fn);
|
|
11411
|
+
map.set(col.field, this.formatSummary(raw, summary.format));
|
|
10181
11412
|
}
|
|
10182
11413
|
return map;
|
|
10183
11414
|
}, /* @ts-ignore */
|
|
@@ -10367,7 +11598,7 @@ class KptDataTable {
|
|
|
10367
11598
|
// poza edytorem zamyka panel, a więc zatwierdza i zamyka edycję — bez tego edytor z zamkniętym
|
|
10368
11599
|
// panelem potrafiłby zostać otwarty w nieskończoność.
|
|
10369
11600
|
const type = col.edit?.type;
|
|
10370
|
-
this.editorPanelOpen.set(!!type && OVERLAY_EDITORS.
|
|
11601
|
+
this.editorPanelOpen.set(!!type && OVERLAY_EDITORS.has(type));
|
|
10371
11602
|
}
|
|
10372
11603
|
/**
|
|
10373
11604
|
* Panel edytora zamknięty (wybór, klik poza, Esc) → zatwierdź. Celowo NIE wieszamy tego na
|
|
@@ -10454,73 +11685,23 @@ class KptDataTable {
|
|
|
10454
11685
|
const v = this.columnFilters()[col.field];
|
|
10455
11686
|
return v ?? [mn, mx];
|
|
10456
11687
|
}
|
|
10457
|
-
|
|
10458
|
-
if (value instanceof Date) {
|
|
10459
|
-
const p = (n) => String(n).padStart(2, '0');
|
|
10460
|
-
return `${value.getFullYear()}-${p(value.getMonth() + 1)}-${p(value.getDate())}`;
|
|
10461
|
-
}
|
|
10462
|
-
return String(value ?? '');
|
|
10463
|
-
}
|
|
11688
|
+
/** Semantyka dopasowania siedzi w `./column-filter` — tu zostaje tylko spięcie ze stanem. */
|
|
10464
11689
|
matchesColumnFilters(row) {
|
|
10465
11690
|
const filters = this.columnFilters();
|
|
11691
|
+
const cells = row;
|
|
10466
11692
|
return this.columns().every((col) => {
|
|
10467
|
-
const
|
|
10468
|
-
if (!
|
|
11693
|
+
const filter = col.filter;
|
|
11694
|
+
if (!filter)
|
|
10469
11695
|
return true;
|
|
10470
|
-
const
|
|
10471
|
-
if (
|
|
11696
|
+
const value = filters[col.field];
|
|
11697
|
+
if (isEmptyFilterValue(value))
|
|
10472
11698
|
return true;
|
|
10473
|
-
|
|
10474
|
-
switch (f.type) {
|
|
10475
|
-
case 'text':
|
|
10476
|
-
return String(cell ?? '').toLowerCase().includes(String(fv).toLowerCase());
|
|
10477
|
-
case 'number':
|
|
10478
|
-
return String(cell ?? '').includes(String(fv));
|
|
10479
|
-
case 'select': {
|
|
10480
|
-
const vals = Array.isArray(fv) ? fv : [fv];
|
|
10481
|
-
// Komórka-tablica (np. lista tagów/członków) → dopasuj, gdy zawiera dowolną z wybranych wartości.
|
|
10482
|
-
if (Array.isArray(cell))
|
|
10483
|
-
return cell.some((c) => vals.includes(c));
|
|
10484
|
-
return vals.includes(cell);
|
|
10485
|
-
}
|
|
10486
|
-
case 'numberRange': {
|
|
10487
|
-
const { min, max } = fv ?? {};
|
|
10488
|
-
const hasMin = min != null && min !== '';
|
|
10489
|
-
const hasMax = max != null && max !== '';
|
|
10490
|
-
if (!hasMin && !hasMax)
|
|
10491
|
-
return true;
|
|
10492
|
-
const num = typeof cell === 'number' ? cell : parseFloat(String(cell ?? ''));
|
|
10493
|
-
if (Number.isNaN(num))
|
|
10494
|
-
return false;
|
|
10495
|
-
if (hasMin && num < parseFloat(min))
|
|
10496
|
-
return false;
|
|
10497
|
-
if (hasMax && num > parseFloat(max))
|
|
10498
|
-
return false;
|
|
10499
|
-
return true;
|
|
10500
|
-
}
|
|
10501
|
-
case 'slider': {
|
|
10502
|
-
const [lo, hi] = fv;
|
|
10503
|
-
const num = typeof cell === 'number' ? cell : parseFloat(String(cell ?? ''));
|
|
10504
|
-
if (Number.isNaN(num))
|
|
10505
|
-
return false;
|
|
10506
|
-
return num >= lo && num <= hi;
|
|
10507
|
-
}
|
|
10508
|
-
case 'dateRange': {
|
|
10509
|
-
const { start, end } = fv ?? { start: '', end: '' };
|
|
10510
|
-
if (!start && !end)
|
|
10511
|
-
return true;
|
|
10512
|
-
const iso = KptDataTable.toIso(cell);
|
|
10513
|
-
if (start && iso < start)
|
|
10514
|
-
return false;
|
|
10515
|
-
if (end && iso > end)
|
|
10516
|
-
return false;
|
|
10517
|
-
return true;
|
|
10518
|
-
}
|
|
10519
|
-
default:
|
|
10520
|
-
return true;
|
|
10521
|
-
}
|
|
11699
|
+
return matchesColumnFilter(filter, cells[col.field], value);
|
|
10522
11700
|
});
|
|
10523
11701
|
}
|
|
11702
|
+
formatSummary(raw, format) {
|
|
11703
|
+
return format ? format(raw) : toText(raw);
|
|
11704
|
+
}
|
|
10524
11705
|
summaryText(field) {
|
|
10525
11706
|
return this.summaryTexts().get(field) ?? '';
|
|
10526
11707
|
}
|
|
@@ -10528,7 +11709,7 @@ class KptDataTable {
|
|
|
10528
11709
|
parseWidthPx(width) {
|
|
10529
11710
|
if (!width)
|
|
10530
11711
|
return 8 * REM_PX;
|
|
10531
|
-
const n = parseFloat(width);
|
|
11712
|
+
const n = Number.parseFloat(width);
|
|
10532
11713
|
if (Number.isNaN(n))
|
|
10533
11714
|
return 8 * REM_PX;
|
|
10534
11715
|
return width.trim().endsWith('px') ? n : n * REM_PX;
|
|
@@ -10615,7 +11796,7 @@ class KptDataTable {
|
|
|
10615
11796
|
} if (rf & 2) {
|
|
10616
11797
|
i0.ɵɵqueryAdvance(3);
|
|
10617
11798
|
} }, viewQuery: function KptDataTable_Query(rf, ctx) { if (rf & 1) {
|
|
10618
|
-
i0.ɵɵviewQuerySignal(ctx.scrollEl, _c0$
|
|
11799
|
+
i0.ɵɵviewQuerySignal(ctx.scrollEl, _c0$d, 5)(ctx.theadEl, _c1$5, 5)(ctx.editorHost, _c2$2, 5);
|
|
10619
11800
|
} if (rf & 2) {
|
|
10620
11801
|
i0.ɵɵqueryAdvance(3);
|
|
10621
11802
|
} }, hostAttrs: [1, "kpt-data-table"], hostVars: 2, hostBindings: function KptDataTable_HostBindings(rf, ctx) { if (rf & 2) {
|
|
@@ -10692,9 +11873,9 @@ class KptDataTable {
|
|
|
10692
11873
|
'[style.--kpt-thead-offset]': "theadOffset() + 'px'",
|
|
10693
11874
|
}, 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 @if (hasSummary() && !loading() && displayCount() > 0) {\n <tfoot>\n <tr class=\"kpt-data-table__summary\">\n @if (summaryLabelSpan() > 0) {\n <th\n class=\"kpt-data-table__summary-label\"\n [attr.colspan]=\"summaryLabelSpan()\"\n [class.kpt-data-table__cell--frozen]=\"hasFrozen()\"\n [style.left.px]=\"hasFrozen() ? 0 : null\"\n >\n {{ summaryLabelText() }}\n </th>\n }\n @for (col of visibleOrderedColumns(); track col.field; let i = $index) {\n @if (i >= summaryStartIndex()) {\n <td\n [attr.data-align]=\"col.align ?? 'end'\"\n [style.width]=\"col.width\"\n [style.left.px]=\"frozenLeft(col.field)\"\n [class.kpt-data-table__cell--frozen]=\"isFrozen(col.field)\"\n >\n {{ summaryText(col.field) }}\n </td>\n }\n }\n </tr>\n </tfoot>\n }\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__table tfoot th,.kpt-data-table__table tfoot td{position:sticky;bottom:0;z-index:1;background:var(--kpt-table-summary-bg, var(--kpt-table-header-bg));color:var(--kpt-table-header-fg);font-weight:var(--kpt-font-weight-semibold, 600);white-space:nowrap;border-bottom:0;border-top:var(--kpt-border-width-thin, 1px) solid var(--kpt-table-border)}.kpt-data-table__table .kpt-data-table__summary-label{text-align:end}.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 tfoot th.kpt-data-table__cell--frozen,.kpt-data-table tfoot td.kpt-data-table__cell--frozen{z-index:3;background:var(--kpt-table-summary-bg, 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"] }]
|
|
10694
11875
|
}], () => [], { 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 }] }], summaryLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "summaryLabel", required: false }] }], summaryValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "summaryValues", 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 }] }] }); })();
|
|
10695
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDataTable, { className: "KptDataTable", filePath: "lib/data-table/data-table.component.ts", lineNumber:
|
|
11876
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDataTable, { className: "KptDataTable", filePath: "lib/data-table/data-table.component.ts", lineNumber: 157 }); })();
|
|
10696
11877
|
|
|
10697
|
-
const _c0$
|
|
11878
|
+
const _c0$c = a0 => ({ $implicit: a0, level: 0 });
|
|
10698
11879
|
const _c1$4 = (a0, a1) => ({ $implicit: a0, level: a1 });
|
|
10699
11880
|
function KptTree_ng_template_2_For_1_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
10700
11881
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
@@ -10816,7 +11997,7 @@ class KptTree {
|
|
|
10816
11997
|
} if (rf & 2) {
|
|
10817
11998
|
const nodeTpl_r6 = i0.ɵɵreference(3);
|
|
10818
11999
|
i0.ɵɵadvance();
|
|
10819
|
-
i0.ɵɵproperty("ngTemplateOutlet", nodeTpl_r6)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c0$
|
|
12000
|
+
i0.ɵɵproperty("ngTemplateOutlet", nodeTpl_r6)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c0$c, ctx.nodes()));
|
|
10820
12001
|
} }, dependencies: [NgTemplateOutlet, KptIcon], styles: ["@layer kpt.components{.kpt-tree-host{display:block}.kpt-tree,.kpt-tree ul{list-style:none;margin:0;padding:0}.kpt-tree__row{display:flex;align-items:center;gap:.35rem;padding-block:.3rem;padding-inline-end:.5rem;border-radius:var(--%NS%kpt-radius-sm, .25rem);cursor:pointer;font-size:var(--%NS%kpt-font-size-sm, .875rem);color:var(--%NS%kpt-color-on-surface)}.kpt-tree__row:hover{background:var(--%NS%kpt-color-surface-variant)}.kpt-tree__row.is-selected{background:color-mix(in oklch,var(--%NS%kpt-color-primary) 14%,var(--%NS%kpt-color-surface));color:var(--%NS%kpt-color-primary)}.kpt-tree__row.is-disabled{opacity:.5;cursor:not-allowed}.kpt-tree__toggle{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;flex-shrink:0;border:0;background:none;cursor:pointer;color:var(--%NS%kpt-color-on-surface-muted);padding:0}.kpt-tree__spacer{display:inline-block;width:1.25rem;flex-shrink:0}.kpt-tree__chevron{transition:transform var(--%NS%kpt-motion-duration-fast, .12s) var(--%NS%kpt-motion-easing-standard)}.kpt-tree__chevron.is-open{transform:rotate(90deg)}.kpt-tree__icon{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-tree__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}\n"], encapsulation: 2 }); }
|
|
10821
12002
|
}
|
|
10822
12003
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptTree, [{
|
|
@@ -10950,7 +12131,7 @@ class KptTimeline {
|
|
|
10950
12131
|
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }] }); })();
|
|
10951
12132
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptTimeline, { className: "KptTimeline", filePath: "lib/timeline/timeline.component.ts", lineNumber: 44 }); })();
|
|
10952
12133
|
|
|
10953
|
-
const _c0$
|
|
12134
|
+
const _c0$b = (a0, a1) => ({ $implicit: a0, index: a1 });
|
|
10954
12135
|
const _c1$3 = a0 => ({ index: a0 });
|
|
10955
12136
|
function KptCarousel_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
10956
12137
|
i0.ɵɵelementStart(0, "div", 3);
|
|
@@ -10961,7 +12142,7 @@ function KptCarousel_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
10961
12142
|
const $index_r2 = ctx.$index;
|
|
10962
12143
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
10963
12144
|
i0.ɵɵadvance();
|
|
10964
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r2.slideTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c0$
|
|
12145
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r2.slideTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c0$b, item_r1, $index_r2));
|
|
10965
12146
|
} }
|
|
10966
12147
|
function KptCarousel_For_11_Template(rf, ctx) { if (rf & 1) {
|
|
10967
12148
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
@@ -11073,7 +12254,7 @@ class KptCarousel {
|
|
|
11073
12254
|
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }, { type: i0.Output, args: ["activeIndexChange"] }], slideTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] }); })();
|
|
11074
12255
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptCarousel, { className: "KptCarousel", filePath: "lib/carousel/carousel.component.ts", lineNumber: 54 }); })();
|
|
11075
12256
|
|
|
11076
|
-
const _c0$
|
|
12257
|
+
const _c0$a = a0 => ({ count: a0 });
|
|
11077
12258
|
const _c1$2 = (a0, a1) => ({ $implicit: a0, index: a1 });
|
|
11078
12259
|
const _c2$1 = a0 => [a0];
|
|
11079
12260
|
function KptDataView_For_11_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -11165,7 +12346,7 @@ class KptDataView {
|
|
|
11165
12346
|
i0.ɵɵelementEnd();
|
|
11166
12347
|
} if (rf & 2) {
|
|
11167
12348
|
i0.ɵɵadvance(3);
|
|
11168
|
-
i0.ɵɵtextInterpolate(ctx.i18n.t("dataView.count", i0.ɵɵpureFunction1(10, _c0$
|
|
12349
|
+
i0.ɵɵtextInterpolate(ctx.i18n.t("dataView.count", i0.ɵɵpureFunction1(10, _c0$a, ctx.items().length)));
|
|
11169
12350
|
i0.ɵɵadvance(2);
|
|
11170
12351
|
i0.ɵɵclassProp("is-active", ctx.layout() === "list");
|
|
11171
12352
|
i0.ɵɵattribute("aria-label", ctx.i18n.t("dataView.list"));
|
|
@@ -11210,7 +12391,7 @@ class KptDataView {
|
|
|
11210
12391
|
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }, { type: i0.Output, args: ["layoutChange"] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], paginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginated", required: false }] }], itemTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], pageIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageIndex", required: false }] }, { type: i0.Output, args: ["pageIndexChange"] }] }); })();
|
|
11211
12392
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptDataView, { className: "KptDataView", filePath: "lib/data-view/data-view.component.ts", lineNumber: 49 }); })();
|
|
11212
12393
|
|
|
11213
|
-
const _c0$
|
|
12394
|
+
const _c0$9 = a0 => ({ $implicit: a0 });
|
|
11214
12395
|
function KptPickList_For_6_Template(rf, ctx) { if (rf & 1) {
|
|
11215
12396
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
11216
12397
|
i0.ɵɵelementStart(0, "li", 9);
|
|
@@ -11222,7 +12403,7 @@ function KptPickList_For_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
11222
12403
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
11223
12404
|
i0.ɵɵclassProp("is-selected", ctx_r2.selSource().has(item_r2));
|
|
11224
12405
|
i0.ɵɵadvance();
|
|
11225
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r2.itemTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction1(4, _c0$
|
|
12406
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r2.itemTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction1(4, _c0$9, item_r2));
|
|
11226
12407
|
} }
|
|
11227
12408
|
function KptPickList_For_23_Template(rf, ctx) { if (rf & 1) {
|
|
11228
12409
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
@@ -11235,7 +12416,7 @@ function KptPickList_For_23_Template(rf, ctx) { if (rf & 1) {
|
|
|
11235
12416
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
11236
12417
|
i0.ɵɵclassProp("is-selected", ctx_r2.selTarget().has(item_r5));
|
|
11237
12418
|
i0.ɵɵadvance();
|
|
11238
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r2.itemTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction1(4, _c0$
|
|
12419
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r2.itemTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction1(4, _c0$9, item_r5));
|
|
11239
12420
|
} }
|
|
11240
12421
|
/**
|
|
11241
12422
|
* PickList — transfer elementów między dwiema listami (źródło ↔ cel).
|
|
@@ -11380,7 +12561,7 @@ class KptPickList {
|
|
|
11380
12561
|
}], null, { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }, { type: i0.Output, args: ["sourceChange"] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }, { type: i0.Output, args: ["targetChange"] }], sourceHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "sourceHeader", required: false }] }], targetHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "targetHeader", required: false }] }], itemTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] }); })();
|
|
11381
12562
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptPickList, { className: "KptPickList", filePath: "lib/pick-list/pick-list.component.ts", lineNumber: 55 }); })();
|
|
11382
12563
|
|
|
11383
|
-
const _c0$
|
|
12564
|
+
const _c0$8 = (a0, a1) => ({ $implicit: a0, index: a1 });
|
|
11384
12565
|
function KptOrderList_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
11385
12566
|
i0.ɵɵelementStart(0, "div", 6);
|
|
11386
12567
|
i0.ɵɵtext(1);
|
|
@@ -11402,7 +12583,7 @@ function KptOrderList_For_10_Template(rf, ctx) { if (rf & 1) {
|
|
|
11402
12583
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
11403
12584
|
i0.ɵɵclassProp("is-selected", ctx_r0.selected() === ɵ$index_21_r3);
|
|
11404
12585
|
i0.ɵɵadvance();
|
|
11405
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.itemTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction2(4, _c0$
|
|
12586
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.itemTpl())("ngTemplateOutletContext", i0.ɵɵpureFunction2(4, _c0$8, item_r4, ɵ$index_21_r3));
|
|
11406
12587
|
} }
|
|
11407
12588
|
/**
|
|
11408
12589
|
* OrderList — lista z ręcznym porządkowaniem elementów (w górę/dół).
|
|
@@ -11492,7 +12673,7 @@ class KptOrderList {
|
|
|
11492
12673
|
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }, { type: i0.Output, args: ["itemsChange"] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], itemTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] }); })();
|
|
11493
12674
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptOrderList, { className: "KptOrderList", filePath: "lib/order-list/order-list.component.ts", lineNumber: 41 }); })();
|
|
11494
12675
|
|
|
11495
|
-
const _c0$
|
|
12676
|
+
const _c0$7 = a0 => ({ index: a0 });
|
|
11496
12677
|
function KptGalleria_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
11497
12678
|
i0.ɵɵelement(0, "img", 4);
|
|
11498
12679
|
} if (rf & 2) {
|
|
@@ -11510,7 +12691,7 @@ function KptGalleria_Conditional_7_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
11510
12691
|
const ɵ$index_19_r3 = ctx.$index;
|
|
11511
12692
|
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
11512
12693
|
i0.ɵɵclassProp("is-active", ɵ$index_19_r3 === ctx_r3.activeIndex());
|
|
11513
|
-
i0.ɵɵattribute("aria-label", ctx_r3.i18n.t("galleria.image", i0.ɵɵpureFunction1(5, _c0$
|
|
12694
|
+
i0.ɵɵattribute("aria-label", ctx_r3.i18n.t("galleria.image", i0.ɵɵpureFunction1(5, _c0$7, ɵ$index_19_r3 + 1)));
|
|
11514
12695
|
i0.ɵɵadvance();
|
|
11515
12696
|
i0.ɵɵproperty("src", item_r5.thumbnail || item_r5.src, i0.ɵɵsanitizeUrl)("alt", item_r5.alt || "");
|
|
11516
12697
|
} }
|
|
@@ -11599,94 +12780,6 @@ class KptGalleria {
|
|
|
11599
12780
|
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }, { type: i0.Output, args: ["activeIndexChange"] }], showThumbnails: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThumbnails", required: false }] }] }); })();
|
|
11600
12781
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptGalleria, { className: "KptGalleria", filePath: "lib/galleria/galleria.component.ts", lineNumber: 46 }); })();
|
|
11601
12782
|
|
|
11602
|
-
const _c0$7 = ["*"];
|
|
11603
|
-
function KptAlert_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
11604
|
-
i0.ɵɵelementStart(0, "div", 3);
|
|
11605
|
-
i0.ɵɵtext(1);
|
|
11606
|
-
i0.ɵɵelementEnd();
|
|
11607
|
-
} if (rf & 2) {
|
|
11608
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
11609
|
-
i0.ɵɵadvance();
|
|
11610
|
-
i0.ɵɵtextInterpolate(ctx_r0.title());
|
|
11611
|
-
} }
|
|
11612
|
-
function KptAlert_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
11613
|
-
const _r2 = i0.ɵɵgetCurrentView();
|
|
11614
|
-
i0.ɵɵelementStart(0, "button", 6);
|
|
11615
|
-
i0.ɵɵlistener("click", function KptAlert_Conditional_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.dismiss()); });
|
|
11616
|
-
i0.ɵɵelement(1, "kpt-icon", 7);
|
|
11617
|
-
i0.ɵɵelementEnd();
|
|
11618
|
-
} if (rf & 2) {
|
|
11619
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
11620
|
-
i0.ɵɵattribute("aria-label", ctx_r0.i18n.t("common.close"));
|
|
11621
|
-
} }
|
|
11622
|
-
/**
|
|
11623
|
-
* Komunikat inline (alert). Warianty info/success/warning/danger, opcjonalny tytuł i zamykanie.
|
|
11624
|
-
*
|
|
11625
|
-
* @example
|
|
11626
|
-
* <kpt-alert variant="success" title="Zapisano">Zmiany zostały zapisane.</kpt-alert>
|
|
11627
|
-
*/
|
|
11628
|
-
class KptAlert {
|
|
11629
|
-
constructor() {
|
|
11630
|
-
this.variant = input('info', /* @ts-ignore */
|
|
11631
|
-
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
11632
|
-
this.title = input('', /* @ts-ignore */
|
|
11633
|
-
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
11634
|
-
this.dismissible = input(false, { ...(ngDevMode ? { debugName: "dismissible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
11635
|
-
this.closed = output();
|
|
11636
|
-
this.i18n = inject(KptI18n);
|
|
11637
|
-
this.visible = signal(true, /* @ts-ignore */
|
|
11638
|
-
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
11639
|
-
}
|
|
11640
|
-
iconName() {
|
|
11641
|
-
return { info: 'info', success: 'circle-check', warning: 'alert-triangle', danger: 'circle-x' }[this.variant()];
|
|
11642
|
-
}
|
|
11643
|
-
dismiss() {
|
|
11644
|
-
this.visible.set(false);
|
|
11645
|
-
this.closed.emit();
|
|
11646
|
-
}
|
|
11647
|
-
static { this.ɵfac = function KptAlert_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptAlert)(); }; }
|
|
11648
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptAlert, selectors: [["kpt-alert"]], hostAttrs: [1, "kpt-alert-host"], hostVars: 1, hostBindings: function KptAlert_HostBindings(rf, ctx) { if (rf & 2) {
|
|
11649
|
-
i0.ɵɵdomProperty("hidden", !ctx.visible());
|
|
11650
|
-
} }, inputs: { variant: [1, "variant"], title: [1, "title"], dismissible: [1, "dismissible"] }, outputs: { closed: "closed" }, ngContentSelectors: _c0$7, decls: 7, vars: 4, consts: [["role", "alert", 1, "kpt-alert"], [1, "kpt-alert__icon", 3, "name"], [1, "kpt-alert__content"], [1, "kpt-alert__title"], [1, "kpt-alert__message"], ["type", "button", 1, "kpt-alert__close"], ["type", "button", 1, "kpt-alert__close", 3, "click"], ["name", "x"]], template: function KptAlert_Template(rf, ctx) { if (rf & 1) {
|
|
11651
|
-
i0.ɵɵprojectionDef();
|
|
11652
|
-
i0.ɵɵelementStart(0, "div", 0);
|
|
11653
|
-
i0.ɵɵelement(1, "kpt-icon", 1);
|
|
11654
|
-
i0.ɵɵelementStart(2, "div", 2);
|
|
11655
|
-
i0.ɵɵconditionalCreate(3, KptAlert_Conditional_3_Template, 2, 1, "div", 3);
|
|
11656
|
-
i0.ɵɵelementStart(4, "div", 4);
|
|
11657
|
-
i0.ɵɵprojection(5);
|
|
11658
|
-
i0.ɵɵelementEnd()();
|
|
11659
|
-
i0.ɵɵconditionalCreate(6, KptAlert_Conditional_6_Template, 2, 1, "button", 5);
|
|
11660
|
-
i0.ɵɵelementEnd();
|
|
11661
|
-
} if (rf & 2) {
|
|
11662
|
-
i0.ɵɵattribute("data-variant", ctx.variant());
|
|
11663
|
-
i0.ɵɵadvance();
|
|
11664
|
-
i0.ɵɵproperty("name", ctx.iconName());
|
|
11665
|
-
i0.ɵɵadvance(2);
|
|
11666
|
-
i0.ɵɵconditional(ctx.title() ? 3 : -1);
|
|
11667
|
-
i0.ɵɵadvance(3);
|
|
11668
|
-
i0.ɵɵconditional(ctx.dismissible() ? 6 : -1);
|
|
11669
|
-
} }, dependencies: [KptIcon], styles: ["@layer kpt.components{.kpt-alert{--%NS%_accent: var(--%NS%kpt-color-info);display:flex;align-items:flex-start;gap:var(--%NS%kpt-space-3, .75rem);padding:var(--%NS%kpt-space-3, .75rem) var(--%NS%kpt-space-4, 1rem);border:var(--%NS%kpt-border-width-thin, 1px) solid color-mix(in oklch,var(--%NS%_accent) 35%,transparent);border-inline-start:3px solid var(--%NS%_accent);border-radius:var(--%NS%kpt-radius-md, .5rem);background:color-mix(in oklch,var(--%NS%_accent) 10%,var(--%NS%kpt-color-surface));color:var(--%NS%kpt-color-on-surface);font-size:var(--%NS%kpt-font-size-sm, .875rem)}.kpt-alert[data-variant=success]{--%NS%_accent: var(--%NS%kpt-color-success)}.kpt-alert[data-variant=warning]{--%NS%_accent: var(--%NS%kpt-color-warning)}.kpt-alert[data-variant=danger]{--%NS%_accent: var(--%NS%kpt-color-danger)}.kpt-alert__icon{color:var(--%NS%_accent);font-weight:700;line-height:1.5}.kpt-alert__content{flex:1;min-width:0}.kpt-alert__title{font-weight:var(--%NS%kpt-font-weight-semibold, 600);margin-bottom:.15rem}.kpt-alert__close{background:none;border:0;cursor:pointer;color:var(--%NS%kpt-color-on-surface-muted);font-size:1.15rem;line-height:1;padding:0}.kpt-alert__close:hover{color:var(--%NS%kpt-color-on-surface)}}\n"], encapsulation: 2 }); }
|
|
11670
|
-
}
|
|
11671
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptAlert, [{
|
|
11672
|
-
type: Component,
|
|
11673
|
-
args: [{ selector: 'kpt-alert', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptIcon], template: `
|
|
11674
|
-
<div class="kpt-alert" [attr.data-variant]="variant()" role="alert">
|
|
11675
|
-
<kpt-icon class="kpt-alert__icon" [name]="iconName()" />
|
|
11676
|
-
<div class="kpt-alert__content">
|
|
11677
|
-
@if (title()) {
|
|
11678
|
-
<div class="kpt-alert__title">{{ title() }}</div>
|
|
11679
|
-
}
|
|
11680
|
-
<div class="kpt-alert__message"><ng-content /></div>
|
|
11681
|
-
</div>
|
|
11682
|
-
@if (dismissible()) {
|
|
11683
|
-
<button class="kpt-alert__close" type="button" (click)="dismiss()" [attr.aria-label]="i18n.t('common.close')"><kpt-icon name="x" /></button>
|
|
11684
|
-
}
|
|
11685
|
-
</div>
|
|
11686
|
-
`, host: { class: 'kpt-alert-host', '[hidden]': '!visible()' }, styles: ["@layer kpt.components{.kpt-alert{--_accent: var(--kpt-color-info);display:flex;align-items:flex-start;gap:var(--kpt-space-3, .75rem);padding:var(--kpt-space-3, .75rem) var(--kpt-space-4, 1rem);border:var(--kpt-border-width-thin, 1px) solid color-mix(in oklch,var(--_accent) 35%,transparent);border-inline-start:3px solid var(--_accent);border-radius:var(--kpt-radius-md, .5rem);background:color-mix(in oklch,var(--_accent) 10%,var(--kpt-color-surface));color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm, .875rem)}.kpt-alert[data-variant=success]{--_accent: var(--kpt-color-success)}.kpt-alert[data-variant=warning]{--_accent: var(--kpt-color-warning)}.kpt-alert[data-variant=danger]{--_accent: var(--kpt-color-danger)}.kpt-alert__icon{color:var(--_accent);font-weight:700;line-height:1.5}.kpt-alert__content{flex:1;min-width:0}.kpt-alert__title{font-weight:var(--kpt-font-weight-semibold, 600);margin-bottom:.15rem}.kpt-alert__close{background:none;border:0;cursor:pointer;color:var(--kpt-color-on-surface-muted);font-size:1.15rem;line-height:1;padding:0}.kpt-alert__close:hover{color:var(--kpt-color-on-surface)}}\n"] }]
|
|
11687
|
-
}], null, { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] }); })();
|
|
11688
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptAlert, { className: "KptAlert", filePath: "lib/alert/alert.component.ts", lineNumber: 45 }); })();
|
|
11689
|
-
|
|
11690
12783
|
const _c0$6 = ["dlg"];
|
|
11691
12784
|
const _c1$1 = ["*", [["", "kptDialogFooter", ""]]];
|
|
11692
12785
|
const _c2 = ["*", "[kptDialogFooter]"];
|
|
@@ -12071,7 +13164,7 @@ function KptMenu_ng_template_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
12071
13164
|
* Wymaga stylów overlay CDK: `import '@angular/cdk/overlay-prebuilt.css';`
|
|
12072
13165
|
*
|
|
12073
13166
|
* @example
|
|
12074
|
-
* <kpt-menu [items]="items" (
|
|
13167
|
+
* <kpt-menu [items]="items" (selected)="onSelect($event)">
|
|
12075
13168
|
* <kpt-button variant="outline">Opcje</kpt-button>
|
|
12076
13169
|
* </kpt-menu>
|
|
12077
13170
|
*/
|
|
@@ -12079,7 +13172,7 @@ class KptMenu {
|
|
|
12079
13172
|
constructor() {
|
|
12080
13173
|
this.items = input([], /* @ts-ignore */
|
|
12081
13174
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
12082
|
-
this.
|
|
13175
|
+
this.selected = output();
|
|
12083
13176
|
this.open = signal(false, /* @ts-ignore */
|
|
12084
13177
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
12085
13178
|
this.positions = [
|
|
@@ -12097,11 +13190,11 @@ class KptMenu {
|
|
|
12097
13190
|
pick(item) {
|
|
12098
13191
|
if (item.disabled)
|
|
12099
13192
|
return;
|
|
12100
|
-
this.
|
|
13193
|
+
this.selected.emit(item);
|
|
12101
13194
|
this.close();
|
|
12102
13195
|
}
|
|
12103
13196
|
static { this.ɵfac = function KptMenu_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptMenu)(); }; }
|
|
12104
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMenu, selectors: [["kpt-menu"]], hostAttrs: [1, "kpt-menu-host"], inputs: { items: [1, "items"] }, outputs: {
|
|
13197
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMenu, selectors: [["kpt-menu"]], hostAttrs: [1, "kpt-menu-host"], inputs: { items: [1, "items"] }, outputs: { selected: "selected" }, ngContentSelectors: _c0$5, decls: 4, vars: 4, consts: [["origin", "cdkOverlayOrigin"], ["cdkOverlayOrigin", "", 1, "kpt-menu__trigger", 3, "click"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["role", "menu", 1, "kpt-menu__panel"], ["role", "separator", 1, "kpt-menu__separator"], ["role", "presentation", 1, "kpt-menu__header"], ["type", "button", "role", "menuitem", 1, "kpt-menu__item", 3, "kpt-menu__item--danger", "disabled"], ["size", "sm", 3, "src", "name", "icon"], [3, "name"], [1, "kpt-menu__text"], [1, "kpt-menu__label"], [1, "kpt-menu__description"], ["type", "button", "role", "menuitem", 1, "kpt-menu__item", 3, "click", "disabled"], [1, "kpt-menu__badge", 3, "value", "variant"]], template: function KptMenu_Template(rf, ctx) { if (rf & 1) {
|
|
12105
13198
|
i0.ɵɵprojectionDef();
|
|
12106
13199
|
i0.ɵɵelementStart(0, "span", 1, 0);
|
|
12107
13200
|
i0.ɵɵlistener("click", function KptMenu_Template_span_click_0_listener() { return ctx.toggle(); });
|
|
@@ -12176,7 +13269,7 @@ class KptMenu {
|
|
|
12176
13269
|
</div>
|
|
12177
13270
|
</ng-template>
|
|
12178
13271
|
`, host: { class: 'kpt-menu-host' }, styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-menu-host{display:inline-flex}.kpt-menu__trigger{display:inline-flex;cursor:pointer}.kpt-menu__panel{min-width:11rem;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)}.kpt-menu__item{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);width:100%;padding:.5rem .6rem;border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);font:inherit;font-size:var(--kpt-font-size-sm, .875rem);text-align:start;cursor:pointer}.kpt-menu__item:hover:not(:disabled){background:var(--kpt-color-surface-variant)}.kpt-menu__item:disabled{opacity:.45;cursor:not-allowed}.kpt-menu__item--danger{color:var(--kpt-color-danger)}.kpt-menu__item kpt-icon{color:var(--kpt-color-on-surface-muted)}.kpt-menu__item--danger kpt-icon{color:var(--kpt-color-danger)}.kpt-menu__header{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);padding:.5rem .6rem;font-size:var(--kpt-font-size-sm, .875rem);cursor:default}.kpt-menu__header .kpt-menu__label{font-weight:var(--kpt-font-weight-semibold, 600)}.kpt-menu__header kpt-icon{color:var(--kpt-color-on-surface-muted)}.kpt-menu__text{display:flex;flex-direction:column;min-width:0}.kpt-menu__label,.kpt-menu__description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kpt-menu__description{color:var(--kpt-color-on-surface-muted);font-size:var(--kpt-font-size-xs, .75rem)}.kpt-menu__badge{margin-inline-start:auto}.kpt-menu__separator{height:1px;margin:.25rem 0;background:var(--kpt-color-border)}}\n"] }]
|
|
12179
|
-
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }],
|
|
13272
|
+
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] }); })();
|
|
12180
13273
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptMenu, { className: "KptMenu", filePath: "lib/menu/menu.component.ts", lineNumber: 116 }); })();
|
|
12181
13274
|
|
|
12182
13275
|
const _c0$4 = [[["", "kptPopoverTrigger", ""]], "*"];
|
|
@@ -12629,7 +13722,7 @@ function KptContextMenu_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
12629
13722
|
* Menu kontekstowe (PPM) na obszarze projekcji. Panel pozycjonowany do kursora.
|
|
12630
13723
|
*
|
|
12631
13724
|
* @example
|
|
12632
|
-
* <kpt-context-menu [items]="items" (
|
|
13725
|
+
* <kpt-context-menu [items]="items" (selected)="onSelect($event)">
|
|
12633
13726
|
* <div class="obszar">Kliknij prawym przyciskiem</div>
|
|
12634
13727
|
* </kpt-context-menu>
|
|
12635
13728
|
*/
|
|
@@ -12637,7 +13730,7 @@ class KptContextMenu {
|
|
|
12637
13730
|
constructor() {
|
|
12638
13731
|
this.items = input([], /* @ts-ignore */
|
|
12639
13732
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
12640
|
-
this.
|
|
13733
|
+
this.selected = output();
|
|
12641
13734
|
this.open = signal(false, /* @ts-ignore */
|
|
12642
13735
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
12643
13736
|
this.x = signal(0, /* @ts-ignore */
|
|
@@ -12657,11 +13750,11 @@ class KptContextMenu {
|
|
|
12657
13750
|
pick(item) {
|
|
12658
13751
|
if (item.disabled)
|
|
12659
13752
|
return;
|
|
12660
|
-
this.
|
|
13753
|
+
this.selected.emit(item);
|
|
12661
13754
|
this.close();
|
|
12662
13755
|
}
|
|
12663
13756
|
static { this.ɵfac = function KptContextMenu_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptContextMenu)(); }; }
|
|
12664
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptContextMenu, selectors: [["kpt-context-menu"]], hostAttrs: [1, "kpt-context-menu-host"], inputs: { items: [1, "items"] }, outputs: {
|
|
13757
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptContextMenu, selectors: [["kpt-context-menu"]], hostAttrs: [1, "kpt-context-menu-host"], inputs: { items: [1, "items"] }, outputs: { selected: "selected" }, ngContentSelectors: _c0$2, decls: 3, vars: 1, consts: [[1, "kpt-context-menu__area", 3, "contextmenu"], [1, "kpt-context-menu__backdrop", 3, "click", "contextmenu"], ["role", "menu", 1, "kpt-context-menu__panel"], ["role", "separator", 1, "kpt-context-menu__separator"], ["role", "presentation", 1, "kpt-context-menu__header"], ["type", "button", "role", "menuitem", 1, "kpt-context-menu__item", 3, "kpt-context-menu__item--danger", "disabled"], ["size", "sm", 3, "src", "name", "icon"], [3, "name"], [1, "kpt-context-menu__text"], [1, "kpt-context-menu__label"], [1, "kpt-context-menu__description"], ["type", "button", "role", "menuitem", 1, "kpt-context-menu__item", 3, "click", "disabled"], [1, "kpt-context-menu__badge", 3, "value", "variant"]], template: function KptContextMenu_Template(rf, ctx) { if (rf & 1) {
|
|
12665
13758
|
i0.ɵɵprojectionDef();
|
|
12666
13759
|
i0.ɵɵelementStart(0, "div", 0);
|
|
12667
13760
|
i0.ɵɵlistener("contextmenu", function KptContextMenu_Template_div_contextmenu_0_listener($event) { return ctx.onContext($event); });
|
|
@@ -12734,7 +13827,7 @@ class KptContextMenu {
|
|
|
12734
13827
|
</div>
|
|
12735
13828
|
}
|
|
12736
13829
|
`, host: { class: 'kpt-context-menu-host' }, styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-context-menu-host{display:block}.kpt-context-menu__area{display:contents}.kpt-context-menu__backdrop{position:fixed;inset:0;z-index:var(--kpt-z-overlay, 1000)}.kpt-context-menu__panel{position:fixed;z-index:calc(var(--kpt-z-overlay, 1000) + 1);min-width:11rem;padding:var(--kpt-space-1, .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)}.kpt-context-menu__item{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);width:100%;padding:var(--kpt-space-2, .5rem) var(--kpt-space-3, .75rem);border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm, .875rem);text-align:left;cursor:pointer}.kpt-context-menu__item:hover:not(:disabled){background:var(--kpt-color-muted)}.kpt-context-menu__item:disabled{opacity:.5;cursor:not-allowed}.kpt-context-menu__item--danger{color:var(--kpt-color-danger)}.kpt-context-menu__header{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);padding:var(--kpt-space-2, .5rem) var(--kpt-space-3, .75rem);font-size:var(--kpt-font-size-sm, .875rem);cursor:default}.kpt-context-menu__header .kpt-context-menu__label{font-weight:var(--kpt-font-weight-semibold, 600)}.kpt-context-menu__header kpt-icon{color:var(--kpt-color-on-surface-muted)}.kpt-context-menu__text{display:flex;flex-direction:column;min-width:0}.kpt-context-menu__label,.kpt-context-menu__description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kpt-context-menu__description{color:var(--kpt-color-on-surface-muted);font-size:var(--kpt-font-size-xs, .75rem)}.kpt-context-menu__badge{margin-inline-start:auto}.kpt-context-menu__separator{height:1px;margin:var(--kpt-space-1, .25rem) 0;background:var(--kpt-color-border)}}\n"] }]
|
|
12737
|
-
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }],
|
|
13830
|
+
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] }); })();
|
|
12738
13831
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptContextMenu, { className: "KptContextMenu", filePath: "lib/context-menu/context-menu.component.ts", lineNumber: 82 }); })();
|
|
12739
13832
|
|
|
12740
13833
|
function KptMenubar_For_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -12824,13 +13917,13 @@ function KptMenubar_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
12824
13917
|
* `import '@angular/cdk/overlay-prebuilt.css';`
|
|
12825
13918
|
*
|
|
12826
13919
|
* @example
|
|
12827
|
-
* <kpt-menubar [items]="items" (
|
|
13920
|
+
* <kpt-menubar [items]="items" (selected)="onSelect($event)" />
|
|
12828
13921
|
*/
|
|
12829
13922
|
class KptMenubar {
|
|
12830
13923
|
constructor() {
|
|
12831
13924
|
this.items = input([], /* @ts-ignore */
|
|
12832
13925
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
12833
|
-
this.
|
|
13926
|
+
this.selected = output();
|
|
12834
13927
|
this.openIndex = signal(null, /* @ts-ignore */
|
|
12835
13928
|
...(ngDevMode ? [{ debugName: "openIndex" }] : /* istanbul ignore next */ []));
|
|
12836
13929
|
this.positions = [
|
|
@@ -12845,21 +13938,21 @@ class KptMenubar {
|
|
|
12845
13938
|
this.openIndex.update((cur) => (cur === i ? null : i));
|
|
12846
13939
|
}
|
|
12847
13940
|
else {
|
|
12848
|
-
this.
|
|
13941
|
+
this.selected.emit(item);
|
|
12849
13942
|
this.closeAll();
|
|
12850
13943
|
}
|
|
12851
13944
|
}
|
|
12852
13945
|
pick(item) {
|
|
12853
13946
|
if (item.disabled)
|
|
12854
13947
|
return;
|
|
12855
|
-
this.
|
|
13948
|
+
this.selected.emit(item);
|
|
12856
13949
|
this.closeAll();
|
|
12857
13950
|
}
|
|
12858
13951
|
closeAll() {
|
|
12859
13952
|
this.openIndex.set(null);
|
|
12860
13953
|
}
|
|
12861
13954
|
static { this.ɵfac = function KptMenubar_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptMenubar)(); }; }
|
|
12862
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMenubar, selectors: [["kpt-menubar"]], hostAttrs: [1, "kpt-menubar-host"], inputs: { items: [1, "items"] }, outputs: {
|
|
13955
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMenubar, selectors: [["kpt-menubar"]], hostAttrs: [1, "kpt-menubar-host"], inputs: { items: [1, "items"] }, outputs: { selected: "selected" }, decls: 3, vars: 0, consts: [["origin", "cdkOverlayOrigin"], ["role", "menubar", 1, "kpt-menubar"], [1, "kpt-menubar__group"], ["type", "button", "role", "menuitem", "cdkOverlayOrigin", "", 1, "kpt-menubar__top", 3, "click", "disabled"], [3, "name"], ["name", "chevron-down", 1, "kpt-menubar__caret"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["role", "menu", 1, "kpt-menubar__dropdown"], ["role", "separator", 1, "kpt-menubar__separator"], ["type", "button", "role", "menuitem", 1, "kpt-menubar__item", 3, "kpt-menubar__item--danger", "disabled"], ["type", "button", "role", "menuitem", 1, "kpt-menubar__item", 3, "click", "disabled"]], template: function KptMenubar_Template(rf, ctx) { if (rf & 1) {
|
|
12863
13956
|
i0.ɵɵelementStart(0, "nav", 1);
|
|
12864
13957
|
i0.ɵɵrepeaterCreate(1, KptMenubar_For_2_Template, 8, 10, "div", 2, i0.ɵɵrepeaterTrackByIndex);
|
|
12865
13958
|
i0.ɵɵelementEnd();
|
|
@@ -12923,7 +14016,7 @@ class KptMenubar {
|
|
|
12923
14016
|
}
|
|
12924
14017
|
</nav>
|
|
12925
14018
|
`, host: { class: 'kpt-menubar-host' }, styles: ["@layer kpt.components{.kpt-menubar-host{display:block}.kpt-menubar{display:flex;align-items:center;gap:var(--kpt-space-1, .25rem);padding:var(--kpt-space-1, .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)}.kpt-menubar__group{display:inline-flex}.kpt-menubar__top{display:inline-flex;align-items:center;gap:var(--kpt-space-2, .5rem);padding:var(--kpt-space-2, .5rem) var(--kpt-space-3, .75rem);border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm, .875rem);cursor:pointer}.kpt-menubar__top:hover:not(:disabled),.kpt-menubar__top.is-open{background:var(--kpt-color-muted)}.kpt-menubar__top:disabled{opacity:.5;cursor:not-allowed}.kpt-menubar__caret{opacity:.6}.kpt-menubar__dropdown{min-width:12rem;padding:var(--kpt-space-1, .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)}.kpt-menubar__item{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);width:100%;padding:var(--kpt-space-2, .5rem) var(--kpt-space-3, .75rem);border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm, .875rem);text-align:left;cursor:pointer}.kpt-menubar__item:hover:not(:disabled){background:var(--kpt-color-muted)}.kpt-menubar__item:disabled{opacity:.5;cursor:not-allowed}.kpt-menubar__item--danger{color:var(--kpt-color-danger)}.kpt-menubar__separator{height:1px;margin:var(--kpt-space-1, .25rem) 0;background:var(--kpt-color-border)}}\n"] }]
|
|
12926
|
-
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }],
|
|
14019
|
+
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] }); })();
|
|
12927
14020
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptMenubar, { className: "KptMenubar", filePath: "lib/menubar/menubar.component.ts", lineNumber: 76 }); })();
|
|
12928
14021
|
|
|
12929
14022
|
const _c0$1 = () => [];
|
|
@@ -13013,13 +14106,13 @@ function KptMegamenu_ng_template_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
13013
14106
|
* `import '@angular/cdk/overlay-prebuilt.css';`
|
|
13014
14107
|
*
|
|
13015
14108
|
* @example
|
|
13016
|
-
* <kpt-megamenu [items]="items" (
|
|
14109
|
+
* <kpt-megamenu [items]="items" (selected)="onSelect($event)" />
|
|
13017
14110
|
*/
|
|
13018
14111
|
class KptMegamenu {
|
|
13019
14112
|
constructor() {
|
|
13020
14113
|
this.items = input([], /* @ts-ignore */
|
|
13021
14114
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
13022
|
-
this.
|
|
14115
|
+
this.selected = output();
|
|
13023
14116
|
this.openIndex = signal(null, /* @ts-ignore */
|
|
13024
14117
|
...(ngDevMode ? [{ debugName: "openIndex" }] : /* istanbul ignore next */ []));
|
|
13025
14118
|
this.positions = [
|
|
@@ -13037,14 +14130,14 @@ class KptMegamenu {
|
|
|
13037
14130
|
pick(link) {
|
|
13038
14131
|
if (link.disabled)
|
|
13039
14132
|
return;
|
|
13040
|
-
this.
|
|
14133
|
+
this.selected.emit(link);
|
|
13041
14134
|
this.closeAll();
|
|
13042
14135
|
}
|
|
13043
14136
|
closeAll() {
|
|
13044
14137
|
this.openIndex.set(null);
|
|
13045
14138
|
}
|
|
13046
14139
|
static { this.ɵfac = function KptMegamenu_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptMegamenu)(); }; }
|
|
13047
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMegamenu, selectors: [["kpt-megamenu"]], hostAttrs: [1, "kpt-megamenu-host"], inputs: { items: [1, "items"] }, outputs: {
|
|
14140
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMegamenu, selectors: [["kpt-megamenu"]], hostAttrs: [1, "kpt-megamenu-host"], inputs: { items: [1, "items"] }, outputs: { selected: "selected" }, decls: 5, vars: 4, consts: [["origin", "cdkOverlayOrigin"], ["role", "menubar", "cdkOverlayOrigin", "", 1, "kpt-megamenu"], ["type", "button", "role", "menuitem", 1, "kpt-megamenu__top", 3, "is-open"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["type", "button", "role", "menuitem", 1, "kpt-megamenu__top", 3, "click"], [3, "name"], ["name", "chevron-down", 1, "kpt-megamenu__caret"], ["role", "menu", 1, "kpt-megamenu__panel"], [1, "kpt-megamenu__column"], [1, "kpt-megamenu__col-title"], ["type", "button", 1, "kpt-megamenu__link", 3, "disabled"], ["type", "button", 1, "kpt-megamenu__link", 3, "click", "disabled"]], template: function KptMegamenu_Template(rf, ctx) { if (rf & 1) {
|
|
13048
14141
|
i0.ɵɵelementStart(0, "nav", 1, 0);
|
|
13049
14142
|
i0.ɵɵrepeaterCreate(2, KptMegamenu_For_3_Template, 5, 4, "button", 2, i0.ɵɵrepeaterTrackByIndex);
|
|
13050
14143
|
i0.ɵɵelementEnd();
|
|
@@ -13102,7 +14195,7 @@ class KptMegamenu {
|
|
|
13102
14195
|
</div>
|
|
13103
14196
|
</ng-template>
|
|
13104
14197
|
`, host: { class: 'kpt-megamenu-host' }, styles: ["@layer kpt.components{.kpt-megamenu-host{display:block}.kpt-megamenu{position:relative;display:flex;align-items:center;gap:var(--kpt-space-1, .25rem);padding:var(--kpt-space-1, .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)}.kpt-megamenu__top{display:inline-flex;align-items:center;gap:var(--kpt-space-2, .5rem);padding:var(--kpt-space-2, .5rem) var(--kpt-space-3, .75rem);border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm, .875rem);cursor:pointer}.kpt-megamenu__top:hover,.kpt-megamenu__top.is-open{background:var(--kpt-color-muted)}.kpt-megamenu__caret{opacity:.6}.kpt-megamenu__panel{display:flex;gap:var(--kpt-space-6, 1.5rem);min-width:min(40rem,90vw);padding:var(--kpt-space-4, 1rem);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-megamenu__column{min-width:9rem}.kpt-megamenu__col-title{margin-bottom:var(--kpt-space-2, .5rem);font-size:var(--kpt-font-size-xs, .75rem);font-weight:var(--kpt-font-weight-semibold, 600);text-transform:uppercase;letter-spacing:.04em;color:var(--kpt-color-on-surface-muted)}.kpt-megamenu__link{display:flex;align-items:center;gap:var(--kpt-space-2, .5rem);width:100%;padding:var(--kpt-space-2, .5rem);border:0;border-radius:var(--kpt-radius-sm, .25rem);background:none;color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm, .875rem);text-align:left;cursor:pointer}.kpt-megamenu__link:hover:not(:disabled){background:var(--kpt-color-muted)}.kpt-megamenu__link:disabled{opacity:.5;cursor:not-allowed}}\n"] }]
|
|
13105
|
-
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }],
|
|
14198
|
+
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] }); })();
|
|
13106
14199
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptMegamenu, { className: "KptMegamenu", filePath: "lib/megamenu/megamenu.component.ts", lineNumber: 66 }); })();
|
|
13107
14200
|
|
|
13108
14201
|
/**
|
|
@@ -13324,7 +14417,7 @@ function KptSpeedDial_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
13324
14417
|
* Speed dial — FAB rozwijający zestaw akcji. Buduje na `kpt-fab`.
|
|
13325
14418
|
*
|
|
13326
14419
|
* @example
|
|
13327
|
-
* <kpt-speed-dial [items]="actions" direction="up" (
|
|
14420
|
+
* <kpt-speed-dial [items]="actions" direction="up" (selected)="onAction($event)" />
|
|
13328
14421
|
*/
|
|
13329
14422
|
class KptSpeedDial {
|
|
13330
14423
|
constructor() {
|
|
@@ -13337,7 +14430,7 @@ class KptSpeedDial {
|
|
|
13337
14430
|
/** Etykieta a11y FAB (stan zamknięty); bez wartości używa i18n (`speedDial.actions`). */
|
|
13338
14431
|
this.ariaLabel = input(/* @ts-ignore */
|
|
13339
14432
|
...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
13340
|
-
this.
|
|
14433
|
+
this.selected = output();
|
|
13341
14434
|
this.i18n = inject(KptI18n);
|
|
13342
14435
|
this.effectiveAriaLabel = computed(() => this.ariaLabel() ?? this.i18n.t('speedDial.actions'), /* @ts-ignore */
|
|
13343
14436
|
...(ngDevMode ? [{ debugName: "effectiveAriaLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -13353,11 +14446,11 @@ class KptSpeedDial {
|
|
|
13353
14446
|
pick(item) {
|
|
13354
14447
|
if (item.disabled)
|
|
13355
14448
|
return;
|
|
13356
|
-
this.
|
|
14449
|
+
this.selected.emit(item);
|
|
13357
14450
|
this.close();
|
|
13358
14451
|
}
|
|
13359
14452
|
static { this.ɵfac = function KptSpeedDial_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptSpeedDial)(); }; }
|
|
13360
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSpeedDial, selectors: [["kpt-speed-dial"]], hostAttrs: [1, "kpt-speed-dial-host"], inputs: { items: [1, "items"], direction: [1, "direction"], icon: [1, "icon"], ariaLabel: [1, "ariaLabel"] }, outputs: {
|
|
14453
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptSpeedDial, selectors: [["kpt-speed-dial"]], hostAttrs: [1, "kpt-speed-dial-host"], inputs: { items: [1, "items"], direction: [1, "direction"], icon: [1, "icon"], ariaLabel: [1, "ariaLabel"] }, outputs: { selected: "selected" }, decls: 8, vars: 6, consts: [[1, "kpt-speed-dial"], [1, "kpt-speed-dial__actions"], ["type", "button", 1, "kpt-speed-dial__action", 3, "disabled"], [3, "click", "ariaLabel"], [1, "kpt-speed-dial__trigger-icon"], [3, "name"], [1, "kpt-speed-dial__backdrop"], ["type", "button", 1, "kpt-speed-dial__action", 3, "click", "disabled"], [1, "kpt-speed-dial__label"], [1, "kpt-speed-dial__backdrop", 3, "click"]], template: function KptSpeedDial_Template(rf, ctx) { if (rf & 1) {
|
|
13361
14454
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
13362
14455
|
i0.ɵɵrepeaterCreate(2, KptSpeedDial_For_3_Template, 3, 4, "button", 2, i0.ɵɵrepeaterTrackByIndex);
|
|
13363
14456
|
i0.ɵɵelementEnd();
|
|
@@ -13398,7 +14491,7 @@ class KptSpeedDial {
|
|
|
13398
14491
|
</div>
|
|
13399
14492
|
@if (open()) { <div class="kpt-speed-dial__backdrop" (click)="close()"></div> }
|
|
13400
14493
|
`, host: { class: 'kpt-speed-dial-host' }, styles: ["@layer kpt.components{.kpt-speed-dial-host{display:inline-block}.kpt-speed-dial{position:relative;display:inline-flex;z-index:calc(var(--kpt-z-overlay, 1000) + 1)}.kpt-speed-dial__trigger-icon{display:inline-flex;transition:transform .2s ease}.kpt-speed-dial.is-open .kpt-speed-dial__trigger-icon{transform:rotate(45deg)}.kpt-speed-dial__actions{position:absolute;display:flex;gap:var(--kpt-space-2, .5rem);opacity:0;pointer-events:none;transition:opacity .15s ease}.kpt-speed-dial.is-open .kpt-speed-dial__actions{opacity:1;pointer-events:auto}.kpt-speed-dial[data-direction=up] .kpt-speed-dial__actions{flex-direction:column-reverse;bottom:calc(100% + .5rem);left:50%;transform:translate(-50%)}.kpt-speed-dial[data-direction=down] .kpt-speed-dial__actions{flex-direction:column;top:calc(100% + .5rem);left:50%;transform:translate(-50%)}.kpt-speed-dial[data-direction=left] .kpt-speed-dial__actions{flex-direction:row-reverse;right:calc(100% + .5rem);top:50%;transform:translateY(-50%)}.kpt-speed-dial[data-direction=right] .kpt-speed-dial__actions{flex-direction:row;left:calc(100% + .5rem);top:50%;transform:translateY(-50%)}.kpt-speed-dial__action{display:inline-flex;align-items:center;gap:var(--kpt-space-2, .5rem);height:2.5rem;padding-inline:var(--kpt-space-3, .75rem);border:0;border-radius:999px;background:var(--kpt-color-surface-raised);color:var(--kpt-color-on-surface);box-shadow:var(--kpt-elevation-2);cursor:pointer;white-space:nowrap}.kpt-speed-dial__action:hover:not(:disabled){background:var(--kpt-color-muted)}.kpt-speed-dial__action:disabled{opacity:.5;cursor:not-allowed}.kpt-speed-dial__label{font-size:var(--kpt-font-size-sm, .875rem)}.kpt-speed-dial__backdrop{position:fixed;inset:0;z-index:var(--kpt-z-overlay, 1000)}}\n"] }]
|
|
13401
|
-
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }],
|
|
14494
|
+
}], null, { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] }); })();
|
|
13402
14495
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptSpeedDial, { className: "KptSpeedDial", filePath: "lib/speed-dial/speed-dial.component.ts", lineNumber: 39 }); })();
|
|
13403
14496
|
|
|
13404
14497
|
/*
|
|
@@ -13410,5 +14503,5 @@ class KptSpeedDial {
|
|
|
13410
14503
|
* Generated bundle index. Do not edit.
|
|
13411
14504
|
*/
|
|
13412
14505
|
|
|
13413
|
-
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 };
|
|
14506
|
+
export { KPT_BREAKPOINTS, KPT_FORM_FIELD_CONTROL, KPT_I18N_CONFIG, KPT_MESSAGES_EN, KPT_MESSAGES_PL, KptAccordion, KptAccordionPanel, KptAlert, KptAppShell, KptAuth, KptAuthProviderDef, 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 };
|
|
13414
14507
|
//# sourceMappingURL=konce-pt-angular.mjs.map
|