@dataloop-ai/components 0.18.113 → 0.18.114
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
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
:schema="schema"
|
|
18
18
|
:color-schema="colorSchema"
|
|
19
19
|
:strict="strict"
|
|
20
|
+
:placeholder="placeholder"
|
|
20
21
|
@focus="isFocused = true"
|
|
21
22
|
@blur="isFocused = false"
|
|
22
23
|
/>
|
|
@@ -130,6 +131,10 @@ export default defineComponent({
|
|
|
130
131
|
strict: {
|
|
131
132
|
type: Boolean,
|
|
132
133
|
default: false
|
|
134
|
+
},
|
|
135
|
+
placeholder: {
|
|
136
|
+
type: String,
|
|
137
|
+
default: ''
|
|
133
138
|
}
|
|
134
139
|
},
|
|
135
140
|
emits: ['save-query', 'remove-query', 'search-query', 'update:model-value'],
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
ref="input"
|
|
25
25
|
:class="inputClass"
|
|
26
26
|
:style="textareaStyles"
|
|
27
|
-
:placeholder="
|
|
27
|
+
:placeholder="inputPlaceholder"
|
|
28
28
|
:contenteditable="!disabled"
|
|
29
29
|
@keypress="onKeyPress"
|
|
30
30
|
@input="onInput"
|
|
@@ -431,6 +431,10 @@ export default defineComponent({
|
|
|
431
431
|
if (e.key === 'Enter') {
|
|
432
432
|
e.preventDefault()
|
|
433
433
|
}
|
|
434
|
+
|
|
435
|
+
if (!focused.value) {
|
|
436
|
+
focus()
|
|
437
|
+
}
|
|
434
438
|
}
|
|
435
439
|
|
|
436
440
|
const onInput = (e: Event) => {
|
|
@@ -612,6 +616,13 @@ export default defineComponent({
|
|
|
612
616
|
message: error.value
|
|
613
617
|
}
|
|
614
618
|
})
|
|
619
|
+
|
|
620
|
+
const inputPlaceholder = computed(() => {
|
|
621
|
+
return focused.value || searchQuery.value.length
|
|
622
|
+
? ''
|
|
623
|
+
: props.placeholder
|
|
624
|
+
})
|
|
625
|
+
|
|
615
626
|
//#endregion
|
|
616
627
|
|
|
617
628
|
//#region watcher
|
|
@@ -715,7 +726,8 @@ export default defineComponent({
|
|
|
715
726
|
onInput,
|
|
716
727
|
onDateSelection,
|
|
717
728
|
computedStatus,
|
|
718
|
-
setInputFromSuggestion
|
|
729
|
+
setInputFromSuggestion,
|
|
730
|
+
inputPlaceholder
|
|
719
731
|
}
|
|
720
732
|
}
|
|
721
733
|
})
|
|
@@ -831,8 +843,10 @@ export default defineComponent({
|
|
|
831
843
|
color: var(--dl-color-darker);
|
|
832
844
|
background-color: var(--dl-color-panel-background);
|
|
833
845
|
|
|
834
|
-
|
|
846
|
+
&::before {
|
|
835
847
|
color: var(--dl-color-lighter);
|
|
848
|
+
/* In case this causes render shadowing move to use html/injection approach */
|
|
849
|
+
content: attr(placeholder);
|
|
836
850
|
}
|
|
837
851
|
& > * {
|
|
838
852
|
display: flex;
|
|
@@ -70,6 +70,19 @@
|
|
|
70
70
|
/>
|
|
71
71
|
{{ queryObject }}
|
|
72
72
|
{{ queryObject2 }}
|
|
73
|
+
|
|
74
|
+
<br>
|
|
75
|
+
<br>
|
|
76
|
+
With placeholder
|
|
77
|
+
<dl-smart-search-input
|
|
78
|
+
v-model="queryObject"
|
|
79
|
+
:aliases="aliases"
|
|
80
|
+
:schema="schema"
|
|
81
|
+
:color-schema="colorSchema"
|
|
82
|
+
:strict="strictState"
|
|
83
|
+
:disabled="switchState"
|
|
84
|
+
placeholder="I am a placeholder"
|
|
85
|
+
/>
|
|
73
86
|
</div>
|
|
74
87
|
</template>
|
|
75
88
|
|