diff --git a/.browserslistrc b/.browserslistrc deleted file mode 100644 index dc3bc09a247732bf162a0078796c68ebdc074c30..0000000000000000000000000000000000000000 --- a/.browserslistrc +++ /dev/null @@ -1,4 +0,0 @@ -> 1% -last 2 versions -not dead -not ie 11 diff --git a/.npmignore b/.npmrc similarity index 100% rename from .npmignore rename to .npmrc diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index e9558405fdcc02f12d757acb308e02937a7444f1..0000000000000000000000000000000000000000 --- a/babel.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] -} diff --git a/build/rollup.config.js b/build/rollup.config.js deleted file mode 100644 index ffa2219a514fb23951ff2bee8695c7d12a58c2dd..0000000000000000000000000000000000000000 --- a/build/rollup.config.js +++ /dev/null @@ -1,51 +0,0 @@ -// import vue from 'rollup-plugin-vue' -import { nodeResolve } from '@rollup/plugin-node-resolve' -// import commonjs from '@rollup/plugin-commonjs' -import { terser } from 'rollup-plugin-terser' -import typescript from 'rollup-plugin-typescript2' -import pkg from '../package.json' -const deps = Object.keys(pkg.dependencies) -// eslint-disable-next-line @typescript-eslint/no-var-requires -const vue = require('rollup-plugin-vue') - -export default [ - { - input: 'packages/index.ts', - output: [ - { - format: 'es', - file: pkg.module - } - ], - plugins: [ - terser(), - nodeResolve(), - // commonjs(), - vue({ - target: 'browser', - css: false, - exposeFilename: false - }), - typescript({ - tsconfigOverride: { - compilerOptions: { - declaration: true - }, - 'include': [ - 'packages/**/*', - 'typings/*' - ], - 'exclude': [ - 'node_modules', - 'packages/**/__tests__/*' - ] - }, - abortOnError: false - }) - ], - external(id) { - return /^vue/.test(id) - || deps.some(k => new RegExp('^' + k).test(id)) - } - } -] \ No newline at end of file diff --git a/docs/.vuepress b/docs/.vuepress deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/docs/guide b/docs/guide deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/env.d.ts b/env.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1d5e70def47ae8d2c9a44a61fe6b32b12128ca5d --- /dev/null +++ b/env.d.ts @@ -0,0 +1,15 @@ +/// +interface ImportMetaEnv { + readonly VITE_SCHOOL_TYPE: string +} + +interface ImportMeta { + readonly env: ImportMetaEnv +} + +declare module '*.vue' { + import { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/common/index.ts b/examples/common/index.ts deleted file mode 100644 index 73ed647298b35db4447f83673da2e47582ed0f53..0000000000000000000000000000000000000000 --- a/examples/common/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -export default function DeepCopy(source: any) { - if(null == source || {} == source || [] == source) - { - return source; - } - - let newObject : any; - let isArray = false; - if((source as any).length) - { - newObject = []; - isArray = true; - } - else - { - newObject = {}; - isArray = false; - } - - for (let key of Object.keys(source)) - { - if(null == source[key]) - { - if (isArray) - { - newObject.push(null); - } - else - { - newObject[key] = null; - } - } - else - { - let sub = (typeof source[key] == 'object') ? DeepCopy(source[key]) : source[key]; - if(isArray) - { - newObject.push(sub); - } - else - { - newObject[key] = sub; - } - } - } - return newObject; -} \ No newline at end of file diff --git a/examples/main.ts b/examples/main.ts index bb839401f49072f5dfefba45314e05c62a4b1691..24a1727d48c7ff2e0a110d3e18e5c6bf3a771293 100644 --- a/examples/main.ts +++ b/examples/main.ts @@ -1,12 +1,20 @@ import { createApp } from 'vue' -import App from './App.vue' +import App from './src/App.vue' +import { createPinia } from 'pinia'; +import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'; + + // @ts-ignore -import PhotUI from '~/index' -import store from '../stores' +import PhotUI from '../src/index' + + import '@photlab/phot-icon/iconfont.css' import '@photlab/phot-icon/iconfont.js' +const pinia = createPinia(); +pinia.use(piniaPluginPersistedstate); const app = createApp(App) + app.use(PhotUI) -app.use(store) +app.use(pinia) app.mount('#app') \ No newline at end of file diff --git a/examples/App.vue b/examples/src/App.vue similarity index 37% rename from examples/App.vue rename to examples/src/App.vue index 7344deab8c171813d998a2e6ffe06e1b2895409a..4e70a4b93a3c2c8ae2e977758efa4025a05e3aff 100644 --- a/examples/App.vue +++ b/examples/src/App.vue @@ -13,8 +13,7 @@ inactiveColor="#909399" v-model="demoRef.theme" @onChange="themeChange" - > - + > @@ -23,7 +22,7 @@
描边按钮 描边按钮 - small按钮 + 描边按钮
@@ -31,8 +30,12 @@
开关
- - +
@@ -40,8 +43,13 @@
- - +
@@ -50,7 +58,7 @@
下拉列表
- +
@@ -63,8 +71,7 @@ iconPosition="right" clearAble @onIconClick="onIconClick" - > - + >
@@ -76,16 +83,27 @@
数字输入框
- +
+
复选框
- +
@@ -130,8 +148,7 @@ add remove @onRightClickHandle="tabRightClickHandle" - > - + >
@@ -172,7 +189,7 @@ 树形控件 - +
@@ -218,653 +235,736 @@
分析器子窗口
- - - - - - + + + + + + +
-