├── .eslintignore
├── .eslintrc.js
├── .github
└── workflows
│ ├── main.yml
│ └── pages.yml
├── .gitignore
├── .husky
└── pre-commit
├── .npmrc
├── .prettierignore
├── .prettierrc
├── .travis.yml
├── .vscode
└── settings.json
├── LICENSE
├── README.md
├── demo
└── index.html
├── dev
├── app.vue
├── dashborad.vue
├── layout.vue
├── main.ts
├── online-pkg.vue
├── readme.md
├── router.js
└── setting.vue
├── docs
├── .vitepress
│ ├── components
│ │ └── gitalk.vue
│ ├── config.ts
│ ├── nav.ts
│ ├── sidebar.ts
│ ├── theme
│ │ ├── Layout.vue
│ │ ├── index.ts
│ │ ├── style.css
│ │ └── var.css
│ └── vitepress-theme-demoblock
│ │ ├── bin
│ │ ├── help.ts
│ │ └── vitepress-register-components.ts
│ │ ├── client
│ │ ├── components
│ │ │ ├── Demo.vue
│ │ │ ├── DemoBlock.vue
│ │ │ ├── Message.vue
│ │ │ └── message.js
│ │ ├── index.ts
│ │ └── utils.ts
│ │ ├── node
│ │ ├── demoblock.ts
│ │ ├── index.ts
│ │ ├── markdown-it-container.d.ts
│ │ ├── patterns.ts
│ │ ├── render.ts
│ │ └── utils.ts
│ │ ├── theme
│ │ ├── index.ts
│ │ └── styles
│ │ │ ├── code.css
│ │ │ ├── index.css
│ │ │ └── layout.css
│ │ ├── types
│ │ └── index.ts
│ │ └── utils
│ │ ├── getDirname.ts
│ │ ├── index.ts
│ │ └── util.ts
├── components
│ ├── avatar.md
│ ├── backtop.md
│ ├── button.md
│ ├── calendar.md
│ ├── card.md
│ ├── carousel.md
│ ├── checkbox.md
│ ├── collapse-transition.md
│ ├── drawer.md
│ ├── empty.md
│ ├── icon.md
│ ├── index.md
│ ├── input.md
│ ├── layout.md
│ ├── loading.md
│ ├── lockScreen.md
│ ├── menu.md
│ ├── message.md
│ ├── modal.md
│ ├── popper.md
│ ├── ripple.md
│ ├── select.md
│ ├── skeleton.md
│ ├── slider.md
│ ├── space.md
│ ├── switch.md
│ ├── tab.md
│ ├── tag.md
│ └── tooltip.md
├── guide
│ ├── colors.md
│ ├── index.md
│ ├── overview.md
│ ├── quickstart.md
│ ├── timeline.md
│ └── toggle-theme.md
├── index.md
├── public
│ ├── favicon.ico
│ ├── fullscreen-bg2.jpg
│ ├── ik-1.jpg
│ ├── ik-2.jpg
│ ├── ik-3.jpg
│ ├── ik-4.png
│ ├── ik-5.png
│ ├── ik-6.png
│ ├── ik-7.png
│ ├── ikun.gif
│ └── layer5.png
├── shims-vue.d.ts
├── styles
│ ├── animation.md
│ ├── index.md
│ └── shadow.md
└── vite.config.ts
├── global.d.ts
├── index.html
├── package.json
├── packages
├── ikui-components
│ ├── README.md
│ ├── __test__
│ │ └── button.test.ts
│ ├── _utils
│ │ ├── useClickOutside.ts
│ │ ├── useCssVar.ts
│ │ ├── useZIndex.ts
│ │ └── withInstall.ts
│ ├── avatar
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── avatar.tsx
│ │ │ └── prop.ts
│ ├── backtop
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── backtop.tsx
│ │ │ └── prop.ts
│ ├── button
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── button.ts
│ │ │ └── button.vue
│ ├── calendar
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── calendar-util.ts
│ │ │ ├── calendar.vue
│ │ │ └── props.ts
│ ├── card
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── card.ts
│ │ │ └── card.vue
│ ├── carousel
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── carousel-item.vue
│ │ │ ├── carousel.vue
│ │ │ └── prop.ts
│ ├── checkbox-group
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── checkbox-group.ts
│ │ │ ├── checkbox-group.vue
│ │ │ └── interface.d.ts
│ ├── checkbox
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── checkbox.ts
│ │ │ └── checkbox.vue
│ ├── collapse-transition
│ │ ├── index.ts
│ │ └── src
│ │ │ └── collapse-transition.vue
│ ├── drawer
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── drawer.ts
│ │ │ └── drawer.vue
│ ├── empty
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── empty.tsx
│ │ │ └── prop.ts
│ ├── icon
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── icon.ts
│ │ │ └── icon.vue
│ ├── index.ts
│ ├── input
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── input.ts
│ │ │ └── input.vue
│ ├── layout
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── aside.vue
│ │ │ ├── container.vue
│ │ │ ├── header.vue
│ │ │ └── main.vue
│ ├── loading
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── directive.ts
│ │ │ ├── mask.ts
│ │ │ ├── mask.vue
│ │ │ └── service.ts
│ ├── lock-screen
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── lock-screen.vue
│ │ │ └── prop.ts
│ ├── menu
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── collapse-transition.vue
│ │ │ ├── menu-item.vue
│ │ │ ├── menu.vue
│ │ │ ├── prop.ts
│ │ │ └── submenu.vue
│ ├── message
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── message.ts
│ │ │ ├── message.vue
│ │ │ └── service.ts
│ ├── modal
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── model.tsx
│ │ │ └── props.ts
│ ├── package.json
│ ├── popper
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── popper.vue
│ │ │ └── prop.ts
│ ├── ripple
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── interface.ts
│ │ │ └── ripple.ts
│ ├── select
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── props.ts
│ │ │ └── select.tsx
│ ├── skeleton
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── prop.ts
│ │ │ └── skeleton.vue
│ ├── slider
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── prop.ts
│ │ │ └── slider.vue
│ ├── space
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── prop.ts
│ │ │ ├── space.ts
│ │ │ └── space.vue
│ ├── switch
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── prop.ts
│ │ │ └── switch.vue
│ ├── tab
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── props.ts
│ │ │ ├── tab-item.vue
│ │ │ └── tab.tsx
│ ├── tag
│ │ ├── index.ts
│ │ └── src
│ │ │ ├── prop.ts
│ │ │ └── tag.tsx
│ └── tooltip
│ │ ├── index.ts
│ │ └── src
│ │ ├── tooltip.ts
│ │ ├── tooltip.vue
│ │ └── tooltip2.vue
├── ikui-theme
│ ├── index.scss
│ ├── mixins
│ │ ├── common.scss
│ │ ├── config.scss
│ │ ├── transition.scss
│ │ └── var.scss
│ ├── package.json
│ └── src
│ │ ├── avatar.scss
│ │ ├── backTop.scss
│ │ ├── button.scss
│ │ ├── calendar.scss
│ │ ├── card.scss
│ │ ├── checkbox.scss
│ │ ├── container.scss
│ │ ├── drawer.scss
│ │ ├── empty.scss
│ │ ├── icon.scss
│ │ ├── input.scss
│ │ ├── loading.scss
│ │ ├── lock-screen.scss
│ │ ├── menu.scss
│ │ ├── message.scss
│ │ ├── modal.scss
│ │ ├── ripple.scss
│ │ ├── select.scss
│ │ ├── skeleton.scss
│ │ ├── slider.scss
│ │ ├── space.scss
│ │ ├── switch.scss
│ │ ├── tab.scss
│ │ ├── tag.scss
│ │ └── tooltip.scss
└── utils
│ └── install.ts
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── scripts
├── build-theme.config.ts
├── create-component.ts
└── gen.ts
├── tsconfig.json
├── vite-plugin-setup-name.ts
├── vite.config.ts
└── vitest.config.ts
/.eslintignore:
--------------------------------------------------------------------------------
1 | /dev
2 | /dist
3 | */node_modules/*
4 | **/node_modules/**
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | es2021: true,
5 | node: true,
6 | },
7 | extends: [
8 | 'eslint:recommended',
9 | 'plugin:vue/vue3-essential',
10 | 'plugin:@typescript-eslint/recommended',
11 | 'plugin:prettier/recommended',
12 | ],
13 | overrides: [],
14 | parser: 'vue-eslint-parser',
15 | parserOptions: {
16 | ecmaVersion: 'latest',
17 | parser: '@typescript-eslint/parser',
18 | sourceType: 'module',
19 | },
20 | plugins: ['vue', '@typescript-eslint'],
21 | rules: {
22 | 'vue/multi-word-component-names': 'off',
23 | },
24 | }
25 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: Codecov
2 | on:
3 | push:
4 | branches: [master]
5 | pull_request:
6 | branches: [master]
7 | jobs:
8 | UnitTest:
9 | # The type of runner that the job will run on
10 | runs-on: ubuntu-latest
11 | # Steps represent a sequence of tasks that will be executed as part of the job
12 | steps:
13 | - uses: actions/checkout@v2
14 | - uses: pnpm/action-setup@v2.1.0
15 | with:
16 | version: 7.2.1
17 | - name: Install modules
18 | run: pnpm install
19 | - name: Run Test
20 | run: pnpm run coverage
21 | - name: Upload coverage to Codecov
22 | uses: codecov/codecov-action@v3
23 | with:
24 | files: ./coverage/coverage-final.json,./coverage/index.html,./coverage/clover.html
25 | token: ${{ secrets.CODECOV_TOKEN }}
26 |
--------------------------------------------------------------------------------
/.github/workflows/pages.yml:
--------------------------------------------------------------------------------
1 | name: Deploy
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | deploy:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout
13 | uses: actions/checkout@v3
14 |
15 | - name: Setup pnpm
16 | uses: pnpm/action-setup@v2
17 |
18 | - name: Setup node
19 | uses: actions/setup-node@v3
20 | with:
21 | node-version: 18
22 |
23 | - name: Install dependencies
24 | run: pnpm i
25 |
26 | - name: Build Ik UI
27 | run: pnpm build
28 | env:
29 | FORCE_COLOR: 2
30 | NODE_OPTIONS: --max-old-space-size=4096
31 |
32 | - name: Build website
33 | run: pnpm docs:build
34 | env:
35 | DOC_ENV: preview
36 | NODE_OPTIONS: --max-old-space-size=4096
37 |
38 | - name: Deploy
39 | uses: peaceiris/actions-gh-pages@v3
40 | with:
41 | github_token: ${{ secrets.GITHUB_TOKEN }}
42 | publish_dir: docs/.vitepress/dist
43 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | /node_modules
3 | dist
4 | /docs/.vitepress/dist
5 | /docs/.vitepress/cache
6 | /coverage
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | pnpm lint && pnpm format
5 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | strict-peer-dependencies=false
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 | coverage
4 | CHANGELOG.en-US.md
5 | pnpm-lock.yaml
6 | docs/components.d.ts
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "semi": false,
3 | "singleQuote": true,
4 | "printWidth": 120,
5 | "endOfLine": "auto",
6 | "overrides": [
7 | {
8 | "files": ".prettierrc",
9 | "options": {
10 | "parser": "json"
11 | }
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - lts/*
4 | install:
5 | - yarn install # npm ci
6 | script:
7 | - yarn docs:build # npm run docs:build
8 | deploy:
9 | provider: pages
10 | skip_cleanup: true
11 | local_dir: docs/.vitepress/dist
12 | # 在 GitHub 中生成,用于允许 Travis 向你的仓库推送代码。在 Travis 的项目设置页面进行配置,设置为 secure variable
13 | github_token: $GITHUB_TOKEN
14 | keep_history: true
15 | on:
16 | branch: master
17 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.codeActionsOnSave": {
3 | "source.fixAll": "never",
4 | "source.fixAll.eslint": "explicit"
5 | },
6 | "editor.formatOnSave": true,
7 | "editor.defaultFormatter": "esbenp.prettier-vscode"
8 | }
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 LAINE001
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IKUN-UI
2 |
3 |
4 |
5 |
6 |
7 |
8 | IKUNUI
9 |
10 |
11 |
12 | a simple ui components built on vue3 .
13 |
14 | docs see IKUNUI, 国内:https://laine001.gitee.io/ikun-ui/ or https://ikun-cool.netlify.app/
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | ## Features
25 |
26 | - 🏀 vue3、typescript
27 | - ⚡ vite3
28 | - 🌈 pnpm
29 | - ✨ monorepo
30 |
31 | ## Install
32 |
33 | Using `npm` to install:
34 |
35 | ```bash
36 | npm i ikun-ui
37 | ```
38 |
39 | Using `yarn` or `pnpm` to install:
40 |
41 | ```bash
42 | yarn add ikun-ui
43 |
44 | pnpm add ikun-ui
45 | ```
46 |
47 | ## Quickstart
48 |
49 | ```js
50 | import { createApp } from 'vue'
51 | import App from './app.vue'
52 |
53 | import ikun from 'ikun-ui'
54 | import 'ikunui/lib/index.css'
55 |
56 | createApp(App).use(ikun).mount('#app')
57 |
58 | // or
59 |
60 | import { IkButton } from 'ikun-ui'
61 | app.use(IkButton)
62 | ```
63 |
64 | see more in [Quickstart](https://laine001.github.io/ik-ui)
65 |
66 | ## Links
67 |
68 | - [Documentation](https://laine001.github.io/ikun-ui)
69 | - [Timelines](https://laine001.github.io/ikun-ui)
70 | - [more](https://laine001.github.io/ikun-ui)
71 |
72 | ## Join us
73 |
74 | Hava an idea ? u can join us
75 |
76 | ## Contributors
77 |
78 |
79 |
80 |
81 |
82 | ## Thanks
83 |
84 | Learn from many excellent community projects
85 |
86 | - [Element-plus](https://github.com/element-plus/element-plus)
87 | - [Vant](https://github.com/youzan/vant)
88 | - [Varlet](https://github.com/varletjs/varlet)
89 | - [Antd](https://ant.design/index-cn)
90 | - [Fighting-Design](https://github.com/LAINE001/fighting-design)
91 |
92 | ## LICENSE
93 |
94 | [MIT](https://github.com/LAINE001/ikun-ui/blob/master/LICENSE)
95 |
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | {{ message }}
26 | {{ message }}22
27 |
28 |
48 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/dev/dashborad.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
123123
9 |
123123
10 |
123123
11 |
123123
12 |
123123
13 |
123123
14 |
123123
15 |
123123
16 |
123123
17 |
123123
18 |
19 | 这里放置浮层内容
20 | 按钮
21 |
22 |
123123
23 |
123123
24 |
123123
25 |
123123
26 |
123123
27 |
123123
28 |
123123
29 |
30 |
31 |
36 |
--------------------------------------------------------------------------------
/dev/main.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import app from './layout.vue'
3 | import IkUI from 'ikuiv'
4 | import '@ikui/theme/index.scss'
5 | import router from './router'
6 |
7 | document.title = 'ikui-dev'
8 | createApp(app).use(IkUI).use(router).mount('#app')
9 |
10 | // import { createApp } from 'vue'
11 | // import app from './online-pkg.vue'
12 | // import IkUI, { IkButton } from 'ikuiv'
13 | // console.log(IkButton, 'IkButton')
14 |
15 | // createApp(app)
16 | // .use(IkUI)
17 | // .mount('#app')
18 |
--------------------------------------------------------------------------------
/dev/online-pkg.vue:
--------------------------------------------------------------------------------
1 |
2 | 普通按钮
3 | 普通按钮
4 |
5 |
--------------------------------------------------------------------------------
/dev/readme.md:
--------------------------------------------------------------------------------
1 | # git 提交规范
2 |
3 | - feat:新增功能(feature)
4 | - fix:修复补丁(bug)
5 | - docs:修订文档,如 Readme, Change Log, Contribute 等
6 | - refactor:代码重构,未新增任何功能和修复任何 bug
7 | - style: 仅调整空格、格式缩进等(不改变代码逻辑的变动)
8 | - perf:优化相关,改善性能和体验的修改
9 | - test:测试用例的增加/修改
10 | - chore:非 src 和 test 的修改
11 | - merge:合并分支或冲突等
12 | - revert: 回滚到上一个版本
13 | - build:改变构建流程,新增依赖库、工具等(例如 webpack、maven 修改)
14 | - ci:自动化流程配置修改
15 |
--------------------------------------------------------------------------------
/dev/router.js:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHistory } from 'vue-router'
2 |
3 | import Dashboard from './dashborad.vue'
4 | import Setting from './setting.vue'
5 |
6 | const routes = [
7 | {
8 | path: '/',
9 | redirect: '/dashboard',
10 | name: 'dashboard',
11 | },
12 | {
13 | path: '/dashboard',
14 | name: 'dashboard',
15 | component: Dashboard,
16 | },
17 | {
18 | path: '/setting',
19 | name: 'setting',
20 | component: Setting,
21 | },
22 | ]
23 |
24 | const router = createRouter({
25 | history: createWebHistory(),
26 | routes,
27 | })
28 |
29 | export default router
30 |
--------------------------------------------------------------------------------
/dev/setting.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | url2base64
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/.vitepress/components/gitalk.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
25 |
26 |
62 |
--------------------------------------------------------------------------------
/docs/.vitepress/nav.ts:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | text: '首页',
4 | link: '/',
5 | },
6 | {
7 | text: '指引',
8 | // link: '/guide/quickstart',
9 | // activeMatch: '/guide/',
10 | collapsed: false,
11 | items: [
12 | {
13 | text: '概览',
14 | link: '/guide/overview',
15 | },
16 | {
17 | text: '快速上手',
18 | link: '/guide/quickstart',
19 | },
20 | {
21 | text: '视觉与色彩',
22 | link: '/guide/colors',
23 | },
24 | {
25 | text: '动态主题',
26 | link: '/guide/toggle-theme',
27 | },
28 | ],
29 | },
30 | {
31 | text: '组件',
32 | link: '/components/button',
33 | activeMatch: '/components/',
34 | },
35 | // {
36 | // text: 'CSS',
37 | // link: '/styles/animation',
38 | // activeMatch: '/styles/',
39 | // },
40 | {
41 | text: '相关链接',
42 | items: [
43 | {
44 | text: 'vitejs',
45 | link: 'https://vitejs.dev/',
46 | },
47 | {
48 | text: 'vue3',
49 | link: 'https://vuejs.org/',
50 | },
51 | {
52 | text: 'blog',
53 | link: 'https://laine001.github.io/blog/fe/components-proj',
54 | },
55 | {
56 | text: '国内链接',
57 | link: 'https://laine001.gitee.io/ikun-ui/',
58 | },
59 | ],
60 | },
61 | ]
62 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/Layout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
39 |
40 |
41 |
42 |
43 |
44 |
69 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/index.ts:
--------------------------------------------------------------------------------
1 | import DefaultTheme from 'vitepress/theme'
2 | import Layout from './Layout.vue'
3 | import IkUI, { message } from 'ikuiv'
4 | import '@ikui/theme/index.scss'
5 | // import Demo from '../components/demo.vue'
6 | // import DemoBlock from '../components/demoBlock.vue'
7 | import './var.css'
8 | import './style.css'
9 | // console.log(IkUI, message, 'IkUI')
10 | import Demo from '../vitepress-theme-demoblock/client/components/Demo.vue'
11 | import DemoBlock from '../vitepress-theme-demoblock/client/components/DemoBlock.vue'
12 | import Comment from '../components/gitalk.vue'
13 | import '../vitepress-theme-demoblock/theme/styles/index.css'
14 |
15 | export default {
16 | extends: DefaultTheme,
17 | Layout,
18 | enhanceApp({ app }) {
19 | app.use(IkUI)
20 | app.config.globalProperties.$message = message
21 | app.component('Demo', Demo)
22 | app.component('DemoBlock', DemoBlock)
23 | app.component('git-talk', Comment)
24 | },
25 | }
26 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/var.css:
--------------------------------------------------------------------------------
1 | /* home */
2 | :root {
3 | --vp-home-hero-name-color: transparent;
4 | /* --vp-home-hero-name-background: -webkit-linear-gradient(120deg, #cd8025 40%, #eccd90); */
5 | --vp-home-hero-name-background: -webkit-linear-gradient(120deg, var(--primary-color) 40%, var(--primary-color-hover));
6 |
7 | /* --vp-home-hero-image-background-image: linear-gradient(-45deg, #cd8025 50%, #eccd90 50%); */
8 | --vp-home-hero-image-background-image: linear-gradient(
9 | -45deg,
10 | var(--primary-color) 50%,
11 | var(--primary-color-hover) 50%
12 | );
13 | --vp-home-hero-image-filter: blur(60px);
14 | }
15 |
16 | /**
17 | * Colors
18 | * -------------------------------------------------------------------------- */
19 |
20 | /* :root {
21 | --vp-c-brand: #cd8025;
22 | --vp-c-brand-light: #cd8025;
23 | --vp-c-brand-lighter: #505058;
24 | --vp-c-brand-lightest: #1a1a20;
25 | --vp-c-brand-dark: #a55b03;
26 | --vp-c-brand-darker: #a55b03;
27 | --vp-c-brand-dimm: rgba(100, 108, 255, 0.08);
28 | } */
29 | :root {
30 | /* --vp-c-brand: #6379f6; */
31 | --vp-c-brand: var(--primary-color);
32 | /* --vp-c-brand-light: #6379f6; */
33 | --vp-c-brand-light: var(--primary-color);
34 | --vp-c-brand-lighter: #505058;
35 | --vp-c-brand-lightest: #1a1a20;
36 | /* --vp-c-brand-dark: #6379f6; */
37 | /* --vp-c-brand-dark: #6379f6; */
38 | --vp-c-brand-dark: var(--primary-color);
39 | --vp-c-brand-dimm: rgba(100, 108, 255, 0.08);
40 |
41 | --vp-c-brand-opacity: var(--primary-color-hover);
42 | --vp-c-brand-hover: var(--primary-color-hover);
43 | }
44 |
45 | /**
46 | * Component: Button
47 | * -------------------------------------------------------------------------- */
48 |
49 | :root {
50 | --vp-button-brand-border: var(--vp-c-brand-light);
51 | --vp-button-brand-text: var(--vp-c-text-dark-1);
52 | --vp-button-brand-bg: var(--vp-c-brand);
53 | --vp-button-brand-hover-border: var(--vp-c-brand-light);
54 | --vp-button-brand-hover-text: var(--vp-c-text-dark-1);
55 | --vp-button-brand-hover-bg: var(--vp-c-brand-light);
56 | --vp-button-brand-active-border: var(--vp-c-brand-light);
57 | --vp-button-brand-active-text: var(--vp-c-text-dark-1);
58 | --vp-button-brand-active-bg: var(--vp-button-brand-bg);
59 | }
60 |
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/bin/help.ts:
--------------------------------------------------------------------------------
1 | import prettier from 'prettier'
2 | import yaml from 'yaml'
3 | import path from 'path'
4 | import fs from 'fs'
5 |
6 | const cwd = process.cwd()
7 | const resolve = (...args: any[]) => path.resolve(cwd, ...args)
8 |
9 | const prettierConfigPath = '.prettierrc'
10 |
11 | export const format = (content: string, userOptions = { parser: 'javascript' }) => {
12 | const defaultOptionBuffer = fs.readFileSync(resolve(prettierConfigPath))
13 | const defaultOptions = yaml.parse(defaultOptionBuffer.toString())
14 | const options = Object.assign({}, defaultOptions, userOptions)
15 | return prettier.format(content, options)
16 | }
17 |
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/client/components/DemoBlock.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
19 |
20 |
32 |
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/client/components/Message.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
{{ item.content }}
9 |
10 |
11 |
12 |
13 |
52 |
53 |
100 |
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/client/components/message.js:
--------------------------------------------------------------------------------
1 | import { createApp, h } from 'vue'
2 | import Message from './Message.vue'
3 |
4 | // newInstance
5 | Message.newInstance = (props = {}) => {
6 | const container = document.createElement('div')
7 |
8 | const app = createApp({
9 | render() {
10 | return h(Message, {
11 | ...props,
12 | ref: 'messageRef',
13 | })
14 | },
15 | })
16 |
17 | const instance = app.mount(container)
18 | const messageRef = instance.$refs.messageRef
19 | document.body.appendChild(container.firstElementChild)
20 |
21 | return {
22 | add(messageProps) {
23 | messageRef.add(messageProps)
24 | },
25 | remove(name) {
26 | messageRef.remove(name)
27 | },
28 | }
29 | }
30 |
31 | // message
32 | let messageInstance
33 |
34 | function getMessageInstance() {
35 | messageInstance = messageInstance || Message.newInstance()
36 | return messageInstance
37 | }
38 |
39 | function message(content, { duration = 3, type = '' }) {
40 | const instance = getMessageInstance()
41 |
42 | instance.add({ content, duration, type })
43 | }
44 |
45 | export default {
46 | info(content, options) {
47 | return message(content, { ...options })
48 | },
49 | error(content, options) {
50 | return message(content, { ...options, type: 'error' })
51 | },
52 | }
53 |
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/client/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/.vitepress/vitepress-theme-demoblock/client/index.ts
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/client/utils.ts:
--------------------------------------------------------------------------------
1 | export function stripScript(content: string) {
2 | const result = content.match(/<(script)>([\s\S]+)<\/\1>/)
3 | return result && result[2] ? result[2].trim() : ''
4 | }
5 |
6 | export function stripStyle(content: string) {
7 | const result = content.match(/<(style)\s*>([\s\S]+)<\/\1>/)
8 | return result && result[2] ? result[2].trim() : ''
9 | }
10 |
11 | // 编写例子时不一定有 template。所以采取的方案是剔除其他的内容
12 | function _stripTemplate(content: string) {
13 | content = content.trim()
14 | if (!content) {
15 | return content
16 | }
17 | return content.replace(/<(script|style)[\s\S]+<\/\1>/g, '').trim()
18 | }
19 |
20 | export function stripTemplate(content: string) {
21 | const result = _stripTemplate(content)
22 | if (result.indexOf('') === 0) {
23 | const html = result.replace(/^/, '').replace(/<\/template>$/, '')
24 | return html
25 | .replace(/^[\r?\n|\r]/, '')
26 | .replace(/[\r?\n|\r]$/, '')
27 | .trim()
28 | }
29 | return result
30 | }
31 |
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/node/index.ts:
--------------------------------------------------------------------------------
1 | import { demoblock } from './demoblock'
2 |
3 | export * from './demoblock'
4 | export * from '../types'
5 |
6 | export { demoblock as demoBlockPlugin } from './demoblock'
7 |
8 | export default demoblock
9 |
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/node/markdown-it-container.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'markdown-it-container' {
2 | import type { PluginWithParams } from 'markdown-it'
3 | const container: PluginWithParams
4 | export = container
5 | }
6 |
--------------------------------------------------------------------------------
/docs/.vitepress/vitepress-theme-demoblock/node/patterns.ts:
--------------------------------------------------------------------------------
1 | export const ScriptSetupPattern = /<(script)(?:.* \bsetup\b)?[^>]*>([\s\S]+)<\/\1>/
2 | export const StylePattern = /<(style)[^>]*>([\s\S]+)<\/\1>/
3 | export const ScriptOrStyleReplacePattern = /<(script|style)[\s\S]+<\/\1>/g
4 | export const TemplateReplacePattern = /([\s\S]+)<\/template>/g
5 | export const ScriptMatchPattern = /^.*(
41 |
42 |
43 |
44 |
45 |
46 | ```
47 |
48 | :::
49 |
--------------------------------------------------------------------------------
/docs/components/backtop.md:
--------------------------------------------------------------------------------
1 | # Backtop 回到顶部
2 |
3 | ## 基本使用
4 |
5 |
6 |
7 | 向下滑动显示
8 | 向下滑动显示
9 | 向下滑动显示
10 |
11 | ::: details 点击展开
12 |
13 | ```html
14 |
15 | ```
16 |
17 | :::
18 |
19 | ## 圆形
20 |
21 |
22 | ::: details 点击展开
23 | ```vue
24 |
25 | ```
26 | :::
27 |
28 | ## 自定义图标
29 |
30 |
31 |
32 |
33 |
34 | ::: details 点击展开
35 |
36 | ```vue
37 |
38 |
39 | ```
40 |
41 | :::
42 |
43 | ## attrs
44 |
45 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
46 | | ------ | :------------: | :----: | :------------: | -----: |
47 | | icon | icon 名称 | string | `ik-icon name` | - |
48 | | bottom | 距离底部距离 | number | - | 120 |
49 | | right | 距离右侧部距离 | number | - | 60 |
50 |
--------------------------------------------------------------------------------
/docs/components/calendar.md:
--------------------------------------------------------------------------------
1 | # 日历
2 |
3 | 日历组件 🐥
4 |
5 | ## 基础使用
6 |
7 | ::: demo
8 |
9 | ```vue
10 |
11 |
12 |
13 | ```
14 |
15 | :::
16 |
17 | ## 基础配置
18 |
19 | `showLunar`配置显示农历,显示当前月份
20 | ::: demo
21 |
22 | ```vue
23 |
24 |
25 |
26 | ```
27 |
28 | :::
29 |
--------------------------------------------------------------------------------
/docs/components/card.md:
--------------------------------------------------------------------------------
1 | # Card 卡片
2 |
3 | 最基础的卡片容器,可承载文字、列表、图片、段落,常用于后台概览页面。
4 |
5 | ## 基础用法
6 |
7 |
8 |
9 | this is header
10 | this is card content.
11 |
12 |
13 |
14 | ::: details 点击查看源代码
15 |
16 | ```vue
17 |
18 |
19 | this is header
20 | this is card content.
21 |
22 |
23 | ```
24 |
25 | :::
26 |
27 | ## 简单用法
28 |
29 |
30 |
31 | this is card content.
32 |
33 |
34 |
35 | ::: details 点击查看源代码
36 |
37 | ```vue
38 |
39 | this is card content.
40 |
41 | ```
42 |
43 | :::
44 |
45 | ## 阴影配置
46 |
47 |
48 |
49 |
50 | 始终展示
51 |
52 |
53 | hover展示
54 |
55 |
56 | 无阴影
57 |
58 |
59 |
60 |
61 | ::: details 点击查看源代码
62 |
63 | ```vue
64 |
65 |
66 | 始终展示
67 | hover展示
68 | 无阴影
69 |
70 |
71 | ```
72 |
73 | :::
74 |
75 | ## 3D 悬浮效果
76 |
77 |
78 | content...
79 |
80 |
81 |
90 |
--------------------------------------------------------------------------------
/docs/components/carousel.md:
--------------------------------------------------------------------------------
1 | # 轮播 Carousel
2 |
3 | :::demo
4 |
5 | ```vue
6 |
7 |
8 | 1
9 | 2
10 | 3
11 | 4
12 |
13 |
14 | ```
15 |
16 | :::
17 |
--------------------------------------------------------------------------------
/docs/components/checkbox.md:
--------------------------------------------------------------------------------
1 | # 复选框 Checkbox
2 |
3 | ## 单个复选
4 |
5 | 绑定值为`boolean`类型
6 |
7 |
8 | {{ checked1 }}
9 | {{ checked2 }}
10 |
11 | ::: details 点击展开
12 |
13 | ```html
14 |
19 |
20 |
21 |
22 |
23 | ```
24 |
25 | :::
26 |
27 | ## 多个选项可用复选框组
28 |
29 | 返回`array[]`
30 |
31 |
32 |
33 |
34 |
35 | {{ checkedList1 }}
36 |
37 | ::: details 点击展开
38 |
39 | ```vue
40 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | {{ checkedList1 }}
51 |
52 | ```
53 |
54 | :::
55 |
56 |
62 |
--------------------------------------------------------------------------------
/docs/components/collapse-transition.md:
--------------------------------------------------------------------------------
1 | # 折叠动画 CollapseTransition
2 |
3 |
4 |
5 |
6 |
7 |
8 |
鸡~
9 |
哎呦~你干嘛
10 |
厉不厉害你k哥
11 |
12 |
13 |
14 | :::details 点击展开
15 |
16 | ```vue
17 |
21 |
22 |
23 |
24 |
25 |
26 |
鸡~
27 |
哎呦~你干嘛
28 |
厉不厉害你k哥
29 |
30 |
31 |
32 | ```
33 |
34 | :::
35 |
36 |
40 |
--------------------------------------------------------------------------------
/docs/components/drawer.md:
--------------------------------------------------------------------------------
1 | # 抽屉 Drawer
2 |
3 | 呼出一个临时的侧边栏, 设置`position`可以从多个方向呼出
4 |
5 | onOpen('left')">left
6 | onOpen('right')">right
7 | onOpen('top')">top
8 | onOpen('bottom')">bottom
9 |
10 |
11 | content...
12 |
13 |
14 | ::: details 点击查看源码
15 |
16 | ```vue
17 |
18 |
19 | onOpen('left')">left
20 | onOpen('right')">right
21 | onOpen('top')">top
22 | onOpen('bottom')">bottom
23 |
24 | content...
25 |
26 |
37 | ```
38 |
39 | :::
40 |
41 |
53 |
--------------------------------------------------------------------------------
/docs/components/empty.md:
--------------------------------------------------------------------------------
1 | # 空状态 Empty
2 |
3 | 空状态时的占位提示 🐤
4 |
5 | ## 基础用法
6 |
7 | ::: demo
8 |
9 | ```vue
10 |
11 |
12 |
13 | ```
14 |
15 | :::
16 |
17 | ## 自定义图片
18 |
19 | 通过设置`image`设置自定义图片
20 |
21 | ::: demo
22 |
23 | ```vue
24 |
25 |
28 |
29 | ```
30 |
31 | :::
32 |
33 | ## 底部内容
34 |
35 | 可使用默认插槽在底部插入内容
36 | ::: demo
37 |
38 | ```vue
39 |
40 |
41 | Back Home
42 |
43 |
44 | ```
45 |
46 | :::
47 |
--------------------------------------------------------------------------------
/docs/components/icon.md:
--------------------------------------------------------------------------------
1 | # 图标 Icon
2 |
3 | 语义化的矢量图形 🐥
4 |
5 | ## 不同颜色
6 |
7 | ::: demo
8 |
9 | ```vue
10 |
11 |
17 |
18 | ```
19 |
20 | :::
21 |
22 | ## 不同大小
23 |
24 | ::: demo
25 |
26 | ```vue
27 |
28 |
34 |
35 | ```
36 |
37 | :::
38 |
39 | ## 部分展示
40 |
41 |
58 |
63 |
64 | ::: details 点击展开
65 |
66 | ```vue
67 |
83 |
84 |
89 |
90 | ```
91 |
92 | :::
93 |
94 | ## attrs
95 |
96 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
97 | | ----- | :--: | :---------------------: | :----: | -----: |
98 | | name | 名称 | string | | |
99 | | size | 大小 | string | - | - |
100 | | color | 颜色 | string<`CSSProperties`> | - | - |
101 |
102 |
120 |
--------------------------------------------------------------------------------
/docs/components/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/components/index.md
--------------------------------------------------------------------------------
/docs/components/input.md:
--------------------------------------------------------------------------------
1 | # 输入框 Input
2 |
3 | ## 基本使用
4 |
5 | 通常可以直接使用内置指令`v-model`实现双向绑定
6 |
7 | {{ inputValue1 }}
8 |
9 | :::details 点击展开
10 |
11 | ```vue
12 |
13 |
14 |
15 | ```
16 |
17 | :::
18 |
19 | ## 清除图标
20 |
21 | 直接添加`hasClear`属性可使输入框带有清除图标
22 |
23 |
24 | :::details 点击展开
25 |
26 | ```vue
27 |
31 |
32 |
33 |
34 | ```
35 |
36 | :::
37 |
38 |
43 |
44 | ## 前缀和后缀
45 |
46 | ::: demo
47 |
48 | ```vue
49 |
50 |
51 |
52 |
53 |
54 |
55 | ```
56 |
57 | :::
58 |
--------------------------------------------------------------------------------
/docs/components/layout.md:
--------------------------------------------------------------------------------
1 | # 布局容器 Layout
2 |
3 | 协助进行页面级整体布局 🏀
4 |
5 | ## 常见页面布局
6 |
7 |
8 |
9 |
10 | main
11 |
12 |
13 |
14 |
15 |
16 |
17 | aside
18 |
19 |
20 | main
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | aside
29 | main
30 |
31 |
32 |
33 | ::: details 点击展开
34 |
35 | ```html
36 |
37 | header
38 | main
39 |
40 |
41 |
42 | aside
43 |
44 | header
45 | main
46 |
47 |
48 |
49 |
50 | aside
51 | main
52 |
53 | ```
54 |
55 | :::
56 |
57 |
69 |
--------------------------------------------------------------------------------
/docs/components/loading.md:
--------------------------------------------------------------------------------
1 | # loading 组件、指令
2 |
3 | 用于页面和区块的加载中状态
4 |
5 | ## 基本使用
6 |
7 |
8 | 切换loading
9 |
10 |
11 |
雨霖铃
12 |
寒蝉凄切
13 |
对长亭晚
14 |
骤雨初歇
15 |
16 |
17 | ::: details 点击展开
18 |
19 | ```vue
20 |
21 | 切换loading
22 |
23 |
雨霖铃
24 |
寒蝉凄切
25 |
对长亭晚
26 |
骤雨初歇
27 |
28 |
29 |
36 | ```
37 |
38 | :::
39 |
40 | ## 全屏
41 |
42 | 切换全屏 loading
43 |
44 |
45 |
46 | :::details 点击展开
47 |
48 | ```html
49 | 切换全屏loading
50 |
51 | ```
52 |
53 | :::
54 |
55 | ## 方法调用
56 |
57 | 打开 loading
58 |
59 | ::: details 点击展开
60 |
61 | ```html
62 |
69 | 打开loading
70 | ```
71 |
72 | :::
73 |
74 |
95 |
--------------------------------------------------------------------------------
/docs/components/lockScreen.md:
--------------------------------------------------------------------------------
1 | # 锁屏 LockScreen
2 |
3 |
4 |
5 |
6 | 打开锁屏
7 |
8 |
9 |
10 | ::: details
11 |
12 | ```vue
13 |
25 |
26 |
27 |
28 |
29 | 打开锁屏
30 |
31 |
32 |
33 | ```
34 |
35 | :::
36 |
37 |
49 |
--------------------------------------------------------------------------------
/docs/components/menu.md:
--------------------------------------------------------------------------------
1 | # 导航菜单
2 |
3 | 为页面和功能提供导航的菜单列表
4 |
5 | ## 基础使用
6 |
7 | 支持直接传入字段渲染,默认根据 `children`字段渲染子菜单
8 |
9 |
64 |
65 |
66 | ::: details 点击展开
67 |
68 | ```vue
69 |
124 |
125 |
126 |
127 | ```
128 |
129 | :::
130 |
131 |
136 |
--------------------------------------------------------------------------------
/docs/components/message.md:
--------------------------------------------------------------------------------
1 | # 消息提示 Message
2 |
3 | ## 基本使用
4 |
5 | 直接传入文本可快速调用
6 |
7 |
8 | 显示消息
9 |
10 |
11 | ::: details 点击展开
12 |
13 | ```html
14 |
21 |
22 | 显示消息
23 |
24 | ```
25 |
26 | :::
27 |
28 | ## 消息类型
29 |
30 | message 有多个消息类型可用: `success`、`warning`、 `info`
31 |
32 |
33 | 成功提示
34 | 警告提示
35 |
36 |
37 | ::: details 点击展开
38 |
39 | ```js
40 | const openMessage2 = () => {
41 | _global?.appContext.config.globalProperties.$message.success('这是成功提示')
42 | }
43 | const openMessage3 = () => {
44 | _global?.appContext.config.globalProperties.$message.warning('这是警告提示')
45 | }
46 | ```
47 |
48 | :::
49 |
50 | ## 多个参数
51 |
52 |
53 | 提 示
54 |
55 |
56 | ::: details 点击展开
57 |
58 | ```js
59 | const openMessage4 = () => {
60 | _global?.appContext.config.globalProperties.$message({
61 | type: 'info',
62 | message: '这是一个提示',
63 | duration: 5000,
64 | })
65 | }
66 | ```
67 |
68 | :::
69 |
70 | ## 属性
71 |
72 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
73 | | -------- | :----------: | :----: | :-------------: | -----: |
74 | | type | 提示类型 | string | success/warning | |
75 | | message | 提示文字 | string | - | / |
76 | | duration | 提示展示时长 | number | - | / |
77 |
78 |
98 |
105 |
--------------------------------------------------------------------------------
/docs/components/modal.md:
--------------------------------------------------------------------------------
1 | # 对话框 Modal
2 |
3 | ## 基础使用
4 |
5 | 打开 modal
6 |
7 | ::: details 点击展开
8 |
9 | ```vue
10 |
17 |
18 | 打开 modal
19 | modal contents ...
20 |
21 | ```
22 |
23 | :::
24 |
25 |
26 | modal contents ...
27 |
28 |
29 |
36 |
--------------------------------------------------------------------------------
/docs/components/popper.md:
--------------------------------------------------------------------------------
1 | # Popper
2 |
--------------------------------------------------------------------------------
/docs/components/ripple.md:
--------------------------------------------------------------------------------
1 | # 水波纹 Ripple
2 |
3 | 使元素点击时生成一个水波扩散的效果,此效果通过`自定义指令`实现 🏀
4 |
5 | ## 基本使用
6 |
7 | 直接添加指令`v-ripple`即可
8 |
9 | :::demo
10 |
11 | ```vue
12 |
13 |
14 | 按钮1
15 | 按钮2
16 | click me
17 |
18 |
19 |
33 | ```
34 |
35 | :::
36 |
37 | ## 自定义波纹颜色
38 |
39 | `v-ripple`指令中字面量传参可自定义颜色
40 |
41 | :::demo
42 |
43 | ```vue
44 |
45 |
46 | click me
47 | click me
48 |
49 |
50 |
64 | ```
65 |
66 | :::
67 |
--------------------------------------------------------------------------------
/docs/components/select.md:
--------------------------------------------------------------------------------
1 | # 下拉框 Select
2 |
3 | ## 基本使用
4 |
5 |
6 | {{ selection }}
7 |
8 |
12 |
13 | ::: details 点击展开
14 |
15 | ```vue
16 |
17 | {{ selection }}
18 |
19 |
23 | ```
24 |
25 | :::
26 |
27 | ## 可搜索
28 |
29 |
30 |
31 | ::: details 点击展开
32 |
33 | ```vue
34 |
35 |
36 |
40 | ```
41 |
42 | :::
43 |
--------------------------------------------------------------------------------
/docs/components/skeleton.md:
--------------------------------------------------------------------------------
1 | # skeleton
2 |
3 | ## 基础使用
4 |
5 | :::demo
6 |
7 | ```vue
8 |
9 |
10 |
11 |
12 | ```
13 |
14 | :::
15 |
16 | ## 显示动画
17 |
18 | `active`可配置动画效果
19 |
20 | :::demo
21 |
22 | ```vue
23 |
24 |
25 |
26 |
27 | ```
28 |
29 | :::
30 |
31 | ## 切换效果
32 |
33 |
34 |
35 |
36 |
37 |
38 |
大家好
39 |
我是练习时长两年半的
40 |
🐥🏀
41 |
42 |
43 |
44 | ::: details 点击展开
45 |
46 | ```vue
47 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
大家好
58 |
我是练习时长两年半的
59 |
🐥🏀
60 |
61 |
62 |
63 | ```
64 |
65 | :::
66 |
67 |
71 |
--------------------------------------------------------------------------------
/docs/components/slider.md:
--------------------------------------------------------------------------------
1 | # 滑块 Slider
2 |
3 | 通过拖动滑块 🏀 在一个间内进行选择
4 |
5 | ## 基础使用
6 |
7 | `v-model`绑定值,可通过设置绑定值自定义滑块的初始值
8 |
9 | :::demo
10 |
11 | ```vue
12 |
16 |
17 |
18 | {{ val }}
19 |
20 | ```
21 |
22 | :::
23 |
24 | ## 属性配置
25 |
26 | 可开启`ikun`属性
27 | :::demo
28 |
29 | ```vue
30 |
34 |
35 |
36 | {{ val }}
37 |
38 | ```
39 |
40 | :::
41 |
--------------------------------------------------------------------------------
/docs/components/space.md:
--------------------------------------------------------------------------------
1 | # 间距 Space
2 |
3 | 通过此组件为其子元素提供公共间距
4 |
5 | ## 基础用法
6 |
7 |
8 | 按钮一
9 | 按钮二
10 | 按钮三
11 |
12 |
13 | ::: details 点击展开
14 |
15 | ```vue
16 |
17 |
18 | 按钮一
19 | 按钮二
20 | 按钮三
21 |
22 |
23 | ```
24 |
25 | :::
26 |
27 | ## 调节间距与布局方式
28 |
29 | `size`属性可设置间距大小
30 |
31 | 按钮一
32 | 按钮二
33 | 按钮三
34 |
35 |
36 |
37 |
38 | 按钮四
39 | 按钮五
40 | 按钮六
41 |
42 |
43 | ::: details 点击展开
44 |
45 | ```vue
46 |
47 |
48 | 按钮一
49 | 按钮二
50 | 按钮三
51 |
52 |
53 |
54 | 按钮四
55 | 按钮五
56 | 按钮六
57 |
58 |
59 | ```
60 |
61 | :::
62 |
63 | ## 排列方向与换行
64 |
65 | 设置`direction`设置横向、竖向。`wrap`设置是否换行
66 |
67 |
68 | content one
69 | content two
70 | content three
71 |
72 |
73 |
74 |
75 | content one
76 | content two
77 | content three
78 |
79 |
80 |
81 |
91 |
--------------------------------------------------------------------------------
/docs/components/switch.md:
--------------------------------------------------------------------------------
1 | # 开关 Switch
2 |
3 | ## 基础使用
4 |
5 | `v-model`绑定值
6 |
7 |
8 | {{ switchValue }}
9 |
10 | :::details 点击展开
11 |
12 | ```vue
13 |
14 | {{ switchValue }}
15 |
16 |
20 | ```
21 |
22 | :::
23 |
24 | ## 其他配置
25 |
26 | 可通过配置`style`配置开关状态的背景色,其属性名必须为`--switch-bg-on-color`和`--switch-bg-off-color`。
27 | `square`属性可将其设置为方形。`true-text` 和 `false-text`则可配置开关状态的文字。
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | ::: details 点击展开
37 |
38 | ```vue
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
56 | ```
57 |
58 | :::
59 |
60 | ## attrs
61 |
62 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
63 | | ---------- | :------------: | :-----: | :------------: | -----: |
64 | | true-text | 开状态的文字 | string | \* | - |
65 | | false-text | 关状态下的文字 | string | \* | - |
66 | | square | 是否方形 | boolean | `true` `false` | - |
67 | | style | 样式配置 | object | - | - |
68 |
69 |
79 |
--------------------------------------------------------------------------------
/docs/components/tab.md:
--------------------------------------------------------------------------------
1 | # 选项卡
2 |
3 | 选项卡切换组件
4 |
5 | ## 基础使用
6 |
7 | :::demo
8 |
9 | ```vue
10 |
11 |
12 | 内容一
13 | 内容二
14 | 内容三
15 |
16 |
17 | ```
18 |
19 | :::
20 |
21 | ## 头部样式设置
22 |
23 | `type`属性可设置头部样式,可选值为`segmented` `default` `card`
24 |
25 | :::demo
26 |
27 | ```vue
28 |
29 |
30 | 内容一
31 | 内容二
32 | 内容三
33 |
34 |
35 | ```
36 |
37 | :::
38 |
--------------------------------------------------------------------------------
/docs/components/tag.md:
--------------------------------------------------------------------------------
1 | # 标签 Tag
2 |
3 | 可进行标记 🐥 和分类 🏀 的小标签
4 |
5 | ## 基础使用
6 |
7 | `type`指定`tag`的类型,默认为`primary`
8 |
9 | :::demo
10 |
11 | ```vue
12 |
13 |
14 | ikun
15 | Tag 2
16 | Tag 3
17 | Tag 4
18 |
19 |
20 | ```
21 |
22 | :::
23 |
24 | ## 可关闭
25 |
26 | `closeable`配置 tag 可删除
27 |
28 | :::demo
29 |
30 | ```vue
31 |
32 |
33 | Tag 1
34 | Tag 2
35 | Tag 3
36 | Tag 4
37 |
38 |
39 | ```
40 |
41 | :::
42 |
43 | ## 双标签
44 |
45 | `tag`支持双色标签
46 |
47 | :::demo
48 |
49 | ```vue
50 |
51 |
52 |
53 | ikun
54 | ui
55 |
56 |
57 |
58 | ikun
59 | hub
60 |
61 |
62 |
63 | ```
64 |
65 | :::
66 |
--------------------------------------------------------------------------------
/docs/guide/index.md:
--------------------------------------------------------------------------------
1 | # 开始
2 |
3 |
4 |
5 | ## 总览
6 |
7 | IKUNUI(ikun ui),个人兴趣爱好的产物,当前请勿用于生产环境,此库:
8 |
9 | - 🐥 基于 TypeScript
10 | - ⚡ 基于 Vite
11 | - 🏀 vue3
12 | - ✨ monorepo 风格仓库
13 |
14 | ```bash
15 | npm install ikun-ui
16 | ```
17 |
18 | ```js
19 | import ikun from 'ikun-ui'
20 | app.use(ikun)
21 | ```
22 |
23 |
24 |
--------------------------------------------------------------------------------
/docs/guide/overview.md:
--------------------------------------------------------------------------------
1 | # 组件总览
2 |
3 | ::: warning
4 | 文档编写中...
5 | :::
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | hello ikun
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | hello ikun
30 |
31 |
32 |
33 |
34 |
35 |
36 | 222
37 |
38 |
39 |
40 |
41 |
42 |
53 |
54 |
85 |
--------------------------------------------------------------------------------
/docs/guide/quickstart.md:
--------------------------------------------------------------------------------
1 | # 快速上手
2 |
3 |
4 |
5 | ## 安装
6 |
7 | ```bash
8 | npm install ikun-ui
9 | ```
10 |
11 | ## 引入
12 |
13 | ```js{4,5}
14 | import { createApp } from 'vue'
15 | import App from './app.vue'
16 |
17 | import ikun from 'ikun-ui'
18 | import 'ikui/lib/index.css'
19 |
20 | createApp(App).use(ikun).mount('#app')
21 |
22 | // or
23 |
24 | import { IkButton } from 'ikun-ui'
25 | app.use(IkButton)
26 | ```
27 |
28 | ## 使用
29 |
30 | ```html
31 |
32 | 按 钮
33 |
34 |
35 | ```
36 |
37 | ## 效果
38 |
39 |
40 | 按 钮
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/docs/guide/timeline.md:
--------------------------------------------------------------------------------
1 | # 节点及规划
2 |
3 | - ✔ 按钮 | 输入框 | 图标 `SFC`
4 | - ✔ 加载 `Directive`
5 | - ✔ 提示 `Function`
6 | - ✔ 复选框 `SFC嵌套`
7 | - ✔ 回到顶部 `TSX`
8 | - × 手风琴 `TSX`
9 |
10 | ::: tip
11 | 文档编写中...
12 | :::
13 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: home
3 |
4 | title: IKUNUI
5 | titleTemplate: A simple UI
6 |
7 | hero:
8 | name: IKUN-UI
9 | text: A simple UI
10 | tagline: Built on Vue3 and Vitejs .
11 | image:
12 | # src: /logo-with-shadow.png
13 | src: /layer5.png
14 | alt: IKUN-UI
15 | actions:
16 | - theme: brand
17 | text: ✨ Get Start
18 | link: /guide/
19 | # - theme: alt
20 | # text: 为什么选IKUI
21 | # link: /guide/why
22 | - theme: alt
23 | text: 👉 View on Github
24 | link: https://github.com/LAINE001/ikun-ui
25 |
26 | features:
27 | - icon: 🎵
28 | title: Sing
29 | details:
30 | - icon: ⚡️
31 | title: Dancing
32 | details:
33 | - icon: 🛠️
34 | title: Rap
35 | details:
36 | - icon: 🏀
37 | title: Basketball
38 | details:
39 | ---
40 |
--------------------------------------------------------------------------------
/docs/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/favicon.ico
--------------------------------------------------------------------------------
/docs/public/fullscreen-bg2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/fullscreen-bg2.jpg
--------------------------------------------------------------------------------
/docs/public/ik-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/ik-1.jpg
--------------------------------------------------------------------------------
/docs/public/ik-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/ik-2.jpg
--------------------------------------------------------------------------------
/docs/public/ik-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/ik-3.jpg
--------------------------------------------------------------------------------
/docs/public/ik-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/ik-4.png
--------------------------------------------------------------------------------
/docs/public/ik-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/ik-5.png
--------------------------------------------------------------------------------
/docs/public/ik-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/ik-6.png
--------------------------------------------------------------------------------
/docs/public/ik-7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/ik-7.png
--------------------------------------------------------------------------------
/docs/public/ikun.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/ikun.gif
--------------------------------------------------------------------------------
/docs/public/layer5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/public/layer5.png
--------------------------------------------------------------------------------
/docs/shims-vue.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import { DefineComponent } from 'vue'
3 | const component: DefineComponent, Record, unknown>
4 | export default component
5 | }
6 |
--------------------------------------------------------------------------------
/docs/styles/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laine001/ikun-ui/b4da78aa7e152fb135ad9350e3b30a494004a9aa/docs/styles/index.md
--------------------------------------------------------------------------------
/docs/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import vueJsx from '@vitejs/plugin-vue-jsx'
3 | import setupNamePlugin from '../vite-plugin-setup-name'
4 |
5 | export default defineConfig({
6 | plugins: [vueJsx(), setupNamePlugin()],
7 | server: {
8 | port: 9527,
9 | },
10 | })
11 |
--------------------------------------------------------------------------------
/global.d.ts:
--------------------------------------------------------------------------------
1 | declare module '@vue/runtime-core' {
2 | export interface GlobalComponents {
3 | IkButton: typeof import('ikuiv')['IkButton']
4 | IkIcon: typeof import('ikuiv')['IkIcon']
5 | IkInput: typeof import('ikuiv')['IkInput']
6 | IkCheckbox: typeof import('ikuiv')['IkCheckbox']
7 | }
8 | }
9 |
10 | export {}
11 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ikuiv",
3 | "packageManager": "pnpm@7.3.0",
4 | "version": "1.0.0",
5 | "description": "",
6 | "main": "index.js",
7 | "homepage": "https://laine001.github.io/ikun-ui/",
8 | "scripts": {
9 | "play": "vite",
10 | "build": "pnpm build:pkg && pnpm build:theme && pnpm gen",
11 | "build:pkg": "vite build",
12 | "build:theme": "vite build --config ./scripts/build-theme.config.ts",
13 | "docs:dev": "vitepress dev docs",
14 | "docs:build": "vitepress build docs",
15 | "netlify:build": "vitepress build docs --env=netlify",
16 | "docs:serve": "vitepress serve docs",
17 | "lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix",
18 | "format": "prettier --write --cache .",
19 | "test:run": "vitest run",
20 | "coverage": "vitest run --coverage",
21 | "prepare": "husky install",
22 | "gen": "node ./scripts/gen.ts"
23 | },
24 | "keywords": [],
25 | "author": "",
26 | "license": "ISC",
27 | "dependencies": {
28 | "@mdit-vue/plugin-sfc": "^0.12.0",
29 | "@vitejs/plugin-vue": "^3.1.0",
30 | "@vitejs/plugin-vue-jsx": "^2.0.1",
31 | "@vue/compiler-sfc": "^3.2.39",
32 | "jsdom": "^20.0.0",
33 | "magic-string": "^0.26.4",
34 | "markdown-it": "^13.0.1",
35 | "markdown-it-container": "^3.0.0",
36 | "packages": "^0.0.8",
37 | "sass": "1.54.9",
38 | "vite": "^3.1.0",
39 | "vue": "3.4.21"
40 | },
41 | "devDependencies": {
42 | "@ikui/theme": "workspace:^1.0.0",
43 | "@typescript-eslint/eslint-plugin": "^5.44.0",
44 | "@typescript-eslint/parser": "^5.44.0",
45 | "@vitest/coverage-c8": "^0.30.1",
46 | "@vitest/coverage-istanbul": "^0.30.1",
47 | "@vue/test-utils": "^2.0.2",
48 | "@vueuse/core": "^10.1.2",
49 | "chalk": "^5.2.0",
50 | "chalk-animation": "^2.0.3",
51 | "clear": "^0.1.0",
52 | "eslint": "^8.24.0",
53 | "eslint-config-prettier": "^8.5.0",
54 | "eslint-config-standard-with-typescript": "^23.0.0",
55 | "eslint-plugin-import": "^2.25.2",
56 | "eslint-plugin-n": "^15.0.0",
57 | "eslint-plugin-prettier": "^4.2.1",
58 | "eslint-plugin-promise": "^6.0.0",
59 | "eslint-plugin-vue": "^9.8.0",
60 | "figlet": "^1.6.0",
61 | "gitalk": "^1.8.0",
62 | "husky": "^8.0.2",
63 | "i": "^0.3.7",
64 | "ikuiv": "workspace:0.0.1-alpha.5",
65 | "inquirer": "^9.2.7",
66 | "npm": "^9.6.4",
67 | "prettier": "^2.7.1",
68 | "typescript": "*",
69 | "vanilla-tilt": "^1.8.0",
70 | "vite-plugin-dts": "^1.6.6",
71 | "vitepress": "^1.0.1",
72 | "vitest": "^0.29.8",
73 | "vue-router": "^4.2.2",
74 | "vue3-popper": "^1.5.0"
75 | },
76 | "pnpm": {
77 | "peerDependencyRules": {
78 | "ignoreMissing": [
79 | "@algolia/client-search"
80 | ]
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/packages/ikui-components/README.md:
--------------------------------------------------------------------------------
1 | # ikun
2 |
3 |
4 |
5 |
6 |
7 |
8 | IkUI
9 |
10 |
11 |
12 | a simple ui components built on vue3
13 |
14 |
15 |
16 |
17 |
18 |
19 | ## Features
20 |
21 | - 🏀 vue3、typescript
22 | - ⚡ vite3
23 | - 🌈 pnpm
24 |
25 | ## Install
26 |
27 | Using `npm` to install:
28 |
29 | ```bash
30 | npm i ikun-ui
31 | ```
32 |
33 | Using `yarn` or `pnpm` to install:
34 |
35 | ```bash
36 | yarn add ikun-ui
37 |
38 | pnpm add ikun-ui
39 | ```
40 |
41 | ## Quickstart
42 |
43 | ```js
44 | import { createApp } from 'vue'
45 | import App from './app.vue'
46 |
47 | import ikun from 'ikun-ui'
48 | import 'ikun/lib/index.css'
49 |
50 | createApp(App).use(ikun).mount('#app')
51 |
52 | // or
53 |
54 | import { IkButton } from 'ikun-ui'
55 | app.use(IkButton)
56 | ```
57 |
58 | see more in [Quickstart](https://laine001.github.io/ikun-ui)
59 |
60 | ## Links
61 |
62 | - [Documentation](https://laine001.github.io/ikun-ui)
63 | - [Timelines](https://laine001.github.io/ikun-ui)
64 | - [more](https://laine001.github.io/ikun-ui)
65 |
66 | ## Join us
67 |
68 | Hava an idea ? u can join us
69 |
70 |
71 |
72 |
73 |
74 | ## Contributors
75 |
76 |
77 |
78 |
79 |
80 | ## Thanks
81 |
82 | Learn from many excellent community projects
83 |
84 | - [Element-plus](https://github.com/element-plus/element-plus)
85 | - [Vant](https://github.com/youzan/vant)
86 | - [Varlet](https://github.com/varletjs/varlet)
87 | - [Fighting-Design](https://github.com/FightingDesign/fighting-design)
88 |
89 | ## LICENSE
90 |
91 | ...
92 |
--------------------------------------------------------------------------------
/packages/ikui-components/__test__/button.test.ts:
--------------------------------------------------------------------------------
1 | import IkButton from '../button'
2 | import IkIcon from '../icon'
3 | import { describe, expect, test } from 'vitest'
4 | import { mount } from '@vue/test-utils'
5 |
6 | describe('IkButton', () => {
7 | test('class', () => {
8 | const wrapper = mount(IkButton)
9 | expect(wrapper.classes()).toContain('ik-button')
10 | })
11 | test('class', () => {
12 | const wrapper = mount(IkButton, {
13 | props: {
14 | type: 'primary',
15 | },
16 | })
17 | expect(wrapper.classes()).toContain('ik-button-primary')
18 | })
19 | test('loading', () => {
20 | const wrapper = mount(IkButton, {
21 | props: {
22 | loading: true,
23 | },
24 | })
25 | expect(wrapper.classes()).toContain('ik-button')
26 | })
27 | })
28 |
--------------------------------------------------------------------------------
/packages/ikui-components/_utils/useClickOutside.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * clickoutside
3 | * @param target 监听元素
4 | * @param callback 回调
5 | */
6 | export const useClickOutside = (target: HTMLElement, callback: () => void) => {
7 | const handler = (e) => {
8 | const element = e.target
9 | if (element && !e.target.contains(target)) {
10 | // console.log('not')
11 | } else {
12 | callback()
13 | }
14 | }
15 | window.addEventListener('click', handler)
16 | }
17 |
--------------------------------------------------------------------------------
/packages/ikui-components/_utils/useCssVar.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * get or set css var
3 | */
4 | export const useCssVar = (varProp: string, value?: string) => {
5 | if (value) {
6 | document.documentElement.style.setProperty(varProp, value)
7 | } else {
8 | const cssVar = window.getComputedStyle(document.documentElement).getPropertyValue(varProp)
9 | return cssVar
10 | }
11 | }
12 |
13 | /**
14 | * calc color by origin color and olum
15 | * @param hex color
16 | * @param lum opacity
17 | * @returns string
18 | */
19 | export const calcColor = (hex, lum = 0) => {
20 | hex = String(hex).replace(/[^0-9a-f]/gi, '')
21 | if (hex.length < 6) {
22 | hex = `${hex[0]}${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}`
23 | }
24 | let rgb = '#'
25 | let c, i
26 |
27 | for (let i = 0; i < 3; i++) {
28 | c = parseInt(hex.substr(i * 2, 2), 16)
29 | c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16)
30 | rgb += ('00' + c).substr(c.length)
31 | }
32 | return rgb
33 | }
34 |
--------------------------------------------------------------------------------
/packages/ikui-components/_utils/useZIndex.ts:
--------------------------------------------------------------------------------
1 | import { computed, ref } from 'vue'
2 |
3 | const zIndex = ref(0)
4 |
5 | export const useZIndex = () => {
6 | const initialIndex = 2000
7 | const currentZIndex = computed(() => {
8 | return initialIndex + zIndex.value
9 | })
10 | const nextZIndex = () => {
11 | zIndex.value++
12 | return currentZIndex.value
13 | }
14 |
15 | return {
16 | currentZIndex,
17 | nextZIndex,
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/ikui-components/_utils/withInstall.ts:
--------------------------------------------------------------------------------
1 | import type { App, Plugin } from 'vue'
2 |
3 | export type SFCWithInstall = T & Plugin
4 |
5 | export const withInstall = (component: T) => {
6 | ;(component as SFCWithInstall).install = (app: App): void => {
7 | app.component((component as unknown as { name: string }).name, component)
8 | }
9 | return component as SFCWithInstall
10 | }
11 |
12 | export const directiveWithInstall = (component: T) => {
13 | ;(component as SFCWithInstall).install = (app: App): void => {
14 | app.component((component as unknown as { name: string }).name, component)
15 | }
16 | return component as SFCWithInstall
17 | }
18 |
--------------------------------------------------------------------------------
/packages/ikui-components/avatar/index.ts:
--------------------------------------------------------------------------------
1 | import Avatar from './src/avatar'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkAvatar = withInstall(Avatar)
5 |
6 | export default IkAvatar
7 |
8 | export type { AvatarInstance, AvatarProps } from './src/prop'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/avatar/src/avatar.tsx:
--------------------------------------------------------------------------------
1 | import { computed, defineComponent } from 'vue'
2 | import { props } from './prop'
3 |
4 | export default defineComponent({
5 | name: 'ik-avatar',
6 | props,
7 | // emits: ['click'],
8 | // slots, attrs
9 | setup(props) {
10 | const computedCls = computed(() => {
11 | return [
12 | 'ik-avatar',
13 | `ik-avatar--${props.size}`,
14 | {
15 | 'ik-avatar__square': props.square,
16 | },
17 | ]
18 | })
19 | return () => {
20 | const Content = (
21 |
22 |

23 |
24 | )
25 | return Content
26 | }
27 | },
28 | })
29 |
--------------------------------------------------------------------------------
/packages/ikui-components/avatar/src/prop.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes } from 'vue'
2 | import type avatar from './avatar'
3 |
4 | export type AvatarSize = 'small' | 'default' | 'large'
5 |
6 | export const props = {
7 | url: {
8 | type: String,
9 | default: (): string => 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png',
10 | },
11 | square: {
12 | type: Boolean,
13 | default: (): boolean => false,
14 | },
15 | size: {
16 | type: String,
17 | default: (): string => 'default' as AvatarSize,
18 | },
19 | } as const
20 |
21 | export type AvatarProps = ExtractPropTypes
22 | export type AvatarInstance = InstanceType
23 |
--------------------------------------------------------------------------------
/packages/ikui-components/backtop/index.ts:
--------------------------------------------------------------------------------
1 | import Backtop from './src/backtop'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkBacktop = withInstall(Backtop)
5 |
6 | export default IkBacktop
7 |
8 | export type { BacktopInstance, BacktopProps } from './src/prop'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/backtop/src/backtop.tsx:
--------------------------------------------------------------------------------
1 | import { computed, defineComponent, onMounted, ref } from 'vue'
2 | import IkIcon from '../../icon'
3 | import { props } from './prop'
4 |
5 | export default defineComponent({
6 | components: {
7 | IkIcon,
8 | },
9 | name: 'ik-backtop',
10 | props,
11 | emits: ['click'],
12 | // slots, attrs
13 | setup(props, { emit }) {
14 | const show = ref(false)
15 | const handleClick = (event: MouseEvent) => {
16 | emit('click', event)
17 | window.scrollTo({
18 | top: 0,
19 | behavior: 'smooth',
20 | })
21 | }
22 | const onScroll = () => {
23 | const st = document.documentElement.scrollTop
24 | show.value = st > 400 ? true : false
25 | }
26 | onMounted(() => {
27 | // console.log(document.querySelectorAll('.ik-backop'))
28 | window.addEventListener('scroll', onScroll)
29 | })
30 | // watch(show, () => {
31 | // console.log(show.value, 'show')
32 | // })
33 | const computedCls = computed(() => {
34 | return [
35 | 'ik-backtop',
36 | {
37 | 'show-backtop': show.value,
38 | 'ik-backtop__shape': props.shape,
39 | },
40 | ]
41 | })
42 | const computedStyle = computed(() => {
43 | return {
44 | bottom: `${props.bottom || 120}px`,
45 | right: `${props.right}px`,
46 | }
47 | })
48 | return () => {
49 | const Content = (
50 |
51 |
52 |
53 | )
54 | return show.value ? Content : null
55 | }
56 | },
57 | })
58 |
--------------------------------------------------------------------------------
/packages/ikui-components/backtop/src/prop.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes } from 'vue'
2 | import type backtop from './backtop'
3 |
4 | export const props = {
5 | icon: {
6 | type: String,
7 | default: (): string => 'arrow-up',
8 | },
9 | shape: {
10 | type: Boolean,
11 | },
12 | bottom: {
13 | type: Number,
14 | },
15 | right: {
16 | type: Number,
17 | default: (): number => 60,
18 | },
19 | } as const
20 |
21 | export type BacktopProps = ExtractPropTypes
22 | export type BacktopInstance = InstanceType
23 |
--------------------------------------------------------------------------------
/packages/ikui-components/button/index.ts:
--------------------------------------------------------------------------------
1 | import Button from './src/button.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkButton = withInstall(Button)
5 |
6 | export default IkButton
7 |
8 | export type { ButtonInstance, ButtonType } from './src/button'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/button/src/button.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes, PropType } from 'vue'
2 | import type button from './button.vue'
3 |
4 | export const buttonTypes = ['default', 'primary', 'success', 'warning', 'danger'] as const
5 |
6 | export type ButtonSize = 'small' | 'default' | 'large'
7 |
8 | export const buttonProps = {
9 | type: {
10 | type: String,
11 | values: buttonTypes,
12 | default: 'default',
13 | },
14 | disabled: {
15 | type: Boolean,
16 | default: () => false,
17 | },
18 | icon: {
19 | type: String,
20 | },
21 | loading: {
22 | type: Boolean,
23 | default: (): boolean => false,
24 | },
25 | round: {
26 | type: Boolean,
27 | default: false,
28 | },
29 | size: {
30 | type: String as PropType,
31 | default: 'default',
32 | },
33 | plain: {
34 | type: Boolean,
35 | default: false,
36 | },
37 | ikun: {
38 | type: Boolean,
39 | default: false,
40 | },
41 | } as const
42 |
43 | export type ButtonProps = ExtractPropTypes
44 | export type ButtonType = ButtonProps['type']
45 |
46 | export type ButtonInstance = InstanceType
47 |
--------------------------------------------------------------------------------
/packages/ikui-components/button/src/button.vue:
--------------------------------------------------------------------------------
1 |
36 |
37 |
45 |
46 |
--------------------------------------------------------------------------------
/packages/ikui-components/calendar/index.ts:
--------------------------------------------------------------------------------
1 | import Calendar from './src/calendar.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkCalendar = withInstall(Calendar)
5 |
6 | export default IkCalendar
7 |
8 | // export type { IkCalendarInstance, IkCalendarProps } from './src/prop'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/calendar/src/props.ts:
--------------------------------------------------------------------------------
1 | export interface LunarDateType {
2 | lunarYear: string
3 | lunarMonth: string
4 | lunarDay: string
5 | }
6 |
7 | export interface CalendarItemType {
8 | year: number
9 | month: number
10 | day: number
11 | date?: string
12 | lunarDate?: LunarDateType
13 | isToday?: boolean
14 | isYesterday?: boolean
15 | isTomorrow?: boolean
16 | lunarYear?: number
17 | isCurrentMonth?: boolean
18 | currentDate?: string
19 | }
20 |
21 | export type CalendarOperateDate = 'next-year' | 'prev-year' | 'next-month' | 'prev-month' | 'today'
22 |
23 | export const props = {
24 | showLunar: {
25 | type: Boolean,
26 | default: false,
27 | },
28 | } as const
29 |
--------------------------------------------------------------------------------
/packages/ikui-components/card/index.ts:
--------------------------------------------------------------------------------
1 | import Card from './src/card.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkCard = withInstall(Card)
5 |
6 | export default IkCard
7 |
8 | export type { CardInstance, CardProps } from './src/card'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/card/src/card.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes, PropType } from 'vue'
2 | import type card from './card.vue'
3 |
4 | export type ShadowType = 'always' | 'hover' | 'none'
5 |
6 | export const cardProps = {
7 | shadow: {
8 | type: String as PropType,
9 | default: 'always',
10 | },
11 | suspension: {
12 | type: Boolean,
13 | },
14 | height: {
15 | type: String || Number,
16 | },
17 | } as const
18 |
19 | export type CardProps = ExtractPropTypes
20 |
21 | export type CardInstance = InstanceType
22 |
--------------------------------------------------------------------------------
/packages/ikui-components/card/src/card.vue:
--------------------------------------------------------------------------------
1 |
32 |
33 |
41 |
42 |
--------------------------------------------------------------------------------
/packages/ikui-components/carousel/index.ts:
--------------------------------------------------------------------------------
1 | import Carousel from './src/carousel.vue'
2 | import CarouselItem from './src/carousel-item.vue'
3 | import { withInstall } from '../_utils/withInstall'
4 |
5 | const IkCarousel = withInstall(Carousel)
6 | const IkCarouselItem = withInstall(CarouselItem)
7 |
8 | export default IkCarousel
9 |
10 | export type { CarouselInstance, CarouselProps } from './src/prop'
11 |
12 | export { IkCarouselItem }
13 |
--------------------------------------------------------------------------------
/packages/ikui-components/carousel/src/carousel-item.vue:
--------------------------------------------------------------------------------
1 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/packages/ikui-components/carousel/src/prop.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes } from 'vue'
2 | import type carousel from './carousel.vue'
3 |
4 | export const carouselTypes = ['default'] as const
5 |
6 | export type actionType = 'next' | 'prev' | 'assign'
7 |
8 | export const carouselProps = {
9 | type: {
10 | type: String,
11 | values: carouselTypes,
12 | default: 'default',
13 | },
14 | } as const
15 |
16 | export const carouselItemProps = {
17 | activeIndex: {
18 | type: Number,
19 | },
20 | key: {
21 | type: Number,
22 | },
23 | index: {
24 | type: Number,
25 | },
26 | }
27 |
28 | export type CarouselProps = ExtractPropTypes
29 |
30 | export type CarouselInstance = InstanceType
31 |
32 | export const carouselContextKey = Symbol('carouselContextKey')
33 |
--------------------------------------------------------------------------------
/packages/ikui-components/checkbox-group/index.ts:
--------------------------------------------------------------------------------
1 | import CheckboxGroup from './src/checkbox-group.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkCheckboxGroup = withInstall(CheckboxGroup)
5 |
6 | export default IkCheckboxGroup
7 |
--------------------------------------------------------------------------------
/packages/ikui-components/checkbox-group/src/checkbox-group.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes, InjectionKey, PropType } from 'vue'
2 | import type { CheckboxLabelType, CheckboxGroupSizeType } from './interface'
3 |
4 | export const checkboxGroupProps = {
5 | modelValue: {
6 | type: [String, Number, Array] as PropType,
7 | default: () => [],
8 | },
9 | disabled: {
10 | type: Boolean,
11 | default: (): boolean => false,
12 | },
13 | label: {
14 | type: String,
15 | },
16 | changeEvent: {
17 | type: Function,
18 | },
19 | border: {
20 | type: Boolean,
21 | default: false,
22 | },
23 | size: {
24 | type: String,
25 | default: (): string => 'middle',
26 | validator: (val: CheckboxGroupSizeType): boolean => {
27 | return (['large', 'middle', 'small'] as const).includes(val)
28 | },
29 | },
30 | } as const
31 |
32 | export const checkboxGroupEmits = {
33 | 'update:modelValue': (val: CheckboxLabelType): boolean => Array.isArray(val),
34 | change: (val: CheckboxLabelType): boolean => typeof val === 'object',
35 | }
36 |
37 | type checkboxGroupProps = ExtractPropTypes
38 |
39 | export const checkboxGroupCtxKey: InjectionKey = Symbol('')
40 |
--------------------------------------------------------------------------------
/packages/ikui-components/checkbox-group/src/checkbox-group.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/ikui-components/checkbox-group/src/interface.d.ts:
--------------------------------------------------------------------------------
1 | export type CheckboxLabelType = string | number | boolean
2 |
3 | export interface CheckboxChangeEventInterface {
4 | (value: CheckboxLabelType): void
5 | }
6 |
7 | export type CheckboxGroupSizeType = 'large' | 'middle' | 'small'
8 |
9 | export interface CheckboxGroupInterface {
10 | disabled: boolean
11 | modelValue: CheckboxLabelType
12 | label: string
13 | changeEvent: CheckboxChangeEventInterface
14 | border: boolean
15 | size: string
16 | }
17 |
--------------------------------------------------------------------------------
/packages/ikui-components/checkbox/index.ts:
--------------------------------------------------------------------------------
1 | import Checkbox from './src/checkbox.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkCheckbox = withInstall(Checkbox)
5 |
6 | export default IkCheckbox
7 |
8 | export type { CheckboxInstance, CheckboxProps } from './src/checkbox'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/checkbox/src/checkbox.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes } from 'vue'
2 | import Checkbox from './checkbox'
3 |
4 | export type CheckboxLabelType = string | number | boolean
5 |
6 | export const checkboxProps = {
7 | modelValue: {
8 | // type: [Number, String, Boolean],
9 | type: Boolean,
10 | default: false,
11 | },
12 | label: {
13 | type: String,
14 | },
15 | disabled: {
16 | type: Boolean,
17 | default: false,
18 | },
19 | border: {
20 | type: Boolean,
21 | default: false,
22 | },
23 | size: {
24 | type: String,
25 | default: (): string => 'middle',
26 | },
27 | }
28 |
29 | export const checkboxEmits = {
30 | 'update:modelValue': (val: CheckboxLabelType): boolean => {
31 | return typeof val === 'string' || typeof val === 'number' || typeof val === 'boolean'
32 | },
33 | }
34 |
35 | export type CheckboxProps = ExtractPropTypes
36 | export type CheckboxInstance = InstanceType
37 |
--------------------------------------------------------------------------------
/packages/ikui-components/checkbox/src/checkbox.vue:
--------------------------------------------------------------------------------
1 |
68 |
69 |
70 |
80 |
81 |
--------------------------------------------------------------------------------
/packages/ikui-components/collapse-transition/index.ts:
--------------------------------------------------------------------------------
1 | import CollapseTransition from './src/collapse-transition.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkCollapseTransition = withInstall(CollapseTransition)
5 |
6 | export default IkCollapseTransition
7 |
--------------------------------------------------------------------------------
/packages/ikui-components/collapse-transition/src/collapse-transition.vue:
--------------------------------------------------------------------------------
1 |
62 |
63 |
64 |
65 |
66 |
67 |
77 |
--------------------------------------------------------------------------------
/packages/ikui-components/drawer/index.ts:
--------------------------------------------------------------------------------
1 | import Drawer from './src/drawer.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkDrawer = withInstall(Drawer)
5 |
6 | export default IkDrawer
7 |
--------------------------------------------------------------------------------
/packages/ikui-components/drawer/src/drawer.ts:
--------------------------------------------------------------------------------
1 | import { PropType } from 'vue'
2 |
3 | export type DrawerPosition = 'left' | 'right' | 'top' | 'bottom'
4 |
5 | export const drawerProps = {
6 | visible: {
7 | type: Boolean,
8 | },
9 | title: {
10 | type: String,
11 | },
12 | position: {
13 | type: String as PropType,
14 | default: 'left',
15 | },
16 | }
17 |
18 | export const Emits = {
19 | 'update:modelValue': (value): boolean => {
20 | return typeof value === 'string' || typeof value === 'number'
21 | },
22 | change(value) {
23 | return typeof value
24 | },
25 | }
26 |
--------------------------------------------------------------------------------
/packages/ikui-components/drawer/src/drawer.vue:
--------------------------------------------------------------------------------
1 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/packages/ikui-components/empty/index.ts:
--------------------------------------------------------------------------------
1 | import Empty from './src/empty'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkEmpty = withInstall(Empty)
5 |
6 | export default IkEmpty
7 |
8 | export type { EmptyInstance, EmptyProps } from './src/prop'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/empty/src/prop.ts:
--------------------------------------------------------------------------------
1 | import type { ExtractPropTypes } from 'vue'
2 | import type empty from './empty'
3 |
4 | export const props = {
5 | image: {
6 | type: String,
7 | default: '',
8 | },
9 | } as const
10 |
11 | export type EmptyProps = ExtractPropTypes
12 | export type EmptyInstance = InstanceType
13 |
--------------------------------------------------------------------------------
/packages/ikui-components/icon/index.ts:
--------------------------------------------------------------------------------
1 | // export * from './button'
2 | // import { withInstall } from '../../utils/install'
3 | import IkIcon from './src/icon.vue'
4 |
5 | export default IkIcon
6 | export type { IconInstance, iconProps } from './src/icon'
7 |
--------------------------------------------------------------------------------
/packages/ikui-components/icon/src/icon.ts:
--------------------------------------------------------------------------------
1 | import type icon from './icon.vue'
2 |
3 | export const iconProps = {
4 | name: {
5 | type: String,
6 | },
7 | size: {
8 | type: Number || String,
9 | default: (): number => 22,
10 | },
11 | class: {
12 | type: String,
13 | },
14 | color: {
15 | type: String,
16 | },
17 | } as const
18 |
19 | export type IconInstance = InstanceType
20 |
--------------------------------------------------------------------------------
/packages/ikui-components/icon/src/icon.vue:
--------------------------------------------------------------------------------
1 |
20 |
21 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/ikui-components/input/index.ts:
--------------------------------------------------------------------------------
1 | import Input from './src/input.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkInput = withInstall(Input)
5 |
6 | export default IkInput
7 |
8 | // export type { } from './src/input'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/input/src/input.ts:
--------------------------------------------------------------------------------
1 | export const InputProps = {
2 | modelValue: {
3 | type: String,
4 | },
5 | hasClear: {
6 | type: Boolean,
7 | default: (): boolean => false,
8 | },
9 | placeholder: {
10 | type: String,
11 | default: (): string => '请输入',
12 | },
13 | prefixIcon: {
14 | type: String,
15 | default: '',
16 | },
17 | suffixIcon: {
18 | type: String,
19 | default: '',
20 | },
21 | }
22 |
23 | export const Emits = {
24 | 'update:modelValue': (value): boolean => {
25 | return typeof value === 'string' || typeof value === 'number'
26 | },
27 | change(value) {
28 | return typeof value
29 | },
30 | }
31 |
--------------------------------------------------------------------------------
/packages/ikui-components/input/src/input.vue:
--------------------------------------------------------------------------------
1 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/packages/ikui-components/layout/index.ts:
--------------------------------------------------------------------------------
1 | import IkContainer from './src/container.vue'
2 | import IkAside from './src/aside.vue'
3 | import IkMain from './src/main.vue'
4 | import IkHeader from './src/header.vue'
5 |
6 | export { IkContainer, IkAside, IkMain, IkHeader }
7 |
--------------------------------------------------------------------------------
/packages/ikui-components/layout/src/aside.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/layout/src/container.vue:
--------------------------------------------------------------------------------
1 |
18 |
19 |
22 |
23 |
--------------------------------------------------------------------------------
/packages/ikui-components/layout/src/header.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/layout/src/main.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/loading/index.ts:
--------------------------------------------------------------------------------
1 | // import { vLoading, loadingService } from './src/directive'
2 |
3 | // export default {
4 | // vLoading,
5 | // IkLoading: loadingService
6 | // }
7 |
8 | export * from './src/directive'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/loading/src/directive.ts:
--------------------------------------------------------------------------------
1 | import type { Directive, DirectiveBinding } from 'vue'
2 | import { createApp } from 'vue'
3 | import Mask from './mask.vue'
4 |
5 | export interface LoadingElType extends HTMLElement {
6 | loadingIns?: ProxyHandler
7 | originPosition?: string
8 | style: CSSStyleDeclaration
9 | }
10 |
11 | export interface LoadingServiceOptions {
12 | duration?: number
13 | }
14 |
15 | const removeDom = (el: LoadingElType): void => {
16 | el.style.position = el.originPosition || 'static'
17 | el.removeChild(el.loadingIns.$el)
18 | }
19 |
20 | const insertDom = (el: LoadingElType, binding: DirectiveBinding): void => {
21 | if (el.originPosition !== 'absolute' && el.originPosition !== 'fixed') {
22 | el.style.position = 'relative'
23 | }
24 | const loading = createApp(Mask)
25 | const fullscreen = binding.modifiers.fullscreen
26 | loading.provide('fullscreen', fullscreen)
27 | const loadingIns = loading.mount(document.createElement('div'))
28 | el.loadingIns = loadingIns
29 | el.appendChild(loadingIns.$el)
30 | }
31 |
32 | export const IkLoading: Directive = {
33 | mounted(el: LoadingElType, binding: DirectiveBinding) {
34 | const originPosition = window.getComputedStyle(el)['position']
35 | el.originPosition = originPosition
36 | if (binding.value) {
37 | insertDom(el, binding)
38 | }
39 | },
40 | updated(el: LoadingElType, binding: DirectiveBinding) {
41 | if (binding.value !== binding.oldValue) {
42 | if (!binding.value) {
43 | removeDom(el)
44 | } else {
45 | insertDom(el, binding)
46 | }
47 | }
48 | },
49 | }
50 | export const loadingService = {
51 | service(options: LoadingServiceOptions) {
52 | const loading = createApp(Mask)
53 | loading.provide('fullscreen', true)
54 | const loadingIns = loading.mount(document.createElement('div'))
55 | document.body.appendChild(loadingIns.$el)
56 | setTimeout(() => {
57 | document.body.removeChild(loadingIns.$el)
58 | }, options.duration || 2000)
59 | },
60 | }
61 |
--------------------------------------------------------------------------------
/packages/ikui-components/loading/src/mask.ts:
--------------------------------------------------------------------------------
1 | import { createApp, h } from 'vue'
2 | export function createLoadingComponent() {
3 | const loadingComponent = {
4 | name: 'IkLoading',
5 | setup() {
6 | return () => {
7 | return h(
8 | 'div',
9 | {
10 | class: 'ik-loading-wrapper',
11 | },
12 | 'this is loading'
13 | )
14 | }
15 | },
16 | }
17 |
18 | const loadingIns = createApp(loadingComponent)
19 | const vm = loadingIns.mount(document.createElement('div'))
20 | return {
21 | vm,
22 | get $el(): HTMLElement {
23 | return vm?.$el
24 | },
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/ikui-components/loading/src/mask.vue:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/packages/ikui-components/loading/src/service.ts:
--------------------------------------------------------------------------------
1 | // import { createApp } from "vue"
2 | // import Mask from './mask.vue'
3 |
4 | // import type { Directive, DirectiveBinding } from 'vue'
5 |
--------------------------------------------------------------------------------
/packages/ikui-components/lock-screen/index.ts:
--------------------------------------------------------------------------------
1 | import LockScreen from './src/lock-screen.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkLockScreen = withInstall(LockScreen)
5 |
6 | export default IkLockScreen
7 |
--------------------------------------------------------------------------------
/packages/ikui-components/lock-screen/src/lock-screen.vue:
--------------------------------------------------------------------------------
1 |
26 |
27 |
28 |
29 |
30 |
{{ currentTime }}
31 |
32 |
33 |
34 | 解锁
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/packages/ikui-components/lock-screen/src/prop.ts:
--------------------------------------------------------------------------------
1 | export const lockScreenProps = {
2 | modleValue: {
3 | type: Boolean,
4 | },
5 | visible: Boolean,
6 | showTime: {
7 | type: Boolean,
8 | default: false,
9 | },
10 | } as const
11 |
--------------------------------------------------------------------------------
/packages/ikui-components/menu/index.ts:
--------------------------------------------------------------------------------
1 | import Menu from './src/menu.vue'
2 | import { withInstall } from '../_utils/withInstall'
3 |
4 | const IkMenu = withInstall(Menu)
5 |
6 | export default IkMenu
7 |
8 | // export type { MenuInstance, MenuType } from './src/menu'
9 |
--------------------------------------------------------------------------------
/packages/ikui-components/menu/src/collapse-transition.vue:
--------------------------------------------------------------------------------
1 |
62 |
63 |
64 |
65 |
66 |
67 |
77 |
--------------------------------------------------------------------------------
/packages/ikui-components/menu/src/menu-item.vue:
--------------------------------------------------------------------------------
1 |
32 |
33 |
34 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/packages/ikui-components/menu/src/menu.vue:
--------------------------------------------------------------------------------
1 |
19 |
20 |
30 |
31 |
--------------------------------------------------------------------------------
/packages/ikui-components/menu/src/prop.ts:
--------------------------------------------------------------------------------
1 | import type { PropType } from 'vue'
2 | import type menu from './menu.vue'
3 |
4 | export interface MenuItem {
5 | label?: string
6 | icon?: string
7 | children?: MenuItem[]
8 | isExpand?: boolean
9 | _level: number
10 | open?: boolean
11 | path?: string
12 | }
13 |
14 | export type MenuItems = MenuItem[]
15 |
16 | export const menuProps = {
17 | items: {
18 | type: Array as PropType,
19 | },
20 | }
21 |
22 | export const menuItemProps = {
23 | current: {
24 | type: Object as PropType