@teammodlr/ui-kit 3.0.0-beta.34 → 3.0.0-beta.37
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/lib/components/clearbutton/ClearButton.vue.d.ts +7 -0
- package/lib/components/clearbutton/style/ClearButton.css.d.ts +2 -0
- package/lib/components/clearbutton/style/index.d.ts +1 -0
- package/lib/components/input/Input.vue.d.ts +15 -0
- package/lib/components/input/style/Input.css.d.ts +4 -0
- package/lib/components/select/Select.vue.d.ts +12 -0
- package/lib/components/select/style/Select.css.d.ts +2 -1
- package/lib/components/textarea/Textarea.vue.d.ts +11 -0
- package/lib/components/textarea/style/Textarea.css.d.ts +2 -0
- package/lib/index.cjs.js +3 -3
- package/lib/index.es.js +2982 -2863
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/src/components/clearbutton/ClearButton.vue +39 -0
- package/src/components/clearbutton/style/ClearButton.css.ts +37 -0
- package/src/components/clearbutton/style/index.ts +1 -0
- package/src/components/input/Input.vue +51 -3
- package/src/components/input/examples/clearable.vue +18 -0
- package/src/components/input/examples/index.stories.ts +3 -1
- package/src/components/input/examples/index.ts +1 -0
- package/src/components/input/style/Input.css.ts +19 -0
- package/src/components/select/Select.vue +31 -1
- package/src/components/select/examples/clearable.vue +18 -0
- package/src/components/select/examples/index.stories.ts +2 -1
- package/src/components/select/examples/index.ts +1 -0
- package/src/components/select/style/Select.css.ts +8 -6
- package/src/components/textarea/Textarea.vue +39 -3
- package/src/components/textarea/examples/clearable.vue +16 -0
- package/src/components/textarea/examples/index.stories.ts +2 -1
- package/src/components/textarea/examples/index.ts +1 -0
- package/src/components/textarea/style/Textarea.css.ts +10 -0
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
:type="inputType"
|
|
21
21
|
:placeholder="placeholder"
|
|
22
22
|
:name="name"
|
|
23
|
-
:value="
|
|
23
|
+
:value="currentValue"
|
|
24
24
|
:readonly="readonly"
|
|
25
25
|
v-on="inputListeners"
|
|
26
|
+
@input="onNativeInput"
|
|
26
27
|
:class="inputComputedClasses"
|
|
27
28
|
v-bind="$attrs"
|
|
28
29
|
:disabled="disabled || loading"
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
<div v-if="hasSuffix" :class="style.suffix">
|
|
33
34
|
<slot name="suffix" />
|
|
34
35
|
</div>
|
|
36
|
+
<MClearButton v-if="showClear" :class="clearClasses" @clear="onClear" />
|
|
35
37
|
<div v-if="hasRightIcon" :class="style.rightIcon">
|
|
36
38
|
<slot name="icon-right" />
|
|
37
39
|
</div>
|
|
@@ -52,14 +54,17 @@ import {
|
|
|
52
54
|
defineComponent,
|
|
53
55
|
ref,
|
|
54
56
|
computed,
|
|
55
|
-
toRef
|
|
57
|
+
toRef,
|
|
58
|
+
watch
|
|
56
59
|
} from "vue";
|
|
57
60
|
import { useInput } from "../../composables/useInput";
|
|
58
61
|
import { useInteractive } from "../../composables/useInteractive";
|
|
62
|
+
import MClearButton from '../clearbutton/ClearButton.vue';
|
|
59
63
|
import * as style from './style';
|
|
60
64
|
|
|
61
65
|
export default defineComponent({
|
|
62
66
|
name: 'MInput',
|
|
67
|
+
components: { MClearButton },
|
|
63
68
|
props: {
|
|
64
69
|
...useInput.props(),
|
|
65
70
|
...useInteractive.props(),
|
|
@@ -103,8 +108,12 @@ export default defineComponent({
|
|
|
103
108
|
type: String,
|
|
104
109
|
default: ''
|
|
105
110
|
},
|
|
111
|
+
clearable: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: false
|
|
114
|
+
},
|
|
106
115
|
},
|
|
107
|
-
emits: useInput.emits(),
|
|
116
|
+
emits: [...useInput.emits(), 'clear'],
|
|
108
117
|
setup(props, { slots, emit, expose }) {
|
|
109
118
|
const element = ref<HTMLInputElement|null>(null);
|
|
110
119
|
const { focus, blur } = useInteractive(element);
|
|
@@ -170,6 +179,8 @@ export default defineComponent({
|
|
|
170
179
|
[style.disabled]: disabled.value || loading.value,
|
|
171
180
|
[style.hasLeftIcon]: hasLeftIcon.value,
|
|
172
181
|
[style.hasRightIcon]: hasRightIcon.value,
|
|
182
|
+
[style.hasClear]: props.clearable,
|
|
183
|
+
[style.hasClearAndRightIcon]: props.clearable && hasRightIcon.value,
|
|
173
184
|
}
|
|
174
185
|
];
|
|
175
186
|
|
|
@@ -193,8 +204,41 @@ export default defineComponent({
|
|
|
193
204
|
return formError.value || props.error;
|
|
194
205
|
});
|
|
195
206
|
|
|
207
|
+
// Tracks typed text so clearable works without v-model
|
|
208
|
+
const internalValue = ref<any>(props.modelValue ?? '');
|
|
209
|
+
watch(() => props.modelValue, value => {
|
|
210
|
+
internalValue.value = value ?? '';
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const currentValue = computed(() => {
|
|
214
|
+
const value = props.modelValue !== undefined ? props.modelValue : internalValue.value;
|
|
215
|
+
return value || '';
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
const onNativeInput = (event: Event) => {
|
|
219
|
+
internalValue.value = (event.target as HTMLInputElement).value;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
const showClear = computed(() => {
|
|
223
|
+
return props.clearable
|
|
224
|
+
&& !disabled.value
|
|
225
|
+
&& !loading.value
|
|
226
|
+
&& !props.readonly
|
|
227
|
+
&& currentValue.value !== '';
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const clearClasses = computed(() => {
|
|
231
|
+
return [
|
|
232
|
+
style.clear,
|
|
233
|
+
{ [style.clearWithRightIcon]: hasRightIcon.value }
|
|
234
|
+
];
|
|
235
|
+
});
|
|
236
|
+
|
|
196
237
|
const onClear = () => {
|
|
238
|
+
internalValue.value = '';
|
|
197
239
|
emit('update:modelValue', '');
|
|
240
|
+
emit('clear');
|
|
241
|
+
focus();
|
|
198
242
|
};
|
|
199
243
|
|
|
200
244
|
expose({
|
|
@@ -220,6 +264,10 @@ export default defineComponent({
|
|
|
220
264
|
hasHelpMessage,
|
|
221
265
|
inputError,
|
|
222
266
|
style,
|
|
267
|
+
showClear,
|
|
268
|
+
clearClasses,
|
|
269
|
+
currentValue,
|
|
270
|
+
onNativeInput,
|
|
223
271
|
|
|
224
272
|
onClear,
|
|
225
273
|
validate,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="display: flex; flex-direction: column; gap: 12px; max-width: 320px;">
|
|
3
|
+
<MInput v-model="value" placeholder="Type something..." clearable />
|
|
4
|
+
<MInput v-model="value" placeholder="With a right icon" clearable>
|
|
5
|
+
<template #icon-right>
|
|
6
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 20px; height: 20px;">
|
|
7
|
+
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd" />
|
|
8
|
+
</svg>
|
|
9
|
+
</template>
|
|
10
|
+
</MInput>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { ref } from 'vue';
|
|
16
|
+
|
|
17
|
+
const value = ref('Clear me');
|
|
18
|
+
</script>
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
MInputPrefix,
|
|
6
6
|
MInputLeftIcon,
|
|
7
7
|
MInputRightIcon,
|
|
8
|
-
MInputSizes
|
|
8
|
+
MInputSizes,
|
|
9
|
+
MInputClearable
|
|
9
10
|
} from './index';
|
|
10
11
|
|
|
11
12
|
import { createStory, sizeArgType } from '../../../__storybook__';
|
|
@@ -24,3 +25,4 @@ export const Prefix = createStory(MInputPrefix);
|
|
|
24
25
|
export const Sizes = createStory(MInputSizes);
|
|
25
26
|
export const LeftIcon = createStory(MInputLeftIcon);
|
|
26
27
|
export const RightIcon = createStory(MInputRightIcon);
|
|
28
|
+
export const Clearable = createStory(MInputClearable);
|
|
@@ -4,3 +4,4 @@ export { default as MInputPrefix } from './prefix.vue';
|
|
|
4
4
|
export { default as MInputSizes } from './sizes.vue';
|
|
5
5
|
export { default as MInputLeftIcon } from './left-icon.vue';
|
|
6
6
|
export { default as MInputRightIcon } from './right-icon.vue';
|
|
7
|
+
export { default as MInputClearable } from './clearable.vue';
|
|
@@ -251,6 +251,25 @@ export const hasRightIcon = style({
|
|
|
251
251
|
paddingRight: '2.25rem'
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
+
export const hasClear = style({
|
|
255
|
+
paddingRight: '1.75rem'
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
export const hasClearAndRightIcon = style({
|
|
259
|
+
paddingRight: '4rem'
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
export const clear = style({
|
|
263
|
+
position: 'absolute',
|
|
264
|
+
top: '50%',
|
|
265
|
+
right: themeVars.space[1],
|
|
266
|
+
transform: 'translateY(-50%)'
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
export const clearWithRightIcon = style({
|
|
270
|
+
right: '2.25rem'
|
|
271
|
+
});
|
|
272
|
+
|
|
254
273
|
export const prefix = style({
|
|
255
274
|
pointerEvents: 'none',
|
|
256
275
|
marginRight: themeVars.space[3],
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-down-icon lucide-chevron-down"><path d="m6 9 6 6 6-6"/></svg>
|
|
36
36
|
</span>
|
|
37
37
|
</div>
|
|
38
|
+
<MClearButton v-if="showClear" :class="style.clear" @clear="clearSelected" />
|
|
38
39
|
</div>
|
|
39
40
|
</PopoverTrigger>
|
|
40
41
|
|
|
@@ -121,6 +122,7 @@ import {
|
|
|
121
122
|
type PropType
|
|
122
123
|
} from 'vue';
|
|
123
124
|
import MTag from '../tag/Tag.vue';
|
|
125
|
+
import MClearButton from '../clearbutton/ClearButton.vue';
|
|
124
126
|
import { VList } from 'virtua/vue';
|
|
125
127
|
import * as style from './style';
|
|
126
128
|
|
|
@@ -140,7 +142,8 @@ export default defineComponent({
|
|
|
140
142
|
emits: {
|
|
141
143
|
...useInput.emits(),
|
|
142
144
|
'on-open': () => true,
|
|
143
|
-
'on-close': () => true
|
|
145
|
+
'on-close': () => true,
|
|
146
|
+
clear: () => true
|
|
144
147
|
},
|
|
145
148
|
props: {
|
|
146
149
|
...useInput.props(),
|
|
@@ -226,6 +229,10 @@ export default defineComponent({
|
|
|
226
229
|
zIndex: {
|
|
227
230
|
type: Number
|
|
228
231
|
},
|
|
232
|
+
clearable: {
|
|
233
|
+
type: Boolean,
|
|
234
|
+
default: false
|
|
235
|
+
},
|
|
229
236
|
showDataOptions: {
|
|
230
237
|
type: Boolean,
|
|
231
238
|
default: true
|
|
@@ -235,6 +242,7 @@ export default defineComponent({
|
|
|
235
242
|
},
|
|
236
243
|
components: {
|
|
237
244
|
MTag,
|
|
245
|
+
MClearButton,
|
|
238
246
|
VList,
|
|
239
247
|
PopoverContent,
|
|
240
248
|
PopoverPortal,
|
|
@@ -615,6 +623,25 @@ export default defineComponent({
|
|
|
615
623
|
}
|
|
616
624
|
}
|
|
617
625
|
|
|
626
|
+
const hasValue = computed(() => {
|
|
627
|
+
return props.multiple
|
|
628
|
+
? Array.isArray(selected.value) && selected.value.length > 0
|
|
629
|
+
: !!selected.value;
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
const showClear = computed(() => {
|
|
633
|
+
return props.clearable
|
|
634
|
+
&& hasValue.value
|
|
635
|
+
&& !disabled.value
|
|
636
|
+
&& !loading.value;
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
function clearSelected() {
|
|
640
|
+
selected.value = props.multiple ? [] : '';
|
|
641
|
+
emit('clear');
|
|
642
|
+
container.value?.focus();
|
|
643
|
+
}
|
|
644
|
+
|
|
618
645
|
function removeSelected(value: string | number) {
|
|
619
646
|
if (!props.multiple) {
|
|
620
647
|
return;
|
|
@@ -783,6 +810,7 @@ export default defineComponent({
|
|
|
783
810
|
style.base,
|
|
784
811
|
style.sizes[props.size],
|
|
785
812
|
{
|
|
813
|
+
[style.hasClear]: showClear.value,
|
|
786
814
|
[style.selectedTags]:
|
|
787
815
|
props.multiple &&
|
|
788
816
|
Array.isArray(selected.value) &&
|
|
@@ -954,6 +982,8 @@ export default defineComponent({
|
|
|
954
982
|
getSelectedLabel,
|
|
955
983
|
openSelect,
|
|
956
984
|
removeSelected,
|
|
985
|
+
showClear,
|
|
986
|
+
clearSelected,
|
|
957
987
|
inputError,
|
|
958
988
|
transitionName,
|
|
959
989
|
inputListeners,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="display: flex; flex-direction: column; gap: 12px; max-width: 320px;">
|
|
3
|
+
<MSelect v-model="single" :options="options" clearable />
|
|
4
|
+
<MSelect v-model="multiple" :options="options" multiple clearable />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts" setup>
|
|
9
|
+
import { ref } from 'vue';
|
|
10
|
+
|
|
11
|
+
const options = Array.from({ length: 10 }, (_, i) => ({
|
|
12
|
+
value: i + 1,
|
|
13
|
+
label: `Option ${i + 1}`
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
const single = ref(2);
|
|
17
|
+
const multiple = ref([1, 2]);
|
|
18
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import MSelect from '../Select.vue';
|
|
2
|
-
import { MSelectBasic, MSelectSearchable, MSelectMultiple, MSelectFill } from './index';
|
|
2
|
+
import { MSelectBasic, MSelectSearchable, MSelectMultiple, MSelectFill, MSelectClearable } from './index';
|
|
3
3
|
|
|
4
4
|
import { createStory, sizeArgType } from '../../../__storybook__';
|
|
5
5
|
|
|
@@ -15,3 +15,4 @@ export const Basic = createStory(MSelectBasic);
|
|
|
15
15
|
export const Searchable = createStory(MSelectSearchable);
|
|
16
16
|
export const Multiple = createStory(MSelectMultiple);
|
|
17
17
|
export const Fill = createStory(MSelectFill);
|
|
18
|
+
export const Clearable = createStory(MSelectClearable);
|
|
@@ -2,3 +2,4 @@ export { default as MSelectBasic } from './basic.vue';
|
|
|
2
2
|
export { default as MSelectSearchable } from './searchable.vue';
|
|
3
3
|
export { default as MSelectMultiple } from './multiple.vue';
|
|
4
4
|
export { default as MSelectFill } from './fill.vue';
|
|
5
|
+
export { default as MSelectClearable } from './clearable.vue';
|
|
@@ -379,13 +379,15 @@ export const noResults = style({
|
|
|
379
379
|
fontSize: themeVars.fontSize.small
|
|
380
380
|
});
|
|
381
381
|
|
|
382
|
-
export const
|
|
383
|
-
width: themeVars.space[4],
|
|
384
|
-
height: themeVars.space[4],
|
|
382
|
+
export const clear = style({
|
|
385
383
|
position: 'absolute',
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
384
|
+
top: '50%',
|
|
385
|
+
right: '2.25rem',
|
|
386
|
+
transform: 'translateY(-50%)'
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
export const hasClear = style({
|
|
390
|
+
paddingRight: '3.75rem'
|
|
389
391
|
});
|
|
390
392
|
|
|
391
393
|
export const arrow = style({
|
|
@@ -17,12 +17,14 @@
|
|
|
17
17
|
:value="textareaValue"
|
|
18
18
|
:readonly="readonly"
|
|
19
19
|
v-on="inputListeners"
|
|
20
|
+
@input="onNativeInput"
|
|
20
21
|
:class="inputComputedClasses"
|
|
21
22
|
v-bind="$attrs"
|
|
22
23
|
:disabled="disabled || loading"
|
|
23
24
|
:aria-disabled="disabled ? 'true' : 'false'"
|
|
24
25
|
:aria-labelledby="`${id}-label`"
|
|
25
26
|
/>
|
|
27
|
+
<MClearButton v-if="showClear" :class="style.clear" @clear="onClear" />
|
|
26
28
|
</div>
|
|
27
29
|
<div v-if="inputError" :class="style.errorMessage">
|
|
28
30
|
{{ inputError }}
|
|
@@ -37,14 +39,17 @@ import {
|
|
|
37
39
|
defineComponent,
|
|
38
40
|
ref,
|
|
39
41
|
computed,
|
|
40
|
-
toRef
|
|
42
|
+
toRef,
|
|
43
|
+
watch
|
|
41
44
|
} from "vue";
|
|
42
45
|
import { useInput } from "../../composables/useInput";
|
|
43
46
|
import { useInteractive } from "../../composables/useInteractive";
|
|
47
|
+
import MClearButton from '../clearbutton/ClearButton.vue';
|
|
44
48
|
import * as style from './style';
|
|
45
49
|
|
|
46
50
|
export default defineComponent({
|
|
47
51
|
name: 'MTextArea',
|
|
52
|
+
components: { MClearButton },
|
|
48
53
|
props: {
|
|
49
54
|
...useInput.props(),
|
|
50
55
|
...useInteractive.props(),
|
|
@@ -87,8 +92,12 @@ export default defineComponent({
|
|
|
87
92
|
type: Number,
|
|
88
93
|
default: 64
|
|
89
94
|
},
|
|
95
|
+
clearable: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: false
|
|
98
|
+
},
|
|
90
99
|
},
|
|
91
|
-
emits: useInput.emits(),
|
|
100
|
+
emits: [...useInput.emits(), 'clear'],
|
|
92
101
|
setup(props, { emit, expose }) {
|
|
93
102
|
const element = ref<HTMLTextAreaElement | null>(null);
|
|
94
103
|
const { focus, blur } = useInteractive(element);
|
|
@@ -136,6 +145,7 @@ export default defineComponent({
|
|
|
136
145
|
[style.block]: props.block,
|
|
137
146
|
[style.disabled]: disabled.value || loading.value,
|
|
138
147
|
[style.error]: inputError.value,
|
|
148
|
+
[style.hasClear]: props.clearable,
|
|
139
149
|
}
|
|
140
150
|
];
|
|
141
151
|
});
|
|
@@ -144,12 +154,36 @@ export default defineComponent({
|
|
|
144
154
|
return formError.value || props.error;
|
|
145
155
|
});
|
|
146
156
|
|
|
157
|
+
// Tracks typed text so clearable works without v-model
|
|
158
|
+
const internalValue = ref('');
|
|
159
|
+
watch(() => props.modelValue, value => {
|
|
160
|
+
internalValue.value = value == null ? '' : String(value);
|
|
161
|
+
}, { immediate: true });
|
|
162
|
+
|
|
147
163
|
const textareaValue = computed(() => {
|
|
148
|
-
|
|
164
|
+
if (props.modelValue !== undefined) {
|
|
165
|
+
return props.modelValue == null ? '' : String(props.modelValue);
|
|
166
|
+
}
|
|
167
|
+
return internalValue.value;
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const onNativeInput = (event: Event) => {
|
|
171
|
+
internalValue.value = (event.target as HTMLTextAreaElement).value;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const showClear = computed(() => {
|
|
175
|
+
return props.clearable
|
|
176
|
+
&& !disabled.value
|
|
177
|
+
&& !loading.value
|
|
178
|
+
&& !readonly.value
|
|
179
|
+
&& textareaValue.value !== '';
|
|
149
180
|
});
|
|
150
181
|
|
|
151
182
|
const onClear = () => {
|
|
183
|
+
internalValue.value = '';
|
|
152
184
|
emit('update:modelValue', '');
|
|
185
|
+
emit('clear');
|
|
186
|
+
focus();
|
|
153
187
|
};
|
|
154
188
|
|
|
155
189
|
expose({
|
|
@@ -171,6 +205,8 @@ export default defineComponent({
|
|
|
171
205
|
textareaValue,
|
|
172
206
|
inputError,
|
|
173
207
|
style,
|
|
208
|
+
showClear,
|
|
209
|
+
onNativeInput,
|
|
174
210
|
|
|
175
211
|
onClear,
|
|
176
212
|
validate,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MTextArea
|
|
3
|
+
v-model="value"
|
|
4
|
+
label="Some Text"
|
|
5
|
+
name="text"
|
|
6
|
+
placeholder="Some text placeholder"
|
|
7
|
+
:height="128"
|
|
8
|
+
clearable
|
|
9
|
+
/>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
|
|
15
|
+
const value = ref('Clear me');
|
|
16
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import MTextarea from '../Textarea.vue';
|
|
2
|
-
import { MTextareaBasic } from './index';
|
|
2
|
+
import { MTextareaBasic, MTextareaClearable } from './index';
|
|
3
3
|
|
|
4
4
|
import { createStory, sizeArgType } from '../../../__storybook__';
|
|
5
5
|
|
|
@@ -12,3 +12,4 @@ export default {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export const Basic = createStory(MTextareaBasic);
|
|
15
|
+
export const Clearable = createStory(MTextareaClearable);
|
|
@@ -144,6 +144,16 @@ export const disabled = style({
|
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
+
export const hasClear = style({
|
|
148
|
+
paddingRight: '1.75rem'
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export const clear = style({
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
top: themeVars.space[1],
|
|
154
|
+
right: themeVars.space[1]
|
|
155
|
+
});
|
|
156
|
+
|
|
147
157
|
export const label = style({
|
|
148
158
|
fontWeight: '500',
|
|
149
159
|
display: 'inline-block',
|