ngx-dsxlibrary 2.21.64 → 2.21.65

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.
@@ -5114,13 +5114,26 @@ class JsonValuesDebujComponent {
5114
5114
  id = uid();
5115
5115
  subscription;
5116
5116
  changesCount = 0;
5117
+ // Computed que indica si debemos mostrar debug
5118
+ get shouldDebug() {
5119
+ // Si debug está explícitamente true, mostrar
5120
+ if (this.debug())
5121
+ return true;
5122
+ // Si está en modo desarrollo y debug no es false, mostrar
5123
+ if (isDevMode() && this.debug() !== false)
5124
+ return true;
5125
+ // En cualquier otro caso, no mostrar
5126
+ return false;
5127
+ }
5117
5128
  constructor() {
5118
- console.log('CONSTRUCTOR', this.id);
5129
+ if (this.shouldDebug) {
5130
+ console.log('CONSTRUCTOR', this.id);
5131
+ }
5119
5132
  effect((onCleanup) => {
5120
5133
  const form = this.form();
5121
5134
  if (!form)
5122
5135
  return; // 👈 CLAVE
5123
- if (this.debug()) {
5136
+ if (this.shouldDebug) {
5124
5137
  console.log(`[json-debug:${this.id}] EFFECT INIT`, {
5125
5138
  controls: Object.keys(form.controls).length,
5126
5139
  });
@@ -5129,6 +5142,9 @@ class JsonValuesDebujComponent {
5129
5142
  this.debugValue.set(form.getRawValue());
5130
5143
  this.subscription = form.valueChanges.subscribe(() => {
5131
5144
  this.debugValue.set(form.getRawValue());
5145
+ if (this.shouldDebug) {
5146
+ this.changesCount++;
5147
+ }
5132
5148
  });
5133
5149
  onCleanup(() => {
5134
5150
  this.subscription?.unsubscribe();
@@ -5136,20 +5152,22 @@ class JsonValuesDebujComponent {
5136
5152
  });
5137
5153
  }
5138
5154
  ngOnDestroy() {
5139
- console.log('DESTROY', this.id);
5155
+ if (this.shouldDebug) {
5156
+ console.log('DESTROY', this.id);
5157
+ }
5140
5158
  this.subscription?.unsubscribe();
5141
- if (this.debug()) {
5159
+ if (this.shouldDebug) {
5142
5160
  console.log(`[json-debug:${this.id}] DESTROY`, {
5143
5161
  totalChanges: this.changesCount,
5144
5162
  });
5145
5163
  }
5146
5164
  }
5147
5165
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: JsonValuesDebujComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5148
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: JsonValuesDebujComponent, isStandalone: true, selector: "app-json-values-debuj", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (form()) {\r\n <div class=\"custom-container\">\r\n <pre class=\"custom-pre\" [innerHTML]=\"debugValue() | jsonHighlight\"></pre>\r\n </div>\r\n}\r\n", styles: [".custom-container{width:100%;overflow:auto;max-height:700px;background:#1e1e1e;border:1px solid #333;border-radius:8px;padding:1rem;margin-bottom:1rem}.custom-pre{margin:0;white-space:pre-wrap;word-break:break-word;font-family:Consolas,Monaco,Courier New,monospace;font-size:13px;line-height:1.55;color:#d4d4d4}.json-key{color:#9cdcfe;font-weight:600}.json-string{color:#ce9178}.json-number{color:#b5cea8;font-weight:600}.json-boolean{color:#569cd6;font-weight:700}.json-null{color:gray;font-style:italic}.json-bracket{color:gold;font-weight:700}.json-colon{color:#d4d4d4}.json-comma{color:gray}.json-date-part{color:#4fc1ff;font-weight:600}.json-date-sep{color:gray}.json-date-time{color:#c586c0}.custom-container::-webkit-scrollbar{width:10px;height:10px}.custom-container::-webkit-scrollbar-track{background:#252526}.custom-container::-webkit-scrollbar-thumb{background:#555;border-radius:6px}.custom-container::-webkit-scrollbar-thumb:hover{background:#777}\n"], dependencies: [{ kind: "pipe", type: JsonHighlightPipe, name: "jsonHighlight" }], encapsulation: i0.ViewEncapsulation.None });
5166
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: JsonValuesDebujComponent, isStandalone: true, selector: "app-json-values-debuj", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (form() && shouldDebug) {\r\n <div class=\"custom-container\">\r\n <pre class=\"custom-pre\" [innerHTML]=\"debugValue() | jsonHighlight\"></pre>\r\n </div>\r\n}\r\n", styles: [".custom-container{width:100%;overflow:auto;max-height:700px;background:#1e1e1e;border:1px solid #333;border-radius:8px;padding:1rem;margin-bottom:1rem}.custom-pre{margin:0;white-space:pre-wrap;word-break:break-word;font-family:Consolas,Monaco,Courier New,monospace;font-size:13px;line-height:1.55;color:#d4d4d4}.json-key{color:#9cdcfe;font-weight:600}.json-string{color:#ce9178}.json-number{color:#b5cea8;font-weight:600}.json-boolean{color:#569cd6;font-weight:700}.json-null{color:gray;font-style:italic}.json-bracket{color:gold;font-weight:700}.json-colon{color:#d4d4d4}.json-comma{color:gray}.json-date-part{color:#4fc1ff;font-weight:600}.json-date-sep{color:gray}.json-date-time{color:#c586c0}.custom-container::-webkit-scrollbar{width:10px;height:10px}.custom-container::-webkit-scrollbar-track{background:#252526}.custom-container::-webkit-scrollbar-thumb{background:#555;border-radius:6px}.custom-container::-webkit-scrollbar-thumb:hover{background:#777}\n"], dependencies: [{ kind: "pipe", type: JsonHighlightPipe, name: "jsonHighlight" }], encapsulation: i0.ViewEncapsulation.None });
5149
5167
  }
5150
5168
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: JsonValuesDebujComponent, decorators: [{
5151
5169
  type: Component,
5152
- args: [{ selector: 'app-json-values-debuj', standalone: true, imports: [JsonHighlightPipe], encapsulation: ViewEncapsulation.None, template: "@if (form()) {\r\n <div class=\"custom-container\">\r\n <pre class=\"custom-pre\" [innerHTML]=\"debugValue() | jsonHighlight\"></pre>\r\n </div>\r\n}\r\n", styles: [".custom-container{width:100%;overflow:auto;max-height:700px;background:#1e1e1e;border:1px solid #333;border-radius:8px;padding:1rem;margin-bottom:1rem}.custom-pre{margin:0;white-space:pre-wrap;word-break:break-word;font-family:Consolas,Monaco,Courier New,monospace;font-size:13px;line-height:1.55;color:#d4d4d4}.json-key{color:#9cdcfe;font-weight:600}.json-string{color:#ce9178}.json-number{color:#b5cea8;font-weight:600}.json-boolean{color:#569cd6;font-weight:700}.json-null{color:gray;font-style:italic}.json-bracket{color:gold;font-weight:700}.json-colon{color:#d4d4d4}.json-comma{color:gray}.json-date-part{color:#4fc1ff;font-weight:600}.json-date-sep{color:gray}.json-date-time{color:#c586c0}.custom-container::-webkit-scrollbar{width:10px;height:10px}.custom-container::-webkit-scrollbar-track{background:#252526}.custom-container::-webkit-scrollbar-thumb{background:#555;border-radius:6px}.custom-container::-webkit-scrollbar-thumb:hover{background:#777}\n"] }]
5170
+ args: [{ selector: 'app-json-values-debuj', standalone: true, imports: [JsonHighlightPipe], encapsulation: ViewEncapsulation.None, template: "@if (form() && shouldDebug) {\r\n <div class=\"custom-container\">\r\n <pre class=\"custom-pre\" [innerHTML]=\"debugValue() | jsonHighlight\"></pre>\r\n </div>\r\n}\r\n", styles: [".custom-container{width:100%;overflow:auto;max-height:700px;background:#1e1e1e;border:1px solid #333;border-radius:8px;padding:1rem;margin-bottom:1rem}.custom-pre{margin:0;white-space:pre-wrap;word-break:break-word;font-family:Consolas,Monaco,Courier New,monospace;font-size:13px;line-height:1.55;color:#d4d4d4}.json-key{color:#9cdcfe;font-weight:600}.json-string{color:#ce9178}.json-number{color:#b5cea8;font-weight:600}.json-boolean{color:#569cd6;font-weight:700}.json-null{color:gray;font-style:italic}.json-bracket{color:gold;font-weight:700}.json-colon{color:#d4d4d4}.json-comma{color:gray}.json-date-part{color:#4fc1ff;font-weight:600}.json-date-sep{color:gray}.json-date-time{color:#c586c0}.custom-container::-webkit-scrollbar{width:10px;height:10px}.custom-container::-webkit-scrollbar-track{background:#252526}.custom-container::-webkit-scrollbar-thumb{background:#555;border-radius:6px}.custom-container::-webkit-scrollbar-thumb:hover{background:#777}\n"] }]
5153
5171
  }], ctorParameters: () => [], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], debug: [{ type: i0.Input, args: [{ isSignal: true, alias: "debug", required: false }] }] } });
5154
5172
 
5155
5173
  class IcoLabel {