orbiq-neural-ui-kit 1.2.56 → 1.2.58

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.
@@ -14774,25 +14774,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
14774
14774
  }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], appIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "appIcon", required: true }] }], iconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconClass", required: false }] }], menuOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuOptions", required: false }] }] } });
14775
14775
 
14776
14776
  class NeuralAppLauncherComponent {
14777
+ router;
14777
14778
  openModel = model(false, /* @ts-ignore */
14778
14779
  ...(ngDevMode ? [{ debugName: "openModel" }] : /* istanbul ignore next */ []));
14779
14780
  modules = input([], /* @ts-ignore */
14780
14781
  ...(ngDevMode ? [{ debugName: "modules" }] : /* istanbul ignore next */ []));
14781
- handleModuleClick() {
14782
- this.openModel.set(false);
14782
+ path = signal([], /* @ts-ignore */
14783
+ ...(ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []));
14784
+ constructor(router) {
14785
+ this.router = router;
14786
+ // Reset path when modal closes
14787
+ effect(() => {
14788
+ if (!this.openModel()) {
14789
+ setTimeout(() => this.path.set([]), 200); // delay reset to allow close animation
14790
+ }
14791
+ });
14792
+ }
14793
+ currentParent = computed(() => {
14794
+ const p = this.path();
14795
+ return p.length > 0 ? p[p.length - 1] : null;
14796
+ }, /* @ts-ignore */
14797
+ ...(ngDevMode ? [{ debugName: "currentParent" }] : /* istanbul ignore next */ []));
14798
+ currentModules = computed(() => {
14799
+ const parent = this.currentParent();
14800
+ return parent ? (parent.children || []) : this.modules();
14801
+ }, /* @ts-ignore */
14802
+ ...(ngDevMode ? [{ debugName: "currentModules" }] : /* istanbul ignore next */ []));
14803
+ handleModuleClick(module) {
14804
+ if (module.children && module.children.length > 0) {
14805
+ // Drill down
14806
+ this.path.update(p => [...p, module]);
14807
+ }
14808
+ else if (module.route) {
14809
+ // Navigate and close
14810
+ this.openModel.set(false);
14811
+ this.router.navigate([module.route]);
14812
+ }
14783
14813
  }
14784
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NeuralAppLauncherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
14814
+ goBack() {
14815
+ this.path.update(p => p.slice(0, -1));
14816
+ }
14817
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NeuralAppLauncherComponent, deps: [{ token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
14785
14818
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: NeuralAppLauncherComponent, isStandalone: true, selector: "neural-app-launcher", inputs: { openModel: { classPropertyName: "openModel", publicName: "openModel", isSignal: true, isRequired: false, transformFunction: null }, modules: { classPropertyName: "modules", publicName: "modules", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openModel: "openModelChange" }, ngImport: i0, template: `
14786
14819
  <neural-dialog [(openModel)]="openModel" size="4xl" [hasTitleSlot]="true" [hasDefaultSlot]="true">
14787
- <span title>Módulos de la Plataforma</span>
14820
+ <span title class="flex items-center gap-2">
14821
+ @if (path().length > 0) {
14822
+ <neural-button variant="ghost" [iconOnly]="true" icon="lucide-arrow-left" (clicked)="goBack()" class="-ml-2"></neural-button>
14823
+ <span>{{ currentParent()?.label }}</span>
14824
+ } @else {
14825
+ <span>Módulos de la Plataforma</span>
14826
+ }
14827
+ </span>
14788
14828
 
14789
- <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 p-4">
14790
- @for (module of modules(); track module.id) {
14829
+ <!-- We add a simple animation key to force re-render/animation on the grid when path changes -->
14830
+ <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 content-start gap-4 p-4 min-h-[400px] animate-in fade-in slide-in-from-bottom-2 duration-200" [attr.data-level]="path().length">
14831
+ @for (module of currentModules(); track module.id) {
14791
14832
  <div
14792
14833
  class="flex flex-col items-center justify-center p-4 rounded-xl border border-outline-gray-2 hover:shadow-md transition-all cursor-pointer bg-surface-base group"
14793
14834
  [ngClass]="module.colorClass"
14794
- [routerLink]="module.route"
14795
- (click)="handleModuleClick()"
14835
+ (click)="handleModuleClick(module)"
14796
14836
  >
14797
14837
  <div class="group-hover:scale-110 transition-transform flex items-center justify-center">
14798
14838
  <i [class]="module.icon" class="size-8 text-ink-gray-7 group-hover:text-ink-gray-9 transition-colors"></i>
@@ -14805,25 +14845,32 @@ class NeuralAppLauncherComponent {
14805
14845
  }
14806
14846
  </div>
14807
14847
  </neural-dialog>
14808
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: NeuralDialogComponent, selector: "neural-dialog", inputs: ["openModel", "title", "message", "icon", "size", "position", "paddingTop", "actions", "dismissible", "showCloseButton", "bare", "hasTitleSlot", "hasActionsSlot", "hasDefaultSlot"], outputs: ["openModelChange"] }] });
14848
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: NeuralDialogComponent, selector: "neural-dialog", inputs: ["openModel", "title", "message", "icon", "size", "position", "paddingTop", "actions", "dismissible", "showCloseButton", "bare", "hasTitleSlot", "hasActionsSlot", "hasDefaultSlot"], outputs: ["openModelChange"] }, { kind: "component", type: NeuralButtonComponent, selector: "neural-button", inputs: ["variant", "theme", "size", "type", "disabled", "loading", "icon", "iconLeft", "iconRight", "iconOnly", "shape"], outputs: ["clicked"] }] });
14809
14849
  }
14810
14850
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NeuralAppLauncherComponent, decorators: [{
14811
14851
  type: Component,
14812
14852
  args: [{
14813
14853
  selector: 'neural-app-launcher',
14814
14854
  standalone: true,
14815
- imports: [CommonModule, RouterModule, NeuralDialogComponent],
14855
+ imports: [CommonModule, RouterModule, NeuralDialogComponent, NeuralButtonComponent],
14816
14856
  template: `
14817
14857
  <neural-dialog [(openModel)]="openModel" size="4xl" [hasTitleSlot]="true" [hasDefaultSlot]="true">
14818
- <span title>Módulos de la Plataforma</span>
14858
+ <span title class="flex items-center gap-2">
14859
+ @if (path().length > 0) {
14860
+ <neural-button variant="ghost" [iconOnly]="true" icon="lucide-arrow-left" (clicked)="goBack()" class="-ml-2"></neural-button>
14861
+ <span>{{ currentParent()?.label }}</span>
14862
+ } @else {
14863
+ <span>Módulos de la Plataforma</span>
14864
+ }
14865
+ </span>
14819
14866
 
14820
- <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 p-4">
14821
- @for (module of modules(); track module.id) {
14867
+ <!-- We add a simple animation key to force re-render/animation on the grid when path changes -->
14868
+ <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 content-start gap-4 p-4 min-h-[400px] animate-in fade-in slide-in-from-bottom-2 duration-200" [attr.data-level]="path().length">
14869
+ @for (module of currentModules(); track module.id) {
14822
14870
  <div
14823
14871
  class="flex flex-col items-center justify-center p-4 rounded-xl border border-outline-gray-2 hover:shadow-md transition-all cursor-pointer bg-surface-base group"
14824
14872
  [ngClass]="module.colorClass"
14825
- [routerLink]="module.route"
14826
- (click)="handleModuleClick()"
14873
+ (click)="handleModuleClick(module)"
14827
14874
  >
14828
14875
  <div class="group-hover:scale-110 transition-transform flex items-center justify-center">
14829
14876
  <i [class]="module.icon" class="size-8 text-ink-gray-7 group-hover:text-ink-gray-9 transition-colors"></i>
@@ -14838,7 +14885,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
14838
14885
  </neural-dialog>
14839
14886
  `
14840
14887
  }]
14841
- }], propDecorators: { openModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "openModel", required: false }] }, { type: i0.Output, args: ["openModelChange"] }], modules: [{ type: i0.Input, args: [{ isSignal: true, alias: "modules", required: false }] }] } });
14888
+ }], ctorParameters: () => [{ type: i2.Router }], propDecorators: { openModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "openModel", required: false }] }, { type: i0.Output, args: ["openModelChange"] }], modules: [{ type: i0.Input, args: [{ isSignal: true, alias: "modules", required: false }] }] } });
14842
14889
 
14843
14890
  // Note: TextEditor is deprecated in Frappe UI, but migrated for faithful parity.
14844
14891
  // For new projects, consider using the /editor module with RichTextKit.