├── .gitignore
├── .gitattributes
├── src
├── index.js
└── vue-loading-button.vue
├── LICENSE
├── examples
└── example.vue
├── package.json
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 | /dist/
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import component from "./vue-loading-button.vue";
2 |
3 | // install function executed by Vue.use()
4 | export function install(Vue) {
5 | if (install.installed) return;
6 | install.installed = true;
7 | Vue.component("VueLoadingButton", component);
8 | }
9 |
10 | // create module definition for Vue.use()
11 | const plugin = {
12 | install
13 | };
14 |
15 | // auto-install when vue is found
16 | let GlobalVue = null;
17 | if (typeof window !== "undefined") {
18 | GlobalVue = window.Vue;
19 | } else if (typeof global !== "undefined") {
20 | GlobalVue = global.Vue;
21 | }
22 | if (GlobalVue) {
23 | GlobalVue.use(plugin);
24 | }
25 |
26 | export default component;
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 William L
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, 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,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/examples/example.vue:
--------------------------------------------------------------------------------
1 |
2 |
53 | > Note: By default, this button component will apply minimal styles to enable you to easily add your own implementation-specific CSS. To enable the more opinionated styles seen at the top of this file, pass a `styled` prop as `true` to the button.
54 |
55 | ## Accessibility
56 |
57 | Apply attributes, such as aria-label, directly on the element to apply them to the button.
58 |
59 | ```html
60 |
61 |
62 |
63 | ```
64 |
65 | ## Dev
66 |
67 | Running example script requires @vue/cli and @vue/cli-service-global to be installed.
68 | Install globally by running `npm i --g @vue/cli @vue/cli-service-global` or `yarn add global vue/cli @vue/cli-service-global`.
69 |
70 | ## Contributing
71 |
72 | This project is open to and encourages contributions! Feel free to discuss any bug fixes/features in the [issues](https://github.com/shwilliam/vue-loading-button/issues). If you wish to work on this project:
73 |
74 | 1. [Fork the project](https://github.com/shwilliam/vue-loading-button/archive/master.zip)
75 | 2. Create your feature branch (`git checkout -b new-feature-branch`)
76 | 3. Commit your changes (`git commit -am 'add new feature'`)
77 | 4. Push to the branch (`git push origin new-feature-branch`)
78 | 5. [Submit a pull request!](https://github.com/shwilliam/vue-loading-button/pull/new/master)
79 |
--------------------------------------------------------------------------------
/src/vue-loading-button.vue:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
38 |
39 |
171 |
--------------------------------------------------------------------------------