skcr-autechre 0.0.1 → 1.0.0

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.
@@ -1,29 +1,44 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, input, model, signal, computed, inject, ElementRef, viewChild, effect, output } from '@angular/core';
3
- import { trigger, transition, style, animate } from '@angular/animations';
2
+ import { input, model, signal, computed, inject, ElementRef, viewChild, effect, Component, output, ViewChild, Injectable, contentChild, contentChildren, booleanAttribute, HostBinding, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
3
+ import { trigger, transition, style, animate, group, query, animateChild } from '@angular/animations';
4
4
  import * as i1 from '@angular/forms';
5
- import { FormsModule } from '@angular/forms';
6
- import { NgClass } from '@angular/common';
5
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
6
+ import { NgClass, NgTemplateOutlet } from '@angular/common';
7
7
  import * as i2 from '@angular/cdk/scrolling';
8
- import { ScrollingModule } from '@angular/cdk/scrolling';
8
+ import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
9
9
  import { NgIcon } from '@ng-icons/core';
10
+ import * as i1$1 from '@angular/material/datepicker';
11
+ import { MatDatepickerModule } from '@angular/material/datepicker';
12
+ import { MatInputModule } from '@angular/material/input';
13
+ import { MatFormFieldModule } from '@angular/material/form-field';
14
+ import { DateAdapter, MatNativeDateModule, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
15
+ import { Subject } from 'rxjs';
10
16
 
11
- class Autechre {
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Autechre, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: Autechre, isStandalone: true, selector: "lib-autechre", ngImport: i0, template: `
14
- <p>
15
- autechre works!
16
- </p>
17
- `, isInline: true, styles: [""] }); }
18
- }
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Autechre, decorators: [{
20
- type: Component,
21
- args: [{ selector: 'lib-autechre', imports: [], template: `
22
- <p>
23
- autechre works!
24
- </p>
25
- ` }]
26
- }] });
17
+ var ESortDirection;
18
+ (function (ESortDirection) {
19
+ ESortDirection["Ascending"] = "ascending";
20
+ ESortDirection["Descending"] = "descending";
21
+ ESortDirection["None"] = "none";
22
+ })(ESortDirection || (ESortDirection = {}));
23
+
24
+ var EButtonColorVariant$1;
25
+ (function (EButtonColorVariant) {
26
+ EButtonColorVariant["Primary"] = "btn-primary";
27
+ EButtonColorVariant["Danger"] = "btn-danger";
28
+ })(EButtonColorVariant$1 || (EButtonColorVariant$1 = {}));
29
+
30
+ var EConfirmLevelVariant;
31
+ (function (EConfirmLevelVariant) {
32
+ EConfirmLevelVariant["Danger"] = "danger";
33
+ EConfirmLevelVariant["Info"] = "info";
34
+ EConfirmLevelVariant["Success"] = "success";
35
+ })(EConfirmLevelVariant || (EConfirmLevelVariant = {}));
36
+
37
+ var EModalCloseCondition;
38
+ (function (EModalCloseCondition) {
39
+ EModalCloseCondition["SubmitSuccess"] = "SubmitSuccess";
40
+ EModalCloseCondition["Close"] = "close";
41
+ })(EModalCloseCondition || (EModalCloseCondition = {}));
27
42
 
28
43
  class MultiSelectComponent {
29
44
  constructor() {
@@ -311,13 +326,891 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
311
326
  ], template: "<button\n class=\"btn btn-large w-full\"\n type=\"button\"\n [class]=\"colorVariant()\"\n [ngClass]=\"{\n 'btn-success': isSuccessIconDisplayed(),\n 'btn-full': isFullWidth(),\n }\"\n [disabled]=\"isLoading() || isSuccessIconDisplayed() || isDisabled()\"\n (click)=\"handleCLick()\"\n>\n @if (isLoading()) {\n <span class=\"spinner\"></span>\n }\n\n @if (isSuccessIconDisplayed()) {\n <span class=\"flex items-center justify-center text-inherit\">\n <ng-icon\n name=\"heroCheck\"\n size=\"20px\"\n />\n </span>\n }\n\n @if (!isLoading() && !isSuccessIconDisplayed()) {\n {{ label() }}\n }\n</button>\n", styles: [".spinner{display:inline-block;border-radius:50%;width:1em;height:1em;border:.215em solid transparent;vertical-align:middle;font-size:16px;border-top-color:#fff;animation:spin 1s cubic-bezier(.55,.15,.45,.85) infinite}.btn.btn-success{line-height:0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
312
327
  }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], isFullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFullWidth", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], isSuccess: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSuccess", required: false }] }], colorVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorVariant", required: false }] }], submitClicked: [{ type: i0.Output, args: ["submitClicked"] }] } });
313
328
 
314
- /*
315
- * Public API Surface of autechre
316
- */
329
+ class CheckboxComponent {
330
+ constructor() {
331
+ this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
332
+ this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
333
+ this.subLabel = input('', ...(ngDevMode ? [{ debugName: "subLabel" }] : []));
334
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
335
+ this.isWithFullSpace = input(false, ...(ngDevMode ? [{ debugName: "isWithFullSpace" }] : []));
336
+ this.isLabelLeft = input(false, ...(ngDevMode ? [{ debugName: "isLabelLeft" }] : []));
337
+ this.checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
338
+ }
339
+ handleToggleClick() {
340
+ if (!this.isDisabled()) {
341
+ this.checked.update(currentValue => !currentValue);
342
+ }
343
+ }
344
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
345
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: CheckboxComponent, isStandalone: true, selector: "skcr-checkbox", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, subLabel: { classPropertyName: "subLabel", publicName: "subLabel", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isWithFullSpace: { classPropertyName: "isWithFullSpace", publicName: "isWithFullSpace", isSignal: true, isRequired: false, transformFunction: null }, isLabelLeft: { classPropertyName: "isLabelLeft", publicName: "isLabelLeft", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, ngImport: i0, template: "<div\n class=\"flex items-center gap-2\"\n [class.flex-row-reverse]=\"!isLabelLeft()\"\n [ngClass]=\"{\n 'justify-between': isWithFullSpace(),\n }\"\n>\n <div class=\"flex flex-col gap-1\">\n <label\n [ngClass]=\"{\n 'opacity-50': isDisabled(),\n 'cursor-pointer': !isDisabled(),\n }\"\n [for]=\"name()\"\n >\n {{ label() }}\n </label>\n\n @if (subLabel()) {\n <p class=\"text-slate-500\">\n {{ subLabel() }}\n </p>\n }\n </div>\n\n <button\n class=\"relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:outline-hidden\"\n type=\"button\"\n [ngClass]=\"{\n 'bg-primary': checked(),\n 'bg-slate-200': !checked(),\n 'opacity-50 cursor-not-allowed': isDisabled(),\n }\"\n role=\"switch\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n (click)=\"handleToggleClick()\"\n [id]=\"name()\"\n >\n <span class=\"sr-only\">\n {{ label() }}\n </span>\n\n <span\n [class]=\"\n 'pointer-events-none inline-block size-5 transform rounded-full bg-white shadow-sm ring-0 transition duration-200 ease-in-out ' +\n (checked() ? 'translate-x-5' : 'translate-x-0')\n \"\n aria-hidden=\"true\"\n ></span>\n </button>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
346
+ }
347
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: CheckboxComponent, decorators: [{
348
+ type: Component,
349
+ args: [{ selector: 'skcr-checkbox', imports: [
350
+ NgClass,
351
+ ], template: "<div\n class=\"flex items-center gap-2\"\n [class.flex-row-reverse]=\"!isLabelLeft()\"\n [ngClass]=\"{\n 'justify-between': isWithFullSpace(),\n }\"\n>\n <div class=\"flex flex-col gap-1\">\n <label\n [ngClass]=\"{\n 'opacity-50': isDisabled(),\n 'cursor-pointer': !isDisabled(),\n }\"\n [for]=\"name()\"\n >\n {{ label() }}\n </label>\n\n @if (subLabel()) {\n <p class=\"text-slate-500\">\n {{ subLabel() }}\n </p>\n }\n </div>\n\n <button\n class=\"relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:outline-hidden\"\n type=\"button\"\n [ngClass]=\"{\n 'bg-primary': checked(),\n 'bg-slate-200': !checked(),\n 'opacity-50 cursor-not-allowed': isDisabled(),\n }\"\n role=\"switch\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n (click)=\"handleToggleClick()\"\n [id]=\"name()\"\n >\n <span class=\"sr-only\">\n {{ label() }}\n </span>\n\n <span\n [class]=\"\n 'pointer-events-none inline-block size-5 transform rounded-full bg-white shadow-sm ring-0 transition duration-200 ease-in-out ' +\n (checked() ? 'translate-x-5' : 'translate-x-0')\n \"\n aria-hidden=\"true\"\n ></span>\n </button>\n</div>\n" }]
352
+ }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], subLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "subLabel", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], isWithFullSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "isWithFullSpace", required: false }] }], isLabelLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLabelLeft", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }] } });
353
+
354
+ class CheckboxClassicComponent {
355
+ constructor() {
356
+ this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
357
+ this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
358
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
359
+ this.checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
360
+ }
361
+ handleToggleClick() {
362
+ if (!this.isDisabled()) {
363
+ this.checked.set(!this.checked());
364
+ }
365
+ }
366
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: CheckboxClassicComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
367
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: CheckboxClassicComponent, isStandalone: true, selector: "skcr-checkbox-classic", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, ngImport: i0, template: "<div class=\"flex gap-1.5 items-center\" (click)=\"handleToggleClick()\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input\n class=\"col-start-1 row-start-1 appearance-none rounded-sm border border-border-color bg-white checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:border-border-color disabled:bg-slate-50 disabled:checked:bg-slate-50\"\n type=\"checkbox\"\n [id]=\"name()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n />\n\n <svg\n class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-disabled:stroke-slate-950/25 dark:group-has-disabled:stroke-white/25\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n >\n <path\n class=\"opacity-0 group-has-checked:opacity-100\"\n d=\"M3 8L6 11L11 3.5\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n class=\"opacity-0 group-has-indeterminate:opacity-100\"\n d=\"M3 7H11\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n\n <label\n class=\"leading-none cursor-pointer\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n [class.opacity-50]=\"isDisabled()\"\n >\n {{ label() }} {{ checked() }}\n </label>\n</div>\n" }); }
368
+ }
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: CheckboxClassicComponent, decorators: [{
370
+ type: Component,
371
+ args: [{ selector: 'skcr-checkbox-classic', template: "<div class=\"flex gap-1.5 items-center\" (click)=\"handleToggleClick()\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input\n class=\"col-start-1 row-start-1 appearance-none rounded-sm border border-border-color bg-white checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:border-border-color disabled:bg-slate-50 disabled:checked:bg-slate-50\"\n type=\"checkbox\"\n [id]=\"name()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n />\n\n <svg\n class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-disabled:stroke-slate-950/25 dark:group-has-disabled:stroke-white/25\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n >\n <path\n class=\"opacity-0 group-has-checked:opacity-100\"\n d=\"M3 8L6 11L11 3.5\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n class=\"opacity-0 group-has-indeterminate:opacity-100\"\n d=\"M3 7H11\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n\n <label\n class=\"leading-none cursor-pointer\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n [class.opacity-50]=\"isDisabled()\"\n >\n {{ label() }} {{ checked() }}\n </label>\n</div>\n" }]
372
+ }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }] } });
373
+
374
+ class SelectComponent {
375
+ constructor() {
376
+ this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
377
+ this.options = input.required(...(ngDevMode ? [{ debugName: "options" }] : []));
378
+ this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
379
+ this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
380
+ this.isInvalid = input(false, ...(ngDevMode ? [{ debugName: "isInvalid" }] : []));
381
+ this.isSearchDisplayed = input(false, ...(ngDevMode ? [{ debugName: "isSearchDisplayed" }] : []));
382
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
383
+ this.isOptional = input(false, ...(ngDevMode ? [{ debugName: "isOptional" }] : []));
384
+ this.isFullWidth = input(false, ...(ngDevMode ? [{ debugName: "isFullWidth" }] : []));
385
+ this.isShort = input(false, ...(ngDevMode ? [{ debugName: "isShort" }] : []));
386
+ this.isResetDisplayed = input(true, ...(ngDevMode ? [{ debugName: "isResetDisplayed" }] : []));
387
+ this.searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
388
+ this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
389
+ this.dropdownTop = 0;
390
+ this.dropdownLeft = 0;
391
+ this.dropdownWidth = 0;
392
+ this.formattedOptions = computed(() => {
393
+ let formattedOptions = this.options() || [];
394
+ if (formattedOptions[0]?.value === undefined) {
395
+ formattedOptions = formattedOptions.map(option => {
396
+ return {
397
+ ...option,
398
+ value: option.id,
399
+ };
400
+ });
401
+ }
402
+ return formattedOptions;
403
+ }, ...(ngDevMode ? [{ debugName: "formattedOptions" }] : []));
404
+ this.displayedValue = computed(() => {
405
+ let displayedValue;
406
+ if (this.value() !== null && this.value() !== undefined) {
407
+ displayedValue = this.formattedOptions().find(option => option.value === this.value()).name;
408
+ }
409
+ else {
410
+ if (this.placeholder) {
411
+ displayedValue = this.placeholder();
412
+ }
413
+ else if (this.isOptional()) {
414
+ displayedValue = 'None';
415
+ }
416
+ else {
417
+ displayedValue = 'To select';
418
+ }
419
+ }
420
+ return displayedValue;
421
+ }, ...(ngDevMode ? [{ debugName: "displayedValue" }] : []));
422
+ this.filteredOptions = computed(() => {
423
+ const normalizedQuery = this.normalizeString(this.searchTerm());
424
+ return this.formattedOptions().filter(option => {
425
+ return this.normalizeString(option.name).includes(normalizedQuery);
426
+ });
427
+ }, ...(ngDevMode ? [{ debugName: "filteredOptions" }] : []));
428
+ this.elRef = inject(ElementRef);
429
+ this.clickOutsideHandler = (e) => {
430
+ if (!this.elRef.nativeElement.contains(e.target) && this.isOpen()) {
431
+ this.toggleSelect();
432
+ }
433
+ };
434
+ }
435
+ toggleSelect() {
436
+ if (this.isSearchDisplayed()) {
437
+ this.searchTerm.set('');
438
+ }
439
+ this.isOpen.update(isOpen => !isOpen);
440
+ if (this.isOpen()) {
441
+ this.updateDropdownPosition();
442
+ document.addEventListener('click', this.clickOutsideHandler);
443
+ setTimeout(() => {
444
+ if (this.isSearchDisplayed()) {
445
+ this.searchInput.nativeElement.focus();
446
+ }
447
+ });
448
+ }
449
+ else if (!this.isOpen) {
450
+ document.removeEventListener('click', this.clickOutsideHandler);
451
+ }
452
+ }
453
+ optionByValue(index, option) {
454
+ return option.value;
455
+ }
456
+ onSearchTermInput(event) {
457
+ this.searchTerm.set(event.target.value);
458
+ }
459
+ handleOptionClick(item, event) {
460
+ if (this.isOptional() && this.value() === item.value) {
461
+ this.value.set(null);
462
+ }
463
+ else {
464
+ this.value.set(item.value);
465
+ }
466
+ this.toggleSelect();
467
+ event.preventDefault();
468
+ }
469
+ isItemSelected(item) {
470
+ return this.value() === item.value;
471
+ }
472
+ getSelectedOption() {
473
+ return this.formattedOptions().find(option => option.value === this.value());
474
+ }
475
+ clearSelection(event) {
476
+ this.value.set(null);
477
+ event.stopPropagation();
478
+ }
479
+ normalizeString(value) {
480
+ return value
481
+ .normalize('NFD')
482
+ .replace(/[\u0300-\u036f]/g, '')
483
+ .toLocaleLowerCase();
484
+ }
485
+ updateDropdownPosition() {
486
+ const buttonElement = this.elRef.nativeElement.querySelector('button');
487
+ if (buttonElement) {
488
+ const rect = buttonElement.getBoundingClientRect();
489
+ this.dropdownTop = rect.bottom + window.scrollY;
490
+ this.dropdownLeft = rect.left + window.scrollX;
491
+ this.dropdownWidth = rect.width;
492
+ }
493
+ }
494
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
495
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: SelectComponent, isStandalone: true, selector: "skcr-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, isInvalid: { classPropertyName: "isInvalid", publicName: "isInvalid", isSignal: true, isRequired: false, transformFunction: null }, isSearchDisplayed: { classPropertyName: "isSearchDisplayed", publicName: "isSearchDisplayed", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isOptional: { classPropertyName: "isOptional", publicName: "isOptional", isSignal: true, isRequired: false, transformFunction: null }, isFullWidth: { classPropertyName: "isFullWidth", publicName: "isFullWidth", isSignal: true, isRequired: false, transformFunction: null }, isShort: { classPropertyName: "isShort", publicName: "isShort", isSignal: true, isRequired: false, transformFunction: null }, isResetDisplayed: { classPropertyName: "isResetDisplayed", publicName: "isResetDisplayed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }], ngImport: i0, template: "<div>\n @if (label()) {\n <label class=\"flex items-center gap-2\">\n {{ label() }}\n\n @if (isOptional()) {\n <span class=\"text-xs text-slate-500\">\n {{ 'Optional' }}\n </span>\n }\n </label>\n }\n\n <div\n class=\"relative\"\n [ngClass]=\"{\n 'w-fit min-w-[180px]': isShort(),\n 'w-full': isFullWidth(),\n 'mt-1': label(),\n }\"\n >\n <button\n class=\"grid w-full shadow-sm cursor-default grid-cols-1 rounded-md py-2 px-3 text-left outline-1 -outline-offset-1 outline-border-color focus:outline-2 focus:-outline-offset-2 focus:outline-primary\"\n (click)=\"toggleSelect()\"\n [disabled]=\"isDisabled() || !options().length\"\n [ngClass]=\"{\n 'border-destructive focus:border-destructive focus:ring-destructive': isInvalid(),\n 'border-border-color focus:border-primaryBlue focus:ring-primaryBlue': !isInvalid(),\n 'cursor-not-allowed bg-slate-50': isDisabled() || !options().length,\n 'cursor-pointer bg-white': !isDisabled() && !!options().length,\n }\"\n type=\"button\"\n aria-expanded=\"true\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"multiselect-label\"\n >\n <span\n class=\"col-start-1 row-start-1 flex items-center gap-2 truncate pr-6\"\n [ngClass]=\"{\n 'text-slate-400': !this.value(),\n }\"\n >\n {{ this.displayedValue() }}\n </span>\n\n <span class=\"col-start-1 row-start-1 flex items-center gap-2 self-center justify-self-end text-slate-500\">\n @if (isResetDisplayed() && value() !== null && value() !== undefined) {\n <span\n class=\"size-5 sm:size-4 cursor-pointer\"\n (click)=\"clearSelection($event)\"\n >\n <ng-icon name=\"heroXMark\" />\n </span>\n }\n <span class=\"size-5 sm:size-4\">\n <ng-icon name=\"heroChevronUpDown\" />\n </span>\n </span>\n </button>\n\n @if (isOpen()) {\n <ul\n class=\"fixed z-50 max-h-60 overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-body-small\"\n [style.top.px]=\"dropdownTop\"\n [style.left.px]=\"dropdownLeft\"\n [style.width.px]=\"dropdownWidth\"\n @AnimationTrigger0\n role=\"listbox\"\n >\n @if (isSearchDisplayed()) {\n <li class=\"relative cursor-default py-2 px-3 shadow-sm select-none\">\n <div class=\"pointer-events-none absolute inset-y-0 left-1 flex items-center pl-3\">\n <span class=\"flex items-center\">\n <ng-icon name=\"heroMagnifyingGlass\" />\n </span>\n </div>\n\n <input\n class=\"block rounded-md w-full pl-6 pr-3 py-2 text-body-small shadow-sm outline-1 -outline-offset-1 outline-border-color focus:outline-2 focus:-outline-offset-2 focus:outline-primary placeholder:text-slate-500\"\n #searchInput\n type=\"text\"\n [value]=\"searchTerm()\"\n (input)=\"onSearchTermInput($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n </li>\n }\n\n @for (option of filteredOptions(); track optionByValue(i, option); let i = $index) {\n <li\n class=\"relative cursor-pointer select-none py-2 pl-8 pr-4 text-left hover:bg-primary-50\"\n (click)=\"handleOptionClick(option, $event)\"\n [id]=\"'listbox-option-' + i\"\n role=\"option\"\n [attr.aria-selected]=\"isItemSelected(option)\"\n >\n <span\n class=\"flex items-center gap-2 truncate\"\n [ngClass]=\"{\n 'font-semibold': isItemSelected(option),\n 'font-normal': !isItemSelected(option),\n }\"\n >\n {{ option.name }}\n @if (option.icon) {\n <img\n class=\"size-4\"\n [src]=\"'assets/icons/' + option.icon + '.svg'\"\n alt=\"\"\n />\n }\n </span>\n\n @if (isItemSelected(option)) {\n <span class=\"absolute inset-y-0 right-0 flex items-center pr-4 text-primary\">\n <ng-icon name=\"heroCheck\" />\n </span>\n }\n </li>\n }\n </ul>\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "ngmodule", type: FormsModule }], animations: [
496
+ trigger('AnimationTrigger0', [
497
+ transition(':leave', [
498
+ style({ opacity: 1 }),
499
+ animate('200ms ease-in-out', style({ opacity: 0 })),
500
+ ]),
501
+ ]),
502
+ ] }); }
503
+ }
504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SelectComponent, decorators: [{
505
+ type: Component,
506
+ args: [{ selector: 'skcr-select', animations: [
507
+ trigger('AnimationTrigger0', [
508
+ transition(':leave', [
509
+ style({ opacity: 1 }),
510
+ animate('200ms ease-in-out', style({ opacity: 0 })),
511
+ ]),
512
+ ]),
513
+ ], imports: [
514
+ NgClass,
515
+ NgIcon,
516
+ FormsModule,
517
+ ], template: "<div>\n @if (label()) {\n <label class=\"flex items-center gap-2\">\n {{ label() }}\n\n @if (isOptional()) {\n <span class=\"text-xs text-slate-500\">\n {{ 'Optional' }}\n </span>\n }\n </label>\n }\n\n <div\n class=\"relative\"\n [ngClass]=\"{\n 'w-fit min-w-[180px]': isShort(),\n 'w-full': isFullWidth(),\n 'mt-1': label(),\n }\"\n >\n <button\n class=\"grid w-full shadow-sm cursor-default grid-cols-1 rounded-md py-2 px-3 text-left outline-1 -outline-offset-1 outline-border-color focus:outline-2 focus:-outline-offset-2 focus:outline-primary\"\n (click)=\"toggleSelect()\"\n [disabled]=\"isDisabled() || !options().length\"\n [ngClass]=\"{\n 'border-destructive focus:border-destructive focus:ring-destructive': isInvalid(),\n 'border-border-color focus:border-primaryBlue focus:ring-primaryBlue': !isInvalid(),\n 'cursor-not-allowed bg-slate-50': isDisabled() || !options().length,\n 'cursor-pointer bg-white': !isDisabled() && !!options().length,\n }\"\n type=\"button\"\n aria-expanded=\"true\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"multiselect-label\"\n >\n <span\n class=\"col-start-1 row-start-1 flex items-center gap-2 truncate pr-6\"\n [ngClass]=\"{\n 'text-slate-400': !this.value(),\n }\"\n >\n {{ this.displayedValue() }}\n </span>\n\n <span class=\"col-start-1 row-start-1 flex items-center gap-2 self-center justify-self-end text-slate-500\">\n @if (isResetDisplayed() && value() !== null && value() !== undefined) {\n <span\n class=\"size-5 sm:size-4 cursor-pointer\"\n (click)=\"clearSelection($event)\"\n >\n <ng-icon name=\"heroXMark\" />\n </span>\n }\n <span class=\"size-5 sm:size-4\">\n <ng-icon name=\"heroChevronUpDown\" />\n </span>\n </span>\n </button>\n\n @if (isOpen()) {\n <ul\n class=\"fixed z-50 max-h-60 overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-body-small\"\n [style.top.px]=\"dropdownTop\"\n [style.left.px]=\"dropdownLeft\"\n [style.width.px]=\"dropdownWidth\"\n @AnimationTrigger0\n role=\"listbox\"\n >\n @if (isSearchDisplayed()) {\n <li class=\"relative cursor-default py-2 px-3 shadow-sm select-none\">\n <div class=\"pointer-events-none absolute inset-y-0 left-1 flex items-center pl-3\">\n <span class=\"flex items-center\">\n <ng-icon name=\"heroMagnifyingGlass\" />\n </span>\n </div>\n\n <input\n class=\"block rounded-md w-full pl-6 pr-3 py-2 text-body-small shadow-sm outline-1 -outline-offset-1 outline-border-color focus:outline-2 focus:-outline-offset-2 focus:outline-primary placeholder:text-slate-500\"\n #searchInput\n type=\"text\"\n [value]=\"searchTerm()\"\n (input)=\"onSearchTermInput($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n </li>\n }\n\n @for (option of filteredOptions(); track optionByValue(i, option); let i = $index) {\n <li\n class=\"relative cursor-pointer select-none py-2 pl-8 pr-4 text-left hover:bg-primary-50\"\n (click)=\"handleOptionClick(option, $event)\"\n [id]=\"'listbox-option-' + i\"\n role=\"option\"\n [attr.aria-selected]=\"isItemSelected(option)\"\n >\n <span\n class=\"flex items-center gap-2 truncate\"\n [ngClass]=\"{\n 'font-semibold': isItemSelected(option),\n 'font-normal': !isItemSelected(option),\n }\"\n >\n {{ option.name }}\n @if (option.icon) {\n <img\n class=\"size-4\"\n [src]=\"'assets/icons/' + option.icon + '.svg'\"\n alt=\"\"\n />\n }\n </span>\n\n @if (isItemSelected(option)) {\n <span class=\"absolute inset-y-0 right-0 flex items-center pr-4 text-primary\">\n <ng-icon name=\"heroCheck\" />\n </span>\n }\n </li>\n }\n </ul>\n }\n </div>\n</div>\n" }]
518
+ }], propDecorators: { searchInput: [{
519
+ type: ViewChild,
520
+ args: ['searchInput']
521
+ }], 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: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "isInvalid", required: false }] }], isSearchDisplayed: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSearchDisplayed", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], isOptional: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOptional", required: false }] }], isFullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFullWidth", required: false }] }], isShort: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShort", required: false }] }], isResetDisplayed: [{ type: i0.Input, args: [{ isSignal: true, alias: "isResetDisplayed", required: false }] }] } });
522
+
523
+ class LoaderComponent {
524
+ constructor() {
525
+ this.size = input('xl', ...(ngDevMode ? [{ debugName: "size" }] : []));
526
+ this.isNotAbsolute = input(false, ...(ngDevMode ? [{ debugName: "isNotAbsolute" }] : []));
527
+ }
528
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
529
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: LoaderComponent, isStandalone: true, selector: "app-loader", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, isNotAbsolute: { classPropertyName: "isNotAbsolute", publicName: "isNotAbsolute", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"'loader ' + size\"></div>\n", styles: [".loader{width:100px;aspect-ratio:1;display:grid;border:4px solid rgba(0,0,0,0);border-radius:50%;border-right-color:var(--color-primary-l);animation:l15 1s infinite linear}.loader:before,.loader:after{content:\"\";grid-area:1/1;margin:2px;border:inherit;border-radius:50%;animation:l15 2s infinite}.loader:after{margin:8px;animation-duration:3s}@keyframes l15{to{transform:rotate(1turn)}}\n"] }); }
530
+ }
531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LoaderComponent, decorators: [{
532
+ type: Component,
533
+ args: [{ selector: 'app-loader', template: "<div [class]=\"'loader ' + size\"></div>\n", styles: [".loader{width:100px;aspect-ratio:1;display:grid;border:4px solid rgba(0,0,0,0);border-radius:50%;border-right-color:var(--color-primary-l);animation:l15 1s infinite linear}.loader:before,.loader:after{content:\"\";grid-area:1/1;margin:2px;border:inherit;border-radius:50%;animation:l15 2s infinite}.loader:after{margin:8px;animation-duration:3s}@keyframes l15{to{transform:rotate(1turn)}}\n"] }]
534
+ }], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], isNotAbsolute: [{ type: i0.Input, args: [{ isSignal: true, alias: "isNotAbsolute", required: false }] }] } });
535
+
536
+ class TooltipService {
537
+ constructor() {
538
+ this.activeTooltip = null;
539
+ }
540
+ showTooltip(event, content) {
541
+ this.hideTooltip();
542
+ const tooltip = document.createElement('div');
543
+ tooltip.className =
544
+ 'bg-gray-800 text-white p-2 rounded text-xs max-w-md whitespace-normal z-[9999] fixed pointer-events-none';
545
+ tooltip.style.visibility = 'visible';
546
+ tooltip.textContent = content;
547
+ tooltip.style.left = event.clientX + 10 + 'px';
548
+ tooltip.style.top = event.clientY - 30 + 'px';
549
+ document.body.appendChild(tooltip);
550
+ this.activeTooltip = tooltip;
551
+ }
552
+ hideTooltip() {
553
+ if (this.activeTooltip) {
554
+ document.body.removeChild(this.activeTooltip);
555
+ this.activeTooltip = null;
556
+ }
557
+ }
558
+ updateTooltipPosition(event) {
559
+ if (this.activeTooltip) {
560
+ this.activeTooltip.style.left = event.clientX + 10 + 'px';
561
+ this.activeTooltip.style.top = event.clientY - 30 + 'px';
562
+ }
563
+ }
564
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TooltipService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
565
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TooltipService, providedIn: 'root' }); }
566
+ }
567
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TooltipService, decorators: [{
568
+ type: Injectable,
569
+ args: [{
570
+ providedIn: 'root',
571
+ }]
572
+ }] });
573
+
574
+ class TableHeaderCellComponent {
575
+ constructor() {
576
+ this.name = input.required(...(ngDevMode ? [{ debugName: "name" }] : []));
577
+ this.sortDirection = input(ESortDirection.None, ...(ngDevMode ? [{ debugName: "sortDirection" }] : []));
578
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
579
+ this.isOrderByDisplayed = input(false, ...(ngDevMode ? [{ debugName: "isOrderByDisplayed" }] : []));
580
+ this.disabledText = input('Sorting is possible on this value only for query with less than 10000 results.', ...(ngDevMode ? [{ debugName: "disabledText" }] : []));
581
+ this.clickEvent = output();
582
+ this.tooltipService = inject(TooltipService);
583
+ this.ESortDirection = ESortDirection;
584
+ }
585
+ emitClickEvent() {
586
+ if (!this.isDisabled()) {
587
+ this.clickEvent.emit();
588
+ }
589
+ }
590
+ showTooltip(event, content) {
591
+ this.tooltipService.showTooltip(event, content);
592
+ }
593
+ hideTooltip() {
594
+ this.tooltipService.hideTooltip();
595
+ }
596
+ updateTooltipPosition(event) {
597
+ this.tooltipService.updateTooltipPosition(event);
598
+ }
599
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TableHeaderCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
600
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TableHeaderCellComponent, isStandalone: true, selector: "skcr-table-header-cell", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isOrderByDisplayed: { classPropertyName: "isOrderByDisplayed", publicName: "isOrderByDisplayed", isSignal: true, isRequired: false, transformFunction: null }, disabledText: { classPropertyName: "disabledText", publicName: "disabledText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickEvent: "clickEvent" }, ngImport: i0, template: "<div>\n <button\n class=\"flex items-center gap-1.5 text-start text-caption font-medium text-slate-500\"\n type=\"button\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n [class.opacity-50]=\"isDisabled()\"\n (click)=\"!isDisabled() && emitClickEvent()\"\n (mouseenter)=\"isDisabled() ? showTooltip($event, disabledText()) : null\"\n (mouseleave)=\"isDisabled() ? hideTooltip() : null\"\n (mousemove)=\"isDisabled() ? updateTooltipPosition($event) : null\"\n >\n <span\n class=\"inline-block whitespace-normal break-words leading-tight\"\n [class.w-[150px]]=\"isOrderByDisplayed()\"\n [class.w-[144px]]=\"!isOrderByDisplayed()\"\n >\n <ng-content></ng-content>\n </span>\n\n @if (isOrderByDisplayed()) {\n <div class=\"shrink-0 flex items-center\">\n <div class=\"shrink-0 flex items-center relative\">\n @switch (sortDirection()) {\n @case (ESortDirection.Ascending) {\n <ng-icon\n class=\"absolute transition-opacity duration-300\"\n name=\"heroChevronUp\"\n @fadeIn\n aria-hidden=\"true\"\n ></ng-icon>\n }\n @case (ESortDirection.Descending) {\n <ng-icon\n class=\"absolute transition-opacity duration-300\"\n name=\"heroChevronDown\"\n @fadeIn\n aria-hidden=\"true\"\n ></ng-icon>\n }\n @case (ESortDirection.None) {\n <ng-icon\n class=\"absolute transition-opacity duration-300\"\n name=\"heroChevronUpDown\"\n @fadeIn\n aria-hidden=\"true\"\n ></ng-icon>\n }\n }\n </div>\n </div>\n }\n </button>\n</div>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], animations: [
601
+ trigger('fadeIn', [
602
+ transition(':enter', [
603
+ style({ opacity: 0 }),
604
+ animate('300ms', style({ opacity: 1 })),
605
+ ]),
606
+ ]),
607
+ ] }); }
608
+ }
609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TableHeaderCellComponent, decorators: [{
610
+ type: Component,
611
+ args: [{ selector: 'skcr-table-header-cell', imports: [
612
+ NgIcon,
613
+ ], animations: [
614
+ trigger('fadeIn', [
615
+ transition(':enter', [
616
+ style({ opacity: 0 }),
617
+ animate('300ms', style({ opacity: 1 })),
618
+ ]),
619
+ ]),
620
+ ], template: "<div>\n <button\n class=\"flex items-center gap-1.5 text-start text-caption font-medium text-slate-500\"\n type=\"button\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n [class.opacity-50]=\"isDisabled()\"\n (click)=\"!isDisabled() && emitClickEvent()\"\n (mouseenter)=\"isDisabled() ? showTooltip($event, disabledText()) : null\"\n (mouseleave)=\"isDisabled() ? hideTooltip() : null\"\n (mousemove)=\"isDisabled() ? updateTooltipPosition($event) : null\"\n >\n <span\n class=\"inline-block whitespace-normal break-words leading-tight\"\n [class.w-[150px]]=\"isOrderByDisplayed()\"\n [class.w-[144px]]=\"!isOrderByDisplayed()\"\n >\n <ng-content></ng-content>\n </span>\n\n @if (isOrderByDisplayed()) {\n <div class=\"shrink-0 flex items-center\">\n <div class=\"shrink-0 flex items-center relative\">\n @switch (sortDirection()) {\n @case (ESortDirection.Ascending) {\n <ng-icon\n class=\"absolute transition-opacity duration-300\"\n name=\"heroChevronUp\"\n @fadeIn\n aria-hidden=\"true\"\n ></ng-icon>\n }\n @case (ESortDirection.Descending) {\n <ng-icon\n class=\"absolute transition-opacity duration-300\"\n name=\"heroChevronDown\"\n @fadeIn\n aria-hidden=\"true\"\n ></ng-icon>\n }\n @case (ESortDirection.None) {\n <ng-icon\n class=\"absolute transition-opacity duration-300\"\n name=\"heroChevronUpDown\"\n @fadeIn\n aria-hidden=\"true\"\n ></ng-icon>\n }\n }\n </div>\n </div>\n }\n </button>\n</div>\n" }]
621
+ }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], isOrderByDisplayed: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOrderByDisplayed", required: false }] }], disabledText: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledText", required: false }] }], clickEvent: [{ type: i0.Output, args: ["clickEvent"] }] } });
622
+
623
+ class TableComponent {
624
+ constructor() {
625
+ this.itemsList = input.required(...(ngDevMode ? [{ debugName: "itemsList" }] : []));
626
+ this.isContentLoading = input(false, ...(ngDevMode ? [{ debugName: "isContentLoading" }] : []));
627
+ this.columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : []));
628
+ this.columnCategories = input(...(ngDevMode ? [undefined, { debugName: "columnCategories" }] : []));
629
+ this.noRowsMessage = input('', ...(ngDevMode ? [{ debugName: "noRowsMessage" }] : []));
630
+ this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
631
+ this.fixedColumnsCount = input(0, ...(ngDevMode ? [{ debugName: "fixedColumnsCount" }] : []));
632
+ this.selectedItemIds = input(...(ngDevMode ? [undefined, { debugName: "selectedItemIds" }] : []));
633
+ this.tableEndClose = output();
634
+ this.headerCellTemplateRef = contentChild('headerCell', ...(ngDevMode ? [{ debugName: "headerCellTemplateRef" }] : []));
635
+ this.rowCellTemplateRef = contentChild('rowCell', ...(ngDevMode ? [{ debugName: "rowCellTemplateRef" }] : []));
636
+ this.sortButtons = contentChildren(TableHeaderCellComponent, ...(ngDevMode ? [{ debugName: "sortButtons" }] : []));
637
+ this.sortingItem = computed(() => {
638
+ const sortButtons = this.sortButtons();
639
+ const sortingButton = sortButtons.find(button => button.sortDirection() !== ESortDirection.None);
640
+ return sortingButton
641
+ ? {
642
+ column: sortingButton.name(),
643
+ direction: sortingButton.sortDirection(),
644
+ }
645
+ : null;
646
+ }, ...(ngDevMode ? [{ debugName: "sortingItem" }] : []));
647
+ }
648
+ get inverseOfTranslation() {
649
+ if (!this.viewPort || !this.viewPort['_renderedContentOffset']) {
650
+ return '-0px';
651
+ }
652
+ let offset = this.viewPort['_renderedContentOffset'];
653
+ return `-${offset}px`;
654
+ }
655
+ onScroll(index) {
656
+ const bufferZone = 250;
657
+ if (index + bufferZone > this.itemsList().length) {
658
+ this.tableEndClose.emit();
659
+ }
660
+ }
661
+ scrollToTop() {
662
+ this.viewPort.scrollToIndex(0);
663
+ }
664
+ refreshViewport() {
665
+ if (this.viewPort) {
666
+ this.viewPort.checkViewportSize();
667
+ setTimeout(() => {
668
+ this.viewPort.checkViewportSize();
669
+ }, 100);
670
+ }
671
+ }
672
+ getColumnLeftPosition(columnIndex) {
673
+ if (columnIndex === 0) {
674
+ return '0px';
675
+ }
676
+ const columnWidth = 174;
677
+ return `${columnIndex * columnWidth}px`;
678
+ }
679
+ isRowSelected(item) {
680
+ return this.selectedItemIds()?.has(item['id']) ?? false;
681
+ }
682
+ isCategoryStart(columnIndex) {
683
+ if (!this.columnCategories() || columnIndex === 0) {
684
+ return false;
685
+ }
686
+ const categories = this.columnCategories();
687
+ let currentColumnCount = 0;
688
+ for (const category of categories) {
689
+ if (currentColumnCount === columnIndex) {
690
+ return true;
691
+ }
692
+ currentColumnCount += category.colspan;
693
+ }
694
+ return false;
695
+ }
696
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
697
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TableComponent, isStandalone: true, selector: "skcr-table", inputs: { itemsList: { classPropertyName: "itemsList", publicName: "itemsList", isSignal: true, isRequired: true, transformFunction: null }, isContentLoading: { classPropertyName: "isContentLoading", publicName: "isContentLoading", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, columnCategories: { classPropertyName: "columnCategories", publicName: "columnCategories", isSignal: true, isRequired: false, transformFunction: null }, noRowsMessage: { classPropertyName: "noRowsMessage", publicName: "noRowsMessage", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, fixedColumnsCount: { classPropertyName: "fixedColumnsCount", publicName: "fixedColumnsCount", isSignal: true, isRequired: false, transformFunction: null }, selectedItemIds: { classPropertyName: "selectedItemIds", publicName: "selectedItemIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tableEndClose: "tableEndClose" }, queries: [{ propertyName: "headerCellTemplateRef", first: true, predicate: ["headerCell"], descendants: true, isSignal: true }, { propertyName: "rowCellTemplateRef", first: true, predicate: ["rowCell"], descendants: true, isSignal: true }, { propertyName: "sortButtons", predicate: TableHeaderCellComponent, isSignal: true }], viewQueries: [{ propertyName: "viewPort", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], ngImport: i0, template: "<div class=\"border-collapse overflow-hidden w-full mb-6 flex flex-col h-full\">\n <cdk-virtual-scroll-viewport\n class=\"flex-grow block overflow-y-auto overflow-x-auto\"\n (scrolledIndexChange)=\"onScroll($event)\"\n itemSize=\"52\"\n minBufferPx=\"2080\"\n maxBufferPx=\"4160\"\n >\n <table class=\"w-full relative table-auto whitespace-nowrap\">\n <thead\n class=\"bg-white sticky top-0 z-10 before:content-[''] before:absolute before:bottom-0 before:left-0 before:right-0 before:h-[1px] before:bg-slate-200\"\n [style.top]=\"inverseOfTranslation\"\n >\n @if (columnCategories()) {\n <tr>\n @for (category of columnCategories(); track category; let i = $index) {\n <th\n class=\"py-2 p-3 text-left text-caption text-slate-500\"\n style=\"box-shadow: inset 0 -1px 0 0 rgb(226 232 240)\"\n scope=\"colgroup\"\n [attr.colspan]=\"category.colspan\"\n [style.left]=\"i < fixedColumnsCount() ? getColumnLeftPosition(i) : null\"\n [ngClass]=\"{\n 'pl-5': i === 0,\n 'sticky z-[1] bg-white': i === 0,\n 'border-l border-slate-200': i > 0,\n }\"\n >\n {{ category.label }}\n </th>\n }\n </tr>\n }\n <tr>\n @for (column of columns(); track column; let isLast = $last; let i = $index) {\n <th\n class=\"p-3 text-left text-caption font-medium text-slate-500\"\n style=\"box-shadow: inset 0 -1px 0 0 rgb(226 232 240)\"\n scope=\"col\"\n [attr.aria-sort]=\"sortingItem()?.column === column ? sortingItem()!.direction : null\"\n [ngClass]=\"{\n 'pr-5': isLast,\n 'sticky z-[1] bg-white': i < fixedColumnsCount(),\n 'border-l border-slate-200': isCategoryStart(i),\n }\"\n [style.left]=\"i < fixedColumnsCount() ? getColumnLeftPosition(i) : null\"\n >\n <ng-container *ngTemplateOutlet=\"headerCellTemplateRef()!; context: { column }\"></ng-container>\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @if (isContentLoading()) {\n <td\n class=\"pt-10 sm:px-3\"\n [colSpan]=\"columns().length\"\n >\n <div class=\"flex h-[400px] items-center justify-center\">\n <app-loader [isNotAbsolute]=\"true\"></app-loader>\n </div>\n </td>\n } @else if (!!itemsList().length) {\n <tr\n class=\"height-[50px] border-b border-slate-200\"\n *cdkVirtualFor=\"let item of !isContentLoading() ? itemsList() : []; let index = index\"\n >\n @for (column of columns(); track column; let isFirst = $first; let islast = $last; let i = $index) {\n <td\n class=\"py-4 px-3 text-body-small whitespace-nowrap\"\n [ngClass]=\"{\n 'pr-5': islast,\n 'sticky z-[1]': i < fixedColumnsCount(),\n 'border-l border-slate-200': isCategoryStart(i),\n 'bg-white': !isRowSelected(item),\n 'bg-slate-100': isRowSelected(item),\n }\"\n [class.text-end]=\"column === 'actions'\"\n [style.left]=\"i < fixedColumnsCount() ? getColumnLeftPosition(i) : null\"\n >\n <span class=\"inline-block w-[150px] whitespace-normal break-words leading-tight\">\n <ng-container *ngTemplateOutlet=\"rowCellTemplateRef()!; context: { column, item }\"></ng-container>\n </span>\n </td>\n }\n </tr>\n } @else {\n <td\n class=\"pt-10 sm:px-3\"\n [ngClass]=\"{\n hidden: isContentLoading(),\n }\"\n [colSpan]=\"columns().length\"\n >\n <span class=\"flex items-center justify-center\"> No results </span>\n </td>\n }\n </tbody>\n </table>\n </cdk-virtual-scroll-viewport>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: LoaderComponent, selector: "app-loader", inputs: ["size", "isNotAbsolute"] }] }); }
698
+ }
699
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TableComponent, decorators: [{
700
+ type: Component,
701
+ args: [{ selector: 'skcr-table', imports: [
702
+ NgClass,
703
+ NgTemplateOutlet,
704
+ ScrollingModule,
705
+ LoaderComponent,
706
+ ], template: "<div class=\"border-collapse overflow-hidden w-full mb-6 flex flex-col h-full\">\n <cdk-virtual-scroll-viewport\n class=\"flex-grow block overflow-y-auto overflow-x-auto\"\n (scrolledIndexChange)=\"onScroll($event)\"\n itemSize=\"52\"\n minBufferPx=\"2080\"\n maxBufferPx=\"4160\"\n >\n <table class=\"w-full relative table-auto whitespace-nowrap\">\n <thead\n class=\"bg-white sticky top-0 z-10 before:content-[''] before:absolute before:bottom-0 before:left-0 before:right-0 before:h-[1px] before:bg-slate-200\"\n [style.top]=\"inverseOfTranslation\"\n >\n @if (columnCategories()) {\n <tr>\n @for (category of columnCategories(); track category; let i = $index) {\n <th\n class=\"py-2 p-3 text-left text-caption text-slate-500\"\n style=\"box-shadow: inset 0 -1px 0 0 rgb(226 232 240)\"\n scope=\"colgroup\"\n [attr.colspan]=\"category.colspan\"\n [style.left]=\"i < fixedColumnsCount() ? getColumnLeftPosition(i) : null\"\n [ngClass]=\"{\n 'pl-5': i === 0,\n 'sticky z-[1] bg-white': i === 0,\n 'border-l border-slate-200': i > 0,\n }\"\n >\n {{ category.label }}\n </th>\n }\n </tr>\n }\n <tr>\n @for (column of columns(); track column; let isLast = $last; let i = $index) {\n <th\n class=\"p-3 text-left text-caption font-medium text-slate-500\"\n style=\"box-shadow: inset 0 -1px 0 0 rgb(226 232 240)\"\n scope=\"col\"\n [attr.aria-sort]=\"sortingItem()?.column === column ? sortingItem()!.direction : null\"\n [ngClass]=\"{\n 'pr-5': isLast,\n 'sticky z-[1] bg-white': i < fixedColumnsCount(),\n 'border-l border-slate-200': isCategoryStart(i),\n }\"\n [style.left]=\"i < fixedColumnsCount() ? getColumnLeftPosition(i) : null\"\n >\n <ng-container *ngTemplateOutlet=\"headerCellTemplateRef()!; context: { column }\"></ng-container>\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @if (isContentLoading()) {\n <td\n class=\"pt-10 sm:px-3\"\n [colSpan]=\"columns().length\"\n >\n <div class=\"flex h-[400px] items-center justify-center\">\n <app-loader [isNotAbsolute]=\"true\"></app-loader>\n </div>\n </td>\n } @else if (!!itemsList().length) {\n <tr\n class=\"height-[50px] border-b border-slate-200\"\n *cdkVirtualFor=\"let item of !isContentLoading() ? itemsList() : []; let index = index\"\n >\n @for (column of columns(); track column; let isFirst = $first; let islast = $last; let i = $index) {\n <td\n class=\"py-4 px-3 text-body-small whitespace-nowrap\"\n [ngClass]=\"{\n 'pr-5': islast,\n 'sticky z-[1]': i < fixedColumnsCount(),\n 'border-l border-slate-200': isCategoryStart(i),\n 'bg-white': !isRowSelected(item),\n 'bg-slate-100': isRowSelected(item),\n }\"\n [class.text-end]=\"column === 'actions'\"\n [style.left]=\"i < fixedColumnsCount() ? getColumnLeftPosition(i) : null\"\n >\n <span class=\"inline-block w-[150px] whitespace-normal break-words leading-tight\">\n <ng-container *ngTemplateOutlet=\"rowCellTemplateRef()!; context: { column, item }\"></ng-container>\n </span>\n </td>\n }\n </tr>\n } @else {\n <td\n class=\"pt-10 sm:px-3\"\n [ngClass]=\"{\n hidden: isContentLoading(),\n }\"\n [colSpan]=\"columns().length\"\n >\n <span class=\"flex items-center justify-center\"> No results </span>\n </td>\n }\n </tbody>\n </table>\n </cdk-virtual-scroll-viewport>\n</div>\n" }]
707
+ }], propDecorators: { viewPort: [{
708
+ type: ViewChild,
709
+ args: [CdkVirtualScrollViewport, { static: false }]
710
+ }], itemsList: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsList", required: true }] }], isContentLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isContentLoading", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], columnCategories: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnCategories", required: false }] }], noRowsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noRowsMessage", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], fixedColumnsCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "fixedColumnsCount", required: false }] }], selectedItemIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemIds", required: false }] }], tableEndClose: [{ type: i0.Output, args: ["tableEndClose"] }], headerCellTemplateRef: [{ type: i0.ContentChild, args: ['headerCell', { isSignal: true }] }], rowCellTemplateRef: [{ type: i0.ContentChild, args: ['rowCell', { isSignal: true }] }], sortButtons: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableHeaderCellComponent), { isSignal: true }] }] } });
711
+
712
+ class DialogComponent {
713
+ constructor() {
714
+ this.hasAnimation = true;
715
+ this.isLarge = input(false, ...(ngDevMode ? [{ debugName: "isLarge" }] : []));
716
+ this.isOpen = input(true, { ...(ngDevMode ? { debugName: "isOpen" } : {}), transform: booleanAttribute });
717
+ this.isCloseAnimDone = output();
718
+ this.escapeKeyListener = null;
719
+ this.dialogElement = signal(null, ...(ngDevMode ? [{ debugName: "dialogElement" }] : []));
720
+ }
721
+ set dialogElementComponent(dialogElement) {
722
+ if (dialogElement) {
723
+ this.dialogElement.set(dialogElement);
724
+ dialogElement.nativeElement.showModal();
725
+ this.escapeKeyListener = (event) => {
726
+ console.log(event.key);
727
+ if (event.key === 'Escape') {
728
+ event.preventDefault();
729
+ }
730
+ };
731
+ dialogElement.nativeElement.addEventListener('keydown', this.escapeKeyListener);
732
+ }
733
+ }
734
+ onDialogAnimDone(e) {
735
+ if (e.toState === 'void') {
736
+ const dialogEl = this.dialogElement()?.nativeElement;
737
+ if (dialogEl && this.escapeKeyListener) {
738
+ dialogEl.removeEventListener('keydown', this.escapeKeyListener);
739
+ this.escapeKeyListener = null;
740
+ }
741
+ dialogEl?.close();
742
+ this.dialogElement.set(null);
743
+ this.isCloseAnimDone.emit();
744
+ }
745
+ }
746
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
747
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: DialogComponent, isStandalone: true, selector: "skcr-dialog", inputs: { isLarge: { classPropertyName: "isLarge", publicName: "isLarge", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isCloseAnimDone: "isCloseAnimDone" }, host: { properties: { "@ModalTrigger": "this.hasAnimation" } }, viewQueries: [{ propertyName: "dialogElementComponent", first: true, predicate: ["dialog"], descendants: true }], ngImport: i0, template: "@if (isOpen()) {\n <div\n class=\"fixed inset-0 z-50 bg-slate-500/75 transition-opacity\"\n [@BackdropTrigger]\n ></div>\n\n <dialog\n class=\"z-[60] fixed inset-0 m-auto rounded-lg shadow-xl backdrop:invisible max-h-[90vh] flex flex-col overflow-hidden scrollbar-hide\"\n #dialog\n (cancel)=\"$event.preventDefault()\"\n [@DialogTrigger]\n (@DialogTrigger.done)=\"onDialogAnimDone($event)\"\n [ngClass]=\"{\n 'max-w-lg': !isLarge(),\n 'max-w-4xl': isLarge(),\n }\"\n >\n <ng-content></ng-content>\n </dialog>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
748
+ trigger('DialogTrigger', [
749
+ transition(':enter', [
750
+ style({ opacity: 0, transform: 'translateY(1rem)' }),
751
+ animate('300ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
752
+ ]),
753
+ transition(':leave', [
754
+ style({ opacity: 1, transform: 'translateY(0)' }),
755
+ animate('200ms ease-in', style({ opacity: 0, transform: 'translateY(1rem)' })),
756
+ ]),
757
+ ]),
758
+ trigger('BackdropTrigger', [
759
+ transition(':enter', [
760
+ style({ opacity: 0 }),
761
+ animate('300ms ease-out', style({ opacity: 1 })),
762
+ ]),
763
+ transition(':leave', [
764
+ style({ opacity: 1 }),
765
+ animate('200ms ease-in', style({ opacity: 0 })),
766
+ ]),
767
+ ]),
768
+ trigger('ModalTrigger', [
769
+ transition(':enter', [
770
+ group([
771
+ query('@DialogTrigger', animateChild()),
772
+ query('@BackdropTrigger', animateChild()),
773
+ ]),
774
+ ]),
775
+ transition(':leave', [
776
+ group([
777
+ query('@DialogTrigger', animateChild()),
778
+ query('@BackdropTrigger', animateChild()),
779
+ ]),
780
+ ]),
781
+ ]),
782
+ ] }); }
783
+ }
784
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DialogComponent, decorators: [{
785
+ type: Component,
786
+ args: [{ selector: 'skcr-dialog', animations: [
787
+ trigger('DialogTrigger', [
788
+ transition(':enter', [
789
+ style({ opacity: 0, transform: 'translateY(1rem)' }),
790
+ animate('300ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
791
+ ]),
792
+ transition(':leave', [
793
+ style({ opacity: 1, transform: 'translateY(0)' }),
794
+ animate('200ms ease-in', style({ opacity: 0, transform: 'translateY(1rem)' })),
795
+ ]),
796
+ ]),
797
+ trigger('BackdropTrigger', [
798
+ transition(':enter', [
799
+ style({ opacity: 0 }),
800
+ animate('300ms ease-out', style({ opacity: 1 })),
801
+ ]),
802
+ transition(':leave', [
803
+ style({ opacity: 1 }),
804
+ animate('200ms ease-in', style({ opacity: 0 })),
805
+ ]),
806
+ ]),
807
+ trigger('ModalTrigger', [
808
+ transition(':enter', [
809
+ group([
810
+ query('@DialogTrigger', animateChild()),
811
+ query('@BackdropTrigger', animateChild()),
812
+ ]),
813
+ ]),
814
+ transition(':leave', [
815
+ group([
816
+ query('@DialogTrigger', animateChild()),
817
+ query('@BackdropTrigger', animateChild()),
818
+ ]),
819
+ ]),
820
+ ]),
821
+ ], imports: [
822
+ NgClass,
823
+ ], template: "@if (isOpen()) {\n <div\n class=\"fixed inset-0 z-50 bg-slate-500/75 transition-opacity\"\n [@BackdropTrigger]\n ></div>\n\n <dialog\n class=\"z-[60] fixed inset-0 m-auto rounded-lg shadow-xl backdrop:invisible max-h-[90vh] flex flex-col overflow-hidden scrollbar-hide\"\n #dialog\n (cancel)=\"$event.preventDefault()\"\n [@DialogTrigger]\n (@DialogTrigger.done)=\"onDialogAnimDone($event)\"\n [ngClass]=\"{\n 'max-w-lg': !isLarge(),\n 'max-w-4xl': isLarge(),\n }\"\n >\n <ng-content></ng-content>\n </dialog>\n}\n" }]
824
+ }], propDecorators: { hasAnimation: [{
825
+ type: HostBinding,
826
+ args: ['@ModalTrigger']
827
+ }], isLarge: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLarge", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }], isCloseAnimDone: [{ type: i0.Output, args: ["isCloseAnimDone"] }], dialogElementComponent: [{
828
+ type: ViewChild,
829
+ args: ['dialog', { static: false }]
830
+ }] } });
831
+
832
+ class ModalComponent {
833
+ constructor() {
834
+ this.submitLabel = input('', ...(ngDevMode ? [{ debugName: "submitLabel" }] : []));
835
+ this.isSubmitting = input(false, ...(ngDevMode ? [{ debugName: "isSubmitting" }] : []));
836
+ this.isSuccess = input(false, ...(ngDevMode ? [{ debugName: "isSuccess" }] : []));
837
+ this.isLarge = input(false, ...(ngDevMode ? [{ debugName: "isLarge" }] : []));
838
+ this.form = input(null, ...(ngDevMode ? [{ debugName: "form" }] : []));
839
+ this.submitColorVariant = input(EButtonColorVariant$1.Primary, ...(ngDevMode ? [{ debugName: "submitColorVariant" }] : []));
840
+ this.closingCondition = input(EModalCloseCondition.Close, ...(ngDevMode ? [{ debugName: "closingCondition" }] : []));
841
+ this.isCancelButtonVisible = input(false, ...(ngDevMode ? [{ debugName: "isCancelButtonVisible" }] : []));
842
+ this.cancelLabel = input('', ...(ngDevMode ? [{ debugName: "cancelLabel" }] : []));
843
+ this.isCrossButtonVisible = input(false, ...(ngDevMode ? [{ debugName: "isCrossButtonVisible" }] : []));
844
+ this.isFooterInvisible = input(false, ...(ngDevMode ? [{ debugName: "isFooterInvisible" }] : []));
845
+ this.closeEvent = output();
846
+ this.submitEvent = output();
847
+ this.isOpen = signal(true, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
848
+ effect(() => {
849
+ const closingCondition = this.closingCondition();
850
+ const isSuccess = this.isSuccess();
851
+ if (closingCondition === EModalCloseCondition.SubmitSuccess && isSuccess) {
852
+ setTimeout(() => {
853
+ this.handleCloseClick();
854
+ }, 1000);
855
+ }
856
+ });
857
+ }
858
+ handleCloseClick() {
859
+ this.isOpen.set(false);
860
+ }
861
+ emitCloseEvent() {
862
+ this.closeEvent.emit();
863
+ }
864
+ emitSubmitEvent() {
865
+ this.submitEvent.emit();
866
+ }
867
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
868
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ModalComponent, isStandalone: true, selector: "skcr-modal", inputs: { submitLabel: { classPropertyName: "submitLabel", publicName: "submitLabel", isSignal: true, isRequired: false, transformFunction: null }, isSubmitting: { classPropertyName: "isSubmitting", publicName: "isSubmitting", isSignal: true, isRequired: false, transformFunction: null }, isSuccess: { classPropertyName: "isSuccess", publicName: "isSuccess", isSignal: true, isRequired: false, transformFunction: null }, isLarge: { classPropertyName: "isLarge", publicName: "isLarge", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, submitColorVariant: { classPropertyName: "submitColorVariant", publicName: "submitColorVariant", isSignal: true, isRequired: false, transformFunction: null }, closingCondition: { classPropertyName: "closingCondition", publicName: "closingCondition", isSignal: true, isRequired: false, transformFunction: null }, isCancelButtonVisible: { classPropertyName: "isCancelButtonVisible", publicName: "isCancelButtonVisible", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, isCrossButtonVisible: { classPropertyName: "isCrossButtonVisible", publicName: "isCrossButtonVisible", isSignal: true, isRequired: false, transformFunction: null }, isFooterInvisible: { classPropertyName: "isFooterInvisible", publicName: "isFooterInvisible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeEvent: "closeEvent", submitEvent: "submitEvent" }, ngImport: i0, template: "<skcr-dialog\n [isOpen]=\"isOpen()\"\n (isCloseAnimDone)=\"emitCloseEvent()\"\n [isLarge]=\"isLarge()\"\n>\n <div\n class=\"relative flex flex-col h-full overflow-hidden py-4 sm:py-6\"\n [ngClass]=\"{\n 'px-9': isCrossButtonVisible(),\n 'px-4 sm:px-6': !isCrossButtonVisible(),\n 'max-w-4xl w-4xl': isLarge(),\n 'max-w-lg w-lg': !isLarge(),\n }\"\n >\n @if (isCrossButtonVisible()) {\n <div class=\"absolute right-0 top-0 pr-4 pt-4\">\n <button\n class=\"rounded-md bg-white text-slate-950\"\n type=\"button\"\n [disabled]=\"isSubmitting() || isSuccess() || !isOpen()\"\n (click)=\"handleCloseClick()\"\n >\n <span class=\"sr-only\"> Close </span>\n\n <ng-icon\n name=\"heroXMark\"\n size=\"20px\"\n />\n </button>\n </div>\n }\n\n <div class=\"flex-1 px-1 overflow-y-auto scrollbar-hide\">\n <ng-content></ng-content>\n </div>\n\n @if (!isFooterInvisible()) {\n <div\n class=\"mt-6 flex flex-col justify-center gap-3 pb-1\"\n [ngClass]=\"{\n 'grid grid-flow-row-dense grid-cols-2': isCancelButtonVisible(),\n 'w-full': !isCancelButtonVisible(),\n }\"\n >\n <skcr-submit-button\n [label]=\"submitLabel()\"\n [isLoading]=\"isSubmitting()\"\n [isSuccess]=\"isSuccess()\"\n [colorVariant]=\"submitColorVariant()\"\n (submitClicked)=\"emitSubmitEvent()\"\n [isFullWidth]=\"true\"\n [ngClass]=\"{\n 'col-start-2': isCancelButtonVisible(),\n }\"\n ></skcr-submit-button>\n\n @if (isCancelButtonVisible()) {\n <button\n class=\"btn btn-neutral max-w-full\"\n type=\"button\"\n [disabled]=\"isSubmitting() || isSuccess() || !isOpen()\"\n (click)=\"handleCloseClick()\"\n >\n {{ cancelLabel() || 'Cancel' }}\n </button>\n }\n </div>\n }\n </div>\n</skcr-dialog>\n", dependencies: [{ kind: "component", type: DialogComponent, selector: "skcr-dialog", inputs: ["isLarge", "isOpen"], outputs: ["isCloseAnimDone"] }, { kind: "component", type: SubmitButtonComponent, selector: "skcr-submit-button", inputs: ["label", "isLoading", "isFullWidth", "isDisabled", "isSuccess", "colorVariant"], outputs: ["submitClicked"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }] }); }
869
+ }
870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ModalComponent, decorators: [{
871
+ type: Component,
872
+ args: [{ selector: 'skcr-modal', imports: [
873
+ DialogComponent,
874
+ SubmitButtonComponent,
875
+ NgClass,
876
+ NgIcon,
877
+ ], template: "<skcr-dialog\n [isOpen]=\"isOpen()\"\n (isCloseAnimDone)=\"emitCloseEvent()\"\n [isLarge]=\"isLarge()\"\n>\n <div\n class=\"relative flex flex-col h-full overflow-hidden py-4 sm:py-6\"\n [ngClass]=\"{\n 'px-9': isCrossButtonVisible(),\n 'px-4 sm:px-6': !isCrossButtonVisible(),\n 'max-w-4xl w-4xl': isLarge(),\n 'max-w-lg w-lg': !isLarge(),\n }\"\n >\n @if (isCrossButtonVisible()) {\n <div class=\"absolute right-0 top-0 pr-4 pt-4\">\n <button\n class=\"rounded-md bg-white text-slate-950\"\n type=\"button\"\n [disabled]=\"isSubmitting() || isSuccess() || !isOpen()\"\n (click)=\"handleCloseClick()\"\n >\n <span class=\"sr-only\"> Close </span>\n\n <ng-icon\n name=\"heroXMark\"\n size=\"20px\"\n />\n </button>\n </div>\n }\n\n <div class=\"flex-1 px-1 overflow-y-auto scrollbar-hide\">\n <ng-content></ng-content>\n </div>\n\n @if (!isFooterInvisible()) {\n <div\n class=\"mt-6 flex flex-col justify-center gap-3 pb-1\"\n [ngClass]=\"{\n 'grid grid-flow-row-dense grid-cols-2': isCancelButtonVisible(),\n 'w-full': !isCancelButtonVisible(),\n }\"\n >\n <skcr-submit-button\n [label]=\"submitLabel()\"\n [isLoading]=\"isSubmitting()\"\n [isSuccess]=\"isSuccess()\"\n [colorVariant]=\"submitColorVariant()\"\n (submitClicked)=\"emitSubmitEvent()\"\n [isFullWidth]=\"true\"\n [ngClass]=\"{\n 'col-start-2': isCancelButtonVisible(),\n }\"\n ></skcr-submit-button>\n\n @if (isCancelButtonVisible()) {\n <button\n class=\"btn btn-neutral max-w-full\"\n type=\"button\"\n [disabled]=\"isSubmitting() || isSuccess() || !isOpen()\"\n (click)=\"handleCloseClick()\"\n >\n {{ cancelLabel() || 'Cancel' }}\n </button>\n }\n </div>\n }\n </div>\n</skcr-dialog>\n" }]
878
+ }], ctorParameters: () => [], propDecorators: { submitLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitLabel", required: false }] }], isSubmitting: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSubmitting", required: false }] }], isSuccess: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSuccess", required: false }] }], isLarge: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLarge", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], submitColorVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitColorVariant", required: false }] }], closingCondition: [{ type: i0.Input, args: [{ isSignal: true, alias: "closingCondition", required: false }] }], isCancelButtonVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCancelButtonVisible", required: false }] }], cancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelLabel", required: false }] }], isCrossButtonVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCrossButtonVisible", required: false }] }], isFooterInvisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFooterInvisible", required: false }] }], closeEvent: [{ type: i0.Output, args: ["closeEvent"] }], submitEvent: [{ type: i0.Output, args: ["submitEvent"] }] } });
879
+
880
+ class ConfirmationModalComponent {
881
+ constructor() {
882
+ this.class = 'absolute';
883
+ this.submitLabel = input.required(...(ngDevMode ? [{ debugName: "submitLabel" }] : []));
884
+ this.isSubmitting = input(false, ...(ngDevMode ? [{ debugName: "isSubmitting" }] : []));
885
+ this.isSuccess = input(false, ...(ngDevMode ? [{ debugName: "isSuccess" }] : []));
886
+ this.form = input(null, ...(ngDevMode ? [{ debugName: "form" }] : []));
887
+ this.isCloseButtonVisible = input(false, ...(ngDevMode ? [{ debugName: "isCloseButtonVisible" }] : []));
888
+ this.cancelLabel = input('', ...(ngDevMode ? [{ debugName: "cancelLabel" }] : []));
889
+ this.levelVariant = input(EConfirmLevelVariant.Info, ...(ngDevMode ? [{ debugName: "levelVariant" }] : []));
890
+ this.closingCondition = input(EModalCloseCondition.SubmitSuccess, ...(ngDevMode ? [{ debugName: "closingCondition" }] : []));
891
+ this.closeEvent = output();
892
+ this.submitEvent = output();
893
+ this.iconKey = computed(() => {
894
+ return this.levelVariant() === EConfirmLevelVariant.Success ? 'heroCheckCircle' : 'heroExclamationTriangle';
895
+ }, ...(ngDevMode ? [{ debugName: "iconKey" }] : []));
896
+ this.submitColorVariant = computed(() => {
897
+ return this.levelVariant() === EConfirmLevelVariant.Danger
898
+ ? EButtonColorVariant$1.Danger
899
+ : EButtonColorVariant$1.Primary;
900
+ }, ...(ngDevMode ? [{ debugName: "submitColorVariant" }] : []));
901
+ this.iconColorVariant = computed(() => {
902
+ return this.levelVariant() === EConfirmLevelVariant.Danger ? 'text-red-500' : 'text-primary-l';
903
+ }, ...(ngDevMode ? [{ debugName: "iconColorVariant" }] : []));
904
+ }
905
+ emitCloseEvent() {
906
+ this.closeEvent.emit();
907
+ }
908
+ emitSubmitEvent() {
909
+ this.submitEvent.emit();
910
+ }
911
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
912
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ConfirmationModalComponent, isStandalone: true, selector: "skcr-confirmation-modal", inputs: { submitLabel: { classPropertyName: "submitLabel", publicName: "submitLabel", isSignal: true, isRequired: true, transformFunction: null }, isSubmitting: { classPropertyName: "isSubmitting", publicName: "isSubmitting", isSignal: true, isRequired: false, transformFunction: null }, isSuccess: { classPropertyName: "isSuccess", publicName: "isSuccess", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, isCloseButtonVisible: { classPropertyName: "isCloseButtonVisible", publicName: "isCloseButtonVisible", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, levelVariant: { classPropertyName: "levelVariant", publicName: "levelVariant", isSignal: true, isRequired: false, transformFunction: null }, closingCondition: { classPropertyName: "closingCondition", publicName: "closingCondition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeEvent: "closeEvent", submitEvent: "submitEvent" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<skcr-modal\n [submitColorVariant]=\"submitColorVariant()\"\n [submitLabel]=\"submitLabel()\"\n [isSubmitting]=\"isSubmitting()\"\n [isSuccess]=\"isSuccess()\"\n [closingCondition]=\"closingCondition()\"\n [isCancelButtonVisible]=\"isCloseButtonVisible()\"\n (submitEvent)=\"emitSubmitEvent()\"\n (closeEvent)=\"emitCloseEvent()\"\n>\n <div class=\"flex max-w-xl flex-col gap-3\">\n @if (iconKey()) {\n <div [class]=\"'mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full ' + iconColorVariant()\">\n <ng-icon\n [name]=\"iconKey()!\"\n size=\"48px\"\n />\n </div>\n }\n\n <div class=\"flex flex-col gap-8\">\n <ng-content select=\"[title]\"></ng-content>\n\n <ng-content select=\"[content]\"></ng-content>\n </div>\n </div>\n</skcr-modal>\n", dependencies: [{ kind: "component", type: ModalComponent, selector: "skcr-modal", inputs: ["submitLabel", "isSubmitting", "isSuccess", "isLarge", "form", "submitColorVariant", "closingCondition", "isCancelButtonVisible", "cancelLabel", "isCrossButtonVisible", "isFooterInvisible"], outputs: ["closeEvent", "submitEvent"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }] }); }
913
+ }
914
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationModalComponent, decorators: [{
915
+ type: Component,
916
+ args: [{ selector: 'skcr-confirmation-modal', imports: [
917
+ ModalComponent,
918
+ NgIcon,
919
+ ], template: "<skcr-modal\n [submitColorVariant]=\"submitColorVariant()\"\n [submitLabel]=\"submitLabel()\"\n [isSubmitting]=\"isSubmitting()\"\n [isSuccess]=\"isSuccess()\"\n [closingCondition]=\"closingCondition()\"\n [isCancelButtonVisible]=\"isCloseButtonVisible()\"\n (submitEvent)=\"emitSubmitEvent()\"\n (closeEvent)=\"emitCloseEvent()\"\n>\n <div class=\"flex max-w-xl flex-col gap-3\">\n @if (iconKey()) {\n <div [class]=\"'mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full ' + iconColorVariant()\">\n <ng-icon\n [name]=\"iconKey()!\"\n size=\"48px\"\n />\n </div>\n }\n\n <div class=\"flex flex-col gap-8\">\n <ng-content select=\"[title]\"></ng-content>\n\n <ng-content select=\"[content]\"></ng-content>\n </div>\n </div>\n</skcr-modal>\n" }]
920
+ }], propDecorators: { class: [{
921
+ type: HostBinding,
922
+ args: ['class']
923
+ }], submitLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitLabel", required: true }] }], isSubmitting: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSubmitting", required: false }] }], isSuccess: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSuccess", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], isCloseButtonVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCloseButtonVisible", required: false }] }], cancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelLabel", required: false }] }], levelVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelVariant", required: false }] }], closingCondition: [{ type: i0.Input, args: [{ isSignal: true, alias: "closingCondition", required: false }] }], closeEvent: [{ type: i0.Output, args: ["closeEvent"] }], submitEvent: [{ type: i0.Output, args: ["submitEvent"] }] } });
924
+
925
+ class DropdownMenuComponent {
926
+ constructor() {
927
+ this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
928
+ this.labelIcon = input(...(ngDevMode ? [undefined, { debugName: "labelIcon" }] : []));
929
+ this.isOpeningOnLeft = input(false, ...(ngDevMode ? [{ debugName: "isOpeningOnLeft" }] : []));
930
+ this.menuClosed = output();
931
+ this.isMenuOpen = signal(false, ...(ngDevMode ? [{ debugName: "isMenuOpen" }] : []));
932
+ this.clickOutsideHandler = (e) => {
933
+ const target = e.target;
934
+ const isClickInDropdown = this.dropdownMenu?.nativeElement.contains(target);
935
+ const isClickInToggleButton = this.toggleButton?.nativeElement.contains(target);
936
+ if (!isClickInDropdown && !isClickInToggleButton) {
937
+ this.closeMenu();
938
+ }
939
+ };
940
+ }
941
+ toggleMenu() {
942
+ this.isMenuOpen.update(isOpen => !isOpen);
943
+ if (this.isMenuOpen()) {
944
+ document.addEventListener('click', this.clickOutsideHandler);
945
+ }
946
+ else {
947
+ document.removeEventListener('click', this.clickOutsideHandler);
948
+ }
949
+ }
950
+ closeMenu() {
951
+ this.isMenuOpen.set(false);
952
+ document.removeEventListener('click', this.clickOutsideHandler);
953
+ this.menuClosed.emit();
954
+ }
955
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
956
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: DropdownMenuComponent, isStandalone: true, selector: "skcr-dropdown-menu", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelIcon: { classPropertyName: "labelIcon", publicName: "labelIcon", isSignal: true, isRequired: false, transformFunction: null }, isOpeningOnLeft: { classPropertyName: "isOpeningOnLeft", publicName: "isOpeningOnLeft", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuClosed: "menuClosed" }, viewQueries: [{ propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "toggleButton", first: true, predicate: ["toggleButton"], descendants: true }], ngImport: i0, template: "<div class=\"relative h-fit inline-block text-left\">\n <div>\n <button\n class=\"cursor-pointer inline-flex items-center rounded-md gap-1 h-full items-center border-b-2 border-transparent px-3 py-2 hover:bg-slate-100\"\n #toggleButton\n type=\"button\"\n (click)=\"toggleMenu()\"\n >\n {{ label() }}\n\n <ng-icon\n [name]=\"labelIcon() ?? 'heroChevronDown'\"\n [size]=\"labelIcon() ? '1.25rem' : '1rem'\"\n ></ng-icon>\n </button>\n </div>\n\n @if (isMenuOpen()) {\n <div\n class=\"absolute z-10 mt-2 min-w-33 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black/5 focus:outline-hidden\"\n #dropdownMenu\n role=\"menu\"\n tabindex=\"-1\"\n @dropdownAnimation\n [class.left-0]=\"!isOpeningOnLeft()\"\n [class.right-0]=\"isOpeningOnLeft()\"\n aria-orientation=\"vertical\"\n aria-labelledby=\"menu-button\"\n >\n <div\n class=\"flex flex-col py-1\"\n role=\"none\"\n (click)=\"closeMenu()\"\n >\n <ng-content />\n </div>\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], animations: [
957
+ trigger('dropdownAnimation', [
958
+ transition(':enter', [
959
+ style({ opacity: 0, transform: 'translateY(-10px)' }),
960
+ animate('200ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
961
+ ]),
962
+ transition(':leave', [
963
+ style({ opacity: 1 }),
964
+ animate('200ms ease-in', style({ opacity: 0, transform: 'translateY(-10px)' })),
965
+ ]),
966
+ ]),
967
+ ] }); }
968
+ }
969
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DropdownMenuComponent, decorators: [{
970
+ type: Component,
971
+ args: [{ selector: 'skcr-dropdown-menu', imports: [
972
+ NgIcon,
973
+ ], animations: [
974
+ trigger('dropdownAnimation', [
975
+ transition(':enter', [
976
+ style({ opacity: 0, transform: 'translateY(-10px)' }),
977
+ animate('200ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
978
+ ]),
979
+ transition(':leave', [
980
+ style({ opacity: 1 }),
981
+ animate('200ms ease-in', style({ opacity: 0, transform: 'translateY(-10px)' })),
982
+ ]),
983
+ ]),
984
+ ], template: "<div class=\"relative h-fit inline-block text-left\">\n <div>\n <button\n class=\"cursor-pointer inline-flex items-center rounded-md gap-1 h-full items-center border-b-2 border-transparent px-3 py-2 hover:bg-slate-100\"\n #toggleButton\n type=\"button\"\n (click)=\"toggleMenu()\"\n >\n {{ label() }}\n\n <ng-icon\n [name]=\"labelIcon() ?? 'heroChevronDown'\"\n [size]=\"labelIcon() ? '1.25rem' : '1rem'\"\n ></ng-icon>\n </button>\n </div>\n\n @if (isMenuOpen()) {\n <div\n class=\"absolute z-10 mt-2 min-w-33 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black/5 focus:outline-hidden\"\n #dropdownMenu\n role=\"menu\"\n tabindex=\"-1\"\n @dropdownAnimation\n [class.left-0]=\"!isOpeningOnLeft()\"\n [class.right-0]=\"isOpeningOnLeft()\"\n aria-orientation=\"vertical\"\n aria-labelledby=\"menu-button\"\n >\n <div\n class=\"flex flex-col py-1\"\n role=\"none\"\n (click)=\"closeMenu()\"\n >\n <ng-content />\n </div>\n </div>\n }\n</div>\n" }]
985
+ }], propDecorators: { dropdownMenu: [{
986
+ type: ViewChild,
987
+ args: ['dropdownMenu']
988
+ }], toggleButton: [{
989
+ type: ViewChild,
990
+ args: ['toggleButton']
991
+ }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelIcon", required: false }] }], isOpeningOnLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpeningOnLeft", required: false }] }], menuClosed: [{ type: i0.Output, args: ["menuClosed"] }] } });
992
+
993
+ const DD_MM_YYYY_FORMAT = {
994
+ parse: {
995
+ dateInput: 'DD/MM/YYYY',
996
+ },
997
+ display: {
998
+ dateInput: 'DD/MM/YYYY',
999
+ monthYearLabel: 'MMM YYYY',
1000
+ dateA11yLabel: 'LL',
1001
+ monthYearA11yLabel: 'MMMM YYYY',
1002
+ },
1003
+ };
1004
+ class DatePickerComponent {
1005
+ constructor() {
1006
+ this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
1007
+ this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
1008
+ this.placeholder = input('dd/mm/yyyy', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
1009
+ this.isInvalid = input(false, ...(ngDevMode ? [{ debugName: "isInvalid" }] : []));
1010
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
1011
+ this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
1012
+ this.dateAdapter = inject((DateAdapter));
1013
+ this.dateAdapter.setLocale('fr-FR');
1014
+ }
1015
+ formatDate(date) {
1016
+ if (!date)
1017
+ return '';
1018
+ const day = date.getDate().toString().padStart(2, '0');
1019
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
1020
+ const year = date.getFullYear();
1021
+ return `${day}/${month}/${year}`;
1022
+ }
1023
+ parseDate(dateStr) {
1024
+ if (!dateStr)
1025
+ return null;
1026
+ dateStr = dateStr.replace(/[^\d/]/g, '');
1027
+ if (dateStr.length === 2 && !dateStr.includes('/')) {
1028
+ dateStr += '/';
1029
+ }
1030
+ else if (dateStr.length === 5 && dateStr.indexOf('/', 3) === -1) {
1031
+ dateStr += '/';
1032
+ }
1033
+ const parts = dateStr.split('/');
1034
+ if (parts.length !== 3)
1035
+ return null;
1036
+ const day = parseInt(parts[0], 10);
1037
+ const month = parseInt(parts[1], 10) - 1;
1038
+ const year = parseInt(parts[2], 10);
1039
+ if (isNaN(day) || isNaN(month) || isNaN(year))
1040
+ return null;
1041
+ const date = new Date(year, month, day);
1042
+ if (date.getFullYear() !== year || date.getMonth() !== month || date.getDate() !== day) {
1043
+ return null;
1044
+ }
1045
+ return date;
1046
+ }
1047
+ onDateChange(date) {
1048
+ this.value.set(date);
1049
+ // this.markAsTouched();
1050
+ }
1051
+ onInputChange(event) {
1052
+ const input = event.target;
1053
+ const value = input.value;
1054
+ let formattedValue = value.replace(/[^\d/]/g, '');
1055
+ if (formattedValue.length === 2 && !formattedValue.includes('/')) {
1056
+ formattedValue = formattedValue + '/';
1057
+ input.value = formattedValue;
1058
+ }
1059
+ else if (formattedValue.length === 5 && formattedValue.indexOf('/', 3) === -1) {
1060
+ formattedValue = formattedValue + '/';
1061
+ input.value = formattedValue;
1062
+ }
1063
+ const date = this.parseDate(formattedValue);
1064
+ this.value.set(date);
1065
+ }
1066
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1067
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: DatePickerComponent, isStandalone: true, selector: "skcr-date-picker", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, isInvalid: { classPropertyName: "isInvalid", publicName: "isInvalid", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
1068
+ { provide: MAT_DATE_FORMATS, useValue: DD_MM_YYYY_FORMAT },
1069
+ { provide: MAT_DATE_LOCALE, useValue: 'fr-FR' },
1070
+ ], ngImport: i0, template: "<div>\n <label\n class=\"mb-1 block\"\n [for]=\"name()\"\n >\n {{ label() }}\n </label>\n\n <!-- Custom styled input that looks like other inputs in the project -->\n <div class=\"relative\">\n <input\n class=\"block w-full rounded-md px-3 py-2 text-body-small shadow-sm outline-1 -outline-offset-1 outline-border-color focus:outline-2 focus:-outline-offset-2 placeholder:text-slate-500\"\n [id]=\"name()\"\n [name]=\"name()\"\n type=\"text\"\n [placeholder]=\"placeholder()\"\n [matDatepicker]=\"picker\"\n [value]=\"value()\"\n [attr.value]=\"value() ? formatDate(value()) : ''\"\n (dateChange)=\"onDateChange($event.value)\"\n (input)=\"onInputChange($event)\"\n [disabled]=\"isDisabled()\"\n [ngClass]=\"{\n 'border-destructive placeholder-destructive focus:border-destructive focus:ring-destructive': isInvalid(),\n 'border-lightGrey focus:border-primary focus:ring-primaryBlue': !isInvalid(),\n 'cursor-not-allowed bg-slate-50': isDisabled(),\n }\"\n />\n <button\n class=\"absolute right-2 top-1/2 -translate-y-1/2\"\n type=\"button\"\n (click)=\"picker.open()\"\n [disabled]=\"isDisabled()\"\n >\n <svg\n class=\"h-5 w-5\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"\n />\n </svg>\n </button>\n </div>\n\n <!-- Hidden Material datepicker -->\n <mat-datepicker\n #picker\n [startAt]=\"value()\"\n [disabled]=\"isDisabled()\"\n ></mat-datepicker>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i1$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i1$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatNativeDateModule }] }); }
1071
+ }
1072
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DatePickerComponent, decorators: [{
1073
+ type: Component,
1074
+ args: [{ selector: 'skcr-date-picker', providers: [
1075
+ { provide: MAT_DATE_FORMATS, useValue: DD_MM_YYYY_FORMAT },
1076
+ { provide: MAT_DATE_LOCALE, useValue: 'fr-FR' },
1077
+ ], imports: [
1078
+ NgClass,
1079
+ FormsModule,
1080
+ MatDatepickerModule,
1081
+ MatInputModule,
1082
+ MatFormFieldModule,
1083
+ MatNativeDateModule,
1084
+ FormsModule,
1085
+ MatDatepickerModule,
1086
+ MatInputModule,
1087
+ MatFormFieldModule,
1088
+ MatNativeDateModule,
1089
+ ], template: "<div>\n <label\n class=\"mb-1 block\"\n [for]=\"name()\"\n >\n {{ label() }}\n </label>\n\n <!-- Custom styled input that looks like other inputs in the project -->\n <div class=\"relative\">\n <input\n class=\"block w-full rounded-md px-3 py-2 text-body-small shadow-sm outline-1 -outline-offset-1 outline-border-color focus:outline-2 focus:-outline-offset-2 placeholder:text-slate-500\"\n [id]=\"name()\"\n [name]=\"name()\"\n type=\"text\"\n [placeholder]=\"placeholder()\"\n [matDatepicker]=\"picker\"\n [value]=\"value()\"\n [attr.value]=\"value() ? formatDate(value()) : ''\"\n (dateChange)=\"onDateChange($event.value)\"\n (input)=\"onInputChange($event)\"\n [disabled]=\"isDisabled()\"\n [ngClass]=\"{\n 'border-destructive placeholder-destructive focus:border-destructive focus:ring-destructive': isInvalid(),\n 'border-lightGrey focus:border-primary focus:ring-primaryBlue': !isInvalid(),\n 'cursor-not-allowed bg-slate-50': isDisabled(),\n }\"\n />\n <button\n class=\"absolute right-2 top-1/2 -translate-y-1/2\"\n type=\"button\"\n (click)=\"picker.open()\"\n [disabled]=\"isDisabled()\"\n >\n <svg\n class=\"h-5 w-5\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"\n />\n </svg>\n </button>\n </div>\n\n <!-- Hidden Material datepicker -->\n <mat-datepicker\n #picker\n [startAt]=\"value()\"\n [disabled]=\"isDisabled()\"\n ></mat-datepicker>\n</div>\n" }]
1090
+ }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "isInvalid", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
1091
+
1092
+ class RadioButtonComponent {
1093
+ constructor() {
1094
+ this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
1095
+ this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
1096
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
1097
+ this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
1098
+ }
1099
+ onRadioChange(value) {
1100
+ this.value.set(value);
1101
+ }
1102
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: RadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1103
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: RadioButtonComponent, isStandalone: true, selector: "skcr-radio-button", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<fieldset class=\"flex items-center gap-4 flex-row\">\n <legend>{{ label() }}</legend>\n\n <div class=\"flex gap-4\">\n @for (option of options(); track option.value) {\n <div class=\"flex items-center\">\n <input\n class=\"relative size-4 appearance-none rounded-full border border-border-color bg-white before:absolute before:inset-1 before:rounded-full before:bg-white not-checked:before:hidden checked:border-primary checked:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 disabled:border-border-color disabled:bg-slate-100 disabled:before:bg-slate-400 forced-colors:appearance-auto forced-colors:before:hidden\"\n [id]=\"option.name\"\n type=\"radio\"\n [name]=\"label()\"\n [checked]=\"value() === option.value\"\n [disabled]=\"isDisabled()\"\n (change)=\"onRadioChange(option.value)\"\n />\n\n <label\n class=\"ml-3 block\"\n [for]=\"option.name\"\n >{{ option.name }}</label\n >\n </div>\n }\n </div>\n</fieldset>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
1104
+ }
1105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: RadioButtonComponent, decorators: [{
1106
+ type: Component,
1107
+ args: [{ selector: 'skcr-radio-button', imports: [
1108
+ FormsModule,
1109
+ ReactiveFormsModule,
1110
+ ], template: "<fieldset class=\"flex items-center gap-4 flex-row\">\n <legend>{{ label() }}</legend>\n\n <div class=\"flex gap-4\">\n @for (option of options(); track option.value) {\n <div class=\"flex items-center\">\n <input\n class=\"relative size-4 appearance-none rounded-full border border-border-color bg-white before:absolute before:inset-1 before:rounded-full before:bg-white not-checked:before:hidden checked:border-primary checked:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 disabled:border-border-color disabled:bg-slate-100 disabled:before:bg-slate-400 forced-colors:appearance-auto forced-colors:before:hidden\"\n [id]=\"option.name\"\n type=\"radio\"\n [name]=\"label()\"\n [checked]=\"value() === option.value\"\n [disabled]=\"isDisabled()\"\n (change)=\"onRadioChange(option.value)\"\n />\n\n <label\n class=\"ml-3 block\"\n [for]=\"option.name\"\n >{{ option.name }}</label\n >\n </div>\n }\n </div>\n</fieldset>\n" }]
1111
+ }], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
1112
+
1113
+ class ToastService {
1114
+ constructor() {
1115
+ this.newToastEvent$ = new Subject();
1116
+ }
1117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1118
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastService, providedIn: 'root' }); }
1119
+ }
1120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastService, decorators: [{
1121
+ type: Injectable,
1122
+ args: [{
1123
+ providedIn: 'root',
1124
+ }]
1125
+ }] });
1126
+
1127
+ class ToastComponent {
1128
+ constructor() {
1129
+ this.class = 'flex w-full flex-col items-center space-y-4 sm:items-end';
1130
+ this.toast = input.required(...(ngDevMode ? [{ debugName: "toast" }] : []));
1131
+ this.disposeEvent = output();
1132
+ }
1133
+ ngOnInit() {
1134
+ setTimeout(() => {
1135
+ this.closeToast();
1136
+ }, 5000);
1137
+ }
1138
+ closeToast() {
1139
+ this.disposeEvent.emit(this.toast());
1140
+ }
1141
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1142
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ToastComponent, isStandalone: true, selector: "app-toast", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { disposeEvent: "disposeEvent" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div\n class=\"ring-opacity/5 pointer-events-auto w-full max-w-sm overflow-hidden rounded-md bg-white shadow-lg\"\n @AnimationTrigger0\n>\n <div class=\"p-4\">\n <div class=\"flex items-center\">\n <ng-icon\n class=\"shrink-0 text-destructive\"\n name=\"heroXCircle\"\n />\n\n <div class=\"ml-3 w-0 flex-1 pt-0.5\">\n <p class=\"text-destructive\">An error occured</p>\n\n @if (!!toast().message || !!toast().key) {\n <p class=\"mt-1 text-body-small text-slate-500\">\n <span>\n {{ toast().message }}\n </span>\n </p>\n }\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], animations: [
1143
+ trigger('AnimationTrigger0', [
1144
+ transition(':enter', [
1145
+ style({ transform: 'translateY(0.5rem)', opacity: 0 }),
1146
+ animate('300ms ease-out', style({ transform: 'translateY(0)', opacity: 1 })),
1147
+ ]),
1148
+ transition(':leave', [
1149
+ style({ opacity: 1 }),
1150
+ animate('100ms ease-in', style({ opacity: 0 })),
1151
+ ]),
1152
+ ]),
1153
+ ] }); }
1154
+ }
1155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastComponent, decorators: [{
1156
+ type: Component,
1157
+ args: [{ selector: 'app-toast', animations: [
1158
+ trigger('AnimationTrigger0', [
1159
+ transition(':enter', [
1160
+ style({ transform: 'translateY(0.5rem)', opacity: 0 }),
1161
+ animate('300ms ease-out', style({ transform: 'translateY(0)', opacity: 1 })),
1162
+ ]),
1163
+ transition(':leave', [
1164
+ style({ opacity: 1 }),
1165
+ animate('100ms ease-in', style({ opacity: 0 })),
1166
+ ]),
1167
+ ]),
1168
+ ], imports: [
1169
+ NgIcon,
1170
+ ], template: "<div\n class=\"ring-opacity/5 pointer-events-auto w-full max-w-sm overflow-hidden rounded-md bg-white shadow-lg\"\n @AnimationTrigger0\n>\n <div class=\"p-4\">\n <div class=\"flex items-center\">\n <ng-icon\n class=\"shrink-0 text-destructive\"\n name=\"heroXCircle\"\n />\n\n <div class=\"ml-3 w-0 flex-1 pt-0.5\">\n <p class=\"text-destructive\">An error occured</p>\n\n @if (!!toast().message || !!toast().key) {\n <p class=\"mt-1 text-body-small text-slate-500\">\n <span>\n {{ toast().message }}\n </span>\n </p>\n }\n </div>\n </div>\n </div>\n</div>\n" }]
1171
+ }], propDecorators: { class: [{
1172
+ type: HostBinding,
1173
+ args: ['class']
1174
+ }], toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], disposeEvent: [{ type: i0.Output, args: ["disposeEvent"] }] } });
1175
+
1176
+ class ToasterComponent {
1177
+ constructor() {
1178
+ this.cdr = inject(ChangeDetectorRef);
1179
+ this.toastService = inject(ToastService);
1180
+ this.currentToasts = [];
1181
+ }
1182
+ ngOnInit() {
1183
+ this.subscribeToToasts();
1184
+ }
1185
+ subscribeToToasts() {
1186
+ this.newToastSub = this.toastService.newToastEvent$.subscribe(toast => {
1187
+ const currentToast = {
1188
+ id: Date.now(),
1189
+ key: toast.key,
1190
+ message: toast.message,
1191
+ };
1192
+ this.currentToasts.push(currentToast);
1193
+ this.cdr.detectChanges();
1194
+ });
1195
+ }
1196
+ dispose(toastToRemove) {
1197
+ const toastIndex = this.currentToasts.findIndex(toast => toast.id === toastToRemove.id);
1198
+ this.currentToasts.splice(toastIndex, 1);
1199
+ this.cdr.detectChanges();
1200
+ }
1201
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToasterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1202
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ToasterComponent, isStandalone: true, selector: "skcr-toaster", ngImport: i0, template: "<div class=\"fixed end-0 top-0 z-100 m-16 px-3 py-2\">\n <div\n class=\"pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n aria-live=\"assertive\"\n >\n <div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n @for (toast of currentToasts; track toast; let i = $index) {\n <app-toast\n [toast]=\"toast\"\n (disposeEvent)=\"dispose($event)\"\n ></app-toast>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ToastComponent, selector: "app-toast", inputs: ["toast"], outputs: ["disposeEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1203
+ }
1204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToasterComponent, decorators: [{
1205
+ type: Component,
1206
+ args: [{ selector: 'skcr-toaster', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1207
+ ToastComponent,
1208
+ ], template: "<div class=\"fixed end-0 top-0 z-100 m-16 px-3 py-2\">\n <div\n class=\"pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n aria-live=\"assertive\"\n >\n <div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n @for (toast of currentToasts; track toast; let i = $index) {\n <app-toast\n [toast]=\"toast\"\n (disposeEvent)=\"dispose($event)\"\n ></app-toast>\n }\n </div>\n </div>\n</div>\n" }]
1209
+ }] });
317
1210
 
318
1211
  /**
319
1212
  * Generated bundle index. Do not edit.
320
1213
  */
321
1214
 
322
- export { Autechre, InputComponent, InputNumberComponent, MultiSelectComponent, SubmitButtonComponent };
1215
+ export { CheckboxClassicComponent, CheckboxComponent, ConfirmationModalComponent, DD_MM_YYYY_FORMAT, DatePickerComponent, DialogComponent, DropdownMenuComponent, EButtonColorVariant$1 as EButtonColorVariant, EConfirmLevelVariant, EModalCloseCondition, ESortDirection, InputComponent, InputNumberComponent, LoaderComponent, ModalComponent, MultiSelectComponent, RadioButtonComponent, SelectComponent, SubmitButtonComponent, TableComponent, TableHeaderCellComponent, ToastComponent, ToastService, ToasterComponent };
323
1216
  //# sourceMappingURL=skcr-autechre.mjs.map