@dataloop-ai/components 0.18.20 → 0.18.22
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 +5 -2
- package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +3 -3
- package/src/components/compound/DlSelect/DlSelect.vue +9 -7
- package/src/components/compound/DlSelect/utils.ts +6 -0
package/package.json
CHANGED
|
@@ -249,7 +249,7 @@ export default defineComponent({
|
|
|
249
249
|
|
|
250
250
|
this.dateInterval = { from: date, to: date }
|
|
251
251
|
|
|
252
|
-
if (this.singleSelection) {
|
|
252
|
+
if (!this.singleSelection) {
|
|
253
253
|
this.isSelectionMode = true
|
|
254
254
|
} else {
|
|
255
255
|
this.updateModelValue(this.dateInterval)
|
|
@@ -297,7 +297,10 @@ export default defineComponent({
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
this.dateInterval = {
|
|
300
|
+
this.dateInterval = {
|
|
301
|
+
from: this.dateInterval.from,
|
|
302
|
+
to: date
|
|
303
|
+
}
|
|
301
304
|
}
|
|
302
305
|
}
|
|
303
306
|
})
|
|
@@ -442,9 +442,9 @@ export default defineComponent({
|
|
|
442
442
|
this.dateInterval = {
|
|
443
443
|
from: value.from,
|
|
444
444
|
to: new Date(
|
|
445
|
-
value.
|
|
446
|
-
value.
|
|
447
|
-
value.
|
|
445
|
+
value.to.getFullYear(),
|
|
446
|
+
value.to.getMonth(),
|
|
447
|
+
value.to.getDate(),
|
|
448
448
|
23,
|
|
449
449
|
59
|
|
450
450
|
)
|
|
@@ -324,7 +324,8 @@ import {
|
|
|
324
324
|
getIconSize,
|
|
325
325
|
optionsValidator,
|
|
326
326
|
DlSelectOptionType,
|
|
327
|
-
getLabelOfSelectedOption
|
|
327
|
+
getLabelOfSelectedOption,
|
|
328
|
+
getCaseInsensitiveInput
|
|
328
329
|
} from './utils'
|
|
329
330
|
import DlSelectOption from './components/DlSelectOption.vue'
|
|
330
331
|
import { isEqual } from 'lodash'
|
|
@@ -836,14 +837,15 @@ export default defineComponent({
|
|
|
836
837
|
this.$emit('search-input', searchValue)
|
|
837
838
|
},
|
|
838
839
|
getOptionHtml(option: DlSelectOptionType) {
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
label = label.toLowerCase()
|
|
842
|
-
}
|
|
840
|
+
const label = `${this.getOptionLabel(option)}`
|
|
841
|
+
const toReplace = new RegExp(this.searchInputValue, 'gi')
|
|
843
842
|
|
|
844
843
|
const highlightedHtml = label.replace(
|
|
845
|
-
|
|
846
|
-
`<span style="background: var(--dl-color-warning)">${
|
|
844
|
+
toReplace,
|
|
845
|
+
`<span style="background: var(--dl-color-warning)">${getCaseInsensitiveInput(
|
|
846
|
+
label,
|
|
847
|
+
this.searchInputValue
|
|
848
|
+
)}</span>`
|
|
847
849
|
)
|
|
848
850
|
const html = `<span>${highlightedHtml}</span>`
|
|
849
851
|
|
|
@@ -44,3 +44,9 @@ export const optionsValidator = (opts: DlSelectOptionType[]) => {
|
|
|
44
44
|
return keys.includes('value') && keys.includes('label')
|
|
45
45
|
})
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
export const getCaseInsensitiveInput = (label: string, input: string) => {
|
|
49
|
+
const inputRegexp = new RegExp(input, 'gi')
|
|
50
|
+
const position = label.search(inputRegexp)
|
|
51
|
+
return label.slice(position, input.length)
|
|
52
|
+
}
|