goodteditor-ui 1.0.94 → 1.0.95

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.94",
3
+ "version": "1.0.95",
4
4
  "main": "index.js",
5
5
  "homepage": "https://goodt-ui.netlify.app/",
6
6
  "scripts": {
@@ -27,10 +27,10 @@
27
27
  }">
28
28
  <ui-badge
29
29
  class="mar-none mar-right-2"
30
- theme="primary"
30
+ :theme="selectedBadgeTheme"
31
31
  size="small"
32
32
  :key="index"
33
- removable
33
+ :removable="isSelectedRemovable"
34
34
  @click.native.stop
35
35
  @remove="deselectOption(option)">
36
36
  <span>{{ getOptionLabel(option) }}</span>
@@ -79,20 +79,23 @@
79
79
  @slot Open state icon slot
80
80
  -->
81
81
  <slot name="icon-open" v-if="popoverShow">
82
- <i class="icon mdi mdi-chevron-up" :class="{
83
- 'mdi-18px': size === '',
84
- 'h-auto w-auto': size === 'small'
85
- }">
86
- </i>
82
+ <i
83
+ class="icon mdi mdi-chevron-up"
84
+ :class="{
85
+ 'mdi-18px': size === '',
86
+ 'h-auto w-auto': size === 'small'
87
+ }"></i>
87
88
  </slot>
88
89
  <!--
89
90
  @slot Close state icon slot
90
91
  -->
91
92
  <slot name="icon-close" v-else>
92
- <i class="icon mdi mdi-chevron-down" :class="{
93
- 'mdi-18px': size === '',
94
- 'h-auto w-auto': size === 'small'
95
- }"></i>
93
+ <i
94
+ class="icon mdi mdi-chevron-down"
95
+ :class="{
96
+ 'mdi-18px': size === '',
97
+ 'h-auto w-auto': size === 'small'
98
+ }"></i>
96
99
  </slot>
97
100
 
98
101
  <ui-popover :show.sync="popoverShow" v-bind="popoverOptions">
@@ -375,7 +378,7 @@ export default {
375
378
  itemHeight: {
376
379
  type: String,
377
380
  default: null
378
- },
381
+ }
379
382
  },
380
383
  data() {
381
384
  return {
@@ -388,8 +391,17 @@ export default {
388
391
  * @return {object}
389
392
  */
390
393
  cssClassExt() {
391
- let obj = { 'u-select-none': this.readonly };
392
- return { ...this.cssClass, ...obj };
394
+ if (this.readonly) {
395
+ const { ['events-none']: eventsNone, ...cssClass } = this.cssClass;
396
+ return cssClass;
397
+ }
398
+ return this.cssClass;
399
+ },
400
+ selectedBadgeTheme() {
401
+ return this.disabled ? '' : 'primary';
402
+ },
403
+ isSelectedRemovable() {
404
+ return this.readonly === false && this.disabled === false;
393
405
  }
394
406
  },
395
407
  watch: {
@@ -487,6 +499,9 @@ export default {
487
499
  };
488
500
  },
489
501
  selectOption(option) {
502
+ if (this.readonly) {
503
+ return;
504
+ }
490
505
  if (this.isOptionSelected(option)) {
491
506
  return;
492
507
  }
@@ -502,6 +517,9 @@ export default {
502
517
  this.triggerModelChange(rollback);
503
518
  },
504
519
  deselectOption(option) {
520
+ if (this.readonly) {
521
+ return;
522
+ }
505
523
  if (!this.multiple) {
506
524
  this.popoverShow = false;
507
525
  return;
@@ -67,7 +67,8 @@ export default {
67
67
  },
68
68
  readonly: {
69
69
  handler(val) {
70
- this.$set(this.cssClass, 'readonly events-none', val);
70
+ this.$set(this.cssClass, 'readonly', val);
71
+ this.$set(this.cssClass, 'events-none', val);
71
72
  },
72
73
  immediate: true,
73
74
  },