@dataloop-ai/components 0.17.20 → 0.17.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
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
:id="uuid"
|
|
4
4
|
:class="rootContainerClasses"
|
|
5
|
+
:style="cssVars"
|
|
5
6
|
>
|
|
6
7
|
<div :class="wrapperClasses">
|
|
7
8
|
<div
|
|
@@ -333,7 +334,11 @@ export default defineComponent({
|
|
|
333
334
|
type: Boolean,
|
|
334
335
|
default: false
|
|
335
336
|
},
|
|
336
|
-
fitContent: Boolean
|
|
337
|
+
fitContent: Boolean,
|
|
338
|
+
margin: {
|
|
339
|
+
type: String,
|
|
340
|
+
default: null
|
|
341
|
+
}
|
|
337
342
|
},
|
|
338
343
|
emits: ['input', 'focus', 'blur', 'clear', 'enter', 'update:model-value'],
|
|
339
344
|
setup(props, { emit }) {
|
|
@@ -396,6 +401,16 @@ export default defineComponent({
|
|
|
396
401
|
}
|
|
397
402
|
return classes
|
|
398
403
|
},
|
|
404
|
+
cssVars(): Record<string, any> {
|
|
405
|
+
let inputMargin = this.margin
|
|
406
|
+
|
|
407
|
+
if (!this.margin && this.isSmall) {
|
|
408
|
+
inputMargin = '0px 20px 0px 0px'
|
|
409
|
+
}
|
|
410
|
+
return {
|
|
411
|
+
'--dl-input-margin': inputMargin
|
|
412
|
+
}
|
|
413
|
+
},
|
|
399
414
|
inputClasses(): string[] {
|
|
400
415
|
const classes = [
|
|
401
416
|
'dl-text-input__input',
|
|
@@ -623,7 +638,7 @@ export default defineComponent({
|
|
|
623
638
|
|
|
624
639
|
<style scoped lang="scss">
|
|
625
640
|
.dl-text-input {
|
|
626
|
-
|
|
641
|
+
margin: var(--dl-input-margin);
|
|
627
642
|
|
|
628
643
|
/* Chrome, Safari, Edge, Opera */
|
|
629
644
|
input::-webkit-outer-spin-button,
|
|
@@ -33,11 +33,8 @@
|
|
|
33
33
|
</dl-input>
|
|
34
34
|
<dl-button
|
|
35
35
|
v-show="withSearchButton"
|
|
36
|
-
|
|
37
|
-
style="width: 20%; min-width: fit-content"
|
|
38
|
-
:size="size"
|
|
36
|
+
:size="buttonSize"
|
|
39
37
|
:class="buttonClasses"
|
|
40
|
-
fluid
|
|
41
38
|
@click="onSearchButtonPress"
|
|
42
39
|
>
|
|
43
40
|
Search
|
|
@@ -58,6 +55,11 @@ const SearchSizes = {
|
|
|
58
55
|
} as const
|
|
59
56
|
type TSearchSizes = (typeof SearchSizes)[keyof typeof SearchSizes]
|
|
60
57
|
|
|
58
|
+
const BUTTON_SIZES = {
|
|
59
|
+
l: 'l',
|
|
60
|
+
m: 's'
|
|
61
|
+
}
|
|
62
|
+
|
|
61
63
|
export default defineComponent({
|
|
62
64
|
name: 'DlSearch',
|
|
63
65
|
components: {
|
|
@@ -100,6 +102,9 @@ export default defineComponent({
|
|
|
100
102
|
}
|
|
101
103
|
},
|
|
102
104
|
computed: {
|
|
105
|
+
buttonSize(): string {
|
|
106
|
+
return BUTTON_SIZES[this.size]
|
|
107
|
+
},
|
|
103
108
|
identifierClass(): string {
|
|
104
109
|
return `dl-search-${this.placeholder}`.replaceAll(' ', '-')
|
|
105
110
|
},
|
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
placeholder="Search here"
|
|
9
9
|
:auto-suggest-items="suggestItems"
|
|
10
10
|
/>
|
|
11
|
+
|
|
12
|
+
<dl-search
|
|
13
|
+
v-model="searchValue"
|
|
14
|
+
size="m"
|
|
15
|
+
with-search-button
|
|
16
|
+
highlight-matches
|
|
17
|
+
placeholder="Search here"
|
|
18
|
+
:auto-suggest-items="suggestItems"
|
|
19
|
+
/>
|
|
11
20
|
</div>
|
|
12
21
|
</template>
|
|
13
22
|
|