forked from IDuxFE/idux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(comp: checkbox): add checkbox component
fix IDuxFE#120
- Loading branch information
1 parent
321e8fd
commit 00b4466
Showing
28 changed files
with
1,123 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
module.exports = { | ||
// u can change this option to a more specific folder for test single component or util when dev | ||
// for example, ['<rootDir>/packages/components/button'] | ||
roots: ['<rootDir>'], | ||
// u can change this option to a more specific folder for test single component or util when dev | ||
// for example, ['<rootDir>/packages/components/button'] | ||
roots: ['<rootDir>'], | ||
|
||
testEnvironment: 'jsdom', | ||
transform: { | ||
'^.+\\.vue$': 'vue-jest', | ||
'^.+\\.(t|j)sx?$': [ | ||
'babel-jest', | ||
{ | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
testEnvironment: 'jsdom', | ||
transform: { | ||
'^.+\\.vue$': 'vue-jest', | ||
'^.+\\.(t|j)sx?$': [ | ||
'babel-jest', | ||
{ | ||
targets: { | ||
node: true, | ||
}, | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: true, | ||
}, | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
], | ||
plugins: ['@vue/babel-plugin-jsx'], | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
], | ||
plugins: ['@vue/babel-plugin-jsx'], | ||
}, | ||
], | ||
}, | ||
moduleNameMapper: { | ||
'^@idux(.*)$': '<rootDir>/packages$1', | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], | ||
collectCoverage: true, | ||
coverageReporters: ['json', 'lcov', 'text', 'cobertura'], | ||
coverageThreshold: { | ||
global: { | ||
branches: 85, | ||
functions: 85, | ||
lines: 85, | ||
statements: 85, | ||
}, | ||
}, | ||
reporters: ['default', 'jest-junit'], | ||
} | ||
moduleNameMapper: { | ||
'^@idux(.*)$': '<rootDir>/packages$1', | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], | ||
collectCoverage: true, | ||
coverageReporters: ['json', 'lcov', 'text', 'cobertura'], | ||
coverageThreshold: { | ||
global: { | ||
branches: 85, | ||
functions: 85, | ||
lines: 85, | ||
statements: 85, | ||
}, | ||
}, | ||
reporters: ['default', 'jest-junit'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,122 @@ | ||
{ | ||
"name": "idux", | ||
"version": "0.0.0-NOT-USED", | ||
"description": "A UI Component Library for Vue 3.x", | ||
"private": true, | ||
"scripts": { | ||
"start": "gulp start:dev", | ||
"icons": "gulp icons:start", | ||
"cz": "git-cz", | ||
"gen": "ts-node --project scripts/gen/tsconfig.json scripts/gen/index.ts", | ||
"postinstall": "lerna bootstrap", | ||
"codecov": "codecov -t", | ||
"test": "jest", | ||
"lint": "npm run ls-lint && npm run eslint && npm run stylelint && npm run markdownlint", | ||
"lint-fix": "npm run ls-lint && npm run eslint-fix && npm run stylelint-fix && npm run markdownlint-fix", | ||
"eslint": "eslint ./packages --ext .vue,.js,.ts", | ||
"eslint-fix": "eslint --fix ./packages --ext .vue,.js,.ts", | ||
"stylelint": "stylelint \"./packages/components/**/*.less\" --syntax less", | ||
"stylelint-fix": "stylelint --fix \"./packages/components/**/*.less\" --syntax less", | ||
"markdownlint": "markdownlint \"./packages/{cdk,components,pro}/**/*.md\"", | ||
"markdownlint-fix": "markdownlint --fix \"./packages/{cdk,components,pro}/**/*.md\"", | ||
"ls-lint": "ls-lint" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.12.0", | ||
"@babel/preset-typescript": "^7.12.0", | ||
"@commitlint/cli": "^11.0.0", | ||
"@commitlint/config-angular": "^11.0.0", | ||
"@ls-lint/ls-lint": "^1.9.0", | ||
"@types/detect-port": "^1.3.0", | ||
"@types/fs-extra": "^9.0.0", | ||
"@types/gulp": "^4.0.0", | ||
"@types/jest": "^26.0.0", | ||
"@types/lodash": "^4.14.0", | ||
"@types/marked": "^1.2.0", | ||
"@types/parse5": "^5.0.0", | ||
"@types/prismjs": "^1.16.0", | ||
"@types/svgo": "^1.3.0", | ||
"@types/yaml-front-matter": "^4.1.0", | ||
"@typescript-eslint/eslint-plugin": "^4.8.0", | ||
"@typescript-eslint/parser": "^4.8.0", | ||
"@vitejs/plugin-vue": "^1.0.0", | ||
"@vue/babel-plugin-jsx": "^1.0.0", | ||
"@vue/compiler-sfc": "^3.0.0", | ||
"@vue/eslint-config-prettier": "^6.0.0", | ||
"@vue/eslint-config-typescript": "^7.0.0", | ||
"@vue/test-utils": "^2.0.0-beta.12", | ||
"babel-jest": "^26.6.0", | ||
"chalk": "^4.1.0", | ||
"codecov": "^3.8.0", | ||
"commitizen": "^4.2.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"detect-port": "^1.3.0", | ||
"eslint": "^7.14.0", | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint-plugin-markdown": "^2.0.0-rc.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"eslint-plugin-vue": "^7.1.0", | ||
"fs-extra": "^9.0.0", | ||
"gulp": "^4.0.0", | ||
"gulp-clean": "^0.4.0", | ||
"husky": "^4.3.0", | ||
"jest": "^26.6.0", | ||
"jest-junit": "^12.0.0", | ||
"lerna": "^3.22.0", | ||
"less": "^3.12.2", | ||
"lint-staged": "^10.5.0", | ||
"lodash": "^4.17.0", | ||
"markdownlint-cli": "^0.25.0", | ||
"marked": "^1.2.0", | ||
"parse5": "^6.0.0", | ||
"prettier": "^2.0.0", | ||
"prismjs": "^1.22.0", | ||
"remark": "^13.0.0", | ||
"resolve-bin": "^0.4.0", | ||
"rimraf": "^3.0.0", | ||
"stylelint": "^13.0.0", | ||
"stylelint-config-prettier": "^8.0.0", | ||
"stylelint-config-standard": "^20.0.0", | ||
"svgo": "^1.3.0", | ||
"ts-jest": "^26.4.0", | ||
"ts-node": "^9.1.0", | ||
"tslib": "^2.0.0", | ||
"typescript": "^4.1.0", | ||
"vite": "^v2.0.0-beta.2", | ||
"vue": "^3.0.5", | ||
"vue-jest": "^5.0.0-alpha.7", | ||
"vue-router": "^4.0.0", | ||
"vue-types": "^3.0.0", | ||
"yaml-front-matter": "^4.1.0" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "ls-lint && lint-staged", | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
"name": "idux", | ||
"version": "0.0.0-NOT-USED", | ||
"description": "A UI Component Library for Vue 3.x", | ||
"private": true, | ||
"scripts": { | ||
"start": "gulp start:dev", | ||
"icons": "gulp icons:start", | ||
"cz": "git-cz", | ||
"gen": "ts-node --project scripts/gen/tsconfig.json scripts/gen/index.ts", | ||
"postinstall": "lerna bootstrap", | ||
"codecov": "codecov -t", | ||
"test": "jest", | ||
"lint": "npm run ls-lint && npm run eslint && npm run stylelint && npm run markdownlint", | ||
"lint-fix": "npm run ls-lint && npm run eslint-fix && npm run stylelint-fix && npm run markdownlint-fix", | ||
"eslint": "eslint ./packages --ext .vue,.js,.ts", | ||
"eslint-fix": "eslint --fix ./packages --ext .vue,.js,.ts", | ||
"stylelint": "stylelint \"./packages/components/**/*.less\" --syntax less", | ||
"stylelint-fix": "stylelint --fix \"./packages/components/**/*.less\" --syntax less", | ||
"markdownlint": "markdownlint \"./packages/{cdk,components,pro}/**/*.md\"", | ||
"markdownlint-fix": "markdownlint --fix \"./packages/{cdk,components,pro}/**/*.md\"", | ||
"ls-lint": "ls-lint" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.12.0", | ||
"@babel/preset-typescript": "^7.12.0", | ||
"@commitlint/cli": "^11.0.0", | ||
"@commitlint/config-angular": "^11.0.0", | ||
"@ls-lint/ls-lint": "^1.9.0", | ||
"@types/detect-port": "^1.3.0", | ||
"@types/fs-extra": "^9.0.0", | ||
"@types/gulp": "^4.0.0", | ||
"@types/jest": "^26.0.0", | ||
"@types/lodash": "^4.14.0", | ||
"@types/marked": "^1.2.0", | ||
"@types/parse5": "^5.0.0", | ||
"@types/prismjs": "^1.16.0", | ||
"@types/svgo": "^1.3.0", | ||
"@types/yaml-front-matter": "^4.1.0", | ||
"@typescript-eslint/eslint-plugin": "^4.8.0", | ||
"@typescript-eslint/parser": "^4.8.0", | ||
"@vitejs/plugin-vue": "^1.0.0", | ||
"@vue/babel-plugin-jsx": "^1.0.0", | ||
"@vue/compiler-sfc": "^3.0.0", | ||
"@vue/eslint-config-prettier": "^6.0.0", | ||
"@vue/eslint-config-typescript": "^7.0.0", | ||
"@vue/test-utils": "^2.0.0-beta.12", | ||
"babel-jest": "^26.6.0", | ||
"chalk": "^4.1.0", | ||
"codecov": "^3.8.0", | ||
"commitizen": "^4.2.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"detect-port": "^1.3.0", | ||
"eslint": "^7.14.0", | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint-plugin-markdown": "^2.0.0-rc.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"eslint-plugin-vue": "^7.1.0", | ||
"fs-extra": "^9.0.0", | ||
"gulp": "^4.0.0", | ||
"gulp-clean": "^0.4.0", | ||
"husky": "^4.3.0", | ||
"jest": "^26.6.0", | ||
"jest-junit": "^12.0.0", | ||
"lerna": "^3.22.0", | ||
"less": "^3.12.2", | ||
"lint-staged": "^10.5.0", | ||
"lodash": "^4.17.0", | ||
"markdownlint-cli": "^0.25.0", | ||
"marked": "^1.2.0", | ||
"mitt": "^2.1.0", | ||
"parse5": "^6.0.0", | ||
"prettier": "^2.0.0", | ||
"prismjs": "^1.22.0", | ||
"remark": "^13.0.0", | ||
"resolve-bin": "^0.4.0", | ||
"rimraf": "^3.0.0", | ||
"stylelint": "^13.0.0", | ||
"stylelint-config-prettier": "^8.0.0", | ||
"stylelint-config-standard": "^20.0.0", | ||
"svgo": "^1.3.0", | ||
"ts-jest": "^26.4.0", | ||
"ts-node": "^9.1.0", | ||
"tslib": "^2.0.0", | ||
"typescript": "^4.1.0", | ||
"vite": "^v2.0.0-beta.2", | ||
"vue": "^3.0.5", | ||
"vue-jest": "^5.0.0-alpha.7", | ||
"vue-router": "^4.0.0", | ||
"vue-types": "^3.0.0", | ||
"yaml-front-matter": "^4.1.0" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "ls-lint && lint-staged", | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts,vue,json}": [ | ||
"prettier --write" | ||
], | ||
"*.{js,ts,vue}": [ | ||
"eslint --fix" | ||
], | ||
"*.less": [ | ||
"stylelint --fix" | ||
], | ||
"*.md": [ | ||
"markdownlint --fix" | ||
] | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
}, | ||
"engines": { | ||
"node": ">11.5.0" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts,vue,json}": [ | ||
"prettier --write" | ||
], | ||
"*.{js,ts,vue}": [ | ||
"eslint --fix" | ||
], | ||
"*.less": [ | ||
"stylelint --fix" | ||
], | ||
"*.md": [ | ||
"markdownlint --fix" | ||
] | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
}, | ||
"engines": { | ||
"node": ">11.5.0" | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/components/checkbox/__tests__/__snapshots__/checkbox.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Checkbox.vue render work 1`] = `"<label class=\\"ix-checkbox\\" role=\\"checkbox\\" aria-checked=\\"false\\" aria-disabled=\\"false\\"><span class=\\"ix-checkbox-input\\"><span class=\\"ix-checkbox-inner\\"></span><input type=\\"checkbox\\" class=\\"ix-checkbox-original-input\\" true-value=\\"true\\" false-value=\\"false\\"></span><!--v-if--></label>"`; |
3 changes: 3 additions & 0 deletions
3
packages/components/checkbox/__tests__/__snapshots__/checkboxGroup.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`CheckboxGroup.vue and Checkbox.vue render work 1`] = `"<div class=\\"ix-checkbox-group\\" role=\\"group\\" aria-label=\\"checkbox-group\\"><label class=\\"ix-checkbox\\" role=\\"checkbox\\" aria-checked=\\"false\\" aria-disabled=\\"false\\"><span class=\\"ix-checkbox-input\\"><span class=\\"ix-checkbox-inner\\"></span><input type=\\"checkbox\\" class=\\"ix-checkbox-original-input\\" value=\\"option1\\" true-value=\\"true\\" false-value=\\"false\\"></span><span class=\\"ix-checkbox-label\\"> 选项1 </span></label><label class=\\"ix-checkbox\\" role=\\"checkbox\\" aria-checked=\\"false\\" aria-disabled=\\"false\\"><span class=\\"ix-checkbox-input\\"><span class=\\"ix-checkbox-inner\\"></span><input type=\\"checkbox\\" class=\\"ix-checkbox-original-input\\" value=\\"option2\\" true-value=\\"true\\" false-value=\\"false\\"></span><span class=\\"ix-checkbox-label\\"> 选项2 </span></label><label class=\\"ix-checkbox\\" role=\\"checkbox\\" aria-checked=\\"false\\" aria-disabled=\\"false\\"><span class=\\"ix-checkbox-input\\"><span class=\\"ix-checkbox-inner\\"></span><input type=\\"checkbox\\" class=\\"ix-checkbox-original-input\\" value=\\"option3\\" true-value=\\"true\\" false-value=\\"false\\"></span><span class=\\"ix-checkbox-label\\"> 选项3 </span></label></div>"`; |
Oops, something went wrong.