├── templates ├── vue │ ├── packages │ │ ├── setters │ │ │ ├── src │ │ │ │ └── index.ts │ │ │ ├── .npmignore.tpl │ │ │ ├── tsconfig.json │ │ │ ├── README.zh-CN.md │ │ │ ├── README.md │ │ │ ├── builder.config.ts │ │ │ ├── tsconfig.build.json │ │ │ └── package.json │ │ ├── components │ │ │ ├── src │ │ │ │ └── index.ts │ │ │ ├── .npmignore.tpl │ │ │ ├── README.zh-CN.md │ │ │ ├── tsconfig.json │ │ │ ├── README.md │ │ │ ├── builder.config.ts │ │ │ ├── tsconfig.build.json │ │ │ └── package.json │ │ ├── prototypes │ │ │ ├── src │ │ │ │ └── index.ts │ │ │ ├── .npmignore.tpl │ │ │ ├── tsconfig.json │ │ │ ├── README.zh-CN.md │ │ │ ├── README.md │ │ │ ├── builder.config.ts │ │ │ ├── tsconfig.build.json │ │ │ └── package.json │ │ ├── renderer │ │ │ ├── src │ │ │ │ └── index.ts │ │ │ ├── .npmignore.tpl │ │ │ ├── tsconfig.json │ │ │ ├── README.md │ │ │ ├── README.zh-CN.md │ │ │ ├── builder.config.ts │ │ │ ├── tsconfig.build.json │ │ │ └── package.json │ │ ├── settings-form │ │ │ ├── src │ │ │ │ └── index.ts │ │ │ ├── .npmignore.tpl │ │ │ ├── tsconfig.json │ │ │ ├── README.md │ │ │ ├── README.zh-CN.md │ │ │ ├── builder.config.ts │ │ │ ├── tsconfig.build.json │ │ │ └── package.json │ │ └── .eslintrc │ ├── global.config.d.ts │ ├── .yarnrc │ ├── commitlint.config.js │ ├── .prettierrc.js │ ├── docs │ │ ├── .vuepress │ │ │ ├── util.js │ │ │ ├── enhanceApp.js │ │ │ ├── components │ │ │ │ └── highlight.js │ │ │ ├── config.js │ │ │ └── styles │ │ │ │ └── index.styl │ │ ├── guide │ │ │ ├── input.md │ │ │ ├── switch.md │ │ │ ├── array-tabs.md │ │ │ ├── space.md │ │ │ ├── password.md │ │ │ ├── transfer.md │ │ │ ├── cascader.md │ │ │ ├── date-picker.md │ │ │ ├── time-picker.md │ │ │ ├── form-button-group.md │ │ │ ├── input-number.md │ │ │ ├── upload.md │ │ │ ├── editable.md │ │ │ ├── radio.md │ │ │ ├── checkbox.md │ │ │ ├── form-tab.md │ │ │ ├── form-step.md │ │ │ ├── select.md │ │ │ ├── reset.md │ │ │ ├── submit.md │ │ │ ├── preview-text.md │ │ │ ├── form.md │ │ │ ├── form-collapse.md │ │ │ ├── form-grid.md │ │ │ ├── form-drawer.md │ │ │ ├── form-dialog.md │ │ │ └── array-items.md │ │ ├── README.md │ │ └── demos │ │ │ ├── guide │ │ │ ├── form-item │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── switch │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── password │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── input │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── input-number │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── radio │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── transfer │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── form-layout │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── select │ │ │ │ ├── template-sync.vue │ │ │ │ ├── markup-schema-sync.vue │ │ │ │ └── json-schema-sync.vue │ │ │ ├── checkbox │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── time-picker │ │ │ │ ├── template.vue │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── reset │ │ │ │ ├── base.vue │ │ │ │ ├── force.vue │ │ │ │ └── validate.vue │ │ │ ├── submit │ │ │ │ ├── base.vue │ │ │ │ └── loading.vue │ │ │ ├── form-button-group.vue │ │ │ ├── form.vue │ │ │ ├── form-drawer │ │ │ │ ├── template.vue │ │ │ │ ├── json-schema.vue │ │ │ │ └── markup-schema.vue │ │ │ ├── cascader │ │ │ │ ├── template.vue │ │ │ │ └── markup-schema.vue │ │ │ ├── array-tabs │ │ │ │ └── markup-schema.vue │ │ │ ├── form-dialog │ │ │ │ └── template.vue │ │ │ ├── form-grid │ │ │ │ ├── markup-schema.vue │ │ │ │ └── json-schema.vue │ │ │ ├── preview-text │ │ │ │ └── base.vue │ │ │ └── upload │ │ │ │ └── template.vue │ │ │ └── index.vue │ ├── .eslintignore │ ├── .codecov.yml │ ├── tsconfig.build.json │ ├── .github │ │ ├── workflows │ │ │ ├── pr-welcome.yml │ │ │ ├── package-size.yml │ │ │ ├── check-pr-title.yml │ │ │ ├── commitlint.yml │ │ │ ├── issue-open-check.yml │ │ │ ├── ci.yml │ │ │ └── release.yml │ │ ├── ISSUE_TEMPLATE │ │ │ └── config.yml │ │ ├── FUNDING.yml │ │ └── PULL_REQUEST_TEMPLATE.md │ ├── lerna.json │ ├── .editorconfig │ ├── tsconfig.jest.json │ ├── .gitignore.tpl │ ├── .vscode │ │ └── cspell.json │ ├── tsconfig.json │ ├── global.config.ts │ ├── jest.config.js │ ├── global.config.js │ ├── LICENSE.md │ ├── global.config.js.map │ ├── .eslintrc │ └── README.zh-CN.md └── react │ ├── global.config.d.ts │ ├── packages │ ├── components │ │ ├── src │ │ │ └── index.ts │ │ ├── .npmignore.tpl │ │ ├── README.zh-CN.md │ │ ├── tsconfig.json │ │ ├── README.md │ │ ├── builder.config.ts │ │ ├── tsconfig.build.json │ │ └── package.json │ ├── prototypes │ │ ├── src │ │ │ └── index.ts │ │ ├── .npmignore.tpl │ │ ├── tsconfig.json │ │ ├── README.zh-CN.md │ │ ├── README.md │ │ ├── builder.config.ts │ │ ├── tsconfig.build.json │ │ └── package.json │ ├── renderer │ │ ├── src │ │ │ └── index.ts │ │ ├── .npmignore.tpl │ │ ├── tsconfig.json │ │ ├── README.md │ │ ├── README.zh-CN.md │ │ ├── builder.config.ts │ │ ├── tsconfig.build.json │ │ └── package.json │ ├── setters │ │ ├── src │ │ │ └── index.ts │ │ ├── .npmignore.tpl │ │ ├── tsconfig.json │ │ ├── README.zh-CN.md │ │ ├── README.md │ │ ├── builder.config.ts │ │ ├── tsconfig.build.json │ │ └── package.json │ └── settings-form │ │ ├── src │ │ └── index.ts │ │ ├── .npmignore.tpl │ │ ├── tsconfig.json │ │ ├── README.md │ │ ├── README.zh-CN.md │ │ ├── builder.config.ts │ │ ├── tsconfig.build.json │ │ └── package.json │ ├── .yarnrc │ ├── commitlint.config.js │ ├── .prettierrc.js │ ├── .codecov.yml │ ├── .eslintignore │ ├── tsconfig.build.json │ ├── .github │ ├── workflows │ │ ├── pr-welcome.yml │ │ ├── package-size.yml │ │ ├── check-pr-title.yml │ │ ├── commitlint.yml │ │ ├── issue-open-check.yml │ │ ├── ci.yml │ │ └── release.yml │ ├── ISSUE_TEMPLATE │ │ └── config.yml │ ├── FUNDING.yml │ └── PULL_REQUEST_TEMPLATE.md │ ├── .editorconfig │ ├── lerna.json │ ├── tsconfig.jest.json │ ├── .gitignore.tpl │ ├── .vscode │ └── cspell.json │ ├── tsconfig.json │ ├── global.config.ts │ ├── jest.config.js │ ├── global.config.js │ ├── LICENSE.md │ ├── global.config.js.map │ ├── .eslintrc │ ├── README.zh-CN.md │ └── docs │ └── components │ └── index.zh-CN.md ├── .yarnrc ├── .npmignore ├── commitlint.config.js ├── src ├── index.ts ├── cli.ts ├── shared.ts ├── types.ts ├── constants.ts ├── build │ ├── copy-style-files.ts │ ├── build-root-style.ts │ ├── build-library.ts │ └── fix-deps-paths.ts └── init │ ├── generate.ts │ └── index.ts ├── .prettierrc.js ├── .eslintignore ├── .editorconfig ├── .gitignore ├── .vscode └── cspell.json ├── README.md ├── tsconfig.json └── .eslintrc /templates/vue/packages/setters/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | registry "https://registry.yarnpkg.com" -------------------------------------------------------------------------------- /templates/react/global.config.d.ts: -------------------------------------------------------------------------------- 1 | export {} 2 | -------------------------------------------------------------------------------- /templates/react/packages/components/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/react/packages/prototypes/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/react/packages/renderer/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/react/packages/setters/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/vue/global.config.d.ts: -------------------------------------------------------------------------------- 1 | export {} 2 | -------------------------------------------------------------------------------- /templates/vue/packages/components/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/vue/packages/prototypes/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/vue/packages/renderer/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/react/packages/settings-form/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/vue/packages/settings-form/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | doc-site 4 | yarn.lock -------------------------------------------------------------------------------- /templates/react/.yarnrc: -------------------------------------------------------------------------------- 1 | registry "https://registry.yarnpkg.com" -------------------------------------------------------------------------------- /templates/vue/.yarnrc: -------------------------------------------------------------------------------- 1 | registry "https://registry.yarnpkg.com" -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] } 2 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './build' 2 | export * from './init' 3 | export * from './types' 4 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: false, 3 | tabWidth: 2, 4 | singleQuote: true, 5 | } 6 | -------------------------------------------------------------------------------- /templates/react/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] } 2 | -------------------------------------------------------------------------------- /templates/vue/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] } 2 | -------------------------------------------------------------------------------- /templates/react/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: false, 3 | tabWidth: 2, 4 | singleQuote: true, 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: false, 3 | tabWidth: 2, 4 | singleQuote: true, 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/docs/.vuepress/util.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | 3 | module.exports = { 4 | getFiles(dir) { 5 | return fs.readdirSync(dir) 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/packages/renderer/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/vue/packages/setters/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/react/packages/components/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/react/packages/prototypes/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/react/packages/renderer/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/react/packages/setters/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/vue/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | dist 4 | build 5 | coverage 6 | expected 7 | website 8 | gh-pages 9 | weex 10 | build.ts 11 | esm 12 | doc-site 13 | public 14 | package -------------------------------------------------------------------------------- /templates/vue/packages/components/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/vue/packages/prototypes/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/vue/packages/settings-form/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /src/cli.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ts-node 2 | import { build, init } from './index' 3 | if (process.argv.includes('build')) { 4 | build() 5 | } else if (process.argv.includes('init')) { 6 | init() 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/packages/settings-form/.npmignore.tpl: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | build 4 | docs 5 | doc-site 6 | __tests__ 7 | .eslintrc 8 | jest.config.js 9 | tsconfig.json 10 | .umi 11 | src -------------------------------------------------------------------------------- /templates/react/packages/components/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %> 2 | 3 | > Formily 组件库桥接层 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %> --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/setters/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/packages/components/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %> 2 | 3 | > Formily 组件库桥接层 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %> --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/packages/renderer/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/packages/setters/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/react/packages/components/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/react/packages/prototypes/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/react/packages/renderer/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/packages/components/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/packages/prototypes/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/packages/settings-form/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/react/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | threshold: 0.1% 6 | patch: 7 | default: 8 | threshold: 0.1% 9 | target: 95% 10 | -------------------------------------------------------------------------------- /templates/react/packages/components/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %> 2 | 3 | > Formily Component Adaptor 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %> --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/settings-form/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"] 5 | } 6 | -------------------------------------------------------------------------------- /templates/vue/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | threshold: 0.1% 6 | patch: 7 | default: 8 | threshold: 0.1% 9 | target: 95% 10 | -------------------------------------------------------------------------------- /templates/vue/packages/components/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %> 2 | 3 | > Formily Component Adaptor 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %> --save 9 | ``` 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | dist 4 | build 5 | coverage 6 | expected 7 | website 8 | gh-pages 9 | weex 10 | build.ts 11 | packages/element 12 | esm 13 | doc-site 14 | public 15 | package 16 | templates -------------------------------------------------------------------------------- /templates/react/packages/setters/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-setters 2 | 3 | > Formily Designable 设置器 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-setters --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/packages/setters/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-setters 2 | 3 | > Formily Designable 设置器 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-setters --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/prototypes/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-prototypes 2 | 3 | > Formily Designable 画布组件库 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-prototypes --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/packages/prototypes/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-prototypes 2 | 3 | > Formily Designable 画布组件库 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-prototypes --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/packages/renderer/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-renderer 2 | 3 | > Formily Designable Settings Form 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-renderer --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/packages/renderer/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-renderer 2 | 3 | > Formily Designable Settings Form 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-renderer --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/packages/setters/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-setters 2 | 3 | > Formily Designable Component Adaptor 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-setters --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "moduleResolution": "node", 5 | "allowJs": true, 6 | "module": "commonjs", 7 | "target": "es5" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /templates/react/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | dist 4 | build 5 | coverage 6 | expected 7 | website 8 | gh-pages 9 | weex 10 | build.ts 11 | packages/vue 12 | packages/element 13 | esm 14 | doc-site 15 | public 16 | package -------------------------------------------------------------------------------- /templates/react/packages/renderer/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-renderer 2 | 3 | > Formily Designable Settings Form 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-renderer --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/renderer/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-renderer 2 | 3 | > Formily Designable Settings Form 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-renderer --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/setters/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-setters 2 | 3 | > Formily Designable Component Adaptor 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-setters --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "moduleResolution": "node", 5 | "allowJs": true, 6 | "module": "commonjs", 7 | "target": "es5" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /templates/vue/packages/prototypes/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-prototypes 2 | 3 | > Formily Designable Component Adaptor 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-prototypes --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/prototypes/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-prototypes 2 | 3 | > Formily Designable Component Adaptor 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-prototypes --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/packages/settings-form/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-settings-form 2 | 3 | > Formily Designable Settings Form 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-settings-form --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/vue/packages/settings-form/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-settings-form 2 | 3 | > Formily Designable Settings Form 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-settings-form --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/settings-form/README.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-settings-form 2 | 3 | > Formily Designable Settings Form 4 | 5 | ## Install 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-settings-form --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/settings-form/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # @formily/<%= repoName %>-settings-form 2 | 3 | > Formily Designable Settings Form 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install @formily/<%= repoName %>-settings-form --save 9 | ``` 10 | -------------------------------------------------------------------------------- /templates/react/packages/setters/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/docs/.vuepress/enhanceApp.js: -------------------------------------------------------------------------------- 1 | import pageComponents from '@internal/page-components' 2 | 3 | export default ({ Vue }) => { 4 | for (const [name, component] of Object.entries(pageComponents)) { 5 | Vue.component(name, component) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/packages/renderer/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/packages/setters/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/packages/setters/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/react/packages/components/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/packages/components/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/react/packages/prototypes/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/packages/prototypes/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/react/packages/renderer/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/packages/renderer/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/react/packages/setters/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/vue/packages/components/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/packages/components/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/vue/packages/prototypes/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/vue/packages/prototypes/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/vue/packages/renderer/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/vue/packages/settings-form/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/packages/settings-form/builder.config.ts: -------------------------------------------------------------------------------- 1 | import { IBuilderConfig } from '@formily/template' 2 | 3 | export const BuilderConfig: IBuilderConfig = { 4 | targetLibName: '<%= packageName %>', 5 | targetLibCjsDir: 'lib', 6 | targetLibEsDir: 'es', 7 | } 8 | -------------------------------------------------------------------------------- /templates/react/packages/settings-form/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/vue/packages/settings-form/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/shared.ts: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import { cwd } from './constants' 3 | 4 | export const getConfigs = (name: string) => { 5 | try { 6 | const module = require.resolve(path.resolve(cwd, name)) 7 | return require(module) 8 | } catch { 9 | return {} as any 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | export interface IBuilderConfig { 2 | externals?: Record 3 | //当前仓库核心依赖的三方组件库名称 4 | targetLibName?: string 5 | //核心三方库cjs目录名 6 | targetLibCjsDir?: string 7 | //核心三方库es目录名 8 | targetLibEsDir?: string 9 | //是否打包全量类型文件 10 | bundleDts?: boolean 11 | } 12 | -------------------------------------------------------------------------------- /templates/react/.github/workflows/pr-welcome.yml: -------------------------------------------------------------------------------- 1 | name: PR Welcome 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened] 6 | 7 | jobs: 8 | welcome: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions-cool/pr-welcome@v1.1.2 12 | with: 13 | pr-emoji: '+1, heart' 14 | -------------------------------------------------------------------------------- /templates/vue/.github/workflows/pr-welcome.yml: -------------------------------------------------------------------------------- 1 | name: PR Welcome 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened] 6 | 7 | jobs: 8 | welcome: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions-cool/pr-welcome@v1.1.2 12 | with: 13 | pr-emoji: '+1, heart' 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 2 12 | 13 | [*.gradle] 14 | indent_size = 4 -------------------------------------------------------------------------------- /templates/vue/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0-alpha.0", 3 | "npmClient": "yarn", 4 | "useWorkspaces": true, 5 | "npmClientArgs": ["--ignore-engines"], 6 | "command": { 7 | "version": { 8 | "forcePublish": true, 9 | "exact": true, 10 | "message": "chore(release): 😊 publish %s" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /templates/react/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 2 12 | 13 | [*.gradle] 14 | indent_size = 4 -------------------------------------------------------------------------------- /templates/react/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0-alpha.0", 3 | "npmClient": "yarn", 4 | "useWorkspaces": true, 5 | "npmClientArgs": ["--ignore-engines"], 6 | "command": { 7 | "version": { 8 | "forcePublish": true, 9 | "exact": true, 10 | "message": "chore(release): 😊 publish %s" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /templates/vue/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 2 12 | 13 | [*.gradle] 14 | indent_size = 4 -------------------------------------------------------------------------------- /templates/react/.github/workflows/package-size.yml: -------------------------------------------------------------------------------- 1 | name: Compressed Size 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: preactjs/compressed-size-action@v2 12 | with: 13 | repo-token: '${{ secrets.GITHUB_TOKEN }}' 14 | -------------------------------------------------------------------------------- /templates/vue/.github/workflows/package-size.yml: -------------------------------------------------------------------------------- 1 | name: Compressed Size 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: preactjs/compressed-size-action@v2 12 | with: 13 | repo-token: '${{ secrets.GITHUB_TOKEN }}' 14 | -------------------------------------------------------------------------------- /templates/react/tsconfig.jest.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "react", 5 | "esModuleInterop": true, 6 | "moduleResolution": "node", 7 | "allowJs": true, 8 | "module": "commonjs", 9 | "target": "es5", 10 | "paths": { 11 | "@formily/*": ["./packages/*/src"] 12 | } 13 | }, 14 | "exclude": ["./packages/*/esm", "./packages/*/lib"] 15 | } 16 | -------------------------------------------------------------------------------- /templates/vue/tsconfig.jest.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "preserve", 5 | "esModuleInterop": true, 6 | "moduleResolution": "node", 7 | "allowJs": true, 8 | "module": "commonjs", 9 | "target": "es5", 10 | "paths": { 11 | "@formily/*": ["./packages/*/src"] 12 | } 13 | }, 14 | "exclude": ["./packages/*/esm", "./packages/*/lib"] 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | .DS_Store 4 | .changelog 5 | .tea 6 | npm-debug.log 7 | lerna-debug.log 8 | npm-debug.log* 9 | package-lock.json 10 | lib/ 11 | esm/ 12 | temp_esm/ 13 | dist/ 14 | coverage/ 15 | node_modules/ 16 | examples/test 17 | .idea/ 18 | TODO.md 19 | tsconfig.tsbuildinfo 20 | package/ 21 | package.zip 22 | .umi 23 | .umi-production 24 | .cjsescache 25 | doc-site 26 | .lerna-changelog 27 | .history 28 | .lint-report.log -------------------------------------------------------------------------------- /templates/react/.gitignore.tpl: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | .DS_Store 4 | .changelog 5 | .tea 6 | npm-debug.log 7 | lerna-debug.log 8 | npm-debug.log* 9 | package-lock.json 10 | lib/ 11 | esm/ 12 | temp_esm/ 13 | dist/ 14 | build/ 15 | coverage/ 16 | node_modules/ 17 | examples/test 18 | .idea/ 19 | TODO.md 20 | tsconfig.tsbuildinfo 21 | package/ 22 | package.zip 23 | .umi 24 | .umi-production 25 | .cjsescache 26 | doc-site 27 | .lerna-changelog 28 | .history 29 | .lint-report.log -------------------------------------------------------------------------------- /templates/vue/.gitignore.tpl: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | .DS_Store 4 | .changelog 5 | .tea 6 | npm-debug.log 7 | lerna-debug.log 8 | npm-debug.log* 9 | package-lock.json 10 | lib/ 11 | esm/ 12 | temp_esm/ 13 | dist/ 14 | build/ 15 | coverage/ 16 | node_modules/ 17 | examples/test 18 | .idea/ 19 | TODO.md 20 | tsconfig.tsbuildinfo 21 | package/ 22 | package.zip 23 | .umi 24 | .umi-production 25 | .cjsescache 26 | doc-site 27 | .lerna-changelog 28 | .history 29 | .lint-report.log -------------------------------------------------------------------------------- /templates/vue/docs/guide/input.md: -------------------------------------------------------------------------------- 1 | # Input 2 | 3 | > 文本输入框 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/input](https://element.eleme.io/#/zh-CN/component/input) 20 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/switch.md: -------------------------------------------------------------------------------- 1 | # Switch 2 | 3 | > 开关组件 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/switch](https://element.eleme.io/#/zh-CN/component/switch) 20 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/array-tabs.md: -------------------------------------------------------------------------------- 1 | # ArrayTabs 2 | 3 | > 自增选项卡,对于纵向空间要求较高的场景可以考虑使用该组件 4 | > 5 | > 注意:该组件只适用于 Schema 场景 6 | 7 | ## Markup Schema 案例 8 | 9 | 10 | 11 | ## JSON Schema 案例 12 | 13 | 14 | 15 | ## API 16 | 17 | ### ArrayTabs 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/tab](https://element.eleme.io/#/zh-CN/component/tab) 20 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/space.md: -------------------------------------------------------------------------------- 1 | # Space 2 | 3 | > 超级便捷的 Flex 布局组件,可以帮助用户快速实现任何元素的并排紧挨布局 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://ant.design/components/space-cn/](https://ant.design/components/space-cn/) 20 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/password.md: -------------------------------------------------------------------------------- 1 | # Password 2 | 3 | > 密码输入框 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/input](https://element.eleme.io/#/zh-CN/component/input) 20 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/transfer.md: -------------------------------------------------------------------------------- 1 | # Transfer 2 | 3 | > 穿梭框 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/transfer](https://element.eleme.io/#/zh-CN/component/transfer) 20 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/cascader.md: -------------------------------------------------------------------------------- 1 | # Cascader 2 | 3 | > 级联选择器 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/cascader](https://element.eleme.io/#/zh-CN/component/cascader) 20 | -------------------------------------------------------------------------------- /templates/react/.github/workflows/check-pr-title.yml: -------------------------------------------------------------------------------- 1 | name: Check PR title 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | - reopened 7 | - edited 8 | - synchronize 9 | 10 | jobs: 11 | lint: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: aslafy-z/conventional-pr-title-action@master 15 | with: 16 | preset: conventional-changelog-angular@^5.0.6 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /templates/vue/.github/workflows/check-pr-title.yml: -------------------------------------------------------------------------------- 1 | name: Check PR title 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | - reopened 7 | - edited 8 | - synchronize 9 | 10 | jobs: 11 | lint: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: aslafy-z/conventional-pr-title-action@master 15 | with: 16 | preset: conventional-changelog-angular@^5.0.6 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/date-picker.md: -------------------------------------------------------------------------------- 1 | # DatePicker 2 | 3 | > 日期选择器 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/date-picker](https://element.eleme.io/#/zh-CN/component/date-picker) 20 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/time-picker.md: -------------------------------------------------------------------------------- 1 | # TimePicker 2 | 3 | > 时间选择器 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/time-picker](https://element.eleme.io/#/zh-CN/component/time-picker) 20 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/form-button-group.md: -------------------------------------------------------------------------------- 1 | # FormButtonGroup 2 | 3 | > 表单按钮组布局组件 4 | 5 | ## 使用案例 6 | 7 | 8 | 9 | ## API 10 | 11 | | 属性名 | 类型 | 描述 | 默认值 | 12 | | ------------- | ------- | ------------- | -------- | -------- | -------- | 13 | | gutter | number | 间隙大小 | 8px | 14 | | align | `'left' | 'center' | 'right'` | 对齐方式 | `'left'` | 15 | | alignFormItem | boolean | 对齐 FormItem | `false` | 16 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/input-number.md: -------------------------------------------------------------------------------- 1 | # InputNumber 2 | 3 | > 数字输入框 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/input-number](https://element.eleme.io/#/zh-CN/component/input-number) 20 | -------------------------------------------------------------------------------- /.vscode/cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1", 3 | "language": "en", 4 | "ignoreWords": [ 5 | "autorun", 6 | "mutators", 7 | "Formily", 8 | "formily", 9 | "untrack", 10 | "untracker", 11 | "untracked", 12 | "Untracking", 13 | "Unmount", 14 | "octokit", 15 | "repos", 16 | "alibaba", 17 | "Lifecycles", 18 | "antd", 19 | "Antd", 20 | "alifd", 21 | "Mixins", 22 | "builtins", 23 | "cascader", 24 | "Cascader", 25 | "execa", 26 | "middlewares" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/upload.md: -------------------------------------------------------------------------------- 1 | # Upload 2 | 3 | > 上传组件 4 | > 5 | > 注意:使用上传组件,推荐用户进行二次封装,用户无需关心上传组件与 Formily 的数据通信,只需要处理样式与基本上传配置即可。 6 | 7 | ## Markup Schema 案例 8 | 9 | 10 | 11 | ## JSON Schema 案例 12 | 13 | 14 | 15 | ## Template 案例 16 | 17 | 18 | 19 | ## API 20 | 21 | 参考 [https://element.eleme.io/#/zh-CN/component/upload](https://element.eleme.io/#/zh-CN/component/upload) 22 | -------------------------------------------------------------------------------- /templates/react/.vscode/cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1", 3 | "language": "en", 4 | "ignoreWords": [ 5 | "autorun", 6 | "mutators", 7 | "Formily", 8 | "formily", 9 | "untrack", 10 | "untracker", 11 | "untracked", 12 | "Untracking", 13 | "Unmount", 14 | "octokit", 15 | "repos", 16 | "alibaba", 17 | "Lifecycles", 18 | "<%= packageName %>", 19 | "<%= pascalName %>", 20 | "alifd", 21 | "Mixins", 22 | "builtins", 23 | "cascader", 24 | "Cascader", 25 | "middlewares" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /templates/vue/.vscode/cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1", 3 | "language": "en", 4 | "ignoreWords": [ 5 | "autorun", 6 | "mutators", 7 | "Formily", 8 | "formily", 9 | "untrack", 10 | "untracker", 11 | "untracked", 12 | "Untracking", 13 | "Unmount", 14 | "octokit", 15 | "repos", 16 | "alibaba", 17 | "Lifecycles", 18 | "<%= packageName %>", 19 | "<%= pascalName %>", 20 | "alifd", 21 | "Mixins", 22 | "builtins", 23 | "cascader", 24 | "Cascader", 25 | "middlewares" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /templates/react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "moduleResolution": "node", 5 | "jsx": "react", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "allowJs": false, 9 | "noUnusedLocals": false, 10 | "preserveConstEnums": true, 11 | "skipLibCheck": true, 12 | "sourceMap": true, 13 | "inlineSources": true, 14 | "declaration": true, 15 | "experimentalDecorators": true, 16 | "downlevelIteration": true, 17 | "baseUrl": ".", 18 | "paths": { 19 | "@formily/*": ["packages/*/src"] 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /templates/vue/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "moduleResolution": "node", 5 | "jsx": "preserve", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "allowJs": false, 9 | "noUnusedLocals": false, 10 | "preserveConstEnums": true, 11 | "skipLibCheck": true, 12 | "sourceMap": true, 13 | "inlineSources": true, 14 | "declaration": true, 15 | "experimentalDecorators": true, 16 | "downlevelIteration": true, 17 | "baseUrl": ".", 18 | "paths": { 19 | "@formily/*": ["packages/*/src"] 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /templates/react/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Create new issue 4 | url: https://formilyjs.org/guide/issue-helper 5 | about: The issue which is not created via https://formilyjs.org/guide/issue-helper will be closed immediately. 6 | - name: ✨ Question Answer / Idea 7 | url: https://github.com/alibaba/formily/discussions/new 8 | about: All questions can be solved here. At the same time you can provide all your ideas here. 9 | - name: 📖 View documentation 10 | url: https://formilyjs.org 11 | about: Official Formily documentation 12 | -------------------------------------------------------------------------------- /templates/vue/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Create new issue 4 | url: https://formilyjs.org/guide/issue-helper 5 | about: The issue which is not created via https://formilyjs.org/guide/issue-helper will be closed immediately. 6 | - name: ✨ Question Answer / Idea 7 | url: https://github.com/alibaba/formily/discussions/new 8 | about: All questions can be solved here. At the same time you can provide all your ideas here. 9 | - name: 📖 View documentation 10 | url: https://formilyjs.org 11 | about: Official Formily documentation 12 | -------------------------------------------------------------------------------- /templates/vue/docs/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | heroText: Formily <%= pascalName %> 4 | tagline: 基于 <%= brandName %> 封装的Formily2.x组件体系 5 | actionText: 开发指南 6 | actionLink: /guide/ 7 | features: 8 | - title: 更易用 9 | details: 开箱即用,案例丰富 10 | - title: 更高效 11 | details: 傻瓜写法,超高性能 12 | - title: 更专业 13 | details: 完备,灵活,优雅 14 | footer: Open-source MIT Licensed | Copyright © 2019-present 15 | --- 16 | 17 | ## 安装 18 | 19 | vue2: 20 | 21 | ```bash 22 | $ npm install --save <%= packageName %> 23 | $ npm install --save @formily/core @formily/vue @vue/composition-api @formily/<%= repoName %> 24 | ``` 25 | 26 | ## 快速开始 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/constants.ts: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fs from 'fs-extra' 3 | import { glob } from 'glob' 4 | import { IBuilderConfig } from './types' 5 | import { getConfigs } from './shared' 6 | 7 | export const cwd = process.cwd() 8 | 9 | export const entry = path.resolve(cwd, 'src/index.ts') 10 | 11 | const configs = getConfigs('builder.config') 12 | 13 | export const builderConfigs: IBuilderConfig = 14 | configs?.BuilderConfig ?? configs ?? {} 15 | 16 | export const templates = glob.sync(path.resolve(__dirname, '../templates/*')) 17 | 18 | let pkg: any = {} 19 | 20 | try { 21 | pkg = fs.readJSONSync(path.resolve(cwd, 'package.json')) 22 | } catch { 23 | pkg = {} 24 | } 25 | 26 | export { pkg } 27 | -------------------------------------------------------------------------------- /templates/react/global.config.ts: -------------------------------------------------------------------------------- 1 | import prettyFormat from 'pretty-format' 2 | 3 | global['prettyFormat'] = prettyFormat 4 | 5 | global['sleep'] = (time) => { 6 | return new Promise((resolve) => setTimeout(resolve, time)) 7 | } 8 | 9 | global['requestAnimationFrame'] = (fn) => setTimeout(fn) 10 | 11 | global.document.documentElement.style['grid-column-gap'] = true 12 | 13 | // 把 console.error 转换成 error,方便断言 14 | ;(() => { 15 | const spy = jest.spyOn(console, 'error') 16 | beforeAll(() => { 17 | spy.mockImplementation((message) => { 18 | console.log(message) 19 | throw new Error(message) 20 | }) 21 | }) 22 | 23 | afterAll(() => { 24 | spy.mockRestore() 25 | }) 26 | })() 27 | -------------------------------------------------------------------------------- /templates/vue/global.config.ts: -------------------------------------------------------------------------------- 1 | import prettyFormat from 'pretty-format' 2 | 3 | global['prettyFormat'] = prettyFormat 4 | 5 | global['sleep'] = (time) => { 6 | return new Promise((resolve) => setTimeout(resolve, time)) 7 | } 8 | 9 | global['requestAnimationFrame'] = (fn) => setTimeout(fn) 10 | 11 | global.document.documentElement.style['grid-column-gap'] = true 12 | 13 | // 把 console.error 转换成 error,方便断言 14 | ;(() => { 15 | const spy = jest.spyOn(console, 'error') 16 | beforeAll(() => { 17 | spy.mockImplementation((message) => { 18 | console.log(message) 19 | throw new Error(message) 20 | }) 21 | }) 22 | 23 | afterAll(() => { 24 | spy.mockRestore() 25 | }) 26 | })() 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # @formily/template 2 | 3 | > Formily 桥接组件库生态脚手架 4 | 5 | ## 安装 6 | 7 | ```bash 8 | npm install -g ts-node @formily/template 9 | ``` 10 | 11 | ## 初始化 12 | 13 | 先 cd 到你需要初始化的项目目录,执行以下命令 14 | 15 | ```bash 16 | npx formily-tpl init 17 | ``` 18 | 19 | ## 构建 20 | 21 | ```bash 22 | formily-tpl build 23 | ``` 24 | 25 | ## 构建配置 26 | 27 | 在包根路径上创建,builder.config.ts 文件 28 | 29 | ```ts 30 | import { IBuilderConfig } from '@formily/template' 31 | 32 | export const BuilderConfig: IBuilderConfig = { 33 | externals: {}, 34 | //当前仓库核心依赖的三方组件库名称 35 | targetLibName: 'antd', 36 | //核心三方库cjs目录名 37 | targetLibCjsDir: 'lib', 38 | //核心三方库es目录名 39 | targetLibEsDir: 'es', 40 | //是否打包全量类型文件 41 | bundleDts: false, 42 | } 43 | ``` 44 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "moduleResolution": "node", 5 | "jsx": "react", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "allowJs": false, 9 | "noUnusedLocals": false, 10 | "preserveConstEnums": true, 11 | "skipLibCheck": true, 12 | "sourceMap": true, 13 | "inlineSources": true, 14 | "declaration": true, 15 | "experimentalDecorators": true, 16 | "downlevelIteration": true, 17 | "baseUrl": "src", 18 | "outDir": "./lib", 19 | "paths": { 20 | "@formily/*": ["packages/*", "devtools/*"] 21 | } 22 | }, 23 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 24 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 25 | } 26 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/editable.md: -------------------------------------------------------------------------------- 1 | # Editable 2 | 3 | > 局部编辑器,对于一些空间要求较高的表单区域可以使用该组件 4 | > 5 | > Editable 组件相当于是 FormItem 组件的变体,所以通常放在 decorator 中 6 | 7 | ## Markup Schema 案例 8 | 9 | 10 | 11 | ## JSON Schema 案例 12 | 13 | 14 | 15 | ## Template 案例 16 | 17 | 18 | 19 | ## API 20 | 21 | ### Editable 22 | 23 | > 内联编辑 24 | 25 | 参考 [https://element.formilyjs.org/guide/form-item.html#api](https://element.formilyjs.org/guide/form-item.html#api) 26 | 27 | ### Editable.Popover 28 | 29 | > 浮层编辑 30 | 31 | 参考 [https://element.eleme.io/#/zh-CN/component/popover](https://element.eleme.io/#/zh-CN/component/popover) 32 | -------------------------------------------------------------------------------- /templates/vue/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: formily # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /templates/react/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: formily # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /templates/vue/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | _Before_ submitting a pull request, please make sure the following is done... 2 | 3 | - [ ] Ensure the pull request title and commit message follow the [Commit Specific](https://github.com/alibaba/formily/blob/master/.github/GIT_COMMIT_SPECIFIC.md) in **English**. 4 | - [ ] Fork the repo and create your branch from `master` or `master`. 5 | - [ ] If you've added code that should be tested, add tests! 6 | - [ ] If you've changed APIs, update the documentation. 7 | - [ ] Ensure the test suite passes (`npm test`). 8 | - [ ] Make sure your code lints (`npm run lint`) - we've done our best to make sure these rules match our internal linting guidelines. 9 | 10 | **Please do not delete the above content** 11 | 12 | --- 13 | 14 | ## What have you changed? 15 | -------------------------------------------------------------------------------- /templates/react/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | _Before_ submitting a pull request, please make sure the following is done... 2 | 3 | - [ ] Ensure the pull request title and commit message follow the [Commit Specific](https://github.com/alibaba/formily/blob/master/.github/GIT_COMMIT_SPECIFIC.md) in **English**. 4 | - [ ] Fork the repo and create your branch from `master` or `master`. 5 | - [ ] If you've added code that should be tested, add tests! 6 | - [ ] If you've changed APIs, update the documentation. 7 | - [ ] Ensure the test suite passes (`npm test`). 8 | - [ ] Make sure your code lints (`npm run lint`) - we've done our best to make sure these rules match our internal linting guidelines. 9 | 10 | **Please do not delete the above content** 11 | 12 | --- 13 | 14 | ## What have you changed? 15 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-item/template.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 37 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/switch/template.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 36 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/password/template.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 36 | -------------------------------------------------------------------------------- /src/build/copy-style-files.ts: -------------------------------------------------------------------------------- 1 | import glob from 'glob' 2 | import path from 'path' 3 | import fs from 'fs-extra' 4 | import { cwd } from '../constants' 5 | 6 | export const copyStyleFiles = () => { 7 | return new Promise((resolve, reject) => { 8 | glob('src/**/*.{less,scss,sass,css}', { cwd }, async (err, files) => { 9 | if (err) return reject(err) 10 | files.forEach((filename) => { 11 | const filepath = path.resolve(cwd, filename) 12 | const distPathEs = filepath 13 | .replace(/src\//, 'esm/') 14 | .replace(/src\\/, 'esm\\') 15 | const distPathLib = filepath 16 | .replace(/src\//, 'lib/') 17 | .replace(/src\\/, 'lib\\') 18 | fs.copySync(filepath, distPathEs) 19 | fs.copySync(filepath, distPathLib) 20 | }) 21 | resolve(0) 22 | }) 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true 4 | }, 5 | "extends": [ 6 | "plugin:@typescript-eslint/recommended", 7 | "prettier/@typescript-eslint" 8 | ], 9 | "globals": { 10 | "sleep": true, 11 | "prettyFormat": true 12 | }, 13 | "parserOptions": { 14 | "ecmaVersion": 10, 15 | "sourceType": "module", 16 | "ecmaFeatures": { 17 | "jsx": true 18 | } 19 | }, 20 | "parser": "@typescript-eslint/parser", 21 | "plugins": ["@typescript-eslint", "prettier"], 22 | "rules": { 23 | "@typescript-eslint/explicit-module-boundary-types": "off", 24 | "@typescript-eslint/no-var-requires": "off", 25 | "@typescript-eslint/no-explicit-any": "off", 26 | "@typescript-eslint/no-unused-vars": "error", 27 | "@typescript-eslint/ban-ts-comment": "off", 28 | "@typescript-eslint/no-empty-function": "off" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/build/build-root-style.ts: -------------------------------------------------------------------------------- 1 | import glob from 'glob' 2 | import path from 'path' 3 | import fs from 'fs-extra' 4 | import { cwd } from '../constants' 5 | 6 | const createStyleFile = (files: string[]) => { 7 | return `// auto generated code 8 | ${files 9 | .map((path) => { 10 | return `import '${path}'\n` 11 | }) 12 | .join('')}` 13 | } 14 | 15 | export const buildRootStyle = () => { 16 | return new Promise((resolve, reject) => { 17 | glob( 18 | './**/*/style.{less,scss,sass}', 19 | { cwd: path.resolve(cwd, './src') }, 20 | async (err, files) => { 21 | if (err) return reject(err) 22 | if (files.length === 0) return resolve(0) 23 | await fs.writeFile( 24 | path.resolve(cwd, './src/style.ts'), 25 | createStyleFile(files), 26 | 'utf8' 27 | ) 28 | resolve(0) 29 | } 30 | ) 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /src/build/build-library.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs-extra' 2 | import path from 'path' 3 | import execa from 'execa' 4 | import { cwd } from '../constants' 5 | 6 | const hasBuildConfig = async () => { 7 | try { 8 | await fs.access(path.resolve(cwd, 'tsconfig.build.json')) 9 | return true 10 | } catch { 11 | return false 12 | } 13 | } 14 | 15 | const buildDefault = async (params: string[] = []) => { 16 | const hasProjects = await hasBuildConfig() 17 | if (hasProjects) { 18 | params.push('--project', 'tsconfig.build.json', '--sourceRoot', 'lib') 19 | } 20 | execa('tsc', params).stdout.pipe(process.stdout) 21 | } 22 | 23 | const buildEsm = async () => { 24 | await buildDefault([ 25 | '--module', 26 | 'es2015', 27 | '--outDir', 28 | 'esm', 29 | '--sourceRoot', 30 | 'esm', 31 | ]) 32 | } 33 | 34 | export const buildLibrary = async () => { 35 | await buildDefault() 36 | await buildEsm() 37 | } 38 | -------------------------------------------------------------------------------- /templates/react/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | module.exports = { 3 | collectCoverage: true, 4 | verbose: true, 5 | testEnvironment: 'jsdom', 6 | preset: 'ts-jest', 7 | testMatch: ['**/__tests__/**/*.spec.[jt]s?(x)'], 8 | setupFilesAfterEnv: [ 9 | require.resolve('jest-dom/extend-expect'), 10 | './global.config.ts', 11 | ], 12 | // moduleNameMapper: process.env.TEST_ENV === 'production' ? undefined : alias, 13 | globals: { 14 | 'ts-jest': { 15 | babelConfig: false, 16 | tsconfig: './tsconfig.jest.json', 17 | diagnostics: false, 18 | }, 19 | }, 20 | coveragePathIgnorePatterns: [ 21 | '/node_modules/', 22 | '/__tests__/', 23 | '/esm/', 24 | '/lib/', 25 | 'package.json', 26 | '/demo/', 27 | '/packages/builder/src/__tests__/', 28 | '/packages/builder/src/components/', 29 | '/packages/builder/src/configs/', 30 | 'package-lock.json', 31 | ], 32 | } 33 | -------------------------------------------------------------------------------- /templates/vue/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | module.exports = { 3 | collectCoverage: true, 4 | verbose: true, 5 | testEnvironment: 'jsdom', 6 | preset: 'ts-jest', 7 | testMatch: ['**/__tests__/**/*.spec.[jt]s?(x)'], 8 | setupFilesAfterEnv: [ 9 | require.resolve('jest-dom/extend-expect'), 10 | './global.config.ts', 11 | ], 12 | // moduleNameMapper: process.env.TEST_ENV === 'production' ? undefined : alias, 13 | globals: { 14 | 'ts-jest': { 15 | babelConfig: false, 16 | tsconfig: './tsconfig.jest.json', 17 | diagnostics: false, 18 | }, 19 | }, 20 | coveragePathIgnorePatterns: [ 21 | '/node_modules/', 22 | '/__tests__/', 23 | '/esm/', 24 | '/lib/', 25 | 'package.json', 26 | '/demo/', 27 | '/packages/builder/src/__tests__/', 28 | '/packages/builder/src/components/', 29 | '/packages/builder/src/configs/', 30 | 'package-lock.json', 31 | ], 32 | } 33 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/radio.md: -------------------------------------------------------------------------------- 1 | # Radio 2 | 3 | > 单选框 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/radio](https://element.eleme.io/#/zh-CN/component/radio) 20 | 21 | ### 扩展属性 22 | 23 | | 属性名 | 类型 | 描述 | 默认值 | 24 | | ---------- | --------------------------------------------------------------------------------- | -------- | ------- | 25 | | options | [RadioProps](https://element.eleme.io/#/zh-CN/component/radio#radio-attributes)[] | 选项 | [] | 26 | | optionType | default/button | 样式类型 | default | 27 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/input/template.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 42 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/input-number/template.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 43 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-item/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 43 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/switch/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 42 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/password/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 42 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/checkbox.md: -------------------------------------------------------------------------------- 1 | # Checkbox 2 | 3 | > 复选框 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/checkbox](https://element.eleme.io/#/zh-CN/component/checkbox) 20 | 21 | ### 扩展属性 22 | 23 | | 属性名 | 类型 | 描述 | 默认值 | 24 | | ---------- | ------------------------------------------------------------------------------------------ | -------- | ------- | 25 | | options | [CheckboxProps](https://element.eleme.io/#/zh-CN/component/checkbox#checkbox-attributes)[] | 选项 | [] | 26 | | optionType | default/button | 样式类型 | default | 27 | -------------------------------------------------------------------------------- /templates/react/global.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | var __importDefault = 3 | (this && this.__importDefault) || 4 | function (mod) { 5 | return mod && mod.__esModule ? mod : { default: mod } 6 | } 7 | Object.defineProperty(exports, '__esModule', { value: true }) 8 | var pretty_format_1 = __importDefault(require('pretty-format')) 9 | global['prettyFormat'] = pretty_format_1.default 10 | global['sleep'] = function (time) { 11 | return new Promise(function (resolve) { 12 | return setTimeout(resolve, time) 13 | }) 14 | } 15 | global['requestAnimationFrame'] = function (fn) { 16 | return setTimeout(fn) 17 | } 18 | global.document.documentElement.style['grid-column-gap'] = true 19 | ;(function () { 20 | var spy = jest.spyOn(console, 'error') 21 | beforeAll(function () { 22 | spy.mockImplementation(function (message) { 23 | console.log(message) 24 | throw new Error(message) 25 | }) 26 | }) 27 | afterAll(function () { 28 | spy.mockRestore() 29 | }) 30 | })() 31 | //# sourceMappingURL=global.config.js.map 32 | -------------------------------------------------------------------------------- /templates/vue/global.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | var __importDefault = 3 | (this && this.__importDefault) || 4 | function (mod) { 5 | return mod && mod.__esModule ? mod : { default: mod } 6 | } 7 | Object.defineProperty(exports, '__esModule', { value: true }) 8 | var pretty_format_1 = __importDefault(require('pretty-format')) 9 | global['prettyFormat'] = pretty_format_1.default 10 | global['sleep'] = function (time) { 11 | return new Promise(function (resolve) { 12 | return setTimeout(resolve, time) 13 | }) 14 | } 15 | global['requestAnimationFrame'] = function (fn) { 16 | return setTimeout(fn) 17 | } 18 | global.document.documentElement.style['grid-column-gap'] = true 19 | ;(function () { 20 | var spy = jest.spyOn(console, 'error') 21 | beforeAll(function () { 22 | spy.mockImplementation(function (message) { 23 | console.log(message) 24 | throw new Error(message) 25 | }) 26 | }) 27 | afterAll(function () { 28 | spy.mockRestore() 29 | }) 30 | })() 31 | //# sourceMappingURL=global.config.js.map 32 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/radio/template.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 46 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/transfer/template.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 46 | -------------------------------------------------------------------------------- /templates/react/.github/workflows/commitlint.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: Check Commit spec 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [master] 10 | pull_request: 11 | branches: [master] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | commitlint: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v2 27 | with: 28 | fetch-depth: 0= 29 | - uses: wagoid/commitlint-github-action@v3 30 | -------------------------------------------------------------------------------- /templates/vue/.github/workflows/commitlint.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: Check Commit spec 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [master] 10 | pull_request: 11 | branches: [master] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | commitlint: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v2 27 | with: 28 | fetch-depth: 0= 29 | - uses: wagoid/commitlint-github-action@v3 30 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-item/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 48 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/switch/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 48 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/password/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 48 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/form-tab.md: -------------------------------------------------------------------------------- 1 | # FormTab 2 | 3 | > 选项卡表单 4 | > 5 | > 注意:该组件只适用于 Schema 场景 6 | 7 | ## Markup Schema 案例 8 | 9 | 10 | 11 | ## JSON Schema 案例 12 | 13 | 14 | 15 | ## API 16 | 17 | ### FormTab 18 | 19 | | 属性名 | 类型 | 描述 | 默认值 | 20 | | ------- | -------- | ------------------------------------- | ------ | 21 | | formTab | IFormTab | 传入通过 createFormTab 创建出来的模型 | | 22 | 23 | 其余参考 [https://element.eleme.io/#/zh-CN/component/tabs](https://element.eleme.io/#/zh-CN/component/tabs) 24 | 25 | ### FormTab.TabPane 26 | 27 | 参考 [https://element.eleme.io/#/zh-CN/component/tabs](https://element.eleme.io/#/zh-CN/component/tabs) 28 | 29 | ### FormTab.createFormTab 30 | 31 | ```ts pure 32 | type ActiveKey = string | number 33 | 34 | interface createFormTab { 35 | (defaultActiveKey?: ActiveKey): IFormTab 36 | } 37 | 38 | interface IFormTab { 39 | //激活主键 40 | activeKey: ActiveKey 41 | //设置激活主键 42 | setActiveKey(key: ActiveKey): void 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/input-number/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 47 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-layout/template.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 46 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/input/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 48 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/select/template-sync.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 53 | -------------------------------------------------------------------------------- /templates/vue/.github/workflows/issue-open-check.yml: -------------------------------------------------------------------------------- 1 | name: Issue Open Check 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | jobs: 8 | check-issue: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions-cool/check-user-permission@v1.0.0 12 | id: checkUser 13 | with: 14 | require: 'write' 15 | 16 | - name: check invalid 17 | if: (contains(github.event.issue.body, 'formily-issue-helper') == false) && (steps.checkUser.outputs.result == 'false') 18 | uses: actions-cool/issues-helper@v1.2 19 | with: 20 | actions: 'create-comment,add-labels,close-issue' 21 | issue-number: ${{ github.event.issue.number }} 22 | labels: 'Invalid' 23 | body: | 24 | Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](https://formilyjs.org/guide/issue-helper) to create an issue, thank you! 25 | 你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](https://formilyjs.org/guide/issue-helper) 来创建 issue 以方便我们定位错误。谢谢配合! 26 | -------------------------------------------------------------------------------- /templates/react/.github/workflows/issue-open-check.yml: -------------------------------------------------------------------------------- 1 | name: Issue Open Check 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | jobs: 8 | check-issue: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions-cool/check-user-permission@v1.0.0 12 | id: checkUser 13 | with: 14 | require: 'write' 15 | 16 | - name: check invalid 17 | if: (contains(github.event.issue.body, 'formily-issue-helper') == false) && (steps.checkUser.outputs.result == 'false') 18 | uses: actions-cool/issues-helper@v1.2 19 | with: 20 | actions: 'create-comment,add-labels,close-issue' 21 | issue-number: ${{ github.event.issue.number }} 22 | labels: 'Invalid' 23 | body: | 24 | Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](https://formilyjs.org/guide/issue-helper) to create an issue, thank you! 25 | 你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](https://formilyjs.org/guide/issue-helper) 来创建 issue 以方便我们定位错误。谢谢配合! 26 | -------------------------------------------------------------------------------- /templates/react/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-present, <%= userName %> Holding Limited. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /templates/vue/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-present, <%= userName %> Holding Limited. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/radio/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 52 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/transfer/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 52 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/transfer/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 52 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/input/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 54 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/input-number/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 53 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/checkbox/template.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 50 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/checkbox/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 52 | l 53 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/form-step.md: -------------------------------------------------------------------------------- 1 | # FormStep 2 | 3 | > 分步表单组件 4 | > 5 | > 注意:该组件只能用在 Schema 场景 6 | 7 | ## Markup Schema 案例 8 | 9 | 10 | 11 | ## JSON Schema 案例 12 | 13 | 14 | 15 | ## API 16 | 17 | ### FormStep 18 | 19 | | 属性名 | 类型 | 描述 | 默认值 | 20 | | -------- | --------- | -------------------------------------- | ------ | 21 | | formStep | IFormStep | 传入通过 createFormStep 创建出来的模型 | | 22 | 23 | 其余参考 [https://element.eleme.io/#/zh-CN/component/steps](https://element.eleme.io/#/zh-CN/component/steps) 24 | 25 | ### FormStep.StepPane 26 | 27 | 参考 [https://element.eleme.io/#/zh-CN/component/steps](https://element.eleme.io/#/zh-CN/component/steps) 28 | 29 | ### FormStep.createFormStep 30 | 31 | ```ts pure 32 | interface createFormStep { 33 | (current?: number): IFormStep 34 | } 35 | 36 | interface IFormStep { 37 | //当前索引 38 | current: number 39 | //是否允许向后 40 | allowNext: boolean 41 | //是否允许向前 42 | allowBack: boolean 43 | //设置当前索引 44 | setCurrent(key: number): void 45 | //提交表单 46 | submit: Formily.Core.Models.Form['submit'] 47 | //向后 48 | next(): void 49 | //向前 50 | back(): void 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/select.md: -------------------------------------------------------------------------------- 1 | # Select 2 | 3 | > 下拉框组件 4 | 5 | ## Markup Schema 同步数据源案例 6 | 7 | 8 | 9 | ## Markup Schema 异步搜索案例 10 | 11 | 12 | 13 | ## Markup Schema 异步联动数据源案例 14 | 15 | 16 | 17 | ## JSON Schema 同步数据源案例 18 | 19 | 20 | 21 | ## JSON Schema 异步联动数据源案例 22 | 23 | 24 | 25 | ## Template 同步数据源案例 26 | 27 | 28 | 29 | ## Template 异步联动数据源案例 30 | 31 | 32 | 33 | ## API 34 | 35 | 参考 [https://element.eleme.io/#/zh-CN/component/select](https://element.eleme.io/#/zh-CN/component/select) 36 | 37 | ### 扩展属性 38 | 39 | | 属性名 | 类型 | 描述 | 默认值 | 40 | | ------- | ------------------------------------------------------------------------------------------ | ---- | ------ | 41 | | options | [SelectOptionProps](https://element.eleme.io/#/zh-CN/component/select#option-attributes)[] | 选项 | [] | 42 | -------------------------------------------------------------------------------- /templates/react/packages/components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "react": ">=16.8.0 || >=17.0.0", 40 | "react-dom": ">=16.8.0", 41 | "react-is": ">=16.8.0 || >=17.0.0" 42 | }, 43 | "dependencies": {}, 44 | "devDependencies": {} 45 | } 46 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/time-picker/template.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 58 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/reset/base.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 60 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/reset/force.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 60 | -------------------------------------------------------------------------------- /templates/react/packages/setters/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>-setters", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>-setters.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>-setters.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>-setters.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "react": ">=16.8.0 || >=17.0.0", 40 | "react-dom": ">=16.8.0", 41 | "react-is": ">=16.8.0 || >=17.0.0" 42 | }, 43 | "dependencies": {}, 44 | "devDependencies": {} 45 | } 46 | -------------------------------------------------------------------------------- /templates/vue/.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Node CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | build: 13 | runs-on: ${{ matrix.os }} 14 | if: contains(github.event.head_commit.message, 'chore(versions)') == false 15 | strategy: 16 | matrix: 17 | node_version: [10.x, 11.x] 18 | os: [ubuntu-latest] 19 | steps: 20 | - uses: actions/checkout@v1 21 | - name: Use Node.js ${{ matrix.node_version }} 22 | uses: actions/setup-node@v1 23 | with: 24 | node-version: ${{ matrix.node_version }} 25 | 26 | - run: yarn -v 27 | - run: yarn --ignore-engines 28 | - name: ESlint 29 | uses: reviewdog/action-eslint@v1 30 | with: 31 | reporter: github-check 32 | eslint_flags: '.' 33 | - run: yarn build 34 | - run: yarn test:prod 35 | env: 36 | CI: true 37 | HEADLESS: false 38 | PROGRESS: none 39 | NODE_ENV: test 40 | NODE_OPTIONS: --max_old_space_size=4096 41 | 42 | - name: Upload coverage to Codecov 43 | uses: codecov/codecov-action@v1 44 | with: 45 | token: ${{ secrets.CODECOV_TOKEN }} 46 | fail_ci_if_error: true 47 | verbose: true 48 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/select/markup-schema-sync.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 57 | -------------------------------------------------------------------------------- /templates/react/.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Node CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | build: 13 | runs-on: ${{ matrix.os }} 14 | if: contains(github.event.head_commit.message, 'chore(versions)') == false 15 | strategy: 16 | matrix: 17 | node_version: [10.x, 11.x] 18 | os: [ubuntu-latest] 19 | steps: 20 | - uses: actions/checkout@v1 21 | - name: Use Node.js ${{ matrix.node_version }} 22 | uses: actions/setup-node@v1 23 | with: 24 | node-version: ${{ matrix.node_version }} 25 | 26 | - run: yarn -v 27 | - run: yarn --ignore-engines 28 | - name: ESlint 29 | uses: reviewdog/action-eslint@v1 30 | with: 31 | reporter: github-check 32 | eslint_flags: '.' 33 | - run: yarn build 34 | - run: yarn test:prod 35 | env: 36 | CI: true 37 | HEADLESS: false 38 | PROGRESS: none 39 | NODE_ENV: test 40 | NODE_OPTIONS: --max_old_space_size=4096 41 | 42 | - name: Upload coverage to Codecov 43 | uses: codecov/codecov-action@v1 44 | with: 45 | token: ${{ secrets.CODECOV_TOKEN }} 46 | fail_ci_if_error: true 47 | verbose: true 48 | -------------------------------------------------------------------------------- /templates/react/packages/renderer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>-renderer", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>-renderer.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>-renderer.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>-renderer.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "react": ">=16.8.0 || >=17.0.0", 40 | "react-dom": ">=16.8.0", 41 | "react-is": ">=16.8.0 || >=17.0.0" 42 | }, 43 | "dependencies": {}, 44 | "devDependencies": {} 45 | } 46 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/reset/validate.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 60 | -------------------------------------------------------------------------------- /templates/react/packages/prototypes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>-prototypes", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>-prototypes.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>-prototypes.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>-prototypes.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "react": ">=16.8.0 || >=17.0.0", 40 | "react-dom": ">=16.8.0", 41 | "react-is": ">=16.8.0 || >=17.0.0" 42 | }, 43 | "dependencies": {}, 44 | "devDependencies": {} 45 | } 46 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/submit/base.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 59 | -------------------------------------------------------------------------------- /templates/react/packages/settings-form/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>-settings-form", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>-settings-form.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>-settings-form.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>-settings-form.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "react": ">=16.8.0 || >=17.0.0", 40 | "react-dom": ">=16.8.0", 41 | "react-is": ">=16.8.0 || >=17.0.0" 42 | }, 43 | "dependencies": {}, 44 | "devDependencies": {} 45 | } 46 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/select/json-schema-sync.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 61 | -------------------------------------------------------------------------------- /templates/vue/packages/components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "@vue/composition-api": "^1.0.0-beta.1", 40 | "vue": "^2.6.0 || >=3.0.0-rc.0" 41 | }, 42 | "peerDependenciesMeta": { 43 | "@vue/composition-api": { 44 | "optional": true 45 | } 46 | }, 47 | "dependencies": {}, 48 | "devDependencies": {} 49 | } 50 | -------------------------------------------------------------------------------- /templates/vue/.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | jobs: 8 | release: 9 | runs-on: ubuntu-latest 10 | if: contains(github.event.head_commit.message, 'chore(release)') 11 | steps: 12 | - uses: actions/checkout@v1 13 | with: 14 | ref: master 15 | fetch-depth: 0 16 | - uses: actions/setup-node@v1 17 | with: 18 | node-version: 12 19 | registry-url: https://registry.npmjs.org/ 20 | - run: | 21 | yarn -v 22 | yarn --ignore-engines 23 | yarn build 24 | yarn test:prod 25 | env: 26 | NODE_OPTIONS: --max_old_space_size=4096 27 | REGISTRY: https://registry.npmjs.org 28 | - uses: janrywang/github-tag-release@main 29 | with: 30 | github_token: ${{ secrets.GITHUB_TOKEN }} 31 | - run: yarn run release 32 | env: 33 | NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} 34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 35 | ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }} 36 | ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }} 37 | - name: Upload coverage to Codecov 38 | uses: codecov/codecov-action@v1 39 | with: 40 | token: ${{ secrets.CODECOV_TOKEN }} 41 | fail_ci_if_error: true 42 | verbose: true 43 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/reset.md: -------------------------------------------------------------------------------- 1 | # Reset 2 | 3 | > 重置按钮 4 | 5 | ## 普通重置 6 | 7 | > 有默认值的控件无法清空 8 | 9 | 10 | 11 | ## 强制清空重置 12 | 13 | 14 | 15 | ## 强制清空重置并校验 16 | 17 | 18 | 19 | ## API 20 | 21 | 按钮相关的 API 属性,我们参考 [https://element.eleme.io/#/zh-CN/component/button](https://element.eleme.io/#/zh-CN/component/button) 即可,剩下是 Reset 组件独有的 API 属性 22 | 23 | ### 事件 24 | 25 | | 属性名 | 类型 | 描述 | 默认值 | 26 | | ---------------------- | ------------------------------------------------------------------------------------------------ | ---------------- | ------------------------------------- | --- | 27 | | onClick | `(event: MouseEvent) => void | boolean` | 点击事件,如果返回 false 可以阻塞重置 | - | 28 | | onResetValidateSuccess | (payload: any) => void | 重置校验成功事件 | - | 29 | | onResetValidateFailed | (feedbacks: [IFormFeedback](https://core.formilyjs.org/api/models/form#iformfeedback)[]) => void | 重置校验失败事件 | - | 30 | -------------------------------------------------------------------------------- /templates/react/.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | jobs: 8 | release: 9 | runs-on: ubuntu-latest 10 | if: contains(github.event.head_commit.message, 'chore(release)') 11 | steps: 12 | - uses: actions/checkout@v1 13 | with: 14 | ref: master 15 | fetch-depth: 0 16 | - uses: actions/setup-node@v1 17 | with: 18 | node-version: 12 19 | registry-url: https://registry.npmjs.org/ 20 | - run: | 21 | yarn -v 22 | yarn --ignore-engines 23 | yarn build 24 | yarn test:prod 25 | env: 26 | NODE_OPTIONS: --max_old_space_size=4096 27 | REGISTRY: https://registry.npmjs.org 28 | - uses: janrywang/github-tag-release@main 29 | with: 30 | github_token: ${{ secrets.GITHUB_TOKEN }} 31 | - run: yarn run release 32 | env: 33 | NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} 34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 35 | ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }} 36 | ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }} 37 | - name: Upload coverage to Codecov 38 | uses: codecov/codecov-action@v1 39 | with: 40 | token: ${{ secrets.CODECOV_TOKEN }} 41 | fail_ci_if_error: true 42 | verbose: true 43 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-layout/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 52 | -------------------------------------------------------------------------------- /templates/vue/global.config.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"global.config.js","sourceRoot":"","sources":["global.config.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAM,CAAC,cAAc,CAAC,GAAG,uBAAY,CAAA;AAErC,MAAM,CAAC,OAAO,CAAC,GAAG,UAAC,IAAI;IACrB,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,IAAK,OAAA,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAzB,CAAyB,CAAC,CAAA;AAC5D,CAAC,CAAA;AAED,MAAM,CAAC,uBAAuB,CAAC,GAAG,UAAC,EAAE,IAAK,OAAA,UAAU,CAAC,EAAE,CAAC,EAAd,CAAc,CAAA;AAExD,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAG9D;AAAA,CAAC;IACA,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACxC,SAAS,CAAC;QACR,GAAG,CAAC,kBAAkB,CAAC,UAAC,OAAO;YAC7B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACpB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC;QACP,GAAG,CAAC,WAAW,EAAE,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,EAAE,CAAA","sourcesContent":["import prettyFormat from 'pretty-format'\n\nglobal['prettyFormat'] = prettyFormat\n\nglobal['sleep'] = (time) => {\n return new Promise((resolve) => setTimeout(resolve, time))\n}\n\nglobal['requestAnimationFrame'] = (fn) => setTimeout(fn)\n\nglobal.document.documentElement.style['grid-column-gap'] = true\n\n// 把 console.error 转换成 error,方便断言\n;(() => {\n const spy = jest.spyOn(console, 'error')\n beforeAll(() => {\n spy.mockImplementation((message) => {\n console.log(message)\n throw new Error(message)\n })\n })\n\n afterAll(() => {\n spy.mockRestore()\n })\n})()\n"]} -------------------------------------------------------------------------------- /templates/vue/packages/setters/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>-setters", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>-setters.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>-setters.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>-setters.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "@vue/composition-api": "^1.0.0-beta.1", 40 | "vue": "^2.6.0 || >=3.0.0-rc.0" 41 | }, 42 | "peerDependenciesMeta": { 43 | "@vue/composition-api": { 44 | "optional": true 45 | } 46 | }, 47 | "dependencies": {}, 48 | "devDependencies": {} 49 | } 50 | -------------------------------------------------------------------------------- /templates/react/global.config.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"global.config.js","sourceRoot":"","sources":["global.config.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAM,CAAC,cAAc,CAAC,GAAG,uBAAY,CAAA;AAErC,MAAM,CAAC,OAAO,CAAC,GAAG,UAAC,IAAI;IACrB,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,IAAK,OAAA,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAzB,CAAyB,CAAC,CAAA;AAC5D,CAAC,CAAA;AAED,MAAM,CAAC,uBAAuB,CAAC,GAAG,UAAC,EAAE,IAAK,OAAA,UAAU,CAAC,EAAE,CAAC,EAAd,CAAc,CAAA;AAExD,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAG9D;AAAA,CAAC;IACA,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACxC,SAAS,CAAC;QACR,GAAG,CAAC,kBAAkB,CAAC,UAAC,OAAO;YAC7B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACpB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC;QACP,GAAG,CAAC,WAAW,EAAE,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,EAAE,CAAA","sourcesContent":["import prettyFormat from 'pretty-format'\n\nglobal['prettyFormat'] = prettyFormat\n\nglobal['sleep'] = (time) => {\n return new Promise((resolve) => setTimeout(resolve, time))\n}\n\nglobal['requestAnimationFrame'] = (fn) => setTimeout(fn)\n\nglobal.document.documentElement.style['grid-column-gap'] = true\n\n// 把 console.error 转换成 error,方便断言\n;(() => {\n const spy = jest.spyOn(console, 'error')\n beforeAll(() => {\n spy.mockImplementation((message) => {\n console.log(message)\n throw new Error(message)\n })\n })\n\n afterAll(() => {\n spy.mockRestore()\n })\n})()\n"]} -------------------------------------------------------------------------------- /templates/vue/packages/renderer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>-renderer", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>-renderer.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>-renderer.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>-renderer.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "@vue/composition-api": "^1.0.0-beta.1", 40 | "vue": "^2.6.0 || >=3.0.0-rc.0" 41 | }, 42 | "peerDependenciesMeta": { 43 | "@vue/composition-api": { 44 | "optional": true 45 | } 46 | }, 47 | "dependencies": {}, 48 | "devDependencies": {} 49 | } 50 | -------------------------------------------------------------------------------- /templates/vue/docs/.vuepress/components/highlight.js: -------------------------------------------------------------------------------- 1 | const prism = require('prismjs') 2 | const escapeHtml = require('escape-html') 3 | const loadLanguages = require('prismjs/components/index') 4 | 5 | function wrap(code, lang) { 6 | if (lang === 'text') { 7 | code = escapeHtml(code) 8 | } 9 | return `
${code}
` 10 | } 11 | 12 | function getLangCodeFromExtension(extension) { 13 | const extensionMap = { 14 | vue: 'markup', 15 | html: 'markup', 16 | md: 'markdown', 17 | rb: 'ruby', 18 | ts: 'typescript', 19 | py: 'python', 20 | sh: 'bash', 21 | yml: 'yaml', 22 | styl: 'stylus', 23 | kt: 'kotlin', 24 | rs: 'rust', 25 | } 26 | 27 | return extensionMap[extension] || extension 28 | } 29 | 30 | module.exports = (str, lang) => { 31 | if (!lang) { 32 | return wrap(str, 'text') 33 | } 34 | lang = lang.toLowerCase() 35 | const rawLang = lang 36 | 37 | lang = getLangCodeFromExtension(lang) 38 | 39 | if (!prism.languages[lang]) { 40 | try { 41 | loadLanguages([lang]) 42 | } catch (e) { 43 | console.warn( 44 | `[vuepress] Syntax highlight for language "${lang}" is not supported.` 45 | ) 46 | } 47 | } 48 | if (prism.languages[lang]) { 49 | const code = prism.highlight(str, prism.languages[lang], lang) 50 | return wrap(code, rawLang) 51 | } 52 | return wrap(str, 'text') 53 | } 54 | -------------------------------------------------------------------------------- /templates/vue/packages/prototypes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>-prototypes", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>-prototypes.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>-prototypes.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>-prototypes.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "@vue/composition-api": "^1.0.0-beta.1", 40 | "vue": "^2.6.0 || >=3.0.0-rc.0" 41 | }, 42 | "peerDependenciesMeta": { 43 | "@vue/composition-api": { 44 | "optional": true 45 | } 46 | }, 47 | "dependencies": {}, 48 | "devDependencies": {} 49 | } 50 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/submit.md: -------------------------------------------------------------------------------- 1 | # Submit 2 | 3 | > 提交按钮 4 | 5 | ## 普通提交 6 | 7 | 8 | 9 | ## 防重提交 10 | 11 | 12 | 13 | ## API 14 | 15 | 按钮相关的 API 属性,我们参考 [https://element.eleme.io/#/zh-CN/component/button](https://element.eleme.io/#/zh-CN/component/button) 即可,剩下是 Submit 组件独有的 API 属性 16 | 17 | | 属性名 | 类型 | 描述 | 默认值 | 18 | | --------------- | ------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------- | --- | 19 | | onClick | `(event: MouseEvent) => void | boolean` | 点击事件,如果返回 false 可以阻塞提交 | - | 20 | | onSubmit | `(values: any) => Promise | any` | 提交事件回调 | - | 21 | | onSubmitSuccess | (payload: any) => void | 提交成功响应事件 | - | 22 | | onSubmitFailed | (feedbacks: [IFormFeedback](https://core.formilyjs.org/api/models/form#iformfeedback)[]) => void | 提交校验失败事件回调 | - | 23 | -------------------------------------------------------------------------------- /templates/vue/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true 4 | }, 5 | "extends": [ 6 | "plugin:vue/vue3-recommended", 7 | "plugin:@typescript-eslint/recommended", 8 | "prettier/@typescript-eslint" 9 | ], 10 | "globals": { 11 | "sleep": true, 12 | "prettyFormat": true 13 | }, 14 | "parserOptions": { 15 | "ecmaVersion": 10, 16 | "sourceType": "module", 17 | "ecmaFeatures": { 18 | "jsx": true 19 | } 20 | }, 21 | "parser": "@typescript-eslint/parser", 22 | "plugins": ["@typescript-eslint", "prettier", "markdown"], 23 | "rules": { 24 | "@typescript-eslint/explicit-module-boundary-types": "off", 25 | "@typescript-eslint/no-var-requires": "off", 26 | "@typescript-eslint/no-explicit-any": "off", 27 | "@typescript-eslint/no-unused-vars": "error", 28 | "@typescript-eslint/ban-ts-comment": "off" 29 | }, 30 | "overrides": [ 31 | { 32 | "files": ["**/*.md"], 33 | "processor": "markdown/markdown" 34 | }, 35 | { 36 | "files": ["**/*.md/*.{jsx,tsx}"], 37 | "rules": { 38 | "@typescript-eslint/no-unused-vars": "error", 39 | "no-unused-vars": "error", 40 | "no-console": "off" 41 | } 42 | }, 43 | { 44 | "files": ["**/*.md/*.{js,ts}"], 45 | "rules": { 46 | "@typescript-eslint/no-unused-vars": "off", 47 | "no-unused-vars": "off", 48 | "no-console": "off" 49 | } 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/checkbox/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 64 | l 65 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/radio/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 62 | -------------------------------------------------------------------------------- /templates/vue/packages/settings-form/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@formily/<%= repoName %>-settings-form", 3 | "version": "1.0.0-alpha.0", 4 | "license": "MIT", 5 | "main": "lib", 6 | "types": "lib/index.d.ts", 7 | "engines": { 8 | "npm": ">=3.0.0" 9 | }, 10 | "module": "esm", 11 | "umd:main": "dist/formily.<%= repoName %>-settings-form.umd.production.js", 12 | "unpkg": "dist/formily.<%= repoName %>-settings-form.umd.production.js", 13 | "jsdelivr": "dist/formily.<%= repoName %>-settings-form.umd.production.js", 14 | "jsnext:main": "esm", 15 | "sideEffects": [ 16 | "dist/*", 17 | "esm/*.js", 18 | "lib/*.js", 19 | "src/*.ts", 20 | "*.less", 21 | "*.scss", 22 | "**/*/style.js" 23 | ], 24 | "scripts": { 25 | "build": "formily-tpl build" 26 | }, 27 | "repository": { 28 | "type": "git", 29 | "url": "git+https://github.com/formilyjs/<%= repoName %>.git" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/formilyjs/<%= repoName %>/issues" 33 | }, 34 | "homepage": "https://github.com/formilyjs/<%= repoName %>#readme", 35 | "publishConfig": { 36 | "access": "public" 37 | }, 38 | "peerDependencies": { 39 | "@vue/composition-api": "^1.0.0-beta.1", 40 | "vue": "^2.6.0 || >=3.0.0-rc.0" 41 | }, 42 | "peerDependenciesMeta": { 43 | "@vue/composition-api": { 44 | "optional": true 45 | } 46 | }, 47 | "dependencies": {}, 48 | "devDependencies": {} 49 | } 50 | -------------------------------------------------------------------------------- /src/init/generate.ts: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fs from 'fs-extra' 3 | import ejs from 'ejs' 4 | import { glob } from 'glob' 5 | import { cwd } from '../constants' 6 | 7 | export interface IGeneratorParams { 8 | template: string 9 | repoName: string 10 | userName: string 11 | brandName: string 12 | pascalName: string 13 | } 14 | 15 | export const generate = (params: IGeneratorParams) => { 16 | return new Promise((resolve, reject) => { 17 | const base = path.resolve(__dirname, `../../templates/${params.template}`) 18 | glob( 19 | '**/*', 20 | { 21 | dot: true, 22 | cwd: base, 23 | }, 24 | (err, files) => { 25 | if (err) return reject(err) 26 | 27 | files.forEach((filename) => { 28 | const filepath = path.resolve(base, filename) 29 | const dist = path.resolve(cwd, filename) 30 | const distPath = dist.replace(/ignore\.tpl$/, 'ignore') 31 | const stat = fs.statSync(filepath) 32 | if (stat.isDirectory()) { 33 | if (filepath.includes('.tpl')) return 34 | fs.copySync(filepath, dist) 35 | return 36 | } 37 | const contents = fs.readFileSync(filepath, 'utf-8') 38 | const template = ejs.compile(contents) 39 | fs.outputFileSync(distPath, template(params)) 40 | }) 41 | console.log('🎉🎉 generate success!') 42 | resolve(0) 43 | } 44 | ) 45 | }) 46 | } 47 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/time-picker/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 60 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-button-group.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 63 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/preview-text.md: -------------------------------------------------------------------------------- 1 | # PreviewText 2 | 3 | > 阅读态组件,主要用来实现类 Input,类 DatePicker 这些组件的阅读态 4 | 5 | ## 简单案例 6 | 7 | 8 | 9 | ## 扩展案例 10 | 11 | 12 | 13 | ## API 14 | 15 | ### PreviewText.Input 16 | 17 | 参考 [https://element.eleme.io/#/zh-CN/component/input](https://element.eleme.io/#/zh-CN/component/input) 18 | 19 | ### PreviewText.Select 20 | 21 | 参考 [https://element.eleme.io/#/zh-CN/component/select](https://element.eleme.io/#/zh-CN/component/select) 22 | 23 | ### PreviewText.Cascader 24 | 25 | 参考 [https://element.eleme.io/#/zh-CN/component/cascader](https://element.eleme.io/#/zh-CN/component/cascader) 26 | 27 | ### PreviewText.DatePicker 28 | 29 | 参考 [https://element.eleme.io/#/zh-CN/component/date-picker](https://element.eleme.io/#/zh-CN/component/date-picker) 30 | 31 | ### PreviewText.TimePicker 32 | 33 | 参考 [https://element.eleme.io/#/zh-CN/component/time-picker](https://element.eleme.io/#/zh-CN/component/time-picker) 34 | 35 | ### PreviewText 36 | 37 | | 属性名 | 类型 | 描述 | 默认值 | 38 | | ------ | ------ | ---------- | ------ | 39 | | value | stirng | 缺省占位符 | N/A | 40 | 41 | ### PreviewText.Placeholder 42 | 43 | | 属性名 | 类型 | 描述 | 默认值 | 44 | | ------ | ------ | ---------- | ------ | 45 | | value | stirng | 缺省占位符 | N/A | 46 | 47 | ### PreviewText.usePlaceholder 48 | 49 | ```ts pure 50 | interface usePreviewTextPlaceholder { 51 | (): string 52 | } 53 | ``` 54 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/time-picker/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 65 | l 66 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/submit/loading.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 64 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/form.md: -------------------------------------------------------------------------------- 1 | # Form 2 | 3 | > FormProvider + FormLayout + form 标签的组合组件,可以帮助我们快速实现带回车提交的且能批量布局的表单 4 | 5 | ## 使用案例 6 | 7 | 8 | 9 | > 注意:想要实现回车提交,我们在使用 Submit 组件的时候不能给其传 submit 事件,否则回车提交会失效,这样做的目的是为了防止用户同时在多处写 submit 事件监听器,处理逻辑不一致的话,提交时很难定位问题。 10 | 11 | ## API 12 | 13 | 布局相关的 API 属性,我们参考 [FormLayout](./form-layout) 即可,剩下是 Form 组件独有的 API 属性 14 | 15 | | 属性名 | 类型 | 描述 | 默认值 | 16 | | ---------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------- | ------ | 17 | | form | [Form](https://core.formilyjs.org/api/models/form) | Form 实例 | - | 18 | | component | string | 渲染组件,可以指定为自定义组件渲染 | `form` | 19 | | previewTextPlaceholder | string \| Vue Component | 预览态占位符 | `N/A` | 20 | | onAutoSubmit | `(values:any)=>any` | 回车提交事件回调 | - | 21 | | onAutoSubmitFailed | (feedbacks: [IFormFeedback](https://core.formilyjs.org/api/models/form#iformfeedback)[]) => void | 回车提交校验失败事件回调 | - | 22 | -------------------------------------------------------------------------------- /templates/vue/docs/.vuepress/config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const utils = require('./util') 3 | 4 | const componentFiles = utils 5 | .getFiles(path.resolve(__dirname, '../guide')) 6 | .map((item) => item.replace(/(\.md)/g, '')) 7 | .filter((item) => !['el-form', 'el-form-item', 'index'].includes(item)) 8 | 9 | module.exports = { 10 | title: 'Formily <%= pascalName %>', 11 | dest: './doc-site', 12 | theme: '@vuepress-dumi/dumi', 13 | head: [ 14 | [ 15 | 'link', 16 | { 17 | rel: 'icon', 18 | href: '//img.alicdn.com/imgextra/i3/O1CN01XtT3Tv1Wd1b5hNVKy_!!6000000002810-55-tps-360-360.svg', 19 | }, 20 | ], 21 | ], 22 | themeConfig: { 23 | logo: '//img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg', 24 | nav: [ 25 | { 26 | text: '指南', 27 | link: '/guide/', 28 | }, 29 | { 30 | text: '主站', 31 | link: 'https://v2.formilyjs.org', 32 | }, 33 | { 34 | text: 'GITHUB', 35 | link: 'https://github.com/alibaba/formily', 36 | }, 37 | ], 38 | sidebar: { 39 | '/guide/': ['', ...componentFiles], 40 | }, 41 | lastUpdated: 'Last Updated', 42 | smoothScroll: true, 43 | }, 44 | plugins: [ 45 | 'vuepress-plugin-typescript', 46 | '@vuepress/back-to-top', 47 | '@vuepress/last-updated', 48 | '@vuepress-dumi/dumi-previewer', 49 | [ 50 | '@vuepress/medium-zoom', 51 | { 52 | selector: '.content__default :not(a) > img', 53 | }, 54 | ], 55 | ], 56 | } 57 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/form-collapse.md: -------------------------------------------------------------------------------- 1 | # FormCollapse 2 | 3 | > 折叠面板,通常用在布局空间要求较高的表单场景 4 | > 5 | > 注意:只能用在 Schema 场景 6 | 7 | ## Markup Schema 案例 8 | 9 | 10 | 11 | ## JSON Schema 案例 12 | 13 | 14 | 15 | ## API 16 | 17 | ### FormCollapse 18 | 19 | | 属性名 | 类型 | 描述 | 默认值 | 20 | | ------------ | ------------- | ---------------------------------------------------------- | ------ | 21 | | formCollapse | IFormCollapse | 传入通过 createFormCollapse/useFormCollapse 创建出来的模型 | | 22 | 23 | 其余参考 [https://element.eleme.io/#/zh-CN/component/collapse](https://element.eleme.io/#/zh-CN/component/collapse) 24 | 25 | ### FormCollapse.Item 26 | 27 | 参考 [https://element.eleme.io/#/zh-CN/component/collapse](https://element.eleme.io/#/zh-CN/component/collapse) 28 | 29 | ### FormCollapse.createFormCollapse 30 | 31 | ```ts pure 32 | type ActiveKey = string | number 33 | type ActiveKeys = string | number | Array 34 | 35 | interface createFormCollapse { 36 | (defaultActiveKeys?: ActiveKeys): IFormCollpase 37 | } 38 | 39 | interface IFormCollapse { 40 | //激活主键列表 41 | activeKeys: ActiveKeys 42 | //是否存在该激活主键 43 | hasActiveKey(key: ActiveKey): boolean 44 | //设置激活主键列表 45 | setActiveKeys(keys: ActiveKeys): void 46 | //添加激活主键 47 | addActiveKey(key: ActiveKey): void 48 | //删除激活主键 49 | removeActiveKey(key: ActiveKey): void 50 | //开关切换激活主键 51 | toggleActiveKey(key: ActiveKey): void 52 | } 53 | ``` 54 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/index.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | 64 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 71 | -------------------------------------------------------------------------------- /src/build/fix-deps-paths.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs-extra' 2 | import path from 'path' 3 | import { glob } from 'glob' 4 | import { cwd, builderConfigs } from '../constants' 5 | 6 | const cjsToEs = (contents: string) => { 7 | return contents.replace( 8 | new RegExp( 9 | `${builderConfigs.targetLibName}\\/${builderConfigs.targetLibCjsDir}\\/`, 10 | 'g' 11 | ), 12 | `${builderConfigs.targetLibName}/${builderConfigs.targetLibEsDir}/` 13 | ) 14 | } 15 | 16 | const esToCjs = (contents: string) => { 17 | return contents.replace( 18 | new RegExp( 19 | `${builderConfigs.targetLibName}\\/${builderConfigs.targetLibEsDir}\\/`, 20 | 'g' 21 | ), 22 | `${builderConfigs.targetLibName}/${builderConfigs.targetLibCjsDir}/` 23 | ) 24 | } 25 | 26 | export const fixDepsPaths = async () => { 27 | if ( 28 | !builderConfigs.targetLibName || 29 | !builderConfigs.targetLibCjsDir || 30 | !builderConfigs.targetLibEsDir 31 | ) 32 | return 33 | return new Promise((resolve, reject) => { 34 | glob('{esm,lib}/**/*.{js,ts,less,scss}', { cwd }, (err, files) => { 35 | if (err) return reject(err) 36 | files.forEach((filename) => { 37 | const isCjsPath = filename.includes(`lib/`) 38 | const isEsPath = filename.includes(`esm/`) 39 | const filepath = path.resolve(cwd, filename) 40 | const contents = fs.readFileSync(filepath, 'utf-8') 41 | const replaced = isCjsPath 42 | ? esToCjs(contents) 43 | : isEsPath 44 | ? cjsToEs(contents) 45 | : contents 46 | fs.writeFileSync(filepath, replaced, 'utf-8') 47 | }) 48 | resolve(0) 49 | }) 50 | }) 51 | } 52 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/form-grid.md: -------------------------------------------------------------------------------- 1 | # FormGrid 2 | 3 | > FormGrid 组件 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## 原生案例 14 | 15 | 16 | 17 | ## API 18 | 19 | ### FormGrid 20 | 21 | | 属性名 | 类型 | 描述 | 默认值 | 22 | | ----------- | ------------------- | ------------ | ----------------- | 23 | | minWidth | `number / number[]` | 元素最小宽度 | 100 | 24 | | maxWidth | `number / number[]` | 元素最大宽度 | - | 25 | | minColumns | `number / number[]` | 最小列数 | 0 | 26 | | maxColumns | `number / number[]` | 最大列数 | - | 27 | | breakpoints | number[] | 容器尺寸断点 | `[720,1280,1920]` | 28 | | columnGap | number | 列间距 | 8 | 29 | | rowGap | number | 行间距 | 4 | 30 | | colWrap | boolean | 自动换行 | true | 31 | 32 | 注意: 33 | 34 | - minWidth 生效优先级高于 minColumn 35 | - maxWidth 优先级高于 maxColumn 36 | - minWidth/maxWidth/minColumns/maxColumns 的数组格式代表与断点数组映射 37 | 38 | ### FormGrid.GridColumn 39 | 40 | | 属性名 | 类型 | 描述 | 默认值 | 41 | | -------- | ------ | ---------------------------------------------------- | ------ | 42 | | gridSpan | number | 元素所跨列数,如果为-1,那么会自动反向跨列填补单元格 | 1 | 43 | 44 | ### FormGrid.useGridSpan 45 | 46 | #### 描述 47 | 48 | 根据容器宽度计算出正确的 span,防止元素溢出 49 | 50 | #### 签名 51 | 52 | ```ts 53 | interface uesGridSpan { 54 | (gridSpan: number): number 55 | } 56 | ``` 57 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-layout/json-schema.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 76 | -------------------------------------------------------------------------------- /templates/react/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true 4 | }, 5 | "extends": [ 6 | "plugin:react/recommended", 7 | "plugin:@typescript-eslint/recommended", 8 | "prettier/@typescript-eslint" 9 | ], 10 | "globals": { 11 | "sleep": true, 12 | "prettyFormat": true 13 | }, 14 | "parserOptions": { 15 | "ecmaVersion": 10, 16 | "sourceType": "module", 17 | "ecmaFeatures": { 18 | "jsx": true 19 | } 20 | }, 21 | "parser": "@typescript-eslint/parser", 22 | "plugins": ["@typescript-eslint", "react", "prettier", "markdown"], 23 | "settings": { 24 | "react": { 25 | "version": "detect" 26 | } 27 | }, 28 | "rules": { 29 | "@typescript-eslint/explicit-module-boundary-types": "off", 30 | "@typescript-eslint/no-var-requires": "off", 31 | "@typescript-eslint/no-explicit-any": "off", 32 | "@typescript-eslint/no-unused-vars": "error", 33 | "@typescript-eslint/ban-ts-comment": "off", 34 | "react/no-unescaped-entities": "off", 35 | "react/prop-types": "off" 36 | }, 37 | "overrides": [ 38 | { 39 | "files": ["**/*.md"], 40 | "processor": "markdown/markdown" 41 | }, 42 | { 43 | "files": ["**/*.md/*.{jsx,tsx}"], 44 | "rules": { 45 | "@typescript-eslint/no-unused-vars": "error", 46 | "no-unused-vars": "error", 47 | "no-console": "off", 48 | "react/display-name": "off", 49 | "react/prop-types": "off" 50 | } 51 | }, 52 | { 53 | "files": ["**/*.md/*.{js,ts}"], 54 | "rules": { 55 | "@typescript-eslint/no-unused-vars": "off", 56 | "no-unused-vars": "off", 57 | "no-console": "off", 58 | "react/display-name": "off", 59 | "react/prop-types": "off" 60 | } 61 | } 62 | ] 63 | } 64 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-drawer/template.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 72 | -------------------------------------------------------------------------------- /src/init/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import prompts from 'prompts' 3 | import { pascalCase } from 'pascal-case' 4 | import { cwd, templates } from '../constants' 5 | import { generate } from './generate' 6 | import execa from 'execa' 7 | 8 | const required = (value: string) => (!value ? 'this field is required' : true) 9 | 10 | export const init = async () => { 11 | const params = await prompts([ 12 | { 13 | type: 'select', 14 | name: 'template', 15 | message: 'Which template do you need to install?', 16 | choices: templates.map((name) => ({ 17 | title: pascalCase(path.basename(name)), 18 | value: path.basename(name), 19 | })), 20 | validate: required, 21 | }, 22 | { 23 | type: 'text', 24 | name: 'brandName', 25 | message: 26 | 'What is the brand name of the component library you rely on? Like "Ant Design"', 27 | initial: 'Ant Design', 28 | validate: required, 29 | }, 30 | { 31 | type: 'text', 32 | name: 'packageName', 33 | message: 34 | 'What is the package name of the component library you rely on? Like "antd"', 35 | initial: 'Ant Design', 36 | validate: required, 37 | }, 38 | { 39 | type: 'text', 40 | name: 'repoName', 41 | message: 42 | 'What is the repo name of the component library you depend on? Like "antd"', 43 | initial: 'antd', 44 | validate: required, 45 | }, 46 | { 47 | type: 'text', 48 | name: 'userName', 49 | message: 'What is your GitHub username?', 50 | validate: required, 51 | }, 52 | ]) 53 | if (params.repoName) { 54 | await generate({ ...params, pascalName: pascalCase(params.repoName) }) 55 | execa('yarn', ['install', '--ignore-engines'], { cwd }).stdout.pipe( 56 | process.stdout 57 | ) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/form-drawer.md: -------------------------------------------------------------------------------- 1 | # FormDrawer 2 | 3 | > 抽屉表单,主要用在简单的事件打开表单场景 4 | 5 | ## Markup Schema 案例 6 | 7 | 8 | 9 | ## JSON Schema 案例 10 | 11 | 12 | 13 | ## Template 案例 14 | 15 | 16 | 17 | ## API 18 | 19 | ### FormDrawer 20 | 21 | ```ts pure 22 | import { IFormProps, Form } from '@formily/core' 23 | 24 | type FormDrawerContentProps = { form: Form } 25 | 26 | type FormDrawerContent = Component | ((props: FormDrawerContentProps) => VNode) 27 | 28 | type DrawerTitle = string | number | Component | VNode | (() => VNode) 29 | 30 | type IFormDrawerProps = Omit & { 31 | title?: DrawerTitle 32 | footer?: null | Component | VNode | (() => VNode) 33 | cancelText?: string | Component | VNode | (() => VNode) 34 | cancelButtonProps?: ButtonProps 35 | okText?: string | Component | VNode | (() => VNode) 36 | okButtonProps?: ButtonProps 37 | onOpen?: () => void 38 | onOpend?: () => void 39 | onClose?: () => void 40 | onClosed?: () => void 41 | onCancel?: () => void 42 | onOK?: () => void 43 | loadingText?: string 44 | } 45 | 46 | interface FormDrawer { 47 | (title: IFormDrawerProps, id: string, content: FormDrawerContent): IFormDrawer 48 | (title: IFormDrawerProps, id: FormDrawerContent): IFormDrawer 49 | (title: DrawerTitle, id: string, content: FormDrawerContent): IFormDrawer 50 | (title: DrawerTitle, id: FormDrawerContent): IFormDrawer 51 | } 52 | ``` 53 | 54 | `DrawerProps`类型定义参考 [Element-UI Drawer API](https://element.eleme.io/#/zh-CN/component/drawer#attributes) 55 | 56 | ### FormDrawer.Footer 57 | 58 | 无属性,只接收子节点 59 | 60 | ### FormDrawer.Portal 61 | 62 | 接收可选的 id 属性,默认值为 form-dialog,如果一个应用存在多个 prefixCls,不同区域的弹窗内部 prefixCls 不一样,那推荐指定 id 为区域级 id 63 | -------------------------------------------------------------------------------- /templates/vue/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | [English](./README.md) | 简体中文 2 | 3 |

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | PRs Welcome 12 | 13 | 14 | 15 |

16 | 17 | --- 18 | 19 | ## 概要 20 | 21 | 这是一个结合了 Formily & <%= brandName %>的超酷组件库. 22 | 23 | ## 特性 24 | 25 | - 🖼 可设计,借助 Form Builder 可以快速搭建表单 26 | - 🚀 高性能,字段分布式渲染,大大减轻 React 渲染压力 27 | - 💡 支持 Ant Design/Fusion Next 组件体系 28 | - 🎨 JSX 标签化写法/JSON Schema 数据驱动方案无缝迁移过渡 29 | - 🏅 副作用逻辑独立管理,涵盖各种复杂联动校验逻辑 30 | - 🌯 支持各种表单复杂布局方案 31 | 32 | ## 表单设计器 33 | 34 | ![https://designable-antd.formilyjs.org/](https://img.alicdn.com/imgextra/i3/O1CN01xAJj1y1wcGzXYc1Uq_!!6000000006328-2-tps-2980-1740.png) 35 | 36 | ## 官网 37 | 38 | https://<%= repoName %>.formilyjs.org 39 | 40 | ## 生态产品 41 | 42 | - [formily](https://github.com/alibaba/formily) 43 | - [formilyjs](https://github.com/formilyjs) 44 | - [designable](https://github.com/alibaba/designable) 45 | 46 | ## 如何贡献? 47 | 48 | - [Contribute document](https://formilyjs.org/zh-CN/guide/contribution) 49 | 50 | ## 贡献者 51 | 52 | This project exists thanks to all the people who contribute. 53 | 54 | 55 | ## LICENSE 56 | 57 | Formily is open source software licensed as 58 | [MIT](./LICENSE.md). 59 | -------------------------------------------------------------------------------- /templates/react/README.zh-CN.md: -------------------------------------------------------------------------------- 1 | [English](./README.md) | 简体中文 2 | 3 |

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | PRs Welcome 12 | 13 | 14 | 15 |

16 | 17 | --- 18 | 19 | ## 概要 20 | 21 | 这是一个结合了 Formily & <%= brandName %>的超酷组件库. 22 | 23 | ## 特性 24 | 25 | - 🖼 可设计,借助 Form Builder 可以快速搭建表单 26 | - 🚀 高性能,字段分布式渲染,大大减轻 React 渲染压力 27 | - 💡 支持 Ant Design/Fusion Next 组件体系 28 | - 🎨 JSX 标签化写法/JSON Schema 数据驱动方案无缝迁移过渡 29 | - 🏅 副作用逻辑独立管理,涵盖各种复杂联动校验逻辑 30 | - 🌯 支持各种表单复杂布局方案 31 | 32 | ## 表单设计器 33 | 34 | ![https://designable-antd.formilyjs.org/](https://img.alicdn.com/imgextra/i3/O1CN01xAJj1y1wcGzXYc1Uq_!!6000000006328-2-tps-2980-1740.png) 35 | 36 | ## 官网 37 | 38 | https://<%= repoName %>.formilyjs.org 39 | 40 | ## 生态产品 41 | 42 | - [formily](https://github.com/alibaba/formily) 43 | - [formilyjs](https://github.com/formilyjs) 44 | - [designable](https://github.com/alibaba/designable) 45 | 46 | ## 如何贡献? 47 | 48 | - [Contribute document](https://formilyjs.org/zh-CN/guide/contribution) 49 | 50 | ## 贡献者 51 | 52 | This project exists thanks to all the people who contribute. 53 | 54 | 55 | ## LICENSE 56 | 57 | Formily is open source software licensed as 58 | [MIT](./LICENSE.md). 59 | -------------------------------------------------------------------------------- /templates/vue/docs/.vuepress/styles/index.styl: -------------------------------------------------------------------------------- 1 | .navbar { 2 | padding: 0 28px !important; 3 | } 4 | 5 | .navbar .logo { 6 | height: auto !important; 7 | width: 150px !important; 8 | } 9 | 10 | .navbar .site-name { 11 | display: none; 12 | } 13 | 14 | .navbar .sidebar-button { 15 | padding: 0; 16 | } 17 | 18 | .home .feature { 19 | margin-bottom: 40px; 20 | text-align: center; 21 | } 22 | 23 | .theme-dumi-content:not(.custom) { 24 | max-width: 100%; 25 | } 26 | 27 | .page .page-nav { 28 | max-width: 100%; 29 | } 30 | 31 | .dumi-previewer .dumi-previewer-actions .dumi-previewer-actions__icon { 32 | padding: 0 !important; 33 | } 34 | 35 | .page .page-edit { 36 | max-width 100% 37 | } 38 | 39 | .sidebar-group .sidebar-heading { 40 | color: #454d64; 41 | font-size: 16px; 42 | } 43 | 44 | .sidebar-group a.sidebar-link { 45 | font-size: 0.9em; 46 | } 47 | 48 | .theme-dumi-content .custom-block.warning { 49 | padding: 10px 20px; 50 | border-color: #FFC11F; 51 | box-shadow: 0 6px 16px -2px rgba(0,0,0,.06); 52 | background: rgba(255,229,100,0.1); 53 | } 54 | .theme-dumi-content .custom-block.danger { 55 | padding: 10px 20px; 56 | p { 57 | margin: 0; 58 | } 59 | } 60 | 61 | .theme-dumi-content:not(.custom) > h1, .theme-dumi-content:not(.custom) > h2, .theme-dumi-content:not(.custom) > h3, .theme-dumi-content:not(.custom) > h4, .theme-dumi-content:not(.custom) > h5, .theme-dumi-content:not(.custom) > h6 { 62 | margin-bottom: 18px; 63 | } 64 | 65 | .theme-dumi-content p { 66 | margin: 1em 0; 67 | } 68 | 69 | .custom-block.warning p { 70 | margin: 0; 71 | } 72 | 73 | // .theme-dumi-content div[class*="language-"] { 74 | // background-color: #f9fafb; 75 | // } 76 | 77 | // .theme-dumi-content pre[class*="language-"] code { 78 | // color: #000; 79 | // } 80 | 81 | .dumi-previewer .dumi-previewer-source, 82 | .dumi-previewer .dumi-previewer-demo { 83 | overflow: auto; 84 | } 85 | 86 | @media (max-width: 719px) { 87 | .sidebar-button + .home-link { 88 | margin-left: 20px; 89 | } 90 | } 91 | 92 | @media (max-width: 419px) { 93 | .theme-dumi-content div[class*="language-"] { 94 | margin: 0; 95 | border-radius: 0; 96 | } 97 | } 98 | 99 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/cascader/template.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 87 | -------------------------------------------------------------------------------- /templates/react/docs/components/index.zh-CN.md: -------------------------------------------------------------------------------- 1 | # Ant Design 2 | 3 | ## 介绍 4 | 5 | @formily/<%= repoName %> 是基于 Ant Design 封装的针对表单场景专业级(Professional)组件库,它主要有以下几个特点: 6 | 7 | - 仅支持 Formily2.x 8 | - 大部分组件无法向后兼容 9 | - 很遗憾,1.x 的很多组件在 API 设计上存在本质上的缺陷,这也是因为表单方案一直在探索之中,所以才会出现版本断裂。 10 | - 更丰富的组件体系 11 | - 布局组件 12 | - FormLayout 13 | - FormItem 14 | - FormGrid 15 | - FormButtonGroup 16 | - Space 17 | - Submit 18 | - Reset 19 | - 输入控件 20 | - Input 21 | - Password 22 | - Select 23 | - TreeSelect 24 | - DatePicker 25 | - TimePicker 26 | - NumberPicker 27 | - Transfer 28 | - Cascader 29 | - Radio 30 | - Checkbox 31 | - Upload 32 | - Switch 33 | - 场景组件 34 | - ArrayCards 35 | - ArrayItems 36 | - ArrayTable 37 | - ArrayTabs 38 | - FormCollapse 39 | - FormStep 40 | - FormTab 41 | - FormDialog 42 | - FormDrawer 43 | - Editable 44 | - 阅读态组件 45 | - PreviewText 46 | - 主题定制能力 47 | - 完全放弃了 1.x styled-components 方案,follow 组件库的样式体系,更方便定制主题 48 | - 支持二次封装 49 | - 所有组件都能二次封装,1.x 的组件体系是不能二次封装的,所以提供了这个能力则更方便用户做业务定制 50 | - 支持阅读态 51 | - 虽然 1.x 同样支持阅读态,但是 2.x 单独提供了 PreviewText 组件,用户可以基于它自己做阅读态封装,灵活性更强 52 | - 类型更加友好 53 | - 每个组件都有着极其完整的类型定义,用户在实际开发过程中,可以感受到前所未有的智能提示体验 54 | - 更完备的布局控制能力 55 | - 1.x 的布局能力基本上都收敛到了 FormMegaLayout 上,这次,我们直接去掉 Mega,Mega 就是标准组件,完全内化到 FormLayout 和 FormItem 组件中,同时将 MegaLayout 的网格布局能力放到了 FormGrid 组件中,也提供了更智能的布局能力。 56 | - 更优雅易用的 API,比如: 57 | - 过去的 FormStep,有很多问题,第一,类型不友好,第二,API 隐藏太深,想要控制前进后退需要理解一堆的私有事件。新版 FormStep,用户只需要关注 FormStep Reactive Model 即可,通过 createFormStep 就可以创建出 Reactive Model,传给 FormStep 组件即可快速通讯。同理,FormTab/FormCollapse 也是一样的通讯模式。 58 | - 弹窗表单,抽屉表单,想必过去,用户几乎每次都得在这两个场景上写大量的代码,这次直接提供了极其简易的 API 让用户使用,最大化提升开发效率。 59 | 60 | ## 安装 61 | 62 | ```bash 63 | $ npm install --save <%= packageName %> moment 64 | $ npm install --save @formily/core @formily/react @formily/<%= repoName %> 65 | 66 | ``` 67 | 68 | ## Q/A 69 | 70 | 问:我想自己封装一套组件库,该怎么做? 71 | 72 | 答:如果是开源组件库,可以直接参与项目共建,提供 PR,如果是企业内私有组件库,参考源码即可,源码并没有太多复杂逻辑。 73 | 74 | 问:为什么 ArrayCards/ArrayTable/FormStep 这类组件只支持 Schema 模式,不支持纯 JSX 模式? 75 | 76 | 答:这就是 Schema 模式的核心优势,借助协议,我们可以做场景化抽象,相反,纯 JSX 模式,受限于 JSX 的不可解析性,我们很难做到 UI 级别的场景化抽象,更多的只是抽象 Hook。 77 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/array-tabs/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-dialog/template.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 85 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/form-dialog.md: -------------------------------------------------------------------------------- 1 | # FormDialog 2 | 3 | > 弹窗表单,主要用在简单的事件打开表单场景 4 | 5 | ## Markup Schema 案例 6 | 7 | 以下例子演示了 FormDialog 的几个能力: 8 | 9 | - 快速打开,关闭能力 10 | - 中间件能力,自动出现加载态 11 | - 渲染函数内可以响应式能力 12 | - 上下文共享能力 13 | 14 | 15 | 16 | ## JSON Schema 案例 17 | 18 | 19 | 20 | ## Template 案例 21 | 22 | 23 | 24 | ## API 25 | 26 | ### FormDialog 27 | 28 | ```ts pure 29 | import { IFormProps, Form } from '@formily/core' 30 | 31 | type FormDialogContentProps = { form: Form } 32 | 33 | type FormDialogContent = Component | ((props: FormDialogContentProps) => VNode) 34 | 35 | type DialogTitle = string | number | Component | VNode | (() => VNode) 36 | 37 | type IFormDialogProps = Omit & { 38 | title?: DialogTitle 39 | footer?: null | Component | VNode | (() => VNode) 40 | cancelText?: string | Component | VNode | (() => VNode) 41 | cancelButtonProps?: ButtonProps 42 | okText?: string | Component | VNode | (() => VNode) 43 | okButtonProps?: ButtonProps 44 | onOpen?: () => void 45 | onOpend?: () => void 46 | onClose?: () => void 47 | onClosed?: () => void 48 | onCancel?: () => void 49 | onOK?: () => void 50 | loadingText?: string 51 | } 52 | 53 | interface IFormDialog { 54 | forOpen(middleware: IMiddleware): IFormDialog 55 | forConfirm(middleware: IMiddleware): IFormDialog 56 | forCancel(middleware: IMiddleware): IFormDialog 57 | open(props?: IFormProps): Promise 58 | close(): void 59 | } 60 | 61 | interface FormDialog { 62 | (title: IFormDialogProps, id: string, content: FormDialogContent): IFormDialog 63 | (title: IFormDialogProps, id: FormDialogContent): IFormDialog 64 | (title: DialogTitle, id: string, content: FormDialogContent): IFormDialog 65 | (title: DialogTitle, id: FormDialogContent): IFormDialog 66 | } 67 | ``` 68 | 69 | `DialogProps`类型定义参考 [Element-UI Dialog API](https://element.eleme.io/#/zh-CN/component/dialog#attributes) 70 | 71 | ### FormDialog.Footer 72 | 73 | 无属性,只接收子节点 74 | 75 | ### FormDialog.Portal 76 | 77 | 接收可选的 id 属性,默认值为 form-dialog,如果一个应用存在多个 prefixCls,不同区域的弹窗内部 prefixCls 不一样,那推荐指定 id 为区域级 id 78 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-grid/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 59 | 60 | 88 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-drawer/json-schema.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 96 | -------------------------------------------------------------------------------- /templates/vue/docs/guide/array-items.md: -------------------------------------------------------------------------------- 1 | # ArrayItems 2 | 3 | > 自增列表,对于简单的自增编辑场景比较适合,或者对于空间要求高的场景比较适合 4 | > 5 | > 注意:该组件只适用于 Schema 场景 6 | 7 | ## Markup Schema 案例 8 | 9 | 10 | 11 | ## JSON Schema 案例 12 | 13 | 14 | 15 | ## API 16 | 17 | ### ArrayItems 18 | 19 | 继承 HTMLDivElement Props 20 | 21 | ### ArrayItems.Item 22 | 23 | > 列表区块 24 | 25 | 继承 HTMLDivElement Props 26 | 27 | ### ArrayItems.SortHandle 28 | 29 | > 拖拽手柄 30 | 31 | 参考 [https://element.eleme.io/#/zh-CN/component/button](https://element.eleme.io/#/zh-CN/component/button) 32 | 33 | ### ArrayItems.Addition 34 | 35 | > 添加按钮 36 | 37 | 扩展属性 38 | 39 | | 属性名 | 类型 | 描述 | 默认值 | 40 | | ------ | ---- | ---- | ------ || 41 | | title | string | 文案 | | 42 | | method | `'push' | 'unshift'` | 添加方式 | `'push'` | 43 | | defaultValue | any | 默认值 | | 44 | 45 | 其余参考 [https://element.eleme.io/#/zh-CN/component/button](https://element.eleme.io/#/zh-CN/component/button) 46 | 47 | 注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的 48 | 49 | ### ArrayItems.Remove 50 | 51 | > 删除按钮 52 | 53 | | 属性名 | 类型 | 描述 | 默认值 | 54 | | ------ | ------ | ---- | ------ | 55 | | title | string | 文案 | | 56 | 57 | 其余参考 [https://element.eleme.io/#/zh-CN/component/button](https://element.eleme.io/#/zh-CN/component/button) 58 | 59 | 注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的 60 | 61 | ### ArrayItems.MoveDown 62 | 63 | > 下移按钮 64 | 65 | | 属性名 | 类型 | 描述 | 默认值 | 66 | | ------ | ------ | ---- | ------ | 67 | | title | string | 文案 | | 68 | 69 | 其余参考 [https://element.eleme.io/#/zh-CN/component/button](https://element.eleme.io/#/zh-CN/component/button) 70 | 71 | 注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的 72 | 73 | ### ArrayItems.MoveUp 74 | 75 | > 上移按钮 76 | 77 | | 属性名 | 类型 | 描述 | 默认值 | 78 | | ------ | ------ | ---- | ------ | 79 | | title | string | 文案 | | 80 | 81 | 其余参考 [https://element.eleme.io/#/zh-CN/component/button](https://element.eleme.io/#/zh-CN/component/button) 82 | 83 | 注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的 84 | 85 | ### ArrayItems.Index 86 | 87 | > 索引渲染器 88 | 89 | 无属性 90 | 91 | ### ArrayItems.useIndex 92 | 93 | > 读取当前渲染行索引的 Hook 94 | 95 | ### ArrayItems.useRecord 96 | 97 | > 读取当前渲染记录的 Hook 98 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/cascader/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 91 | l 92 | -------------------------------------------------------------------------------- /templates/vue/packages/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@typescript-eslint/parser", 3 | "extends": [ 4 | "plugin:vue/vue3-recommended", 5 | "plugin:@typescript-eslint/recommended", 6 | "prettier/@typescript-eslint" 7 | ], 8 | "env": { 9 | "node": true 10 | }, 11 | "plugins": ["@typescript-eslint", "prettier", "markdown"], 12 | "parserOptions": { 13 | "sourceType": "module", 14 | "ecmaVersion": 10, 15 | "ecmaFeatures": { 16 | "jsx": true 17 | } 18 | }, 19 | "rules": { 20 | "prettier/prettier": 0, 21 | // don't force es6 functions to include space before paren 22 | "space-before-function-paren": 0, 23 | // maybe we should no-public 24 | "@typescript-eslint/explicit-member-accessibility": 0, 25 | "@typescript-eslint/interface-name-prefix": 0, 26 | "@typescript-eslint/no-explicit-any": 0, 27 | "@typescript-eslint/explicit-function-return-type": 0, 28 | "@typescript-eslint/no-parameter-properties": 0, 29 | "@typescript-eslint/array-type": 0, 30 | "@typescript-eslint/no-object-literal-type-assertion": 0, 31 | "@typescript-eslint/no-use-before-define": 0, 32 | "@typescript-eslint/no-unused-vars": 1, 33 | "@typescript-eslint/no-namespace": 0, 34 | "@typescript-eslint/ban-ts-comment": 0, 35 | "@typescript-eslint/ban-types": 0, 36 | "@typescript-eslint/adjacent-overload-signatures": 0, 37 | "@typescript-eslint/explicit-module-boundary-types": 0, 38 | "@typescript-eslint/triple-slash-reference": 0, 39 | "@typescript-eslint/no-empty-function": 0, 40 | "no-console": [ 41 | "error", 42 | { 43 | "allow": ["warn", "error", "info"] 44 | } 45 | ], 46 | "prefer-const": 0, 47 | "no-var": 1, 48 | "prefer-rest-params": 0 49 | }, 50 | "overrides": [ 51 | { 52 | "files": ["**/*.md.{jsx,tsx}"], 53 | "processor": "markdown/markdown" 54 | }, 55 | { 56 | "files": ["**/*.md/*.{jsx,tsx}"], 57 | "rules": { 58 | "@typescript-eslint/no-unused-vars": "error", 59 | "no-unused-vars": "error", 60 | "no-console": "off" 61 | } 62 | }, 63 | { 64 | "files": ["**/*.md/*.{js,ts}"], 65 | "rules": { 66 | "@typescript-eslint/no-unused-vars": "off", 67 | "no-unused-vars": "off", 68 | "no-console": "off" 69 | } 70 | } 71 | ] 72 | } 73 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-drawer/markup-schema.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 98 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/preview-text/base.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | 85 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/upload/template.vue: -------------------------------------------------------------------------------- 1 | 61 | 62 | 99 | -------------------------------------------------------------------------------- /templates/vue/docs/demos/guide/form-grid/json-schema.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 94 | l 95 | --------------------------------------------------------------------------------