<commit_before>"use strict";

import * as m from 'mithril';
import View from './View';
import NavigationComponent from '../Component/Navigation/NavigationComponent';
import HeaderComponent from '../Component/Header/HeaderComponent';
import HeaderMenuIconComponent from '../Component/Header/HeaderMenuIconComponent';
import HeaderMenuListComponent from '../Component/Header/HeaderMenuListComponent';
import DiskMenuContentComponent from '../Component/Disk/DiskMenuContentComponent';
import DialogComponent from '../Component/Dialog/DialogComponent';
import DiskDialogComponent from '../Component/Disk/DiskDialogComponent';
import DiskDialogViewModel from '../ViewModel/Disk/DiskDialogViewModel';
import SnackbarComponent from '../Component/Snackbar/SnackbarComponent';

/**
* ParentPage View
* 親ページの View で使用される
*/
abstract class ParentPageView extends View {
    //Mithril へ渡される部分
    public abstract execute(): Mithril.VirtualElement

    /**
    * header 作成
    * @param title title
    * @param leftButton leftButton content
    */
    protected createHeader(title: string, leftButton: any[] = []): Mithril.Component<{}> {
        leftButton.push(m(new HeaderMenuIconComponent(), {
            id: ParentPageView.headerMenuId
        }));

        return m(new HeaderComponent(), {
            title: title,
            leftButton: leftButton
        });
    }

    /**
    * header メニュー作成
    * @param content メニューコンテント
    */
    protected createHeaderMenu(content: any[] = []): Mithril.Component<{}> {
        content.push(m(new DiskMenuContentComponent())); //ディスク空き容量メニュー

        return m(new HeaderMenuListComponent(), {
            id: ParentPageView.headerMenuId,
            content: content
        });
    }

    /**
    * Navigation 作成
    */
    protected createNavigation(): Mithril.Component<{}> {
        return m(new NavigationComponent())
    }

    /**
    * ディスク空き容量ダイアログ
    */
    protected createDiskDialog(): Mithril.Component<{}> {
        return m(new DialogComponent(), {
            id: DiskDialogViewModel.dialogId,
            width: 250,
            content: m(new DiskDialogComponent())
        });
    }

    /**
    * SnackbarComponent 生成
    */
    protected createSnackbar(): Mithril.Component<{}> {
        return m(new SnackbarComponent());
    }

    /**
    * main layout
    * @param content content
    */
    protected mainLayout(content: any): Mithril.VirtualElement {
        return m("main", {
            class: "fadeIn mdl-layout__content",
            oncreate: (vnode: Mithril.VnodeDOM<any, any>) => {
                this.addShowAnimetion(vnode.dom);
            }
        }, [
            m("div", {class: "page-content" }, [
                content
            ])
        ]);
    }
}

namespace ParentPageView {
    export const headerMenuId = "header_menu";
}

export default ParentPageView;
<commit_msg>fix ParentPageView<commit_after>"use strict";

import * as m from 'mithril';
import View from './View';
import NavigationComponent from '../Component/Navigation/NavigationComponent';
import HeaderComponent from '../Component/Header/HeaderComponent';
import HeaderMenuIconComponent from '../Component/Header/HeaderMenuIconComponent';
import HeaderMenuListComponent from '../Component/Header/HeaderMenuListComponent';
import DiskMenuContentComponent from '../Component/Disk/DiskMenuContentComponent';
import DialogComponent from '../Component/Dialog/DialogComponent';
import DiskDialogComponent from '../Component/Disk/DiskDialogComponent';
import DiskDialogViewModel from '../ViewModel/Disk/DiskDialogViewModel';
import SnackbarComponent from '../Component/Snackbar/SnackbarComponent';

/**
* ParentPage View
* 親ページの View で使用される
*/
abstract class ParentPageView extends View {
    private headerMenuIconComponent = new HeaderMenuIconComponent();
    private headerComponent = new HeaderComponent();
    private diskMenuContentComponent = new DiskMenuContentComponent();
    private headerMenuListComponent = new HeaderMenuListComponent();
    private navigationComponent = new NavigationComponent();
    private dialogComponent = new DialogComponent();
    private diskDialogComponent = new DiskDialogComponent();
    private snackbarComponent = new SnackbarComponent();

    //Mithril へ渡される部分
    public abstract execute(): Mithril.Vnode<any, any>

    /**
    * header 作成
    * @param title title
    * @param leftButton leftButton content
    */
    protected createHeader(title: string, leftButton: any[] = []): Mithril.Vnode<any, any> {
        leftButton.push(m(this.headerMenuIconComponent, {
            id: ParentPageView.headerMenuId
        }));

        return m(this.headerComponent, {
            title: title,
            leftButton: leftButton
        });
    }

    /**
    * header メニュー作成
    * @param content メニューコンテント
    */
    protected createHeaderMenu(content: any[] = []): Mithril.Vnode<any, any> {
        content.push(m(this.diskMenuContentComponent)); //ディスク空き容量メニュー

        return m(this.headerMenuListComponent, {
            id: ParentPageView.headerMenuId,
            content: content
        });
    }

    /**
    * Navigation 作成
    */
    protected createNavigation(): Mithril.Vnode<any, any> {
        return m(this.navigationComponent)
    }

    /**
    * ディスク空き容量ダイアログ
    */
    protected createDiskDialog(): Mithril.Vnode<any, any> {
        return m(this.dialogComponent, {
            id: DiskDialogViewModel.dialogId,
            width: 250,
            content: m(this.diskDialogComponent)
        });
    }

    /**
    * SnackbarComponent 生成
    */
    protected createSnackbar(): Mithril.Vnode<any, any> {
        return m(this.snackbarComponent);
    }

    /**
    * main layout
    * @param content content
    */
    protected mainLayout(content: any): Mithril.Vnode<any, any> {
        return m("main", {
            class: "fadeIn mdl-layout__content",
            oncreate: (vnode: Mithril.VnodeDOM<any, any>) => {
                this.addShowAnimetion(vnode.dom);
            }
        }, [
            m("div", {class: "page-content" }, [
                content
            ])
        ]);
    }
}

namespace ParentPageView {
    export const headerMenuId = "header_menu";
}

export default ParentPageView;

{'fraction_non_alphanumeric': 0.1144829800899165, 'fraction_numerical': 0.0009633911368015414, 'mean_word_length': 2.8028083028083026, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5196271', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1727, 'n_words': 372}