mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
parent
e2d784176b
commit
c613b12f11
30
packages/element-plus-adapter/.npmignore
Normal file
30
packages/element-plus-adapter/.npmignore
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
.babelrc
|
||||||
|
.eslintrc
|
||||||
|
.editorconfig
|
||||||
|
node_modules
|
||||||
|
.DS_Store
|
||||||
|
examples
|
||||||
|
tests
|
||||||
|
.code.yml
|
||||||
|
reports
|
||||||
|
tsconfig.json
|
||||||
|
vite.config.ts
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
50
packages/element-plus-adapter/package.json
Normal file
50
packages/element-plus-adapter/package.json
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"version": "1.2.0-beta.2",
|
||||||
|
"name": "@tmagic/element-plus-adapter",
|
||||||
|
"sideEffects": [
|
||||||
|
"dist/*"
|
||||||
|
],
|
||||||
|
"main": "dist/tmagic-element-plus-adapter.umd.js",
|
||||||
|
"module": "dist/tmagic-element-plus-adapter.mjs",
|
||||||
|
"types": "types/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"import": "./dist/tmagic-element-plus-adapter.mjs",
|
||||||
|
"require": "./dist/tmagic-element-plus-adapter.umd.js"
|
||||||
|
},
|
||||||
|
"./*": "./*"
|
||||||
|
},
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc -b tsconfig.build.json",
|
||||||
|
"clear:type": "rimraf ./types"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Tencent/tmagic-editor.git"
|
||||||
|
},
|
||||||
|
"homepage": "https://tencent.github.io/tmagic-editor/docs/",
|
||||||
|
"keywords": [
|
||||||
|
"design",
|
||||||
|
"vue",
|
||||||
|
"vue3",
|
||||||
|
"typescript"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"element-plus": "^2.2.17",
|
||||||
|
"vue": "^3.2.37"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"element-plus": "^2.2.17",
|
||||||
|
"vue": "^3.2.37"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^15.12.4",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
|
"typescript": "^4.7.4",
|
||||||
|
"vite": "^3.1.3"
|
||||||
|
}
|
||||||
|
}
|
196
packages/element-plus-adapter/src/index.ts
Normal file
196
packages/element-plus-adapter/src/index.ts
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
import {
|
||||||
|
ElButton,
|
||||||
|
ElCard,
|
||||||
|
ElCascader,
|
||||||
|
ElCheckbox,
|
||||||
|
ElCheckboxGroup,
|
||||||
|
ElCol,
|
||||||
|
ElColorPicker,
|
||||||
|
ElDatePicker,
|
||||||
|
ElDialog,
|
||||||
|
ElForm,
|
||||||
|
ElFormItem,
|
||||||
|
ElIcon,
|
||||||
|
ElInput,
|
||||||
|
ElInputNumber,
|
||||||
|
ElMessage,
|
||||||
|
ElOption,
|
||||||
|
ElOptionGroup,
|
||||||
|
ElPagination,
|
||||||
|
ElRadio,
|
||||||
|
ElRadioGroup,
|
||||||
|
ElRow,
|
||||||
|
ElSelect,
|
||||||
|
ElStep,
|
||||||
|
ElSteps,
|
||||||
|
ElSwitch,
|
||||||
|
ElTable,
|
||||||
|
ElTableColumn,
|
||||||
|
ElTabPane,
|
||||||
|
ElTabs,
|
||||||
|
ElTimePicker,
|
||||||
|
ElTooltip,
|
||||||
|
ElUpload,
|
||||||
|
} from 'element-plus';
|
||||||
|
|
||||||
|
const adapter: any = {
|
||||||
|
message: ElMessage,
|
||||||
|
components: {
|
||||||
|
button: {
|
||||||
|
component: ElButton,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
card: {
|
||||||
|
component: ElCard,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
cascader: {
|
||||||
|
component: ElCascader,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
checkbox: {
|
||||||
|
component: ElCheckbox,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
checkboxGroup: {
|
||||||
|
component: ElCheckboxGroup,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
col: {
|
||||||
|
component: ElCol,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
colorPicker: {
|
||||||
|
component: ElColorPicker,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
datePicker: {
|
||||||
|
component: ElDatePicker,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
dialog: {
|
||||||
|
component: ElDialog,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
form: {
|
||||||
|
component: ElForm,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
formItem: {
|
||||||
|
component: ElFormItem,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
icon: {
|
||||||
|
component: ElIcon,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
input: {
|
||||||
|
component: ElInput,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
inputNumber: {
|
||||||
|
component: ElInputNumber,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
option: {
|
||||||
|
component: ElOption,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
optionGroup: {
|
||||||
|
component: ElOptionGroup,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
pagination: {
|
||||||
|
component: ElPagination,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
radio: {
|
||||||
|
component: ElRadio,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
radioGroup: {
|
||||||
|
component: ElRadioGroup,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
row: {
|
||||||
|
component: ElRow,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
select: {
|
||||||
|
component: ElSelect,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
step: {
|
||||||
|
component: ElStep,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
steps: {
|
||||||
|
component: ElSteps,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
switch: {
|
||||||
|
component: ElSwitch,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
table: {
|
||||||
|
component: ElTable,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
tableColumn: {
|
||||||
|
component: ElTableColumn,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
tabPane: {
|
||||||
|
component: ElTabPane,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
tabs: {
|
||||||
|
component: ElTabs,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
timePicker: {
|
||||||
|
component: ElTimePicker,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
tooltip: {
|
||||||
|
component: ElTooltip,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
|
||||||
|
upload: {
|
||||||
|
component: ElUpload,
|
||||||
|
props: (props: any) => props,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default adapter;
|
16
packages/element-plus-adapter/tsconfig.build.json
Normal file
16
packages/element-plus-adapter/tsconfig.build.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "types",
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"paths": {},
|
||||||
|
"module": "CommonJS",
|
||||||
|
"rootDir": "./src",
|
||||||
|
"outDir": "./dist",
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
],
|
||||||
|
}
|
6
packages/element-plus-adapter/tsconfig.json
Normal file
6
packages/element-plus-adapter/tsconfig.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "../..",
|
||||||
|
},
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user