goodteditor-ui 1.0.95 → 1.0.96

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.95",
3
+ "version": "1.0.96",
4
4
  "main": "index.js",
5
5
  "homepage": "https://goodt-ui.netlify.app/",
6
6
  "scripts": {
@@ -120,6 +120,7 @@
120
120
  @binding {String} label option's label
121
121
  @binding {Number} index option's index
122
122
  @binding {Boolean} isSelected option selection status
123
+ @binding {Boolean} isDisabled option availability status
123
124
  @binding {Number} cursorIndex current cursor index
124
125
  @binding {Function} selectOption function that selects option
125
126
  @binding {Function} deselectOption function that deselects option
@@ -134,6 +135,7 @@
134
135
  index,
135
136
  cursorIndex,
136
137
  isSelected: isOptionSelected(option),
138
+ isDisabled: isOptionDisabled(option),
137
139
  selectOption,
138
140
  deselectOption,
139
141
  toggleOption
@@ -145,6 +147,7 @@
145
147
  @binding {String} label option's label
146
148
  @binding {Number} index option's index
147
149
  @binding {Boolean} isSelected option selection status
150
+ @binding {Boolean} isDisabled option availability status
148
151
  @binding {Number} cursorIndex current cursor index
149
152
  @binding {Function} selectOption function that selects option
150
153
  @binding {Function} deselectOption function that deselects option
@@ -160,6 +163,7 @@
160
163
  label: getOptionLabel(option),
161
164
  index,
162
165
  isSelected: isOptionSelected(option),
166
+ isDisabled: isOptionDisabled(option),
163
167
  cursorIndex,
164
168
  selectOption,
165
169
  deselectOption,
@@ -171,7 +175,8 @@
171
175
  <li
172
176
  :class="{
173
177
  active: isOptionSelected(option),
174
- 'bg-grey-lighter': index == cursorIndex
178
+ 'bg-grey-lighter': index == cursorIndex,
179
+ 'events-none': isOptionDisabled(option)
175
180
  }"
176
181
  :key="index"
177
182
  :title="getOptionLabel(option)"
@@ -187,6 +192,7 @@
187
192
  label: getOptionLabel(option),
188
193
  index,
189
194
  isSelected: isOptionSelected(option),
195
+ isDisabled: isOptionDisabled(option),
190
196
  cursorIndex
191
197
  }">
192
198
  {{ getOptionLabel(option) }}
@@ -223,6 +229,7 @@
223
229
  @binding {String} label option's label
224
230
  @binding {Number} index option's index
225
231
  @binding {Boolean} isSelected option selection status
232
+ @binding {Boolean} isDisabled option availability status
226
233
  @binding {Number} cursorIndex current cursor index
227
234
  @binding {Function} selectOption function that selects option
228
235
  @binding {Function} deselectOption function that deselects option
@@ -236,6 +243,7 @@
236
243
  label: getOptionLabel(option),
237
244
  index,
238
245
  isSelected: isOptionSelected(option),
246
+ isDisabled: isOptionDisabled(option),
239
247
  cursorIndex,
240
248
  selectOption,
241
249
  deselectOption,
@@ -339,6 +347,13 @@ export default {
339
347
  type: [String, Symbol],
340
348
  default: 'label'
341
349
  },
350
+ /**
351
+ * Defines the 'disabled' field of the option Object
352
+ */
353
+ disabledField: {
354
+ type: [String, Symbol],
355
+ default: 'disabled'
356
+ },
342
357
  autoWidth: {
343
358
  default: true
344
359
  },
@@ -490,6 +505,10 @@ export default {
490
505
  isOptionSelected(option) {
491
506
  return this.optionsSelected.includes(option);
492
507
  },
508
+ isOptionDisabled(option) {
509
+ let disabled = option ? option[this.disabledField] : null;
510
+ return Boolean(disabled);
511
+ },
493
512
  createOptionRollback() {
494
513
  const optionsSelected = [...this.optionsSelected];
495
514
  return () => {