@weni/unnnic-system 3.12.6-alpha-teleports.0 → 3.12.8-alpha.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/.vscode/extensions.json +3 -0
- package/CHANGELOG.md +1080 -0
- package/README.md +1 -9
- package/dist/{es-ebc7770b.mjs → es-52edeb71.mjs} +1 -1
- package/dist/{index-f117a889.mjs → index-756fe685.mjs} +9070 -8660
- package/dist/index.d.ts +1013 -311
- package/dist/{pt-br-b1a08da0.mjs → pt-br-24583c8c.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +181 -177
- package/dist/unnnic.umd.js +33 -33
- package/package.json +1 -1
- package/src/assets/scss/scheme-colors.scss +223 -223
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
- 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 +97 -88
- package/src/components/Input/BaseInput.vue +25 -5
- package/src/components/Input/Input.scss +2 -3
- package/src/components/Input/Input.vue +26 -3
- package/src/components/Input/TextInput.vue +64 -25
- package/src/components/Input/__test__/TextInput.spec.js +1 -1
- 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 +11 -4
- package/src/components/MultiSelect/MultSelectOption.vue +49 -0
- package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +557 -0
- package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +229 -0
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +87 -0
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +51 -0
- package/src/components/MultiSelect/index.vue +265 -0
- package/src/components/Radio/Radio.vue +13 -7
- 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 +71 -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 +308 -0
- package/src/components/Switch/Switch.vue +11 -4
- package/src/components/TemplatePreview/TemplatePreview.vue +30 -27
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +11 -11
- package/src/components/TemplatePreview/types.d.ts +3 -3
- package/src/components/Toast/Toast.vue +13 -9
- package/src/components/Toast/ToastManager.ts +1 -4
- package/src/components/Toast/__tests__/ToastManager.spec.js +6 -10
- package/src/components/ToolTip/ToolTip.vue +1 -1
- package/src/components/index.ts +10 -6
- package/src/components/ui/dialog/DialogContent.vue +5 -5
- package/src/components/ui/drawer/DrawerContent.vue +2 -4
- package/src/components/ui/popover/PopoverContent.vue +29 -13
- package/src/components/ui/popover/PopoverOption.vue +5 -1
- package/src/components/ui/tooltip/TooltipContent.vue +2 -5
- package/src/components/ui/tooltip/TooltipTrigger.vue +4 -2
- package/src/index.ts +2 -9
- package/src/lib/layer-manager.ts +52 -24
- package/src/locales/en.json +3 -1
- package/src/locales/es.json +3 -1
- package/src/locales/pt_br.json +3 -1
- package/src/stories/Input.mdx +3 -0
- package/src/stories/LayerManager.docs.mdx +9 -9
- package/src/stories/LayerManager.stories.js +11 -54
- package/src/stories/MultiSelect.stories.js +143 -45
- package/src/stories/Popover.stories.js +5 -0
- package/src/stories/Select.stories.js +161 -0
- package/src/stories/TemplatePreview.stories.js +27 -27
- package/src/stories/TemplatePreviewModal.stories.js +31 -31
- package/src/components/MultiSelect/MultiSelect.vue +0 -297
- package/src/lib/__tests__/teleport-target.spec.ts +0 -73
- package/src/lib/teleport-target.ts +0 -46
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
class="input-itself"
|
|
13
13
|
:hasIconLeft="!!iconLeft"
|
|
14
14
|
:hasIconRight="!!iconRight || allowTogglePassword"
|
|
15
|
+
:hasClearIcon="showClear"
|
|
15
16
|
:maxlength="maxlength"
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
:readonly="readonly"
|
|
18
|
+
:useFocusProp="useFocusProp"
|
|
19
|
+
:focus="focus"
|
|
18
20
|
/>
|
|
19
21
|
|
|
20
22
|
<UnnnicIcon
|
|
@@ -27,18 +29,28 @@
|
|
|
27
29
|
@click="onIconLeftClick"
|
|
28
30
|
/>
|
|
29
31
|
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
<section class="icon-right-container">
|
|
33
|
+
<UnnnicIcon
|
|
34
|
+
v-if="showClear"
|
|
35
|
+
class="icon-clear"
|
|
36
|
+
:scheme="iconScheme"
|
|
37
|
+
icon="close"
|
|
38
|
+
size="ant"
|
|
39
|
+
clickable
|
|
40
|
+
@click.stop="onClearClick"
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<UnnnicIcon
|
|
44
|
+
v-if="iconRightSvg"
|
|
45
|
+
:scheme="iconScheme"
|
|
46
|
+
:icon="iconRightSvg"
|
|
47
|
+
size="ant"
|
|
48
|
+
:clickable="iconRightClickable || allowTogglePassword"
|
|
49
|
+
class="icon-right"
|
|
50
|
+
:class="{ clickable: iconRightClickable || allowTogglePassword }"
|
|
51
|
+
@click="onIconRightClick"
|
|
52
|
+
/>
|
|
53
|
+
</section>
|
|
42
54
|
</div>
|
|
43
55
|
</template>
|
|
44
56
|
|
|
@@ -103,8 +115,24 @@ export default {
|
|
|
103
115
|
type: Boolean,
|
|
104
116
|
default: false,
|
|
105
117
|
},
|
|
118
|
+
readonly: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false,
|
|
121
|
+
},
|
|
122
|
+
useFocusProp: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
126
|
+
focus: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: false,
|
|
129
|
+
},
|
|
130
|
+
showClear: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: false,
|
|
133
|
+
},
|
|
106
134
|
},
|
|
107
|
-
emits: ['icon-left-click', 'icon-right-click'],
|
|
135
|
+
emits: ['icon-left-click', 'icon-right-click', 'clear'],
|
|
108
136
|
data() {
|
|
109
137
|
return {
|
|
110
138
|
isFocused: false,
|
|
@@ -128,7 +156,6 @@ export default {
|
|
|
128
156
|
if (this.isDisabled) {
|
|
129
157
|
return 'fg-muted';
|
|
130
158
|
}
|
|
131
|
-
|
|
132
159
|
return 'fg-base';
|
|
133
160
|
},
|
|
134
161
|
|
|
@@ -138,7 +165,7 @@ export default {
|
|
|
138
165
|
},
|
|
139
166
|
|
|
140
167
|
methods: {
|
|
141
|
-
|
|
168
|
+
focusInput() {
|
|
142
169
|
this.$refs['base-input'].$el.focus();
|
|
143
170
|
},
|
|
144
171
|
|
|
@@ -154,6 +181,10 @@ export default {
|
|
|
154
181
|
if (this.iconLeftClickable) this.$emit('icon-left-click');
|
|
155
182
|
},
|
|
156
183
|
|
|
184
|
+
onClearClick() {
|
|
185
|
+
this.$emit('clear');
|
|
186
|
+
},
|
|
187
|
+
|
|
157
188
|
onIconRightClick() {
|
|
158
189
|
if (this.attributes.disabled) return;
|
|
159
190
|
if (this.allowTogglePassword) this.showPassword = !this.showPassword;
|
|
@@ -171,25 +202,33 @@ export default {
|
|
|
171
202
|
}
|
|
172
203
|
|
|
173
204
|
.icon {
|
|
174
|
-
&-left,
|
|
175
|
-
&-right {
|
|
176
|
-
&:not(.clickable) {
|
|
177
|
-
pointer-events: none;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
205
|
&-left {
|
|
182
206
|
position: absolute;
|
|
183
207
|
top: 50%;
|
|
184
208
|
transform: translateY(-50%);
|
|
185
209
|
left: $unnnic-space-4;
|
|
210
|
+
|
|
211
|
+
&:not(.clickable) {
|
|
212
|
+
pointer-events: none;
|
|
213
|
+
}
|
|
186
214
|
}
|
|
187
215
|
|
|
188
|
-
&-right {
|
|
216
|
+
&-right-container {
|
|
189
217
|
position: absolute;
|
|
190
218
|
top: 50%;
|
|
191
219
|
transform: translateY(-50%);
|
|
192
220
|
right: $unnnic-space-4;
|
|
221
|
+
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: $unnnic-space-2;
|
|
225
|
+
|
|
226
|
+
.icon-clear {
|
|
227
|
+
cursor: pointer;
|
|
228
|
+
}
|
|
229
|
+
.icon-right:not(.clickable) {
|
|
230
|
+
pointer-events: none;
|
|
231
|
+
}
|
|
193
232
|
}
|
|
194
233
|
}
|
|
195
234
|
</style>
|
|
@@ -129,7 +129,7 @@ describe('TextInput.vue', () => {
|
|
|
129
129
|
|
|
130
130
|
test('focus method calls focus on base input element', () => {
|
|
131
131
|
const focusSpy = vi.spyOn(wrapper.vm.$refs['base-input'].$el, 'focus');
|
|
132
|
-
wrapper.vm.
|
|
132
|
+
wrapper.vm.focusInput();
|
|
133
133
|
|
|
134
134
|
expect(focusSpy).toHaveBeenCalled();
|
|
135
135
|
focusSpy.mockRestore();
|
|
@@ -6,7 +6,11 @@ exports[`Input.vue > matches the snapshot 1`] = `
|
|
|
6
6
|
<p data-v-7f222291="" class="unnnic-label__label">Sample Label</p>
|
|
7
7
|
<!--v-if-->
|
|
8
8
|
</section>
|
|
9
|
-
<div data-v-a0d36167="" data-v-d890ad85="" class="text-input size--md unnnic-form-input" hascloudycolor="false" mask="####-####"><input data-v-86533b41="" data-v-a0d36167="" class="unnnic-form-input input-itself input size-md normal input--has-icon-left input--has-icon-right unnnic-form-input input-itself" hascloudycolor="false" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span
|
|
9
|
+
<div data-v-a0d36167="" data-v-d890ad85="" class="text-input size--md unnnic-form-input" hascloudycolor="false" mask="####-####"><input data-v-86533b41="" data-v-a0d36167="" class="unnnic-form-input input-itself input size-md normal input--has-icon-left input--has-icon-right unnnic-form-input input-itself" hascloudycolor="false" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" showclear="false" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span>
|
|
10
|
+
<section data-v-a0d36167="" class="icon-right-container">
|
|
11
|
+
<!--v-if--><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span>
|
|
12
|
+
</section>
|
|
13
|
+
</div>
|
|
10
14
|
<section data-v-9f8d6c86="" class="unnnic-form-element__hints-container">
|
|
11
15
|
<section data-v-9f8d6c86="" class="unnnic-form-element__message-container">
|
|
12
16
|
<p data-v-9f8d6c86="" class="unnnic-form-element__message">Error message</p>
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`TextInput.vue > matches the snapshot 1`] = `
|
|
3
|
+
exports[`TextInput.vue > matches the snapshot 1`] = `
|
|
4
|
+
"<div data-v-a0d36167="" class="text-input size--md"><input data-v-86533b41="" data-v-a0d36167="" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" allowtogglepassword="false" showclear="false" class="input-itself input size-md normal input--has-icon-left input--has-icon-right input-itself" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span>
|
|
5
|
+
<section data-v-a0d36167="" class="icon-right-container">
|
|
6
|
+
<!--v-if--><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span>
|
|
7
|
+
</section>
|
|
8
|
+
</div>"
|
|
9
|
+
`;
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
class="unnnic-modal-dialog__container__actions__primary-button"
|
|
78
78
|
@click.stop="$emit('primaryButtonClick')"
|
|
79
79
|
/>
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
</UnnnicDialogFooter>
|
|
81
|
+
</section>
|
|
82
82
|
</UnnnicDialogContent>
|
|
83
83
|
</UnnnicDialog>
|
|
84
84
|
</template>
|
|
@@ -102,8 +102,8 @@ export default {
|
|
|
102
102
|
UnnnicDialogTitle,
|
|
103
103
|
UnnnicDialogFooter,
|
|
104
104
|
},
|
|
105
|
-
inheritAttrs: false,
|
|
106
105
|
mixins: [UnnnicI18n],
|
|
106
|
+
inheritAttrs: false,
|
|
107
107
|
props: {
|
|
108
108
|
modelValue: {
|
|
109
109
|
type: Boolean,
|
|
@@ -178,10 +178,18 @@ export default {
|
|
|
178
178
|
},
|
|
179
179
|
};
|
|
180
180
|
},
|
|
181
|
+
watch: {
|
|
182
|
+
modelValue(value) {
|
|
183
|
+
this.updateBodyOverflow(value);
|
|
184
|
+
},
|
|
185
|
+
},
|
|
181
186
|
methods: {
|
|
182
187
|
close() {
|
|
183
188
|
this.$emit('update:modelValue', false);
|
|
184
189
|
},
|
|
190
|
+
updateBodyOverflow(isHidden) {
|
|
191
|
+
document.body.style.overflow = isHidden ? 'hidden' : '';
|
|
192
|
+
},
|
|
185
193
|
persistentHandler(event) {
|
|
186
194
|
if (this.persistent) {
|
|
187
195
|
event.preventDefault();
|
|
@@ -193,7 +201,6 @@ export default {
|
|
|
193
201
|
|
|
194
202
|
<style lang="scss" scoped>
|
|
195
203
|
@use '@/assets/scss/unnnic' as *;
|
|
196
|
-
|
|
197
204
|
.unnnic-modal-dialog__container {
|
|
198
205
|
&__left-sidebar {
|
|
199
206
|
background-color: $unnnic-color-neutral-black;
|
|
@@ -0,0 +1,49 @@
|
|
|
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>
|