@gorse/shards-vue 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/CHANGELOG.md +49 -0
- package/CONTRIBUTING.md +92 -0
- package/ISSUE_TEMPLATE.md +19 -0
- package/LICENSE +21 -0
- package/README.md +157 -0
- package/build/optimize.js +49 -0
- package/build/paths.js +12 -0
- package/build/rollup.config.js +106 -0
- package/dist/shards-vue.common.js +13994 -0
- package/dist/shards-vue.common.js.map +1 -0
- package/dist/shards-vue.common.min.js +1 -0
- package/dist/shards-vue.common.min.map +1 -0
- package/dist/shards-vue.esm.js +13990 -0
- package/dist/shards-vue.esm.js.map +1 -0
- package/dist/shards-vue.esm.min.js +1 -0
- package/dist/shards-vue.esm.min.map +1 -0
- package/dist/shards-vue.umd.js +13997 -0
- package/dist/shards-vue.umd.js.map +1 -0
- package/dist/shards-vue.umd.min.js +1 -0
- package/dist/shards-vue.umd.min.map +1 -0
- package/logo.jpg +0 -0
- package/package.json +121 -0
- package/sandbox/Sandbox.vue +45 -0
- package/src/components/alert/Alert.vue +156 -0
- package/src/components/alert/README.md +86 -0
- package/src/components/alert/index.js +17 -0
- package/src/components/badge/Badge.vue +62 -0
- package/src/components/badge/README.md +112 -0
- package/src/components/badge/index.js +17 -0
- package/src/components/breadcrumb/Breadcrumb.vue +55 -0
- package/src/components/breadcrumb/BreadcrumbItem.vue +42 -0
- package/src/components/breadcrumb/BreadcrumbLink.vue +56 -0
- package/src/components/breadcrumb/README.md +53 -0
- package/src/components/breadcrumb/index.js +23 -0
- package/src/components/button/Button.vue +107 -0
- package/src/components/button/ButtonClose.vue +47 -0
- package/src/components/button/README.md +197 -0
- package/src/components/button/index.js +21 -0
- package/src/components/button-group/ButtonGroup.vue +66 -0
- package/src/components/button-group/README.md +72 -0
- package/src/components/button-group/index.js +18 -0
- package/src/components/button-toolbar/ButtonToolbar.vue +29 -0
- package/src/components/button-toolbar/README.md +24 -0
- package/src/components/button-toolbar/index.js +18 -0
- package/src/components/card/Card.vue +57 -0
- package/src/components/card/CardBody.vue +92 -0
- package/src/components/card/CardFooter.vue +61 -0
- package/src/components/card/CardGroup.vue +47 -0
- package/src/components/card/CardHeader.vue +61 -0
- package/src/components/card/CardImg.vue +64 -0
- package/src/components/card/README.md +96 -0
- package/src/components/card/index.js +27 -0
- package/src/components/collapse/Collapse.vue +209 -0
- package/src/components/collapse/README.md +86 -0
- package/src/components/collapse/index.js +17 -0
- package/src/components/container/Col.vue +125 -0
- package/src/components/container/Container.vue +31 -0
- package/src/components/container/README.md +91 -0
- package/src/components/container/Row.vue +64 -0
- package/src/components/container/index.js +21 -0
- package/src/components/datepicker/Datepicker.vue +391 -0
- package/src/components/datepicker/README.md +185 -0
- package/src/components/datepicker/index.js +17 -0
- package/src/components/dropdown/Dropdown.vue +442 -0
- package/src/components/dropdown/DropdownDivider.vue +22 -0
- package/src/components/dropdown/DropdownHeader.vue +29 -0
- package/src/components/dropdown/DropdownItem.vue +25 -0
- package/src/components/dropdown/README.md +177 -0
- package/src/components/dropdown/index.js +23 -0
- package/src/components/embed/Embed.vue +47 -0
- package/src/components/embed/README.md +23 -0
- package/src/components/embed/index.js +17 -0
- package/src/components/form/Form.vue +40 -0
- package/src/components/form/FormFeedback.vue +39 -0
- package/src/components/form/FormInvalidFeedback.vue +39 -0
- package/src/components/form/FormRow.vue +21 -0
- package/src/components/form/FormText.vue +41 -0
- package/src/components/form/FormValidFeedback.vue +39 -0
- package/src/components/form/README.md +84 -0
- package/src/components/form/index.js +29 -0
- package/src/components/form-checkbox/FormCheckbox.vue +200 -0
- package/src/components/form-checkbox/README.md +131 -0
- package/src/components/form-checkbox/index.js +18 -0
- package/src/components/form-input/FormInput.vue +176 -0
- package/src/components/form-input/README.md +110 -0
- package/src/components/form-input/index.js +18 -0
- package/src/components/form-radio/FormRadio.vue +155 -0
- package/src/components/form-radio/README.md +61 -0
- package/src/components/form-radio/index.js +18 -0
- package/src/components/form-select/FormSelect.vue +246 -0
- package/src/components/form-select/README.md +180 -0
- package/src/components/form-select/index.js +18 -0
- package/src/components/form-textarea/FormTextarea.vue +250 -0
- package/src/components/form-textarea/README.md +74 -0
- package/src/components/form-textarea/index.js +18 -0
- package/src/components/image/Image.vue +123 -0
- package/src/components/image/README.md +32 -0
- package/src/components/image/index.js +18 -0
- package/src/components/index.js +63 -0
- package/src/components/input-group/InputGroup.vue +125 -0
- package/src/components/input-group/InputGroupAddon.vue +58 -0
- package/src/components/input-group/InputGroupText.vue +20 -0
- package/src/components/input-group/README.md +188 -0
- package/src/components/input-group/index.js +21 -0
- package/src/components/link/Link.vue +157 -0
- package/src/components/link/README.md +27 -0
- package/src/components/link/create-link-props.js +54 -0
- package/src/components/link/index.js +17 -0
- package/src/components/list-group/ListGroup.vue +30 -0
- package/src/components/list-group/ListGroupItem.vue +90 -0
- package/src/components/list-group/README.md +23 -0
- package/src/components/list-group/index.js +19 -0
- package/src/components/modal/Modal.vue +121 -0
- package/src/components/modal/ModalBody.vue +20 -0
- package/src/components/modal/ModalFooter.vue +21 -0
- package/src/components/modal/ModalHeader.vue +39 -0
- package/src/components/modal/ModalTitle.vue +21 -0
- package/src/components/modal/README.md +74 -0
- package/src/components/modal/index.js +25 -0
- package/src/components/nav/Nav.vue +62 -0
- package/src/components/nav/NavItem.vue +23 -0
- package/src/components/nav/NavText.vue +21 -0
- package/src/components/nav/README.md +94 -0
- package/src/components/nav/index.js +19 -0
- package/src/components/navbar/Navbar.vue +63 -0
- package/src/components/navbar/NavbarBrand.vue +41 -0
- package/src/components/navbar/NavbarNav.vue +38 -0
- package/src/components/navbar/NavbarToggle.vue +55 -0
- package/src/components/navbar/README.md +51 -0
- package/src/components/navbar/index.js +23 -0
- package/src/components/popover/Popover.vue +126 -0
- package/src/components/popover/README.md +73 -0
- package/src/components/popover/index.js +17 -0
- package/src/components/progress/Progress.vue +93 -0
- package/src/components/progress/ProgressBar.vue +123 -0
- package/src/components/progress/README.md +95 -0
- package/src/components/progress/index.js +19 -0
- package/src/components/slider/README.md +120 -0
- package/src/components/slider/Slider.vue +103 -0
- package/src/components/slider/index.js +17 -0
- package/src/components/tabs/README.md +111 -0
- package/src/components/tabs/Tab.vue +132 -0
- package/src/components/tabs/Tabs.vue +290 -0
- package/src/components/tabs/_TabButton.vue +130 -0
- package/src/components/tabs/index.js +19 -0
- package/src/components/tooltip/README.md +70 -0
- package/src/components/tooltip/Tooltip.vue +115 -0
- package/src/components/tooltip/index.js +17 -0
- package/src/directives/index.js +7 -0
- package/src/directives/toggle/index.js +16 -0
- package/src/directives/toggle/toggle.js +45 -0
- package/src/directives/tooltip/README.md +42 -0
- package/src/directives/tooltip/index.js +16 -0
- package/src/directives/tooltip/meta.json +5 -0
- package/src/directives/tooltip/tooltip.js +145 -0
- package/src/index.js +27 -0
- package/src/markdown/getting-started/README.md +80 -0
- package/src/markdown/getting-started/meta.json +4 -0
- package/src/markdown/roadmap/README.md +3 -0
- package/src/markdown/roadmap/meta.json +4 -0
- package/src/mixins/checkbox-radio.mixin.js +73 -0
- package/src/mixins/root-listener.mixin.js +32 -0
- package/src/mixins/tooltip-popover.mixin.js +292 -0
- package/src/scripts/utils.js +18 -0
- package/src/utils/constants.js +191 -0
- package/src/utils/events.js +48 -0
- package/src/utils/index.js +251 -0
- package/src/utils/observer.js +56 -0
- package/src/utils/popover.class.js +91 -0
- package/src/utils/target.js +50 -0
- package/src/utils/tooltip.class.js +60 -0
- package/src/utils/tpmanager.class.js +730 -0
package/.editorconfig
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
### 1.0.7 - (2019-01-20)
|
|
6
|
+
|
|
7
|
+
* fix(d-textarea): fix(d-textarea): dynamic height based on max-rows #12
|
|
8
|
+
|
|
9
|
+
### 1.0.6 - (2018-11-20)
|
|
10
|
+
|
|
11
|
+
* compat: fix IE11 conflict
|
|
12
|
+
* fix(d-form-checkbox): remove unnecessary `:checked` binding.
|
|
13
|
+
* fix(d-form-radio): remove unnecessary `:checked` binding.
|
|
14
|
+
|
|
15
|
+
### 1.0.5 - (2018-10-30)
|
|
16
|
+
|
|
17
|
+
* fix(d-link): exact/active classes not properly applied #10
|
|
18
|
+
* fix(d-dropdown): hide dropdown when link is clicked
|
|
19
|
+
|
|
20
|
+
### 1.0.4 - (2018-10-15)
|
|
21
|
+
|
|
22
|
+
* feature(d-datepicker): impr. highlighted dates, add small datepicker prop/modifier
|
|
23
|
+
* feature(d-progress): add size prop + docs
|
|
24
|
+
* fix(d-input): allow file inputs (temp)
|
|
25
|
+
* fix(d-datepicker): fix datepickers inside input groups
|
|
26
|
+
* fix(d-datepicker): fix highlighted colors
|
|
27
|
+
* fix(d-card): bind listeners to the card component
|
|
28
|
+
* fix: propagate link-specific props for d-dropdown-item
|
|
29
|
+
* fix: incorrect use of `.includes()` in `<d-list-group-item>`
|
|
30
|
+
* fix: computed `d-col` offset and order classes
|
|
31
|
+
* chore: update readme
|
|
32
|
+
|
|
33
|
+
### 1.0.3 - (2018-09-18)
|
|
34
|
+
|
|
35
|
+
* chore: update BS 4.1.3, Shards 2.1.0
|
|
36
|
+
* chore: update dist
|
|
37
|
+
|
|
38
|
+
### 1.0.2 - (2018-09-18)
|
|
39
|
+
|
|
40
|
+
* fix(alert): close button alert issues
|
|
41
|
+
* fix(d-link): invalid `to` prop binding
|
|
42
|
+
|
|
43
|
+
### 1.0.1 - (2018-09-12)
|
|
44
|
+
|
|
45
|
+
* Fixed linting errors.
|
|
46
|
+
|
|
47
|
+
### 1.0.0 - (2018-09-11)
|
|
48
|
+
|
|
49
|
+
* Initial release.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
When contributing to this repository, please first discuss the change you wish to make via issue,
|
|
4
|
+
email, or any other method with the owners of this repository before making a change.
|
|
5
|
+
|
|
6
|
+
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
|
7
|
+
|
|
8
|
+
## Pull Request Process
|
|
9
|
+
|
|
10
|
+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
|
|
11
|
+
build.
|
|
12
|
+
2. Update the README.md with details of changes to the interface, this includes new environment
|
|
13
|
+
variables, exposed ports, useful file locations and container parameters.
|
|
14
|
+
3. Increase the version numbers in any examples files and the README.md to the new version that this
|
|
15
|
+
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
|
|
16
|
+
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
|
|
17
|
+
do not have permission to do that, you may request the second reviewer to merge it for you.
|
|
18
|
+
|
|
19
|
+
## Code of Conduct
|
|
20
|
+
|
|
21
|
+
### Our Pledge
|
|
22
|
+
|
|
23
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
24
|
+
contributors and maintainers pledge to making participation in our project and
|
|
25
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
26
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
27
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
28
|
+
orientation.
|
|
29
|
+
|
|
30
|
+
### Our Standards
|
|
31
|
+
|
|
32
|
+
Examples of behavior that contributes to creating a positive environment
|
|
33
|
+
include:
|
|
34
|
+
|
|
35
|
+
* Using welcoming and inclusive language
|
|
36
|
+
* Being respectful of differing viewpoints and experiences
|
|
37
|
+
* Gracefully accepting constructive criticism
|
|
38
|
+
* Focusing on what is best for the community
|
|
39
|
+
* Showing empathy towards other community members
|
|
40
|
+
|
|
41
|
+
Examples of unacceptable behavior by participants include:
|
|
42
|
+
|
|
43
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
44
|
+
advances
|
|
45
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
46
|
+
* Public or private harassment
|
|
47
|
+
* Publishing others' private information, such as a physical or electronic
|
|
48
|
+
address, without explicit permission
|
|
49
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
50
|
+
professional setting
|
|
51
|
+
|
|
52
|
+
### Our Responsibilities
|
|
53
|
+
|
|
54
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
55
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
56
|
+
response to any instances of unacceptable behavior.
|
|
57
|
+
|
|
58
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
59
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
60
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
61
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
62
|
+
threatening, offensive, or harmful.
|
|
63
|
+
|
|
64
|
+
### Scope
|
|
65
|
+
|
|
66
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
67
|
+
when an individual is representing the project or its community. Examples of
|
|
68
|
+
representing a project or community include using an official project e-mail
|
|
69
|
+
address, posting via an official social media account, or acting as an appointed
|
|
70
|
+
representative at an online or offline event. Representation of a project may be
|
|
71
|
+
further defined and clarified by project maintainers.
|
|
72
|
+
|
|
73
|
+
### Enforcement
|
|
74
|
+
|
|
75
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
76
|
+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
|
77
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
78
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
79
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
80
|
+
Further details of specific enforcement policies may be posted separately.
|
|
81
|
+
|
|
82
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
83
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
84
|
+
members of the project's leadership.
|
|
85
|
+
|
|
86
|
+
### Attribution
|
|
87
|
+
|
|
88
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
89
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
90
|
+
|
|
91
|
+
[homepage]: http://contributor-covenant.org
|
|
92
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## Expected Behavior
|
|
2
|
+
<!--- Tell us what should happen -->
|
|
3
|
+
|
|
4
|
+
## Current Behavior
|
|
5
|
+
<!--- Tell us what happens instead of the expected behavior -->
|
|
6
|
+
|
|
7
|
+
## Steps to Reproduce
|
|
8
|
+
1.
|
|
9
|
+
2.
|
|
10
|
+
3.
|
|
11
|
+
|
|
12
|
+
## Context (Environment)
|
|
13
|
+
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
|
14
|
+
|
|
15
|
+
## Possible Solution
|
|
16
|
+
<!--- Not required, but suggest a fix/reason for the bug, -->
|
|
17
|
+
|
|
18
|
+
## Possible Implementation
|
|
19
|
+
<!--- Not required, but suggest an idea for implementing addition or change -->
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 DesignRevision
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="logo.jpg" width="230" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
Shards Vue is a free, beautiful and modern Vue.js UI kit <br /> based on <a href="https://github.com/designrevision/shards-ui">Shards</a>.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<br />
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="#">
|
|
13
|
+
<img src="https://img.shields.io/badge/License-MIT-brightgreen.svg" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://twitter.com/designrevision">
|
|
16
|
+
<img src="https://img.shields.io/twitter/follow/DesignRevision.svg?style=social&label=Follow" />
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<br />
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="https://designrevision.com/docs/shards-vue/"><strong>Documentation & Demo</strong></a> •
|
|
24
|
+
<a href="https://designrevision.com/downloads/shards-vue/"><strong>Official Page</strong></a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Getting Started
|
|
29
|
+
|
|
30
|
+
Getting started with Shards Vue is fairly simple. You can download Shards Vue via the official website, here on GitHub as a release package or by using a package manager such as pnpm, Yarn or npm.
|
|
31
|
+
|
|
32
|
+
* [Official Website](https://designrevision.com/download/shards-vue)
|
|
33
|
+
* [Release Package](https://github.com/DesignRevision/shards-vue/releases)
|
|
34
|
+
|
|
35
|
+
<br />
|
|
36
|
+
|
|
37
|
+
### Quick Start
|
|
38
|
+
|
|
39
|
+
You can install Shards Vue via pnpm, Yarn or npm.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
// Install via pnpm
|
|
43
|
+
pnpm add @gorse/shards-vue
|
|
44
|
+
|
|
45
|
+
// Install via Yarn
|
|
46
|
+
yarn add @gorse/shards-vue
|
|
47
|
+
|
|
48
|
+
// Install via npm
|
|
49
|
+
npm i @gorse/shards-vue
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
<br />
|
|
53
|
+
|
|
54
|
+
### Module Bundlers
|
|
55
|
+
|
|
56
|
+
If you are using a module bundler such as [Webpack](https://webpack.js.org/) or [Rollup](https://rollupjs.org/), you can include the entire Shards Vue library inside your project.
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
import Vue from 'vue'
|
|
60
|
+
import ShardsVue from '@gorse/shards-vue'
|
|
61
|
+
|
|
62
|
+
// Import base styles (Bootstrap and Shards)
|
|
63
|
+
import 'bootstrap/dist/css/bootstrap.css'
|
|
64
|
+
import '@gorse/shards-ui/dist/css/shards.css'
|
|
65
|
+
|
|
66
|
+
Vue.use(ShardsVue);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
<br />
|
|
70
|
+
|
|
71
|
+
### Registering Components as Vue Plugins
|
|
72
|
+
|
|
73
|
+
If you'd like to register only certain components as Vue plugins, make sure to import just the component you'd like to use.
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
import Vue from 'vue'
|
|
77
|
+
|
|
78
|
+
// Import base styles (Bootstrap and Shards)
|
|
79
|
+
import 'bootstrap/dist/css/bootstrap.css'
|
|
80
|
+
import '@gorse/shards-ui/dist/css/shards.css'
|
|
81
|
+
|
|
82
|
+
import { Button } from '@gorse/shards-vue/src/components'
|
|
83
|
+
Vue.use(Button)
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
<br />
|
|
88
|
+
|
|
89
|
+
### Importing Single File Components
|
|
90
|
+
|
|
91
|
+
Importing single file components is also possible.
|
|
92
|
+
|
|
93
|
+
```vue
|
|
94
|
+
<template>
|
|
95
|
+
<d-button @click="handleClick">Click Me!</d-button>
|
|
96
|
+
</template>
|
|
97
|
+
|
|
98
|
+
<script>
|
|
99
|
+
import dButton from '@gorse/shards-vue/src/components/button/Button'
|
|
100
|
+
|
|
101
|
+
export default {
|
|
102
|
+
components: {
|
|
103
|
+
dButton
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
handleClick() {
|
|
107
|
+
alert('You just clicked me!')
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
<br />
|
|
115
|
+
|
|
116
|
+
### File Sizes
|
|
117
|
+
|
|
118
|
+
You can also run `pnpm bundlesize` at any time to check the compiled file sizes.
|
|
119
|
+
|
|
120
|
+
| File Name | Size (min.gz) |
|
|
121
|
+
|--------------------------|---------------|
|
|
122
|
+
| shards-vue.common.min.js | 47.97KB |
|
|
123
|
+
| shards-vue.esm.min.js | 48.05KB |
|
|
124
|
+
| shards-vue.umd.min.js | 43.16KB |
|
|
125
|
+
|
|
126
|
+
<br />
|
|
127
|
+
|
|
128
|
+
### Built Using
|
|
129
|
+
|
|
130
|
+
* [Shards UI Kit](https://designrevision.com/downloads/shards/)
|
|
131
|
+
* [noUiSlider by Léon Gersen (WTFPL License)](https://refreshless.com/nouislider/download/)
|
|
132
|
+
* [vuejs-datepicker](https://github.com/charliekassel/vuejs-datepicker)
|
|
133
|
+
|
|
134
|
+
<br />
|
|
135
|
+
|
|
136
|
+
### Contributing
|
|
137
|
+
|
|
138
|
+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
|
|
139
|
+
|
|
140
|
+
If you'd like to fix a bug or work on a feature, make sure to follow the steps below in order to setup the development environment on your local machine:
|
|
141
|
+
|
|
142
|
+
1. Clone the repository.
|
|
143
|
+
2. Run `pnpm install` to install all required dependencies.
|
|
144
|
+
3. Run `pnpm watch` in order to kickstart the server and run the sandbox with hot reloading.
|
|
145
|
+
4. Refer to the `sandbox/Sandbox.vue` file for more details.
|
|
146
|
+
|
|
147
|
+
<br />
|
|
148
|
+
|
|
149
|
+
### Roadmap
|
|
150
|
+
|
|
151
|
+
[View the roadmap.](http://designrevision.com/docs/shards-vue/roadmap)
|
|
152
|
+
|
|
153
|
+
<br />
|
|
154
|
+
|
|
155
|
+
### Changelog
|
|
156
|
+
|
|
157
|
+
[View notable changes.](CHANGELOG.md)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const path = require('path')
|
|
4
|
+
const fs = require('fs')
|
|
5
|
+
const glob = require('glob')
|
|
6
|
+
const UglifyJS = require('uglify-js')
|
|
7
|
+
const UglifyES = require('uglify-es')
|
|
8
|
+
const PATHS = require('./paths')
|
|
9
|
+
|
|
10
|
+
function stripTrailingWhitespace(content) {
|
|
11
|
+
return content
|
|
12
|
+
.replace(/\r\n/g, '\n')
|
|
13
|
+
.replace(/\r/g, '\n')
|
|
14
|
+
.replace(/[ \t]+$/gm, '')
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
glob(path.resolve(PATHS.DIST + '/*.js'), {}, function(err, files) {
|
|
18
|
+
if (err) {
|
|
19
|
+
throw err
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
files.forEach(file => {
|
|
23
|
+
if (path.basename(file).indexOf('.min.js') !== -1) {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const Uglifier = path.basename(file).indexOf('.esm.js') !== -1
|
|
28
|
+
? UglifyES
|
|
29
|
+
: UglifyJS
|
|
30
|
+
|
|
31
|
+
// Define minified file path
|
|
32
|
+
let minFilePath = path.basename(file).replace('.js', '.min.js')
|
|
33
|
+
minFilePath = path.resolve(PATHS.DIST + '/' + minFilePath)
|
|
34
|
+
|
|
35
|
+
// Define minified file's map path
|
|
36
|
+
let minMapPath = path.basename(file).replace('.js', '.min.map')
|
|
37
|
+
minMapPath = path.resolve(PATHS.DIST + '/' + minMapPath)
|
|
38
|
+
|
|
39
|
+
// Minify
|
|
40
|
+
let _c = fs.readFileSync(file, 'utf8')
|
|
41
|
+
_c = stripTrailingWhitespace(_c)
|
|
42
|
+
fs.writeFileSync(file, _c)
|
|
43
|
+
_c = Uglifier.minify(_c, { mangle: true, compress: true, sourceMap: true })
|
|
44
|
+
|
|
45
|
+
// Write minified file and sourcemap
|
|
46
|
+
fs.writeFileSync(minFilePath, _c.code)
|
|
47
|
+
fs.writeFileSync(minMapPath, _c.map)
|
|
48
|
+
})
|
|
49
|
+
})
|
package/build/paths.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const path = require('path')
|
|
4
|
+
|
|
5
|
+
const PATHS = Object.create(null)
|
|
6
|
+
|
|
7
|
+
PATHS.BASE = path.resolve(__dirname, '..'),
|
|
8
|
+
PATHS.SRC = path.resolve(PATHS.BASE, 'src'),
|
|
9
|
+
PATHS.DIST = path.resolve(PATHS.BASE, 'dist')
|
|
10
|
+
PATHS.INPUT = path.resolve(PATHS.SRC, 'index.js')
|
|
11
|
+
|
|
12
|
+
module.exports = PATHS
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import path from 'path'
|
|
4
|
+
import fs from 'fs'
|
|
5
|
+
import { name as packageName, dependencies, version } from '../package.json'
|
|
6
|
+
|
|
7
|
+
import cleanCSS from 'clean-css'
|
|
8
|
+
import buble from 'rollup-plugin-buble'
|
|
9
|
+
import vuePlugin from 'rollup-plugin-vue'
|
|
10
|
+
import nodeResolve from 'rollup-plugin-node-resolve'
|
|
11
|
+
import commonjs from 'rollup-plugin-commonjs'
|
|
12
|
+
|
|
13
|
+
const PATHS = require('./paths')
|
|
14
|
+
|
|
15
|
+
const [major, minor] = process.versions.node.split('.').map(parseFloat)
|
|
16
|
+
if (major < 7 || (major === 7 && minor <= 5)) {
|
|
17
|
+
utils.logError('Node 7.6+ is required.')
|
|
18
|
+
process.exit()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Converts strings into camelCase
|
|
22
|
+
function camelize(str) {
|
|
23
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, index) {
|
|
24
|
+
if (+match === 0) {
|
|
25
|
+
return ''
|
|
26
|
+
}
|
|
27
|
+
return index == 0 ? match.toLowerCase() : match.toUpperCase()
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const year = new Date().getFullYear()
|
|
32
|
+
const bundleName = packageName.split('/').pop()
|
|
33
|
+
const banner = `/*
|
|
34
|
+
* Shards Vue v${version} (https://designrevision.com/downloads/shards-vue/)
|
|
35
|
+
* Based on: Bootstrap ${dependencies.bootstrap} (https://getbootstrap.com)
|
|
36
|
+
* Based on: Shards ${dependencies['@gorse/shards-ui']} (https://designrevision.com/downloads/shards/)
|
|
37
|
+
* Copyright 2017-${year} DesignRevision (https://designrevision.com)
|
|
38
|
+
* Copyright 2017-${year} Catalin Vasile (http://catalin.me)
|
|
39
|
+
*/`
|
|
40
|
+
|
|
41
|
+
const globals = {
|
|
42
|
+
bootstrap: 'bootstrap',
|
|
43
|
+
nouislider: 'noUiSlider',
|
|
44
|
+
'@gorse/shards-ui': 'Shards',
|
|
45
|
+
'vue-clickaway': 'vueClickaway',
|
|
46
|
+
'vuejs-datepicker': 'VueDatepicker'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = {
|
|
50
|
+
input: PATHS.INPUT,
|
|
51
|
+
external: Object.keys(dependencies).filter(dep => {
|
|
52
|
+
return ['popper.js', 'lodash.xor'].indexOf(dep) === -1
|
|
53
|
+
}),
|
|
54
|
+
plugins: [
|
|
55
|
+
vuePlugin({
|
|
56
|
+
compileTemplate: true,
|
|
57
|
+
style: {
|
|
58
|
+
preprocessOptions: {
|
|
59
|
+
scss: {
|
|
60
|
+
silenceDeprecations: ['legacy-js-api']
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
cssModules: {
|
|
65
|
+
generateScopedName: '[name]__[local]'
|
|
66
|
+
},
|
|
67
|
+
css(style) {
|
|
68
|
+
fs.writeFileSync(
|
|
69
|
+
path.resolve(PATHS.DIST, `${bundleName}.css`),
|
|
70
|
+
new cleanCSS().minify(style).styles
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
}),
|
|
74
|
+
nodeResolve({ external: ['vue'] }),
|
|
75
|
+
commonjs(),
|
|
76
|
+
buble({
|
|
77
|
+
objectAssign: 'Object.assign'
|
|
78
|
+
})
|
|
79
|
+
],
|
|
80
|
+
output: [
|
|
81
|
+
{
|
|
82
|
+
banner,
|
|
83
|
+
format: 'cjs',
|
|
84
|
+
name: camelize(bundleName),
|
|
85
|
+
file: path.resolve(PATHS.DIST, bundleName + '.common.js'),
|
|
86
|
+
sourcemap: true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
banner,
|
|
90
|
+
format: 'umd',
|
|
91
|
+
name: camelize(bundleName),
|
|
92
|
+
modulename: camelize(bundleName),
|
|
93
|
+
globals,
|
|
94
|
+
file: path.resolve(PATHS.DIST, bundleName + '.umd.js'),
|
|
95
|
+
sourcemap: true
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
banner,
|
|
99
|
+
format: 'es',
|
|
100
|
+
name: camelize(bundleName),
|
|
101
|
+
modulename: camelize(bundleName),
|
|
102
|
+
file: path.resolve(PATHS.DIST, bundleName + '.esm.js'),
|
|
103
|
+
sourcemap: true
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|