@dataloop-ai/components 0.16.24 → 0.16.25
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/package.json
CHANGED
|
@@ -3,161 +3,164 @@
|
|
|
3
3
|
:id="uuid"
|
|
4
4
|
:class="rootContainerClasses"
|
|
5
5
|
>
|
|
6
|
-
<div
|
|
7
|
-
v-show="!!title.length || !!tooltip.length"
|
|
8
|
-
:class="{
|
|
9
|
-
'dl-text-input__title-container': true,
|
|
10
|
-
'dl-text-input__title-container--s': isSmall
|
|
11
|
-
}"
|
|
12
|
-
>
|
|
13
|
-
<label
|
|
14
|
-
v-show="!!title.length"
|
|
15
|
-
class="dl-text-input__title"
|
|
16
|
-
>
|
|
17
|
-
{{ title
|
|
18
|
-
}}<span
|
|
19
|
-
v-show="required"
|
|
20
|
-
:class="asteriskClasses"
|
|
21
|
-
> *</span>
|
|
22
|
-
{{ !required && optional ? ' (Optional)' : null }}
|
|
23
|
-
</label>
|
|
24
|
-
<span v-show="!!tooltip.length">
|
|
25
|
-
<dl-icon
|
|
26
|
-
class="dl-text-input__tooltip-icon"
|
|
27
|
-
icon="icon-dl-info"
|
|
28
|
-
size="12px"
|
|
29
|
-
/>
|
|
30
|
-
<dl-tooltip>
|
|
31
|
-
{{ tooltip }}
|
|
32
|
-
</dl-tooltip>
|
|
33
|
-
</span>
|
|
34
|
-
</div>
|
|
35
|
-
<div
|
|
36
|
-
v-show="!!topMessage.length && !isSmall"
|
|
37
|
-
class="dl-text-input__top-message-container"
|
|
38
|
-
>
|
|
39
|
-
<dl-info-error-message
|
|
40
|
-
v-show="!!topMessage.length"
|
|
41
|
-
position="above"
|
|
42
|
-
:value="topMessage"
|
|
43
|
-
/>
|
|
44
|
-
</div>
|
|
45
|
-
<div class="dl-text-input__input-wrapper">
|
|
46
|
-
<input
|
|
47
|
-
ref="input"
|
|
48
|
-
:value="modelValue"
|
|
49
|
-
:class="inputClasses"
|
|
50
|
-
:placeholder="placeholder"
|
|
51
|
-
:maxlength="maxLength"
|
|
52
|
-
:type="showPass ? 'text' : type"
|
|
53
|
-
:disabled="disabled"
|
|
54
|
-
:readonly="readonly"
|
|
55
|
-
@input="onChange"
|
|
56
|
-
@focus="onFocus"
|
|
57
|
-
@blur="debouncedBlur()"
|
|
58
|
-
@keyup.enter="onKeyPress"
|
|
59
|
-
>
|
|
6
|
+
<div :class="wrapperClasses">
|
|
60
7
|
<div
|
|
61
|
-
v-show="
|
|
62
|
-
:class="
|
|
63
|
-
|
|
64
|
-
'dl-text-
|
|
65
|
-
|
|
8
|
+
v-show="!!title.length || !!tooltip.length"
|
|
9
|
+
:class="{
|
|
10
|
+
'dl-text-input__title-container': true,
|
|
11
|
+
'dl-text-input__title-container--s': isSmall
|
|
12
|
+
}"
|
|
66
13
|
>
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
flat
|
|
84
|
-
fluid
|
|
85
|
-
@click="onClear"
|
|
86
|
-
/>
|
|
87
|
-
<dl-tooltip v-if="clearButtonTooltip">
|
|
88
|
-
Remove text
|
|
89
|
-
</dl-tooltip>
|
|
90
|
-
</span>
|
|
91
|
-
<span v-show="showShowPassBtn">
|
|
92
|
-
<dl-button
|
|
93
|
-
ref="input-show-pass-button"
|
|
94
|
-
:icon="passShowIcon"
|
|
95
|
-
size="s"
|
|
96
|
-
text-color="dl-color-darker"
|
|
97
|
-
flat
|
|
98
|
-
fluid
|
|
99
|
-
@click="onPassShowClick"
|
|
14
|
+
<label
|
|
15
|
+
v-show="!!title.length"
|
|
16
|
+
class="dl-text-input__title"
|
|
17
|
+
>
|
|
18
|
+
{{ title
|
|
19
|
+
}}<span
|
|
20
|
+
v-show="required"
|
|
21
|
+
:class="asteriskClasses"
|
|
22
|
+
> *</span>
|
|
23
|
+
{{ !required && optional ? ' (Optional)' : null }}
|
|
24
|
+
</label>
|
|
25
|
+
<span v-show="!!tooltip.length">
|
|
26
|
+
<dl-icon
|
|
27
|
+
class="dl-text-input__tooltip-icon"
|
|
28
|
+
icon="icon-dl-info"
|
|
29
|
+
size="12px"
|
|
100
30
|
/>
|
|
101
31
|
<dl-tooltip>
|
|
102
|
-
{{
|
|
32
|
+
{{ tooltip }}
|
|
103
33
|
</dl-tooltip>
|
|
104
34
|
</span>
|
|
105
35
|
</div>
|
|
106
36
|
<div
|
|
107
|
-
v-show="
|
|
108
|
-
|
|
109
|
-
...adornmentClasses,
|
|
110
|
-
'dl-text-input__adornment-container--pos-right-out'
|
|
111
|
-
]"
|
|
37
|
+
v-show="!!topMessage.length"
|
|
38
|
+
class="dl-text-input__top-message-container"
|
|
112
39
|
>
|
|
113
|
-
<
|
|
40
|
+
<dl-info-error-message
|
|
41
|
+
v-show="!!topMessage.length"
|
|
42
|
+
position="above"
|
|
43
|
+
:value="topMessage"
|
|
44
|
+
/>
|
|
114
45
|
</div>
|
|
115
|
-
<dl-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
46
|
+
<div class="dl-text-input__input-wrapper">
|
|
47
|
+
<input
|
|
48
|
+
ref="input"
|
|
49
|
+
:value="modelValue"
|
|
50
|
+
:class="inputClasses"
|
|
51
|
+
:placeholder="placeholder"
|
|
52
|
+
:maxlength="maxLength"
|
|
53
|
+
:type="showPass ? 'text' : type"
|
|
54
|
+
:disabled="disabled"
|
|
55
|
+
:readonly="readonly"
|
|
56
|
+
@input="onChange"
|
|
57
|
+
@focus="onFocus"
|
|
58
|
+
@blur="debouncedBlur()"
|
|
59
|
+
@keyup.enter="onKeyPress"
|
|
60
|
+
>
|
|
61
|
+
<div
|
|
62
|
+
v-show="hasPrepend"
|
|
63
|
+
:class="[
|
|
64
|
+
...adornmentClasses,
|
|
65
|
+
'dl-text-input__adornment-container--pos-left'
|
|
66
|
+
]"
|
|
67
|
+
>
|
|
68
|
+
<slot name="prepend" />
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
v-show="hasAppend"
|
|
72
|
+
:class="[
|
|
73
|
+
...adornmentClasses,
|
|
74
|
+
'dl-text-input__adornment-container--pos-right'
|
|
75
|
+
]"
|
|
76
|
+
>
|
|
77
|
+
<slot name="append" />
|
|
78
|
+
<span v-show="showClearBtn">
|
|
79
|
+
<dl-button
|
|
80
|
+
ref="input-clear-button"
|
|
81
|
+
icon="icon-dl-close"
|
|
82
|
+
size="s"
|
|
83
|
+
text-color="dl-color-darker"
|
|
84
|
+
flat
|
|
85
|
+
fluid
|
|
86
|
+
@click="onClear"
|
|
87
|
+
/>
|
|
88
|
+
<dl-tooltip v-if="clearButtonTooltip">
|
|
89
|
+
Remove text
|
|
90
|
+
</dl-tooltip>
|
|
91
|
+
</span>
|
|
92
|
+
<span v-show="showShowPassBtn">
|
|
93
|
+
<dl-button
|
|
94
|
+
ref="input-show-pass-button"
|
|
95
|
+
:icon="passShowIcon"
|
|
96
|
+
size="s"
|
|
97
|
+
text-color="dl-color-darker"
|
|
98
|
+
flat
|
|
99
|
+
fluid
|
|
100
|
+
@click="onPassShowClick"
|
|
101
|
+
/>
|
|
102
|
+
<dl-tooltip>
|
|
103
|
+
{{ showPass ? 'Hide' : 'Show' }}
|
|
104
|
+
</dl-tooltip>
|
|
105
|
+
</span>
|
|
106
|
+
</div>
|
|
107
|
+
<div
|
|
108
|
+
v-show="hasAction"
|
|
109
|
+
:class="[
|
|
110
|
+
...adornmentClasses,
|
|
111
|
+
'dl-text-input__adornment-container--pos-right-out'
|
|
112
|
+
]"
|
|
128
113
|
>
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
114
|
+
<slot name="action" />
|
|
115
|
+
</div>
|
|
116
|
+
<dl-menu
|
|
117
|
+
v-if="showSuggestItems"
|
|
118
|
+
v-model="isMenuOpen"
|
|
119
|
+
auto-close
|
|
120
|
+
no-focus
|
|
121
|
+
:offset="[0, 3]"
|
|
122
|
+
fit-container
|
|
123
|
+
:fit-content="fitContent"
|
|
124
|
+
@click="onMenuShow"
|
|
125
|
+
>
|
|
126
|
+
<dl-list
|
|
127
|
+
bordered
|
|
128
|
+
:style="{ maxWidth: suggestMenuWidth }"
|
|
135
129
|
>
|
|
136
|
-
<
|
|
137
|
-
v-for="
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
:class="{
|
|
143
|
-
'dl-text-input__suggestion--highlighted':
|
|
144
|
-
word.highlighted
|
|
145
|
-
}"
|
|
130
|
+
<dl-list-item
|
|
131
|
+
v-for="item in suggestItems"
|
|
132
|
+
:key="item"
|
|
133
|
+
clickable
|
|
134
|
+
style="font-size: 12px"
|
|
135
|
+
@click="onClick($event, item)"
|
|
146
136
|
>
|
|
147
|
-
<span v-show="word.value[0] === ' '"> </span>
|
|
148
|
-
{{ word.value }}
|
|
149
137
|
<span
|
|
150
|
-
v-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
138
|
+
v-for="(word, index) in getSuggestWords(
|
|
139
|
+
item,
|
|
140
|
+
modelValue
|
|
141
|
+
)"
|
|
142
|
+
:key="JSON.stringify(word) + index"
|
|
143
|
+
:class="{
|
|
144
|
+
'dl-text-input__suggestion--highlighted':
|
|
145
|
+
word.highlighted
|
|
146
|
+
}"
|
|
147
|
+
>
|
|
148
|
+
<span v-show="word.value[0] === ' '"> </span>
|
|
149
|
+
{{ word.value }}
|
|
150
|
+
<span
|
|
151
|
+
v-show="
|
|
152
|
+
word.value[word.value.length - 1] ===
|
|
153
|
+
' '
|
|
154
|
+
"
|
|
155
|
+
> </span>
|
|
156
|
+
</span>
|
|
157
|
+
</dl-list-item>
|
|
158
|
+
</dl-list>
|
|
159
|
+
</dl-menu>
|
|
160
|
+
</div>
|
|
158
161
|
</div>
|
|
159
162
|
<div
|
|
160
|
-
v-if="
|
|
163
|
+
v-if="bottomMessage"
|
|
161
164
|
class="dl-text-input__bottom-message-container"
|
|
162
165
|
>
|
|
163
166
|
<dl-info-error-message
|
|
@@ -448,6 +451,15 @@ export default defineComponent({
|
|
|
448
451
|
: this.inputLength
|
|
449
452
|
|
|
450
453
|
return `${chars}/${this.maxLength}`
|
|
454
|
+
},
|
|
455
|
+
wrapperClasses(): string {
|
|
456
|
+
let classes = 'flex items-center'
|
|
457
|
+
|
|
458
|
+
if (this.isSmall) {
|
|
459
|
+
classes += ' no-wrap'
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return classes
|
|
451
463
|
}
|
|
452
464
|
},
|
|
453
465
|
methods: {
|
|
@@ -602,6 +614,7 @@ export default defineComponent({
|
|
|
602
614
|
|
|
603
615
|
&--s {
|
|
604
616
|
display: flex;
|
|
617
|
+
flex-wrap: wrap;
|
|
605
618
|
align-items: center;
|
|
606
619
|
}
|
|
607
620
|
|