@weni/unnnic-system 3.12.8-alpha.0 → 3.13.0
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 +27 -0
- package/dist/{es-52edeb71.mjs → es-41fceca9.mjs} +1 -1
- package/dist/{index-756fe685.mjs → index-cca96b43.mjs} +26458 -29323
- package/dist/index.d.ts +1652 -4902
- package/dist/{pt-br-24583c8c.mjs → pt-br-a3088529.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +204 -232
- package/dist/unnnic.umd.js +44 -48
- package/package.json +2 -3
- package/src/assets/scss/scheme-colors.scss +223 -223
- package/src/assets/scss/tailwind.scss +0 -8
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/Drawer/Drawer.vue +269 -190
- package/src/components/Drawer/__tests__/Drawer.spec.js +46 -37
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
- package/src/components/FormElement/FormElement.vue +1 -1
- package/src/components/Input/Input.scss +2 -0
- package/src/components/ModalDialog/ModalDialog.vue +148 -64
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +221 -11
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
- package/src/components/MultiSelect/MultiSelect.vue +297 -0
- package/src/components/Radio/Radio.vue +1 -1
- package/src/components/Select/index.vue +3 -3
- package/src/components/Switch/Switch.vue +1 -1
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
- package/src/components/TemplatePreview/TemplatePreview.vue +2 -2
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +1 -1
- package/src/components/Toast/Toast.vue +9 -16
- package/src/components/ToolTip/ToolTip.vue +177 -25
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -339
- package/src/components/index.ts +2 -58
- package/src/components/ui/popover/PopoverContent.vue +4 -5
- package/src/components/ui/popover/PopoverTrigger.vue +1 -5
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/ModalDialog.mdx +0 -3
- package/src/stories/ModalDialog.stories.js +1 -1
- package/src/stories/MultiSelect.stories.js +45 -143
- package/src/components/MultiSelect/MultSelectOption.vue +0 -49
- package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +0 -557
- package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +0 -229
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +0 -87
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +0 -51
- package/src/components/MultiSelect/index.vue +0 -265
- package/src/components/ui/dialog/Dialog.vue +0 -19
- package/src/components/ui/dialog/DialogClose.vue +0 -29
- package/src/components/ui/dialog/DialogContent.vue +0 -140
- package/src/components/ui/dialog/DialogFooter.vue +0 -50
- package/src/components/ui/dialog/DialogHeader.vue +0 -83
- package/src/components/ui/dialog/DialogTitle.vue +0 -38
- package/src/components/ui/dialog/DialogTrigger.vue +0 -16
- package/src/components/ui/dialog/index.ts +0 -7
- package/src/components/ui/drawer/Drawer.vue +0 -27
- package/src/components/ui/drawer/DrawerClose.vue +0 -31
- package/src/components/ui/drawer/DrawerContent.vue +0 -111
- package/src/components/ui/drawer/DrawerDescription.vue +0 -40
- package/src/components/ui/drawer/DrawerFooter.vue +0 -38
- package/src/components/ui/drawer/DrawerHeader.vue +0 -57
- package/src/components/ui/drawer/DrawerOverlay.vue +0 -33
- package/src/components/ui/drawer/DrawerTitle.vue +0 -37
- package/src/components/ui/drawer/DrawerTrigger.vue +0 -31
- package/src/components/ui/drawer/index.ts +0 -10
- package/src/components/ui/tooltip/Tooltip.vue +0 -21
- package/src/components/ui/tooltip/TooltipContent.vue +0 -74
- package/src/components/ui/tooltip/TooltipTrigger.vue +0 -26
- package/src/components/ui/tooltip/index.ts +0 -3
- package/src/lib/layer-manager.ts +0 -92
- package/src/stories/Dialog.stories.js +0 -832
- package/src/stories/DrawerNext.stories.js +0 -611
- package/src/stories/LayerManager.docs.mdx +0 -40
- package/src/stories/LayerManager.stories.js +0 -364
|
@@ -1,160 +1,62 @@
|
|
|
1
|
-
import UnnnicMultiSelect from '../components/MultiSelect/
|
|
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
|
-
];
|
|
1
|
+
import UnnnicMultiSelect from '../components/MultiSelect/MultiSelect.vue';
|
|
15
2
|
|
|
16
3
|
export default {
|
|
17
4
|
title: 'Form/MultiSelect',
|
|
18
5
|
component: UnnnicMultiSelect,
|
|
19
|
-
|
|
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.',
|
|
78
|
-
},
|
|
79
|
-
locale: {
|
|
80
|
-
description: 'Locale for i18n translations.',
|
|
81
|
-
},
|
|
82
|
-
disabled: {
|
|
83
|
-
description: 'Disable the select.',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
6
|
+
argTypes: {},
|
|
86
7
|
render: (args) => ({
|
|
87
|
-
components: {
|
|
8
|
+
components: {
|
|
9
|
+
UnnnicMultiSelect,
|
|
10
|
+
},
|
|
88
11
|
setup() {
|
|
89
|
-
|
|
90
|
-
args.search = value;
|
|
91
|
-
};
|
|
92
|
-
return { args, handleSearch };
|
|
12
|
+
return { args };
|
|
93
13
|
},
|
|
94
14
|
data() {
|
|
95
15
|
return {
|
|
96
|
-
|
|
16
|
+
groups: [
|
|
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
|
+
],
|
|
97
52
|
};
|
|
98
53
|
},
|
|
99
54
|
template: `
|
|
100
|
-
<div
|
|
101
|
-
<
|
|
102
|
-
<unnnic-multi-select v-model="exampleValue" v-bind="args" @update:search="handleSearch" />
|
|
55
|
+
<div>
|
|
56
|
+
<UnnnicMultiSelect v-bind="args" v-model="groups" />
|
|
103
57
|
</div>
|
|
104
58
|
`,
|
|
105
59
|
}),
|
|
106
60
|
};
|
|
107
61
|
|
|
108
|
-
export const
|
|
109
|
-
args: {
|
|
110
|
-
placeholder: 'Placeholder',
|
|
111
|
-
label: 'Label',
|
|
112
|
-
options,
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const ReturnObject = {
|
|
117
|
-
args: {
|
|
118
|
-
returnObject: true,
|
|
119
|
-
placeholder: 'Placeholder',
|
|
120
|
-
label: 'Label',
|
|
121
|
-
options,
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export const AlternativeValueKey = {
|
|
126
|
-
args: {
|
|
127
|
-
itemValue: 'altValue',
|
|
128
|
-
placeholder: 'Placeholder',
|
|
129
|
-
label: 'Label',
|
|
130
|
-
options,
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export const AlternativeValueLabel = {
|
|
135
|
-
args: {
|
|
136
|
-
itemLabel: 'altValue',
|
|
137
|
-
placeholder: 'Placeholder',
|
|
138
|
-
label: 'Label',
|
|
139
|
-
options,
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export const Disabled = {
|
|
144
|
-
args: {
|
|
145
|
-
placeholder: 'Placeholder',
|
|
146
|
-
label: 'Label',
|
|
147
|
-
options,
|
|
148
|
-
disabled: true,
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export const WithSearch = {
|
|
153
|
-
args: {
|
|
154
|
-
placeholder: 'Placeholder',
|
|
155
|
-
label: 'Label',
|
|
156
|
-
options,
|
|
157
|
-
enableSearch: true,
|
|
158
|
-
search: '',
|
|
159
|
-
},
|
|
160
|
-
};
|
|
62
|
+
export const Medium = { args: {} };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="['unnnic-multi-select-option']">
|
|
3
|
-
<UnnnicCheckbox
|
|
4
|
-
:modelValue="props.active"
|
|
5
|
-
:disabled="props.disabled"
|
|
6
|
-
:label="props.label"
|
|
7
|
-
@update:model-value="emit('update:modelValue', !props.active)"
|
|
8
|
-
/>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script setup lang="ts">
|
|
13
|
-
import UnnnicCheckbox from '../Checkbox/Checkbox.vue';
|
|
14
|
-
|
|
15
|
-
defineOptions({
|
|
16
|
-
name: 'UnnnicMultiSelectOption',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const emit = defineEmits<{
|
|
20
|
-
'update:modelValue': [boolean];
|
|
21
|
-
}>();
|
|
22
|
-
|
|
23
|
-
interface SelectOptionProps {
|
|
24
|
-
label: string;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
active?: boolean;
|
|
27
|
-
focused?: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const props = withDefaults(defineProps<SelectOptionProps>(), {
|
|
31
|
-
disabled: false,
|
|
32
|
-
active: false,
|
|
33
|
-
focused: false,
|
|
34
|
-
});
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<style lang="scss" scoped>
|
|
38
|
-
@use '@/assets/scss/unnnic' as *;
|
|
39
|
-
* {
|
|
40
|
-
margin: 0;
|
|
41
|
-
padding: 0;
|
|
42
|
-
box-sizing: border-box;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.unnnic-multi-select-option {
|
|
46
|
-
border-radius: $unnnic-radius-1;
|
|
47
|
-
font: $unnnic-font-emphasis;
|
|
48
|
-
}
|
|
49
|
-
</style>
|