import './style.css';

import '@vueup/vue-quill/dist/vue-quill.snow.css';

import '@toast-ui/chart/dist/toastui-chart.css';
import 'tui-color-picker/dist/tui-color-picker.css';

import '@toast-ui/editor-plugin-code-syntax-highlight/dist/toastui-editor-plugin-code-syntax-highlight.css';
import '@toast-ui/editor-plugin-color-syntax/dist/toastui-editor-plugin-color-syntax.css';
import '@toast-ui/editor-plugin-table-merged-cell/dist/toastui-editor-plugin-table-merged-cell.css';
import '@toast-ui/editor/dist/toastui-editor.css';

import PaasDate from "./PaasDate/index.vue";
import PaasMenu from "./PaasMenu/index.vue";
import MentionInput from "./MentionInput/index.vue";
import PaasPageTable from "./PaasPageTable/index.vue";
import PaasSelect from "./PaasSelect/index.vue";
import PaasPageSelect from "./PaasPageSelect/index.vue";
import PaasTree from "./PaasTree/index.vue";
import PaasUploadModal from "./PaasUploadModal/index.vue";
import FormDate from "./form/FormDate/index.vue";
import FormInput from "./form/FormInput/index.vue";
import FormNumber from "./form/FormNumber/index.vue";
import FormPageSelect from "./form/FormPageSelect/index.vue";
import FormSelect from "./form/FormSelect/index.vue";
import FormSwitch from "./form/FormSwitch/index.vue";
import FormDateRange from "./form/FormDateRange/index.vue";
import FormTree from "./form/FormTree/index.vue";
import PaasUpload from "./PaasUpload/index.vue";
import FormTextarea from "./form/FormTextarea/index.vue";
import FormRadio from "./form/FormRadio/index.vue";
import FormCheckbox from "./form/FormCheckbox/index.vue";
import PaasEditor from "./PaasEditor/index.vue";
import PaasMdEditor from "./PaasMdEditor/index.vue";
import PaasTreePanel from "./PaasTreePanel/index.vue";
import PaasIcon from "./PaasIcon/index.vue";
import PaasCodeEditor from "./PaasCodeEditor/index.vue";
import PaasForm from "./PaasForm/index.vue";
import OrgPathSelector from "./OrgPathSelector/index.vue";
import PaasImageViewer from "./PaasImageViewer/index.vue";
import PaasInput from "./PaasInput/index.vue";
import PaasNumber from "./PaasNumber/index.vue";
import PaasTextarea from "./PaasTextarea/index.vue";
import PaasSwitch from "./PaasSwitch/index.vue";
import PaasDateRange from "./PaasDateRange/index.vue";
import PaasRadio from "./PaasRadio/index.vue";
import PaasCheckbox from "./PaasCheckbox/index.vue";

import * as Icons from '@ant-design/icons-vue';

const component = [
    PaasDate,
    PaasMenu,
    MentionInput,
    PaasPageTable,
    PaasPageSelect,
    PaasSelect,
    PaasTree,
    PaasUploadModal,
    OrgPathSelector,
    FormDate,
    FormInput,
    FormNumber,
    FormPageSelect,
    FormSelect,
    FormSwitch,
    FormTree,
    FormDateRange,
    PaasUpload,
    PaasEditor,
    PaasMdEditor,
    PaasTreePanel,
    PaasForm,
    FormTextarea,
    FormRadio,
    FormCheckbox,
    PaasIcon,
    PaasCodeEditor,
    PaasImageViewer,
    PaasInput,
    PaasNumber,
    PaasTextarea,
    PaasSwitch,
    PaasDateRange,
    PaasRadio,
    PaasCheckbox,
];

const globalComponents = {
    install(app) {
        component.forEach((item) => {
            app.component(item.name, item);
        });
        Object.keys(Icons).forEach((key) => {
            app.component(key, Icons[key]);
        });
    },
};

// 单独导出所有组件以支持按需导入
export {
    PaasDate,
    PaasMenu,
    MentionInput,
    PaasPageTable,
    PaasPageSelect,
    PaasSelect,
    PaasTree,
    PaasUploadModal,
    OrgPathSelector,
    FormDate,
    FormInput,
    FormNumber,
    FormPageSelect,
    FormSelect,
    FormSwitch,
    FormTree,
    FormDateRange,
    PaasUpload,
    PaasEditor,
    PaasMdEditor,
    PaasTreePanel,
    PaasForm,
    FormTextarea,
    FormRadio,
    FormCheckbox,
    PaasIcon,
    PaasCodeEditor,
    PaasImageViewer,
    PaasInput,
    PaasNumber,
    PaasTextarea,
    PaasSwitch,
    PaasDateRange,
};

export const widgets = component.filter(c => c.name)

export default globalComponents;