Skip to content

Commit

Permalink
feat(comp: checkbox): add checkbox component
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzaijiang committed Jan 25, 2021
1 parent b4f21c8 commit 799f949
Show file tree
Hide file tree
Showing 29 changed files with 1,463 additions and 406 deletions.
84 changes: 42 additions & 42 deletions jest.config.js
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>'],

testEnvironment: 'jsdom',
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.(t|j)sx?$': [
'babel-jest',
{
presets: [
[
'@babel/preset-env',
{
targets: {
node: true,
},
},
],
'@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'],
}
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>'],

testEnvironment: 'jsdom',
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.(t|j)sx?$': [
'babel-jest',
{
presets: [
[
'@babel/preset-env',
{
targets: {
node: true,
},
},
],
'@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'],
}
243 changes: 122 additions & 121 deletions package.json
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"
}
},
"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"
}
}
{
"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"
}
}
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\\" ariachecked=\\"false\\" ariadisabled=\\"false\\"><span class=\\"ix-checkbox-input-wrapper\\"><span class=\\"ix-checkbox-inner\\"></span><input type=\\"checkbox\\" class=\\"ix-checkbox-input\\" truevalue=\\"true\\" falsevalue=\\"false\\"></span><span class=\\"ix-checkbox-label\\">option</span></label>"`;
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\\" ariachecked=\\"false\\" ariadisabled=\\"false\\"><span class=\\"ix-checkbox-input-wrapper\\"><span class=\\"ix-checkbox-inner\\"></span><input type=\\"checkbox\\" class=\\"ix-checkbox-input\\" truevalue=\\"true\\" falsevalue=\\"false\\" value=\\"option1\\"></span><span class=\\"ix-checkbox-label\\"> option1 </span></label><label class=\\"ix-checkbox\\" role=\\"checkbox\\" ariachecked=\\"false\\" ariadisabled=\\"false\\"><span class=\\"ix-checkbox-input-wrapper\\"><span class=\\"ix-checkbox-inner\\"></span><input type=\\"checkbox\\" class=\\"ix-checkbox-input\\" truevalue=\\"true\\" falsevalue=\\"false\\" value=\\"option2\\"></span><span class=\\"ix-checkbox-label\\"> option2 </span></label><label class=\\"ix-checkbox\\" role=\\"checkbox\\" ariachecked=\\"false\\" ariadisabled=\\"false\\"><span class=\\"ix-checkbox-input-wrapper\\"><span class=\\"ix-checkbox-inner\\"></span><input type=\\"checkbox\\" class=\\"ix-checkbox-input\\" truevalue=\\"true\\" falsevalue=\\"false\\" value=\\"option3\\"></span><span class=\\"ix-checkbox-label\\"> option3 </span></label></div>"`;
Loading

0 comments on commit 799f949

Please sign in to comment.