@weni/unnnic-system 3.12.3-alpha-teleports.1 → 3.12.3-alpha.1
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/dist/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +81 -2
- package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
- package/dist/components/Input/BaseInput.vue.d.ts +22 -0
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +81 -2
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +52 -1
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputNext/InputNext.vue.d.ts +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +81 -2
- package/dist/components/MultiSelect/MultSelectOption.vue.d.ts +17 -0
- package/dist/components/MultiSelect/MultSelectOption.vue.d.ts.map +1 -0
- package/dist/components/MultiSelect/index.vue.d.ts +44 -0
- package/dist/components/MultiSelect/index.vue.d.ts.map +1 -0
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/Select/index.vue.d.ts +44 -0
- package/dist/components/Select/index.vue.d.ts.map +1 -0
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +52 -1
- package/dist/components/SelectTime/index.vue.d.ts +52 -1
- package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +23720 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverOption.vue.d.ts +18 -0
- package/dist/components/ui/popover/PopoverOption.vue.d.ts.map +1 -0
- package/dist/components/ui/popover/index.d.ts +1 -0
- package/dist/components/ui/popover/index.d.ts.map +1 -1
- package/dist/{es-4aa88754.mjs → es-239c29c2.mjs} +1 -1
- package/dist/{index-ec96f88a.mjs → index-40e176e4.mjs} +9498 -9233
- package/dist/lib/layer-manager.d.ts.map +1 -1
- package/dist/locales/en.json.d.ts +2 -1
- package/dist/locales/es.json.d.ts +2 -1
- package/dist/locales/pt_br.json.d.ts +2 -1
- package/dist/{pt-br-ec1ec185.mjs → pt-br-5004a35e.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +176 -172
- package/dist/unnnic.umd.js +33 -33
- package/package.json +1 -1
- package/src/assets/scss/scheme-colors.scss +223 -223
- package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +1 -2
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +60 -61
- package/src/components/Checkbox/Checkbox.vue +9 -3
- package/src/components/CheckboxGroup/CheckboxGroup.vue +7 -5
- package/src/components/Chip/Chip.vue +1 -1
- package/src/components/Drawer/Drawer.vue +20 -9
- package/src/components/Drawer/__tests__/Drawer.spec.js +11 -9
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +9 -9
- package/src/components/FormElement/FormElement.vue +96 -87
- package/src/components/Input/BaseInput.vue +21 -2
- package/src/components/Input/Input.scss +2 -3
- package/src/components/Input/Input.vue +21 -3
- package/src/components/Input/TextInput.vue +58 -22
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +5 -1
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +7 -1
- package/src/components/ModalDialog/ModalDialog.vue +2 -2
- package/src/components/MultiSelect/MultSelectOption.vue +49 -0
- package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +556 -0
- package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +229 -0
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +81 -0
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +51 -0
- package/src/components/MultiSelect/index.vue +224 -0
- package/src/components/Radio/Radio.vue +12 -6
- package/src/components/Radio/__test__/Radio.spec.js +3 -1
- package/src/components/RadioGroup/RadioGroup.vue +18 -10
- package/src/components/Select/__tests__/Select.spec.js +422 -0
- package/src/components/Select/__tests__/SelectItem.spec.js +330 -0
- package/src/components/Select/__tests__/__snapshots__/Popover.spec.js.snap +8 -0
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +65 -0
- package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +15 -0
- package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +25 -0
- package/src/components/Select/__tests__/__snapshots__/SelectPopover.spec.js.snap +8 -0
- package/src/components/Select/index.vue +261 -0
- package/src/components/Switch/Switch.vue +10 -3
- package/src/components/TemplatePreview/TemplatePreview.vue +28 -25
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +10 -10
- package/src/components/TemplatePreview/types.d.ts +3 -3
- package/src/components/Toast/Toast.vue +12 -8
- package/src/components/index.ts +7 -7
- package/src/components/ui/dialog/DialogClose.vue +3 -3
- package/src/components/ui/drawer/DrawerClose.vue +9 -3
- package/src/components/ui/popover/PopoverOption.vue +4 -0
- package/src/lib/layer-manager.ts +12 -20
- package/src/locales/en.json +2 -1
- package/src/locales/es.json +2 -1
- package/src/locales/pt_br.json +2 -1
- package/src/stories/MultiSelect.stories.js +142 -46
- package/src/stories/Select.stories.js +158 -0
- package/src/stories/TemplatePreview.stories.js +27 -27
- package/src/stories/TemplatePreviewModal.stories.js +31 -31
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +0 -163
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts.map +0 -1
- package/src/components/MultiSelect/MultiSelect.vue +0 -297
package/src/locales/en.json
CHANGED
package/src/locales/es.json
CHANGED
package/src/locales/pt_br.json
CHANGED
|
@@ -1,62 +1,158 @@
|
|
|
1
|
-
import UnnnicMultiSelect from '../components/MultiSelect/
|
|
1
|
+
import UnnnicMultiSelect from '../components/MultiSelect/index.vue';
|
|
2
|
+
|
|
3
|
+
const options = [
|
|
4
|
+
{ label: 'Option 1', value: 'option1', altValue: 'alt_value_option1' },
|
|
5
|
+
{ label: 'Option 2', value: 'option2', altValue: 'alt_value_option2' },
|
|
6
|
+
{ label: 'Option 3', value: 'option3', altValue: 'alt_value_option3' },
|
|
7
|
+
{ label: 'Option 4', value: 'option4', altValue: 'alt_value_option4' },
|
|
8
|
+
{ label: 'Option 5', value: 'option5', altValue: 'alt_value_option5' },
|
|
9
|
+
{ label: 'Option 6', value: 'option6', altValue: 'alt_value_option6' },
|
|
10
|
+
{ label: 'Option 7', value: 'option7', altValue: 'alt_value_option7' },
|
|
11
|
+
{ label: 'Option 8', value: 'option8', altValue: 'alt_value_option8' },
|
|
12
|
+
{ label: 'Option 9', value: 'option9', altValue: 'alt_value_option9' },
|
|
13
|
+
{ label: 'Option 10', value: 'option10', disabled: true },
|
|
14
|
+
];
|
|
2
15
|
|
|
3
16
|
export default {
|
|
4
17
|
title: 'Form/MultiSelect',
|
|
5
18
|
component: UnnnicMultiSelect,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
tags: ['autodocs'],
|
|
20
|
+
parameters: {
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
component:
|
|
24
|
+
'MultiSelect is designed to solve common problems related to multiple option selection.',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
options: {
|
|
30
|
+
description:
|
|
31
|
+
'List of items to be displayed in the options. If an item has a `disabled` key set to `true`, that item will be disabled. By default, the component looks for the `label` and `value` keys to display and update the model, but these are not required if you wish to customize them using the `itemLabel` and `itemValue` props, respectively.',
|
|
32
|
+
},
|
|
33
|
+
placeholder: {
|
|
34
|
+
description: 'Text to be displayed in the placeholder.',
|
|
35
|
+
},
|
|
36
|
+
label: {
|
|
37
|
+
description: 'Text to be displayed in the label.',
|
|
38
|
+
},
|
|
39
|
+
modelValue: {
|
|
40
|
+
description:
|
|
41
|
+
'Model variable. Its type will always match a list of the return type of the key specified by `itemValue`, or the entire options object when the `returnObject` property is set to `true`.',
|
|
42
|
+
},
|
|
43
|
+
returnObject: {
|
|
44
|
+
description:
|
|
45
|
+
'Prop to indicate that the full option object should be returned in the v-model.',
|
|
46
|
+
},
|
|
47
|
+
itemLabel: {
|
|
48
|
+
description:
|
|
49
|
+
'Field of the option item that should be used to render the option label.',
|
|
50
|
+
},
|
|
51
|
+
itemValue: {
|
|
52
|
+
description:
|
|
53
|
+
'Field of the option item that should be used to return value to v-model.',
|
|
54
|
+
},
|
|
55
|
+
type: {
|
|
56
|
+
description: 'Select state type',
|
|
57
|
+
},
|
|
58
|
+
errors: {
|
|
59
|
+
description:
|
|
60
|
+
"Error message or messages. When it's an array, the messages will be separated by commas.",
|
|
61
|
+
},
|
|
62
|
+
message: {
|
|
63
|
+
description: 'Help or hint message.',
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
description: 'Select size',
|
|
67
|
+
},
|
|
68
|
+
optionsLines: {
|
|
69
|
+
description:
|
|
70
|
+
'Number of options to display at most; if exceeded, scrolling will be enabled.',
|
|
71
|
+
},
|
|
72
|
+
enableSearch: {
|
|
73
|
+
description:
|
|
74
|
+
'If true, enables a search field displayed inside the options popover. The `update:search` event is emitted on each input.',
|
|
75
|
+
},
|
|
76
|
+
search: {
|
|
77
|
+
description: 'Search value.',
|
|
10
78
|
},
|
|
79
|
+
locale: {
|
|
80
|
+
description: 'Locale for i18n translations.',
|
|
81
|
+
},
|
|
82
|
+
disabled: {
|
|
83
|
+
description: 'Disable the select.',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
render: (args) => ({
|
|
87
|
+
components: { UnnnicMultiSelect },
|
|
11
88
|
setup() {
|
|
12
|
-
|
|
89
|
+
const handleSearch = (value) => {
|
|
90
|
+
args.search = value;
|
|
91
|
+
};
|
|
92
|
+
return { args, handleSearch };
|
|
13
93
|
},
|
|
14
94
|
data() {
|
|
15
95
|
return {
|
|
16
|
-
|
|
17
|
-
{
|
|
18
|
-
title: 'Permissões Gerais',
|
|
19
|
-
selected: 0,
|
|
20
|
-
items: [
|
|
21
|
-
{
|
|
22
|
-
title: 'Moderador',
|
|
23
|
-
description:
|
|
24
|
-
'Gerencia membros do projeto e administra o rocket',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
title: 'Contribuidor',
|
|
28
|
-
description: 'Consegue editar o projeto',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
title: 'Vizualizador',
|
|
32
|
-
description: 'Apenas vizualiza o projeto',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
title: 'Permissões do módulo chat',
|
|
38
|
-
selected: 0,
|
|
39
|
-
items: [
|
|
40
|
-
{
|
|
41
|
-
title: 'Gerente de Atendimento',
|
|
42
|
-
description:
|
|
43
|
-
'Consegue responder mensagens e criar grupos no Rocket',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
title: 'Agente',
|
|
47
|
-
description: 'Consegue responder mensagens no Rocket',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
],
|
|
96
|
+
exampleValue: [],
|
|
52
97
|
};
|
|
53
98
|
},
|
|
54
99
|
template: `
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
</div>
|
|
100
|
+
<p>modelValue: {{ exampleValue }}</p>
|
|
101
|
+
<unnnic-multi-select v-model="exampleValue" v-bind="args" @update:search="handleSearch" />
|
|
58
102
|
`,
|
|
59
103
|
}),
|
|
60
104
|
};
|
|
61
105
|
|
|
62
|
-
export const
|
|
106
|
+
export const Default = {
|
|
107
|
+
args: {
|
|
108
|
+
placeholder: 'Placeholder',
|
|
109
|
+
label: 'Label',
|
|
110
|
+
options,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const ReturnObject = {
|
|
115
|
+
args: {
|
|
116
|
+
returnObject: true,
|
|
117
|
+
placeholder: 'Placeholder',
|
|
118
|
+
label: 'Label',
|
|
119
|
+
options,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const AlternativeValueKey = {
|
|
124
|
+
args: {
|
|
125
|
+
itemValue: 'altValue',
|
|
126
|
+
placeholder: 'Placeholder',
|
|
127
|
+
label: 'Label',
|
|
128
|
+
options,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const AlternativeValueLabel = {
|
|
133
|
+
args: {
|
|
134
|
+
itemLabel: 'altValue',
|
|
135
|
+
placeholder: 'Placeholder',
|
|
136
|
+
label: 'Label',
|
|
137
|
+
options,
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const Disabled = {
|
|
142
|
+
args: {
|
|
143
|
+
placeholder: 'Placeholder',
|
|
144
|
+
label: 'Label',
|
|
145
|
+
options,
|
|
146
|
+
disabled: true,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const WithSearch = {
|
|
151
|
+
args: {
|
|
152
|
+
placeholder: 'Placeholder',
|
|
153
|
+
label: 'Label',
|
|
154
|
+
options,
|
|
155
|
+
enableSearch: true,
|
|
156
|
+
search: '',
|
|
157
|
+
},
|
|
158
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import UnnnicSelect from '../components/Select/index.vue';
|
|
2
|
+
|
|
3
|
+
const options = [
|
|
4
|
+
{ label: 'Option 1', value: 'option1', altValue: 'alt_value_option1' },
|
|
5
|
+
{ label: 'Option 2', value: 'option2', altValue: 'alt_value_option2' },
|
|
6
|
+
{ label: 'Option 3', value: 'option3', altValue: 'alt_value_option3' },
|
|
7
|
+
{ label: 'Option 4', value: 'option4', altValue: 'alt_value_option4' },
|
|
8
|
+
{ label: 'Option 5', value: 'option5', altValue: 'alt_value_option5' },
|
|
9
|
+
{ label: 'Option 6', value: 'option6', altValue: 'alt_value_option6' },
|
|
10
|
+
{ label: 'Option 7', value: 'option7', altValue: 'alt_value_option7' },
|
|
11
|
+
{ label: 'Option 8', value: 'option8', altValue: 'alt_value_option8' },
|
|
12
|
+
{ label: 'Option 9', value: 'option9', altValue: 'alt_value_option9' },
|
|
13
|
+
{ label: 'Option 10', value: 'option10', disabled: true },
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Form/Select',
|
|
18
|
+
component: UnnnicSelect,
|
|
19
|
+
tags: ['autodocs'],
|
|
20
|
+
parameters: {
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
component:
|
|
24
|
+
'Select is designed to solve common problems related to option selection.',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
options: {
|
|
30
|
+
description:
|
|
31
|
+
'List of items to be displayed in the options. If an item has a `disabled` key set to `true`, that item will be disabled. By default, the component looks for the `label` and `value` keys to display and update the model, but these are not required if you wish to customize them using the `itemLabel` and `itemValue` props, respectively.',
|
|
32
|
+
},
|
|
33
|
+
placeholder: {
|
|
34
|
+
description: 'Text to be displayed in the placeholder.',
|
|
35
|
+
},
|
|
36
|
+
label: {
|
|
37
|
+
description: 'Text to be displayed in the label.',
|
|
38
|
+
},
|
|
39
|
+
modelValue: {
|
|
40
|
+
description:
|
|
41
|
+
'Model variable. Its type will always match the return type of the key specified by `itemValue`, or the entire options object when `returnObject` prop is set to `true`.',
|
|
42
|
+
},
|
|
43
|
+
returnObject: {
|
|
44
|
+
description:
|
|
45
|
+
'Prop to indicate that the full option object should be returned in the v-model.',
|
|
46
|
+
},
|
|
47
|
+
itemLabel: {
|
|
48
|
+
description:
|
|
49
|
+
'Field of the option item that should be used to render the option label.',
|
|
50
|
+
},
|
|
51
|
+
itemValue: {
|
|
52
|
+
description:
|
|
53
|
+
'Field of the option item that should be used to return value to v-model.',
|
|
54
|
+
},
|
|
55
|
+
type: {
|
|
56
|
+
description: 'Select state type',
|
|
57
|
+
},
|
|
58
|
+
errors: {
|
|
59
|
+
description:
|
|
60
|
+
"Error message or messages. When it's an array, the messages will be separated by commas.",
|
|
61
|
+
},
|
|
62
|
+
message: {
|
|
63
|
+
description: 'Help or hint message.',
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
description: 'Select size',
|
|
67
|
+
},
|
|
68
|
+
optionsLines: {
|
|
69
|
+
description:
|
|
70
|
+
'Number of options to display at most; if exceeded, scrolling will be enabled.',
|
|
71
|
+
},
|
|
72
|
+
enableSearch: {
|
|
73
|
+
description:
|
|
74
|
+
'If true, enables a search field displayed inside the options popover. The `update:search` event is emitted on each input.',
|
|
75
|
+
},
|
|
76
|
+
search: {
|
|
77
|
+
description: 'Search value.',
|
|
78
|
+
},
|
|
79
|
+
locale: {
|
|
80
|
+
description: 'Locale for i18n translations.',
|
|
81
|
+
},
|
|
82
|
+
disabled: {
|
|
83
|
+
description: 'Disable the select.',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
render: (args) => ({
|
|
87
|
+
components: { UnnnicSelect },
|
|
88
|
+
setup() {
|
|
89
|
+
const handleSearch = (value) => {
|
|
90
|
+
args.search = value;
|
|
91
|
+
};
|
|
92
|
+
return { args, handleSearch };
|
|
93
|
+
},
|
|
94
|
+
data() {
|
|
95
|
+
return {
|
|
96
|
+
exampleValue: null,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
template: `
|
|
100
|
+
<p>modelValue: {{ exampleValue }}</p>
|
|
101
|
+
<unnnic-select v-model="exampleValue" v-bind="args" @update:search="handleSearch" />
|
|
102
|
+
`,
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const Default = {
|
|
107
|
+
args: {
|
|
108
|
+
placeholder: 'Placeholder',
|
|
109
|
+
label: 'Label',
|
|
110
|
+
options,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const ReturnObject = {
|
|
115
|
+
args: {
|
|
116
|
+
returnObject: true,
|
|
117
|
+
placeholder: 'Placeholder',
|
|
118
|
+
label: 'Label',
|
|
119
|
+
options,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const AlternativeValueKey = {
|
|
124
|
+
args: {
|
|
125
|
+
itemValue: 'altValue',
|
|
126
|
+
placeholder: 'Placeholder',
|
|
127
|
+
label: 'Label',
|
|
128
|
+
options,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const AlternativeValueLabel = {
|
|
133
|
+
args: {
|
|
134
|
+
itemLabel: 'altValue',
|
|
135
|
+
placeholder: 'Placeholder',
|
|
136
|
+
label: 'Label',
|
|
137
|
+
options,
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const Disabled = {
|
|
142
|
+
args: {
|
|
143
|
+
placeholder: 'Placeholder',
|
|
144
|
+
label: 'Label',
|
|
145
|
+
options,
|
|
146
|
+
disabled: true,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const WithSearch = {
|
|
151
|
+
args: {
|
|
152
|
+
placeholder: 'Placeholder',
|
|
153
|
+
label: 'Label',
|
|
154
|
+
options,
|
|
155
|
+
enableSearch: true,
|
|
156
|
+
search: '',
|
|
157
|
+
},
|
|
158
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import UnnnicTemplatePreview from
|
|
1
|
+
import UnnnicTemplatePreview from '../components/TemplatePreview/TemplatePreview.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title:
|
|
5
|
-
tags: [
|
|
4
|
+
title: 'example/TemplatePreview',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
6
|
component: UnnnicTemplatePreview,
|
|
7
7
|
};
|
|
8
8
|
|
|
@@ -17,28 +17,28 @@ const Template = (args) => ({
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const bodyText =
|
|
20
|
-
|
|
20
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sem orci, ultrices id lectus non, vehicula suscipit libero. Ut vehicula libero a tempus fringilla. Nam tincidunt vestibulum maximus. Morbi vel pretium risus. Curabitur id quam lectus. Quisque dolor elit, auctor a lacus non, rutrum ullamcorper mi. Nulla et turpis sed eros pharetra ullamcorper fermentum ac nisl. Donec lacinia hendrerit tellus, sit amet suscipit velit vestibulum sed. Praesent gravida posuere metus, ut fringilla dolor euismod vel. Aenean vel ipsum magna. Integer metus mi, fermentum ut nulla at, facilisis lobortis metus. Ut vitae tortor posuere, dapibus leo quis, finibus neque.';
|
|
21
21
|
|
|
22
22
|
export const Default = Template.bind({});
|
|
23
23
|
Default.args = {
|
|
24
24
|
template: {
|
|
25
25
|
header: {
|
|
26
|
-
type:
|
|
27
|
-
text:
|
|
26
|
+
type: 'TEXT',
|
|
27
|
+
text: 'Hello, world!',
|
|
28
28
|
},
|
|
29
|
-
footer:
|
|
29
|
+
footer: 'Weni by VTEX',
|
|
30
30
|
buttons: [
|
|
31
31
|
{
|
|
32
|
-
text:
|
|
33
|
-
type:
|
|
32
|
+
text: 'Button 1',
|
|
33
|
+
type: 'PHONE_NUMBER',
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
text:
|
|
37
|
-
type:
|
|
36
|
+
text: 'Button 2',
|
|
37
|
+
type: 'URL',
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
text:
|
|
41
|
-
type:
|
|
40
|
+
text: 'Button 3',
|
|
41
|
+
type: 'QUICK_REPLY',
|
|
42
42
|
},
|
|
43
43
|
],
|
|
44
44
|
body: bodyText,
|
|
@@ -49,10 +49,10 @@ export const Image = Template.bind({});
|
|
|
49
49
|
Image.args = {
|
|
50
50
|
template: {
|
|
51
51
|
header: {
|
|
52
|
-
type:
|
|
53
|
-
mediaType:
|
|
52
|
+
type: 'MEDIA',
|
|
53
|
+
mediaType: 'IMAGE',
|
|
54
54
|
},
|
|
55
|
-
footer:
|
|
55
|
+
footer: 'Weni by VTEX',
|
|
56
56
|
body: bodyText,
|
|
57
57
|
},
|
|
58
58
|
};
|
|
@@ -61,21 +61,21 @@ export const Video = Template.bind({});
|
|
|
61
61
|
Video.args = {
|
|
62
62
|
template: {
|
|
63
63
|
header: {
|
|
64
|
-
type:
|
|
65
|
-
mediaType:
|
|
64
|
+
type: 'MEDIA',
|
|
65
|
+
mediaType: 'VIDEO',
|
|
66
66
|
},
|
|
67
67
|
buttons: [
|
|
68
68
|
{
|
|
69
|
-
text:
|
|
70
|
-
type:
|
|
69
|
+
text: 'Button 1',
|
|
70
|
+
type: 'PHONE_NUMBER',
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
text:
|
|
74
|
-
type:
|
|
73
|
+
text: 'Button 2',
|
|
74
|
+
type: 'URL',
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
text:
|
|
78
|
-
type:
|
|
77
|
+
text: 'Button 3',
|
|
78
|
+
type: 'QUICK_REPLY',
|
|
79
79
|
},
|
|
80
80
|
],
|
|
81
81
|
},
|
|
@@ -85,10 +85,10 @@ export const Document = Template.bind({});
|
|
|
85
85
|
Document.args = {
|
|
86
86
|
template: {
|
|
87
87
|
header: {
|
|
88
|
-
type:
|
|
89
|
-
mediaType:
|
|
88
|
+
type: 'MEDIA',
|
|
89
|
+
mediaType: 'DOCUMENT',
|
|
90
90
|
},
|
|
91
|
-
footer:
|
|
91
|
+
footer: 'Weni by VTEX',
|
|
92
92
|
body: bodyText,
|
|
93
93
|
},
|
|
94
94
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import UnnnicTemplatePreviewModal from
|
|
1
|
+
import UnnnicTemplatePreviewModal from '../components/TemplatePreview/TemplatePreviewModal.vue';
|
|
2
2
|
|
|
3
|
-
import { action } from
|
|
3
|
+
import { action } from '@storybook/addon-actions';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
title:
|
|
7
|
-
tags: [
|
|
6
|
+
title: 'example/TemplatePreviewModal',
|
|
7
|
+
tags: ['autodocs'],
|
|
8
8
|
component: UnnnicTemplatePreviewModal,
|
|
9
9
|
argTypes: {
|
|
10
10
|
locale: {
|
|
11
|
-
control: { type:
|
|
12
|
-
options: [
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: ['pt-br', 'en', 'es'],
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
};
|
|
@@ -18,7 +18,7 @@ const Template = (args) => ({
|
|
|
18
18
|
components: { UnnnicTemplatePreviewModal },
|
|
19
19
|
setup() {
|
|
20
20
|
const close = () => {
|
|
21
|
-
action(
|
|
21
|
+
action('close')();
|
|
22
22
|
args.modelValue = false;
|
|
23
23
|
};
|
|
24
24
|
return { args, close };
|
|
@@ -32,29 +32,29 @@ const Template = (args) => ({
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
const bodyText =
|
|
35
|
-
|
|
35
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sem orci, ultrices id lectus non, vehicula suscipit libero. Ut vehicula libero a tempus fringilla. Nam tincidunt vestibulum maximus. Morbi vel pretium risus. Curabitur id quam lectus. Quisque dolor elit, auctor a lacus non, rutrum ullamcorper mi. Nulla et turpis sed eros pharetra ullamcorper fermentum ac nisl. Donec lacinia hendrerit tellus, sit amet suscipit velit vestibulum sed. Praesent gravida posuere metus, ut fringilla dolor euismod vel. Aenean vel ipsum magna. Integer metus mi, fermentum ut nulla at, facilisis lobortis metus. Ut vitae tortor posuere, dapibus leo quis, finibus neque.';
|
|
36
36
|
|
|
37
37
|
export const Default = Template.bind({});
|
|
38
38
|
Default.args = {
|
|
39
39
|
modelValue: false,
|
|
40
40
|
template: {
|
|
41
41
|
header: {
|
|
42
|
-
type:
|
|
43
|
-
text:
|
|
42
|
+
type: 'TEXT',
|
|
43
|
+
text: 'Hello, world!',
|
|
44
44
|
},
|
|
45
|
-
footer:
|
|
45
|
+
footer: 'Weni by VTEX',
|
|
46
46
|
buttons: [
|
|
47
47
|
{
|
|
48
|
-
text:
|
|
49
|
-
type:
|
|
48
|
+
text: 'Button 1',
|
|
49
|
+
type: 'PHONE_NUMBER',
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
text:
|
|
53
|
-
type:
|
|
52
|
+
text: 'Button 2',
|
|
53
|
+
type: 'URL',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
text:
|
|
57
|
-
type:
|
|
56
|
+
text: 'Button 3',
|
|
57
|
+
type: 'QUICK_REPLY',
|
|
58
58
|
},
|
|
59
59
|
],
|
|
60
60
|
body: bodyText,
|
|
@@ -65,10 +65,10 @@ export const Image = Template.bind({});
|
|
|
65
65
|
Image.args = {
|
|
66
66
|
template: {
|
|
67
67
|
header: {
|
|
68
|
-
type:
|
|
69
|
-
mediaType:
|
|
68
|
+
type: 'MEDIA',
|
|
69
|
+
mediaType: 'IMAGE',
|
|
70
70
|
},
|
|
71
|
-
footer:
|
|
71
|
+
footer: 'Weni by VTEX',
|
|
72
72
|
body: bodyText,
|
|
73
73
|
},
|
|
74
74
|
};
|
|
@@ -77,21 +77,21 @@ export const Video = Template.bind({});
|
|
|
77
77
|
Video.args = {
|
|
78
78
|
template: {
|
|
79
79
|
header: {
|
|
80
|
-
type:
|
|
81
|
-
mediaType:
|
|
80
|
+
type: 'MEDIA',
|
|
81
|
+
mediaType: 'VIDEO',
|
|
82
82
|
},
|
|
83
83
|
buttons: [
|
|
84
84
|
{
|
|
85
|
-
text:
|
|
86
|
-
type:
|
|
85
|
+
text: 'Button 1',
|
|
86
|
+
type: 'PHONE_NUMBER',
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
text:
|
|
90
|
-
type:
|
|
89
|
+
text: 'Button 2',
|
|
90
|
+
type: 'URL',
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
text:
|
|
94
|
-
type:
|
|
93
|
+
text: 'Button 3',
|
|
94
|
+
type: 'QUICK_REPLY',
|
|
95
95
|
},
|
|
96
96
|
],
|
|
97
97
|
},
|
|
@@ -101,10 +101,10 @@ export const Document = Template.bind({});
|
|
|
101
101
|
Document.args = {
|
|
102
102
|
template: {
|
|
103
103
|
header: {
|
|
104
|
-
type:
|
|
105
|
-
mediaType:
|
|
104
|
+
type: 'MEDIA',
|
|
105
|
+
mediaType: 'DOCUMENT',
|
|
106
106
|
},
|
|
107
|
-
footer:
|
|
107
|
+
footer: 'Weni by VTEX',
|
|
108
108
|
body: bodyText,
|
|
109
109
|
},
|
|
110
110
|
};
|