skcr-autechre 0.0.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/skcr-autechre.mjs +922 -25
- package/fesm2022/skcr-autechre.mjs.map +1 -1
- package/package.json +3 -2
- package/types/skcr-autechre.d.ts +296 -6
|
@@ -1,29 +1,44 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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,895 @@ 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
|
-
|
|
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.tooltipService = inject(TooltipService);
|
|
577
|
+
this.name = input.required(...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
578
|
+
this.sortDirection = input(ESortDirection.None, ...(ngDevMode ? [{ debugName: "sortDirection" }] : []));
|
|
579
|
+
this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
580
|
+
this.isOrderByDisplayed = input(false, ...(ngDevMode ? [{ debugName: "isOrderByDisplayed" }] : []));
|
|
581
|
+
this.disabledText = input('Sorting is possible on this value only for query with less than 10000 results.', ...(ngDevMode ? [{ debugName: "disabledText" }] : []));
|
|
582
|
+
this.toolTipText = input(...(ngDevMode ? [undefined, { debugName: "toolTipText" }] : []));
|
|
583
|
+
this.clickEvent = output();
|
|
584
|
+
this.hasTooltipToDisplay = computed(() => {
|
|
585
|
+
return this.isDisabled() || !!this.toolTipText();
|
|
586
|
+
}, ...(ngDevMode ? [{ debugName: "hasTooltipToDisplay" }] : []));
|
|
587
|
+
this.ESortDirection = ESortDirection;
|
|
588
|
+
}
|
|
589
|
+
emitClickEvent() {
|
|
590
|
+
if (!this.isDisabled()) {
|
|
591
|
+
this.clickEvent.emit();
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
showTooltip(event, content) {
|
|
595
|
+
this.tooltipService.showTooltip(event, content);
|
|
596
|
+
}
|
|
597
|
+
hideTooltip() {
|
|
598
|
+
this.tooltipService.hideTooltip();
|
|
599
|
+
}
|
|
600
|
+
updateTooltipPosition(event) {
|
|
601
|
+
this.tooltipService.updateTooltipPosition(event);
|
|
602
|
+
}
|
|
603
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TableHeaderCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
604
|
+
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 }, toolTipText: { classPropertyName: "toolTipText", publicName: "toolTipText", 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)=\"hasTooltipToDisplay() ? showTooltip($event, disabledText()) : null\"\n (mouseleave)=\"hasTooltipToDisplay() ? hideTooltip() : null\"\n (mousemove)=\"hasTooltipToDisplay() ? 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: [
|
|
605
|
+
trigger('fadeIn', [
|
|
606
|
+
transition(':enter', [
|
|
607
|
+
style({ opacity: 0 }),
|
|
608
|
+
animate('300ms', style({ opacity: 1 })),
|
|
609
|
+
]),
|
|
610
|
+
]),
|
|
611
|
+
] }); }
|
|
612
|
+
}
|
|
613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TableHeaderCellComponent, decorators: [{
|
|
614
|
+
type: Component,
|
|
615
|
+
args: [{ selector: 'skcr-table-header-cell', imports: [
|
|
616
|
+
NgIcon,
|
|
617
|
+
], animations: [
|
|
618
|
+
trigger('fadeIn', [
|
|
619
|
+
transition(':enter', [
|
|
620
|
+
style({ opacity: 0 }),
|
|
621
|
+
animate('300ms', style({ opacity: 1 })),
|
|
622
|
+
]),
|
|
623
|
+
]),
|
|
624
|
+
], 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)=\"hasTooltipToDisplay() ? showTooltip($event, disabledText()) : null\"\n (mouseleave)=\"hasTooltipToDisplay() ? hideTooltip() : null\"\n (mousemove)=\"hasTooltipToDisplay() ? 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" }]
|
|
625
|
+
}], 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 }] }], toolTipText: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolTipText", required: false }] }], clickEvent: [{ type: i0.Output, args: ["clickEvent"] }] } });
|
|
626
|
+
|
|
627
|
+
class TableComponent {
|
|
628
|
+
constructor() {
|
|
629
|
+
this.itemsList = input.required(...(ngDevMode ? [{ debugName: "itemsList" }] : []));
|
|
630
|
+
this.isContentLoading = input(false, ...(ngDevMode ? [{ debugName: "isContentLoading" }] : []));
|
|
631
|
+
this.columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
632
|
+
this.columnCategories = input(...(ngDevMode ? [undefined, { debugName: "columnCategories" }] : []));
|
|
633
|
+
this.noRowsMessage = input('', ...(ngDevMode ? [{ debugName: "noRowsMessage" }] : []));
|
|
634
|
+
this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
635
|
+
this.fixedColumnsCount = input(0, ...(ngDevMode ? [{ debugName: "fixedColumnsCount" }] : []));
|
|
636
|
+
this.selectedItemIds = input(...(ngDevMode ? [undefined, { debugName: "selectedItemIds" }] : []));
|
|
637
|
+
this.tableEndClose = output();
|
|
638
|
+
this.headerCellTemplateRef = contentChild('headerCell', ...(ngDevMode ? [{ debugName: "headerCellTemplateRef" }] : []));
|
|
639
|
+
this.rowCellTemplateRef = contentChild('rowCell', ...(ngDevMode ? [{ debugName: "rowCellTemplateRef" }] : []));
|
|
640
|
+
this.sortButtons = contentChildren(TableHeaderCellComponent, ...(ngDevMode ? [{ debugName: "sortButtons" }] : []));
|
|
641
|
+
this.sortingItem = computed(() => {
|
|
642
|
+
const sortButtons = this.sortButtons();
|
|
643
|
+
const sortingButton = sortButtons.find(button => button.sortDirection() !== ESortDirection.None);
|
|
644
|
+
return sortingButton
|
|
645
|
+
? {
|
|
646
|
+
column: sortingButton.name(),
|
|
647
|
+
direction: sortingButton.sortDirection(),
|
|
648
|
+
}
|
|
649
|
+
: null;
|
|
650
|
+
}, ...(ngDevMode ? [{ debugName: "sortingItem" }] : []));
|
|
651
|
+
}
|
|
652
|
+
get inverseOfTranslation() {
|
|
653
|
+
if (!this.viewPort || !this.viewPort['_renderedContentOffset']) {
|
|
654
|
+
return '-0px';
|
|
655
|
+
}
|
|
656
|
+
let offset = this.viewPort['_renderedContentOffset'];
|
|
657
|
+
return `-${offset}px`;
|
|
658
|
+
}
|
|
659
|
+
onScroll(index) {
|
|
660
|
+
const bufferZone = 250;
|
|
661
|
+
if (index + bufferZone > this.itemsList().length) {
|
|
662
|
+
this.tableEndClose.emit();
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
scrollToTop() {
|
|
666
|
+
this.viewPort.scrollToIndex(0);
|
|
667
|
+
}
|
|
668
|
+
refreshViewport() {
|
|
669
|
+
if (this.viewPort) {
|
|
670
|
+
this.viewPort.checkViewportSize();
|
|
671
|
+
setTimeout(() => {
|
|
672
|
+
this.viewPort.checkViewportSize();
|
|
673
|
+
}, 100);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
getColumnLeftPosition(columnIndex) {
|
|
677
|
+
if (columnIndex === 0) {
|
|
678
|
+
return '0px';
|
|
679
|
+
}
|
|
680
|
+
const columnWidth = 174;
|
|
681
|
+
return `${columnIndex * columnWidth}px`;
|
|
682
|
+
}
|
|
683
|
+
isRowSelected(item) {
|
|
684
|
+
return this.selectedItemIds()?.has(item['id']) ?? false;
|
|
685
|
+
}
|
|
686
|
+
isCategoryStart(columnIndex) {
|
|
687
|
+
if (!this.columnCategories() || columnIndex === 0) {
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
const categories = this.columnCategories();
|
|
691
|
+
let currentColumnCount = 0;
|
|
692
|
+
for (const category of categories) {
|
|
693
|
+
if (currentColumnCount === columnIndex) {
|
|
694
|
+
return true;
|
|
695
|
+
}
|
|
696
|
+
currentColumnCount += category.colspan;
|
|
697
|
+
}
|
|
698
|
+
return false;
|
|
699
|
+
}
|
|
700
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
701
|
+
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-2 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"] }] }); }
|
|
702
|
+
}
|
|
703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TableComponent, decorators: [{
|
|
704
|
+
type: Component,
|
|
705
|
+
args: [{ selector: 'skcr-table', imports: [
|
|
706
|
+
NgClass,
|
|
707
|
+
NgTemplateOutlet,
|
|
708
|
+
ScrollingModule,
|
|
709
|
+
LoaderComponent,
|
|
710
|
+
], 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-2 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" }]
|
|
711
|
+
}], propDecorators: { viewPort: [{
|
|
712
|
+
type: ViewChild,
|
|
713
|
+
args: [CdkVirtualScrollViewport, { static: false }]
|
|
714
|
+
}], 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 }] }] } });
|
|
715
|
+
|
|
716
|
+
class DialogComponent {
|
|
717
|
+
constructor() {
|
|
718
|
+
this.hasAnimation = true;
|
|
719
|
+
this.isLarge = input(false, ...(ngDevMode ? [{ debugName: "isLarge" }] : []));
|
|
720
|
+
this.isOpen = input(true, { ...(ngDevMode ? { debugName: "isOpen" } : {}), transform: booleanAttribute });
|
|
721
|
+
this.isCloseAnimDone = output();
|
|
722
|
+
this.escapeKeyListener = null;
|
|
723
|
+
this.dialogElement = signal(null, ...(ngDevMode ? [{ debugName: "dialogElement" }] : []));
|
|
724
|
+
}
|
|
725
|
+
set dialogElementComponent(dialogElement) {
|
|
726
|
+
if (dialogElement) {
|
|
727
|
+
this.dialogElement.set(dialogElement);
|
|
728
|
+
dialogElement.nativeElement.showModal();
|
|
729
|
+
this.escapeKeyListener = (event) => {
|
|
730
|
+
console.log(event.key);
|
|
731
|
+
if (event.key === 'Escape') {
|
|
732
|
+
event.preventDefault();
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
dialogElement.nativeElement.addEventListener('keydown', this.escapeKeyListener);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
onDialogAnimDone(e) {
|
|
739
|
+
if (e.toState === 'void') {
|
|
740
|
+
const dialogEl = this.dialogElement()?.nativeElement;
|
|
741
|
+
if (dialogEl && this.escapeKeyListener) {
|
|
742
|
+
dialogEl.removeEventListener('keydown', this.escapeKeyListener);
|
|
743
|
+
this.escapeKeyListener = null;
|
|
744
|
+
}
|
|
745
|
+
dialogEl?.close();
|
|
746
|
+
this.dialogElement.set(null);
|
|
747
|
+
this.isCloseAnimDone.emit();
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
751
|
+
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: [
|
|
752
|
+
trigger('DialogTrigger', [
|
|
753
|
+
transition(':enter', [
|
|
754
|
+
style({ opacity: 0, transform: 'translateY(1rem)' }),
|
|
755
|
+
animate('300ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
|
|
756
|
+
]),
|
|
757
|
+
transition(':leave', [
|
|
758
|
+
style({ opacity: 1, transform: 'translateY(0)' }),
|
|
759
|
+
animate('200ms ease-in', style({ opacity: 0, transform: 'translateY(1rem)' })),
|
|
760
|
+
]),
|
|
761
|
+
]),
|
|
762
|
+
trigger('BackdropTrigger', [
|
|
763
|
+
transition(':enter', [
|
|
764
|
+
style({ opacity: 0 }),
|
|
765
|
+
animate('300ms ease-out', style({ opacity: 1 })),
|
|
766
|
+
]),
|
|
767
|
+
transition(':leave', [
|
|
768
|
+
style({ opacity: 1 }),
|
|
769
|
+
animate('200ms ease-in', style({ opacity: 0 })),
|
|
770
|
+
]),
|
|
771
|
+
]),
|
|
772
|
+
trigger('ModalTrigger', [
|
|
773
|
+
transition(':enter', [
|
|
774
|
+
group([
|
|
775
|
+
query('@DialogTrigger', animateChild()),
|
|
776
|
+
query('@BackdropTrigger', animateChild()),
|
|
777
|
+
]),
|
|
778
|
+
]),
|
|
779
|
+
transition(':leave', [
|
|
780
|
+
group([
|
|
781
|
+
query('@DialogTrigger', animateChild()),
|
|
782
|
+
query('@BackdropTrigger', animateChild()),
|
|
783
|
+
]),
|
|
784
|
+
]),
|
|
785
|
+
]),
|
|
786
|
+
] }); }
|
|
787
|
+
}
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DialogComponent, decorators: [{
|
|
789
|
+
type: Component,
|
|
790
|
+
args: [{ selector: 'skcr-dialog', animations: [
|
|
791
|
+
trigger('DialogTrigger', [
|
|
792
|
+
transition(':enter', [
|
|
793
|
+
style({ opacity: 0, transform: 'translateY(1rem)' }),
|
|
794
|
+
animate('300ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
|
|
795
|
+
]),
|
|
796
|
+
transition(':leave', [
|
|
797
|
+
style({ opacity: 1, transform: 'translateY(0)' }),
|
|
798
|
+
animate('200ms ease-in', style({ opacity: 0, transform: 'translateY(1rem)' })),
|
|
799
|
+
]),
|
|
800
|
+
]),
|
|
801
|
+
trigger('BackdropTrigger', [
|
|
802
|
+
transition(':enter', [
|
|
803
|
+
style({ opacity: 0 }),
|
|
804
|
+
animate('300ms ease-out', style({ opacity: 1 })),
|
|
805
|
+
]),
|
|
806
|
+
transition(':leave', [
|
|
807
|
+
style({ opacity: 1 }),
|
|
808
|
+
animate('200ms ease-in', style({ opacity: 0 })),
|
|
809
|
+
]),
|
|
810
|
+
]),
|
|
811
|
+
trigger('ModalTrigger', [
|
|
812
|
+
transition(':enter', [
|
|
813
|
+
group([
|
|
814
|
+
query('@DialogTrigger', animateChild()),
|
|
815
|
+
query('@BackdropTrigger', animateChild()),
|
|
816
|
+
]),
|
|
817
|
+
]),
|
|
818
|
+
transition(':leave', [
|
|
819
|
+
group([
|
|
820
|
+
query('@DialogTrigger', animateChild()),
|
|
821
|
+
query('@BackdropTrigger', animateChild()),
|
|
822
|
+
]),
|
|
823
|
+
]),
|
|
824
|
+
]),
|
|
825
|
+
], imports: [
|
|
826
|
+
NgClass,
|
|
827
|
+
], 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" }]
|
|
828
|
+
}], propDecorators: { hasAnimation: [{
|
|
829
|
+
type: HostBinding,
|
|
830
|
+
args: ['@ModalTrigger']
|
|
831
|
+
}], 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: [{
|
|
832
|
+
type: ViewChild,
|
|
833
|
+
args: ['dialog', { static: false }]
|
|
834
|
+
}] } });
|
|
835
|
+
|
|
836
|
+
class ModalComponent {
|
|
837
|
+
constructor() {
|
|
838
|
+
this.submitLabel = input('', ...(ngDevMode ? [{ debugName: "submitLabel" }] : []));
|
|
839
|
+
this.isSubmitting = input(false, ...(ngDevMode ? [{ debugName: "isSubmitting" }] : []));
|
|
840
|
+
this.isSuccess = input(false, ...(ngDevMode ? [{ debugName: "isSuccess" }] : []));
|
|
841
|
+
this.isLarge = input(false, ...(ngDevMode ? [{ debugName: "isLarge" }] : []));
|
|
842
|
+
this.form = input(null, ...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
843
|
+
this.submitColorVariant = input(EButtonColorVariant$1.Primary, ...(ngDevMode ? [{ debugName: "submitColorVariant" }] : []));
|
|
844
|
+
this.closingCondition = input(EModalCloseCondition.Close, ...(ngDevMode ? [{ debugName: "closingCondition" }] : []));
|
|
845
|
+
this.isCancelButtonVisible = input(false, ...(ngDevMode ? [{ debugName: "isCancelButtonVisible" }] : []));
|
|
846
|
+
this.cancelLabel = input('', ...(ngDevMode ? [{ debugName: "cancelLabel" }] : []));
|
|
847
|
+
this.isCrossButtonVisible = input(false, ...(ngDevMode ? [{ debugName: "isCrossButtonVisible" }] : []));
|
|
848
|
+
this.isFooterInvisible = input(false, ...(ngDevMode ? [{ debugName: "isFooterInvisible" }] : []));
|
|
849
|
+
this.closeEvent = output();
|
|
850
|
+
this.submitEvent = output();
|
|
851
|
+
this.isOpen = signal(true, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
852
|
+
effect(() => {
|
|
853
|
+
const closingCondition = this.closingCondition();
|
|
854
|
+
const isSuccess = this.isSuccess();
|
|
855
|
+
if (closingCondition === EModalCloseCondition.SubmitSuccess && isSuccess) {
|
|
856
|
+
setTimeout(() => {
|
|
857
|
+
this.handleCloseClick();
|
|
858
|
+
}, 1000);
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
handleCloseClick() {
|
|
863
|
+
this.isOpen.set(false);
|
|
864
|
+
}
|
|
865
|
+
emitCloseEvent() {
|
|
866
|
+
this.closeEvent.emit();
|
|
867
|
+
}
|
|
868
|
+
emitSubmitEvent() {
|
|
869
|
+
this.submitEvent.emit();
|
|
870
|
+
}
|
|
871
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
872
|
+
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"] }] }); }
|
|
873
|
+
}
|
|
874
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ModalComponent, decorators: [{
|
|
875
|
+
type: Component,
|
|
876
|
+
args: [{ selector: 'skcr-modal', imports: [
|
|
877
|
+
DialogComponent,
|
|
878
|
+
SubmitButtonComponent,
|
|
879
|
+
NgClass,
|
|
880
|
+
NgIcon,
|
|
881
|
+
], 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" }]
|
|
882
|
+
}], 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"] }] } });
|
|
883
|
+
|
|
884
|
+
class ConfirmationModalComponent {
|
|
885
|
+
constructor() {
|
|
886
|
+
this.class = 'absolute';
|
|
887
|
+
this.submitLabel = input.required(...(ngDevMode ? [{ debugName: "submitLabel" }] : []));
|
|
888
|
+
this.isSubmitting = input(false, ...(ngDevMode ? [{ debugName: "isSubmitting" }] : []));
|
|
889
|
+
this.isSuccess = input(false, ...(ngDevMode ? [{ debugName: "isSuccess" }] : []));
|
|
890
|
+
this.form = input(null, ...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
891
|
+
this.isCloseButtonVisible = input(false, ...(ngDevMode ? [{ debugName: "isCloseButtonVisible" }] : []));
|
|
892
|
+
this.cancelLabel = input('', ...(ngDevMode ? [{ debugName: "cancelLabel" }] : []));
|
|
893
|
+
this.levelVariant = input(EConfirmLevelVariant.Info, ...(ngDevMode ? [{ debugName: "levelVariant" }] : []));
|
|
894
|
+
this.closingCondition = input(EModalCloseCondition.SubmitSuccess, ...(ngDevMode ? [{ debugName: "closingCondition" }] : []));
|
|
895
|
+
this.closeEvent = output();
|
|
896
|
+
this.submitEvent = output();
|
|
897
|
+
this.iconKey = computed(() => {
|
|
898
|
+
return this.levelVariant() === EConfirmLevelVariant.Success ? 'heroCheckCircle' : 'heroExclamationTriangle';
|
|
899
|
+
}, ...(ngDevMode ? [{ debugName: "iconKey" }] : []));
|
|
900
|
+
this.submitColorVariant = computed(() => {
|
|
901
|
+
return this.levelVariant() === EConfirmLevelVariant.Danger
|
|
902
|
+
? EButtonColorVariant$1.Danger
|
|
903
|
+
: EButtonColorVariant$1.Primary;
|
|
904
|
+
}, ...(ngDevMode ? [{ debugName: "submitColorVariant" }] : []));
|
|
905
|
+
this.iconColorVariant = computed(() => {
|
|
906
|
+
return this.levelVariant() === EConfirmLevelVariant.Danger ? 'text-red-500' : 'text-primary-l';
|
|
907
|
+
}, ...(ngDevMode ? [{ debugName: "iconColorVariant" }] : []));
|
|
908
|
+
}
|
|
909
|
+
emitCloseEvent() {
|
|
910
|
+
this.closeEvent.emit();
|
|
911
|
+
}
|
|
912
|
+
emitSubmitEvent() {
|
|
913
|
+
this.submitEvent.emit();
|
|
914
|
+
}
|
|
915
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
916
|
+
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"] }] }); }
|
|
917
|
+
}
|
|
918
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ConfirmationModalComponent, decorators: [{
|
|
919
|
+
type: Component,
|
|
920
|
+
args: [{ selector: 'skcr-confirmation-modal', imports: [
|
|
921
|
+
ModalComponent,
|
|
922
|
+
NgIcon,
|
|
923
|
+
], 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" }]
|
|
924
|
+
}], propDecorators: { class: [{
|
|
925
|
+
type: HostBinding,
|
|
926
|
+
args: ['class']
|
|
927
|
+
}], 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"] }] } });
|
|
928
|
+
|
|
929
|
+
class DropdownMenuComponent {
|
|
930
|
+
constructor() {
|
|
931
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
932
|
+
this.labelIcon = input(...(ngDevMode ? [undefined, { debugName: "labelIcon" }] : []));
|
|
933
|
+
this.isOpeningOnLeft = input(false, ...(ngDevMode ? [{ debugName: "isOpeningOnLeft" }] : []));
|
|
934
|
+
this.menuClosed = output();
|
|
935
|
+
this.isMenuOpen = signal(false, ...(ngDevMode ? [{ debugName: "isMenuOpen" }] : []));
|
|
936
|
+
this.clickOutsideHandler = (e) => {
|
|
937
|
+
const target = e.target;
|
|
938
|
+
const isClickInDropdown = this.dropdownMenu?.nativeElement.contains(target);
|
|
939
|
+
const isClickInToggleButton = this.toggleButton?.nativeElement.contains(target);
|
|
940
|
+
if (!isClickInDropdown && !isClickInToggleButton) {
|
|
941
|
+
this.closeMenu();
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
toggleMenu() {
|
|
946
|
+
this.isMenuOpen.update(isOpen => !isOpen);
|
|
947
|
+
if (this.isMenuOpen()) {
|
|
948
|
+
document.addEventListener('click', this.clickOutsideHandler);
|
|
949
|
+
}
|
|
950
|
+
else {
|
|
951
|
+
document.removeEventListener('click', this.clickOutsideHandler);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
closeMenu() {
|
|
955
|
+
this.isMenuOpen.set(false);
|
|
956
|
+
document.removeEventListener('click', this.clickOutsideHandler);
|
|
957
|
+
this.menuClosed.emit();
|
|
958
|
+
}
|
|
959
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
960
|
+
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: [
|
|
961
|
+
trigger('dropdownAnimation', [
|
|
962
|
+
transition(':enter', [
|
|
963
|
+
style({ opacity: 0, transform: 'translateY(-10px)' }),
|
|
964
|
+
animate('200ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
|
|
965
|
+
]),
|
|
966
|
+
transition(':leave', [
|
|
967
|
+
style({ opacity: 1 }),
|
|
968
|
+
animate('200ms ease-in', style({ opacity: 0, transform: 'translateY(-10px)' })),
|
|
969
|
+
]),
|
|
970
|
+
]),
|
|
971
|
+
] }); }
|
|
972
|
+
}
|
|
973
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DropdownMenuComponent, decorators: [{
|
|
974
|
+
type: Component,
|
|
975
|
+
args: [{ selector: 'skcr-dropdown-menu', imports: [
|
|
976
|
+
NgIcon,
|
|
977
|
+
], animations: [
|
|
978
|
+
trigger('dropdownAnimation', [
|
|
979
|
+
transition(':enter', [
|
|
980
|
+
style({ opacity: 0, transform: 'translateY(-10px)' }),
|
|
981
|
+
animate('200ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
|
|
982
|
+
]),
|
|
983
|
+
transition(':leave', [
|
|
984
|
+
style({ opacity: 1 }),
|
|
985
|
+
animate('200ms ease-in', style({ opacity: 0, transform: 'translateY(-10px)' })),
|
|
986
|
+
]),
|
|
987
|
+
]),
|
|
988
|
+
], 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" }]
|
|
989
|
+
}], propDecorators: { dropdownMenu: [{
|
|
990
|
+
type: ViewChild,
|
|
991
|
+
args: ['dropdownMenu']
|
|
992
|
+
}], toggleButton: [{
|
|
993
|
+
type: ViewChild,
|
|
994
|
+
args: ['toggleButton']
|
|
995
|
+
}], 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"] }] } });
|
|
996
|
+
|
|
997
|
+
const DD_MM_YYYY_FORMAT = {
|
|
998
|
+
parse: {
|
|
999
|
+
dateInput: 'DD/MM/YYYY',
|
|
1000
|
+
},
|
|
1001
|
+
display: {
|
|
1002
|
+
dateInput: 'DD/MM/YYYY',
|
|
1003
|
+
monthYearLabel: 'MMM YYYY',
|
|
1004
|
+
dateA11yLabel: 'LL',
|
|
1005
|
+
monthYearA11yLabel: 'MMMM YYYY',
|
|
1006
|
+
},
|
|
1007
|
+
};
|
|
1008
|
+
class DatePickerComponent {
|
|
1009
|
+
constructor() {
|
|
1010
|
+
this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
1011
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1012
|
+
this.placeholder = input('dd/mm/yyyy', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1013
|
+
this.isInvalid = input(false, ...(ngDevMode ? [{ debugName: "isInvalid" }] : []));
|
|
1014
|
+
this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
1015
|
+
this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
1016
|
+
this.dateAdapter = inject((DateAdapter));
|
|
1017
|
+
this.dateAdapter.setLocale('fr-FR');
|
|
1018
|
+
}
|
|
1019
|
+
formatDate(date) {
|
|
1020
|
+
if (!date)
|
|
1021
|
+
return '';
|
|
1022
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
1023
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
1024
|
+
const year = date.getFullYear();
|
|
1025
|
+
return `${day}/${month}/${year}`;
|
|
1026
|
+
}
|
|
1027
|
+
parseDate(dateStr) {
|
|
1028
|
+
if (!dateStr)
|
|
1029
|
+
return null;
|
|
1030
|
+
dateStr = dateStr.replace(/[^\d/]/g, '');
|
|
1031
|
+
if (dateStr.length === 2 && !dateStr.includes('/')) {
|
|
1032
|
+
dateStr += '/';
|
|
1033
|
+
}
|
|
1034
|
+
else if (dateStr.length === 5 && dateStr.indexOf('/', 3) === -1) {
|
|
1035
|
+
dateStr += '/';
|
|
1036
|
+
}
|
|
1037
|
+
const parts = dateStr.split('/');
|
|
1038
|
+
if (parts.length !== 3)
|
|
1039
|
+
return null;
|
|
1040
|
+
const day = parseInt(parts[0], 10);
|
|
1041
|
+
const month = parseInt(parts[1], 10) - 1;
|
|
1042
|
+
const year = parseInt(parts[2], 10);
|
|
1043
|
+
if (isNaN(day) || isNaN(month) || isNaN(year))
|
|
1044
|
+
return null;
|
|
1045
|
+
const date = new Date(year, month, day);
|
|
1046
|
+
if (date.getFullYear() !== year || date.getMonth() !== month || date.getDate() !== day) {
|
|
1047
|
+
return null;
|
|
1048
|
+
}
|
|
1049
|
+
return date;
|
|
1050
|
+
}
|
|
1051
|
+
onDateChange(date) {
|
|
1052
|
+
this.value.set(date);
|
|
1053
|
+
// this.markAsTouched();
|
|
1054
|
+
}
|
|
1055
|
+
onInputChange(event) {
|
|
1056
|
+
const input = event.target;
|
|
1057
|
+
const value = input.value;
|
|
1058
|
+
let formattedValue = value.replace(/[^\d/]/g, '');
|
|
1059
|
+
if (formattedValue.length === 2 && !formattedValue.includes('/')) {
|
|
1060
|
+
formattedValue = formattedValue + '/';
|
|
1061
|
+
input.value = formattedValue;
|
|
1062
|
+
}
|
|
1063
|
+
else if (formattedValue.length === 5 && formattedValue.indexOf('/', 3) === -1) {
|
|
1064
|
+
formattedValue = formattedValue + '/';
|
|
1065
|
+
input.value = formattedValue;
|
|
1066
|
+
}
|
|
1067
|
+
const date = this.parseDate(formattedValue);
|
|
1068
|
+
this.value.set(date);
|
|
1069
|
+
}
|
|
1070
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1071
|
+
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: [
|
|
1072
|
+
{ provide: MAT_DATE_FORMATS, useValue: DD_MM_YYYY_FORMAT },
|
|
1073
|
+
{ provide: MAT_DATE_LOCALE, useValue: 'fr-FR' },
|
|
1074
|
+
], 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 }] }); }
|
|
1075
|
+
}
|
|
1076
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
1077
|
+
type: Component,
|
|
1078
|
+
args: [{ selector: 'skcr-date-picker', providers: [
|
|
1079
|
+
{ provide: MAT_DATE_FORMATS, useValue: DD_MM_YYYY_FORMAT },
|
|
1080
|
+
{ provide: MAT_DATE_LOCALE, useValue: 'fr-FR' },
|
|
1081
|
+
], imports: [
|
|
1082
|
+
NgClass,
|
|
1083
|
+
FormsModule,
|
|
1084
|
+
MatDatepickerModule,
|
|
1085
|
+
MatInputModule,
|
|
1086
|
+
MatFormFieldModule,
|
|
1087
|
+
MatNativeDateModule,
|
|
1088
|
+
FormsModule,
|
|
1089
|
+
MatDatepickerModule,
|
|
1090
|
+
MatInputModule,
|
|
1091
|
+
MatFormFieldModule,
|
|
1092
|
+
MatNativeDateModule,
|
|
1093
|
+
], 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" }]
|
|
1094
|
+
}], 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"] }] } });
|
|
1095
|
+
|
|
1096
|
+
class RadioButtonComponent {
|
|
1097
|
+
constructor() {
|
|
1098
|
+
this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1099
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1100
|
+
this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
1101
|
+
this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
1102
|
+
}
|
|
1103
|
+
onRadioChange(value) {
|
|
1104
|
+
this.value.set(value);
|
|
1105
|
+
}
|
|
1106
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: RadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1107
|
+
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 }] }); }
|
|
1108
|
+
}
|
|
1109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: RadioButtonComponent, decorators: [{
|
|
1110
|
+
type: Component,
|
|
1111
|
+
args: [{ selector: 'skcr-radio-button', imports: [
|
|
1112
|
+
FormsModule,
|
|
1113
|
+
ReactiveFormsModule,
|
|
1114
|
+
], 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" }]
|
|
1115
|
+
}], 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"] }] } });
|
|
1116
|
+
|
|
1117
|
+
class ToastService {
|
|
1118
|
+
constructor() {
|
|
1119
|
+
this.newToastEvent$ = new Subject();
|
|
1120
|
+
}
|
|
1121
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1122
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastService, providedIn: 'root' }); }
|
|
1123
|
+
}
|
|
1124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastService, decorators: [{
|
|
1125
|
+
type: Injectable,
|
|
1126
|
+
args: [{
|
|
1127
|
+
providedIn: 'root',
|
|
1128
|
+
}]
|
|
1129
|
+
}] });
|
|
1130
|
+
|
|
1131
|
+
class ToastComponent {
|
|
1132
|
+
constructor() {
|
|
1133
|
+
this.class = 'flex w-full flex-col items-center space-y-4 sm:items-end';
|
|
1134
|
+
this.toast = input.required(...(ngDevMode ? [{ debugName: "toast" }] : []));
|
|
1135
|
+
this.disposeEvent = output();
|
|
1136
|
+
}
|
|
1137
|
+
ngOnInit() {
|
|
1138
|
+
setTimeout(() => {
|
|
1139
|
+
this.closeToast();
|
|
1140
|
+
}, 5000);
|
|
1141
|
+
}
|
|
1142
|
+
closeToast() {
|
|
1143
|
+
this.disposeEvent.emit(this.toast());
|
|
1144
|
+
}
|
|
1145
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1146
|
+
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: [
|
|
1147
|
+
trigger('AnimationTrigger0', [
|
|
1148
|
+
transition(':enter', [
|
|
1149
|
+
style({ transform: 'translateY(0.5rem)', opacity: 0 }),
|
|
1150
|
+
animate('300ms ease-out', style({ transform: 'translateY(0)', opacity: 1 })),
|
|
1151
|
+
]),
|
|
1152
|
+
transition(':leave', [
|
|
1153
|
+
style({ opacity: 1 }),
|
|
1154
|
+
animate('100ms ease-in', style({ opacity: 0 })),
|
|
1155
|
+
]),
|
|
1156
|
+
]),
|
|
1157
|
+
] }); }
|
|
1158
|
+
}
|
|
1159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToastComponent, decorators: [{
|
|
1160
|
+
type: Component,
|
|
1161
|
+
args: [{ selector: 'app-toast', animations: [
|
|
1162
|
+
trigger('AnimationTrigger0', [
|
|
1163
|
+
transition(':enter', [
|
|
1164
|
+
style({ transform: 'translateY(0.5rem)', opacity: 0 }),
|
|
1165
|
+
animate('300ms ease-out', style({ transform: 'translateY(0)', opacity: 1 })),
|
|
1166
|
+
]),
|
|
1167
|
+
transition(':leave', [
|
|
1168
|
+
style({ opacity: 1 }),
|
|
1169
|
+
animate('100ms ease-in', style({ opacity: 0 })),
|
|
1170
|
+
]),
|
|
1171
|
+
]),
|
|
1172
|
+
], imports: [
|
|
1173
|
+
NgIcon,
|
|
1174
|
+
], 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" }]
|
|
1175
|
+
}], propDecorators: { class: [{
|
|
1176
|
+
type: HostBinding,
|
|
1177
|
+
args: ['class']
|
|
1178
|
+
}], toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], disposeEvent: [{ type: i0.Output, args: ["disposeEvent"] }] } });
|
|
1179
|
+
|
|
1180
|
+
class ToasterComponent {
|
|
1181
|
+
constructor() {
|
|
1182
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1183
|
+
this.toastService = inject(ToastService);
|
|
1184
|
+
this.currentToasts = [];
|
|
1185
|
+
}
|
|
1186
|
+
ngOnInit() {
|
|
1187
|
+
this.subscribeToToasts();
|
|
1188
|
+
}
|
|
1189
|
+
subscribeToToasts() {
|
|
1190
|
+
this.newToastSub = this.toastService.newToastEvent$.subscribe(toast => {
|
|
1191
|
+
const currentToast = {
|
|
1192
|
+
id: Date.now(),
|
|
1193
|
+
key: toast.key,
|
|
1194
|
+
message: toast.message,
|
|
1195
|
+
};
|
|
1196
|
+
this.currentToasts.push(currentToast);
|
|
1197
|
+
this.cdr.detectChanges();
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
dispose(toastToRemove) {
|
|
1201
|
+
const toastIndex = this.currentToasts.findIndex(toast => toast.id === toastToRemove.id);
|
|
1202
|
+
this.currentToasts.splice(toastIndex, 1);
|
|
1203
|
+
this.cdr.detectChanges();
|
|
1204
|
+
}
|
|
1205
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToasterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1206
|
+
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 }); }
|
|
1207
|
+
}
|
|
1208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ToasterComponent, decorators: [{
|
|
1209
|
+
type: Component,
|
|
1210
|
+
args: [{ selector: 'skcr-toaster', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1211
|
+
ToastComponent,
|
|
1212
|
+
], 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" }]
|
|
1213
|
+
}] });
|
|
317
1214
|
|
|
318
1215
|
/**
|
|
319
1216
|
* Generated bundle index. Do not edit.
|
|
320
1217
|
*/
|
|
321
1218
|
|
|
322
|
-
export {
|
|
1219
|
+
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
1220
|
//# sourceMappingURL=skcr-autechre.mjs.map
|