goodteditor-ui 1.0.84 → 1.0.85

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goodteditor-ui",
3
- "version": "1.0.84",
3
+ "version": "1.0.85",
4
4
  "main": "index.js",
5
5
  "homepage": "https://goodt-ui.netlify.app/",
6
6
  "scripts": {
@@ -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
- ul {
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,7 +101,21 @@ export default {
92
101
  */
93
102
  maxHeight: {
94
103
  type: String,
95
- default: ''
104
+ default: null
105
+ },
106
+ /**
107
+ * Max visible items count
108
+ */
109
+ maxItems: {
110
+ type: Number,
111
+ default: 5
112
+ },
113
+ /**
114
+ * Item height count
115
+ */
116
+ itemHeight: {
117
+ type: String,
118
+ default: null
96
119
  },
97
120
  /**
98
121
  * Max visible items count
@@ -121,11 +144,20 @@ export default {
121
144
  return o;
122
145
  },
123
146
  cssStyle() {
124
- const { maxHeight, maxItems } = this;
147
+ const { maxItems } = this;
148
+ return {
149
+ '--item-count': maxItems
150
+ };
151
+ },
152
+ cssListStyle() {
153
+ const { maxHeight, maxItems, itemHeight } = this;
125
154
  return {
126
155
  ...(maxHeight && {
127
156
  maxHeight
128
157
  }),
158
+ ...(itemHeight && {
159
+ '--item-height': itemHeight
160
+ }),
129
161
  '--item-count': maxItems
130
162
  };
131
163
  }
@@ -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: 4
371
+ },
372
+ /**
373
+ * Item height count
374
+ */
375
+ itemHeight: {
376
+ type: String,
377
+ default: null
378
+ },
357
379
  },
358
380
  data() {
359
381
  return {