@dataloop-ai/components 0.14.3 → 0.14.5
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 +2 -2
- package/src/components/DlChart/Doughnut/DlDoughnutChartLegend.vue +2 -2
- package/src/components/DlDialogBox/DlDialogBox.vue +8 -0
- package/src/components/DlDialogBox/DlDialogBoxHeader.vue +22 -6
- package/src/components/DlDropdownButton.vue +6 -16
- package/src/components/DlMenu/DlMenu.vue +4 -2
- package/src/components/DlPagination/RowsSelector.vue +1 -2
- package/src/components/DlPopup/DlPopup.vue +0 -1
- package/src/components/DlSelect/DlSelect.vue +22 -3
- package/src/components/DlSmartSearch/DlSuggestionsDropdown.vue +1 -1
- package/src/components/DlTextArea.vue +9 -4
- package/src/components/DlTextInput.vue +46 -8
- package/src/components/DlToastMessage/components/ToastComponent.vue +1 -1
- package/src/components/DlToastMessage/utils/render.ts +3 -1
- package/src/demo/DlChipDemo.vue +1 -1
- package/src/demo/DlDropdownButtonDemo.vue +1 -1
- package/src/demo/DlMenuDemo.vue +1 -1
- package/src/demo/DlOptionGroupDemo.vue +1 -1
- package/src/demo/DlSelectDemo.vue +1 -1
- package/src/demo/DlTextAreaDemo.vue +19 -13
- package/src/utils/position-engine.ts +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataloop-ai/components",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.5",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.ts",
|
|
6
6
|
"./models": "./models.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@dataloop-ai/icons": "^2.0.13",
|
|
25
25
|
"@types/lodash": "^4.14.184",
|
|
26
|
-
"chart.js": "^
|
|
26
|
+
"chart.js": "^3.9.1",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"moment": "^2.29.4",
|
|
29
29
|
"sass": "^1.51.0",
|
|
@@ -188,6 +188,14 @@ export default defineComponent({
|
|
|
188
188
|
height: 100vh !important;
|
|
189
189
|
border-radius: 0px;
|
|
190
190
|
}
|
|
191
|
+
&--right {
|
|
192
|
+
position: absolute !important;
|
|
193
|
+
right: 0;
|
|
194
|
+
}
|
|
195
|
+
&--left {
|
|
196
|
+
position: absolute !important;
|
|
197
|
+
left: 0;
|
|
198
|
+
}
|
|
191
199
|
}
|
|
192
200
|
|
|
193
201
|
.header {
|
|
@@ -10,11 +10,21 @@
|
|
|
10
10
|
style="padding: 0; margin-bottom: 10px"
|
|
11
11
|
@click.stop.prevent="$emit('onClose')"
|
|
12
12
|
/>
|
|
13
|
-
<h2
|
|
14
|
-
|
|
13
|
+
<h2
|
|
14
|
+
v-if="hasTitle"
|
|
15
|
+
class="title"
|
|
16
|
+
>
|
|
17
|
+
<slot name="title">
|
|
18
|
+
{{ title }}
|
|
19
|
+
</slot>
|
|
15
20
|
</h2>
|
|
16
|
-
<p
|
|
17
|
-
|
|
21
|
+
<p
|
|
22
|
+
v-if="hasSubtitle"
|
|
23
|
+
class="subtitle"
|
|
24
|
+
>
|
|
25
|
+
<slot name="subtitle">
|
|
26
|
+
{{ subtitle }}
|
|
27
|
+
</slot>
|
|
18
28
|
</p>
|
|
19
29
|
</div>
|
|
20
30
|
<dl-button
|
|
@@ -30,7 +40,7 @@
|
|
|
30
40
|
</template>
|
|
31
41
|
|
|
32
42
|
<script lang="ts">
|
|
33
|
-
import { defineComponent } from 'vue-demi'
|
|
43
|
+
import { computed, defineComponent } from 'vue-demi'
|
|
34
44
|
import { DlButton } from '../DlButton'
|
|
35
45
|
|
|
36
46
|
export default defineComponent({
|
|
@@ -44,7 +54,12 @@ export default defineComponent({
|
|
|
44
54
|
closeButton: { type: Boolean, default: true },
|
|
45
55
|
hasBackButton: Boolean
|
|
46
56
|
},
|
|
47
|
-
emits: ['onClose']
|
|
57
|
+
emits: ['onClose'],
|
|
58
|
+
setup(props, { slots }) {
|
|
59
|
+
const hasTitle = computed(() => !!props.title || !!slots.title)
|
|
60
|
+
const hasSubtitle = computed(() => !!props.subtitle || !!slots.subtitle)
|
|
61
|
+
return { hasTitle, hasSubtitle }
|
|
62
|
+
}
|
|
48
63
|
})
|
|
49
64
|
</script>
|
|
50
65
|
|
|
@@ -60,6 +75,7 @@ export default defineComponent({
|
|
|
60
75
|
font-size: var(--dl-font-size-h2);
|
|
61
76
|
margin: 0;
|
|
62
77
|
color: var(--dl-color-darker);
|
|
78
|
+
line-height: 2rem !important;
|
|
63
79
|
}
|
|
64
80
|
|
|
65
81
|
.subtitle {
|
|
@@ -78,7 +78,8 @@
|
|
|
78
78
|
:class="contentClass"
|
|
79
79
|
:style="contentStyle"
|
|
80
80
|
:cover="cover"
|
|
81
|
-
fit
|
|
81
|
+
fit-container
|
|
82
|
+
:fit-content="fitContent"
|
|
82
83
|
:persistent="persistent"
|
|
83
84
|
:auto-close="autoClose"
|
|
84
85
|
:anchor="menuAnchor"
|
|
@@ -142,7 +143,8 @@
|
|
|
142
143
|
:class="contentClass"
|
|
143
144
|
:style="contentStyle"
|
|
144
145
|
:cover="cover"
|
|
145
|
-
fit
|
|
146
|
+
fit-container
|
|
147
|
+
:fit-content="fitContent"
|
|
146
148
|
:persistent="persistent"
|
|
147
149
|
:auto-close="autoClose"
|
|
148
150
|
:anchor="menuAnchor"
|
|
@@ -227,7 +229,8 @@ export default defineComponent({
|
|
|
227
229
|
flat: Boolean,
|
|
228
230
|
uppercase: Boolean,
|
|
229
231
|
outlined: Boolean,
|
|
230
|
-
padding: { type: String, default: '5px' }
|
|
232
|
+
padding: { type: String, default: '5px' },
|
|
233
|
+
fitContent: Boolean
|
|
231
234
|
},
|
|
232
235
|
emits: [
|
|
233
236
|
'update:model-value',
|
|
@@ -349,19 +352,6 @@ export default defineComponent({
|
|
|
349
352
|
}
|
|
350
353
|
}
|
|
351
354
|
|
|
352
|
-
// expose public methods
|
|
353
|
-
Object.assign(proxy, {
|
|
354
|
-
show,
|
|
355
|
-
hide,
|
|
356
|
-
toggle,
|
|
357
|
-
onClickHide,
|
|
358
|
-
onClick,
|
|
359
|
-
onBeforeShow,
|
|
360
|
-
onShow,
|
|
361
|
-
onBeforeHide,
|
|
362
|
-
onHide
|
|
363
|
-
})
|
|
364
|
-
|
|
365
355
|
onMounted(() => {
|
|
366
356
|
if (props.modelValue) {
|
|
367
357
|
show()
|
|
@@ -98,7 +98,8 @@ export default defineComponent({
|
|
|
98
98
|
|
|
99
99
|
noRefocus: Boolean,
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
fitContainer: Boolean,
|
|
102
|
+
fitContent: Boolean,
|
|
102
103
|
cover: Boolean,
|
|
103
104
|
|
|
104
105
|
square: Boolean,
|
|
@@ -358,7 +359,8 @@ export default defineComponent({
|
|
|
358
359
|
anchorOrigin: anchorOrigin.value,
|
|
359
360
|
selfOrigin: selfOrigin.value,
|
|
360
361
|
absoluteOffset,
|
|
361
|
-
|
|
362
|
+
fitContainer: props.fitContainer,
|
|
363
|
+
fitContent: props.fitContent,
|
|
362
364
|
cover: props.cover,
|
|
363
365
|
maxHeight: props.maxHeight,
|
|
364
366
|
maxWidth: props.maxWidth
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
size="s"
|
|
13
13
|
:options="options"
|
|
14
14
|
:disabled="disabled"
|
|
15
|
-
:fit="false"
|
|
16
15
|
width="min-content"
|
|
17
16
|
align-right
|
|
18
17
|
disable-dropdown-icon-padding
|
|
@@ -55,7 +54,7 @@ export default defineComponent({
|
|
|
55
54
|
},
|
|
56
55
|
emits: ['update:modelValue'],
|
|
57
56
|
computed: {
|
|
58
|
-
hasSingeValue() {
|
|
57
|
+
hasSingeValue(): boolean {
|
|
59
58
|
return this.options.length <= 1
|
|
60
59
|
}
|
|
61
60
|
},
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
class="select-search-input"
|
|
77
77
|
:style="!isExpanded ? 'display: none;' : 'width: 100%;'"
|
|
78
78
|
:disabled="disabled"
|
|
79
|
+
:readonly="readonly"
|
|
79
80
|
@input="handleSearchInput"
|
|
80
81
|
@focus="handleSearchFocus"
|
|
81
82
|
@blur="handleSearchBlur"
|
|
@@ -134,12 +135,13 @@
|
|
|
134
135
|
<dl-menu
|
|
135
136
|
ref="menu"
|
|
136
137
|
v-model="isExpanded"
|
|
137
|
-
|
|
138
|
+
fit-container
|
|
139
|
+
:fit-content="fitContent"
|
|
138
140
|
square
|
|
139
141
|
no-focus
|
|
140
142
|
:offset="[0, 3]"
|
|
141
143
|
style="border-radius: 0"
|
|
142
|
-
:disabled="disabled"
|
|
144
|
+
:disabled="disabled || readonly"
|
|
143
145
|
@show="onMenuOpen"
|
|
144
146
|
@hide="closeMenu"
|
|
145
147
|
>
|
|
@@ -297,7 +299,7 @@ export default defineComponent({
|
|
|
297
299
|
search: { type: Boolean, default: false },
|
|
298
300
|
required: { type: Boolean, default: false },
|
|
299
301
|
optional: { type: Boolean, default: false },
|
|
300
|
-
|
|
302
|
+
fitContent: Boolean,
|
|
301
303
|
tooltip: { type: String, default: '' },
|
|
302
304
|
highlightSelected: { type: Boolean, default: false },
|
|
303
305
|
type: { type: String, default: 'text' },
|
|
@@ -309,6 +311,7 @@ export default defineComponent({
|
|
|
309
311
|
errorMessage: { type: String, default: '' },
|
|
310
312
|
error: { type: Boolean, default: false },
|
|
311
313
|
disabled: { type: Boolean, default: false },
|
|
314
|
+
readonly: { type: Boolean, default: false },
|
|
312
315
|
emitValue: { type: Boolean, default: false }, // We emit the value from the option and compare with it as a modelvalue
|
|
313
316
|
options: {
|
|
314
317
|
type: Array as PropType<SelectOptionType[]>,
|
|
@@ -497,6 +500,9 @@ export default defineComponent({
|
|
|
497
500
|
if (this.disabled) {
|
|
498
501
|
classes.push('dl_select__select--disabled')
|
|
499
502
|
}
|
|
503
|
+
if (this.readonly) {
|
|
504
|
+
classes.push('dl_select__select--readonly')
|
|
505
|
+
}
|
|
500
506
|
if (this.isExpanded) {
|
|
501
507
|
classes.push('dl_select__select--focused')
|
|
502
508
|
}
|
|
@@ -718,6 +724,7 @@ export default defineComponent({
|
|
|
718
724
|
if (!this.preserveSearch) {
|
|
719
725
|
const inputRef = this.$refs.searchInput as HTMLInputElement
|
|
720
726
|
if (inputRef) inputRef.value = ''
|
|
727
|
+
this.$emit('filter', '')
|
|
721
728
|
}
|
|
722
729
|
},
|
|
723
730
|
getLabel,
|
|
@@ -901,6 +908,18 @@ export default defineComponent({
|
|
|
901
908
|
pointer-events: none;
|
|
902
909
|
}
|
|
903
910
|
}
|
|
911
|
+
|
|
912
|
+
&--readonly {
|
|
913
|
+
border-color: var(--dl-color-separator);
|
|
914
|
+
cursor: text;
|
|
915
|
+
|
|
916
|
+
&:hover {
|
|
917
|
+
border-color: var(--dl-color-separator);
|
|
918
|
+
}
|
|
919
|
+
& input {
|
|
920
|
+
pointer-events: none;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
904
923
|
}
|
|
905
924
|
|
|
906
925
|
.selected {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
:disabled="disabled"
|
|
14
14
|
:class="!enableResize ? 'textarea-disable-resize' : ''"
|
|
15
15
|
@input="onChange"
|
|
16
|
+
@keydown="onKeydown"
|
|
16
17
|
@focus="onFocus"
|
|
17
18
|
@blur="onBlur"
|
|
18
19
|
/>
|
|
@@ -63,7 +64,7 @@ export default defineComponent({
|
|
|
63
64
|
default: false
|
|
64
65
|
}
|
|
65
66
|
},
|
|
66
|
-
emits: ['input', 'focus', 'blur', 'update:model-value'],
|
|
67
|
+
emits: ['input', 'focus', 'blur', 'update:model-value', 'keydown'],
|
|
67
68
|
data() {
|
|
68
69
|
return {
|
|
69
70
|
uuid: `dl-text-area-${v4()}`
|
|
@@ -81,6 +82,9 @@ export default defineComponent({
|
|
|
81
82
|
this.$emit('input', e.target.value, e)
|
|
82
83
|
this.$emit('update:model-value', e.target.value)
|
|
83
84
|
},
|
|
85
|
+
onKeydown(e: KeyboardEvent) {
|
|
86
|
+
this.$emit('keydown', e)
|
|
87
|
+
},
|
|
84
88
|
onFocus(e: InputEvent) {
|
|
85
89
|
this.$emit('focus', e)
|
|
86
90
|
},
|
|
@@ -104,8 +108,8 @@ export default defineComponent({
|
|
|
104
108
|
display: flex;
|
|
105
109
|
flex-direction: column;
|
|
106
110
|
align-items: flex-end;
|
|
107
|
-
width:
|
|
108
|
-
max-width:
|
|
111
|
+
width: 100%;
|
|
112
|
+
max-width: var(--dl-textarea-width);
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
.textarea {
|
|
@@ -115,13 +119,14 @@ export default defineComponent({
|
|
|
115
119
|
padding: 10px;
|
|
116
120
|
font-family: 'Roboto', sans-serif;
|
|
117
121
|
font-size: var(--dl-font-size-body);
|
|
118
|
-
width:
|
|
122
|
+
width: 100%;
|
|
119
123
|
min-width: 100px;
|
|
120
124
|
max-width: 100%;
|
|
121
125
|
min-height: 80px;
|
|
122
126
|
max-height: 120px;
|
|
123
127
|
outline: none;
|
|
124
128
|
color: var(--dl-color-darker);
|
|
129
|
+
box-sizing: border-box;
|
|
125
130
|
|
|
126
131
|
&:hover {
|
|
127
132
|
border-color: var(--dl-color-hover);
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
:maxlength="maxLength"
|
|
52
52
|
:type="showPass ? 'text' : type"
|
|
53
53
|
:disabled="disabled"
|
|
54
|
+
:readonly="readonly"
|
|
54
55
|
@input="onChange"
|
|
55
56
|
@focus="onFocus"
|
|
56
57
|
@blur="debouncedBlur()"
|
|
@@ -102,13 +103,23 @@
|
|
|
102
103
|
</dl-tooltip>
|
|
103
104
|
</span>
|
|
104
105
|
</div>
|
|
106
|
+
<div
|
|
107
|
+
v-show="hasAction"
|
|
108
|
+
:class="[
|
|
109
|
+
...adornmentClasses,
|
|
110
|
+
'dl-text-input__adornment-container--pos-right-out'
|
|
111
|
+
]"
|
|
112
|
+
>
|
|
113
|
+
<slot name="action" />
|
|
114
|
+
</div>
|
|
105
115
|
<dl-menu
|
|
106
116
|
v-if="showSuggestItems"
|
|
107
117
|
v-model="isMenuOpen"
|
|
108
118
|
auto-close
|
|
109
119
|
no-focus
|
|
110
120
|
:offset="[0, 3]"
|
|
111
|
-
fit
|
|
121
|
+
fit-container
|
|
122
|
+
:fit-content="fitContent"
|
|
112
123
|
@click="onMenuShow"
|
|
113
124
|
>
|
|
114
125
|
<dl-list
|
|
@@ -274,6 +285,10 @@ export default defineComponent({
|
|
|
274
285
|
type: Boolean,
|
|
275
286
|
default: false
|
|
276
287
|
},
|
|
288
|
+
readonly: {
|
|
289
|
+
type: Boolean,
|
|
290
|
+
default: false
|
|
291
|
+
},
|
|
277
292
|
maxLength: {
|
|
278
293
|
type: Number,
|
|
279
294
|
default: null
|
|
@@ -309,7 +324,8 @@ export default defineComponent({
|
|
|
309
324
|
clearButtonTooltip: {
|
|
310
325
|
type: Boolean,
|
|
311
326
|
default: false
|
|
312
|
-
}
|
|
327
|
+
},
|
|
328
|
+
fitContent: Boolean
|
|
313
329
|
},
|
|
314
330
|
emits: ['input', 'focus', 'blur', 'clear', 'enter', 'update:model-value'],
|
|
315
331
|
data() {
|
|
@@ -323,9 +339,9 @@ export default defineComponent({
|
|
|
323
339
|
computed: {
|
|
324
340
|
bottomMessage(): boolean {
|
|
325
341
|
return (
|
|
326
|
-
!!this.infoMessage
|
|
327
|
-
!!this.errorMessage
|
|
328
|
-
!!this.warningMessage
|
|
342
|
+
!!this.infoMessage?.length ||
|
|
343
|
+
!!this.errorMessage?.length ||
|
|
344
|
+
!!this.warningMessage?.length ||
|
|
329
345
|
this.showCounter
|
|
330
346
|
)
|
|
331
347
|
},
|
|
@@ -391,6 +407,9 @@ export default defineComponent({
|
|
|
391
407
|
!this.isSmall
|
|
392
408
|
)
|
|
393
409
|
},
|
|
410
|
+
hasAction(): boolean {
|
|
411
|
+
return !!this.$slots.action && !this.isSmall
|
|
412
|
+
},
|
|
394
413
|
passShowIcon(): string {
|
|
395
414
|
return this.showPass ? 'icon-dl-hide' : 'icon-dl-show'
|
|
396
415
|
},
|
|
@@ -400,6 +419,7 @@ export default defineComponent({
|
|
|
400
419
|
!this.disableClearBtn &&
|
|
401
420
|
this.type !== 'password' &&
|
|
402
421
|
!this.disabled &&
|
|
422
|
+
!this.readonly &&
|
|
403
423
|
!!this.modelValue
|
|
404
424
|
// this.focused
|
|
405
425
|
)
|
|
@@ -443,10 +463,18 @@ export default defineComponent({
|
|
|
443
463
|
this.$emit('input', e.target.value, e)
|
|
444
464
|
this.$emit('update:model-value', e.target.value)
|
|
445
465
|
},
|
|
466
|
+
focus(): void {
|
|
467
|
+
const inputRef = this.$refs.input as HTMLInputElement
|
|
468
|
+
inputRef.focus()
|
|
469
|
+
},
|
|
446
470
|
onFocus(e: InputEvent): void {
|
|
447
471
|
this.focused = true
|
|
448
472
|
this.$emit('focus', e)
|
|
449
473
|
},
|
|
474
|
+
blur(): void {
|
|
475
|
+
const inputRef = this.$refs.input as HTMLInputElement
|
|
476
|
+
inputRef.blur()
|
|
477
|
+
},
|
|
450
478
|
onBlur(e: InputEvent): void {
|
|
451
479
|
this.focused = false
|
|
452
480
|
this.$emit('blur', e)
|
|
@@ -473,8 +501,7 @@ export default defineComponent({
|
|
|
473
501
|
inputRef.value = item
|
|
474
502
|
},
|
|
475
503
|
onMenuShow(): void {
|
|
476
|
-
|
|
477
|
-
inputRef.focus()
|
|
504
|
+
this.focus()
|
|
478
505
|
},
|
|
479
506
|
getSuggestWords(
|
|
480
507
|
item: string,
|
|
@@ -697,6 +724,13 @@ export default defineComponent({
|
|
|
697
724
|
color: var(--dl-color-disabled);
|
|
698
725
|
cursor: not-allowed;
|
|
699
726
|
}
|
|
727
|
+
&:readonly {
|
|
728
|
+
border-color: var(--dl-color-separator);
|
|
729
|
+
cursor: text;
|
|
730
|
+
&:hover {
|
|
731
|
+
border-color: var(--dl-color-separator) !important;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
700
734
|
}
|
|
701
735
|
|
|
702
736
|
&__adornment-container {
|
|
@@ -725,7 +759,11 @@ export default defineComponent({
|
|
|
725
759
|
|
|
726
760
|
&--pos-right {
|
|
727
761
|
top: 0;
|
|
728
|
-
right:
|
|
762
|
+
right: 0;
|
|
763
|
+
}
|
|
764
|
+
&--pos-right-out {
|
|
765
|
+
top: 0;
|
|
766
|
+
right: -30px;
|
|
729
767
|
}
|
|
730
768
|
}
|
|
731
769
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as VueDemiModule from 'vue-demi'
|
|
2
2
|
import ToastComponent from '../components/ToastComponent.vue'
|
|
3
3
|
|
|
4
4
|
let createComponent: Function
|
|
5
5
|
|
|
6
|
+
const VueDemi: any = VueDemiModule
|
|
7
|
+
|
|
6
8
|
if (VueDemi.isVue3) {
|
|
7
9
|
createComponent = function (
|
|
8
10
|
component: object,
|
package/src/demo/DlChipDemo.vue
CHANGED
package/src/demo/DlMenuDemo.vue
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
2
|
+
<div style="width: 800px">
|
|
3
|
+
<div style="max-width: 500px; width: 100%">
|
|
4
|
+
<dl-text-area
|
|
5
|
+
v-model="textAreaValue"
|
|
6
|
+
placeholder="Type your text..."
|
|
7
|
+
show-counter
|
|
8
|
+
:max-length="20"
|
|
9
|
+
enable-resize
|
|
10
|
+
@keydown="log"
|
|
11
|
+
@focus="textAreaFocused = true"
|
|
12
|
+
@blur="textAreaFocused = false"
|
|
13
|
+
/>
|
|
14
|
+
<div style="margin-left: 20px">
|
|
15
|
+
<p>Value: {{ textAreaValue }}</p>
|
|
16
|
+
<p>Status: {{ textAreaFocused ? 'focused' : 'unfocused' }}</p>
|
|
17
|
+
</div>
|
|
15
18
|
</div>
|
|
16
19
|
</div>
|
|
17
20
|
</template>
|
|
@@ -28,7 +31,10 @@ export default defineComponent({
|
|
|
28
31
|
const textAreaValue = ref('')
|
|
29
32
|
const textAreaFocused = ref(false)
|
|
30
33
|
|
|
34
|
+
const log = (e: KeyboardEvent) => console.log(e)
|
|
35
|
+
|
|
31
36
|
return {
|
|
37
|
+
log,
|
|
32
38
|
textAreaValue,
|
|
33
39
|
textAreaFocused
|
|
34
40
|
}
|
|
@@ -126,7 +126,8 @@ interface PositionConfig {
|
|
|
126
126
|
maxHeight?: string
|
|
127
127
|
maxWidth?: string
|
|
128
128
|
absoluteOffset?: any
|
|
129
|
-
|
|
129
|
+
fitContent?: boolean // fit the size to the content
|
|
130
|
+
fitContainer?: boolean // fit the size to the container
|
|
130
131
|
cover?: boolean
|
|
131
132
|
}
|
|
132
133
|
|
|
@@ -194,13 +195,21 @@ export function setPosition(cfg: PositionConfig) {
|
|
|
194
195
|
visibility: 'visible'
|
|
195
196
|
}
|
|
196
197
|
|
|
197
|
-
if (
|
|
198
|
+
if (
|
|
199
|
+
cfg.fitContainer === true ||
|
|
200
|
+
cfg.cover === true ||
|
|
201
|
+
cfg.fitContent === true
|
|
202
|
+
) {
|
|
198
203
|
elStyle.minWidth = cfg.maxWidth || anchorProps.width + 'px'
|
|
199
204
|
elStyle.maxWidth = cfg.maxWidth || anchorProps.width + 'px'
|
|
200
205
|
|
|
201
206
|
if (cfg.cover === true) {
|
|
202
207
|
elStyle.minHeight = anchorProps.height + 'px'
|
|
203
208
|
}
|
|
209
|
+
|
|
210
|
+
if (cfg.fitContent === true) {
|
|
211
|
+
elStyle.maxWidth = cfg.el.offsetWidth + 'px'
|
|
212
|
+
}
|
|
204
213
|
}
|
|
205
214
|
|
|
206
215
|
Object.assign(cfg.el!.style, elStyle)
|