@dotglitch/ngx-common 1.0.28 → 1.0.30

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.
@@ -29,6 +29,8 @@ import 'tabulator-tables';
29
29
  import '@angular/material/progress-bar';
30
30
  import '@angular/material/expansion';
31
31
  import 'path-browserify';
32
+ import 'react';
33
+ import 'react-dom/client';
32
34
 
33
35
  class FolderRenameComponent {
34
36
  constructor(dialog, fetch) {
@@ -75,4 +77,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
75
77
  }] } });
76
78
 
77
79
  export { FolderRenameComponent };
78
- //# sourceMappingURL=dotglitch-ngx-common-folder-rename.component-ba3ebd0a.mjs.map
80
+ //# sourceMappingURL=dotglitch-ngx-common-folder-rename.component-31a34e6e.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dotglitch-ngx-common-folder-rename.component-31a34e6e.mjs","sources":["../../../packages/common/src/components/filemanager/folder-rename/folder-rename.component.ts","../../../packages/common/src/components/filemanager/folder-rename/folder-rename.component.html"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { NgxFileManagerConfiguration } from '../filemanager.component';\nimport { Fetch } from '../../../public-api';\n\n@Component({\n selector: 'app-folder-rename',\n templateUrl: './folder-rename.component.html',\n styleUrls: ['./folder-rename.component.scss'],\n imports: [\n MatInputModule,\n MatIconModule,\n MatButtonModule,\n FormsModule\n ],\n standalone: true\n})\nexport class FolderRenameComponent implements OnInit {\n\n @Input() path: string;\n @Input() name: string = '';\n @Input() config: NgxFileManagerConfiguration;\n\n isRename = false;\n\n constructor(\n public dialog: MatDialogRef<any>,\n private fetch: Fetch\n ) { }\n\n ngOnInit() {\n this.isRename = this.name.length > 0;\n }\n\n onSave() {\n if (this.isRename) {\n const url = this.config.apiSettings.renameEntryUrlTemplate\n ? this.config.apiSettings.renameEntryUrlTemplate(this.path + this.name)\n : this.config.apiSettings.renameEntryUrl\n\n this.fetch.post(url, { path: this.path + '/' + this.name });\n }\n else {\n const url = this.config.apiSettings.createDirectoryUrlTemplate\n ? this.config.apiSettings.createDirectoryUrlTemplate(this.path + this.name)\n : this.config.apiSettings.createDirectoryUrl\n\n this.fetch.post(url, {path: this.path +'/'+ this.name});\n }\n this.dialog.close(true);\n }\n}\n","<mat-form-field style=\"width: 280px;\">\n <mat-label>Name</mat-label>\n <input matInput type=\"text\" [(ngModel)]=\"name\" (keyup)=\"$event.key == 'Enter' && onSave()\">\n</mat-form-field>\n\n<div style=\"align-self: end;\">\n <button mat-flat-button (click)=\"onSave()\"><mat-icon>check</mat-icon>Ok</button>\n <button mat-flat-button (click)=\"dialog.close()\"><mat-icon>cancel</mat-icon>Cancel</button>\n</div>\n"],"names":["i2.Fetch","i6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBa,qBAAqB,CAAA;IAQ9B,WACW,CAAA,MAAyB,EACxB,KAAY,EAAA;QADb,IAAM,CAAA,MAAA,GAAN,MAAM,CAAmB;QACxB,IAAK,CAAA,KAAA,GAAL,KAAK,CAAO;QAPf,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QAG3B,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;KAKZ;IAEL,QAAQ,GAAA;QACJ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;KACxC;IAED,MAAM,GAAA;QACF,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB;AACtD,kBAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,GAAG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QAAA,EAAA,8aAAA,EAAA,MAAA,EAAA,CAAA,0DAAA,CAAA,EAAA,CAAA;oHAIP,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBACG,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBACG,MAAM,EAAA,CAAA;sBAAd,KAAK;;;;;"}
@@ -37,6 +37,8 @@ import { MatButtonModule } from '@angular/material/button';
37
37
  import * as i2$3 from '@angular/material/expansion';
38
38
  import { MatExpansionModule } from '@angular/material/expansion';
39
39
  import * as path from 'path-browserify';
40
+ import * as React from 'react';
41
+ import { createRoot } from 'react-dom/client';
40
42
 
41
43
  /**
42
44
  * This utils file exists outside of the strict angular DI zone
@@ -528,8 +530,8 @@ class MenuComponent {
528
530
  typeof i['shortcut'] == "string" &&
529
531
  i['shortcut'].length > 2);
530
532
  if (this.ownerCords) {
531
- const selfY = parseInt(this.selfCords.top.replace('px', ''));
532
- const selfX = parseInt(this.selfCords.left.replace('px', ''));
533
+ const selfY = parseInt(this.selfCords.top?.replace('px', '') || '0');
534
+ const selfX = parseInt(this.selfCords.left?.replace('px', '') || '0');
533
535
  this.coverRectCords = {
534
536
  top: this.ownerCords.y - selfY - 16,
535
537
  left: this.ownerCords.x - selfX - 16,
@@ -9383,7 +9385,7 @@ class FilemanagerComponent {
9383
9385
  lazyLoader.registerComponent({
9384
9386
  id: "folder-rename",
9385
9387
  group: "@dotglitch/ngx-web-components",
9386
- load: () => import('./dotglitch-ngx-common-folder-rename.component-ba3ebd0a.mjs')
9388
+ load: () => import('./dotglitch-ngx-common-folder-rename.component-31a34e6e.mjs')
9387
9389
  });
9388
9390
  this.iconResolver = new IconResolver(libConfig.assetPath);
9389
9391
  }
@@ -10440,6 +10442,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
10440
10442
  args: ['window:resize', ['$event']]
10441
10443
  }] } });
10442
10444
 
10445
+ /**
10446
+ * Extend this component to automatically generate
10447
+ * bindings to a React component.
10448
+ *
10449
+ * ! You _must_ override the property `ngReactComponent`
10450
+ * Failure to do so will result in errors
10451
+ * `override readonly ngReactComponent = ReactFlowWrappableComponent;`
10452
+ */
10453
+ class ReactMagicWrapperComponent {
10454
+ constructor(ngContainer, ngTheme) {
10455
+ this.ngContainer = ngContainer;
10456
+ this.ngTheme = ngTheme;
10457
+ this.ngSubscriptions = [
10458
+ this.ngTheme.subscribe(t => {
10459
+ this.theme = t;
10460
+ this.ngOnChanges();
10461
+ })
10462
+ ];
10463
+ if (!this.ngReactComponent)
10464
+ throw new Error("ReactMagicWrapperComponent cannot start without a provided ngReactComponent!");
10465
+ }
10466
+ ngOnInit() {
10467
+ if (!this.ngReactComponent)
10468
+ throw new Error("ReactMagicWrapperComponent cannot start without a provided ngReactComponent!");
10469
+ }
10470
+ ngOnChanges(changes) {
10471
+ this._render();
10472
+ }
10473
+ ngAfterViewInit() {
10474
+ this._render();
10475
+ }
10476
+ ngOnDestroy() {
10477
+ this._root.unmount();
10478
+ this.ngSubscriptions.forEach(s => s.unsubscribe());
10479
+ }
10480
+ _render() {
10481
+ if (!this.ngReactComponent)
10482
+ return;
10483
+ if (!this._root) {
10484
+ this._root = createRoot(this.ngContainer.element.nativeElement);
10485
+ }
10486
+ // List all keys that do not start with `_` nor `ng`
10487
+ const keys = Object.keys(this).filter(k => !/^(?:_|ng)/.test(k));
10488
+ // Get all property keys from the class
10489
+ const propKeys = keys.filter(k => !k.startsWith("on"));
10490
+ // Get all event handler keys from the class
10491
+ const evtKeys = keys.filter(k => k.startsWith("on"));
10492
+ const props = {};
10493
+ // Project all key properties onto `props`
10494
+ propKeys.forEach(k => props[k] = this[k]);
10495
+ // Bind all event handlers.
10496
+ // ! important Angular uses EventEmitter, React uses
10497
+ // a different method of event binding
10498
+ evtKeys.forEach(k => props[k] = (...args) => this[k].next(args));
10499
+ this._root.render(React.createElement(this.ngReactComponent, { props: props }));
10500
+ }
10501
+ }
10502
+ ReactMagicWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ReactMagicWrapperComponent, deps: [{ token: i0.ViewContainerRef }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
10503
+ ReactMagicWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ReactMagicWrapperComponent, isStandalone: true, selector: "app-react-magic-wrapper", usesOnChanges: true, ngImport: i0, template: ``, isInline: true });
10504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ReactMagicWrapperComponent, decorators: [{
10505
+ type: Component,
10506
+ args: [{
10507
+ selector: 'app-react-magic-wrapper',
10508
+ template: ``,
10509
+ standalone: true
10510
+ }]
10511
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: ThemeService }]; } });
10512
+
10443
10513
  /*
10444
10514
  * Public API Surface of package
10445
10515
  */
@@ -10451,5 +10521,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
10451
10521
  * Generated bundle index. Do not edit.
10452
10522
  */
10453
10523
 
10454
- export { ComponentResolveStrategy, DependencyService, DialogService, DynamicHTMLComponent, DynamicHTMLOptions, DynamicHTMLRenderer, Fetch, FileService, FilemanagerComponent, HtmlBypass, KeyboardService, LazyLoaderComponent, LazyLoaderModule, LazyLoaderService, MenuDirective, NGX_DYNAMIC_CONFIG, NGX_LAZY_LOADER_CONFIG, NGX_WEB_COMPONENTS_CONFIG, NavigationService, NgxDynamicHTMLModule, OnMount, ResourceBypass, ScriptBypass, StyleBypass, TabulatorComponent, ThemeService, TooltipDirective, UrlBypass, VscodeComponent, openMenu, openTooltip };
10524
+ export { ComponentResolveStrategy, DependencyService, DialogService, DynamicHTMLComponent, DynamicHTMLOptions, DynamicHTMLRenderer, Fetch, FileService, FilemanagerComponent, HtmlBypass, KeyboardService, LazyLoaderComponent, LazyLoaderModule, LazyLoaderService, MenuDirective, NGX_DYNAMIC_CONFIG, NGX_LAZY_LOADER_CONFIG, NGX_WEB_COMPONENTS_CONFIG, NavigationService, NgxDynamicHTMLModule, OnMount, ReactMagicWrapperComponent, ResourceBypass, ScriptBypass, StyleBypass, TabulatorComponent, ThemeService, TooltipDirective, UrlBypass, VscodeComponent, openMenu, openTooltip };
10455
10525
  //# sourceMappingURL=dotglitch-ngx-common.mjs.map