@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
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Form Textarea
|
|
2
|
+
|
|
3
|
+
The `<d-form-textarea>` component allows you to create multi-line text inputs that adjusts its height (text rows) automatically to fit the content. You can also limit the number of rows displayed using the `max-rows` prop. If you'd like to force the textarea element to a fixed height, you can use both `rows` and `max-rows` props simultaneously.
|
|
4
|
+
|
|
5
|
+
## Alias
|
|
6
|
+
|
|
7
|
+
The `<d-form-textarea>` component is also available as `<d-textarea>`.
|
|
8
|
+
|
|
9
|
+
## Basic Example
|
|
10
|
+
|
|
11
|
+
:::demo
|
|
12
|
+
```html
|
|
13
|
+
<template>
|
|
14
|
+
<div>
|
|
15
|
+
<d-form-textarea v-model="text"
|
|
16
|
+
placeholder="Enter something"
|
|
17
|
+
:rows="3"
|
|
18
|
+
:max-rows="6">
|
|
19
|
+
</d-form-textarea>
|
|
20
|
+
<span v-if="text" class="d-block my-2">🤔 So you're saying: {{ text }}</span>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export default {
|
|
26
|
+
data () {
|
|
27
|
+
return {
|
|
28
|
+
text: ''
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<!-- textarea-1.vue -->
|
|
35
|
+
```
|
|
36
|
+
:::
|
|
37
|
+
|
|
38
|
+
## Validation
|
|
39
|
+
|
|
40
|
+
Using the `state` prop on the `<d-form-textarea>` component you can control the textarea's validation state.
|
|
41
|
+
|
|
42
|
+
The following textarea states are available:
|
|
43
|
+
|
|
44
|
+
* `invalid` when the textarea is invalid.
|
|
45
|
+
* `valid` when the use textarea is valid.
|
|
46
|
+
* `null` when the textarea should display no validation state (neutral).
|
|
47
|
+
|
|
48
|
+
:::demo
|
|
49
|
+
```html
|
|
50
|
+
<template>
|
|
51
|
+
<div>
|
|
52
|
+
<d-form-textarea state="valid"
|
|
53
|
+
v-model="text"
|
|
54
|
+
placeholder="You can start your novel right here..."
|
|
55
|
+
:rows="3"
|
|
56
|
+
:max-rows="6">
|
|
57
|
+
</d-form-textarea>
|
|
58
|
+
<span v-if="text" class="d-block my-2">🤔 So you're saying: {{ text }}</span>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<script>
|
|
63
|
+
export default {
|
|
64
|
+
data () {
|
|
65
|
+
return {
|
|
66
|
+
text: ''
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<!-- textarea-2.vue -->
|
|
73
|
+
```
|
|
74
|
+
:::
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { registerComponents, vueUse } from './../../utils'
|
|
2
|
+
|
|
3
|
+
import dFormTextarea from './FormTextarea.vue'
|
|
4
|
+
|
|
5
|
+
const components = {
|
|
6
|
+
dFormTextarea,
|
|
7
|
+
dTextarea: dFormTextarea
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const VuePlugin = {
|
|
11
|
+
install (Vue) {
|
|
12
|
+
registerComponents(Vue, components)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
vueUse(VuePlugin)
|
|
17
|
+
|
|
18
|
+
export default VuePlugin
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<img :src="src"
|
|
3
|
+
:alt="alt"
|
|
4
|
+
:width="computedWidth"
|
|
5
|
+
:height="computedHeight"
|
|
6
|
+
:class="[
|
|
7
|
+
thumbnail ? 'img-thumbnail' : '',
|
|
8
|
+
fluid || fluidGrow ? 'img-fluid' : '',
|
|
9
|
+
fluidGrow ? 'w-100' : '',
|
|
10
|
+
rounded ? 'rounded' : '',
|
|
11
|
+
center ? 'd-block' : '',
|
|
12
|
+
Boolean(computedAlign) ? computedAlign : '',
|
|
13
|
+
]"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
name: 'd-image',
|
|
20
|
+
props: {
|
|
21
|
+
/**
|
|
22
|
+
* The image source.
|
|
23
|
+
*/
|
|
24
|
+
src: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: null
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* The image alternative text.
|
|
30
|
+
*/
|
|
31
|
+
alt: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* The image width.
|
|
37
|
+
*/
|
|
38
|
+
width: {
|
|
39
|
+
type: [Number, String],
|
|
40
|
+
default: null
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* The image height.
|
|
44
|
+
*/
|
|
45
|
+
height: {
|
|
46
|
+
type: [Number, String],
|
|
47
|
+
default: null
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Whether the image should be fluid, or not.
|
|
51
|
+
*/
|
|
52
|
+
fluid: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Whether the image should take up the entire space (in width).
|
|
58
|
+
*/
|
|
59
|
+
fluidGrow: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* Whether the image should be rounded.
|
|
65
|
+
*/
|
|
66
|
+
rounded: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* Whether the image should be displayed as a thumbnail.
|
|
72
|
+
*/
|
|
73
|
+
thumbnail: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* Whether the image should be floated to the left.
|
|
79
|
+
*/
|
|
80
|
+
left: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Whether the image should be floated to the right.
|
|
86
|
+
*/
|
|
87
|
+
right: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* Whether the image should be centered.
|
|
93
|
+
*/
|
|
94
|
+
center: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
computed: {
|
|
100
|
+
computedWidth() {
|
|
101
|
+
return parseInt(this.width, 10) || null
|
|
102
|
+
},
|
|
103
|
+
computedHeight() {
|
|
104
|
+
return parseInt(this.height, 10) || null
|
|
105
|
+
},
|
|
106
|
+
computedAlign() {
|
|
107
|
+
if (this.center) {
|
|
108
|
+
return 'mx-auto'
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (this.left) {
|
|
112
|
+
return 'float-left'
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (this.right) {
|
|
116
|
+
return 'float-right'
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return null
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Images
|
|
2
|
+
|
|
3
|
+
The `<d-image>` component provides an easy way of adding responsive behavior to your images. Other than this, the component also provides easy-to-use handles for thumbnail styling, alignment and rounded images.
|
|
4
|
+
|
|
5
|
+
## Alias
|
|
6
|
+
|
|
7
|
+
The `<d-image>` component is also available as `<d-img>`.
|
|
8
|
+
|
|
9
|
+
## Basic Example
|
|
10
|
+
|
|
11
|
+
:::demo
|
|
12
|
+
```html
|
|
13
|
+
|
|
14
|
+
<d-img src="https://placeimg.com/640/380/any" fluid />
|
|
15
|
+
|
|
16
|
+
<!-- image-1.vue -->
|
|
17
|
+
```
|
|
18
|
+
:::
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Thumbnails
|
|
22
|
+
|
|
23
|
+
Using the `thumbnail` prop you can turn your images into thumbnails.
|
|
24
|
+
|
|
25
|
+
:::demo
|
|
26
|
+
```html
|
|
27
|
+
|
|
28
|
+
<d-img fluid thumbnail src="https://placeimg.com/200/200/any" />
|
|
29
|
+
|
|
30
|
+
<!-- image-2.vue -->
|
|
31
|
+
```
|
|
32
|
+
:::
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { registerComponents, vueUse } from '../../utils'
|
|
2
|
+
|
|
3
|
+
import dImg from './Image.vue'
|
|
4
|
+
|
|
5
|
+
const components = {
|
|
6
|
+
dImg,
|
|
7
|
+
dImage: dImg
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const VuePlugin = {
|
|
11
|
+
install (Vue) {
|
|
12
|
+
registerComponents(Vue, components)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
vueUse(VuePlugin)
|
|
17
|
+
|
|
18
|
+
export default VuePlugin
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Alert from './alert'
|
|
2
|
+
import Badge from './badge'
|
|
3
|
+
import Breadcrumb from './breadcrumb'
|
|
4
|
+
import Button from './button'
|
|
5
|
+
import ButtonGroup from './button-group'
|
|
6
|
+
import ButtonToolbar from './button-toolbar'
|
|
7
|
+
import Card from './card'
|
|
8
|
+
import Collapse from './collapse'
|
|
9
|
+
import Layout from './container'
|
|
10
|
+
import Datepicker from './datepicker'
|
|
11
|
+
import Dropdown from './dropdown'
|
|
12
|
+
import Embed from './embed'
|
|
13
|
+
import Form from './form'
|
|
14
|
+
import FormCheckbox from './form-checkbox'
|
|
15
|
+
import FormInput from './form-input'
|
|
16
|
+
import FormRadio from './form-radio'
|
|
17
|
+
import FormSelect from './form-select'
|
|
18
|
+
import FormTextarea from './form-textarea'
|
|
19
|
+
import Image from './image'
|
|
20
|
+
import InputGroup from './input-group'
|
|
21
|
+
import Link from './link'
|
|
22
|
+
import ListGroup from './list-group'
|
|
23
|
+
import Modal from './modal'
|
|
24
|
+
import Nav from './nav'
|
|
25
|
+
import Navbar from './navbar'
|
|
26
|
+
import Popover from './popover'
|
|
27
|
+
import Progress from './progress'
|
|
28
|
+
import Slider from './slider'
|
|
29
|
+
import Tabs from './tabs'
|
|
30
|
+
import Tooltip from './tooltip'
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
Alert,
|
|
34
|
+
Badge,
|
|
35
|
+
Breadcrumb,
|
|
36
|
+
Button,
|
|
37
|
+
ButtonGroup,
|
|
38
|
+
ButtonToolbar,
|
|
39
|
+
Card,
|
|
40
|
+
Collapse,
|
|
41
|
+
Layout,
|
|
42
|
+
Datepicker,
|
|
43
|
+
Dropdown,
|
|
44
|
+
Embed,
|
|
45
|
+
Form,
|
|
46
|
+
FormCheckbox,
|
|
47
|
+
FormInput,
|
|
48
|
+
FormRadio,
|
|
49
|
+
FormSelect,
|
|
50
|
+
FormTextarea,
|
|
51
|
+
Image,
|
|
52
|
+
InputGroup,
|
|
53
|
+
Link,
|
|
54
|
+
ListGroup,
|
|
55
|
+
Modal,
|
|
56
|
+
Nav,
|
|
57
|
+
Navbar,
|
|
58
|
+
Popover,
|
|
59
|
+
Progress,
|
|
60
|
+
Slider,
|
|
61
|
+
Tabs,
|
|
62
|
+
Tooltip,
|
|
63
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="tag"
|
|
3
|
+
role="group"
|
|
4
|
+
:id="id"
|
|
5
|
+
:class="[
|
|
6
|
+
'input-group',
|
|
7
|
+
this.size ? `input-group-${this.size}` : '',
|
|
8
|
+
this.seamless ? 'input-group-seamless' : ''
|
|
9
|
+
]">
|
|
10
|
+
<InputGroupAddon v-if="prependIsUsed" :prepend="Boolean(prepend || prependIsUsed)">
|
|
11
|
+
<InputGroupText v-if="Boolean(prepend)" v-html="prepend" />
|
|
12
|
+
<slot name="prepend" />
|
|
13
|
+
</InputGroupAddon>
|
|
14
|
+
<slot />
|
|
15
|
+
<InputGroupAddon v-if="appendIsUsed" :append="Boolean(append || appendIsUsed)">
|
|
16
|
+
<InputGroupText v-if="Boolean(append)" v-html="append" />
|
|
17
|
+
<slot name="append" />
|
|
18
|
+
</InputGroupAddon>
|
|
19
|
+
</component>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import InputGroupAddon from './InputGroupAddon.vue'
|
|
24
|
+
import InputGroupText from './InputGroupText.vue'
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'd-input-group',
|
|
28
|
+
components: {
|
|
29
|
+
InputGroupAddon,
|
|
30
|
+
InputGroupText
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
/**
|
|
34
|
+
* The element id.
|
|
35
|
+
*/
|
|
36
|
+
id: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: null
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* The input group size.
|
|
42
|
+
*/
|
|
43
|
+
size: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: null,
|
|
46
|
+
validator: v => ['sm', 'lg', null].includes(v)
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* The prepend value.
|
|
50
|
+
*/
|
|
51
|
+
prepend: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: null
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* The append value.
|
|
57
|
+
*/
|
|
58
|
+
append: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: null
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Whether it should be seamless, or not.
|
|
64
|
+
*/
|
|
65
|
+
seamless: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* The element tag.
|
|
71
|
+
*/
|
|
72
|
+
tag: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: 'div'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
computed: {
|
|
78
|
+
appendIsUsed() {
|
|
79
|
+
return !!this.$slots['append'] || this.append
|
|
80
|
+
},
|
|
81
|
+
prependIsUsed() {
|
|
82
|
+
return !!this.$slots['prepend'] || this.prepend
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<style>
|
|
89
|
+
.input-group input:focus {
|
|
90
|
+
position: relative;
|
|
91
|
+
z-index: 3;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Adjust dropdowns inside input groups. */
|
|
95
|
+
.input-group > .input-group-prepend > .d-dropdown > .btn {
|
|
96
|
+
border-top-right-radius: 0;
|
|
97
|
+
border-bottom-right-radius: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.input-group > .input-group-append > .d-dropdown > .btn {
|
|
101
|
+
border-top-left-radius: 0;
|
|
102
|
+
border-bottom-left-radius: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Datepickers */
|
|
106
|
+
.vdp-datepicker:not(:last-child) input {
|
|
107
|
+
border-top-right-radius: 0;
|
|
108
|
+
border-bottom-right-radius: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.vdp-datepicker:not(:first-child) input {
|
|
112
|
+
border-top-left-radius: 0;
|
|
113
|
+
border-bottom-left-radius: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.vdp-datepicker + .vdp-datepicker {
|
|
117
|
+
margin-left: -1px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.input-group-sm .vdp-datepicker input {
|
|
121
|
+
height: 1.9375rem;
|
|
122
|
+
font-size: 0.875rem;
|
|
123
|
+
line-height: 1.5;
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="tag"
|
|
3
|
+
:id="id"
|
|
4
|
+
:class="[ `input-group-${append ? 'append' : 'prepend'}` ]">
|
|
5
|
+
<InputGroupText v-if="isText">
|
|
6
|
+
<slot />
|
|
7
|
+
</InputGroupText>
|
|
8
|
+
<slot v-if="!isText" />
|
|
9
|
+
</component>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import InputGroupText from './InputGroupText.vue'
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: 'd-input-group-addon',
|
|
17
|
+
components: {
|
|
18
|
+
InputGroupText
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
/**
|
|
22
|
+
* The element ID.
|
|
23
|
+
*/
|
|
24
|
+
id: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: null
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* The element tag.
|
|
30
|
+
*/
|
|
31
|
+
tag: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'div'
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* The append value.
|
|
37
|
+
*/
|
|
38
|
+
append: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* The prepend value.
|
|
44
|
+
*/
|
|
45
|
+
prepend: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Whether is plain-text, or not.
|
|
51
|
+
*/
|
|
52
|
+
isText: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="tag" class="input-group-text">
|
|
3
|
+
<slot />
|
|
4
|
+
</component>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'd-input-group-text',
|
|
10
|
+
props: {
|
|
11
|
+
/**
|
|
12
|
+
* The element tag.
|
|
13
|
+
*/
|
|
14
|
+
tag: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'div'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|