tailjng 0.0.2 → 0.0.4

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.
@@ -12,15 +12,6 @@ import * as i1$2 from '@angular/common/http';
12
12
  import { HttpParams } from '@angular/common/http';
13
13
  import { formatDistanceToNowStrict } from 'date-fns';
14
14
  import { es } from 'date-fns/locale';
15
- import 'highlight.js/styles/github-dark.css';
16
- import hljs from 'highlight.js/lib/core';
17
- import javascript from 'highlight.js/lib/languages/javascript';
18
- import typescript from 'highlight.js/lib/languages/typescript';
19
- import bash from 'highlight.js/lib/languages/bash';
20
- import css from 'highlight.js/lib/languages/css';
21
- import scss from 'highlight.js/lib/languages/scss';
22
- import html from 'highlight.js/lib/languages/xml';
23
- import json from 'highlight.js/lib/languages/json';
24
15
 
25
16
  class JModeToggleComponent {
26
17
  platformId;
@@ -3854,6 +3845,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
3854
3845
  args: ['document:keydown.escape', ['$event']]
3855
3846
  }] } });
3856
3847
 
3848
+ class ErrorMessageComponent {
3849
+ control;
3850
+ errorMessages = {};
3851
+ classes = '';
3852
+ get hasErrors() {
3853
+ return !!this.control && this.control.invalid && this.control.touched;
3854
+ }
3855
+ get errors() {
3856
+ if (!this.control || !this.control.errors)
3857
+ return [];
3858
+ return Object.keys(this.control.errors)
3859
+ .filter(errorKey => this.errorMessages[errorKey])
3860
+ .map(errorKey => this.errorMessages[errorKey]);
3861
+ }
3862
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ErrorMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3863
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: ErrorMessageComponent, isStandalone: true, selector: "JErrorMessage", inputs: { control: "control", errorMessages: "errorMessages", classes: "classes" }, ngImport: i0, template: "@if (hasErrors) {\r\n<div class=\"flex flex-col text-red-600 dark:text-red-300 text-sm\">\r\n @for (message of errors; track $index) {\r\n <span [class]=\"classes\">{{ message }}</span>\r\n }\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
3864
+ }
3865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ErrorMessageComponent, decorators: [{
3866
+ type: Component,
3867
+ args: [{ selector: 'JErrorMessage', standalone: true, imports: [CommonModule], template: "@if (hasErrors) {\r\n<div class=\"flex flex-col text-red-600 dark:text-red-300 text-sm\">\r\n @for (message of errors; track $index) {\r\n <span [class]=\"classes\">{{ message }}</span>\r\n }\r\n</div>\r\n}" }]
3868
+ }], propDecorators: { control: [{
3869
+ type: Input
3870
+ }], errorMessages: [{
3871
+ type: Input
3872
+ }], classes: [{
3873
+ type: Input
3874
+ }] } });
3875
+
3857
3876
  class JTableComponent {
3858
3877
  currencyPipe;
3859
3878
  genericService;
@@ -4459,49 +4478,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
4459
4478
  type: Input
4460
4479
  }] } });
4461
4480
 
4462
- hljs.registerLanguage('ts', typescript);
4463
- hljs.registerLanguage('js', javascript);
4464
- hljs.registerLanguage('bash', bash);
4465
- hljs.registerLanguage('css', css);
4466
- hljs.registerLanguage('scss', scss);
4467
- hljs.registerLanguage('html', html);
4468
- hljs.registerLanguage('json', json);
4469
- class JCodeBlockComponent {
4470
- icons = {
4471
- copy: Copy,
4472
- check: Check
4473
- };
4474
- copied = false;
4475
- code = '';
4476
- language = 'ts';
4477
- codeRef;
4478
- highlightedCode = '';
4479
- ngAfterViewInit() {
4480
- this.codeRef.nativeElement.textContent = this.code;
4481
- hljs.highlightElement(this.codeRef.nativeElement);
4482
- }
4483
- copyCode() {
4484
- navigator.clipboard.writeText(this.code).then(() => {
4485
- console.log('Copiado al portapapeles');
4486
- });
4487
- this.copied = true;
4488
- setTimeout(() => (this.copied = false), 2000);
4489
- }
4490
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: JCodeBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4491
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: JCodeBlockComponent, isStandalone: true, selector: "JCodeBlock", inputs: { code: "code", language: "language" }, viewQueries: [{ propertyName: "codeRef", first: true, predicate: ["codeRef"], descendants: true }], ngImport: i0, template: "<div class=\"relative rounded bg-foreground pl-5 pt-3 m-0 border border-border dark:border-dark-border\">\r\n <div class=\"absolute top-4 right-4\">\r\n <JButton (clicked)=\"copyCode()\" [icon]=\"icons['copy']\" [iconChange]=\"icons['check']\"\r\n [isChangeIcon]=\"copied\" [iconSize]=\"15\" tooltip=\"Copiar\" classes=\"w-[25px] h-[25px] text-white\" />\r\n </div>\r\n <pre class=\"p-5\">\r\n <code #codeRef class=\"language-{{language}}\"></code>\r\n </pre>\r\n</div>", styles: ["pre,code{margin:0!important;padding:0!important;background:transparent!important;line-height:1.5;font-size:.85rem}.hljs{background:transparent!important;border-radius:0!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: JButtonComponent, selector: "JButton", inputs: ["type", "disabled", "isLoading", "icon", "iconSize", "text", "isChangeIcon", "iconChange", "tooltip", "tooltipPosition", "classes", "ngClasses"], outputs: ["clicked"] }] });
4492
- }
4493
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: JCodeBlockComponent, decorators: [{
4494
- type: Component,
4495
- args: [{ selector: 'JCodeBlock', imports: [CommonModule, JButtonComponent], template: "<div class=\"relative rounded bg-foreground pl-5 pt-3 m-0 border border-border dark:border-dark-border\">\r\n <div class=\"absolute top-4 right-4\">\r\n <JButton (clicked)=\"copyCode()\" [icon]=\"icons['copy']\" [iconChange]=\"icons['check']\"\r\n [isChangeIcon]=\"copied\" [iconSize]=\"15\" tooltip=\"Copiar\" classes=\"w-[25px] h-[25px] text-white\" />\r\n </div>\r\n <pre class=\"p-5\">\r\n <code #codeRef class=\"language-{{language}}\"></code>\r\n </pre>\r\n</div>", styles: ["pre,code{margin:0!important;padding:0!important;background:transparent!important;line-height:1.5;font-size:.85rem}.hljs{background:transparent!important;border-radius:0!important}\n"] }]
4496
- }], propDecorators: { code: [{
4497
- type: Input
4498
- }], language: [{
4499
- type: Input
4500
- }], codeRef: [{
4501
- type: ViewChild,
4502
- args: ['codeRef']
4503
- }] } });
4504
-
4505
4481
  // =======================================
4506
4482
  // Publicar libreria
4507
4483
  // =======================================
@@ -4519,5 +4495,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
4519
4495
  * Generated bundle index. Do not edit.
4520
4496
  */
4521
4497
 
4522
- export { API_URL, CardComponent, JAlertDialogComponent, JAlertDialogService, JAlertToastComponent, JAlertToastService, JButtonComponent, JCheckboxComponent, JCodeBlockComponent, JDialogComponent, JDialogShared, JErrorHandlerService, JFilterComponent, JFormComponent, JFormShared, JGenericService, JHttpParamsService, JInputComponent, JLabelComponent, JModeToggleComponent, JPaginatorComponent, JSelectComponent, JTableComponent, JThemeComponent, JToggleRadioComponent, JTooltipModule };
4498
+ export { API_URL, CardComponent, ErrorMessageComponent, JAlertDialogComponent, JAlertDialogService, JAlertToastComponent, JAlertToastService, JButtonComponent, JCheckboxComponent, JContentFormComponent, JDialogComponent, JDialogShared, JErrorHandlerService, JFilterComponent, JFormComponent, JFormShared, JGenericService, JHttpParamsService, JInputComponent, JLabelComponent, JModeToggleComponent, JPaginatorComponent, JSelectComponent, JTableComponent, JThemeComponent, JToggleRadioComponent, JTooltipModule };
4523
4499
  //# sourceMappingURL=tailjng.mjs.map