From ebf998a83f8112e9e7146a8cfb176e3dd1acad77 Mon Sep 17 00:00:00 2001 From: xidedix Date: Tue, 22 May 2018 13:00:50 +0200 Subject: [PATCH] CoreUI-Vue v2 initial commit --- .babelrc | 17 + .commitlintrc.json | 5 + .editorconfig | 12 + .eslintignore | 5 + .eslintrc.js | 55 + .github/CODE_OF_CONDUCT.md | 46 + .github/COMMIT_CONVENTION.md | 83 + .github/CONTRIBUTING.md | 34 + .github/ISSUE_TEMPLATE.md | 20 + .github/PULL_REQUEST_TEMPLATE.md | 35 + .gitignore | 40 + .npmignore | 14 + .nvmrc | 1 + LICENSE.txt | 7 + README.md | 50 + jest.config.js | 18 + jest.setup.js | 3 + package-lock.json | 10810 ++++++++++++++++ package.json | 112 + rollup.config.js | 116 + src/__tests__/index.js | 35 + src/components/Aside/Aside.vue | 48 + src/components/Aside/AsideToggler.vue | 55 + src/components/Aside/index.js | 7 + src/components/Breadcrumb/Breadcrumb.vue | 34 + src/components/Callout/Callout.vue | 27 + src/components/Footer/Footer.vue | 41 + src/components/Header/Header.vue | 35 + src/components/Header/HeaderDropdown.vue | 33 + src/components/Header/index.js | 7 + src/components/Sidebar/Sidebar.vue | 25 + src/components/Sidebar/SidebarFooter.vue | 11 + src/components/Sidebar/SidebarForm.vue | 11 + src/components/Sidebar/SidebarHeader.vue | 11 + src/components/Sidebar/SidebarMinimizer.vue | 31 + src/components/Sidebar/SidebarNav.vue | 101 + src/components/Sidebar/SidebarNavDivider.vue | 26 + src/components/Sidebar/SidebarNavDropdown.vue | 47 + src/components/Sidebar/SidebarNavItem.vue | 35 + src/components/Sidebar/SidebarNavLabel.vue | 59 + src/components/Sidebar/SidebarNavLink.vue | 74 + src/components/Sidebar/SidebarNavTitle.vue | 42 + src/components/Sidebar/SidebarToggler.vue | 55 + src/components/Sidebar/index.js | 17 + src/components/Switch/Switch.vue | 142 + src/components/Switch/index.js | 3 + src/components/__tests__/Switch.js | 21 + .../__tests__/__snapshots__/.gitkeep | 0 src/components/index.js | 32 + src/index.js | 86 + src/index.umd.js | 8 + src/shared/classes.js | 21 + src/shared/toggle-classes.js | 6 + 53 files changed, 12669 insertions(+) create mode 100644 .babelrc create mode 100644 .commitlintrc.json create mode 100644 .editorconfig create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/COMMIT_CONVENTION.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 .nvmrc create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 jest.config.js create mode 100644 jest.setup.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 rollup.config.js create mode 100644 src/__tests__/index.js create mode 100644 src/components/Aside/Aside.vue create mode 100644 src/components/Aside/AsideToggler.vue create mode 100644 src/components/Aside/index.js create mode 100644 src/components/Breadcrumb/Breadcrumb.vue create mode 100644 src/components/Callout/Callout.vue create mode 100644 src/components/Footer/Footer.vue create mode 100644 src/components/Header/Header.vue create mode 100644 src/components/Header/HeaderDropdown.vue create mode 100644 src/components/Header/index.js create mode 100644 src/components/Sidebar/Sidebar.vue create mode 100644 src/components/Sidebar/SidebarFooter.vue create mode 100644 src/components/Sidebar/SidebarForm.vue create mode 100644 src/components/Sidebar/SidebarHeader.vue create mode 100644 src/components/Sidebar/SidebarMinimizer.vue create mode 100644 src/components/Sidebar/SidebarNav.vue create mode 100644 src/components/Sidebar/SidebarNavDivider.vue create mode 100644 src/components/Sidebar/SidebarNavDropdown.vue create mode 100644 src/components/Sidebar/SidebarNavItem.vue create mode 100644 src/components/Sidebar/SidebarNavLabel.vue create mode 100644 src/components/Sidebar/SidebarNavLink.vue create mode 100644 src/components/Sidebar/SidebarNavTitle.vue create mode 100644 src/components/Sidebar/SidebarToggler.vue create mode 100644 src/components/Sidebar/index.js create mode 100644 src/components/Switch/Switch.vue create mode 100644 src/components/Switch/index.js create mode 100644 src/components/__tests__/Switch.js create mode 100644 src/components/__tests__/__snapshots__/.gitkeep create mode 100644 src/components/index.js create mode 100644 src/index.js create mode 100644 src/index.umd.js create mode 100644 src/shared/classes.js create mode 100644 src/shared/toggle-classes.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..4fedfa53 --- /dev/null +++ b/.babelrc @@ -0,0 +1,17 @@ +{ + "presets": [ + ["vue-app", { + "modules": false + }] + ], + "plugins": [ + ["module-resolver", { + "extensions": [".js", ".vue", ".json"] + }] + ], + "env": { + "test": { + "plugins": ["dynamic-import-node"] + } + } +} \ No newline at end of file diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 00000000..0df1d253 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "@commitlint/config-conventional" + ] +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..4039ff11 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..502f12e7 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +.github/ +_book/ +docs/ +coverage/ +dist/ \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..64977756 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,55 @@ +// https://eslint.org/docs/user-guide/configuring + +module.exports = { + root: true, + parserOptions: { + parser: 'babel-eslint', + ecmaVersion: 2017, + sourceType: 'module' + }, + plugins: ['html', 'vue'], + extends: [ + 'eslint:recommended', + 'plugin:vue/recommended', + 'plugin:import/errors', + 'plugin:import/warnings' + ], + env: { + browser: true, + node: true, + commonjs: true, + es6: true, + jest: true + }, + rules: { + // allow async-await + 'generator-star-spacing': 'off', + // don't require .vue extension when importing + 'import/extensions': ['error', 'always', { + 'js': 'never', + 'vue': 'never' + }], + // disallow reassignment of function parameters + // disallow parameter object manipulation except for specific exclusions + 'no-param-reassign': ['error', { + props: true, + ignorePropertyModificationsFor: [ + 'state', // for vuex state + 'acc', // for reduce accumulators + 'e' // for e.returnvalue + ] + }], + // allow optionalDependencies + 'import/no-extraneous-dependencies': ['error', { + optionalDependencies: ['test/index.js'] + }], + // allow debugger during development + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' + }, + "settings": { + // resolve using plugin babel module resolver + "import/resolver": { + "babel-module": {} + } + } +} \ No newline at end of file diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..64da8777 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at . The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/.github/COMMIT_CONVENTION.md b/.github/COMMIT_CONVENTION.md new file mode 100644 index 00000000..fc436da5 --- /dev/null +++ b/.github/COMMIT_CONVENTION.md @@ -0,0 +1,83 @@ +## Git Commit Message Convention + +> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md). + +#### Examples + +Appears under "Features" header, `compiler` subheader: + +``` +feat(compiler): add 'comments' option +``` + +Appears under "Bug Fixes" header, `v-model` subheader, with a link to issue #28: + +``` +fix(v-model): handle events on blur + +close #28 +``` + +Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: + +``` +perf(core): improve vdom diffing by removing 'foo' option + +BREAKING CHANGE: The 'foo' option has been removed. +``` + +The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. + +``` +revert: feat(compiler): add 'comments' option + +This reverts commit 667ecc1654a317a13331b17617d973392f415f02. +``` + +### Full Message Format + +A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: + +``` +(): + + + +