├── .prettierignore ├── packages ├── playground │ ├── CHANGELOG.md │ ├── .vscode │ │ └── extensions.json │ ├── src │ │ ├── main.ts │ │ ├── vite-env.d.ts │ │ ├── assets │ │ │ ├── vue.svg │ │ │ └── json │ │ │ │ └── icons.json │ │ ├── style.css │ │ └── App.vue │ ├── tsconfig.node.json │ ├── .gitignore │ ├── index.html │ ├── tsconfig.json │ ├── vite.config.ts │ ├── components.d.ts │ ├── scripts │ │ └── genIconList.mjs │ ├── package.json │ ├── public │ │ └── vite.svg │ └── README.md ├── headless │ ├── index.ts │ ├── src │ │ ├── index.ts │ │ └── fullscreen.ts │ ├── README.md │ ├── package.json │ └── CHANGELOG.md ├── types │ ├── index.ts │ ├── src │ │ ├── index.ts │ │ └── base.ts │ ├── CHANGELOG.md │ └── package.json ├── utils │ ├── index.ts │ ├── src │ │ ├── index.ts │ │ ├── install.ts │ │ ├── type.ts │ │ ├── date-utils.ts │ │ └── fullscreen.ts │ ├── README.md │ ├── package.json │ └── CHANGELOG.md └── vue-pro-components │ ├── src │ ├── icon-font │ │ ├── style │ │ │ └── index.less │ │ ├── index.ts │ │ ├── icon-font.vue │ │ └── props.ts │ ├── hooks │ │ ├── index.ts │ │ └── props.ts │ ├── styles │ │ └── vars.less │ ├── button │ │ ├── index.ts │ │ ├── style │ │ │ └── index.less │ │ ├── props.ts │ │ └── button.tsx │ ├── pro-form │ │ ├── index.ts │ │ ├── pro-form.tsx │ │ └── props.ts │ ├── fullscreen │ │ ├── index.ts │ │ ├── style │ │ │ └── index.less │ │ ├── props.ts │ │ └── fullscreen.vue │ ├── select-icon │ │ ├── index.ts │ │ ├── props.ts │ │ ├── style │ │ │ └── index.less │ │ └── select-icon.vue │ ├── icon-svg │ │ ├── index.ts │ │ ├── style │ │ │ └── index.less │ │ ├── icon-svg.vue │ │ └── props.ts │ └── components.ts │ ├── index.ts │ ├── README.md │ ├── package.json │ └── CHANGELOG.md ├── .yarnrc ├── .babelrc ├── scripts └── run-esm.js ├── commitlint.config.js ├── .husky ├── pre-commit └── commit-msg ├── test └── compiler-sfc │ ├── child-comp.vue │ ├── test.vue │ └── test-compiler-sfc.js ├── .npmrc ├── .gitignore ├── prettier.config.js ├── lint-staged.config.js ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── PUBLISH_README.md ├── .eslintignore ├── tsconfig.eslint.json ├── lerna.json ├── stylelint.config.js ├── tsconfig.json ├── LICENSE ├── .release-it.js ├── gulpfile.babel.js ├── .github └── workflows │ └── npm-publish.yml ├── CHANGELOG.md ├── .eslintrc.js ├── package.json └── README.md /.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.json -------------------------------------------------------------------------------- /packages/playground/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | registry "https://registry.npmmirror.com" -------------------------------------------------------------------------------- /packages/headless/index.ts: -------------------------------------------------------------------------------- 1 | export * from './src' 2 | -------------------------------------------------------------------------------- /packages/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './src' 2 | -------------------------------------------------------------------------------- /packages/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './src' 2 | -------------------------------------------------------------------------------- /packages/types/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './base' 2 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/icon-font/style/index.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ "@babel/preset-env" ] 3 | } -------------------------------------------------------------------------------- /packages/headless/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './fullscreen' 2 | -------------------------------------------------------------------------------- /packages/vue-pro-components/index.ts: -------------------------------------------------------------------------------- 1 | export * from './src/components' 2 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './props' 2 | -------------------------------------------------------------------------------- /scripts/run-esm.js: -------------------------------------------------------------------------------- 1 | import path from "path" 2 | 3 | console.log(path.basename) -------------------------------------------------------------------------------- /packages/headless/README.md: -------------------------------------------------------------------------------- 1 | ## 安装 2 | 3 | ``` 4 | yarn add @vue-pro-components/headless 5 | ``` -------------------------------------------------------------------------------- /packages/playground/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar"] 3 | } 4 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'] 3 | } 4 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx lint-staged $1 5 | -------------------------------------------------------------------------------- /test/compiler-sfc/child-comp.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/styles/vars.less: -------------------------------------------------------------------------------- 1 | @ui-prefix: vp; 2 | @fullscreen-prefix: ~'@{ui-prefix}-fullscreen'; -------------------------------------------------------------------------------- /packages/utils/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './date-utils' 2 | export * from './install' 3 | export * from './fullscreen' 4 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmmirror.com 2 | //registry.npmjs.org/:always-auth=true 3 | //registry.npmjs.org/:_authToken=${NPM_TOKEN} -------------------------------------------------------------------------------- /packages/types/src/base.ts: -------------------------------------------------------------------------------- 1 | type IndexType = string | number | symbol 2 | 3 | export type PlainObject = Record 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/*.log 3 | packages/*/dist 4 | packages/*/es 5 | packages/*/lib 6 | packages/*/types 7 | .env.local 8 | .eslintcache 9 | .stylelintcache -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | tabs: false, 3 | tabWidth: 4, 4 | endOfLine: 'auto', 5 | semi: false, 6 | singleQuote: true, 7 | printWidth: 140, 8 | } 9 | -------------------------------------------------------------------------------- /lint-staged.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "packages/**/src/**/*.{js,mjs,jsx,ts,tsx,vue}": "eslint --cache --fix", 3 | "packages/**/src/**/*.{css,less,vue}": "stylelint --cache --fix", 4 | }; 5 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "stylelint.vscode-stylelint", 4 | "esbenp.prettier-vscode", 5 | "dbaeumer.vscode-eslint", 6 | "Vue.volar" 7 | ] 8 | } -------------------------------------------------------------------------------- /packages/vue-pro-components/src/button/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall } from '@vue-pro-components/utils' 2 | import Comp from './button' 3 | 4 | export const Button = withInstall(Comp) 5 | 6 | export default Button 7 | -------------------------------------------------------------------------------- /packages/utils/README.md: -------------------------------------------------------------------------------- 1 | # `@vue-pro-components/utils` 2 | 3 | > TODO: description 4 | 5 | ## Usage 6 | 7 | ``` 8 | const utils = require('@vue-pro-components/utils'); 9 | 10 | // TODO: DEMONSTRATE API 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/pro-form/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall } from '@vue-pro-components/utils' 2 | import Comp from './pro-form' 3 | 4 | export const ProForm = withInstall(Comp) 5 | 6 | export default ProForm 7 | -------------------------------------------------------------------------------- /packages/vue-pro-components/README.md: -------------------------------------------------------------------------------- 1 | # `vue-pro-components` 2 | 3 | > TODO: description 4 | 5 | ## Usage 6 | 7 | ``` 8 | const vueProComponents = require('vue-pro-components'); 9 | 10 | // TODO: DEMONSTRATE API 11 | ``` 12 | -------------------------------------------------------------------------------- /PUBLISH_README.md: -------------------------------------------------------------------------------- 1 | # 发布流程 2 | 3 | ## 登录 4 | 5 | ``` 6 | npm adduser --registry=https://registry.npmjs.org 7 | ``` 8 | 9 | 如果需要退出登录,可以尝试: 10 | 11 | ``` 12 | npm logout --registry=https://registry.npmjs.org 13 | ``` 14 | 15 | ## 发布 -------------------------------------------------------------------------------- /packages/vue-pro-components/src/fullscreen/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall } from '@vue-pro-components/utils' 2 | import Comp from './fullscreen.vue' 3 | 4 | export const Fullscreen = withInstall(Comp) 5 | 6 | export default Fullscreen 7 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/select-icon/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall } from '@vue-pro-components/utils' 2 | import Comp from './select-icon.vue' 3 | 4 | export const SelectIcon = withInstall(Comp) 5 | 6 | export default SelectIcon 7 | -------------------------------------------------------------------------------- /packages/playground/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import './style.css' 3 | import App from './App.vue' 4 | 5 | createApp(App).mount('#app') 6 | 7 | // 两个包一起修改内容 8 | 9 | // 两个包一起修改内容2 10 | 11 | // independent 同时修改 12 | -------------------------------------------------------------------------------- /packages/playground/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import type { DefineComponent } from 'vue' 5 | 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/icon-svg/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall } from '@vue-pro-components/utils' 2 | import Comp from './icon-svg.vue' 3 | 4 | Comp.name = 'VpIconSvg' 5 | 6 | export const IconSvg = withInstall(Comp) 7 | 8 | export default IconSvg 9 | -------------------------------------------------------------------------------- /packages/playground/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "ESNext", 5 | "moduleResolution": "Node", 6 | "allowSyntheticDefaultImports": true 7 | }, 8 | "include": ["vite.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/icon-font/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall } from '@vue-pro-components/utils' 2 | import Comp from './icon-font.vue' 3 | 4 | Comp.name = 'VpIconFont' 5 | 6 | export const IconFont = withInstall(Comp) 7 | 8 | export default IconFont 9 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # 增加 .eslintrc.js 解决以下报错 2 | # Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. 3 | # The file does not match your project config: .eslintrc.js. 4 | # The file must be included in at least one of the projects provided. 5 | *.js 6 | **/*.d.ts -------------------------------------------------------------------------------- /packages/vue-pro-components/src/hooks/props.ts: -------------------------------------------------------------------------------- 1 | import type { PlainObject } from '@vue-pro-components/types' 2 | 3 | import { pick } from 'lodash-es' 4 | import { computed } from 'vue' 5 | 6 | export const usePickedProps = (props: PlainObject, keys: string[]) => computed(() => pick(props, keys)) 7 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/icon-font/icon-font.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/fullscreen/style/index.less: -------------------------------------------------------------------------------- 1 | @import '../../styles/vars'; 2 | 3 | .@{fullscreen-prefix} { 4 | &__wrapper { 5 | display: flex; 6 | align-items: center; 7 | cursor: pointer; 8 | } 9 | 10 | &__text { 11 | margin-left: 6px; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/components.ts: -------------------------------------------------------------------------------- 1 | export { Button } from './button' 2 | 3 | export { Fullscreen } from './fullscreen' 4 | 5 | export { IconFont } from './icon-font' 6 | 7 | export { IconSvg } from './icon-svg' 8 | 9 | export { SelectIcon } from './select-icon' 10 | 11 | export { ProForm } from './pro-form' 12 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/icon-svg/style/index.less: -------------------------------------------------------------------------------- 1 | .vp-icon-svg { 2 | display: inline-block; 3 | line-height: 0; 4 | text-align: center; 5 | text-transform: none; 6 | text-rendering: optimizelegibility; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | } 10 | -------------------------------------------------------------------------------- /packages/playground/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | // extend your base config to share compilerOptions, etc 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | // ensure that nobody can accidentally use this config for a build 6 | "noEmit": true 7 | }, 8 | "include": [ 9 | // whatever paths you intend to lint 10 | ".eslintrc.js", 11 | "packages/**/*.vue" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/select-icon/props.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractPropTypes, PropType } from 'vue' 2 | 3 | export const props = { 4 | value: { 5 | type: String, 6 | }, 7 | // 图标清单 8 | icons: { 9 | type: Array as PropType, 10 | default() { 11 | return [] 12 | }, 13 | }, 14 | } 15 | 16 | export type VpIconSelectProps = Partial> 17 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/button/style/index.less: -------------------------------------------------------------------------------- 1 | @import 'ant-design-vue/es/button/style/index'; 2 | @import '../../icon-svg/style/index'; 3 | 4 | .vp-button { 5 | &.ant-btn { 6 | line-height: 1; 7 | 8 | > span { 9 | line-height: 0; 10 | vertical-align: middle; 11 | } 12 | 13 | .vp-icon-svg { 14 | + span { 15 | margin-left: 8px; 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/icon-svg/icon-svg.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /packages/playground/src/assets/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Create Release via NPM", 5 | "request": "launch", 6 | "runtimeArgs": [ 7 | "run-script", 8 | "create-release" 9 | ], 10 | "runtimeExecutable": "npm", 11 | "console": "integratedTerminal", 12 | "skipFiles": [ 13 | "/**" 14 | ], 15 | "type": "node" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /packages/vue-pro-components/src/pro-form/pro-form.tsx: -------------------------------------------------------------------------------- 1 | import { defineComponent } from 'vue' 2 | import { Form as AForm } from 'ant-design-vue' 3 | import { innerKeys, props as formProps } from './props' 4 | import { usePickedProps } from '../hooks/props' 5 | 6 | export default defineComponent({ 7 | name: 'VpForm', 8 | props: formProps, 9 | setup(props) { 10 | // 把属于 AForm 的属性挑选出来,再绑定到 AForm 上 11 | const innerProps = usePickedProps(props, innerKeys) 12 | 13 | return () => 14 | }, 15 | }) 16 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "useNx": true, 4 | "useWorkspaces": true, 5 | "version": "independent", 6 | "npmClient": "yarn", 7 | "packages": [ 8 | "packages/utils", 9 | "packages/headless", 10 | "packages/type", 11 | "packages/vue-pro-components" 12 | ], 13 | "command": { 14 | "publish": { 15 | "registry": "https://registry.npmjs.org" 16 | }, 17 | "version": { 18 | "changelogPreset": "angular", 19 | "message": "chore(bump): bump version for packages" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/icon-font/props.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractPropTypes } from 'vue' 2 | 3 | export const props = { 4 | // 图标 class 前缀 5 | iconPrefix: { 6 | type: String, 7 | default: 'vp-icon-', 8 | }, 9 | // 图标名,与前缀拼接起来就对应一个完整的 class 10 | icon: { 11 | type: String, 12 | required: true, 13 | }, 14 | // 图标大小 15 | size: { 16 | type: Number, 17 | }, 18 | // 图标颜色 19 | color: { 20 | type: String, 21 | }, 22 | } 23 | 24 | export type VpIconFontProps = Partial> 25 | -------------------------------------------------------------------------------- /packages/playground/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + Vue + TS 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /packages/playground/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "moduleResolution": "Node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "isolatedModules": true, 12 | "esModuleInterop": true, 13 | "lib": ["ESNext", "DOM"], 14 | "skipLibCheck": true 15 | }, 16 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "components.d.ts"], 17 | "references": [{ "path": "./tsconfig.node.json" }] 18 | } 19 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/icon-svg/props.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractPropTypes } from 'vue' 2 | 3 | export const props = { 4 | // 图标 class 前缀 5 | iconPrefix: { 6 | type: String, 7 | default: 'vp-icon-', 8 | }, 9 | // 图标名,与前缀拼接起来就对应一个完整的 class 10 | icon: { 11 | type: String, 12 | required: true, 13 | }, 14 | // 图标大小 15 | size: { 16 | type: Number, 17 | }, 18 | // 图标颜色 19 | color: { 20 | type: String, 21 | }, 22 | } 23 | 24 | export type VpIconSvgProps = Partial> 25 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/fullscreen/props.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractPropTypes, PropType } from 'vue' 2 | import type { EnhancedHTMLElement } from '@vue-pro-components/utils' 3 | 4 | export const props = { 5 | useText: { 6 | type: Boolean, 7 | default: true, 8 | }, 9 | iconSize: { 10 | type: Number, 11 | default: 24, 12 | }, 13 | getElement: { 14 | type: Function as PropType<() => EnhancedHTMLElement>, 15 | default() { 16 | return document.body 17 | }, 18 | }, 19 | } 20 | 21 | export type ClFullscreenProps = Partial> 22 | -------------------------------------------------------------------------------- /packages/utils/src/install.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-argument */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 4 | /* eslint-disable @typescript-eslint/no-explicit-any */ 5 | import type { App, Plugin } from 'vue' 6 | 7 | export type SFCWithInstall = T & 8 | Plugin & { 9 | displayName: string 10 | name: string 11 | } 12 | 13 | export const withInstall = (comp: T) => { 14 | const c = comp as any 15 | c.install = function (app: App) { 16 | app.component(c.displayName || c.name, c) 17 | } 18 | 19 | return c as SFCWithInstall 20 | } 21 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/pro-form/props.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractPropTypes } from 'vue' 2 | // 这是一个函数 3 | import { formProps } from 'ant-design-vue/es/form/Form' 4 | import { initDefaultProps } from 'ant-design-vue/es/_util/props-util' 5 | 6 | const _formProps = initDefaultProps(formProps(), { 7 | layout: 'horizontal', 8 | hideRequiredMark: false, 9 | colon: true, 10 | }) 11 | 12 | export const enhancedProps = {} 13 | 14 | export const innerKeys = Object.keys(_formProps) 15 | export const enhancedKeys = Object.keys(enhancedProps) 16 | 17 | export const props = { 18 | ..._formProps, 19 | ...enhancedProps, 20 | } 21 | 22 | export type VpFormProps = Partial> 23 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/select-icon/style/index.less: -------------------------------------------------------------------------------- 1 | @import 'ant-design-vue/es/select/style/index'; 2 | @import 'ant-design-vue/es/grid/style/index'; 3 | @import '../../icon-svg/style/index'; 4 | 5 | .select-icon { 6 | width: 240px; 7 | 8 | &__search-wrapper { 9 | margin-bottom: 20px; 10 | text-align: center; 11 | } 12 | 13 | &__cell { 14 | height: 54px; 15 | text-align: center; 16 | line-height: 54px; 17 | border-radius: 4px; 18 | font-size: 24px; 19 | cursor: pointer; 20 | 21 | &.is-selected, 22 | &:hover { 23 | background-color: var(--color-primary); 24 | color: #fff; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/playground/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | import vueJsx from '@vitejs/plugin-vue-jsx' 4 | import Components from 'unplugin-vue-components/vite' 5 | import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers' 6 | 7 | // https://vitejs.dev/config/ 8 | export default defineConfig({ 9 | plugins: [ 10 | vue(), 11 | vueJsx(), 12 | Components({ 13 | resolvers: [AntDesignVueResolver({ resolveIcons: true })], 14 | }), 15 | ], 16 | server: { 17 | port: 3200, 18 | }, 19 | css: { 20 | preprocessorOptions: { 21 | less: { 22 | javascriptEnabled: true, 23 | }, 24 | }, 25 | }, 26 | }) 27 | -------------------------------------------------------------------------------- /packages/types/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # 0.3.0 (2023-01-11) 7 | 8 | ### Bug Fixes 9 | 10 | - 修改 publishConfig ([bcae06d](https://github.com/cumt-robin/vue-pro-components/commit/bcae06d05fc8c8f80426f232f4d70e99baef76fc)) 11 | 12 | ### Features 13 | 14 | - Button 支持 IconSvg ([43ec1f3](https://github.com/cumt-robin/vue-pro-components/commit/43ec1f38ed99e79f3a98b031bbd750290d7bf83b)) 15 | - 增加 isSameDay 方法 ([59acd06](https://github.com/cumt-robin/vue-pro-components/commit/59acd0611f92b533e430a5ee2e22d7ff7afd7e74)) 16 | - 支持通用类型打包 ([e2de994](https://github.com/cumt-robin/vue-pro-components/commit/e2de9943279ddf9caee543c820ca043a70918cdc)) 17 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 4, 3 | // 防止内置css校验和stylelint重复报错 4 | "css.validate": false, 5 | "less.validate": false, 6 | "scss.validate": false, 7 | "eslint.validate": ["javascript", "typescript", "javascriptreact", "typescriptreact", "vue"], 8 | "stylelint.validate": [ 9 | "css", 10 | "less", 11 | "scss", 12 | "vue" 13 | ], 14 | "editor.formatOnSave": false, 15 | // 代码保存动作 16 | "editor.codeActionsOnSave": { 17 | "source.fixAll.eslint": true, 18 | "source.fixAll.stylelint": true 19 | }, 20 | "editor.defaultFormatter": "esbenp.prettier-vscode", 21 | "[vue]": { 22 | "editor.defaultFormatter": "Vue.volar" 23 | }, 24 | "typescript.tsdk": "node_modules/typescript/lib" 25 | } -------------------------------------------------------------------------------- /stylelint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | 'stylelint-config-standard', 4 | 'stylelint-config-standard-scss', 5 | 'stylelint-config-standard-vue/scss', 6 | 'stylelint-config-prettier', 7 | ], 8 | plugins: ['stylelint-prettier'], 9 | rules: { 10 | 'prettier/prettier': true, 11 | indentation: 4, 12 | 'max-empty-lines': 1, 13 | "at-rule-no-unknown": null, 14 | "scss/at-rule-no-unknown": null 15 | }, 16 | "overrides": [ 17 | { 18 | "files": ["**/*.less"], 19 | "customSyntax": "postcss-syntax" 20 | }, 21 | ], 22 | // 对 less 变量插值支持不友好,先忽略,并且把变量都集中放在 vars.less,避免添加太多 ignore 23 | "ignoreFiles": ["packages/vue-pro-components/src/styles/vars.less"] 24 | } 25 | -------------------------------------------------------------------------------- /packages/types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-pro-components/types", 3 | "version": "0.3.0", 4 | "description": "types for vue pro components", 5 | "keywords": [ 6 | "types" 7 | ], 8 | "author": "Tusi ", 9 | "homepage": "https://github.com/cumt-robin/vue-pro-components#readme", 10 | "license": "MIT", 11 | "types": "types/index.d.ts", 12 | "files": [ 13 | "types" 14 | ], 15 | "publishConfig": { 16 | "access": "public" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/cumt-robin/vue-pro-components.git" 21 | }, 22 | "bugs": { 23 | "url": "https://github.com/cumt-robin/vue-pro-components/issues" 24 | }, 25 | "gitHead": "332d90f75db2f7a2daff8f964e51abd59aa8e52b" 26 | } 27 | -------------------------------------------------------------------------------- /packages/playground/components.d.ts: -------------------------------------------------------------------------------- 1 | // generated by unplugin-vue-components 2 | // We suggest you to commit this file into source control 3 | // Read more: https://github.com/vuejs/core/pull/3399 4 | import '@vue/runtime-core' 5 | 6 | export {} 7 | 8 | declare module '@vue/runtime-core' { 9 | export interface GlobalComponents { 10 | AButton: typeof import('ant-design-vue/es')['Button'] 11 | ACol: typeof import('ant-design-vue/es')['Col'] 12 | AInputSearch: typeof import('ant-design-vue/es')['InputSearch'] 13 | AModal: typeof import('ant-design-vue/es')['Modal'] 14 | ARow: typeof import('ant-design-vue/es')['Row'] 15 | ASelect: typeof import('ant-design-vue/es')['Select'] 16 | ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] 17 | ASwitch: typeof import('ant-design-vue/es')['Switch'] 18 | PlusOutlined: typeof import('@ant-design/icons-vue')['PlusOutlined'] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/compiler-sfc/test.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 30 | 31 | 41 | 42 | 47 | -------------------------------------------------------------------------------- /packages/playground/scripts/genIconList.mjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | import fs from 'fs' 3 | import axios from 'axios' 4 | 5 | const SVG_ICON_JSON_URL = 'https://at.alicdn.com/t/c/font_3736402_d50r1yq40hw.json' 6 | 7 | export async function genIconListJson() { 8 | try { 9 | const res = await axios.get(SVG_ICON_JSON_URL) 10 | 11 | if (res.status === 200) { 12 | const iconList = res.data.glyphs.map((item) => item.name) 13 | console.log(iconList) 14 | fs.writeFile(new URL('../src/assets/json/icons.json', import.meta.url), JSON.stringify(iconList, null, 2), (err) => { 15 | if (err) { 16 | return console.error(err) 17 | } 18 | console.log('图标清单写入成功!') 19 | }) 20 | } else { 21 | console.error(res.status, res.statusText) 22 | } 23 | } catch (err) { 24 | console.error(err) 25 | } 26 | } 27 | 28 | genIconListJson() 29 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/button/props.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractPropTypes } from 'vue' 2 | // 这是一个函数 3 | import buttonProps from 'ant-design-vue/es/button/buttonTypes' 4 | import { initDefaultProps } from 'ant-design-vue/es/_util/props-util' 5 | 6 | const _buttonProps = initDefaultProps(buttonProps(), { 7 | type: 'default', 8 | }) 9 | 10 | export const enhancedProps = { 11 | // 对应自定义图标的名称 12 | ico: { 13 | type: String, 14 | }, 15 | // 图标的大小 16 | icoSize: { 17 | type: Number, 18 | }, 19 | // 图标颜色 20 | icoColor: { 21 | type: String, 22 | }, 23 | // 按钮主体颜色,影响边框颜色,背景色 24 | primaryColor: { 25 | type: String, 26 | }, 27 | } 28 | 29 | export const innerKeys = Object.keys(_buttonProps) 30 | export const enhancedKeys = Object.keys(enhancedProps) 31 | 32 | export const props = { 33 | ..._buttonProps, 34 | ...enhancedProps, 35 | } 36 | 37 | export type VpButtonProps = Partial> 38 | -------------------------------------------------------------------------------- /packages/playground/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "playground", 3 | "private": true, 4 | "version": "2.4.5", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite --open", 8 | "build": "vue-tsc --noEmit && vite build", 9 | "preview": "vite preview", 10 | "genIconList": "node scripts/genIconList.mjs" 11 | }, 12 | "dependencies": { 13 | "@ant-design/icons-vue": "^6.1.0", 14 | "@vue-pro-components/headless": "^0.2.2", 15 | "@vue-pro-components/utils": "^0.5.0", 16 | "ant-design-vue": "^3.2.15", 17 | "vue": "^3.2.37", 18 | "vue-pro-components": "^0.2.2" 19 | }, 20 | "devDependencies": { 21 | "@vitejs/plugin-vue": "^3.1.0", 22 | "@vitejs/plugin-vue-jsx": "^2.1.1", 23 | "axios": "^1.1.3", 24 | "less": "^4.1.3", 25 | "typescript": "^4.6.4", 26 | "unplugin-vue-components": "^0.22.9", 27 | "vite": "^3.1.0", 28 | "vue-tsc": "^1.0.9" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "strict": false, 6 | "jsx": "preserve", 7 | "importHelpers": true, 8 | "moduleResolution": "node", 9 | "baseUrl": "./", 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "sourceMap": true, 14 | "resolveJsonModule": true, 15 | "allowJs": true, 16 | "strictNullChecks": true, 17 | "lib": ["esnext", "dom", "dom.iterable", "scripthost"], 18 | "paths": { 19 | "@vue-pro-components/types/*": ["packages/types/src/*"], 20 | "@vue-pro-components/utils/*": ["packages/utils/src/*"], 21 | "@vue-pro-components/headless/*": ["packages/headless/src/*"], 22 | } 23 | }, 24 | "include": ["**/*.ts", "**/*.tsx", "**/*.vue", "**/tests/**/*.ts", "**/tests/**/*.tsx", "**/components.d.ts"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Tusi 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 | -------------------------------------------------------------------------------- /.release-it.js: -------------------------------------------------------------------------------- 1 | const options = { 2 | git: { 3 | // 具体参考源码 https://github.com/release-it/release-it/blob/master/lib/plugin/git/Git.js 4 | addUntrackedFiles: true, 5 | commitMessage: 'chore: release v${version}', 6 | tagMatch: "[0-9]*" 7 | }, 8 | // 默认需要 GITHUB_TOKEN 环境变量,可以通过 tokenRef 定制 9 | github: { 10 | release: true, 11 | // 由于我们之前已经配置过 GH_TOKEN,就继续用 GH_TOKEN 吧 12 | tokenRef: 'GH_TOKEN', 13 | }, 14 | plugins: { 15 | '@release-it/conventional-changelog': { 16 | preset: 'angular', 17 | infile: 'CHANGELOG.md', 18 | }, 19 | }, 20 | npm: { 21 | // 不做 npm publish 操作,交给 ci/cd 执行 22 | publish: false, 23 | }, 24 | hooks: { 25 | 'after:release': 'echo Successfully released ${name} v${version} to ${repo.repository}.', 26 | }, 27 | } 28 | 29 | if (process.env.MANUAL_LERNA_VERSION) { 30 | // 更新子包版本号 31 | options.hooks["before:init"] = "yarn packages-manual-bump-version" 32 | } else { 33 | options.hooks["before:init"] = "yarn packages-bump-version" 34 | } 35 | 36 | module.exports = options 37 | -------------------------------------------------------------------------------- /packages/utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-pro-components/utils", 3 | "version": "0.19.0", 4 | "description": "utils", 5 | "keywords": [ 6 | "utils" 7 | ], 8 | "author": "Tusi ", 9 | "homepage": "https://github.com/cumt-robin/vue-pro-components#readme", 10 | "license": "MIT", 11 | "main": "lib/index.js", 12 | "module": "es/index.js", 13 | "types": "types/index.d.ts", 14 | "unpkg": "dist/index.js", 15 | "jsdelivr": "dist/index.js", 16 | "files": [ 17 | "dist", 18 | "lib", 19 | "es", 20 | "types" 21 | ], 22 | "publishConfig": { 23 | "access": "public" 24 | }, 25 | "repository": { 26 | "type": "git", 27 | "url": "git+https://github.com/cumt-robin/vue-pro-components.git" 28 | }, 29 | "bugs": { 30 | "url": "https://github.com/cumt-robin/vue-pro-components/issues" 31 | }, 32 | "gitHead": "332d90f75db2f7a2daff8f964e51abd59aa8e52b", 33 | "dependencies": { 34 | "dayjs": "^1.11.7" 35 | }, 36 | "devDependencies": { 37 | "@vue-pro-components/types": "^0.3.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gulpfile.babel.js: -------------------------------------------------------------------------------- 1 | import { series, src } from "gulp"; 2 | import clean from "gulp-clean"; 3 | import { startBuildHeadless } from "./build/build-headless"; 4 | import { startBuildTypes } from "./build/build-types"; 5 | import { startBuildUtils } from "./build/build-utils"; 6 | import { UTILS_PATH, HEADLESS_PATH, TYPES_PATH } from "./build/path"; 7 | 8 | const ARTIFACTS_DIRS = ["dist", "es", "lib", "types"] 9 | 10 | function cleanDir(dir = "dist", options = {}) { 11 | return src(dir, { allowEmpty: true, ...options }).pipe(clean({ force: true })) 12 | } 13 | 14 | export const cleanUtils = cleanDir.bind(null, ARTIFACTS_DIRS, { cwd: UTILS_PATH }) 15 | 16 | export const cleanHeadless = cleanDir.bind(null, ARTIFACTS_DIRS, { cwd: HEADLESS_PATH }) 17 | 18 | export const cleanTypes = cleanDir.bind(null, ['types'], { cwd: TYPES_PATH }) 19 | 20 | export const buildUtils = series(cleanUtils, startBuildUtils); 21 | 22 | export const buildHeadless = series(cleanHeadless, startBuildHeadless); 23 | 24 | export const buildTypes = series(cleanTypes, startBuildTypes); 25 | 26 | // 根据依赖关系确定顺序 27 | export const buildBatch = series( 28 | buildTypes, 29 | buildUtils, 30 | buildHeadless 31 | ) -------------------------------------------------------------------------------- /packages/headless/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-pro-components/headless", 3 | "version": "0.5.8", 4 | "description": "headless ui for vue-pro-components", 5 | "keywords": [ 6 | "headless", 7 | "ui", 8 | "vue" 9 | ], 10 | "author": "Tusi ", 11 | "homepage": "https://github.com/cumt-robin/vue-pro-components#readme", 12 | "license": "MIT", 13 | "main": "lib/index.js", 14 | "module": "es/index.js", 15 | "types": "types/index.d.ts", 16 | "unpkg": "dist/index.js", 17 | "jsdelivr": "dist/index.js", 18 | "files": [ 19 | "dist", 20 | "lib", 21 | "es", 22 | "types" 23 | ], 24 | "publishConfig": { 25 | "access": "public" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/cumt-robin/vue-pro-components.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/cumt-robin/vue-pro-components/issues" 33 | }, 34 | "peerDependencies": { 35 | "vue": "^3.2.45" 36 | }, 37 | "dependencies": { 38 | "@vue-pro-components/utils": "^0.19.0" 39 | }, 40 | "gitHead": "332d90f75db2f7a2daff8f964e51abd59aa8e52b" 41 | } 42 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/button/button.tsx: -------------------------------------------------------------------------------- 1 | import { defineComponent } from 'vue' 2 | import { Button as AButton } from 'ant-design-vue' 3 | import IconSvg from '../icon-svg' 4 | import { innerKeys, props as buttonProps } from './props' 5 | import { usePickedProps } from '../hooks/props' 6 | 7 | export default defineComponent({ 8 | name: 'VpButton', 9 | props: buttonProps, 10 | setup(props, { slots }) { 11 | // 把属于 AButton 的属性挑选出来,再绑定到 AButton 上 12 | const innerProps = usePickedProps(props, innerKeys) 13 | 14 | return () => ( 15 | ( 22 | <> 23 | {props.ico && !props.loading ? : null} 24 | {slots?.default?.()} 25 | 26 | ), 27 | }} 28 | > 29 | ) 30 | }, 31 | }) 32 | -------------------------------------------------------------------------------- /packages/vue-pro-components/src/fullscreen/fullscreen.vue: -------------------------------------------------------------------------------- 1 | 33 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages 3 | 4 | name: Build and Publish Node.js Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | env: 11 | NPM_TOKEN: ${{secrets.NPM_TOKEN}} 12 | 13 | jobs: 14 | publish-npm: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v3 19 | 20 | - name: Setup Node 21 | uses: actions/setup-node@v3 22 | with: 23 | node-version: 16 24 | 25 | - name: Get yarn cache directory path 26 | id: yarn-cache-dir-path 27 | run: echo "::set-output name=dir::$(yarn cache dir)" 28 | 29 | - uses: actions/cache@v3 30 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 31 | with: 32 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 33 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 34 | restore-keys: | 35 | ${{ runner.os }}-yarn- 36 | 37 | - name: Install Dependency 38 | run: yarn install --frozen-lockfile 39 | 40 | - name: Build and Publish 41 | run: yarn build-publish 42 | -------------------------------------------------------------------------------- /packages/headless/src/fullscreen.ts: -------------------------------------------------------------------------------- 1 | import { 2 | EnhancedHTMLElement, 3 | enterFullscreen, 4 | exitFullscreen, 5 | getFullscreenElement, 6 | isFullscreen, 7 | listenFullscreen, 8 | } from '@vue-pro-components/utils' 9 | import { onMounted, ref } from 'vue' 10 | 11 | export interface UseFullscreenOptions { 12 | getElement?: () => EnhancedHTMLElement 13 | onFullscreenChange?: (state: boolean) => void 14 | } 15 | 16 | export const useFullscreen = ({ getElement = () => document.body, onFullscreenChange }: UseFullscreenOptions = {}) => { 17 | const isTargetFullscreen = ref(false) 18 | const checkFullscreenStatus = () => { 19 | const isFullscreenFlag = isFullscreen() 20 | isTargetFullscreen.value = isFullscreenFlag ? (getFullscreenElement() || document.body) === getElement() : false 21 | } 22 | const toggleFullscreen = () => { 23 | checkFullscreenStatus() 24 | if (isTargetFullscreen.value === true) { 25 | exitFullscreen() 26 | } else { 27 | enterFullscreen(getElement()) 28 | } 29 | } 30 | onMounted(() => { 31 | checkFullscreenStatus() 32 | listenFullscreen(() => { 33 | checkFullscreenStatus() 34 | onFullscreenChange?.(isTargetFullscreen.value) 35 | }) 36 | }) 37 | 38 | return { 39 | isTargetFullscreen, 40 | toggleFullscreen, 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/playground/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/compiler-sfc/test-compiler-sfc.js: -------------------------------------------------------------------------------- 1 | import { readFileSync } from "fs" 2 | import { resolve, relative } from "path" 3 | import { parse, compileStyle, compileScript, compileTemplate } from "vue/compiler-sfc" 4 | import hash from "hash-sum"; 5 | 6 | function compileStyleBlock(styleBlock, descriptor) { 7 | return compileStyle({ source: styleBlock.content, filename: descriptor.filename, id: descriptor.id, scoped: styleBlock.scoped, preprocessLang: styleBlock.lang }) 8 | } 9 | 10 | export async function test() { 11 | const fileName = "test.vue" 12 | 13 | const filePath = resolve(__dirname, fileName) 14 | 15 | const fileContent = await readFileSync(filePath) 16 | 17 | const { descriptor } = parse(fileContent.toString(), { filename: fileName }) 18 | 19 | const rawShortFilePath = relative(process.cwd(), filePath) 20 | .replace(/^(\.\.[\/\\])+/, '') 21 | const shortFilePath = rawShortFilePath.replace(/\\/g, '/') 22 | 23 | const id = hash(shortFilePath) 24 | 25 | descriptor.id = id; 26 | 27 | const styles = descriptor.styles.map(block => compileStyleBlock(block, descriptor)) 28 | 29 | console.log(styles) 30 | 31 | const script = compileScript(descriptor, { id }) 32 | 33 | console.log(script) 34 | 35 | const hasScoped = descriptor.styles.some((s) => s.scoped); 36 | 37 | const template = compileTemplate({ source: descriptor.template.content, filename: descriptor.filename, id, scoped: hasScoped, slotted: descriptor.slotted }) 38 | 39 | console.log(template) 40 | } 41 | 42 | test(); -------------------------------------------------------------------------------- /packages/playground/README.md: -------------------------------------------------------------------------------- 1 | # Vue 3 + TypeScript + Vite 2 | 3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` 69 | -------------------------------------------------------------------------------- /packages/utils/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.19.0](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/utils@0.18.0...@vue-pro-components/utils@0.19.0) (2023-02-17) 7 | 8 | ### Features 9 | 10 | - 新增 getYearStart 方法 ([a774ee8](https://github.com/cumt-robin/vue-pro-components/commit/a774ee8cd9d77ca590f1f0c46b3ed146a19cd4bc)) 11 | 12 | # [0.18.0](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/utils@0.17.0...@vue-pro-components/utils@0.18.0) (2023-02-17) 13 | 14 | ### Features 15 | 16 | - 新增 getOneMonathRange 方法 ([fad657e](https://github.com/cumt-robin/vue-pro-components/commit/fad657ed41c540341f33711b0b5896af88ddced5)) 17 | 18 | # [0.17.0](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/utils@0.16.0...@vue-pro-components/utils@0.17.0) (2023-02-17) 19 | 20 | ### Features 21 | 22 | - 新增 getMonthEnd 方法 ([0bdd0b2](https://github.com/cumt-robin/vue-pro-components/commit/0bdd0b2dc55ece0ae6ced99cc969a530f3ccce7f)) 23 | 24 | # [0.16.0](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/utils@0.15.0...@vue-pro-components/utils@0.16.0) (2023-02-17) 25 | 26 | ### Features 27 | 28 | - 新增 getMonthStart 方法 ([19c42d1](https://github.com/cumt-robin/vue-pro-components/commit/19c42d1f1f6d7d65db0e835c22fb99ccfe362c2f)) 29 | 30 | # [0.15.0](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/utils@0.14.0...@vue-pro-components/utils@0.15.0) (2023-02-17) 31 | 32 | ### Code Refactoring 33 | 34 | - **date-utils:** 修改了传参方式 ([41ebe69](https://github.com/cumt-robin/vue-pro-components/commit/41ebe69a6fde2cc86a08a89739c6f68643197e42)) 35 | 36 | ### Features 37 | 38 | - 新增 getOneWeekRange 方法 ([3743162](https://github.com/cumt-robin/vue-pro-components/commit/3743162d25998ac28d2a787ca8f658bdcee5d2aa)) 39 | 40 | ### BREAKING CHANGES 41 | 42 | - **date-utils:** getOneDayRange 传参方式改为 object 43 | 44 | # [0.14.0](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/utils@0.13.0...@vue-pro-components/utils@0.14.0) (2023-01-13) 45 | 46 | ### Features 47 | 48 | - 新增 getWeekEnd 方法 ([cdc87fe](https://github.com/cumt-robin/vue-pro-components/commit/cdc87fe6daedf91caeb557a9c3faf83a955b1f03)) 49 | -------------------------------------------------------------------------------- /packages/headless/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [0.5.8](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/headless@0.5.7...@vue-pro-components/headless@0.5.8) (2023-02-17) 7 | 8 | **Note:** Version bump only for package @vue-pro-components/headless 9 | 10 | ## [0.5.7](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/headless@0.5.6...@vue-pro-components/headless@0.5.7) (2023-02-17) 11 | 12 | **Note:** Version bump only for package @vue-pro-components/headless 13 | 14 | ## [0.5.6](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/headless@0.5.5...@vue-pro-components/headless@0.5.6) (2023-02-17) 15 | 16 | **Note:** Version bump only for package @vue-pro-components/headless 17 | 18 | ## [0.5.5](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/headless@0.5.4...@vue-pro-components/headless@0.5.5) (2023-02-17) 19 | 20 | **Note:** Version bump only for package @vue-pro-components/headless 21 | 22 | ## [0.5.4](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/headless@0.5.3...@vue-pro-components/headless@0.5.4) (2023-02-17) 23 | 24 | **Note:** Version bump only for package @vue-pro-components/headless 25 | 26 | ## [0.5.3](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/headless@0.5.2...@vue-pro-components/headless@0.5.3) (2023-01-13) 27 | 28 | **Note:** Version bump only for package @vue-pro-components/headless 29 | 30 | ## [0.5.2](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/headless@0.5.1...@vue-pro-components/headless@0.5.2) (2023-01-11) 31 | 32 | **Note:** Version bump only for package @vue-pro-components/headless 33 | 34 | ## [0.5.1](https://github.com/cumt-robin/vue-pro-components/compare/@vue-pro-components/headless@0.5.0...@vue-pro-components/headless@0.5.1) (2023-01-11) 35 | 36 | **Note:** Version bump only for package @vue-pro-components/headless 37 | 38 | # 0.5.0 (2023-01-11) 39 | 40 | ### Bug Fixes 41 | 42 | - 修改 publishConfig ([bcae06d](https://github.com/cumt-robin/vue-pro-components/commit/bcae06d05fc8c8f80426f232f4d70e99baef76fc)) 43 | 44 | ### Features 45 | 46 | - headless ([f2199f8](https://github.com/cumt-robin/vue-pro-components/commit/f2199f84e4f7acb3585ad4a95d87c2949f193cc1)) 47 | - headless fullscreen 完善 ([0ef401f](https://github.com/cumt-robin/vue-pro-components/commit/0ef401f19dc866c177cf25c0c6d882f833ef9672)) 48 | - 增加 isSameDay 方法 ([59acd06](https://github.com/cumt-robin/vue-pro-components/commit/59acd0611f92b533e430a5ee2e22d7ff7afd7e74)) 49 | - 支持 headless 打包 ([a8917ef](https://github.com/cumt-robin/vue-pro-components/commit/a8917ef49b5877382ef5a369ead64b10c3b32d84)) 50 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | browser: true, 5 | es2021: true, 6 | node: true, 7 | }, 8 | parser: 'vue-eslint-parser', 9 | parserOptions: { 10 | parser: { 11 | "ts": "@typescript-eslint/parser", 12 | "