{"size": 2474, "ext": "js", "max_stars_repo_path": "portal/index.stories.js", "max_stars_repo_name": "softwaregroup-bg/ut-model", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "portal/index.stories.js", "max_issues_repo_name": "softwaregroup-bg/ut-model", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "portal/index.stories.js", "max_forks_repo_name": "softwaregroup-bg/ut-model", "max_forks_repo_forks_event_min_datetime": "2022-02-25T18:09:08.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-25T18:09:08.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 32.1298701299, "max_line_length": 100, "alphanum_fraction": 0.5525464834}
import {app} from 'ut-portal/storybook';
import model from '..';
import {tree, modelTree} from './tree';

export default {
    title: 'Model'
};

const organization = [
    {value: 100, label: 'Africa'},
    {value: 300, label: 'Asia'},
    {value: 400, label: 'Australia'},
    {value: 500, label: 'Europe'},
    {value: 600, label: 'North America'},
    {value: 700, label: 'South America'},
    {value: 101, parent: 100, label: 'Egypt'},
    {value: 102, parent: 100, label: 'Kenya'},
    {value: 103, parent: 100, label: 'Ghana'},
    {value: 104, parent: 100, label: 'Nigeria'},
    {value: 301, parent: 300, label: 'Philippines'},
    {value: 302, parent: 300, label: 'India'},
    {value: 501, parent: 500, label: 'Bulgaria'},
    {value: 601, parent: 600, label: 'USA'},
    {value: 701, parent: 700, label: 'Mexico'}
];

const page = app({
    implementation: 'model',
    utModel: true,
    utCore: true
}, {
    'customer.organization.graphFetch': () => ({
        organization: organization.map(({value: id, label: title, ...org}) => ({id, title, ...org}))
    }),
    'model.dropdown.list': () => ({
    }),
    login: () => ({
        result: {
            'permission.get': [{
                actionId: '%'
            }]
        }
    })
}, [
    function utModel() {
        return {
            config: () => ({
                storybook: {
                    browser: true,
                    backend: {
                        mock: true
                    }
                }
            }),
            browser: () => model.component([tree], [
                () => ({ namespace: 'component/model' })
            ])
        };
    },
    function utModel() {
        return model.backendMock([tree], () => ({modelTree}));
    }
]);

export const TreeBrowse = page('model.tree.browse');
export const TreeOpen = page('model.tree.open', 101);
export const TreeOpenThumbIndex = page('model.tree.open', 101, {layout: 'thumbIndex'});
const treeNew = 'model.tree.new';
export const TreeNew = page(treeNew);
export const TreeNewConifer = page(treeNew, {type: 'conifer'});
export const TreeNewBroadleaf = page(treeNew, {type: 'broadleaf'});
export const TreeNewFlat = page(treeNew, {layout: 'flat'});
export const TreeNewNested = page(treeNew, {layout: 'nested'});
export const TreeNew3Col = page(treeNew, {layout: '3col'});
export const TreeNewThumbIndex = page(treeNew, {layout: 'thumbIndex'});
export const TreeReport = page('model.tree.report', 'list');
