"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const box_1 = require("./box");
const formConfig_1 = require("./formConfig");
const tableConfig_1 = require("./tableConfig");
const BasicTable_1 = require("./BasicTable");
const BaseForm_1 = require("./BaseForm");
const RegisterComp_1 = require("../../RegisterComp");
const CustomComp_1 = require("./CustomComp");
const _ = require("lodash");
const widgetList = [
    {
        label: '容器',
        type: 'box',
        list: box_1.default,
    },
    {
        label: '布局',
        type: 'box',
        list: [
            {
                id: 'Row',
                key: 'Row',
                label: 'colum 1',
                params: {
                    columns: 1
                },
                des: '布局容器，1列布局',
                keys: ['布局', '1列', '容器', 'column'],
            },
            {
                id: 'Row',
                key: 'Row',
                label: 'colum 2',
                params: {
                    columns: 2
                },
                des: '布局容器，2列布局',
                keys: ['布局', '2列', '容器', 'column'],
            },
            {
                id: 'Row',
                key: 'Row',
                label: 'colum 3',
                params: {
                    columns: 3
                },
                des: '布局容器，3列布局',
                keys: ['布局', '3列', '容器', 'column'],
            },
            {
                id: 'Row',
                key: 'Row',
                label: 'colum 4',
                params: {
                    columns: 4
                },
                des: '布局容器，4列布局',
                keys: ['布局', '4列', '容器', 'column'],
            },
            {
                id: 'Row',
                key: 'Row',
                label: 'colum 6',
                params: {
                    columns: 6
                },
                des: '布局容器，6列布局',
                keys: ['布局', '6列', '容器', 'column'],
            }
        ]
    },
    {
        label: '表单',
        type: 'component',
        list: formConfig_1.componentConf,
    },
    {
        label: '文本',
        type: 'component',
        list: [
            {
                id: 'Typography',
                key: 'Typography',
                label: '主标题',
                params: {
                    type: 'H1'
                },
                des: '主标题, H1',
                keys: ['主标题', 'H1', '文案', '文本'],
            },
            {
                id: 'Typography',
                key: 'Typography',
                label: '标题',
                params: {
                    type: 'H2'
                },
                des: '标题, H2',
                keys: ['标题', 'H2', '文案', '文本'],
            },
            {
                id: 'Typography',
                key: 'Typography',
                label: '次标题',
                params: {
                    type: 'H3'
                },
                des: '次标题, H3',
                keys: ['次标题', 'H3', '文案', '文本'],
            },
            {
                id: 'Typography',
                key: 'Typography',
                label: '小标题',
                params: {
                    type: 'H4'
                },
                des: '小标题, H4',
                keys: ['小标题', 'H4', '文案', '文本'],
            },
            {
                id: 'Typography',
                key: 'Typography',
                label: '正文',
                params: {
                    type: 'Text'
                },
                des: '正文, Text',
                keys: ['正文', 'Text', '文案', '文本'],
            },
            {
                id: 'Typography',
                key: 'Typography',
                label: '辅助文字',
                params: {
                    type: 'AText'
                },
                des: '辅助文字, AText',
                keys: ['辅助文字', 'AText', '文案', '文本'],
            },
            {
                id: 'EditText',
                key: 'EditText',
                label: '自定义文案',
                des: '自定义文案, 自定义样式',
            }
        ]
    },
    {
        label: '操作',
        type: 'component',
        list: [
            {
                id: 'Button',
                key: 'Button',
                label: 'Button',
                des: '按钮，Button',
                keys: ['按钮', 'Button', '操作'],
            },
            {
                id: 'Link',
                key: 'Link',
                label: 'link',
                des: '按钮，link',
                keys: ['链接', 'link', '操作'],
            },
            {
                id: 'Tag',
                key: 'Tag',
                label: 'Tag',
                des: '标签，Icon',
                keys: ['标签', 'Icon', '操作'],
            }
        ]
    },
    {
        label: '图片',
        type: 'component',
        list: [
            {
                id: 'Image',
                key: 'Image',
                label: 'Image',
                des: '图片，Image',
                keys: ['图片', 'Image', '展示'],
            },
        ]
        // Image
    },
    {
        label: '其他',
        type: 'component',
        list: [
            {
                id: 'Divider',
                key: 'Divider',
                label: 'Divider',
                des: '分割线, Divider',
                keys: ['分割线', 'Divider']
            }
        ]
    }
];
class Data {
    getBoxList() {
        return box_1.default;
    }
    getCompList() {
        RegisterComp_1.default.getCompByAscriptionData('BaseForm');
        return {
            form: formConfig_1.componentConf,
            table: tableConfig_1.tableConf,
            BasicTable: BasicTable_1.BasicTableConf,
            BaseForm: BaseForm_1.BaseFormConf,
            Container: {
                list: box_1.default
            }
        };
    }
    getWidgetList(data) {
        const { value } = data;
        const curWidgetList = _.cloneDeep(widgetList);
        if (value) {
            const filterWidgetList = curWidgetList.map(item => {
                const list = item.list;
                item.list = list.filter(comp => {
                    if (comp.label.match(value) || comp.keys.includes(value) || comp.des.match(value)) {
                        return true;
                    }
                    return false;
                });
                return item;
            }).filter(item => {
                return item.list.length > 0;
            });
            return filterWidgetList;
        }
        return widgetList;
    }
    getEditBlockList() {
        return [
            {
                label: '卡片面板',
                type: 'editBox',
                list: [
                    {
                        id: 'PanelGroup',
                        key: 'PanelGroup',
                        label: '数据面板',
                        path: '/EditBlock/PanelGroup',
                        thumb: 'https://unpkg.com/@sparrow-vue/images@1.0.1/assets/1000002.png',
                        icon: ''
                    },
                    {
                        id: 'CardGroup',
                        key: 'CardGroup',
                        label: '介绍面板',
                        path: '/EditBlock/CardGroup',
                        thumb: 'https://unpkg.com/@sparrow-vue/images@1.0.1/assets/1000003.png',
                        icon: ''
                    },
                    {
                        id: 'CardDetail',
                        key: 'CardDetail',
                        label: '卡片详情',
                        path: '/EditBlock/CardDetail',
                        thumb: 'https://unpkg.com/@sparrow-vue/images@1.0.1/assets/1000001.png',
                        icon: ''
                    }
                ]
            },
            {
                label: '卡片表单',
                type: 'editBox',
                list: [
                    {
                        id: 'CardForm',
                        key: 'CardForm',
                        label: '卡片表单',
                        path: '/EditBlock/CardForm',
                        thumb: 'https://unpkg.com/@sparrow-vue/images@1.0.1/assets/1000004.png',
                        icon: ''
                    },
                    {
                        id: 'StepsForm',
                        key: 'StepsForm',
                        label: '步骤表单',
                        path: '/EditBlock/StepsForm',
                        thumb: 'https://unpkg.com/@sparrow-vue/images@1.0.1/assets/1000005.png',
                        icon: ''
                    }
                ]
            },
            {
                label: '表格',
                type: 'editBox',
                list: [
                    {
                        id: 'TableExpand',
                        key: 'TableExpand',
                        label: '展开行表格',
                        path: '/EditBlock/TableExpand',
                        thumb: 'https://unpkg.com/@sparrow-vue/images@1.0.1/assets/1000006.png',
                        icon: ''
                    }
                ]
            }
        ];
    }
    getCustomComp(params) {
        const { value } = params;
        if (value === '')
            return [];
        const list = CustomComp_1.custom.filter(item => {
            if (item.label.match(value) || item.keys.includes(value) || item.des.match(value)) {
                return true;
            }
            return false;
        });
        return list;
    }
}
exports.default = Data;
//# sourceMappingURL=data:application/json;base64, 