@dataloop-ai/components 0.18.113 → 0.18.115
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 +1 -1
- package/src/components/compound/DlDateTime/DlDatePicker/DlDatePicker.vue +1 -0
- package/src/components/compound/DlDateTime/DlDatePicker/components/DlMonthCalendar.vue +13 -6
- package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +5 -0
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +17 -3
- package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +13 -0
package/package.json
CHANGED
|
@@ -100,19 +100,26 @@ export default defineComponent({
|
|
|
100
100
|
methods: {
|
|
101
101
|
handleClick(value: number) {
|
|
102
102
|
const d = new CalendarDate()
|
|
103
|
-
d.year(parseInt(this.title)).month(value)
|
|
103
|
+
d.year(parseInt(this.title)).month(value)
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
const from = new CalendarDate(d)
|
|
106
|
+
const to = new CalendarDate(d)
|
|
107
|
+
|
|
108
|
+
from.startOf('month')
|
|
109
|
+
from.startOf('day')
|
|
110
|
+
to.endOf('month')
|
|
111
|
+
to.endOf('day')
|
|
112
|
+
|
|
113
|
+
if (!isInRange(this.availableRange, new CalendarDate(from))) return
|
|
114
|
+
if (!isInRange(this.availableRange, new CalendarDate(to))) return
|
|
106
115
|
|
|
107
|
-
const date = d.toDate()
|
|
108
116
|
const newDate = {
|
|
109
|
-
from:
|
|
110
|
-
to:
|
|
117
|
+
from: from.toDate(),
|
|
118
|
+
to: to.toDate()
|
|
111
119
|
}
|
|
112
120
|
this.$emit('update:model-value', newDate)
|
|
113
121
|
this.$emit('change', newDate)
|
|
114
122
|
},
|
|
115
|
-
|
|
116
123
|
handleMouseenter(value: number) {
|
|
117
124
|
if (this.modelValue === null) return
|
|
118
125
|
|
|
@@ -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
|
|