@seniorsistemas/data-seniorx-core 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/types/select-button.type.d.ts +5 -0
- package/esm2022/core/types/select-button.type.mjs +2 -0
- package/esm2022/features/button/button.component.mjs +3 -3
- package/esm2022/features/card-list/card/card.component.mjs +3 -3
- package/esm2022/features/code-editor/code-editor.component.mjs +216 -0
- package/esm2022/features/paginator/paginator.component.mjs +2 -2
- package/esm2022/features/select-button/select-button.component.mjs +118 -0
- package/esm2022/features/tab/tab-item.component.mjs +1 -1
- package/esm2022/features/tab/tab.component.mjs +28 -11
- package/esm2022/providers/services.provider.mjs +3 -3
- package/esm2022/providers/translate.provider.mjs +48 -26
- package/esm2022/public-api.mjs +4 -2
- package/features/code-editor/code-editor.component.d.ts +57 -0
- package/features/paginator/paginator.component.d.ts +1 -1
- package/features/select-button/select-button.component.d.ts +30 -0
- package/features/tab/tab.component.d.ts +3 -0
- package/fesm2022/seniorsistemas-data-seniorx-core.mjs +424 -183
- package/fesm2022/seniorsistemas-data-seniorx-core.mjs.map +1 -1
- package/package.json +3 -3
- package/providers/services.provider.d.ts +2 -2
- package/providers/translate.provider.d.ts +2 -7
- package/public-api.d.ts +3 -1
- package/styles.css +0 -4
- package/styles.scss +0 -1
- package/esm2022/features/sql-editor/sql-editor.component.mjs +0 -125
- package/features/sql-editor/sql-editor.component.d.ts +0 -27
- package/styles/sql-editor.scss +0 -3
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as i2 from 'primeng/api';
|
|
2
2
|
import { MessageService } from 'primeng/api';
|
|
3
3
|
export { MessageService } from 'primeng/api';
|
|
4
|
+
import * as i1$5 from '@ngx-translate/core';
|
|
5
|
+
import { TranslateModule, TranslateStore, TranslateLoader, TranslateService } from '@ngx-translate/core';
|
|
6
|
+
export { TranslateDirective, TranslateModule, TranslatePipe } from '@ngx-translate/core';
|
|
4
7
|
import { definePreset } from '@primeng/themes';
|
|
5
8
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { makeEnvironmentProviders, APP_INITIALIZER, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, TemplateRef, ContentChild, Directive, forwardRef, ViewChild, input, signal, effect, computed,
|
|
9
|
+
import { makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, inject, APP_INITIALIZER, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, TemplateRef, ContentChild, Directive, forwardRef, ViewChild, input, signal, effect, computed, ElementRef, NgZone, ChangeDetectorRef, numberAttribute, booleanAttribute, Injectable, HostBinding, HostListener } from '@angular/core';
|
|
7
10
|
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
|
8
11
|
import { providePrimeNG } from 'primeng/config';
|
|
9
12
|
import Aura from '@primeng/themes/aura';
|
|
10
|
-
import
|
|
11
|
-
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
12
|
-
import { Subject, BehaviorSubject } from 'rxjs';
|
|
13
|
+
import { of, Subject, BehaviorSubject } from 'rxjs';
|
|
13
14
|
import * as i1$2 from '@angular/common';
|
|
14
15
|
import { CommonModule, NgClass, NgIf, NgTemplateOutlet } from '@angular/common';
|
|
15
16
|
import { takeUntil, filter, first } from 'rxjs/operators';
|
|
@@ -52,10 +53,13 @@ import { PanelModule } from '@seniorsistemas/angular-components/panel';
|
|
|
52
53
|
import { EnumSeverity } from '@seniorsistemas/angular-components/shared';
|
|
53
54
|
import { BlockUIModule } from 'primeng/blockui';
|
|
54
55
|
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
|
56
|
+
import { basicSetup } from 'codemirror';
|
|
55
57
|
import { autocompletion } from '@codemirror/autocomplete';
|
|
56
58
|
import { ayuLight } from 'thememirror';
|
|
57
|
-
import { basicSetup } from 'codemirror';
|
|
58
59
|
import { sql, PostgreSQL } from '@codemirror/lang-sql';
|
|
60
|
+
import { javascript } from '@codemirror/lang-javascript';
|
|
61
|
+
import { json } from '@codemirror/lang-json';
|
|
62
|
+
import { html } from '@codemirror/lang-html';
|
|
59
63
|
import * as i3$3 from 'primeng/keyfilter';
|
|
60
64
|
import { KeyFilterModule } from 'primeng/keyfilter';
|
|
61
65
|
import * as i4$2 from 'primeng/tooltip';
|
|
@@ -362,7 +366,7 @@ function provideDataCoreLib() {
|
|
|
362
366
|
}
|
|
363
367
|
|
|
364
368
|
function serviceProviders() {
|
|
365
|
-
return [MessageService, SpinnerService, ToastService,
|
|
369
|
+
return [MessageService, SpinnerService, ToastService, TranslateModule];
|
|
366
370
|
}
|
|
367
371
|
|
|
368
372
|
var en = {
|
|
@@ -413,32 +417,53 @@ var pt = {
|
|
|
413
417
|
"platform.datacore.empty_message": "Tente ajustar os filtros ou refine sua busca para encontrar os dados desejados."
|
|
414
418
|
};
|
|
415
419
|
|
|
416
|
-
const
|
|
420
|
+
const DEFAULT_LOCALE = 'pt';
|
|
421
|
+
class InlineTranslateLoader {
|
|
422
|
+
getTranslation(lang) {
|
|
423
|
+
switch (lang) {
|
|
424
|
+
case 'en':
|
|
425
|
+
case 'en-US':
|
|
426
|
+
return of(en);
|
|
427
|
+
case 'es':
|
|
428
|
+
case 'es-CO':
|
|
429
|
+
return of(es);
|
|
430
|
+
default:
|
|
431
|
+
return of(pt);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
417
435
|
function provideTranslations() {
|
|
418
|
-
return
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
436
|
+
return makeEnvironmentProviders([
|
|
437
|
+
TranslateStore,
|
|
438
|
+
{ provide: TranslateLoader, useClass: InlineTranslateLoader },
|
|
439
|
+
TranslateService,
|
|
440
|
+
{
|
|
441
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
442
|
+
multi: true,
|
|
443
|
+
useValue: () => {
|
|
444
|
+
const translate = inject(TranslateService);
|
|
424
445
|
translate.addLangs(['en', 'es', 'pt']);
|
|
425
|
-
translate.
|
|
426
|
-
|
|
427
|
-
translate.
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
translate.setDefaultLang(defaultLocale);
|
|
432
|
-
translate.use(getSeniorLocale('com.senior.token'));
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
};
|
|
446
|
+
translate.setDefaultLang(DEFAULT_LOCALE);
|
|
447
|
+
const seniorLocale = safeGetSeniorLocale('com.senior.token') ?? DEFAULT_LOCALE;
|
|
448
|
+
translate.use(seniorLocale);
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
]);
|
|
436
452
|
}
|
|
437
|
-
function
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
453
|
+
function safeGetSeniorLocale(name) {
|
|
454
|
+
try {
|
|
455
|
+
if (typeof document === 'undefined')
|
|
456
|
+
return null;
|
|
457
|
+
const cookies = document.cookie?.split('; ') ?? [];
|
|
458
|
+
const raw = cookies.find(c => c.startsWith(name + '='))?.split('=')[1];
|
|
459
|
+
if (!raw)
|
|
460
|
+
return null;
|
|
461
|
+
const json = JSON.parse(decodeURIComponent(raw));
|
|
462
|
+
return json?.locale ?? null;
|
|
463
|
+
}
|
|
464
|
+
catch {
|
|
465
|
+
return null;
|
|
466
|
+
}
|
|
442
467
|
}
|
|
443
468
|
|
|
444
469
|
function resolveStylesHref() {
|
|
@@ -868,11 +893,11 @@ class ButtonComponent {
|
|
|
868
893
|
type = 'button';
|
|
869
894
|
onClick = new EventEmitter();
|
|
870
895
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
871
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ButtonComponent, isStandalone: true, selector: "sdc-button", inputs: { disabled: "disabled", width: "width", icon: "icon", id: "id", label: "label", priority: "priority", size: "size", type: "type" }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<div [style.width]=\"width\">\n <s-button\n class=\"sdc-button-el\"\n (clicked)=\"onClick.emit($event)\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n [size]=\"size\"\n [type]=\"type\"\n [priority]=\"priority\"\n [iconClass]=\"icon\"\n [label]=\"label\">\n </s-button>\n</div>\n", styles: ["::ng-deep .s-button-priority-primary .s-button-icon{color:#fff!important}::ng-deep s-button button:disabled{pointer-events:none;cursor:not-allowed}
|
|
896
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ButtonComponent, isStandalone: true, selector: "sdc-button", inputs: { disabled: "disabled", width: "width", icon: "icon", id: "id", label: "label", priority: "priority", size: "size", type: "type" }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<div [style.width]=\"width\">\n <s-button\n class=\"sdc-button-el\"\n (clicked)=\"onClick.emit($event)\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n [size]=\"size\"\n [type]=\"type\"\n [priority]=\"priority\"\n [iconClass]=\"icon\"\n [label]=\"label\">\n </s-button>\n</div>\n", styles: ["::ng-deep .s-button-priority-primary .s-button-icon{color:#fff!important}::ng-deep s-button button:disabled{pointer-events:none;cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
872
897
|
}
|
|
873
898
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
874
899
|
type: Component,
|
|
875
|
-
args: [{ imports: [CommonModule, ButtonModule], standalone: true, selector: 'sdc-button', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div [style.width]=\"width\">\n <s-button\n class=\"sdc-button-el\"\n (clicked)=\"onClick.emit($event)\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n [size]=\"size\"\n [type]=\"type\"\n [priority]=\"priority\"\n [iconClass]=\"icon\"\n [label]=\"label\">\n </s-button>\n</div>\n", styles: ["::ng-deep .s-button-priority-primary .s-button-icon{color:#fff!important}::ng-deep s-button button:disabled{pointer-events:none;cursor:not-allowed}
|
|
900
|
+
args: [{ imports: [CommonModule, ButtonModule], standalone: true, selector: 'sdc-button', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div [style.width]=\"width\">\n <s-button\n class=\"sdc-button-el\"\n (clicked)=\"onClick.emit($event)\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n [size]=\"size\"\n [type]=\"type\"\n [priority]=\"priority\"\n [iconClass]=\"icon\"\n [label]=\"label\">\n </s-button>\n</div>\n", styles: ["::ng-deep .s-button-priority-primary .s-button-icon{color:#fff!important}::ng-deep s-button button:disabled{pointer-events:none;cursor:not-allowed}\n"] }]
|
|
876
901
|
}], propDecorators: { disabled: [{
|
|
877
902
|
type: Input
|
|
878
903
|
}], width: [{
|
|
@@ -1751,11 +1776,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1751
1776
|
type: Output
|
|
1752
1777
|
}] } });
|
|
1753
1778
|
|
|
1779
|
+
let __tabUid = 0;
|
|
1754
1780
|
class TabComponent {
|
|
1755
1781
|
host = inject(ElementRef);
|
|
1756
1782
|
zone = inject(NgZone);
|
|
1757
1783
|
cdr = inject(ChangeDetectorRef);
|
|
1758
1784
|
headersRef;
|
|
1785
|
+
panelsRef;
|
|
1786
|
+
uid = `sdc-tab-${++__tabUid}`;
|
|
1759
1787
|
_activeIndex = signal(0);
|
|
1760
1788
|
set activeIndex(v) {
|
|
1761
1789
|
this.zone.run(() => {
|
|
@@ -1774,11 +1802,15 @@ class TabComponent {
|
|
|
1774
1802
|
activeIndexChange = new EventEmitter();
|
|
1775
1803
|
isMobile = isMobile();
|
|
1776
1804
|
wcEls = signal([]);
|
|
1777
|
-
headers = computed(() => this.wcEls().map((el, i) =>
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1805
|
+
headers = computed(() => this.wcEls().map((el, i) => {
|
|
1806
|
+
const attrLabel = el.getAttribute('label') || '';
|
|
1807
|
+
const propLabel = el.label;
|
|
1808
|
+
return {
|
|
1809
|
+
label: (attrLabel.trim() || (propLabel?.trim() ?? `Tab ${i}`)),
|
|
1810
|
+
disabled: this.parseBool(el.getAttribute('disabled')),
|
|
1811
|
+
id: el.getAttribute('id') ?? `${this.uid}-tab-${i}`,
|
|
1812
|
+
};
|
|
1813
|
+
}));
|
|
1782
1814
|
mo;
|
|
1783
1815
|
_headersEffect = effect(() => {
|
|
1784
1816
|
this.headers();
|
|
@@ -1789,7 +1821,7 @@ class TabComponent {
|
|
|
1789
1821
|
this.refreshChildren();
|
|
1790
1822
|
this.zone.runOutsideAngular(() => {
|
|
1791
1823
|
this.mo = new MutationObserver(() => this.refreshChildren());
|
|
1792
|
-
this.mo.observe(this.
|
|
1824
|
+
this.mo.observe(this.panelsRef.nativeElement, { childList: true });
|
|
1793
1825
|
});
|
|
1794
1826
|
}
|
|
1795
1827
|
ngOnDestroy() {
|
|
@@ -1854,8 +1886,15 @@ class TabComponent {
|
|
|
1854
1886
|
const list = this.headersRef?.nativeElement.querySelectorAll('[role="tab"]');
|
|
1855
1887
|
list?.[i]?.focus();
|
|
1856
1888
|
}
|
|
1889
|
+
getDirectItems() {
|
|
1890
|
+
const parent = this.panelsRef?.nativeElement;
|
|
1891
|
+
if (!parent)
|
|
1892
|
+
return [];
|
|
1893
|
+
const children = Array.from(parent.children);
|
|
1894
|
+
return children.filter((n) => n.tagName?.toLowerCase() === 'sdc-tab-item');
|
|
1895
|
+
}
|
|
1857
1896
|
refreshChildren() {
|
|
1858
|
-
const els =
|
|
1897
|
+
const els = this.getDirectItems();
|
|
1859
1898
|
this.wcEls.set(els);
|
|
1860
1899
|
this._activeIndex.set(this.normalizeIndex(this._activeIndex()));
|
|
1861
1900
|
this.syncHiddenAndAria();
|
|
@@ -1867,7 +1906,7 @@ class TabComponent {
|
|
|
1867
1906
|
const hs = this.headers();
|
|
1868
1907
|
els.forEach((el, i) => {
|
|
1869
1908
|
const hdr = hs[i];
|
|
1870
|
-
const panelId = ((hdr?.id ??
|
|
1909
|
+
const panelId = ((hdr?.id ?? `${this.uid}-tab-${i}`) + '-panel');
|
|
1871
1910
|
el.setAttribute('role', 'tabpanel');
|
|
1872
1911
|
el.setAttribute('id', panelId);
|
|
1873
1912
|
if (hdr)
|
|
@@ -1892,14 +1931,17 @@ class TabComponent {
|
|
|
1892
1931
|
return s === '' || s === 'true' || s === '1';
|
|
1893
1932
|
}
|
|
1894
1933
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1895
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TabComponent, isStandalone: true, selector: "sdc-tab", inputs: { activeIndex: ["activeIndex", "activeIndex", numberAttribute] }, outputs: { activeIndexChange: "activeIndexChange" }, viewQueries: [{ propertyName: "headersRef", first: true, predicate: ["headersRef"], descendants: true }], ngImport: i0, template: "<div class=\"sdc-tab\" [class.sdc-tab-stack]=\"isMobile\">\n <div #headersRef class=\"sdc-tab-headers\" role=\"tablist\" aria-label=\"Tabs\">\n @for (h of headers(); let i = $index; track i) {\n
|
|
1934
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TabComponent, isStandalone: true, selector: "sdc-tab", inputs: { activeIndex: ["activeIndex", "activeIndex", numberAttribute] }, outputs: { activeIndexChange: "activeIndexChange" }, viewQueries: [{ propertyName: "headersRef", first: true, predicate: ["headersRef"], descendants: true }, { propertyName: "panelsRef", first: true, predicate: ["panelsRef"], descendants: true }], ngImport: i0, template: "<div class=\"sdc-tab\" [class.sdc-tab-stack]=\"isMobile\">\n <div #headersRef class=\"sdc-tab-headers\" role=\"tablist\" aria-label=\"Tabs\">\n @for (h of headers(); let i = $index; track i) {\n <button\n class=\"sdc-tab-header\"\n [class.sdc-tab-header-active]=\"i === activeIndex\"\n [class.sdc-tab-header-disabled]=\"h.disabled\"\n role=\"tab\"\n type=\"button\"\n [disabled]=\"h.disabled\"\n [attr.aria-selected]=\"i === activeIndex\"\n [attr.aria-controls]=\"h.id + '-panel'\"\n [attr.aria-disabled]=\"h.disabled\"\n [id]=\"h.id\"\n [tabindex]=\"h.disabled ? -1 : i === activeIndex ? 0 : -1\"\n (click)=\"select(i)\"\n (keydown)=\"onHeaderKeydown($event, i)\"\n >\n <span class=\"sdc-tab-label\">{{ h.label }}</span>\n </button>\n }\n </div>\n <div class=\"sdc-tab-panels\" #panelsRef>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".sdc-tab{border:0;border-radius:0;background:none;display:flex;flex-direction:column}.sdc-tab .sdc-tab-label{font-size:15px}.sdc-tab-headers{display:flex;white-space:nowrap;overflow-x:auto;overflow-y:hidden;padding:0;margin:0;border-bottom:1px solid var(--sdc-tab-border);position:relative}.sdc-tab-header{position:relative;appearance:none;background:transparent;border:0;margin:0;padding:10px 15px;color:var(--sdc-tab-primary);cursor:pointer;border-bottom:5px solid transparent;transition:color .2s ease-out,border-color .2s ease-out;border-radius:0;flex:0 0 auto}.sdc-tab-header:hover{color:var(--sdc-tab-primary-hover)}.sdc-tab-header:focus{outline:none;background-color:var(--sdc-tab-focus)}.sdc-tab-header[disabled],.sdc-tab-header-disabled{cursor:not-allowed;opacity:.6}.sdc-tab-header-active{color:var(--sdc-tab-text);font-weight:600;border-bottom-color:var(--sdc-tab-primary)}.sdc-tab-header-active:hover{color:#4d4d4d;border-bottom-color:var(--sdc-tab-primary-hover)}.sdc-tab-header>.sds-badge-error{position:absolute;top:16px;left:1px}.sdc-tab-panels{padding:10px 0 0;width:100%;min-width:0}.sdc-tab-panel{outline:0;list-style:none;margin:0}[hidden]{display:none!important}@media (max-width: 750px){.sdc-tab,.sdc-tab *{box-sizing:border-box}.sdc-tab.sdc-tab-stack{display:flex;flex-direction:column;width:100vw;max-width:100vw;overflow:hidden}.sdc-tab.sdc-tab-stack .sdc-tab-headers{flex-direction:row;border-right:0;border-bottom:1px solid var(--sdc-tab-border);width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable both-edges;gap:.25rem;padding:0;margin:0}.sdc-tab.sdc-tab-stack .sdc-tab-header{flex:0 0 auto;white-space:nowrap;border-right:0;border-bottom:5px solid transparent;width:auto;text-align:left}.sdc-tab.sdc-tab-stack .sdc-tab-panels{padding:10px 15px 0 0;width:100%;max-width:100%;min-width:0;overflow-x:hidden}.sdc-tab.sdc-tab-stack .sdc-tab-panel{max-width:100%;overflow-wrap:anywhere;word-break:break-word}img,video,canvas,svg{max-width:100%;height:auto}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1896
1935
|
}
|
|
1897
1936
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TabComponent, decorators: [{
|
|
1898
1937
|
type: Component,
|
|
1899
|
-
args: [{ selector: 'sdc-tab', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"sdc-tab\" [class.sdc-tab-stack]=\"isMobile\">\n <div #headersRef class=\"sdc-tab-headers\" role=\"tablist\" aria-label=\"Tabs\">\n @for (h of headers(); let i = $index; track i) {\n
|
|
1938
|
+
args: [{ selector: 'sdc-tab', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"sdc-tab\" [class.sdc-tab-stack]=\"isMobile\">\n <div #headersRef class=\"sdc-tab-headers\" role=\"tablist\" aria-label=\"Tabs\">\n @for (h of headers(); let i = $index; track i) {\n <button\n class=\"sdc-tab-header\"\n [class.sdc-tab-header-active]=\"i === activeIndex\"\n [class.sdc-tab-header-disabled]=\"h.disabled\"\n role=\"tab\"\n type=\"button\"\n [disabled]=\"h.disabled\"\n [attr.aria-selected]=\"i === activeIndex\"\n [attr.aria-controls]=\"h.id + '-panel'\"\n [attr.aria-disabled]=\"h.disabled\"\n [id]=\"h.id\"\n [tabindex]=\"h.disabled ? -1 : i === activeIndex ? 0 : -1\"\n (click)=\"select(i)\"\n (keydown)=\"onHeaderKeydown($event, i)\"\n >\n <span class=\"sdc-tab-label\">{{ h.label }}</span>\n </button>\n }\n </div>\n <div class=\"sdc-tab-panels\" #panelsRef>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".sdc-tab{border:0;border-radius:0;background:none;display:flex;flex-direction:column}.sdc-tab .sdc-tab-label{font-size:15px}.sdc-tab-headers{display:flex;white-space:nowrap;overflow-x:auto;overflow-y:hidden;padding:0;margin:0;border-bottom:1px solid var(--sdc-tab-border);position:relative}.sdc-tab-header{position:relative;appearance:none;background:transparent;border:0;margin:0;padding:10px 15px;color:var(--sdc-tab-primary);cursor:pointer;border-bottom:5px solid transparent;transition:color .2s ease-out,border-color .2s ease-out;border-radius:0;flex:0 0 auto}.sdc-tab-header:hover{color:var(--sdc-tab-primary-hover)}.sdc-tab-header:focus{outline:none;background-color:var(--sdc-tab-focus)}.sdc-tab-header[disabled],.sdc-tab-header-disabled{cursor:not-allowed;opacity:.6}.sdc-tab-header-active{color:var(--sdc-tab-text);font-weight:600;border-bottom-color:var(--sdc-tab-primary)}.sdc-tab-header-active:hover{color:#4d4d4d;border-bottom-color:var(--sdc-tab-primary-hover)}.sdc-tab-header>.sds-badge-error{position:absolute;top:16px;left:1px}.sdc-tab-panels{padding:10px 0 0;width:100%;min-width:0}.sdc-tab-panel{outline:0;list-style:none;margin:0}[hidden]{display:none!important}@media (max-width: 750px){.sdc-tab,.sdc-tab *{box-sizing:border-box}.sdc-tab.sdc-tab-stack{display:flex;flex-direction:column;width:100vw;max-width:100vw;overflow:hidden}.sdc-tab.sdc-tab-stack .sdc-tab-headers{flex-direction:row;border-right:0;border-bottom:1px solid var(--sdc-tab-border);width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable both-edges;gap:.25rem;padding:0;margin:0}.sdc-tab.sdc-tab-stack .sdc-tab-header{flex:0 0 auto;white-space:nowrap;border-right:0;border-bottom:5px solid transparent;width:auto;text-align:left}.sdc-tab.sdc-tab-stack .sdc-tab-panels{padding:10px 15px 0 0;width:100%;max-width:100%;min-width:0;overflow-x:hidden}.sdc-tab.sdc-tab-stack .sdc-tab-panel{max-width:100%;overflow-wrap:anywhere;word-break:break-word}img,video,canvas,svg{max-width:100%;height:auto}}\n"] }]
|
|
1900
1939
|
}], propDecorators: { headersRef: [{
|
|
1901
1940
|
type: ViewChild,
|
|
1902
1941
|
args: ['headersRef']
|
|
1942
|
+
}], panelsRef: [{
|
|
1943
|
+
type: ViewChild,
|
|
1944
|
+
args: ['panelsRef']
|
|
1903
1945
|
}], activeIndex: [{
|
|
1904
1946
|
type: Input,
|
|
1905
1947
|
args: [{ transform: numberAttribute }]
|
|
@@ -2155,145 +2197,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2155
2197
|
args: [{ required: false }]
|
|
2156
2198
|
}] } });
|
|
2157
2199
|
|
|
2158
|
-
class SqlEditorComponent {
|
|
2159
|
-
sql = '';
|
|
2160
|
-
height = null;
|
|
2161
|
-
width = null;
|
|
2162
|
-
set schema(value) {
|
|
2163
|
-
this.$schema = value;
|
|
2164
|
-
this.updateEditorExtensions();
|
|
2165
|
-
}
|
|
2166
|
-
onDomainFilter = new EventEmitter();
|
|
2167
|
-
editorContainer;
|
|
2168
|
-
$editor;
|
|
2169
|
-
$onChange = () => { };
|
|
2170
|
-
$onTouched = () => { };
|
|
2171
|
-
$schema = {};
|
|
2172
|
-
ngOnInit() {
|
|
2173
|
-
this.$editor = new EditorView({
|
|
2174
|
-
doc: this.sql,
|
|
2175
|
-
parent: this.editorContainer.nativeElement,
|
|
2176
|
-
extensions: this.buildExtensions(),
|
|
2177
|
-
});
|
|
2178
|
-
}
|
|
2179
|
-
ngOnDestroy() {
|
|
2180
|
-
this.$editor?.destroy();
|
|
2181
|
-
}
|
|
2182
|
-
writeValue(value) {
|
|
2183
|
-
if (this.$editor && value !== this.$editor.state.doc.toString()) {
|
|
2184
|
-
this.$editor.dispatch({
|
|
2185
|
-
changes: { from: 0, to: this.$editor.state.doc.length, insert: value },
|
|
2186
|
-
});
|
|
2187
|
-
}
|
|
2188
|
-
}
|
|
2189
|
-
registerOnChange(fn) {
|
|
2190
|
-
this.$onChange = fn;
|
|
2191
|
-
this.$onTouched();
|
|
2192
|
-
}
|
|
2193
|
-
registerOnTouched(fn) {
|
|
2194
|
-
this.$onTouched = fn;
|
|
2195
|
-
}
|
|
2196
|
-
setDisabledState(isDisabled) {
|
|
2197
|
-
this.$editor?.contentDOM.setAttribute('contenteditable', String(!isDisabled));
|
|
2198
|
-
}
|
|
2199
|
-
getStyles() {
|
|
2200
|
-
const styles = [];
|
|
2201
|
-
if (this.width) {
|
|
2202
|
-
const w = typeof this.width === 'number' ? `${this.width}px` : this.width;
|
|
2203
|
-
styles.push(`width:${w}`);
|
|
2204
|
-
}
|
|
2205
|
-
if (this.height) {
|
|
2206
|
-
const h = typeof this.height === 'number' ? `${this.height}px` : this.height;
|
|
2207
|
-
styles.push(`height:${h}`);
|
|
2208
|
-
}
|
|
2209
|
-
return styles.join(';');
|
|
2210
|
-
}
|
|
2211
|
-
buildExtensions() {
|
|
2212
|
-
return [
|
|
2213
|
-
basicSetup,
|
|
2214
|
-
ayuLight,
|
|
2215
|
-
sqlUppercaseHandler(),
|
|
2216
|
-
sqlFormatterHandler(),
|
|
2217
|
-
sql({ dialect: PostgreSQL }),
|
|
2218
|
-
sqlDomainFilterDecorator(token => this.onDomainFilter.emit(token)),
|
|
2219
|
-
autocompletion({
|
|
2220
|
-
override: [createSqlAutoCompletionHadler(this.$schema)],
|
|
2221
|
-
}),
|
|
2222
|
-
EditorView.updateListener.of(update => {
|
|
2223
|
-
if (update.docChanged) {
|
|
2224
|
-
this.$onChange(update.state.doc.toString());
|
|
2225
|
-
}
|
|
2226
|
-
}),
|
|
2227
|
-
];
|
|
2228
|
-
}
|
|
2229
|
-
updateEditorExtensions() {
|
|
2230
|
-
if (!this.$editor)
|
|
2231
|
-
return;
|
|
2232
|
-
this.$editor.dispatch({
|
|
2233
|
-
effects: StateEffect.reconfigure.of(this.buildExtensions()),
|
|
2234
|
-
});
|
|
2235
|
-
}
|
|
2236
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SqlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2237
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: SqlEditorComponent, isStandalone: true, selector: "sdc-sql-editor", inputs: { sql: "sql", height: "height", width: "width", schema: "schema" }, outputs: { onDomainFilter: "onDomainFilter" }, providers: [
|
|
2238
|
-
{
|
|
2239
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2240
|
-
useExisting: forwardRef(() => SqlEditorComponent),
|
|
2241
|
-
multi: true,
|
|
2242
|
-
},
|
|
2243
|
-
], viewQueries: [{ propertyName: "editorContainer", first: true, predicate: ["editorContainer"], descendants: true, static: true }], ngImport: i0, template: "<div #editorContainer class=\"sdc-sql-editor\" [style]=\"getStyles()\"></div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2244
|
-
}
|
|
2245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SqlEditorComponent, decorators: [{
|
|
2246
|
-
type: Component,
|
|
2247
|
-
args: [{ selector: 'sdc-sql-editor', standalone: true, imports: [CommonModule], providers: [
|
|
2248
|
-
{
|
|
2249
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2250
|
-
useExisting: forwardRef(() => SqlEditorComponent),
|
|
2251
|
-
multi: true,
|
|
2252
|
-
},
|
|
2253
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div #editorContainer class=\"sdc-sql-editor\" [style]=\"getStyles()\"></div>" }]
|
|
2254
|
-
}], propDecorators: { sql: [{
|
|
2255
|
-
type: Input
|
|
2256
|
-
}], height: [{
|
|
2257
|
-
type: Input
|
|
2258
|
-
}], width: [{
|
|
2259
|
-
type: Input
|
|
2260
|
-
}], schema: [{
|
|
2261
|
-
type: Input
|
|
2262
|
-
}], onDomainFilter: [{
|
|
2263
|
-
type: Output
|
|
2264
|
-
}], editorContainer: [{
|
|
2265
|
-
type: ViewChild,
|
|
2266
|
-
args: ['editorContainer', { static: true }]
|
|
2267
|
-
}] } });
|
|
2268
|
-
|
|
2269
|
-
class TextboxComponent extends InputsComponent {
|
|
2270
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2271
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: TextboxComponent, isStandalone: true, selector: "sdc-textbox", providers: [
|
|
2272
|
-
{
|
|
2273
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2274
|
-
useExisting: forwardRef(() => TextboxComponent),
|
|
2275
|
-
multi: true,
|
|
2276
|
-
},
|
|
2277
|
-
], usesInheritance: true, ngImport: i0, template: "<div class=\"sdc-textbox\">\n <div *ngIf=\"label || infoIcon\" class=\"flex align-items-center\">\n <label *ngIf=\"label\" [for]=\"identity.id\">\n <span>{{ label }}</span>\n <span class=\"required-field\" *ngIf=\"required\"> •</span>\n </label>\n <i *ngIf=\"infoIcon\" class=\"fas fa-info-circle ml-3\" \n [pTooltip]=\"tooltipIcon\" \n tooltipZIndex=\"999999999999\"></i>\n </div>\n\n <input\n (input)=\"onInput($event)\"\n [disabled]=\"disabled\"\n [id]=\"identity.id\"\n [name]=\"identity.name\"\n [ngClass]=\"getInvalidClass()\"\n [ngStyle]=\"getInputStyle()\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"value\"\n pInputText\n type=\"text\"\n [attr.maxlength]=\"maxlength\"\n [pKeyFilter]=\"keyFilter\"\n />\n\n <small\n *ngIf=\"message\"\n [ngClass]=\"getInvalidMessageClass()\"\n >{{ message }}</small>\n</div>\n", styles: [".sdc-textbox label{display:inline-flex;align-items:center;margin-bottom:0;line-height:1;padding-top:7px;padding-bottom:7px}.sdc-textbox .required-field{margin-left:.25rem}.sdc-textbox ::ng-deep input{border-start-start-radius:var(--sdc-formfield-border-radius)!important;border-end-start-radius:var(--sdc-formfield-border-radius)!important;border-start-end-radius:var(--sdc-formfield-border-radius)!important;border-end-end-radius:var(--sdc-formfield-border-radius)!important;min-height:var(--sdc-formfield-default-height)!important;height:var(--sdc-formfield-default-height)!important;max-height:var(--sdc-formfield-default-height)!important;line-height:var(--sdc-formfield-default-line-height)!important}.sdc-textbox ::ng-deep input:disabled{background-color:var(--sdc-formfield-disabled-bg)!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i6.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: KeyFilterModule }, { kind: "directive", type: i3$3.KeyFilter, selector: "[pKeyFilter]", inputs: ["pValidateOnly", "pKeyFilter"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4$2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2278
|
-
}
|
|
2279
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextboxComponent, decorators: [{
|
|
2280
|
-
type: Component,
|
|
2281
|
-
args: [{ selector: 'sdc-textbox', standalone: true, imports: [
|
|
2282
|
-
CommonModule,
|
|
2283
|
-
FormsModule,
|
|
2284
|
-
ReactiveFormsModule,
|
|
2285
|
-
InputTextModule,
|
|
2286
|
-
KeyFilterModule,
|
|
2287
|
-
TooltipModule,
|
|
2288
|
-
], providers: [
|
|
2289
|
-
{
|
|
2290
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2291
|
-
useExisting: forwardRef(() => TextboxComponent),
|
|
2292
|
-
multi: true,
|
|
2293
|
-
},
|
|
2294
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"sdc-textbox\">\n <div *ngIf=\"label || infoIcon\" class=\"flex align-items-center\">\n <label *ngIf=\"label\" [for]=\"identity.id\">\n <span>{{ label }}</span>\n <span class=\"required-field\" *ngIf=\"required\"> •</span>\n </label>\n <i *ngIf=\"infoIcon\" class=\"fas fa-info-circle ml-3\" \n [pTooltip]=\"tooltipIcon\" \n tooltipZIndex=\"999999999999\"></i>\n </div>\n\n <input\n (input)=\"onInput($event)\"\n [disabled]=\"disabled\"\n [id]=\"identity.id\"\n [name]=\"identity.name\"\n [ngClass]=\"getInvalidClass()\"\n [ngStyle]=\"getInputStyle()\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"value\"\n pInputText\n type=\"text\"\n [attr.maxlength]=\"maxlength\"\n [pKeyFilter]=\"keyFilter\"\n />\n\n <small\n *ngIf=\"message\"\n [ngClass]=\"getInvalidMessageClass()\"\n >{{ message }}</small>\n</div>\n", styles: [".sdc-textbox label{display:inline-flex;align-items:center;margin-bottom:0;line-height:1;padding-top:7px;padding-bottom:7px}.sdc-textbox .required-field{margin-left:.25rem}.sdc-textbox ::ng-deep input{border-start-start-radius:var(--sdc-formfield-border-radius)!important;border-end-start-radius:var(--sdc-formfield-border-radius)!important;border-start-end-radius:var(--sdc-formfield-border-radius)!important;border-end-end-radius:var(--sdc-formfield-border-radius)!important;min-height:var(--sdc-formfield-default-height)!important;height:var(--sdc-formfield-default-height)!important;max-height:var(--sdc-formfield-default-height)!important;line-height:var(--sdc-formfield-default-line-height)!important}.sdc-textbox ::ng-deep input:disabled{background-color:var(--sdc-formfield-disabled-bg)!important}\n"] }]
|
|
2295
|
-
}] });
|
|
2296
|
-
|
|
2297
2200
|
class ToastComponent {
|
|
2298
2201
|
toast;
|
|
2299
2202
|
dismiss = new EventEmitter();
|
|
@@ -2398,6 +2301,231 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2398
2301
|
}]
|
|
2399
2302
|
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.ComponentFactoryResolver }] });
|
|
2400
2303
|
|
|
2304
|
+
class CodeEditorComponent {
|
|
2305
|
+
toast;
|
|
2306
|
+
constructor(toast) {
|
|
2307
|
+
this.toast = toast;
|
|
2308
|
+
}
|
|
2309
|
+
sql = '';
|
|
2310
|
+
height = null;
|
|
2311
|
+
width = null;
|
|
2312
|
+
showCopy = false;
|
|
2313
|
+
customHeaderItems = [];
|
|
2314
|
+
activeHeaderKey;
|
|
2315
|
+
headerSelect = new EventEmitter();
|
|
2316
|
+
copied = new EventEmitter();
|
|
2317
|
+
_readOnly = false;
|
|
2318
|
+
set readOnly(v) { this._readOnly = !!v; this.updateEditorExtensions(); }
|
|
2319
|
+
get readOnly() { return this._readOnly; }
|
|
2320
|
+
languageChange = new EventEmitter();
|
|
2321
|
+
set language(value) {
|
|
2322
|
+
const lang = (value || 'sql');
|
|
2323
|
+
if (lang !== this.$language) {
|
|
2324
|
+
this.$language = lang;
|
|
2325
|
+
this.updateEditorExtensions();
|
|
2326
|
+
this.languageChange.emit(this.$language);
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
get language() { return this.$language; }
|
|
2330
|
+
set schema(value) {
|
|
2331
|
+
this.$schema = value;
|
|
2332
|
+
if (this.$language === 'sql')
|
|
2333
|
+
this.updateEditorExtensions();
|
|
2334
|
+
}
|
|
2335
|
+
onDomainFilter = new EventEmitter();
|
|
2336
|
+
editorContainer;
|
|
2337
|
+
$editor;
|
|
2338
|
+
$onChange = () => { };
|
|
2339
|
+
$onTouched = () => { };
|
|
2340
|
+
$schema = {};
|
|
2341
|
+
$language = 'sql';
|
|
2342
|
+
$disabled = false;
|
|
2343
|
+
ngOnInit() {
|
|
2344
|
+
this.$editor = new EditorView({
|
|
2345
|
+
doc: this.sql,
|
|
2346
|
+
parent: this.editorContainer.nativeElement,
|
|
2347
|
+
extensions: this.buildExtensions(),
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
ngOnChanges(changes) {
|
|
2351
|
+
if (changes['sql'] && !changes['sql'].firstChange && this.$editor) {
|
|
2352
|
+
const next = (changes['sql'].currentValue ?? '');
|
|
2353
|
+
if (next !== this.$editor.state.doc.toString()) {
|
|
2354
|
+
this.$editor.dispatch({ changes: { from: 0, to: this.$editor.state.doc.length, insert: next } });
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
ngOnDestroy() { this.$editor?.destroy(); }
|
|
2359
|
+
writeValue(value) {
|
|
2360
|
+
if (this.$editor && value !== this.$editor.state.doc.toString()) {
|
|
2361
|
+
this.$editor.dispatch({ changes: { from: 0, to: this.$editor.state.doc.length, insert: value ?? '' } });
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
registerOnChange(fn) { this.$onChange = fn; }
|
|
2365
|
+
registerOnTouched(fn) { this.$onTouched = fn; }
|
|
2366
|
+
setDisabledState(isDisabled) {
|
|
2367
|
+
this.$disabled = isDisabled;
|
|
2368
|
+
if (!this.$editor)
|
|
2369
|
+
return;
|
|
2370
|
+
const editable = !(isDisabled || this._readOnly);
|
|
2371
|
+
this.$editor.contentDOM.setAttribute('contenteditable', String(editable));
|
|
2372
|
+
this.updateEditorExtensions();
|
|
2373
|
+
}
|
|
2374
|
+
getStyleMap() {
|
|
2375
|
+
const s = {};
|
|
2376
|
+
if (this.width != null)
|
|
2377
|
+
s.width = typeof this.width === 'number' ? `${this.width}px` : this.width;
|
|
2378
|
+
if (this.height != null)
|
|
2379
|
+
s.height = typeof this.height === 'number' ? `${this.height}px` : this.height;
|
|
2380
|
+
return s;
|
|
2381
|
+
}
|
|
2382
|
+
pickHeader(item) {
|
|
2383
|
+
this.activeHeaderKey = item.key;
|
|
2384
|
+
if (item.value !== this.$language)
|
|
2385
|
+
this.language = item.value;
|
|
2386
|
+
this.headerSelect.emit({ key: item.key, lang: item.value });
|
|
2387
|
+
}
|
|
2388
|
+
async copy() {
|
|
2389
|
+
const text = this.$editor ? this.$editor.state.doc.toString() : this.sql || '';
|
|
2390
|
+
let ok = false;
|
|
2391
|
+
try {
|
|
2392
|
+
await navigator.clipboard.writeText(text);
|
|
2393
|
+
ok = true;
|
|
2394
|
+
}
|
|
2395
|
+
catch {
|
|
2396
|
+
try {
|
|
2397
|
+
const ta = document.createElement('textarea');
|
|
2398
|
+
ta.value = text;
|
|
2399
|
+
document.body.appendChild(ta);
|
|
2400
|
+
ta.select();
|
|
2401
|
+
document.execCommand('copy');
|
|
2402
|
+
document.body.removeChild(ta);
|
|
2403
|
+
ok = true;
|
|
2404
|
+
}
|
|
2405
|
+
catch {
|
|
2406
|
+
ok = false;
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
this.toast.show({
|
|
2410
|
+
title: ok ? 'Copiado' : 'Falha ao copiar',
|
|
2411
|
+
text: ok ? 'Conteúdo copiado para a área de transferência.' : 'Não foi possível copiar.',
|
|
2412
|
+
severity: ok ? 'success' : 'error',
|
|
2413
|
+
duration: 2000,
|
|
2414
|
+
closable: true
|
|
2415
|
+
});
|
|
2416
|
+
this.copied.emit(ok);
|
|
2417
|
+
}
|
|
2418
|
+
buildExtensions() {
|
|
2419
|
+
const editable = !(this._readOnly || this.$disabled);
|
|
2420
|
+
const guards = editable ? [] : [
|
|
2421
|
+
EditorView.domEventHandlers({
|
|
2422
|
+
beforeinput: e => e.preventDefault(),
|
|
2423
|
+
drop: e => e.preventDefault(),
|
|
2424
|
+
paste: e => e.preventDefault(),
|
|
2425
|
+
cut: e => e.preventDefault(),
|
|
2426
|
+
}),
|
|
2427
|
+
];
|
|
2428
|
+
const base = [
|
|
2429
|
+
basicSetup,
|
|
2430
|
+
ayuLight,
|
|
2431
|
+
EditorView.editable.of(editable),
|
|
2432
|
+
EditorView.updateListener.of((update) => {
|
|
2433
|
+
if (update.docChanged)
|
|
2434
|
+
this.$onChange(update.state.doc.toString());
|
|
2435
|
+
}),
|
|
2436
|
+
...guards,
|
|
2437
|
+
];
|
|
2438
|
+
return [...base, ...this.getLanguageExtensions()];
|
|
2439
|
+
}
|
|
2440
|
+
getLanguageExtensions() {
|
|
2441
|
+
switch (this.$language) {
|
|
2442
|
+
case 'sql':
|
|
2443
|
+
return [
|
|
2444
|
+
sqlUppercaseHandler(),
|
|
2445
|
+
sqlFormatterHandler(),
|
|
2446
|
+
sql({ dialect: PostgreSQL }),
|
|
2447
|
+
sqlDomainFilterDecorator((token) => this.onDomainFilter.emit(token)),
|
|
2448
|
+
autocompletion({ override: [createSqlAutoCompletionHadler(this.$schema)] }),
|
|
2449
|
+
];
|
|
2450
|
+
case 'typescript': return [javascript({ typescript: true, jsx: true }), autocompletion()];
|
|
2451
|
+
case 'javascript': return [javascript({ typescript: false, jsx: true }), autocompletion()];
|
|
2452
|
+
case 'json': return [json(), autocompletion()];
|
|
2453
|
+
case 'html': return [html(), autocompletion()];
|
|
2454
|
+
case 'plaintext':
|
|
2455
|
+
default: return [autocompletion()];
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
updateEditorExtensions() {
|
|
2459
|
+
if (!this.$editor)
|
|
2460
|
+
return;
|
|
2461
|
+
this.$editor.dispatch({ effects: StateEffect.reconfigure.of(this.buildExtensions()) });
|
|
2462
|
+
}
|
|
2463
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CodeEditorComponent, deps: [{ token: ToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2464
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: CodeEditorComponent, isStandalone: true, selector: "sdc-code-editor", inputs: { sql: "sql", height: "height", width: "width", showCopy: "showCopy", customHeaderItems: "customHeaderItems", activeHeaderKey: "activeHeaderKey", readOnly: "readOnly", language: "language", schema: "schema" }, outputs: { headerSelect: "headerSelect", copied: "onCopy", languageChange: "languageChange", onDomainFilter: "onDomainFilter" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CodeEditorComponent), multi: true }], viewQueries: [{ propertyName: "editorContainer", first: true, predicate: ["editorContainer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"sdc-code-editor\">\n <div #editorContainer class=\"sdc-code-editor\" [ngStyle]=\"getStyleMap()\"></div>\n\n <div class=\"sdc-code-editor-header\" *ngIf=\"showCopy || customHeaderItems.length > 1\">\n <div class=\"header-left\" *ngIf=\"customHeaderItems.length > 1\">\n <div class=\"segmented\">\n <button\n *ngFor=\"let it of customHeaderItems\"\n type=\"button\"\n class=\"segmented-item\"\n [class.active]=\"it.key ? it.key === activeHeaderKey : it.value === language\"\n (click)=\"pickHeader(it)\"\n >\n {{ it.label }}\n </button>\n </div>\n </div>\n\n <div class=\"header-right\">\n <button type=\"button\" class=\"icon-btn\" *ngIf=\"showCopy\" (click)=\"copy()\" title=\"Copiar\">\n <i class=\"fas fa-copy\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Copiar</span>\n </button>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;min-width:0;min-height:0}.sdc-code-editor{border:var(--sql-editor-border);position:relative;isolation:isolate}.sdc-code-editor:hover .sdc-code-editor-header,.sdc-code-editor:focus-within .sdc-code-editor-header{opacity:1;transform:translateY(0);pointer-events:auto}.sdc-code-editor{display:block;width:100%}.sdc-code-editor,.sdc-code-editor .cm-editor,.sdc-code-editor .cm-scroller{position:relative;z-index:0;height:100%}.sdc-code-editor .cm-scroller{overflow:auto}.sdc-code-editor-header{position:absolute;top:8px;right:8px;left:auto;display:flex;align-items:center;gap:8px;z-index:10;opacity:0;transform:translateY(-4px);transition:opacity .18s ease,transform .18s ease;pointer-events:none}.sdc-code-editor-header .header-left,.sdc-code-editor-header .header-right{display:flex;align-items:center;gap:8px}.sdc-code-editor-header .segmented{display:flex;gap:2px;padding:2px;border-radius:999px;background:#ffffffeb;border:1px solid rgba(0,0,0,.08);box-shadow:0 2px 8px #00000014;backdrop-filter:saturate(180%) blur(6px);pointer-events:auto}.sdc-code-editor-header .segmented-item{appearance:none;border:0;background:transparent;padding:6px 10px;border-radius:999px;font:500 12px/1 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;text-transform:uppercase;letter-spacing:.02em;cursor:pointer;-webkit-user-select:none;user-select:none;color:#111}.sdc-code-editor-header .segmented-item:hover{background:#1118270f}.sdc-code-editor-header .segmented-item.active{background:#eef2ff;box-shadow:inset 0 0 0 1px #c7d2fe}.sdc-code-editor-header .segmented-item:focus-visible{outline:none;box-shadow:inset 0 0 0 2px #6366f1}.sdc-code-editor-header .icon-btn{appearance:none;border:1px solid rgba(0,0,0,.08);width:32px;height:32px;border-radius:999px;display:grid;place-items:center;background:#ffffffeb;box-shadow:0 2px 8px #00000014;cursor:pointer;pointer-events:auto}.sdc-code-editor-header .icon-btn:hover{filter:brightness(.98)}.sdc-code-editor-header .icon-btn:active{transform:translateY(1px)}.sdc-code-editor-header .icon-btn:focus-visible{outline:none;box-shadow:0 0 0 2px #6366f1 inset}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2465
|
+
}
|
|
2466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CodeEditorComponent, decorators: [{
|
|
2467
|
+
type: Component,
|
|
2468
|
+
args: [{ selector: 'sdc-code-editor', standalone: true, imports: [CommonModule], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CodeEditorComponent), multi: true }], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"sdc-code-editor\">\n <div #editorContainer class=\"sdc-code-editor\" [ngStyle]=\"getStyleMap()\"></div>\n\n <div class=\"sdc-code-editor-header\" *ngIf=\"showCopy || customHeaderItems.length > 1\">\n <div class=\"header-left\" *ngIf=\"customHeaderItems.length > 1\">\n <div class=\"segmented\">\n <button\n *ngFor=\"let it of customHeaderItems\"\n type=\"button\"\n class=\"segmented-item\"\n [class.active]=\"it.key ? it.key === activeHeaderKey : it.value === language\"\n (click)=\"pickHeader(it)\"\n >\n {{ it.label }}\n </button>\n </div>\n </div>\n\n <div class=\"header-right\">\n <button type=\"button\" class=\"icon-btn\" *ngIf=\"showCopy\" (click)=\"copy()\" title=\"Copiar\">\n <i class=\"fas fa-copy\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Copiar</span>\n </button>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;min-width:0;min-height:0}.sdc-code-editor{border:var(--sql-editor-border);position:relative;isolation:isolate}.sdc-code-editor:hover .sdc-code-editor-header,.sdc-code-editor:focus-within .sdc-code-editor-header{opacity:1;transform:translateY(0);pointer-events:auto}.sdc-code-editor{display:block;width:100%}.sdc-code-editor,.sdc-code-editor .cm-editor,.sdc-code-editor .cm-scroller{position:relative;z-index:0;height:100%}.sdc-code-editor .cm-scroller{overflow:auto}.sdc-code-editor-header{position:absolute;top:8px;right:8px;left:auto;display:flex;align-items:center;gap:8px;z-index:10;opacity:0;transform:translateY(-4px);transition:opacity .18s ease,transform .18s ease;pointer-events:none}.sdc-code-editor-header .header-left,.sdc-code-editor-header .header-right{display:flex;align-items:center;gap:8px}.sdc-code-editor-header .segmented{display:flex;gap:2px;padding:2px;border-radius:999px;background:#ffffffeb;border:1px solid rgba(0,0,0,.08);box-shadow:0 2px 8px #00000014;backdrop-filter:saturate(180%) blur(6px);pointer-events:auto}.sdc-code-editor-header .segmented-item{appearance:none;border:0;background:transparent;padding:6px 10px;border-radius:999px;font:500 12px/1 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;text-transform:uppercase;letter-spacing:.02em;cursor:pointer;-webkit-user-select:none;user-select:none;color:#111}.sdc-code-editor-header .segmented-item:hover{background:#1118270f}.sdc-code-editor-header .segmented-item.active{background:#eef2ff;box-shadow:inset 0 0 0 1px #c7d2fe}.sdc-code-editor-header .segmented-item:focus-visible{outline:none;box-shadow:inset 0 0 0 2px #6366f1}.sdc-code-editor-header .icon-btn{appearance:none;border:1px solid rgba(0,0,0,.08);width:32px;height:32px;border-radius:999px;display:grid;place-items:center;background:#ffffffeb;box-shadow:0 2px 8px #00000014;cursor:pointer;pointer-events:auto}.sdc-code-editor-header .icon-btn:hover{filter:brightness(.98)}.sdc-code-editor-header .icon-btn:active{transform:translateY(1px)}.sdc-code-editor-header .icon-btn:focus-visible{outline:none;box-shadow:0 0 0 2px #6366f1 inset}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
|
|
2469
|
+
}], ctorParameters: () => [{ type: ToastService }], propDecorators: { sql: [{
|
|
2470
|
+
type: Input
|
|
2471
|
+
}], height: [{
|
|
2472
|
+
type: Input
|
|
2473
|
+
}], width: [{
|
|
2474
|
+
type: Input
|
|
2475
|
+
}], showCopy: [{
|
|
2476
|
+
type: Input
|
|
2477
|
+
}], customHeaderItems: [{
|
|
2478
|
+
type: Input
|
|
2479
|
+
}], activeHeaderKey: [{
|
|
2480
|
+
type: Input
|
|
2481
|
+
}], headerSelect: [{
|
|
2482
|
+
type: Output
|
|
2483
|
+
}], copied: [{
|
|
2484
|
+
type: Output,
|
|
2485
|
+
args: ['onCopy']
|
|
2486
|
+
}], readOnly: [{
|
|
2487
|
+
type: Input
|
|
2488
|
+
}], languageChange: [{
|
|
2489
|
+
type: Output
|
|
2490
|
+
}], language: [{
|
|
2491
|
+
type: Input
|
|
2492
|
+
}], schema: [{
|
|
2493
|
+
type: Input
|
|
2494
|
+
}], onDomainFilter: [{
|
|
2495
|
+
type: Output
|
|
2496
|
+
}], editorContainer: [{
|
|
2497
|
+
type: ViewChild,
|
|
2498
|
+
args: ['editorContainer', { static: true }]
|
|
2499
|
+
}] } });
|
|
2500
|
+
|
|
2501
|
+
class TextboxComponent extends InputsComponent {
|
|
2502
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2503
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: TextboxComponent, isStandalone: true, selector: "sdc-textbox", providers: [
|
|
2504
|
+
{
|
|
2505
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2506
|
+
useExisting: forwardRef(() => TextboxComponent),
|
|
2507
|
+
multi: true,
|
|
2508
|
+
},
|
|
2509
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"sdc-textbox\">\n <div *ngIf=\"label || infoIcon\" class=\"flex align-items-center\">\n <label *ngIf=\"label\" [for]=\"identity.id\">\n <span>{{ label }}</span>\n <span class=\"required-field\" *ngIf=\"required\"> •</span>\n </label>\n <i *ngIf=\"infoIcon\" class=\"fas fa-info-circle ml-3\" \n [pTooltip]=\"tooltipIcon\" \n tooltipZIndex=\"999999999999\"></i>\n </div>\n\n <input\n (input)=\"onInput($event)\"\n [disabled]=\"disabled\"\n [id]=\"identity.id\"\n [name]=\"identity.name\"\n [ngClass]=\"getInvalidClass()\"\n [ngStyle]=\"getInputStyle()\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"value\"\n pInputText\n type=\"text\"\n [attr.maxlength]=\"maxlength\"\n [pKeyFilter]=\"keyFilter\"\n />\n\n <small\n *ngIf=\"message\"\n [ngClass]=\"getInvalidMessageClass()\"\n >{{ message }}</small>\n</div>\n", styles: [".sdc-textbox label{display:inline-flex;align-items:center;margin-bottom:0;line-height:1;padding-top:7px;padding-bottom:7px}.sdc-textbox .required-field{margin-left:.25rem}.sdc-textbox ::ng-deep input{border-start-start-radius:var(--sdc-formfield-border-radius)!important;border-end-start-radius:var(--sdc-formfield-border-radius)!important;border-start-end-radius:var(--sdc-formfield-border-radius)!important;border-end-end-radius:var(--sdc-formfield-border-radius)!important;min-height:var(--sdc-formfield-default-height)!important;height:var(--sdc-formfield-default-height)!important;max-height:var(--sdc-formfield-default-height)!important;line-height:var(--sdc-formfield-default-line-height)!important}.sdc-textbox ::ng-deep input:disabled{background-color:var(--sdc-formfield-disabled-bg)!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i6.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: KeyFilterModule }, { kind: "directive", type: i3$3.KeyFilter, selector: "[pKeyFilter]", inputs: ["pValidateOnly", "pKeyFilter"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4$2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2510
|
+
}
|
|
2511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextboxComponent, decorators: [{
|
|
2512
|
+
type: Component,
|
|
2513
|
+
args: [{ selector: 'sdc-textbox', standalone: true, imports: [
|
|
2514
|
+
CommonModule,
|
|
2515
|
+
FormsModule,
|
|
2516
|
+
ReactiveFormsModule,
|
|
2517
|
+
InputTextModule,
|
|
2518
|
+
KeyFilterModule,
|
|
2519
|
+
TooltipModule,
|
|
2520
|
+
], providers: [
|
|
2521
|
+
{
|
|
2522
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2523
|
+
useExisting: forwardRef(() => TextboxComponent),
|
|
2524
|
+
multi: true,
|
|
2525
|
+
},
|
|
2526
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"sdc-textbox\">\n <div *ngIf=\"label || infoIcon\" class=\"flex align-items-center\">\n <label *ngIf=\"label\" [for]=\"identity.id\">\n <span>{{ label }}</span>\n <span class=\"required-field\" *ngIf=\"required\"> •</span>\n </label>\n <i *ngIf=\"infoIcon\" class=\"fas fa-info-circle ml-3\" \n [pTooltip]=\"tooltipIcon\" \n tooltipZIndex=\"999999999999\"></i>\n </div>\n\n <input\n (input)=\"onInput($event)\"\n [disabled]=\"disabled\"\n [id]=\"identity.id\"\n [name]=\"identity.name\"\n [ngClass]=\"getInvalidClass()\"\n [ngStyle]=\"getInputStyle()\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"value\"\n pInputText\n type=\"text\"\n [attr.maxlength]=\"maxlength\"\n [pKeyFilter]=\"keyFilter\"\n />\n\n <small\n *ngIf=\"message\"\n [ngClass]=\"getInvalidMessageClass()\"\n >{{ message }}</small>\n</div>\n", styles: [".sdc-textbox label{display:inline-flex;align-items:center;margin-bottom:0;line-height:1;padding-top:7px;padding-bottom:7px}.sdc-textbox .required-field{margin-left:.25rem}.sdc-textbox ::ng-deep input{border-start-start-radius:var(--sdc-formfield-border-radius)!important;border-end-start-radius:var(--sdc-formfield-border-radius)!important;border-start-end-radius:var(--sdc-formfield-border-radius)!important;border-end-end-radius:var(--sdc-formfield-border-radius)!important;min-height:var(--sdc-formfield-default-height)!important;height:var(--sdc-formfield-default-height)!important;max-height:var(--sdc-formfield-default-height)!important;line-height:var(--sdc-formfield-default-line-height)!important}.sdc-textbox ::ng-deep input:disabled{background-color:var(--sdc-formfield-disabled-bg)!important}\n"] }]
|
|
2527
|
+
}] });
|
|
2528
|
+
|
|
2401
2529
|
class ModalcComponent {
|
|
2402
2530
|
cdr;
|
|
2403
2531
|
title = 'Modal Title';
|
|
@@ -2560,11 +2688,11 @@ class CardComponent {
|
|
|
2560
2688
|
return text.length > this.options.descriptionMaxLength ? text.slice(0, this.options.descriptionMaxLength).trimEnd() + '...' : text;
|
|
2561
2689
|
}
|
|
2562
2690
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2563
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: CardComponent, isStandalone: true, selector: "sdc-card", inputs: { data: "data", options: "options" }, outputs: { cardAction: "cardAction" }, ngImport: i0, template: "<div class=\"sdc-card dp-card\">\n <div class=\"sdc-card__header\">\n <div class=\"sdc-card__icon\" [style.background]=\"options?.backgroundIcon\" [style.color]=\"options?.iconColor\">\n <i [class]=\"options?.icon\"></i>\n </div>\n <div class=\"flex flex-column ml-3\">\n <div class=\"sdc-card__title\">\n {{ data.name }}\n </div>\n\n <div class=\"sdc-card__subtitle\">\n <span>{{ data.category }}</span>\n </div>\n </div>\n </div>\n\n <div class=\"sdc-card__body\">\n <div class=\"sdc-card__content\">\n <p class=\"sdc-card__description\">\n {{ getShortDescription(data.description) }}\n </p>\n </div>\n </div>\n\n <div class=\"sdc-card__footer flex justify-content-center\">\n <sdc-button\n width=\"100%\"\n (onClick)=\"cardAction.emit(data)\"\n [priority]=\"options?.buttonPriority!\"\n [label]=\"options?.buttonLabel! | translate\"\n >\n </sdc-button>\n </div>\n</div>\n", styles: [":host{display:block}.sdc-card{width:100%;border-radius:var(--sdc-formfield-border-radius);overflow:hidden;display:flex;padding:8px;flex-direction:column;
|
|
2691
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: CardComponent, isStandalone: true, selector: "sdc-card", inputs: { data: "data", options: "options" }, outputs: { cardAction: "cardAction" }, ngImport: i0, template: "<div class=\"sdc-card dp-card\">\n <div class=\"sdc-card__header\">\n <div class=\"sdc-card__icon\" [style.background]=\"options?.backgroundIcon\" [style.color]=\"options?.iconColor\">\n <i [class]=\"options?.icon\"></i>\n </div>\n <div class=\"flex flex-column ml-3\">\n <div class=\"sdc-card__title\">\n {{ data.name }}\n </div>\n\n <div class=\"sdc-card__subtitle\">\n <span>{{ data.category }}</span>\n </div>\n </div>\n </div>\n\n <div class=\"sdc-card__body\">\n <div class=\"sdc-card__content\">\n <p class=\"sdc-card__description\">\n {{ getShortDescription(data.description) }}\n </p>\n </div>\n </div>\n\n <div class=\"sdc-card__footer flex justify-content-center\">\n <sdc-button\n width=\"100%\"\n (onClick)=\"cardAction.emit(data)\"\n [priority]=\"options?.buttonPriority!\"\n [label]=\"options?.buttonLabel! | translate\"\n >\n </sdc-button>\n </div>\n</div>\n", styles: [":host{display:block}.sdc-card{width:100%;border-radius:var(--sdc-formfield-border-radius);overflow:hidden;display:flex;padding:8px;flex-direction:column;min-height:19rem}.sdc-card__header{display:flex;align-items:center;justify-content:start;gap:.75rem;padding:.75rem 1rem}.sdc-card__icon{min-width:2.9rem;min-height:2.9rem;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}.sdc-card__body{padding:8px}.sdc-card__title{font-size:1.4rem;font-weight:600;width:100%;white-space:wrap;overflow:hidden;text-overflow:ellipsis}.sdc-card__subtitle{margin-top:.25rem;font-weight:700;font-size:.775rem;color:var(--sdc-muted, #475569);display:flex;justify-content:space-between}.sdc-card__content{margin-top:.5rem}.sdc-card__description{text-align:justify;overflow:hidden}.sdc-card__tags{margin-top:.5rem;display:flex;gap:.5rem;flex-wrap:wrap}.sdc-card__footer{margin-top:auto;padding:.75rem 1rem;display:flex;align-items:center;justify-content:center;gap:.5rem;min-height:3rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CheckboxModule }, { kind: "ngmodule", type: AvatarGroupModule }, { kind: "component", type: ButtonComponent, selector: "sdc-button", inputs: ["disabled", "width", "icon", "id", "label", "priority", "size", "type"], outputs: ["onClick"] }, { kind: "ngmodule", type: CardModule }, { kind: "ngmodule", type: TagModule }, { kind: "ngmodule", type: AvatarModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2564
2692
|
}
|
|
2565
2693
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CardComponent, decorators: [{
|
|
2566
2694
|
type: Component,
|
|
2567
|
-
args: [{ selector: 'sdc-card', imports: [CommonModule, CheckboxModule, AvatarGroupModule, ButtonComponent, CardModule, TagModule, AvatarModule, TranslateModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"sdc-card dp-card\">\n <div class=\"sdc-card__header\">\n <div class=\"sdc-card__icon\" [style.background]=\"options?.backgroundIcon\" [style.color]=\"options?.iconColor\">\n <i [class]=\"options?.icon\"></i>\n </div>\n <div class=\"flex flex-column ml-3\">\n <div class=\"sdc-card__title\">\n {{ data.name }}\n </div>\n\n <div class=\"sdc-card__subtitle\">\n <span>{{ data.category }}</span>\n </div>\n </div>\n </div>\n\n <div class=\"sdc-card__body\">\n <div class=\"sdc-card__content\">\n <p class=\"sdc-card__description\">\n {{ getShortDescription(data.description) }}\n </p>\n </div>\n </div>\n\n <div class=\"sdc-card__footer flex justify-content-center\">\n <sdc-button\n width=\"100%\"\n (onClick)=\"cardAction.emit(data)\"\n [priority]=\"options?.buttonPriority!\"\n [label]=\"options?.buttonLabel! | translate\"\n >\n </sdc-button>\n </div>\n</div>\n", styles: [":host{display:block}.sdc-card{width:100%;border-radius:var(--sdc-formfield-border-radius);overflow:hidden;display:flex;padding:8px;flex-direction:column;
|
|
2695
|
+
args: [{ selector: 'sdc-card', imports: [CommonModule, CheckboxModule, AvatarGroupModule, ButtonComponent, CardModule, TagModule, AvatarModule, TranslateModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"sdc-card dp-card\">\n <div class=\"sdc-card__header\">\n <div class=\"sdc-card__icon\" [style.background]=\"options?.backgroundIcon\" [style.color]=\"options?.iconColor\">\n <i [class]=\"options?.icon\"></i>\n </div>\n <div class=\"flex flex-column ml-3\">\n <div class=\"sdc-card__title\">\n {{ data.name }}\n </div>\n\n <div class=\"sdc-card__subtitle\">\n <span>{{ data.category }}</span>\n </div>\n </div>\n </div>\n\n <div class=\"sdc-card__body\">\n <div class=\"sdc-card__content\">\n <p class=\"sdc-card__description\">\n {{ getShortDescription(data.description) }}\n </p>\n </div>\n </div>\n\n <div class=\"sdc-card__footer flex justify-content-center\">\n <sdc-button\n width=\"100%\"\n (onClick)=\"cardAction.emit(data)\"\n [priority]=\"options?.buttonPriority!\"\n [label]=\"options?.buttonLabel! | translate\"\n >\n </sdc-button>\n </div>\n</div>\n", styles: [":host{display:block}.sdc-card{width:100%;border-radius:var(--sdc-formfield-border-radius);overflow:hidden;display:flex;padding:8px;flex-direction:column;min-height:19rem}.sdc-card__header{display:flex;align-items:center;justify-content:start;gap:.75rem;padding:.75rem 1rem}.sdc-card__icon{min-width:2.9rem;min-height:2.9rem;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}.sdc-card__body{padding:8px}.sdc-card__title{font-size:1.4rem;font-weight:600;width:100%;white-space:wrap;overflow:hidden;text-overflow:ellipsis}.sdc-card__subtitle{margin-top:.25rem;font-weight:700;font-size:.775rem;color:var(--sdc-muted, #475569);display:flex;justify-content:space-between}.sdc-card__content{margin-top:.5rem}.sdc-card__description{text-align:justify;overflow:hidden}.sdc-card__tags{margin-top:.5rem;display:flex;gap:.5rem;flex-wrap:wrap}.sdc-card__footer{margin-top:auto;padding:.75rem 1rem;display:flex;align-items:center;justify-content:center;gap:.5rem;min-height:3rem}\n"] }]
|
|
2568
2696
|
}], propDecorators: { data: [{
|
|
2569
2697
|
type: Input
|
|
2570
2698
|
}], options: [{
|
|
@@ -2694,6 +2822,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2694
2822
|
type: Output
|
|
2695
2823
|
}] } });
|
|
2696
2824
|
|
|
2825
|
+
class SelectButtonComponent {
|
|
2826
|
+
cdr;
|
|
2827
|
+
items = [];
|
|
2828
|
+
multiple = false;
|
|
2829
|
+
compareWith = (a, b) => ("value" in a && "value" in b ? a.value === b.value : this._deepEqual(a, b));
|
|
2830
|
+
itemSelected = new EventEmitter();
|
|
2831
|
+
itemClicked = new EventEmitter();
|
|
2832
|
+
disabled = false;
|
|
2833
|
+
activeItems = new Set();
|
|
2834
|
+
onChange;
|
|
2835
|
+
onTouched;
|
|
2836
|
+
constructor(cdr) {
|
|
2837
|
+
this.cdr = cdr;
|
|
2838
|
+
}
|
|
2839
|
+
// CVA
|
|
2840
|
+
writeValue(value) {
|
|
2841
|
+
this.activeItems.clear();
|
|
2842
|
+
if (value != null) {
|
|
2843
|
+
const ensureMatch = (v) => {
|
|
2844
|
+
for (const it of this.items) {
|
|
2845
|
+
if (this.compareWith(v, it)) {
|
|
2846
|
+
this.activeItems.add(it);
|
|
2847
|
+
break;
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
};
|
|
2851
|
+
Array.isArray(value) ? value.forEach(ensureMatch) : ensureMatch(value);
|
|
2852
|
+
}
|
|
2853
|
+
this.cdr.markForCheck();
|
|
2854
|
+
}
|
|
2855
|
+
registerOnChange(fn) { this.onChange = fn; }
|
|
2856
|
+
registerOnTouched(fn) { this.onTouched = fn; }
|
|
2857
|
+
setDisabledState(disabled) { this.disabled = disabled; this.cdr.markForCheck(); }
|
|
2858
|
+
// UI
|
|
2859
|
+
onItemSelect(item) {
|
|
2860
|
+
if (this.disabled || item.disabled)
|
|
2861
|
+
return;
|
|
2862
|
+
this.itemClicked.emit(item);
|
|
2863
|
+
if (this.multiple) {
|
|
2864
|
+
this.isActive(item) ? this._deleteByCompare(item) : this._addByRef(item);
|
|
2865
|
+
}
|
|
2866
|
+
else {
|
|
2867
|
+
this.activeItems.clear();
|
|
2868
|
+
this._addByRef(item);
|
|
2869
|
+
}
|
|
2870
|
+
const arr = this._asArray();
|
|
2871
|
+
this.itemSelected.emit(arr);
|
|
2872
|
+
this.onChange?.(arr);
|
|
2873
|
+
this.onTouched?.();
|
|
2874
|
+
this.cdr.markForCheck();
|
|
2875
|
+
}
|
|
2876
|
+
isActive(item) {
|
|
2877
|
+
for (const it of this.activeItems)
|
|
2878
|
+
if (this.compareWith(item, it))
|
|
2879
|
+
return true;
|
|
2880
|
+
return false;
|
|
2881
|
+
}
|
|
2882
|
+
trackByIndex = (i) => i;
|
|
2883
|
+
// helpers
|
|
2884
|
+
_addByRef(item) { this.activeItems.add(item); }
|
|
2885
|
+
_deleteByCompare(item) {
|
|
2886
|
+
for (const it of Array.from(this.activeItems))
|
|
2887
|
+
if (this.compareWith(item, it)) {
|
|
2888
|
+
this.activeItems.delete(it);
|
|
2889
|
+
break;
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
_asArray() { return [...this.activeItems]; }
|
|
2893
|
+
_deepEqual(a, b) {
|
|
2894
|
+
if (a === b)
|
|
2895
|
+
return true;
|
|
2896
|
+
if (a == null || b == null || typeof a !== "object" || typeof b !== "object")
|
|
2897
|
+
return false;
|
|
2898
|
+
if (Array.isArray(a) !== Array.isArray(b))
|
|
2899
|
+
return false;
|
|
2900
|
+
const ka = Object.keys(a), kb = Object.keys(b);
|
|
2901
|
+
if (ka.length !== kb.length)
|
|
2902
|
+
return false;
|
|
2903
|
+
for (const k of ka)
|
|
2904
|
+
if (!kb.includes(k) || !this._deepEqual(a[k], b[k]))
|
|
2905
|
+
return false;
|
|
2906
|
+
return true;
|
|
2907
|
+
}
|
|
2908
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectButtonComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2909
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: SelectButtonComponent, isStandalone: true, selector: "sdc-select-button", inputs: { items: "items", multiple: "multiple", compareWith: "compareWith" }, outputs: { itemSelected: "itemSelected", itemClicked: "itemClicked" }, providers: [
|
|
2910
|
+
{
|
|
2911
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2912
|
+
useExisting: forwardRef(() => SelectButtonComponent),
|
|
2913
|
+
multi: true,
|
|
2914
|
+
},
|
|
2915
|
+
], ngImport: i0, template: "<div\n class=\"select-button\"\n [ngClass]=\"{ 'select-button--disabled': disabled }\"\n role=\"group\"\n [attr.aria-disabled]=\"disabled\">\n <button\n type=\"button\"\n class=\"select-button-item\"\n *ngFor=\"let item of items; index as i; trackBy: trackByIndex\"\n [ngClass]=\"{\n 'select-button-item--active': isActive(item),\n 'select-button-item--disabled': disabled || item.disabled,\n 'select-button-item--first': i === 0,\n 'select-button-item--last': i === items.length - 1\n }\"\n [attr.aria-pressed]=\"isActive(item)\"\n [disabled]=\"disabled || item.disabled\"\n (click)=\"onItemSelect(item)\">\n <span class=\"select-button-item__label\">{{ item.label }}</span>\n </button>\n</div>\n", styles: [".select-button{display:inline-flex;align-items:stretch}.select-button--disabled{pointer-events:none;opacity:.6}.select-button-item{padding:8px 12px;cursor:pointer;background-color:#fff;border:none;border-left:1px solid #c1c1cc;border-top:1px solid #c1c1cc;border-bottom:1px solid #c1c1cc}.select-button-item__label{font-family:Open Sans,sans-serif;font-size:14px}.select-button-item:not(.select-button-item--disabled):not(.select-button-item--active):hover{background-color:#eeebf2}.select-button-item--active,.select-button-item--active:hover{background-color:#c1c1cc;font-weight:700}.select-button-item--disabled{opacity:.5;cursor:default}.select-button-item--first{border-top-left-radius:2px;border-bottom-left-radius:2px}.select-button-item--last{border-right:1px solid #c1c1cc;border-top-right-radius:2px;border-bottom-right-radius:2px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2916
|
+
}
|
|
2917
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectButtonComponent, decorators: [{
|
|
2918
|
+
type: Component,
|
|
2919
|
+
args: [{ selector: "sdc-select-button", standalone: true, imports: [CommonModule], providers: [
|
|
2920
|
+
{
|
|
2921
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2922
|
+
useExisting: forwardRef(() => SelectButtonComponent),
|
|
2923
|
+
multi: true,
|
|
2924
|
+
},
|
|
2925
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"select-button\"\n [ngClass]=\"{ 'select-button--disabled': disabled }\"\n role=\"group\"\n [attr.aria-disabled]=\"disabled\">\n <button\n type=\"button\"\n class=\"select-button-item\"\n *ngFor=\"let item of items; index as i; trackBy: trackByIndex\"\n [ngClass]=\"{\n 'select-button-item--active': isActive(item),\n 'select-button-item--disabled': disabled || item.disabled,\n 'select-button-item--first': i === 0,\n 'select-button-item--last': i === items.length - 1\n }\"\n [attr.aria-pressed]=\"isActive(item)\"\n [disabled]=\"disabled || item.disabled\"\n (click)=\"onItemSelect(item)\">\n <span class=\"select-button-item__label\">{{ item.label }}</span>\n </button>\n</div>\n", styles: [".select-button{display:inline-flex;align-items:stretch}.select-button--disabled{pointer-events:none;opacity:.6}.select-button-item{padding:8px 12px;cursor:pointer;background-color:#fff;border:none;border-left:1px solid #c1c1cc;border-top:1px solid #c1c1cc;border-bottom:1px solid #c1c1cc}.select-button-item__label{font-family:Open Sans,sans-serif;font-size:14px}.select-button-item:not(.select-button-item--disabled):not(.select-button-item--active):hover{background-color:#eeebf2}.select-button-item--active,.select-button-item--active:hover{background-color:#c1c1cc;font-weight:700}.select-button-item--disabled{opacity:.5;cursor:default}.select-button-item--first{border-top-left-radius:2px;border-bottom-left-radius:2px}.select-button-item--last{border-right:1px solid #c1c1cc;border-top-right-radius:2px;border-bottom-right-radius:2px}\n"] }]
|
|
2926
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { items: [{
|
|
2927
|
+
type: Input
|
|
2928
|
+
}], multiple: [{
|
|
2929
|
+
type: Input
|
|
2930
|
+
}], compareWith: [{
|
|
2931
|
+
type: Input
|
|
2932
|
+
}], itemSelected: [{
|
|
2933
|
+
type: Output
|
|
2934
|
+
}], itemClicked: [{
|
|
2935
|
+
type: Output
|
|
2936
|
+
}] } });
|
|
2937
|
+
|
|
2697
2938
|
class RowCardComponent {
|
|
2698
2939
|
data;
|
|
2699
2940
|
options;
|
|
@@ -3103,5 +3344,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
3103
3344
|
* Generated bundle index. Do not edit.
|
|
3104
3345
|
*/
|
|
3105
3346
|
|
|
3106
|
-
export { ButtonComponent, CONSTANTS, CardListComponent, CheckboxComponent, ComboboxComponent, ConfirmComponent, DEFAULT_CARD_LIST_OPTIONS, DEFAULT_ROW_CARD_LIST_OPTIONS, DEFAULT_TABLE_OPTIONS, FiltersComponent, HyperlinkComponent, ListComponent, ModalComponent, ModalcComponent, PaginatorComponent, PanelComponent, RowCardListComponent, SQL_HELPER, ScaffoldComponent, SearchboxComponent, SidebarComponent, SpinnerComponent, SpinnerService,
|
|
3347
|
+
export { ButtonComponent, CONSTANTS, CardListComponent, CheckboxComponent, CodeEditorComponent, ComboboxComponent, ConfirmComponent, DEFAULT_CARD_LIST_OPTIONS, DEFAULT_ROW_CARD_LIST_OPTIONS, DEFAULT_TABLE_OPTIONS, FiltersComponent, HyperlinkComponent, ListComponent, ModalComponent, ModalcComponent, PaginatorComponent, PanelComponent, RowCardListComponent, SQL_HELPER, ScaffoldComponent, SearchboxComponent, SelectButtonComponent, SidebarComponent, SpinnerComponent, SpinnerService, TabComponent, TabItemComponent, TableComponent, TextboxComponent, ToastComponent, ToastService, createSqlAutoCompletionHadler, fixComboBoxOverlay, fixDialogMask, getDimensionStyles, isDesktop, isMobile, isTablet, mockRowCardList, provideDataCoreLib, provideGlobalStyles, provideTranslations, range, serviceProviders, sqlDomainFilterDecorator, sqlFormatterHandler, sqlUppercaseHandler };
|
|
3107
3348
|
//# sourceMappingURL=seniorsistemas-data-seniorx-core.mjs.map
|