@opendesign-plus/components 0.0.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/OBanner.vue.d.ts +2 -0
- package/dist/components/OCookieNotice.vue.d.ts +16 -0
- package/dist/components/OCookieNoticeEl.vue.d.ts +29 -0
- package/dist/components/OHeaderSearch.vue.d.ts +692 -0
- package/dist/components/OPlusConfigProvider.vue.d.ts +23 -0
- package/dist/components/OSection.vue.d.ts +37 -0
- package/dist/components/OThemeSwitcher.vue.d.ts +28 -0
- package/dist/components.cjs.js +1 -0
- package/dist/components.css +1 -0
- package/dist/components.es.js +1206 -0
- package/dist/components.umd.js +1 -0
- package/dist/index.d.ts +12 -0
- package/docs/design.md +27 -0
- package/docs/design_banner.md +41 -0
- package/docs/design_section.md +27 -0
- package/package.json +47 -0
- package/scripts/generate-components-index.js +81 -0
- package/src/assets/svg-icons/icon-chevron-right.svg +3 -0
- package/src/assets/svg-icons/icon-close.svg +3 -0
- package/src/assets/svg-icons/icon-delete.svg +3 -0
- package/src/assets/svg-icons/icon-header-back.svg +3 -0
- package/src/assets/svg-icons/icon-header-delete.svg +3 -0
- package/src/assets/svg-icons/icon-header-search.svg +4 -0
- package/src/assets/svg-icons/icon-moon.svg +3 -0
- package/src/assets/svg-icons/icon-sun.svg +3 -0
- package/src/components/OBanner.vue +390 -0
- package/src/components/OCookieNotice.vue +424 -0
- package/src/components/OCookieNoticeEl.vue +404 -0
- package/src/components/OHeaderSearch.vue +601 -0
- package/src/components/OPlusConfigProvider.vue +32 -0
- package/src/components/OSection.vue +178 -0
- package/src/components/OThemeSwitcher.vue +108 -0
- package/src/components/common/ClientOnlyWrapper.ts +21 -0
- package/src/components/common/ContentWrapper.vue +85 -0
- package/src/draft/Banner.vue +265 -0
- package/src/draft/ButtonCards.vue +106 -0
- package/src/draft/Feature.vue +134 -0
- package/src/draft/Footer.vue +512 -0
- package/src/draft/HorizontalAnchor.vue +165 -0
- package/src/draft/ItemSwiper.vue +133 -0
- package/src/draft/Logo.vue +141 -0
- package/src/draft/LogoCard.vue +75 -0
- package/src/draft/LogoV2.vue +19 -0
- package/src/draft/MainCard.vue +38 -0
- package/src/draft/MultiCard.vue +95 -0
- package/src/draft/MultiIconCard.vue +74 -0
- package/src/draft/OInfoCard.vue +176 -0
- package/src/draft/Process.vue +81 -0
- package/src/draft/Section.vue +167 -0
- package/src/draft/SingleTabCard.vue +85 -0
- package/src/draft/SliderCard.vue +110 -0
- package/src/env.d.ts +1 -0
- package/src/i18n/en.ts +20 -0
- package/src/i18n/index.ts +42 -0
- package/src/i18n/zh.ts +9 -0
- package/src/index.ts +34 -0
- package/src/shared/provide.ts +6 -0
- package/src/vue.d.ts +10 -0
- package/tsconfig.json +33 -0
- package/vite.config.ts +94 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// OpenDesignPlus Components 库入口文件
|
|
2
|
+
// 此文件由 scripts/generate-components-index.js 自动生成
|
|
3
|
+
|
|
4
|
+
import OBanner from './components/OBanner.vue';
|
|
5
|
+
import OCookieNotice from './components/OCookieNotice.vue';
|
|
6
|
+
import OCookieNoticeEl from './components/OCookieNoticeEl.vue';
|
|
7
|
+
import OHeaderSearch from './components/OHeaderSearch.vue';
|
|
8
|
+
import OPlusConfigProvider from './components/OPlusConfigProvider.vue';
|
|
9
|
+
import OSection from './components/OSection.vue';
|
|
10
|
+
import OThemeSwitcher from './components/OThemeSwitcher.vue';
|
|
11
|
+
|
|
12
|
+
// 导出组件
|
|
13
|
+
const components = {
|
|
14
|
+
OBanner,
|
|
15
|
+
OCookieNotice,
|
|
16
|
+
OCookieNoticeEl,
|
|
17
|
+
OHeaderSearch,
|
|
18
|
+
OPlusConfigProvider,
|
|
19
|
+
OSection,
|
|
20
|
+
OThemeSwitcher
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// 导出单个组件
|
|
24
|
+
export { OBanner, OCookieNotice, OCookieNoticeEl, OHeaderSearch, OPlusConfigProvider, OSection, OThemeSwitcher };
|
|
25
|
+
|
|
26
|
+
// 默认导出(用于Vue插件安装)
|
|
27
|
+
export default {
|
|
28
|
+
install: (app: any) => {
|
|
29
|
+
// 注册所有组件
|
|
30
|
+
Object.entries(components).forEach(([name, component]) => {
|
|
31
|
+
app.component(name, component);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
package/src/vue.d.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedSideEffectImports": true,
|
|
22
|
+
|
|
23
|
+
/* Declaration */
|
|
24
|
+
"declaration": true,
|
|
25
|
+
"declarationDir": "dist",
|
|
26
|
+
|
|
27
|
+
"baseUrl": ".",
|
|
28
|
+
"paths": {
|
|
29
|
+
"@/*": ["src/*"]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"include": ["src"]
|
|
33
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import vue from '@vitejs/plugin-vue';
|
|
3
|
+
import Icons from 'unplugin-icons/vite';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
|
|
6
|
+
import ElementPlus from 'unplugin-element-plus/vite';
|
|
7
|
+
import dts from 'vite-plugin-dts';
|
|
8
|
+
|
|
9
|
+
export default defineConfig(({ mode }) => {
|
|
10
|
+
const isLibraryMode = mode === 'library';
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
build: {
|
|
14
|
+
outDir: path.resolve(__dirname, './dist'),
|
|
15
|
+
...(isLibraryMode
|
|
16
|
+
? {
|
|
17
|
+
lib: {
|
|
18
|
+
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
19
|
+
name: 'OpenDesignPlusComponents',
|
|
20
|
+
fileName: (format) => `components.${format}.js`,
|
|
21
|
+
formats: ['es', 'umd', 'cjs'],
|
|
22
|
+
cssInjectedByJs: true,
|
|
23
|
+
},
|
|
24
|
+
rollupOptions: {
|
|
25
|
+
external: [
|
|
26
|
+
/^element-plus/,
|
|
27
|
+
'vue',
|
|
28
|
+
'@opensig/opendesign',
|
|
29
|
+
'@vueuse/core',
|
|
30
|
+
'shiki',
|
|
31
|
+
'@opendesign-plus/composables',
|
|
32
|
+
],
|
|
33
|
+
output: {
|
|
34
|
+
globals: {
|
|
35
|
+
'element-plus': 'ElementPlus',
|
|
36
|
+
vue: 'Vue',
|
|
37
|
+
'@opensig/opendesign': 'OpenDesign',
|
|
38
|
+
'@vueuse/core': 'VueUse',
|
|
39
|
+
'@opendesign-plus/composables': 'OpenDesignPlusComposables',
|
|
40
|
+
},
|
|
41
|
+
entryFileNames: 'components.[format].js',
|
|
42
|
+
chunkFileNames: 'components-[name].[format].js',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
cssCodeSplit: false, // 禁用CSS分割,所有样式打包到一起
|
|
46
|
+
}
|
|
47
|
+
: {}),
|
|
48
|
+
},
|
|
49
|
+
resolve: {
|
|
50
|
+
alias: {
|
|
51
|
+
vue: 'vue/dist/vue.esm-bundler.js',
|
|
52
|
+
'@': path.resolve(__dirname, 'src'),
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
css: {
|
|
56
|
+
preprocessorOptions: {
|
|
57
|
+
scss: {
|
|
58
|
+
charset: false,
|
|
59
|
+
additionalData: `
|
|
60
|
+
@use "@opendesign-plus/styles/mixin/screen.scss" as *;
|
|
61
|
+
@use "@opendesign-plus/styles/mixin/font.scss" as *;
|
|
62
|
+
@use "@opendesign-plus/styles/mixin/common.scss" as *;
|
|
63
|
+
`,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
plugins: [
|
|
68
|
+
// 关键:配置Vue插件正确处理样式
|
|
69
|
+
vue({
|
|
70
|
+
include: [/\.vue$/],
|
|
71
|
+
template: {
|
|
72
|
+
compilerOptions: {
|
|
73
|
+
// 确保模板编译正确
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
}) as any,
|
|
77
|
+
dts({
|
|
78
|
+
include: ['./src/components/*.vue', './src/index.ts']
|
|
79
|
+
}),
|
|
80
|
+
Icons({
|
|
81
|
+
compiler: 'vue3',
|
|
82
|
+
customCollections: {
|
|
83
|
+
components: FileSystemIconLoader(path.resolve(__dirname, './src/assets/svg-icons')),
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
ElementPlus({ useSource: true })
|
|
87
|
+
],
|
|
88
|
+
assetsInclude: ['**/*.md'],
|
|
89
|
+
server: {
|
|
90
|
+
proxy: {},
|
|
91
|
+
},
|
|
92
|
+
base: '/',
|
|
93
|
+
};
|
|
94
|
+
});
|