@vcita/design-system 1.2.0 → 1.2.2
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/CHANGELOG.md +9 -0
- package/dist/@vcita/design-system.esm.js +1089 -918
- package/dist/@vcita/design-system.min.js +2 -2
- package/dist/@vcita/design-system.ssr.js +954 -815
- package/init/SvgIcons.js +1 -1
- package/package.json +1 -1
- package/src/components/.DS_Store +0 -0
- package/src/components/VcButton/VcButton.stories.js +23 -23
- package/src/components/VcChip/VcChip.stories.js +3 -2
- package/src/components/VcChipList/VcChipList.stories.js +34 -21
- package/src/components/VcDocItem/VcDocItem.spec.js +10 -0
- package/src/components/VcDocItem/VcDocItem.stories.js +3 -0
- package/src/components/VcDocItem/VcDocItem.vue +17 -5
- package/src/components/VcDocItem/mockData.js +3 -3
- package/src/components/VcIcon/VcIcon.stories.js +30 -7
- package/src/components/VcIcon/VcIcon.vue +11 -2
- package/src/components/VcMenu/.DS_Store +0 -0
- package/src/components/VcSideNav/VcSideNav.spec.js +105 -0
- package/src/components/VcSideNav/VcSideNav.stories.js +117 -0
- package/src/components/VcSideNav/VcSideNav.vue +136 -0
- package/src/components/VcTextField/VcTextField.stories.js +60 -101
- package/src/components/VcTextField/VcTextField.vue +4 -0
- package/src/components/index.js +1 -0
- package/src/components/list/VcList/pattern/VcMobilePickerPattern.stories.js +22 -8
- package/src/components/list/VcListEntity/VcListEntity.stories.js +14 -19
- package/src/components/modal/VcConfirmModal/VcConfirmModal.stories.js +73 -46
- package/src/components/modal/VcConfirmModal/VcConfirmModal.vue +12 -2
- package/src/components/modal/VcConfirmProminentModal/VcConfirmProminentModal.stories.js +6 -10
- package/src/components/modal/VcConfirmProminentModal/VcConfirmProminentModal.vue +5 -0
- package/src/components/modal/VcInputModal/VcInputModal.stories.js +47 -56
- package/src/components/modal/VcInputModal/VcInputModal.vue +2 -1
- package/src/components/modal/VcNoticeModal/VcNoticeModal.stories.js +36 -45
- package/src/components/modal/VcNoticeModal/VcNoticeModal.vue +5 -0
- package/src/components/modal/elements/VcModalContainer.stories.js +35 -12
- package/src/components/modal/elements/VcModalContainer.vue +8 -1
- package/src/components/modal/elements/VcModalFooter.stories.js +10 -6
- package/src/components/modal/elements/VcModalWrapper.stories.js +13 -6
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import VcSideNav from './VcSideNav';
|
|
2
|
+
import VcIcon from "@/components/VcIcon/VcIcon";
|
|
3
|
+
import VcBadge from "@/components/VcBadge/VcBadge";
|
|
4
|
+
import VcBaseDocs from "@/stories/VcBaseDocs.mdx";
|
|
5
|
+
|
|
6
|
+
const basicProps = {
|
|
7
|
+
navGroups: [
|
|
8
|
+
{
|
|
9
|
+
label: 'GROUP 1',
|
|
10
|
+
id: 1,
|
|
11
|
+
items: [
|
|
12
|
+
{id: '1', label: 'Menu Item'},
|
|
13
|
+
{id: '2', label: 'Menu Item'},
|
|
14
|
+
{id: '3', label: 'Menu Item'},
|
|
15
|
+
{id: '4', label: 'Menu Item'},
|
|
16
|
+
{id: '5', label: 'Menu Item', disabled: true},
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: 'GROUP 2',
|
|
21
|
+
id: 2,
|
|
22
|
+
items: [
|
|
23
|
+
{id: '6', label: 'Menu Item'},
|
|
24
|
+
{id: '7', label: 'Menu Item'},
|
|
25
|
+
{id: '8', label: 'Menu Item'},
|
|
26
|
+
{id: '9', label: 'Menu Item'},
|
|
27
|
+
{id: '10', label: 'Menu Item'},
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
dataQa: 'VcSideNav',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const Template = (args, {argTypes}) => ({
|
|
36
|
+
components: {VcSideNav: VcSideNav},
|
|
37
|
+
props: Object.keys(argTypes),
|
|
38
|
+
data: () => ({
|
|
39
|
+
selectedIdx: '1',
|
|
40
|
+
}),
|
|
41
|
+
template: `<div>
|
|
42
|
+
<VcSideNav :navGroups="navGroups" v-model="selectedIdx" @change="onChange">
|
|
43
|
+
</VcSideNav>
|
|
44
|
+
</div>`,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const Playground = Template.bind({});
|
|
48
|
+
|
|
49
|
+
Playground.args = {
|
|
50
|
+
...basicProps,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const UsingSlotsTemplate = (args, {argTypes}) => ({
|
|
54
|
+
components: {VcSideNav: VcSideNav, VcIcon: VcIcon, VcBadge: VcBadge},
|
|
55
|
+
props: Object.keys(argTypes),
|
|
56
|
+
data: () => ({
|
|
57
|
+
selectedIdx: '',
|
|
58
|
+
navGroupsData: [{id: 1, label: 'GROUP', items: [{id: '0', label: 'This is place holder'},{id: '1', label: 'This is place holder'}]}]
|
|
59
|
+
}),
|
|
60
|
+
template: `
|
|
61
|
+
<div>
|
|
62
|
+
<VcSideNav :navGroups="navGroupsData" v-model="selectedIdx" @change="onChange">
|
|
63
|
+
<template #group-1-header>
|
|
64
|
+
<div class="d-flex align-center">
|
|
65
|
+
<span>Group Title</span>
|
|
66
|
+
<VcBadge class="ps-2" badgeText="new" :offsetX="-2" :offsetY="0"></VcBadge>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<template #item-0>
|
|
70
|
+
<div class="d-flex align-center flex-grow-1 justify-space-between px-6">
|
|
71
|
+
<span>Slot Label</span>
|
|
72
|
+
<div class="d-flex align-center">
|
|
73
|
+
<vc-icon size="16" color="black" class="mx-3">$magnify_glass</vc-icon>
|
|
74
|
+
<vc-icon size="16" color="black" class="mx-3">$plus</vc-icon>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<template #item-1>
|
|
80
|
+
<div class="d-flex align-center flex-grow-1 justify-space-between px-6">
|
|
81
|
+
<div class="d-flex align-center">
|
|
82
|
+
<span>Slot Label </span>
|
|
83
|
+
<VcBadge class="ps-2" badgeText="beta" :offsetX="-2" :offsetY="4"></VcBadge>
|
|
84
|
+
</div>
|
|
85
|
+
<vc-icon size="16" color="black" class="mx-3">$plus</vc-icon>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
88
|
+
</VcSideNav>
|
|
89
|
+
</div>
|
|
90
|
+
`
|
|
91
|
+
})
|
|
92
|
+
export const UsingSlots = UsingSlotsTemplate.bind({});
|
|
93
|
+
|
|
94
|
+
UsingSlots.args = {}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
export default {
|
|
98
|
+
title: 'containers / VcSideNav',
|
|
99
|
+
component: VcSideNav,
|
|
100
|
+
id: 'VcSideNav',
|
|
101
|
+
argTypes: {
|
|
102
|
+
onChange: {action: 'change', table: {disable: true}},
|
|
103
|
+
|
|
104
|
+
},
|
|
105
|
+
parameters: {
|
|
106
|
+
design: {
|
|
107
|
+
type: 'figma',
|
|
108
|
+
url: 'https://www.figma.com/file/xIOY6fBoA1wpy1tHv3i5js/vcita---ui-library?node-id=11638%3A241955',
|
|
109
|
+
},
|
|
110
|
+
status: {
|
|
111
|
+
type: 'stable', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
|
|
112
|
+
},
|
|
113
|
+
docs: {
|
|
114
|
+
page: VcBaseDocs,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:data-qa="dataQa" class="side-nav d-flex flex-column">
|
|
4
|
+
<div class="side-nav__group"
|
|
5
|
+
v-for="group in navGroups"
|
|
6
|
+
:key="group.id"
|
|
7
|
+
:data-qa="group.id">
|
|
8
|
+
<div class="side-nav__group__header mb-2" >
|
|
9
|
+
<slot :name="`group-${group.id}-header`">
|
|
10
|
+
{{group.label}}
|
|
11
|
+
</slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="side-nav__group__container d-flex flex-column mb-5">
|
|
14
|
+
<div @click="$emit('change',item.id)"
|
|
15
|
+
:data-qa="`item-${item.id}`"
|
|
16
|
+
v-if="group.items"
|
|
17
|
+
v-for="(item) in group.items"
|
|
18
|
+
:key="item.id"
|
|
19
|
+
:class="{selected: item.id === selected, disabled: item.disabled, mobile: isMobile, 'rtl': $vuetify.rtl}"
|
|
20
|
+
class="side-nav__group__container__menu-item d-flex align-center flex-grow-1">
|
|
21
|
+
<slot :name="`item-${item.id}`" :item="item">
|
|
22
|
+
<div class="d-flex justify-space-between px-4 align-center flex-grow-1">
|
|
23
|
+
<span>{{item.label}}</span>
|
|
24
|
+
<vcIcon size="12" v-if="isMobile">$chevron_right</vcIcon>
|
|
25
|
+
</div>
|
|
26
|
+
</slot>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
<script>
|
|
33
|
+
import VcIcon from "@/components/VcIcon/VcIcon.vue";
|
|
34
|
+
export default {
|
|
35
|
+
name: "VcSideNav",
|
|
36
|
+
components: {VcIcon},
|
|
37
|
+
props: {
|
|
38
|
+
dataQa: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'VcSideNav'
|
|
41
|
+
},
|
|
42
|
+
selected: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
navGroups: {
|
|
47
|
+
type: Array,
|
|
48
|
+
validator: prop => prop.every((group) => group.label && group.id)
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
model: {
|
|
52
|
+
prop: 'selected',
|
|
53
|
+
event: 'change'
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
isMobile(){
|
|
57
|
+
return !this.$vuetify.breakpoint.mdAndUp
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss" scoped>
|
|
64
|
+
.side-nav{
|
|
65
|
+
&__group{
|
|
66
|
+
&__header{
|
|
67
|
+
font-size: var(--font-size-xx-small);
|
|
68
|
+
font-weight: var(--font-weight-large);
|
|
69
|
+
line-height: var(--size-value5);
|
|
70
|
+
color: var(--gray-darken-2);
|
|
71
|
+
}
|
|
72
|
+
&__container{
|
|
73
|
+
border-radius: var(--border-radius);
|
|
74
|
+
background-color: var(--modal-bg-color);
|
|
75
|
+
box-shadow: var(--shadow-1);
|
|
76
|
+
&__menu-item{
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
height: var(--size-value11);
|
|
80
|
+
font-weight: var(--font-weight-medium2);
|
|
81
|
+
font-size: var(--font-size-x-small);
|
|
82
|
+
border-inline-start: 3px solid var(--modal-bg-color);
|
|
83
|
+
transition: 0.3s;
|
|
84
|
+
transition-property: border-color, background-color;
|
|
85
|
+
&:first-of-type{
|
|
86
|
+
margin-top: var(--size-value1);
|
|
87
|
+
}
|
|
88
|
+
&:last-of-type{
|
|
89
|
+
margin-bottom: var(--size-value1);
|
|
90
|
+
}
|
|
91
|
+
&:hover{
|
|
92
|
+
border-color: var(--gray-lighten-3);
|
|
93
|
+
background-color: var(--gray-lighten-3);
|
|
94
|
+
}
|
|
95
|
+
&:focus{
|
|
96
|
+
border: 3px solid var(--v-secondary-lighten1);
|
|
97
|
+
}
|
|
98
|
+
&:active:not(.mobile){
|
|
99
|
+
border-color: var(--gray-lighten-1);
|
|
100
|
+
background-color: var(--gray-lighten-1);
|
|
101
|
+
}
|
|
102
|
+
&.selected{
|
|
103
|
+
font-weight: var(--font-weight-large);
|
|
104
|
+
}
|
|
105
|
+
&.selected:not(.mobile){
|
|
106
|
+
border-inline-start: 3px solid var(--v-secondary-base);
|
|
107
|
+
}
|
|
108
|
+
&.disabled{
|
|
109
|
+
cursor: unset;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
border-color: var(--gray-lighten-3);
|
|
112
|
+
background-color: var(--gray-lighten-3);
|
|
113
|
+
color: var(--gray-darken-2);
|
|
114
|
+
}
|
|
115
|
+
&.mobile{
|
|
116
|
+
color: var(--gray-darken-5);
|
|
117
|
+
height: var(--size-value13);
|
|
118
|
+
::v-deep{
|
|
119
|
+
svg.vc-chevron-right {
|
|
120
|
+
fill: var(--gray-darken-2);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
&.rtl{
|
|
124
|
+
::v-deep{
|
|
125
|
+
svg.vc-chevron-right {
|
|
126
|
+
-webkit-transform: scaleX(-1);
|
|
127
|
+
transform: scaleX(-1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
</style>
|
|
@@ -2,6 +2,32 @@ import VcTextFieldCmp from './VcTextField';
|
|
|
2
2
|
import icons from "../../../init/SvgIcons";
|
|
3
3
|
import VcBaseDocs from "@/stories/VcBaseDocs.mdx";
|
|
4
4
|
|
|
5
|
+
const baseProps = {
|
|
6
|
+
label: "Label",
|
|
7
|
+
type: 'text',
|
|
8
|
+
placeholder: '',
|
|
9
|
+
value: '',
|
|
10
|
+
maxlength: 100,
|
|
11
|
+
hint: '',
|
|
12
|
+
counter: false,
|
|
13
|
+
disabled: false,
|
|
14
|
+
appendIcon: '',
|
|
15
|
+
rules: [],
|
|
16
|
+
tooltipContent: '',
|
|
17
|
+
tooltipHeader: '',
|
|
18
|
+
tooltipNudgeLeft: 0,
|
|
19
|
+
tooltipNudgeRight: 0,
|
|
20
|
+
prefix: '',
|
|
21
|
+
errorMessages: '',
|
|
22
|
+
dataQa: 'vc-text-field',
|
|
23
|
+
hideDetails: 'auto',
|
|
24
|
+
persistentHint: true,
|
|
25
|
+
singleLine: false,
|
|
26
|
+
readonly: false,
|
|
27
|
+
googleAddressAutoComplete: false,
|
|
28
|
+
googleAddressCountryOptions: []
|
|
29
|
+
}
|
|
30
|
+
|
|
5
31
|
const TextFieldTemplate = (args, {argTypes}) => ({
|
|
6
32
|
components: {VcTextField: VcTextFieldCmp},
|
|
7
33
|
props: Object.keys(argTypes),
|
|
@@ -12,7 +38,7 @@ const TextFieldTemplate = (args, {argTypes}) => ({
|
|
|
12
38
|
},
|
|
13
39
|
template: `
|
|
14
40
|
<v-layout column>
|
|
15
|
-
|
|
41
|
+
${args.description}
|
|
16
42
|
<VcTextField :value="value"
|
|
17
43
|
:maxlength="maxlength"
|
|
18
44
|
:hint="hint"
|
|
@@ -34,6 +60,8 @@ const TextFieldTemplate = (args, {argTypes}) => ({
|
|
|
34
60
|
:persistent-hint="persistentHint"
|
|
35
61
|
:single-line="singleLine"
|
|
36
62
|
:readonly="readonly"
|
|
63
|
+
:google-address-auto-complete="googleAddressAutoComplete"
|
|
64
|
+
:google-address-country-options="googleAddressCountryOptions"
|
|
37
65
|
@click="onClick"
|
|
38
66
|
@input="onInput"/>
|
|
39
67
|
</v-layout>`,
|
|
@@ -41,86 +69,44 @@ const TextFieldTemplate = (args, {argTypes}) => ({
|
|
|
41
69
|
|
|
42
70
|
export const Playground = TextFieldTemplate.bind({});
|
|
43
71
|
Playground.args = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
placeholder: 'Placeholder',
|
|
47
|
-
value: '',
|
|
48
|
-
maxlength: 10,
|
|
49
|
-
hint: 'Hint',
|
|
50
|
-
counter: true,
|
|
51
|
-
disabled: false,
|
|
52
|
-
appendIcon: '',
|
|
53
|
-
rules: [],
|
|
54
|
-
tooltipContent: 'Tooltip content',
|
|
55
|
-
tooltipHeader: 'Tooltip header',
|
|
56
|
-
tooltipNudgeLeft: 0,
|
|
57
|
-
tooltipNudgeRight: 0,
|
|
58
|
-
prefix: '',
|
|
59
|
-
errorMessages: '',
|
|
60
|
-
dataQa: 'vc-text-field',
|
|
61
|
-
hideDetails: 'auto',
|
|
62
|
-
persistentHint: true,
|
|
63
|
-
singleLine: false,
|
|
64
|
-
readonly: false,
|
|
72
|
+
...baseProps,
|
|
73
|
+
description: 'In the case of using the append icon make sure there is no tooltip content that will override the slot'
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
export const Prefix = TextFieldTemplate.bind({});
|
|
68
77
|
Prefix.args = {
|
|
69
|
-
|
|
70
|
-
type: 'text',
|
|
78
|
+
...baseProps,
|
|
71
79
|
prefix: '$'
|
|
72
80
|
}
|
|
73
81
|
|
|
74
82
|
export const Placeholder = TextFieldTemplate.bind({});
|
|
75
83
|
Placeholder.args = {
|
|
76
|
-
|
|
84
|
+
...baseProps,
|
|
77
85
|
placeholder: "Placeholder Text"
|
|
78
86
|
}
|
|
79
87
|
|
|
80
|
-
const
|
|
81
|
-
components: {VcTextField: VcTextFieldCmp},
|
|
82
|
-
props: Object.keys(argTypes),
|
|
83
|
-
template: `<div><br/><br/><br/><br/><br/><br/><br/>
|
|
84
|
-
<VcTextField :value="value"
|
|
85
|
-
:maxlength="maxlength"
|
|
86
|
-
:hint="hint"
|
|
87
|
-
:counter="counter"
|
|
88
|
-
:disabled="disabled"
|
|
89
|
-
:rules="rules"
|
|
90
|
-
:label="label"
|
|
91
|
-
:type="type"
|
|
92
|
-
:placeholder="placeholder"
|
|
93
|
-
:tooltip-content="tooltipContent"
|
|
94
|
-
:tooltip-header="tooltipHeader"
|
|
95
|
-
:tooltip-nudge-left="tooltipNudgeLeft"
|
|
96
|
-
:tooltip-nudge-right="tooltipNudgeRight"
|
|
97
|
-
@input="onInput"/></div>`,
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
export const Tooltip = TooltipTemplate.bind({});
|
|
88
|
+
export const Tooltip = TextFieldTemplate.bind({});
|
|
101
89
|
Tooltip.args = {
|
|
102
|
-
|
|
90
|
+
...baseProps,
|
|
103
91
|
tooltipHeader: "tooltipHeader",
|
|
104
92
|
tooltipContent: "tooltipContent"
|
|
105
93
|
}
|
|
106
94
|
|
|
107
95
|
export const Disabled = TextFieldTemplate.bind({});
|
|
108
96
|
Disabled.args = {
|
|
109
|
-
|
|
110
|
-
type: 'text',
|
|
97
|
+
...baseProps,
|
|
111
98
|
disabled: true
|
|
112
99
|
}
|
|
113
100
|
export const Hint = TextFieldTemplate.bind({});
|
|
114
101
|
Hint.args = {
|
|
115
|
-
|
|
116
|
-
type: 'text',
|
|
102
|
+
...baseProps,
|
|
117
103
|
hint: "Help text"
|
|
118
104
|
}
|
|
119
105
|
|
|
120
106
|
export const ErrorRules = TextFieldTemplate.bind({});
|
|
121
107
|
ErrorRules.args = {
|
|
108
|
+
...baseProps,
|
|
122
109
|
label: "Email",
|
|
123
|
-
type: 'text',
|
|
124
110
|
rules: [value => !!value || 'Required.', value => {
|
|
125
111
|
const pattern = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
126
112
|
return pattern.test(value) || 'Invalid e-mail.'
|
|
@@ -129,53 +115,29 @@ ErrorRules.args = {
|
|
|
129
115
|
|
|
130
116
|
export const ErrorMessage = TextFieldTemplate.bind({});
|
|
131
117
|
ErrorMessage.args = {
|
|
132
|
-
|
|
133
|
-
type: 'text',
|
|
118
|
+
...baseProps,
|
|
134
119
|
errorMessages: 'Error message'
|
|
135
120
|
}
|
|
136
121
|
|
|
137
122
|
export const Counter = TextFieldTemplate.bind({});
|
|
138
123
|
Counter.args = {
|
|
124
|
+
...baseProps,
|
|
139
125
|
label: "Email",
|
|
140
|
-
|
|
141
|
-
counter: true,
|
|
142
|
-
maxlength: 100
|
|
126
|
+
counter: true
|
|
143
127
|
}
|
|
144
128
|
|
|
145
|
-
const
|
|
146
|
-
components: {VcTextField: VcTextFieldCmp},
|
|
147
|
-
props: Object.keys(argTypes),
|
|
148
|
-
template: `<div>
|
|
149
|
-
<p>To use Google Address Auto Complete, you must have a Google API key.</p>
|
|
150
|
-
<p>Vue.prototype.$ds = {options: {googleAppKey: 'Google_API_Key'}};</p>
|
|
151
|
-
<VcTextField :value="value"
|
|
152
|
-
:maxlength="maxlength"
|
|
153
|
-
:hint="hint"
|
|
154
|
-
:counter="counter"
|
|
155
|
-
:disabled="disabled"
|
|
156
|
-
:rules="rules"
|
|
157
|
-
:label="label"
|
|
158
|
-
:type="type"
|
|
159
|
-
:placeholder="placeholder"
|
|
160
|
-
:tooltip-content="tooltipContent"
|
|
161
|
-
:tooltip-header="tooltipHeader"
|
|
162
|
-
:google-address-auto-complete="googleAddressAutoComplete"
|
|
163
|
-
:google-address-country-options="googleAddressCountryOptions"
|
|
164
|
-
@input="onInput"
|
|
165
|
-
@onPlaceSelected="onPlaceSelected"/>
|
|
166
|
-
</div>`,
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
export const GoogleAddressAutocomplete = GoogleAutoCompleteTemplate.bind({});
|
|
129
|
+
export const GoogleAddressAutocomplete = TextFieldTemplate.bind({});
|
|
170
130
|
GoogleAddressAutocomplete.args = {
|
|
131
|
+
...baseProps,
|
|
171
132
|
label: "Address",
|
|
172
|
-
type: 'text',
|
|
173
133
|
googleAddressAutoComplete: true,
|
|
174
134
|
googleAddressCountryOptions: ['us'],
|
|
175
135
|
tooltipHeader: "header",
|
|
176
136
|
tooltipContent: "content",
|
|
177
137
|
hint: "hint",
|
|
178
|
-
placeholder: "placeholder"
|
|
138
|
+
placeholder: "placeholder",
|
|
139
|
+
description: `<p>To use Google Address Auto Complete, you must have a Google API key.</p>
|
|
140
|
+
<p>Vue.prototype.$ds = {options: {googleAppKey: 'Google_API_Key'}};</p>`
|
|
179
141
|
}
|
|
180
142
|
|
|
181
143
|
export default {
|
|
@@ -187,27 +149,23 @@ export default {
|
|
|
187
149
|
options: ['number', 'text', 'search'],
|
|
188
150
|
control: {type: 'radio'}
|
|
189
151
|
},
|
|
190
|
-
disabled: {
|
|
191
|
-
options: [true, false],
|
|
192
|
-
control: {type: 'boolean'}
|
|
193
|
-
},
|
|
194
|
-
counter: {
|
|
195
|
-
options: [true, false],
|
|
196
|
-
control: {type: 'boolean'}
|
|
197
|
-
},
|
|
198
|
-
maxlength: {
|
|
199
|
-
control: {type: 'number'}
|
|
200
|
-
},
|
|
201
|
-
value: {
|
|
202
|
-
control: {type: 'text'}
|
|
203
|
-
},
|
|
204
|
-
googleAddressAutoComplete: {
|
|
205
|
-
control: {type: 'boolean'}
|
|
206
|
-
},
|
|
207
152
|
appendIcon: {
|
|
208
153
|
options: Object.keys(icons),
|
|
209
154
|
control: {type: 'select'}
|
|
210
155
|
},
|
|
156
|
+
counter: {table: {category: 'counter'}},
|
|
157
|
+
maxlength: {table: {category: 'counter'}},
|
|
158
|
+
rules: {table: {category: 'error'}},
|
|
159
|
+
hint: {table: {category: 'hint'}},
|
|
160
|
+
persistentHint: {table: {category: 'hint'}},
|
|
161
|
+
errorMessages: {table: {category: 'error'}},
|
|
162
|
+
tooltipContent: {table: {category: 'tooltip'}},
|
|
163
|
+
tooltipHeader: {table: {category: 'tooltip'}},
|
|
164
|
+
tooltipNudgeLeft: {table: {category: 'tooltip'}},
|
|
165
|
+
tooltipNudgeRight: {table: {category: 'tooltip'}},
|
|
166
|
+
googleAddressAutoComplete: {table: {category: 'google address'}},
|
|
167
|
+
googleAddressCountryOptions: {table: {category: 'google address'}},
|
|
168
|
+
description: {table: {disable: true}},
|
|
211
169
|
onInput: {action: 'input', table: {disable: true}},
|
|
212
170
|
onClick: {action: 'click', table: {disable: true}},
|
|
213
171
|
},
|
|
@@ -222,6 +180,7 @@ export default {
|
|
|
222
180
|
},
|
|
223
181
|
docs: {
|
|
224
182
|
page: VcBaseDocs,
|
|
183
|
+
inlineStories: false, // Opt-out of inline rendering
|
|
225
184
|
},
|
|
226
185
|
},
|
|
227
186
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-text-field class="VcTextInput"
|
|
3
3
|
dense
|
|
4
|
+
:class="{'no-label': !label}"
|
|
4
5
|
:data-qa="dataQa"
|
|
5
6
|
:label="label"
|
|
6
7
|
:placeholder="placeholder"
|
|
@@ -311,6 +312,9 @@ export default {
|
|
|
311
312
|
.v-text-field__slot {
|
|
312
313
|
margin-bottom: -14px;
|
|
313
314
|
}
|
|
315
|
+
&.no-label .v-text-field__slot {
|
|
316
|
+
margin-bottom: unset;
|
|
317
|
+
}
|
|
314
318
|
}
|
|
315
319
|
|
|
316
320
|
&.v-input--is-disabled {
|
package/src/components/index.js
CHANGED
|
@@ -64,3 +64,4 @@ export {default as VcTimeSince} from './VcTimeSince/VcTimeSince.vue';
|
|
|
64
64
|
export {default as VcSearchPicker} from './VcSearchPicker/VcSearchPicker.vue';
|
|
65
65
|
export {default as VcDraggableList} from './VcDraggableList/VcDraggableList.vue';
|
|
66
66
|
export {default as VcTabs} from './VcTabs/VcTabs.vue';
|
|
67
|
+
export {default as VcSideNav} from './VcSideNav/VcSideNav.vue';
|
|
@@ -247,8 +247,8 @@ MobileSingleSelectPickerWithAvatars.parameters = {
|
|
|
247
247
|
readonly
|
|
248
248
|
append-icon="$chevron_right"
|
|
249
249
|
@click="showDialog = true">
|
|
250
|
-
<template #prepend-inner>
|
|
251
|
-
[
|
|
250
|
+
<template #prepend-inner="data">
|
|
251
|
+
[1. implement selected item]
|
|
252
252
|
</template>
|
|
253
253
|
</VcTextField>
|
|
254
254
|
|
|
@@ -261,21 +261,30 @@ MobileSingleSelectPickerWithAvatars.parameters = {
|
|
|
261
261
|
@search="onSearch"
|
|
262
262
|
style="margin-bottom: 16px"/>
|
|
263
263
|
<VcList :items="items"
|
|
264
|
-
:image-path="[
|
|
264
|
+
:image-path="[2. (optional) - pass empty state image]"
|
|
265
265
|
:empty-list-msg="$t('your.emptyListMsg.here')"
|
|
266
266
|
@select="onSelect">
|
|
267
|
-
<template #default="
|
|
268
|
-
[
|
|
267
|
+
<template #default="data">
|
|
268
|
+
[3. your list item implementation]
|
|
269
269
|
</template>
|
|
270
270
|
</VcList>
|
|
271
271
|
</template>
|
|
272
272
|
</VcInputModal>
|
|
273
273
|
</template>
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
TODO: - to get this code running you need to
|
|
277
|
+
1. Implement selected item - display the current selected item
|
|
278
|
+
2. Optional - pass empty state image, or you can delete this line
|
|
279
|
+
3. Your list item implementation - display each item on the list
|
|
280
|
+
4. YourPageHere - declare the name of your page
|
|
281
|
+
5. YourStoreModule - map the items data to the store (the don't have to be called "items")
|
|
282
|
+
*/
|
|
274
283
|
|
|
275
284
|
import {mapGetters} from "vuex";
|
|
276
285
|
|
|
277
286
|
export default {
|
|
278
|
-
name: "[YourPageHere]",
|
|
287
|
+
name: "[4. YourPageHere]",
|
|
279
288
|
data() {
|
|
280
289
|
return {
|
|
281
290
|
showDialog: false,
|
|
@@ -284,7 +293,7 @@ MobileSingleSelectPickerWithAvatars.parameters = {
|
|
|
284
293
|
};
|
|
285
294
|
},
|
|
286
295
|
computed: {
|
|
287
|
-
...mapGetters("[
|
|
296
|
+
...mapGetters("[5. YourStoreModule]", ["items"]),
|
|
288
297
|
},
|
|
289
298
|
methods: {
|
|
290
299
|
onSearch(search) {
|
|
@@ -295,7 +304,12 @@ MobileSingleSelectPickerWithAvatars.parameters = {
|
|
|
295
304
|
// Handle any other reaction to selection change
|
|
296
305
|
},
|
|
297
306
|
},
|
|
298
|
-
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
<style lang="scss" scoped>
|
|
310
|
+
// Your css here
|
|
311
|
+
</style>
|
|
312
|
+
`,
|
|
299
313
|
type: "auto",
|
|
300
314
|
},
|
|
301
315
|
},
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import VcListEntityCmp from './VcListEntity.vue';
|
|
2
2
|
import VcBaseDocs from "@/stories/VcBaseDocs.mdx";
|
|
3
3
|
|
|
4
|
+
const baseProps = {
|
|
5
|
+
disabled: false,
|
|
6
|
+
value: false,
|
|
7
|
+
title: 'text for <b>storybook</b>',
|
|
8
|
+
dataQa: 'VcListEntity',
|
|
9
|
+
};
|
|
10
|
+
|
|
4
11
|
const Template = (args, {argTypes}) => ({
|
|
5
12
|
components: {VcListEntity: VcListEntityCmp},
|
|
6
13
|
props: Object.keys(argTypes),
|
|
@@ -10,6 +17,7 @@ const Template = (args, {argTypes}) => ({
|
|
|
10
17
|
template: `
|
|
11
18
|
<div>
|
|
12
19
|
<VcListEntity :disabled="disabled" v-model="itemValue" :value="itemValue" :title="title"
|
|
20
|
+
:data-qa="dataQa"
|
|
13
21
|
@input="onInput"></VcListEntity>
|
|
14
22
|
</div>`,
|
|
15
23
|
watch: {
|
|
@@ -23,27 +31,15 @@ export const Playground = Template.bind({});
|
|
|
23
31
|
|
|
24
32
|
// Set default values
|
|
25
33
|
Playground.args = {
|
|
26
|
-
|
|
27
|
-
value: false,
|
|
28
|
-
title: 'text to <b>storybook</b>'
|
|
34
|
+
...baseProps,
|
|
29
35
|
}
|
|
30
36
|
|
|
31
|
-
const
|
|
32
|
-
components: {VcListEntity: VcListEntityCmp},
|
|
33
|
-
props: Object.keys(argTypes),
|
|
34
|
-
data: () => ({
|
|
35
|
-
itemValue: true,
|
|
36
|
-
}),
|
|
37
|
-
template: '<div><VcListEntity :disabled="disabled" :value="itemValue" :title="title" /></div>',
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
export const Disabled = TemplateDisabled.bind({});
|
|
37
|
+
export const Disabled = Template.bind({});
|
|
41
38
|
|
|
42
39
|
// Set default values
|
|
43
40
|
Disabled.args = {
|
|
41
|
+
...baseProps,
|
|
44
42
|
disabled: true,
|
|
45
|
-
value: false,
|
|
46
|
-
title: 'text to <b>storybook</b>'
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
const TemplateWithSlot = (args, {argTypes}) => ({
|
|
@@ -54,7 +50,8 @@ const TemplateWithSlot = (args, {argTypes}) => ({
|
|
|
54
50
|
}),
|
|
55
51
|
template: `
|
|
56
52
|
<div>
|
|
57
|
-
<VcListEntity :disabled="disabled" :value="itemValue" :title="title"
|
|
53
|
+
<VcListEntity :disabled="disabled" :value="itemValue" :title="title" :data-qa="dataQa"
|
|
54
|
+
@input="onInput">
|
|
58
55
|
<template v-slot:icon>
|
|
59
56
|
<v-icon size="12">home</v-icon>
|
|
60
57
|
</template>
|
|
@@ -66,9 +63,7 @@ export const WithSlot = TemplateWithSlot.bind({});
|
|
|
66
63
|
|
|
67
64
|
// Set default values
|
|
68
65
|
WithSlot.args = {
|
|
69
|
-
|
|
70
|
-
value: false,
|
|
71
|
-
title: 'text to <b>storybook</b>'
|
|
66
|
+
...baseProps,
|
|
72
67
|
}
|
|
73
68
|
|
|
74
69
|
|