layui/src/index.ts

257 lines
6.7 KiB
TypeScript
Raw Normal View History

2022-01-27 16:18:16 +08:00
import type { App, Component } from "vue";
2021-09-27 06:09:33 +08:00
2022-01-25 12:53:25 +08:00
import "./theme/index.less";
2021-12-25 00:09:30 +08:00
import "@layui/layer-vue/lib/index.css";
import "@layui/icons-vue/lib/index.css";
import { layer } from "@layui/layer-vue";
import layerInstall from "@layui/layer-vue";
2022-02-17 10:24:25 +08:00
import i18n from "./language";
2021-11-28 18:53:42 +08:00
2022-01-22 21:30:17 +08:00
import LayBacktop from "./component/backTop/index";
import LayAvatar from "./component/avatar/index";
import LayAvatarList from "./component/avatarList/index";
import LayRadio from "./component/radio/index";
import LayButton from "./component/button/index";
import LayButtonContainer from "./component/buttonContainer/index";
import LayButtonGroup from "./component/buttonGroup/index";
import LayIcon from "./component/icon/index";
import LayIconPicker from "./component/iconPicker/index";
import LayCard from "./component/card/index";
import LayLayout from "./component/layout/index";
import LaySide from "./component/side/index";
import LayBody from "./component/body/index";
import LayHeader from "./component/header/index";
import LayFooter from "./component/footer/index";
import LayLogo from "./component/logo/index";
import LayPanel from "./component/panel/index";
import LayProgress from "./component/progress/index";
import LayCol from "./component/col/index";
import LayRow from "./component/row/index";
import LayInput from "./component/input/index";
import LayBadge from "./component/badge/index";
2022-02-11 18:28:35 +08:00
import LayQuote from "./component/quote/index";
2022-01-22 21:30:17 +08:00
import LayLine from "./component/line/index";
import LayTimeline from "./component/timeline/index";
import LayTimelineItem from "./component/timelineItem/index";
import LayTextarea from "./component/textarea/index";
import LaySwitch from "./component/switch/index";
import LayCollapse from "./component/collapse/index";
import LayCollapseItem from "./component/collapseItem/index";
import LayContainer from "./component/container/index";
import LayCountUp from "./component/countUp/index";
import LayMenu from "./component/menu/index";
import LayMenuItem from "./component/menuItem/index";
import LayCheckbox from "./component/checkbox/index";
import LayCheckboxGroup from "./component/checkboxGroup/index";
import LayForm from "./component/form/index";
import LayBreadcrumb from "./component/breadcrumb/index";
import LayBreadcrumbItem from "./component/breadcrumbItem/index";
import LayField from "./component/field/index";
import LaySelect from "./component/select/index";
import LaySelectOption from "./component/selectOption/index";
import LayScroll from "./component/scroll/index";
import LayEmpty from "./component/empty/index";
import LayFormItem from "./component/formItem/index";
import LayRate from "./component/rate/index";
import LayDropdown from "./component/dropdown/index";
import LayDropdownMenu from "./component/dropdownMenu/index";
import LayDropdownMenuItem from "./component/dropdownMenuItem/index";
2022-01-22 21:30:17 +08:00
import LayTab from "./component/tab/index";
import LayTabItem from "./component/tabItem/index";
import LayTree from "./component/tree/index";
import LayTable from "./component/table/index";
import LayPage from "./component/page/index";
import LayTransfer from "./component/transfer/index";
import LaySlider from "./component/slider/index";
import LayCarousel from "./component/carousel/index";
import LayCarouselItem from "./component/carouselItem/index";
import LayColorPicker from "./component/colorPicker/index";
import LayTooltip from "./component/tooltip/index";
import LayInputNumber from "./component/inputNumber/index";
import LaySkeleton from "./component/skeleton/index";
import LaySkeletonItem from "./component/skeletonItem/index";
import LayStep from "./component/step/index";
import LayStepItem from "./component/stepItem/index";
import LaySubMenu from "./component/subMenu/index";
import LaySplitPanel from "./component/splitPanel/index";
import LaySplitPanelItem from "./component/splitPanelItem/index";
2022-02-16 17:22:55 +08:00
import LayException from "./component/exception/index";
import LayResult from "./component/result/index";
2022-02-17 23:51:25 +08:00
import LayFullscreen from "./component/fullscreen/index";
2022-03-15 22:44:07 +08:00
import LayDatePicker from "./component/datePicker/index";
2022-03-17 17:21:30 +08:00
import LayNoticeBar from "./component/noticeBar/index";
2022-03-19 17:57:32 +08:00
import LayTransition from "./component/transition/index";
2022-02-16 17:22:55 +08:00
import LayConfigProvider from "./provider";
import { InstallOptions } from "./types";
2021-09-27 06:09:33 +08:00
2022-01-27 16:18:16 +08:00
const components: Record<string, Component> = {
2022-01-19 09:38:54 +08:00
LaySplitPanel,
LaySplitPanelItem,
2021-09-27 06:09:33 +08:00
LayRadio,
LayButton,
LayIcon,
LayBacktop,
2021-09-27 06:09:33 +08:00
LayLayout,
LaySide,
LayHeader,
LayBody,
LayFooter,
2021-09-27 06:59:01 +08:00
LayLogo,
2021-09-27 08:43:12 +08:00
LayPanel,
2021-09-27 09:24:54 +08:00
LayCard,
2021-09-27 13:35:53 +08:00
LayProgress,
2021-09-27 14:08:05 +08:00
LayButtonGroup,
2021-09-27 15:30:38 +08:00
LayButtonContainer,
LayRow,
LayCol,
2021-09-27 16:42:13 +08:00
LayInput,
2021-09-27 17:39:35 +08:00
LayBadge,
2022-02-11 18:28:35 +08:00
LayQuote,
2021-09-28 10:35:58 +08:00
LayLine,
LayTimeline,
2021-09-28 12:41:16 +08:00
LayTimelineItem,
LayTextarea,
LaySwitch,
LayCollapse,
2021-10-01 13:35:00 +08:00
LayCollapseItem,
2021-09-29 23:42:53 +08:00
LayContainer,
LayMenu,
LayMenuItem,
LayCheckbox,
LayForm,
LayBreadcrumb,
2021-10-01 20:22:49 +08:00
LayBreadcrumbItem,
2021-10-01 22:31:21 +08:00
LayAvatar,
2022-01-09 22:41:56 +08:00
LayAvatarList,
2021-10-02 00:05:59 +08:00
LayField,
2021-10-03 00:01:14 +08:00
LaySelect,
2021-10-03 00:52:06 +08:00
LayScroll,
2021-10-03 22:47:49 +08:00
LaySelectOption,
2021-10-04 07:44:31 +08:00
LayEmpty,
2021-10-04 08:06:19 +08:00
LayFormItem,
2021-10-05 18:44:07 +08:00
LayRate,
2021-10-05 19:04:06 +08:00
LayDropdown,
LayDropdownMenu,
LayDropdownMenuItem,
2021-10-05 19:04:06 +08:00
LayTab,
LayTabItem,
LayIconPicker,
LayTree,
2021-10-09 10:41:52 +08:00
LayTable,
LayPage,
LayTransfer,
LayCheckboxGroup,
LaySlider,
LayCarousel,
LayCarouselItem,
LayColorPicker,
LayTooltip,
LayInputNumber,
2021-12-29 15:47:31 +08:00
LaySkeleton,
LaySkeletonItem,
LayCountUp,
2022-01-04 18:12:13 +08:00
LayStep,
LayStepItem,
2022-01-19 09:38:54 +08:00
LaySubMenu,
2022-01-30 18:19:12 +08:00
LayException,
2022-02-01 07:23:20 +08:00
LayResult,
2022-02-17 23:51:25 +08:00
LayFullscreen,
2022-02-16 17:22:55 +08:00
LayConfigProvider,
2022-03-16 00:02:24 +08:00
LayDatePicker,
2022-03-17 18:00:28 +08:00
LayNoticeBar,
2022-03-19 17:57:32 +08:00
LayTransition
2021-12-25 00:09:30 +08:00
};
2021-09-27 06:09:33 +08:00
const install = (app: App, options?: InstallOptions): void => {
2021-09-27 06:09:33 +08:00
for (const key in components) {
2021-12-23 00:16:42 +08:00
const item = components[key];
app.component(item.name || key, item);
2021-09-27 06:09:33 +08:00
}
2022-02-09 17:40:33 +08:00
app.use(i18n);
app.use(layerInstall);
2021-12-25 00:09:30 +08:00
};
2021-09-27 06:09:33 +08:00
export {
2022-01-19 09:38:54 +08:00
LaySplitPanel,
LaySplitPanelItem,
2021-09-27 06:09:33 +08:00
LayRadio,
LayButton,
LayIcon,
LayBacktop,
2021-09-27 06:09:33 +08:00
LayLayout,
LaySide,
LayHeader,
LayBody,
LayFooter,
LayLogo,
LayPanel,
2021-09-27 08:43:12 +08:00
LayCard,
2021-09-27 09:24:54 +08:00
LayProgress,
2021-09-27 13:35:53 +08:00
LayButtonGroup,
2021-09-27 14:08:05 +08:00
LayButtonContainer,
2021-09-27 15:30:38 +08:00
LayRow,
LayCol,
2021-09-27 16:42:13 +08:00
LayInput,
LayBadge,
2022-02-11 18:28:35 +08:00
LayQuote,
2021-09-27 22:01:22 +08:00
LayLine,
2021-09-28 10:35:58 +08:00
LayTimeline,
LayTimelineItem,
2021-09-28 12:41:16 +08:00
LayTextarea,
LaySwitch,
LayCollapse,
2021-10-01 13:35:00 +08:00
LayCollapseItem,
LayContainer,
2021-09-29 23:42:53 +08:00
LayMenu,
LayMenuItem,
LayCheckbox,
LayForm,
LayBreadcrumb,
LayBreadcrumbItem,
2021-10-01 20:22:49 +08:00
LayAvatar,
2022-01-09 22:41:56 +08:00
LayAvatarList,
2021-10-01 22:31:21 +08:00
LayField,
2021-10-02 00:05:59 +08:00
LaySelect,
2021-10-03 00:01:14 +08:00
LayScroll,
2021-10-03 00:52:06 +08:00
LaySelectOption,
2021-10-03 22:47:49 +08:00
LayEmpty,
2021-10-04 07:44:31 +08:00
LayFormItem,
2021-10-04 08:06:19 +08:00
LayRate,
2021-10-05 18:44:07 +08:00
LayDropdown,
2022-03-19 17:57:32 +08:00
LayDropdownMenu,
LayDropdownMenuItem,
2021-10-05 19:04:06 +08:00
LayTab,
LayTabItem,
LayIconPicker,
LayTree,
2021-10-09 10:41:52 +08:00
LayTable,
LayPage,
LayTransfer,
LayCheckboxGroup,
LaySlider,
LayCarousel,
LayCarouselItem,
LayColorPicker,
LayTooltip,
LayInputNumber,
LaySkeleton,
LaySkeletonItem,
LayCountUp,
LayStep,
LayStepItem,
2022-01-19 09:38:54 +08:00
LaySubMenu,
2022-01-30 18:19:12 +08:00
LayException,
2022-02-01 07:23:20 +08:00
LayResult,
2022-02-17 23:51:25 +08:00
LayFullscreen,
2022-02-16 17:22:55 +08:00
LayConfigProvider,
2022-03-16 00:02:24 +08:00
LayDatePicker,
2022-03-17 18:00:28 +08:00
LayNoticeBar,
2022-03-19 17:57:32 +08:00
LayTransition
2021-12-25 00:09:30 +08:00
};
2021-09-27 06:09:33 +08:00
export { layer };
2021-09-27 06:09:33 +08:00
2022-02-16 17:22:55 +08:00
export default { install };
2022-03-14 13:13:31 +08:00
2022-03-15 22:44:07 +08:00
export * from "./resolver";