@opendesign-plus-test/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.cjs.js +1 -0
- package/dist/components.css +1 -0
- package/dist/components.es.js +1193 -0
- package/dist/components.umd.js +1 -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 +417 -0
- package/src/components/OCookieNoticeEl.vue +403 -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 +90 -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,90 @@
|
|
|
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
|
+
|
|
8
|
+
export default defineConfig(({ mode }) => {
|
|
9
|
+
const isLibraryMode = mode === 'library';
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
build: {
|
|
13
|
+
outDir: path.resolve(__dirname, './dist'),
|
|
14
|
+
...(isLibraryMode
|
|
15
|
+
? {
|
|
16
|
+
lib: {
|
|
17
|
+
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
18
|
+
name: 'OpenDesignPlusComponents',
|
|
19
|
+
fileName: (format) => `components.${format}.js`,
|
|
20
|
+
formats: ['es', 'umd', 'cjs'],
|
|
21
|
+
cssInjectedByJs: true,
|
|
22
|
+
},
|
|
23
|
+
rollupOptions: {
|
|
24
|
+
external: [
|
|
25
|
+
/^element-plus/,
|
|
26
|
+
'vue',
|
|
27
|
+
'@opensig/opendesign',
|
|
28
|
+
'@vueuse/core',
|
|
29
|
+
'shiki',
|
|
30
|
+
'@opendesign-plus/composables',
|
|
31
|
+
],
|
|
32
|
+
output: {
|
|
33
|
+
globals: {
|
|
34
|
+
'element-plus': 'ElementPlus',
|
|
35
|
+
vue: 'Vue',
|
|
36
|
+
'@opensig/opendesign': 'OpenDesign',
|
|
37
|
+
'@vueuse/core': 'VueUse',
|
|
38
|
+
'@opendesign-plus/composables': 'OpenDesignPlusComposables',
|
|
39
|
+
},
|
|
40
|
+
entryFileNames: 'components.[format].js',
|
|
41
|
+
chunkFileNames: 'components-[name].[format].js',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
cssCodeSplit: false, // 禁用CSS分割,所有样式打包到一起
|
|
45
|
+
}
|
|
46
|
+
: {}),
|
|
47
|
+
},
|
|
48
|
+
resolve: {
|
|
49
|
+
alias: {
|
|
50
|
+
vue: 'vue/dist/vue.esm-bundler.js',
|
|
51
|
+
'@': path.resolve(__dirname, 'src'),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
css: {
|
|
55
|
+
preprocessorOptions: {
|
|
56
|
+
scss: {
|
|
57
|
+
charset: false,
|
|
58
|
+
additionalData: `
|
|
59
|
+
@use "@opendesign-plus/styles/mixin/screen.scss" as *;
|
|
60
|
+
@use "@opendesign-plus/styles/mixin/font.scss" as *;
|
|
61
|
+
@use "@opendesign-plus/styles/mixin/common.scss" as *;
|
|
62
|
+
`,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
plugins: [
|
|
67
|
+
// 关键:配置Vue插件正确处理样式
|
|
68
|
+
vue({
|
|
69
|
+
include: [/\.vue$/],
|
|
70
|
+
template: {
|
|
71
|
+
compilerOptions: {
|
|
72
|
+
// 确保模板编译正确
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
}) as any,
|
|
76
|
+
Icons({
|
|
77
|
+
compiler: 'vue3',
|
|
78
|
+
customCollections: {
|
|
79
|
+
components: FileSystemIconLoader(path.resolve(__dirname, './src/assets/svg-icons')),
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
ElementPlus({ useSource: true })
|
|
83
|
+
],
|
|
84
|
+
assetsInclude: ['**/*.md'],
|
|
85
|
+
server: {
|
|
86
|
+
proxy: {},
|
|
87
|
+
},
|
|
88
|
+
base: '/',
|
|
89
|
+
};
|
|
90
|
+
});
|