ngx-lite-form 1.2.0-pr.25.20250923034808 → 1.2.1-pr.26.20250923091817

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,97 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, effect, Component, HostListener, ViewChild, signal, computed, output, NgModule, Injectable } from '@angular/core';
2
+ import { input, effect, Component, HostListener, ViewChild, signal, computed, Injectable, output } from '@angular/core';
3
+ import * as i2 from '@angular/forms';
4
+ import { FormControl, ReactiveFormsModule } from '@angular/forms';
3
5
  import * as i1 from '@angular/common';
4
6
  import { CommonModule } from '@angular/common';
5
- import * as i2 from '@angular/forms';
6
- import { FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
7
7
  import { trigger, state, transition, style, animate } from '@angular/animations';
8
8
  import * as i1$1 from '@angular/platform-browser';
9
9
 
10
+ class FieldDto {
11
+ label;
12
+ formControl;
13
+ rows;
14
+ type;
15
+ constructor(label, formControl, rows = 2, type = 'text') {
16
+ this.label = label;
17
+ this.formControl = formControl;
18
+ this.rows = rows;
19
+ this.type = type;
20
+ }
21
+ }
22
+ class BaseSelectFieldDto {
23
+ label;
24
+ options;
25
+ displayWith;
26
+ constructor(label, options, displayWith) {
27
+ this.label = label;
28
+ this.options = options;
29
+ this.displayWith = displayWith;
30
+ }
31
+ }
32
+ class SelectFieldDto extends BaseSelectFieldDto {
33
+ formControl;
34
+ constructor(label, formControl, options, displayWith) {
35
+ super(label, options, displayWith);
36
+ this.formControl = formControl;
37
+ }
38
+ }
39
+ class MultiSelectFieldDto extends BaseSelectFieldDto {
40
+ formControl;
41
+ constructor(label, formControl, options, displayWith) {
42
+ super(label, options, displayWith);
43
+ this.formControl = formControl;
44
+ }
45
+ }
46
+ class RadioFieldDto extends BaseSelectFieldDto {
47
+ formControl;
48
+ constructor(label, formControl, options, displayWith) {
49
+ super(label, options, displayWith);
50
+ this.formControl = formControl;
51
+ }
52
+ }
53
+ class FileFieldDto {
54
+ label;
55
+ formControl;
56
+ multiple;
57
+ accept;
58
+ maxFileSize;
59
+ maxFiles;
60
+ showPreview;
61
+ constructor(label, formControl, multiple = true, accept = '*/*', maxFileSize = 10 * 1024 * 1024, // 10MB
62
+ maxFiles = 10, showPreview = true) {
63
+ this.label = label;
64
+ this.formControl = formControl;
65
+ this.multiple = multiple;
66
+ this.accept = accept;
67
+ this.maxFileSize = maxFileSize;
68
+ this.maxFiles = maxFiles;
69
+ this.showPreview = showPreview;
70
+ }
71
+ }
72
+ class PaginatorFieldDto {
73
+ currentPage;
74
+ totalItems;
75
+ itemsPerPage;
76
+ constructor(currentPage = 1, totalItems = 0, itemsPerPage = 10) {
77
+ this.currentPage = currentPage;
78
+ this.totalItems = totalItems;
79
+ this.itemsPerPage = itemsPerPage;
80
+ }
81
+ }
82
+ class TableFieldDto {
83
+ columns;
84
+ data;
85
+ showPaginator;
86
+ paginatorConfig;
87
+ constructor(columns, data, showPaginator = false, paginatorConfig = new PaginatorFieldDto()) {
88
+ this.columns = columns;
89
+ this.data = data;
90
+ this.showPaginator = showPaginator;
91
+ this.paginatorConfig = paginatorConfig;
92
+ }
93
+ }
94
+
10
95
  /**
11
96
  * Utility class for form-related helper functions
12
97
  */
@@ -1837,6 +1922,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
1837
1922
  args: ['cameraInput']
1838
1923
  }] } });
1839
1924
 
1925
+ class LiteSnackbarService {
1926
+ timeoutId;
1927
+ snackbarElem = null;
1928
+ show(text, type = 'done', duration = 3000) {
1929
+ this.clear();
1930
+ this.snackbarElem = document.createElement('div');
1931
+ this.snackbarElem.className = `lite-snackbar ${type}`;
1932
+ this.snackbarElem.innerHTML = `
1933
+ <div class="icon">${this.getIcon(type)}</div>
1934
+ <div class="text">${this.escapeHtml(text)}</div>
1935
+ `;
1936
+ this.injectStyles();
1937
+ document.body.appendChild(this.snackbarElem);
1938
+ this.timeoutId = setTimeout(() => this.clear(), duration);
1939
+ }
1940
+ clear() {
1941
+ if (this.timeoutId)
1942
+ clearTimeout(this.timeoutId);
1943
+ if (this.snackbarElem && this.snackbarElem.parentNode) {
1944
+ this.snackbarElem.parentNode.removeChild(this.snackbarElem);
1945
+ }
1946
+ this.snackbarElem = null;
1947
+ }
1948
+ getIcon(type) {
1949
+ if (type === 'done') {
1950
+ return `<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10"/><path d="M6 10.5L9 13.5L14 8.5" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
1951
+ }
1952
+ if (type === 'warn') {
1953
+ return `<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10"/><path d="M10 6V11" stroke="#fff" stroke-width="2" stroke-linecap="round"/><circle cx="10" cy="14" r="1" fill="#fff"/></svg>`;
1954
+ }
1955
+ if (type === 'error') {
1956
+ return `<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10"/><path d="M7 7L13 13M13 7L7 13" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>`;
1957
+ }
1958
+ return '';
1959
+ }
1960
+ injectStyles() {
1961
+ if (document.getElementById('lite-snackbar-style'))
1962
+ return;
1963
+ const style = document.createElement('style');
1964
+ style.id = 'lite-snackbar-style';
1965
+ style.innerHTML = `
1966
+ .lite-snackbar {
1967
+ position: fixed;
1968
+ left: 50%;
1969
+ top: 20px;
1970
+ transform: translateX(-50%);
1971
+ min-width: 200px;
1972
+ max-width: 90vw;
1973
+ padding: 8px 15px 8px 5px;
1974
+ border-radius: 6px;
1975
+ color: #fff;
1976
+ font-size: 1rem;
1977
+ display: flex;
1978
+ align-items: center;
1979
+ box-shadow: 0 2px 12px rgba(0,0,0,0.18);
1980
+ z-index: 9999;
1981
+ opacity: 0.9;
1982
+ animation: snackbar-in 0.2s;
1983
+ }
1984
+ .lite-snackbar.done { background: #3a82eeff; }
1985
+ .lite-snackbar.warn { background: #f7b731; }
1986
+ .lite-snackbar.error { background: #e74c3c; }
1987
+ .lite-snackbar .icon { margin-right: 5px; height: 30px; }
1988
+ @keyframes snackbar-in {
1989
+ from { opacity: 0; transform: translateX(-50%) translateY(-30px); }
1990
+ to { opacity: 0.9; transform: translateX(-50%) translateY(0); }
1991
+ }
1992
+ `;
1993
+ document.head.appendChild(style);
1994
+ }
1995
+ escapeHtml(text) {
1996
+ return text.replace(/[&<>'"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '\'': '&#39;', '"': '&quot;' }[c] || c));
1997
+ }
1998
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteSnackbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1999
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteSnackbarService, providedIn: 'root' });
2000
+ }
2001
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteSnackbarService, decorators: [{
2002
+ type: Injectable,
2003
+ args: [{ providedIn: 'root' }]
2004
+ }] });
2005
+
1840
2006
  class LitePaginator {
1841
2007
  paginator = input.required(...(ngDevMode ? [{ debugName: "paginator" }] : []));
1842
2008
  pageChange = output();
@@ -1970,192 +2136,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
1970
2136
  args: [{ selector: 'lite-table', standalone: true, imports: [CommonModule, LitePaginator], template: "<div class=\"lite-table\">\n <!-- Table Header -->\n <div class=\"table-header\">\n <div class=\"header-row\">\n @for (column of table().columns; track column.key) {\n <div\n class=\"header-cell\"\n [style.flex]=\"column.flex || '1'\"\n [class.sortable]=\"column.sortable\">\n {{ column.label }}\n </div>\n }\n </div>\n </div>\n\n <!-- Table Body -->\n <div class=\"table-body\">\n @for (row of paginatedData(); track $index) {\n <div class=\"data-row\">\n @for (column of table().columns; track column.key) {\n <div class=\"data-cell\" [style.flex]=\"column.flex || '1'\">\n <span [innerHTML]=\"getCellValue(row, column)\"></span>\n </div>\n }\n </div>\n }\n @if (paginatedData().length === 0) {\n <div class=\"empty-row\">\n <div\n class=\"empty-cell\"\n [style.flex]=\"'1'\">\n No data available\n </div>\n </div>\n }\n </div>\n\n <!-- Paginator -->\n @if (table().showPaginator) {\n <div class=\"table-paginator\">\n <lite-paginator\n [paginator]=\"table().paginatorConfig\"\n (pageChange)=\"onPageChange($event)\"\n (itemsPerPageChange)=\"onItemsPerPageChange($event)\">\n </lite-paginator>\n </div>\n }\n</div>\n", styles: ["*{box-sizing:border-box}input,.label,textarea{font-size:1em;color:#333}.lite-input{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-input .label{font-size:.8em;font-weight:500}.lite-input .value{min-height:1em;line-height:1em}.lite-input.in-edit .label{position:absolute;left:8px;top:2px;color:#aaa;pointer-events:none;transition:.2s;font-size:1em;line-height:40px;font-weight:400}.lite-input.in-edit input{border:1px solid #ccc;border-radius:4px;padding:0 8px;font-size:1em;outline:none;line-height:40px;height:40px}.lite-input.in-edit input:focus{border-color:#2079e1;box-shadow:0 0 5px #2079e180}.lite-input.in-edit input:focus+.label,.lite-input.in-edit input:not(:placeholder-shown)+.label{transform:translateY(-10px) translate(-10px) scale(.8);background:#fff;padding:0 5px;color:#2079e1;line-height:initial}.lite-input.in-edit input.invalid{border-color:#dc3545;background-color:#fff5f5;box-shadow:0 0 2px 1px #dc354540}.lite-password{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-password .label{font-size:.8em;font-weight:500}.lite-password .value{min-height:1em;line-height:1em}.lite-password.in-edit .input-container{position:relative;display:flex;align-items:center}.lite-password.in-edit .input-container input{border:1px solid #ccc;border-radius:4px;padding:0 2.5em 0 8px;font-size:1em;outline:none;line-height:40px;height:40px;width:100%}.lite-password.in-edit .input-container input:focus{border-color:#2079e1;box-shadow:0 0 5px #2079e180}.lite-password.in-edit .input-container input.invalid{border-color:#dc3545;background-color:#fff5f5;box-shadow:0 0 0 2px 1px #dc354540}.lite-password.in-edit .input-container .label{position:absolute;left:8px;top:2px;color:#aaa;pointer-events:none;transition:.2s;font-size:1em;line-height:40px;font-weight:400}.lite-password.in-edit .input-container input:focus+.label,.lite-password.in-edit .input-container input:not(:placeholder-shown)+.label{transform:translateY(-10px) translate(-10px) scale(.8);background:#fff;padding:0 5px;color:#2079e1;line-height:initial}.lite-password.in-edit .input-container .toggle-button{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#666;display:flex;align-items:center;justify-content:center;transition:color .2s,background-color .2s}.lite-password.in-edit .input-container .toggle-button:hover{color:#2079e1;background-color:#f5f5f5}.lite-password.in-edit .input-container .toggle-button:focus{outline:2px solid #2079e1;outline-offset:2px}.lite-password.in-edit .input-container .toggle-button svg{width:16px;height:16px;stroke-width:1.5}.lite-password.in-edit .password-strength{margin-top:8px;padding:8px 0}.lite-password.in-edit .password-strength .strength-bar{width:100%;height:4px;background-color:#e0e0e0;border-radius:2px;overflow:hidden;margin-bottom:6px}.lite-password.in-edit .password-strength .strength-bar .strength-fill{height:100%;transition:width .3s ease,background-color .3s ease;border-radius:2px}.lite-password.in-edit .password-strength .strength-bar .strength-fill.strength-very-weak{width:12.5%;background-color:#f44336}.lite-password.in-edit .password-strength .strength-bar .strength-fill.strength-weak{width:25%;background-color:#ff9800}.lite-password.in-edit .password-strength .strength-bar .strength-fill.strength-fair{width:50%;background-color:#ffeb3b}.lite-password.in-edit .password-strength .strength-bar .strength-fill.strength-good{width:75%;background-color:#8bc34a}.lite-password.in-edit .password-strength .strength-bar .strength-fill.strength-strong{width:100%;background-color:#4caf50}.lite-password.in-edit .password-strength .strength-info{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.lite-password.in-edit .password-strength .strength-info .strength-level{font-size:.85em;font-weight:600}.lite-password.in-edit .password-strength .strength-info .strength-level.level-very-weak{color:#f44336}.lite-password.in-edit .password-strength .strength-info .strength-level.level-weak,.lite-password.in-edit .password-strength .strength-info .strength-level.level-fair{color:#ff9800}.lite-password.in-edit .password-strength .strength-info .strength-level.level-good{color:#8bc34a}.lite-password.in-edit .password-strength .strength-info .strength-level.level-strong{color:#4caf50}.lite-password.in-edit .password-strength .strength-info .strength-score{font-size:.8em;color:#666}.lite-password.in-edit .password-strength .strength-feedback{font-size:.75em;color:#666;line-height:1.4}.lite-password.in-edit .password-strength .strength-feedback .feedback-tip{margin-bottom:2px}.lite-textarea{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-textarea .label{font-size:.8em;font-weight:500}.lite-textarea .value{min-height:1em;line-height:1em}.lite-textarea.in-edit .label{position:absolute;left:8px;top:2px;color:#aaa;pointer-events:none;transition:.2s;font-size:1em;line-height:40px;font-weight:400}.lite-textarea.in-edit textarea{border:1px solid #ccc;border-radius:4px;padding:5px 8px;font-size:1em;outline:none;line-height:40px}.lite-textarea.in-edit textarea:focus{border-color:#2079e1;box-shadow:0 0 5px #2079e180}.lite-textarea.in-edit textarea:focus+.label,.lite-textarea.in-edit textarea:not(:placeholder-shown)+.label{transform:translateY(-10px) translate(-10px) scale(.8);background:#fff;padding:0 5px;color:#2079e1;line-height:initial}.lite-textarea.in-edit textarea.invalid{border-color:#dc3545;background-color:#fff5f5;box-shadow:0 0 0 2px 1px #dc354540}.lite-select{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-select .label{font-size:.8em;font-weight:500}.lite-select .value{min-height:1em;line-height:1em}.lite-select.in-edit .label{position:absolute;left:8px;top:2px;color:#aaa;pointer-events:none;transition:.2s;font-size:1em;line-height:40px;font-weight:400}.lite-select.in-edit input{border:1px solid #ccc;border-radius:4px;padding:0 2em 0 8px;font-size:1em;outline:none;line-height:40px;height:40px}.lite-select.in-edit input:focus{border-color:#2079e1;box-shadow:0 0 5px #2079e180}.lite-select.in-edit input.invalid{border-color:#dc3545;background-color:#fff5f5;box-shadow:0 0 0 2px 1px #dc354540}.lite-select.in-edit .label.float{transform:translateY(-10px) translate(-10px) scale(.8);background:#fff;padding:0 5px;color:#2079e1;line-height:initial}.lite-select.in-edit .options{position:absolute;top:100%;left:0;right:0;background:#fff;border:1px solid #ccc;border-radius:4px;max-height:200px;overflow-y:auto;z-index:1000;overflow:hidden}.lite-select.in-edit .options .option{padding:8px;cursor:pointer}.lite-select.in-edit .options .option:hover{background-color:#f0f0f0}.lite-select.in-edit .options .option.selected{background-color:#e0e0e0}.lite-select.in-edit .arrow_box{position:absolute;right:0;top:0;cursor:pointer;height:100%;width:2em}.lite-select.in-edit .arrow_box .arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #333;position:absolute;top:48%;left:.5em}.lite-select.in-edit .arrow_box .arrow:hover{border-top-color:#2079e1}.lite-multi-select{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-multi-select .label{font-size:.8em;font-weight:500}.lite-multi-select .value{display:flex;gap:5px;flex-wrap:wrap;min-height:1em;line-height:1em}.lite-multi-select .value .item{border:1px solid #999;padding:2px 5px;border-radius:3px;font-size:.8em;line-height:16px}.lite-multi-select.in-edit .label{position:absolute;left:8px;top:2px;color:#aaa;pointer-events:none;transition:.2s;font-size:1em;line-height:40px;font-weight:400}.lite-multi-select.in-edit .input-container{border:1px solid #ccc;border-radius:4px;background:#fff;outline:none;min-height:40px;padding:0 2em 0 8px;position:relative;transition:height .2s ease-in-out}.lite-multi-select.in-edit .input-container:focus-within{border-color:#2079e1;box-shadow:0 0 5px #2079e180}.lite-multi-select.in-edit .input-container.invalid{border-color:#dc3545;background-color:#fff5f5;box-shadow:0 0 0 2px 1px #dc354540}.lite-multi-select.in-edit .input-container .selected-items-inline{position:absolute;inset:0 2em 0 8px;display:flex;flex-wrap:wrap;gap:4px;padding:6px 0;align-content:flex-start;align-items:flex-start;pointer-events:none;z-index:3;overflow:hidden;height:fit-content}.lite-multi-select.in-edit .input-container .selected-items-inline .selected-item-inline{display:inline-flex;align-items:center;border:1px solid #999;background:#fff;padding-left:5px;border-radius:3px;font-size:.8em;gap:4px;max-width:calc(100% - 20px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:20px;pointer-events:auto}.lite-multi-select.in-edit .input-container .selected-items-inline .selected-item-inline .remove-item-inline{background:none;border:none;font-size:1.2em;cursor:pointer;line-height:1;padding:0;margin-left:2px;color:#666;flex-shrink:0;width:16px;height:16px;display:flex;align-items:center;justify-content:center;pointer-events:auto}.lite-multi-select.in-edit .input-container .selected-items-inline .selected-item-inline .remove-item-inline:hover{color:#333}.lite-multi-select.in-edit .input-container .filter-input{border:none;outline:none;background:transparent;font-size:1em;width:100%;height:100%;min-height:40px;position:relative;z-index:2}.lite-multi-select.in-edit .input-container .filter-input::placeholder{color:#aaa}.lite-multi-select.in-edit .label.float{transform:translateY(-10px) translate(-10px) scale(.8);background:#fff;padding:0 5px;color:#2079e1;line-height:initial}.lite-multi-select.in-edit .options{position:absolute;top:100%;left:0;right:0;background:#fff;border:1px solid #ccc;border-radius:4px;max-height:250px;overflow-y:auto;z-index:1000;overflow:auto}.lite-multi-select.in-edit .options .multi-option{padding:6px 8px;cursor:pointer;display:flex;align-items:center;gap:8px}.lite-multi-select.in-edit .options .multi-option:hover{background-color:#f0f0f0}.lite-multi-select.in-edit .options .multi-option.selected{background-color:#e3f2fd}.lite-multi-select.in-edit .options .multi-option input[type=checkbox]{margin:0;cursor:pointer;accent-color:#2079e1;width:16px;height:16px;transform:scale(1.2)}.lite-multi-select.in-edit .options .multi-option .option-text{flex:1;-webkit-user-select:none;user-select:none;line-height:20px}.lite-multi-select.in-edit .options .no-options{padding:12px;text-align:center;color:#999;font-style:italic}.lite-multi-select.in-edit .arrow_box{position:absolute;right:4px;top:4px;cursor:pointer;height:calc(100% - 8px);width:2em;display:flex;align-items:center;justify-content:center}.lite-multi-select.in-edit .arrow_box .arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #333}.lite-multi-select.in-edit .arrow_box .arrow:hover{border-top-color:#2079e1}.lite-radio{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-radio .label{font-size:.8em;font-weight:500}.lite-radio .value{display:flex;gap:5px;flex-wrap:wrap}.lite-radio .value .no-value{color:#999;font-style:italic}.lite-radio.in-edit .radio-container{position:relative}.lite-radio.in-edit .radio-container .label{font-size:1.1em;font-weight:500;padding:5px 0}.lite-radio.in-edit .radio-container .radio-options{display:flex;flex-direction:column;gap:10px;padding:5px 0}.lite-radio.in-edit .radio-container .radio-options .radio-option{display:flex;align-items:flex-start;gap:5px;cursor:pointer;line-height:20px}.lite-radio.in-edit .radio-container .radio-options .radio-option .radio-input{margin:0;cursor:pointer;accent-color:#2079e1;width:20px;height:20px}.lite-radio.in-edit .radio-container .radio-options .radio-option .radio-label{flex:1;-webkit-user-select:none;user-select:none;font-size:1em;color:#333}.lite-radio.in-edit .radio-container .radio-options .radio-option:hover .radio-label{color:#2079e1}.lite-radio.in-edit .radio-container .radio-options.vertical{flex-direction:column}.lite-radio.in-edit .radio-container .radio-options.horizontal{flex-direction:row;flex-wrap:wrap}.in-edit .error-messages{color:#ff4500;font-size:.8em;letter-spacing:.6px;line-height:1.8em;padding-left:10px}.in-edit .error-messages .error-message{margin-bottom:2px}.lite-checkbox{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-checkbox .label{font-size:.8em;font-weight:500}.lite-checkbox .value{display:flex;gap:5px;flex-wrap:wrap}.lite-checkbox .value .checked{color:#28a745;font-weight:500}.lite-checkbox .value .unchecked{color:#6c757d}.lite-checkbox.in-edit .checkbox-container{position:relative}.lite-checkbox.in-edit .checkbox-container .checkbox-label{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:1em;line-height:1.4;width:fit-content}.lite-checkbox.in-edit .checkbox-container .checkbox-label .checkbox-input{margin:0;cursor:pointer;accent-color:#2079e1;width:16px;height:16px;transform:scale(1.2)}.lite-checkbox.in-edit .checkbox-container .checkbox-label .checkbox-text{flex:1;-webkit-user-select:none;user-select:none;color:#333;font-weight:500}.lite-checkbox.in-edit .checkbox-container .checkbox-label .required{margin-left:4px}.lite-checkbox.in-edit .checkbox-container .checkbox-label:hover .checkbox-text{color:#2079e1}.lite-checkbox.invalid .checkbox-container .checkbox-label .checkbox-text{color:#dc3545}.lite-date{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-date .label{font-size:.8em;font-weight:500}.lite-date .value{display:flex;gap:5px;flex-wrap:wrap;color:#333;font-size:1em}.lite-date.in-edit{position:relative}.lite-date.in-edit .label{position:absolute;left:8px;top:2px;color:#aaa;pointer-events:none;transition:.2s;font-size:1em;line-height:40px;font-weight:400}.lite-date.in-edit input{border:1px solid #ccc;border-radius:4px;padding:0 2em 0 8px;font-size:1em;outline:none;line-height:40px;height:40px;color-scheme:light}.lite-date.in-edit input:focus{border-color:#2079e1;box-shadow:0 0 5px #2079e180}.lite-date.in-edit input:focus+.label,.lite-date.in-edit input:not([value=\"\"])+.label,.lite-date.in-edit .label.float{transform:translateY(-10px) translate(-10px) scale(.8);background:#fff;padding:0 5px;color:#2079e1;line-height:initial}.lite-date.in-edit .date-input.invalid{border-color:#dc3545;background-color:#fff5f5;box-shadow:0 0 0 2px 1px #dc354540}.lite-date.in-edit .calendar_icon{position:absolute;right:0;top:0;cursor:pointer;height:100%;width:2.5em}.lite-date.in-edit .calendar_icon .calendar{width:16px;height:16px;color:#333;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.lite-date.in-edit .calendar_icon .calendar:hover{color:#2079e1}.lite-date.in-edit .calendar-overlay{position:absolute;right:0;z-index:1000}.lite-date.in-edit .calendar-overlay.position-bottom{top:100%;margin-top:4px}.lite-date.in-edit .calendar-overlay.position-top{bottom:100%;margin-bottom:4px}.calendar-panel{background:#fff;border:1px solid #ccc;border-radius:8px;box-shadow:0 4px 12px #00000026;padding:16px;width:280px;font-family:inherit}.calendar-panel.datetime{display:flex;width:100%;padding:0}.calendar-panel.datetime .control-header{width:100%;height:50px;display:flex;justify-content:flex-end}.calendar-panel.datetime .control-header .close-button{color:#999;cursor:pointer;border:none;background:none;width:30px;height:30px;padding:0}.calendar-panel.datetime .time-header{font-size:11px;font-weight:600;color:#333;border-bottom:1px solid #ccc;letter-spacing:.5px;line-height:20px}.calendar-panel.datetime .date-panel{width:280px;padding:20px 10px 20px 20px}.calendar-panel.datetime .time-panel{width:200px;padding:20px 20px 20px 10px}.calendar-panel.datetime .time-panel .hh-grid{display:flex;align-items:center;flex-wrap:wrap;margin:10px 0;gap:2px}.calendar-panel.datetime .time-panel .hh-slot{display:flex;width:30px;justify-content:center;line-height:24px;border-radius:4px;cursor:pointer;font-size:.8em;flex:0 0 calc(16.666% - 2px);border:1px solid #ddd;box-sizing:border-box}.calendar-panel.datetime .time-panel .hh-slot:hover{background-color:#f5f5f5}.calendar-panel.datetime .time-panel .hh-slot.selected{background-color:#2079e1;color:#fff}.calendar-panel.range-mode{width:580px}.calendar-panel .dual-calendar{display:flex;gap:20px}.calendar-panel .dual-calendar .calendar-month{flex:1}.calendar-panel .calendar-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.calendar-panel .calendar-header .month-year{font-weight:600;font-size:16px;color:#333}.calendar-panel .calendar-header .nav-button{background:none;border:none;font-size:20px;color:#666;cursor:pointer;padding:4px 8px;border-radius:4px;transition:background-color .2s,color .2s}.calendar-panel .calendar-header .nav-button:hover{background-color:#f5f5f5;color:#2079e1}.calendar-panel .calendar-header .nav-spacer{width:28px}.calendar-panel .calendar-grid .weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:8px}.calendar-panel .calendar-grid .weekdays .weekday{text-align:center;font-size:12px;font-weight:600;color:#666;padding:8px 4px}.calendar-panel .calendar-grid .calendar-days{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}.calendar-panel .calendar-grid .calendar-days .calendar-day{text-align:center;padding:8px 4px;cursor:pointer;border-radius:4px;font-size:14px;transition:background-color .2s,color .2s;position:relative}.calendar-panel .calendar-grid .calendar-days .calendar-day:hover{background-color:#f0f8ff}.calendar-panel .calendar-grid .calendar-days .calendar-day.today{background-color:#f8f8f8;font-weight:600;border:1px solid #ccc;border-radius:50%}.calendar-panel .calendar-grid .calendar-days .calendar-day.dim{opacity:.5;font-size:.9em}.calendar-panel .calendar-grid .calendar-days .calendar-day.selected{background-color:#2079e1;color:#fff;font-weight:600}.calendar-panel .calendar-grid .calendar-days .calendar-day.selected:hover{background-color:#1976d2}.calendar-panel .calendar-grid .calendar-days .calendar-day.range-start{background-color:#2079e1;color:#fff;font-weight:600;border-top-right-radius:0;border-bottom-right-radius:0}.calendar-panel .calendar-grid .calendar-days .calendar-day.range-start:hover{background-color:#1976d2}.calendar-panel .calendar-grid .calendar-days .calendar-day.range-end{background-color:#2079e1;color:#fff;font-weight:600;border-top-left-radius:0;border-bottom-left-radius:0}.calendar-panel .calendar-grid .calendar-days .calendar-day.range-end:hover{background-color:#1976d2}.calendar-panel .calendar-grid .calendar-days .calendar-day.in-range{background-color:#e3f2fd;color:#1976d2;border-radius:0}.calendar-panel .calendar-grid .calendar-days .calendar-day.in-range:hover{background-color:#bbdefb}.calendar-panel .calendar-grid .calendar-days .calendar-day.range-start.range-end{border-radius:4px}.calendar-panel .calendar-grid .calendar-days .calendar-day.today.range-start,.calendar-panel .calendar-grid .calendar-days .calendar-day.today.range-end{background-color:#ff9800;border-color:#e65100}.calendar-panel .calendar-grid .calendar-days .calendar-day.today.in-range{background-color:#ffcc80;color:#e65100;font-weight:700}.lite-file{display:flex;flex-direction:column;margin-bottom:10px;position:relative;gap:5px}.lite-file .label{font-size:.8em;font-weight:500}.lite-file button{position:relative;background:none;border:none;width:30px;display:flex;justify-content:center;cursor:pointer;margin-top:10px}.lite-file button:hover{background:#e9ecef;border-color:#6c757d}.lite-file button.has-files{border-color:#28a745;background:#d4edda}.lite-file button img{width:24px;height:24px;stroke:currentColor}.lite-file button .file-badge{position:absolute;top:-8px;right:-8px;background:#2079e1;color:#fff;border-radius:50%;min-width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:.75em;font-weight:600}.lite-file.in-edit{position:relative;display:inline-block}.lite-file.in-edit .file-button{position:relative;background:none;border:none;padding:4px;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.lite-file.in-edit .file-button:hover{background:#e9ecef;border-color:#6c757d}.lite-file.in-edit .file-button:focus{outline:2px solid #2079e1;outline-offset:2px}.lite-file.in-edit .file-button.has-files{border-color:#28a745;background:#d4edda}.lite-file.in-edit .file-button.has-errors{border-color:#dc3545;background:#f8d7da}.lite-file.in-edit .file-button:disabled{opacity:.6;cursor:not-allowed}.lite-file.in-edit .file-button .file-icon{width:24px;height:24px;stroke:currentColor}.lite-file.in-edit .file-button .file-badge{position:absolute;top:-8px;right:-8px;background:#2079e1;color:#fff;border-radius:50%;min-width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:.75em;font-weight:600}.panel-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#00000080;z-index:999;opacity:0;visibility:hidden;transition:all .2s ease;pointer-events:none}.panel-overlay.visible{opacity:1;visibility:visible;pointer-events:auto}.file-panel{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(.95);min-width:400px;max-width:90vw;max-height:90vh;background:#fff;border:1px solid #dee2e6;border-radius:8px;box-shadow:0 4px 20px #00000026;z-index:1000;opacity:0;visibility:hidden;transition:all .2s;display:none;flex-direction:column;pointer-events:none;overflow:hidden}.file-panel.visible{opacity:1;visibility:visible;transform:translate(-50%,-50%) scale(1);display:flex;pointer-events:auto}.file-panel .panel-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #dee2e6;background:#f8f9fa}.file-panel .panel-header h3{margin:0;font-size:1.1em;font-weight:600;color:#333}.file-panel .panel-header .close-button{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#6c757d;transition:all .2s}.file-panel .panel-header .close-button:hover{color:#dc3545;background:#f8d7da}.file-panel .panel-header .close-button svg{width:16px;height:16px}.file-panel .panel-content{padding:20px;overflow-y:auto;flex:1}.file-panel .panel-content .upload-area{border:2px dashed #dee2e6;border-radius:8px;padding:40px 20px;text-align:center;margin-bottom:20px;transition:all .2s;cursor:pointer;position:relative}.file-panel .panel-content .upload-area:hover,.file-panel .panel-content .upload-area.drag-over{border-color:#2079e1;background:#f0f8ff}.file-panel .panel-content .upload-area.uploading{border-color:#ffc107;background:#fff8e1}.file-panel .panel-content .upload-area .upload-content{pointer-events:none}.file-panel .panel-content .upload-area .upload-content .upload-icon{width:48px;height:48px;margin:0 auto 16px;stroke:#6c757d}.file-panel .panel-content .upload-area .upload-content p{margin:0 0 8px;font-size:1.1em;color:#333;font-weight:500}.file-panel .panel-content .upload-area .upload-content small{color:#6c757d;font-size:.9em}.file-panel .panel-content .action-buttons{display:flex;gap:12px;margin-bottom:20px;flex-wrap:wrap}.file-panel .panel-content .action-buttons .action-btn{display:flex;align-items:center;gap:8px;padding:10px 16px;border:1px solid #dee2e6;border-radius:6px;background:#fff;cursor:pointer;transition:all .2s ease;font-size:.9em;flex:1;min-width:120px;justify-content:center}.file-panel .panel-content .action-buttons .action-btn:hover{background:#f8f9fa;border-color:#6c757d}.file-panel .panel-content .action-buttons .action-btn.upload-btn:hover{background:#e7f3ff;border-color:#2079e1;color:#2079e1}.file-panel .panel-content .action-buttons .action-btn.camera-btn:hover{background:#e8f5e8;border-color:#28a745;color:#28a745}.file-panel .panel-content .action-buttons .action-btn.close-btn:hover{background:#f8d7da;border-color:#dc3545;color:#dc3545}.file-panel .panel-content .action-buttons .action-btn svg{width:16px;height:16px}.file-panel .panel-content .file-list .file-list-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;padding-bottom:8px;border-bottom:1px solid #dee2e6}.file-panel .panel-content .file-list .file-list-header span{font-weight:600;color:#333}.file-panel .panel-content .file-list .file-list-header .total-size{font-size:.9em;color:#6c757d;font-weight:400}.file-panel .panel-content .file-list .file-list-header .clear-all-btn{background:none;border:1px solid #dc3545;color:#dc3545;padding:4px 12px;border-radius:4px;cursor:pointer;font-size:.8em;transition:all .2s ease}.file-panel .panel-content .file-list .file-list-header .clear-all-btn:hover{background:#dc3545;color:#fff}.file-panel .panel-content .file-list .file-items{max-height:300px;overflow-y:auto}.file-panel .panel-content .file-list .file-items .file-item{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid #dee2e6;border-radius:6px;margin-bottom:8px;transition:all .2s ease;background:#fff}.file-panel .panel-content .file-list .file-items .file-item:hover{background:#f8f9fa}.file-panel .panel-content .file-list .file-items .file-item.has-error{border-color:#dc3545;background:#fff5f5}.file-panel .panel-content .file-list .file-items .file-item.uploading{background:#fff8e1;border-color:#ffc107}.file-panel .panel-content .file-list .file-items .file-item .file-preview{width:48px;height:48px;border-radius:4px;overflow:hidden;background:#f8f9fa;display:flex;align-items:center;justify-content:center;flex-shrink:0}.file-panel .panel-content .file-list .file-items .file-item .file-preview .preview-image{width:100%;height:100%;object-fit:cover}.file-panel .panel-content .file-list .file-items .file-item .file-preview .file-type-icon{font-size:24px}.file-panel .panel-content .file-list .file-items .file-item .file-info{flex:1;min-width:0}.file-panel .panel-content .file-list .file-items .file-item .file-info .file-name{font-weight:500;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-panel .panel-content .file-list .file-items .file-item .file-info .file-details{display:flex;gap:12px;margin-top:4px;font-size:.8em;color:#6c757d}.file-panel .panel-content .file-list .file-items .file-item .file-info .file-details .file-size,.file-panel .panel-content .file-list .file-items .file-item .file-info .file-details .file-type{white-space:nowrap}.file-panel .panel-content .file-list .file-items .file-item .file-info .file-error{color:#dc3545;font-size:.8em;margin-top:4px;font-weight:500}.file-panel .panel-content .file-list .file-items .file-item .file-info .upload-progress{display:flex;align-items:center;gap:8px;margin-top:8px}.file-panel .panel-content .file-list .file-items .file-item .file-info .upload-progress .progress-bar{flex:1;height:6px;background:#e9ecef;border-radius:3px;overflow:hidden}.file-panel .panel-content .file-list .file-items .file-item .file-info .upload-progress .progress-bar .progress-fill{height:100%;background:#2079e1;transition:width .3s ease}.file-panel .panel-content .file-list .file-items .file-item .file-info .upload-progress .progress-text{font-size:.8em;color:#6c757d;font-weight:500;min-width:32px}.file-panel .panel-content .file-list .file-items .file-item .remove-file-btn{background:none;border:1px solid #dc3545;color:#dc3545;padding:6px;border-radius:4px;cursor:pointer;transition:all .2s ease;flex-shrink:0}.file-panel .panel-content .file-list .file-items .file-item .remove-file-btn:hover:not(:disabled){background:#dc3545;color:#fff}.file-panel .panel-content .file-list .file-items .file-item .remove-file-btn:disabled{opacity:.5;cursor:not-allowed}.file-panel .panel-content .file-list .file-items .file-item .remove-file-btn svg{width:16px;height:16px}.file-panel .panel-content .empty-state{text-align:center;padding:40px 20px;color:#6c757d}.file-panel .panel-content .empty-state .empty-icon{width:64px;height:64px;margin:0 auto 16px;stroke:#dee2e6}.file-panel .panel-content .empty-state p{margin:0 0 8px;font-size:1.1em}.file-panel .panel-content .empty-state small{font-size:.9em}.lite-paginator{display:flex;align-items:center;gap:12px;padding:8px 0;flex-wrap:wrap;justify-content:center}.lite-paginator .paginator-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:1px solid #ccc;background:#fff;border-radius:4px;cursor:pointer;transition:all .2s ease;color:#666}.lite-paginator .paginator-btn:hover:not(:disabled){background:#f8f9fa;border-color:#2079e1;color:#2079e1}.lite-paginator .paginator-btn:disabled{opacity:.5;cursor:not-allowed}.lite-paginator .paginator-btn svg{width:16px;height:16px}.lite-paginator .page-numbers{display:flex;gap:4px;align-items:center}.lite-paginator .page-number{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:1px solid #ccc;background:#fff;border-radius:4px;cursor:pointer;transition:all .2s ease;font-size:.85em;color:#666}.lite-paginator .page-number:hover{background:#f8f9fa;border-color:#2079e1;color:#2079e1}.lite-paginator .page-number.active{background:#2079e1;border-color:#2079e1;color:#fff;font-weight:600}.lite-paginator .items-per-page{display:flex;align-items:center;gap:6px;font-size:.85em;color:#666}.lite-paginator .items-per-page .items-select{padding:4px 8px;border:1px solid #ccc;border-radius:4px;background:#fff;font-size:.85em;cursor:pointer;min-width:60px;color:#666}.lite-paginator .items-per-page .items-select:focus{outline:none;border-color:#2079e1;box-shadow:0 0 0 2px #2079e133}.lite-paginator .items-per-page .items-label{white-space:nowrap}.lite-paginator .total-info{font-size:.85em;color:#666}.lite-paginator .total-info .total-text{white-space:nowrap}.lite-table{width:100%;background:#fff}.lite-table .table-header{background:#f8f8f8;border-bottom:1px solid #dee2e6}.lite-table .table-header .header-row{display:flex}.lite-table .table-header .header-row .header-cell{padding:5px 10px;text-align:left;font-weight:600;color:#333;font-size:.9em;border-right:1px solid #dee2e6;min-height:36px;display:flex;align-items:center}.lite-table .table-header .header-row .header-cell:last-child{border-right:none}.lite-table .table-header .header-row .header-cell.sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.lite-table .table-header .header-row .header-cell.sortable:hover{background:#e9ecef}.lite-table .table-body .data-row{display:flex;border-bottom:1px solid #dee2e6;transition:background-color .2s ease}.lite-table .table-body .data-row:hover{background:#f8f9fa}.lite-table .table-body .data-row:last-child{border-bottom:none}.lite-table .table-body .data-row .data-cell{padding:5px 10px;border-right:1px solid #dee2e6;font-size:.9em;color:#333;min-height:36px;display:flex;align-items:center}.lite-table .table-body .data-row .data-cell:last-child{border-right:none}.lite-table .table-body .empty-row{display:flex;border-bottom:1px solid #dee2e6}.lite-table .table-body .empty-row .empty-cell{padding:40px 16px;text-align:center;color:#6c757d;font-style:italic;font-size:.9em}.lite-table .table-paginator{margin-top:16px;display:flex;justify-content:center}\n"] }]
1971
2137
  }] });
1972
2138
 
1973
- class LiteFormModule {
1974
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1975
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: LiteFormModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
1976
- LiteInput, LiteTextarea, LiteSelect, LiteMultiSelect, LiteRadio, LiteCheckbox, LiteDate, LiteDateTime, LitePassword, LiteFile, LitePaginator, LiteTable], exports: [LiteInput, LiteTextarea, LiteSelect, LiteMultiSelect, LiteRadio, LiteCheckbox, LiteDate, LiteDateTime, LitePassword, LiteFile, LitePaginator, LiteTable] });
1977
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteFormModule, imports: [CommonModule, FormsModule, ReactiveFormsModule,
1978
- LiteInput, LiteTextarea, LiteSelect, LiteMultiSelect, LiteRadio, LiteCheckbox, LiteDate, LiteDateTime, LitePassword, LiteFile, LitePaginator, LiteTable] });
1979
- }
1980
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteFormModule, decorators: [{
1981
- type: NgModule,
1982
- args: [{
1983
- imports: [
1984
- CommonModule, FormsModule, ReactiveFormsModule,
1985
- LiteInput, LiteTextarea, LiteSelect, LiteMultiSelect, LiteRadio, LiteCheckbox, LiteDate, LiteDateTime, LitePassword, LiteFile, LitePaginator, LiteTable
1986
- ],
1987
- exports: [
1988
- LiteInput, LiteTextarea, LiteSelect, LiteMultiSelect, LiteRadio, LiteCheckbox, LiteDate, LiteDateTime, LitePassword, LiteFile, LitePaginator, LiteTable
1989
- ]
1990
- }]
1991
- }] });
1992
-
1993
- class FieldDto {
1994
- label;
1995
- formControl;
1996
- rows;
1997
- type;
1998
- constructor(label, formControl, rows = 2, type = 'text') {
1999
- this.label = label;
2000
- this.formControl = formControl;
2001
- this.rows = rows;
2002
- this.type = type;
2003
- }
2004
- }
2005
- class BaseSelectFieldDto {
2006
- label;
2007
- options;
2008
- displayWith;
2009
- constructor(label, options, displayWith) {
2010
- this.label = label;
2011
- this.options = options;
2012
- this.displayWith = displayWith;
2013
- }
2014
- }
2015
- class SelectFieldDto extends BaseSelectFieldDto {
2016
- formControl;
2017
- constructor(label, formControl, options, displayWith) {
2018
- super(label, options, displayWith);
2019
- this.formControl = formControl;
2020
- }
2021
- }
2022
- class MultiSelectFieldDto extends BaseSelectFieldDto {
2023
- formControl;
2024
- constructor(label, formControl, options, displayWith) {
2025
- super(label, options, displayWith);
2026
- this.formControl = formControl;
2027
- }
2028
- }
2029
- class RadioFieldDto extends BaseSelectFieldDto {
2030
- formControl;
2031
- constructor(label, formControl, options, displayWith) {
2032
- super(label, options, displayWith);
2033
- this.formControl = formControl;
2034
- }
2035
- }
2036
- class FileFieldDto {
2037
- label;
2038
- formControl;
2039
- multiple;
2040
- accept;
2041
- maxFileSize;
2042
- maxFiles;
2043
- showPreview;
2044
- constructor(label, formControl, multiple = true, accept = '*/*', maxFileSize = 10 * 1024 * 1024, // 10MB
2045
- maxFiles = 10, showPreview = true) {
2046
- this.label = label;
2047
- this.formControl = formControl;
2048
- this.multiple = multiple;
2049
- this.accept = accept;
2050
- this.maxFileSize = maxFileSize;
2051
- this.maxFiles = maxFiles;
2052
- this.showPreview = showPreview;
2053
- }
2054
- }
2055
- class PaginatorFieldDto {
2056
- currentPage;
2057
- totalItems;
2058
- itemsPerPage;
2059
- constructor(currentPage = 1, totalItems = 0, itemsPerPage = 10) {
2060
- this.currentPage = currentPage;
2061
- this.totalItems = totalItems;
2062
- this.itemsPerPage = itemsPerPage;
2063
- }
2064
- }
2065
- class TableFieldDto {
2066
- columns;
2067
- data;
2068
- showPaginator;
2069
- paginatorConfig;
2070
- constructor(columns, data, showPaginator = false, paginatorConfig = new PaginatorFieldDto()) {
2071
- this.columns = columns;
2072
- this.data = data;
2073
- this.showPaginator = showPaginator;
2074
- this.paginatorConfig = paginatorConfig;
2075
- }
2076
- }
2077
-
2078
- class LiteSnackbarService {
2079
- timeoutId;
2080
- snackbarElem = null;
2081
- show(text, type = 'done', duration = 3000) {
2082
- this.clear();
2083
- this.snackbarElem = document.createElement('div');
2084
- this.snackbarElem.className = `lite-snackbar ${type}`;
2085
- this.snackbarElem.innerHTML = `
2086
- <div class="icon">${this.getIcon(type)}</div>
2087
- <div class="text">${this.escapeHtml(text)}</div>
2088
- `;
2089
- this.injectStyles();
2090
- document.body.appendChild(this.snackbarElem);
2091
- this.timeoutId = setTimeout(() => this.clear(), duration);
2092
- }
2093
- clear() {
2094
- if (this.timeoutId)
2095
- clearTimeout(this.timeoutId);
2096
- if (this.snackbarElem && this.snackbarElem.parentNode) {
2097
- this.snackbarElem.parentNode.removeChild(this.snackbarElem);
2098
- }
2099
- this.snackbarElem = null;
2100
- }
2101
- getIcon(type) {
2102
- if (type === 'done') {
2103
- return `<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10"/><path d="M6 10.5L9 13.5L14 8.5" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
2104
- }
2105
- if (type === 'warn') {
2106
- return `<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10"/><path d="M10 6V11" stroke="#fff" stroke-width="2" stroke-linecap="round"/><circle cx="10" cy="14" r="1" fill="#fff"/></svg>`;
2107
- }
2108
- if (type === 'error') {
2109
- return `<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10"/><path d="M7 7L13 13M13 7L7 13" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>`;
2110
- }
2111
- return '';
2112
- }
2113
- injectStyles() {
2114
- if (document.getElementById('lite-snackbar-style'))
2115
- return;
2116
- const style = document.createElement('style');
2117
- style.id = 'lite-snackbar-style';
2118
- style.innerHTML = `
2119
- .lite-snackbar {
2120
- position: fixed;
2121
- left: 50%;
2122
- top: 20px;
2123
- transform: translateX(-50%);
2124
- min-width: 200px;
2125
- max-width: 90vw;
2126
- padding: 8px 15px 8px 5px;
2127
- border-radius: 6px;
2128
- color: #fff;
2129
- font-size: 1rem;
2130
- display: flex;
2131
- align-items: center;
2132
- box-shadow: 0 2px 12px rgba(0,0,0,0.18);
2133
- z-index: 9999;
2134
- opacity: 0.9;
2135
- animation: snackbar-in 0.2s;
2136
- }
2137
- .lite-snackbar.done { background: #3a82eeff; }
2138
- .lite-snackbar.warn { background: #f7b731; }
2139
- .lite-snackbar.error { background: #e74c3c; }
2140
- .lite-snackbar .icon { margin-right: 5px; height: 30px; }
2141
- @keyframes snackbar-in {
2142
- from { opacity: 0; transform: translateX(-50%) translateY(-30px); }
2143
- to { opacity: 0.9; transform: translateX(-50%) translateY(0); }
2144
- }
2145
- `;
2146
- document.head.appendChild(style);
2147
- }
2148
- escapeHtml(text) {
2149
- return text.replace(/[&<>'"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '\'': '&#39;', '"': '&quot;' }[c] || c));
2150
- }
2151
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteSnackbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2152
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteSnackbarService, providedIn: 'root' });
2153
- }
2154
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LiteSnackbarService, decorators: [{
2155
- type: Injectable,
2156
- args: [{ providedIn: 'root' }]
2157
- }] });
2158
-
2159
2139
  /*
2160
2140
  * Public API Surface of lite-form
2161
2141
  */
@@ -2164,5 +2144,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
2164
2144
  * Generated bundle index. Do not edit.
2165
2145
  */
2166
2146
 
2167
- export { BaseSelectFieldDto, FieldDto, FileFieldDto, FormUtils, LiteCheckbox, LiteDate, LiteDateTime, LiteFile, LiteFormModule, LiteInput, LiteMultiSelect, LitePaginator, LitePassword, LiteRadio, LiteSelect, LiteSnackbarService, LiteTable, LiteTextarea, MultiSelectFieldDto, PaginatorFieldDto, RadioFieldDto, SelectFieldDto, TableFieldDto };
2147
+ export { BaseSelectFieldDto, FieldDto, FileFieldDto, FormUtils, LiteCheckbox, LiteDate, LiteDateTime, LiteFile, LiteInput, LiteMultiSelect, LitePaginator, LitePassword, LiteRadio, LiteSelect, LiteSnackbarService, LiteTable, LiteTextarea, MultiSelectFieldDto, PaginatorFieldDto, RadioFieldDto, SelectFieldDto, TableFieldDto };
2168
2148
  //# sourceMappingURL=ngx-lite-form.mjs.map