@weni/unnnic-system 3.9.1-alpha.4 → 3.9.1-alpha.6
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/DateFilter/DateFilter.vue.d.ts +82 -3
- 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 +82 -3
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +53 -2
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +82 -3
- package/dist/components/InputNext/InputNext.vue.d.ts +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +82 -3
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +53 -2
- package/dist/components/SelectTime/index.vue.d.ts +53 -2
- package/dist/components/TextArea/TextArea.vue.d.ts +3 -3
- package/dist/components/index.d.ts +664 -32
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-db30a2ff.mjs → es-18dc2623.mjs} +1 -1
- package/dist/{index-761bb714.mjs → index-d490afbf.mjs} +2428 -2369
- 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-569fa4c1.mjs → pt-br-ea959d2d.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +28 -28
- package/package.json +1 -1
- package/src/assets/scss/scheme-colors.scss +309 -223
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/FormElement/FormElement.vue +1 -1
- package/src/components/Input/BaseInput.vue +21 -2
- package/src/components/Input/Input.scss +2 -1
- package/src/components/Input/Input.vue +19 -1
- package/src/components/Input/TextInput.vue +66 -21
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +10 -6
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +7 -1
- package/src/components/MultiSelectV2/MultSelectOption.vue +67 -0
- package/src/components/MultiSelectV2/__tests__/MultiSelect.spec.js +556 -0
- package/src/components/MultiSelectV2/__tests__/MultiSelectOption.spec.js +229 -0
- package/src/components/MultiSelectV2/__tests__/__snapshots__/MultiSelect.spec.js.snap +121 -0
- package/src/components/MultiSelectV2/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +51 -0
- package/src/components/MultiSelectV2/index.vue +221 -0
- package/src/components/Popover/__tests__/Popover.spec.js +147 -0
- package/src/components/Popover/__tests__/__snapshots__/Popover.spec.js.snap +8 -0
- package/src/components/Popover/index.vue +146 -0
- package/src/components/Select/SelectOption.vue +65 -0
- package/src/components/Select/__tests__/Select.spec.js +412 -0
- package/src/components/Select/__tests__/SelectItem.spec.js +330 -0
- package/src/components/Select/__tests__/SelectOption.spec.js +174 -0
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +97 -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/index.vue +249 -0
- package/src/components/TextArea/TextArea.vue +1 -1
- 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/MultiSelectV2.stories.js +158 -0
- package/src/stories/Select.stories.js +158 -0
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
v-bind="$attrs"
|
|
14
14
|
v-model="val"
|
|
15
15
|
class="unnnic-form-input"
|
|
16
|
+
:forceActiveStatus="forceActiveStatus"
|
|
16
17
|
:placeholder="placeholder"
|
|
17
18
|
:iconLeft="iconLeft"
|
|
18
19
|
:iconRight="iconRight"
|
|
@@ -25,6 +26,9 @@
|
|
|
25
26
|
:nativeType="nativeType"
|
|
26
27
|
:maxlength="maxlength"
|
|
27
28
|
:disabled="disabled"
|
|
29
|
+
:readonly="readonly"
|
|
30
|
+
:showClear="showClear"
|
|
31
|
+
@clear="$emit('clear')"
|
|
28
32
|
/>
|
|
29
33
|
|
|
30
34
|
<template
|
|
@@ -127,8 +131,22 @@ export default {
|
|
|
127
131
|
type: Boolean,
|
|
128
132
|
default: false,
|
|
129
133
|
},
|
|
134
|
+
readonly: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: false,
|
|
137
|
+
},
|
|
138
|
+
forceActiveStatus: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: false,
|
|
141
|
+
},
|
|
142
|
+
showClear: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: false,
|
|
145
|
+
},
|
|
130
146
|
},
|
|
131
|
-
|
|
147
|
+
|
|
148
|
+
emits: ['update:modelValue', 'clear'],
|
|
149
|
+
|
|
132
150
|
data() {
|
|
133
151
|
return {
|
|
134
152
|
val: this.modelValue,
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
class="input-itself"
|
|
13
13
|
:hasIconLeft="!!iconLeft"
|
|
14
14
|
:hasIconRight="!!iconRight || allowTogglePassword"
|
|
15
|
+
:hasClearIcon="showClear"
|
|
15
16
|
:maxlength="maxlength"
|
|
17
|
+
:readonly="readonly"
|
|
18
|
+
:forceActiveStatus="forceActiveStatus"
|
|
16
19
|
@focus="onFocus"
|
|
17
20
|
@blur="onBlur"
|
|
18
21
|
/>
|
|
@@ -27,18 +30,28 @@
|
|
|
27
30
|
@click="onIconLeftClick"
|
|
28
31
|
/>
|
|
29
32
|
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
<section class="icon-right-container">
|
|
34
|
+
<UnnnicIcon
|
|
35
|
+
v-if="showClear"
|
|
36
|
+
class="icon-clear"
|
|
37
|
+
:scheme="iconScheme"
|
|
38
|
+
icon="close"
|
|
39
|
+
size="ant"
|
|
40
|
+
clickable
|
|
41
|
+
@click.stop="onClearClick"
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<UnnnicIcon
|
|
45
|
+
v-if="iconRightSvg"
|
|
46
|
+
:scheme="iconScheme"
|
|
47
|
+
:icon="iconRightSvg"
|
|
48
|
+
size="ant"
|
|
49
|
+
:clickable="iconRightClickable || allowTogglePassword"
|
|
50
|
+
class="icon-right"
|
|
51
|
+
:class="{ clickable: iconRightClickable || allowTogglePassword }"
|
|
52
|
+
@click="onIconRightClick"
|
|
53
|
+
/>
|
|
54
|
+
</section>
|
|
42
55
|
</div>
|
|
43
56
|
</template>
|
|
44
57
|
|
|
@@ -103,8 +116,20 @@ export default {
|
|
|
103
116
|
type: Boolean,
|
|
104
117
|
default: false,
|
|
105
118
|
},
|
|
119
|
+
readonly: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false,
|
|
122
|
+
},
|
|
123
|
+
forceActiveStatus: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false,
|
|
126
|
+
},
|
|
127
|
+
showClear: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: false,
|
|
130
|
+
},
|
|
106
131
|
},
|
|
107
|
-
emits: ['icon-left-click', 'icon-right-click'],
|
|
132
|
+
emits: ['icon-left-click', 'icon-right-click', 'clear'],
|
|
108
133
|
data() {
|
|
109
134
|
return {
|
|
110
135
|
isFocused: false,
|
|
@@ -129,6 +154,14 @@ export default {
|
|
|
129
154
|
return 'fg-muted';
|
|
130
155
|
}
|
|
131
156
|
|
|
157
|
+
if (this.modelValue || this.isFocused || this.forceActiveStatus) {
|
|
158
|
+
return 'color-gray-700';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (this.hasCloudyColor) {
|
|
162
|
+
return 'fg-base';
|
|
163
|
+
}
|
|
164
|
+
|
|
132
165
|
return 'fg-base';
|
|
133
166
|
},
|
|
134
167
|
|
|
@@ -154,6 +187,10 @@ export default {
|
|
|
154
187
|
if (this.iconLeftClickable) this.$emit('icon-left-click');
|
|
155
188
|
},
|
|
156
189
|
|
|
190
|
+
onClearClick() {
|
|
191
|
+
this.$emit('clear');
|
|
192
|
+
},
|
|
193
|
+
|
|
157
194
|
onIconRightClick() {
|
|
158
195
|
if (this.attributes.disabled) return;
|
|
159
196
|
if (this.allowTogglePassword) this.showPassword = !this.showPassword;
|
|
@@ -171,25 +208,33 @@ export default {
|
|
|
171
208
|
}
|
|
172
209
|
|
|
173
210
|
.icon {
|
|
174
|
-
&-left,
|
|
175
|
-
&-right {
|
|
176
|
-
&:not(.clickable) {
|
|
177
|
-
pointer-events: none;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
211
|
&-left {
|
|
182
212
|
position: absolute;
|
|
183
213
|
top: 50%;
|
|
184
214
|
transform: translateY(-50%);
|
|
185
215
|
left: $unnnic-space-4;
|
|
216
|
+
|
|
217
|
+
&:not(.clickable) {
|
|
218
|
+
pointer-events: none;
|
|
219
|
+
}
|
|
186
220
|
}
|
|
187
221
|
|
|
188
|
-
&-right {
|
|
222
|
+
&-right-container {
|
|
189
223
|
position: absolute;
|
|
190
224
|
top: 50%;
|
|
191
225
|
transform: translateY(-50%);
|
|
192
226
|
right: $unnnic-space-4;
|
|
227
|
+
|
|
228
|
+
display: flex;
|
|
229
|
+
align-items: center;
|
|
230
|
+
gap: $unnnic-space-2;
|
|
231
|
+
|
|
232
|
+
.icon-clear {
|
|
233
|
+
cursor: pointer;
|
|
234
|
+
}
|
|
235
|
+
.icon-right:not(.clickable) {
|
|
236
|
+
pointer-events: none;
|
|
237
|
+
}
|
|
193
238
|
}
|
|
194
239
|
}
|
|
195
240
|
</style>
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`Input.vue > matches the snapshot 1`] = `
|
|
4
|
-
"<
|
|
5
|
-
<section data-v-7f222291="" data-v-
|
|
4
|
+
"<div data-v-d890ad85="" class="unnnic-form md">
|
|
5
|
+
<section data-v-7f222291="" data-v-d890ad85="" class="unnnic-label unnnic-form__label">
|
|
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"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
<div data-v-a0d36167="" data-v-d890ad85="" class="text-input size--md unnnic-form-input" 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" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" hascloudycolor="false" showclear="false" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--fg-base 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="material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span>
|
|
12
|
+
</section>
|
|
13
|
+
</div>
|
|
14
|
+
<section data-v-d890ad85="" class="unnnic-form__hints-container">
|
|
15
|
+
<section data-v-d890ad85="" class="unnnic-form__message-container">
|
|
16
|
+
<p data-v-d890ad85="" class="unnnic-form__message">Error message</p>
|
|
13
17
|
<!--v-if-->
|
|
14
18
|
</section>
|
|
15
19
|
<!--v-if-->
|
|
@@ -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" hascloudycolor="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="material-symbols-rounded unnnic-icon-scheme--fg-base 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="material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span>
|
|
7
|
+
</section>
|
|
8
|
+
</div>"
|
|
9
|
+
`;
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
// cursor: pointer;
|
|
47
|
+
border-radius: $unnnic-radius-1;
|
|
48
|
+
font: $unnnic-font-emphasis;
|
|
49
|
+
|
|
50
|
+
// TODO: remove variations styles?
|
|
51
|
+
// &:hover:not(&--active):not(&--disabled),
|
|
52
|
+
// &--focused {
|
|
53
|
+
// background-color: $unnnic-color-bg-soft;
|
|
54
|
+
// }
|
|
55
|
+
|
|
56
|
+
// &--active {
|
|
57
|
+
// background-color: $unnnic-color-bg-active;
|
|
58
|
+
// color: $unnnic-color-fg-inverted;
|
|
59
|
+
// }
|
|
60
|
+
|
|
61
|
+
// &--disabled {
|
|
62
|
+
// color: $unnnic-color-fg-muted;
|
|
63
|
+
// background-color: $unnnic-color-bg-muted;
|
|
64
|
+
// cursor: not-allowed;
|
|
65
|
+
// }
|
|
66
|
+
}
|
|
67
|
+
</style>
|