Skip to content

Commit

Permalink
fix: 还原menu以外的代码,删掉log
Browse files Browse the repository at this point in the history
  • Loading branch information
lycHub committed Oct 27, 2023
1 parent ee8a493 commit 96a6a8d
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 56 deletions.
22 changes: 0 additions & 22 deletions devui/menu/demo/loop/loop.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,4 @@ const MENUS: MenuItemType[] = [
export class LoopComponent {
menus = MENUS;
collapsed = false;
openKeys: string[] = [];
activeKey = '';

openChange(open: boolean, key: string) {
if (open) {
this.openKeys.push(key);
} else {
this.openKeys = this.openKeys.filter(item => item !== key);
}
}

itemClick(key: string) {
this.activeKey = key;
}

menuItemClick(event: MenuItemClickType) {
console.log('menuItemClick', event);
}

trackByMenu(_: number, item: MenuItemType) {
return item.key;
}
}
1 change: 0 additions & 1 deletion devui/menu/note.txt

This file was deleted.

5 changes: 1 addition & 4 deletions devui/menu/sub-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ export class SubMenuComponent implements OnInit, AfterContentInit {
const currentActive$ = this.submenuService.childActive$;
combineLatest([this.submenuService.parentSubMenuActive$, currentActive$])
.pipe(
map((([parentActive, currentActive]) => {
// console.log('map active', parentActive, currentActive)
return parentActive || currentActive;
})),
map((([parentActive, currentActive]) => parentActive || currentActive)),
distinctUntilChanged(),
takeUntilDestroyed()
).subscribe(res => {
Expand Down
1 change: 0 additions & 1 deletion devui/shared/devui-codebox/devui-codebox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export class DevuiCodeboxComponent implements OnInit {
if (ide === 'StackBlitz') {
this.onlineIdeService.openOnStackBlitz(this.sourceData);
} else {
console.log('this.sourceData', this.sourceData);
this.onlineIdeService.openOnCodeSandbox(this.sourceData);
}
}
Expand Down
1 change: 0 additions & 1 deletion devui/shared/devui-online-ide/devui-online-ide.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class DevuiOnlineIdeService {
}

getFiles(sourceData: DevuiSourceData[], ide: 'StackBlitz' | 'CodeSandbox' = 'StackBlitz'): any {
// console.log(sourceData);
const _sourceData = sourceData.map((item) => ({ ...item, code: (item.code.default || item.code) as string }));

// #region 处理Enter文件
Expand Down
28 changes: 1 addition & 27 deletions devui/utils/animations/expand-collapse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { animate, animateChild, AnimationTriggerMetadata, query, state, style, transition, trigger } from '@angular/animations';
import { animate, AnimationTriggerMetadata, state, style, transition, trigger } from '@angular/animations';
import { AnimationCurves, AnimationDuration } from './animationParameters';

const easeInOut = AnimationCurves.EASE_IN_OUT;
Expand All @@ -22,32 +22,6 @@ export const expandCollapseForDomDestroy: AnimationTriggerMetadata = trigger('co
]),
]);

/*
todo: 可作成函数指定selector eg: '.devui-sub-menu-children'
@collapseForDomDestroyWithChildren
bug:
当前是展开的情况下,
如果收起父级,再展开父级
此时再次点击当前菜单收起是不带动画的
*/
export const expandCollapseForDomDestroyWithChildren: AnimationTriggerMetadata = trigger('collapseForDomDestroyWithChildren', [
transition(':enter', [
style({ opacity: 0, height: 0, overflow: 'hidden' }),
animate(`${duration} ${easeInOut}`, style({ opacity: 1, height: '*', overflow: 'hidden' })),
query('@collapseForDomDestroyWithChildren', animateChild({
delay: duration
}), { optional: true })
]),
transition(':leave', [
style({ opacity: 1, height: '*', overflow: 'hidden' }),
animate(`${duration} ${easeInOut}`, style({ opacity: 0, height: 0, overflow: 'hidden' })),
query('@collapseForDomDestroyWithChildren', animateChild({
delay: duration
}), { optional: true })
]),
]);


export const collapseMotion: AnimationTriggerMetadata = trigger('collapseMotion', [
state('expanded', style({ height: '*' })),
state('collapsed', style({ height: 0 })), // overflow: 'hidden'
Expand Down

0 comments on commit 96a6a8d

Please sign in to comment.