goodteditor-ui 1.0.84 → 1.0.86
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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@slot Dropdown header slot
|
|
5
5
|
-->
|
|
6
6
|
<slot name="header"></slot>
|
|
7
|
-
<ul ref="ul">
|
|
7
|
+
<ul ref="ul" class="list" :style="cssListStyle">
|
|
8
8
|
<!--
|
|
9
9
|
@slot Label slot for single mode
|
|
10
10
|
@binding {Object} option option
|
|
@@ -50,7 +50,16 @@
|
|
|
50
50
|
max-height: calc(var(--item-height) * var(--item-count));
|
|
51
51
|
outline: none;
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
--default-item-height: calc(var(--spacer3) * 2 + var(--line-height) * 1rem);
|
|
54
|
+
&&-small {
|
|
55
|
+
--default-item-height: calc(var(--spacer2) * 2 + var(--font-size-smaller) * var(--line-height) * 1.125);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.list {
|
|
59
|
+
--item-count: 5;
|
|
60
|
+
--item-height: var(--default-item-height);
|
|
61
|
+
|
|
62
|
+
max-height: calc(var(--item-height) * var(--item-count));
|
|
54
63
|
scroll-behavior: smooth;
|
|
55
64
|
max-height: inherit;
|
|
56
65
|
}
|
|
@@ -92,14 +101,21 @@ export default {
|
|
|
92
101
|
*/
|
|
93
102
|
maxHeight: {
|
|
94
103
|
type: String,
|
|
95
|
-
default:
|
|
104
|
+
default: null
|
|
96
105
|
},
|
|
97
106
|
/**
|
|
98
107
|
* Max visible items count
|
|
99
108
|
*/
|
|
100
109
|
maxItems: {
|
|
101
110
|
type: Number,
|
|
102
|
-
default:
|
|
111
|
+
default: 5
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* Item height count
|
|
115
|
+
*/
|
|
116
|
+
itemHeight: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: null
|
|
103
119
|
},
|
|
104
120
|
/**
|
|
105
121
|
* The current cursor index position (.sync)
|
|
@@ -121,11 +137,20 @@ export default {
|
|
|
121
137
|
return o;
|
|
122
138
|
},
|
|
123
139
|
cssStyle() {
|
|
124
|
-
const {
|
|
140
|
+
const { maxItems } = this;
|
|
141
|
+
return {
|
|
142
|
+
'--item-count': maxItems
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
cssListStyle() {
|
|
146
|
+
const { maxHeight, maxItems, itemHeight } = this;
|
|
125
147
|
return {
|
|
126
148
|
...(maxHeight && {
|
|
127
149
|
maxHeight
|
|
128
150
|
}),
|
|
151
|
+
...(itemHeight && {
|
|
152
|
+
'--item-height': itemHeight
|
|
153
|
+
}),
|
|
129
154
|
'--item-count': maxItems
|
|
130
155
|
};
|
|
131
156
|
}
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
class="w-100 pull-left"
|
|
101
101
|
@click.native.stop
|
|
102
102
|
@select-option="onDatalistSelectOption"
|
|
103
|
-
v-bind="{ size, options, class: datalistCssClass }"
|
|
103
|
+
v-bind="{ size, options, class: datalistCssClass, maxHeight, maxItems, itemHeight }"
|
|
104
104
|
:cursorIndex.sync="dataListCursorIndex"
|
|
105
105
|
ref="datalist">
|
|
106
106
|
<template #header>
|
|
@@ -307,13 +307,6 @@ export default {
|
|
|
307
307
|
return [];
|
|
308
308
|
}
|
|
309
309
|
},
|
|
310
|
-
/**
|
|
311
|
-
* Datalist css classes (optional)
|
|
312
|
-
*/
|
|
313
|
-
datalistCssClass: {
|
|
314
|
-
type: [String, Array],
|
|
315
|
-
default: ''
|
|
316
|
-
},
|
|
317
310
|
/**
|
|
318
311
|
* Allow multiple selection
|
|
319
312
|
*/
|
|
@@ -353,7 +346,36 @@ export default {
|
|
|
353
346
|
valueOfOptionChecker: {
|
|
354
347
|
type: Function,
|
|
355
348
|
default: null
|
|
356
|
-
}
|
|
349
|
+
},
|
|
350
|
+
// DATALIST OPTIONS
|
|
351
|
+
/**
|
|
352
|
+
* Datalist css classes (optional)
|
|
353
|
+
*/
|
|
354
|
+
datalistCssClass: {
|
|
355
|
+
type: [String, Array],
|
|
356
|
+
default: ''
|
|
357
|
+
},
|
|
358
|
+
/**
|
|
359
|
+
* Defines the max-height of the dropdown list (value may be any css unit/expression)
|
|
360
|
+
*/
|
|
361
|
+
maxHeight: {
|
|
362
|
+
type: String,
|
|
363
|
+
default: null
|
|
364
|
+
},
|
|
365
|
+
/**
|
|
366
|
+
* Max visible items count
|
|
367
|
+
*/
|
|
368
|
+
maxItems: {
|
|
369
|
+
type: Number,
|
|
370
|
+
default: 5
|
|
371
|
+
},
|
|
372
|
+
/**
|
|
373
|
+
* Item height count
|
|
374
|
+
*/
|
|
375
|
+
itemHeight: {
|
|
376
|
+
type: String,
|
|
377
|
+
default: null
|
|
378
|
+
},
|
|
357
379
|
},
|
|
358
380
|
data() {
|
|
359
381
|
return {
|