@itfin/components 1.0.79 → 1.0.80

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": "@itfin/components",
3
- "version": "1.0.79",
3
+ "version": "1.0.80",
4
4
  "main": "dist/itfin-components.umd.js",
5
5
  "unpkg": "dist/itfin-components.common.js",
6
6
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
 
3
- <div class="itf-modal modal" ref="modal" tabindex="-1" :aria-labelledby="modalId" aria-hidden="true">
3
+ <div class="itf-modal modal fade" ref="modal" tabindex="-1" :aria-labelledby="modalId" aria-hidden="true">
4
4
  <div
5
5
  class="modal-dialog modal-fullscreen-sm-down"
6
6
  :class="{[`modal-${size}`]: size}"
@@ -35,11 +35,11 @@
35
35
  }
36
36
  }
37
37
  }
38
- //.modal-open .itf-app {
39
- // -webkit-filter: blur(5px) grayscale(1);
40
- // -moz-filter: blur(5px) grayscale(1);
41
- // filter: blur(5px) grayscale(1);
42
- //}
38
+ .modal-open .itf-app {
39
+ -webkit-filter: blur(5px) grayscale(1);
40
+ -moz-filter: blur(5px) grayscale(1);
41
+ filter: blur(5px) grayscale(1);
42
+ }
43
43
  </style>
44
44
  <script>
45
45
  import { Vue, Component, Prop, Watch, PropSync, Inject } from 'vue-property-decorator';
@@ -98,7 +98,7 @@ class itfModal extends Vue {
98
98
  setTimeout(() => {
99
99
  this.modalEl.show();
100
100
  modalStack.push(this);
101
- }, 500);
101
+ }, modalStack.length ? 500 : 0);
102
102
  } else {
103
103
  this.modalEl.hide();
104
104
  modalStack.pop();
@@ -106,7 +106,7 @@ class itfModal extends Vue {
106
106
  setTimeout(() => {
107
107
  modalStack[modalStack.length - 1].show();
108
108
  modalStack[modalStack.length - 1].bindEvents();
109
- }, 500);
109
+ }, modalStack.length ? 500 : 0);
110
110
  }
111
111
  }
112
112
  }
@@ -133,12 +133,16 @@ class itfModal extends Vue {
133
133
 
134
134
  bindEvents() {
135
135
  this.preventEvents = false;
136
- this.$refs.modal.addEventListener('hidden.bs.modal', this.onClose);
136
+ if (this.$refs.modal) {
137
+ this.$refs.modal.addEventListener('hidden.bs.modal', this.onClose);
138
+ }
137
139
  }
138
140
 
139
141
  unbindEvents() {
140
142
  this.preventEvents = true;
141
- this.$refs.modal.removeEventListener('hidden.bs.modal', this.onClose);
143
+ if (this.$refs.modal) {
144
+ this.$refs.modal.removeEventListener('hidden.bs.modal', this.onClose);
145
+ }
142
146
  }
143
147
 
144
148
  show() {
@@ -14,7 +14,7 @@
14
14
 
15
15
  <slot
16
16
  v-if="!isValueEmpty && !multiple && customRender"
17
- v-bind="getOption(localValue)"
17
+ :option="getOption(localValue)"
18
18
  />
19
19
  <template v-else>
20
20
  {{ getOptionLabel(localValue) }}
@@ -28,11 +28,9 @@
28
28
  >
29
29
  <slot
30
30
  v-if="customRender"
31
- v-bind="{
32
- ...getOption(optionValue),
33
- optionValue,
34
- remove: removeOptionValue
35
- }"
31
+ :option="getOption(optionValue)"
32
+ :value="optionValue"
33
+ :remove="removeOptionValue"
36
34
  />
37
35
  <div v-else class="valueMultiItem text-textDarkest" :style="getOptionColor(optionValue) ? `background-color: #${getOptionColor(optionValue)}; color: #fff` : ''">
38
36
  <div class="valueMultiItemLabel">
@@ -68,11 +66,11 @@
68
66
  </div>
69
67
  </div>
70
68
 
71
- <j-icon
69
+ <icon
72
70
  v-if="(!multiple || isValueEmpty) && variant !== 'empty'"
73
71
  class="ml-auto mr-1"
74
- name="chevron-down"
75
- ></j-icon>
72
+ name="chevron_down"
73
+ ></icon>
76
74
  </div>
77
75
 
78
76
  <Dropdown
@@ -92,9 +90,9 @@
92
90
  @change="handleChange"
93
91
  @searchValueChange="handleSearchValueChange"
94
92
  >
95
- <template v-slot:option="props">
96
- <slot v-if="customRenderOption" name="option" v-bind="props" />
97
- <slot v-else v-bind="props" />
93
+ <template #option="{ option }">
94
+ <slot v-if="customRenderOption" name="option" :option="option" />
95
+ <slot v-else :option="option" />
98
96
  </template>
99
97
  </Dropdown>
100
98
  </div>
@@ -103,6 +101,7 @@
103
101
  <script>
104
102
  import { Component, Model, Prop, Ref } from 'vue-property-decorator';
105
103
  import Vue from 'vue';
104
+ import Icon from '../icon/Icon.vue';
106
105
  import Dropdown from './Dropdown.vue';
107
106
  import { useOutsideClick } from './useOutsideClick';
108
107
 
@@ -110,7 +109,7 @@ const { bind, unbind } = useOutsideClick();
110
109
 
111
110
  export default @Component({
112
111
  name: 'itfAirSelect',
113
- components: { Dropdown },
112
+ components: { Dropdown, Icon },
114
113
  })
115
114
  class itfAirSelect extends Vue {
116
115
  @Model('input', { type: [Array, String, Number], default: undefined }) value;
@@ -139,6 +138,9 @@ class itfAirSelect extends Vue {
139
138
 
140
139
  @Prop({ type: Boolean, default: false }) withClearValue;
141
140
 
141
+ @Prop({ type: Boolean, default: false }) customRender;
142
+ @Prop({ type: Boolean, default: false }) customRenderOption;
143
+
142
144
  @Ref('selectRef') selectRef;
143
145
 
144
146
  @Ref('dropdownRef') dropdownRef;
@@ -147,14 +149,6 @@ class itfAirSelect extends Vue {
147
149
 
148
150
  searchValue = '';
149
151
 
150
- get customRender() {
151
- return !!this.$slots.default;
152
- }
153
-
154
- get customRenderOption() {
155
- return !!this.$slots.option;
156
- }
157
-
158
152
  data() {
159
153
  return {
160
154
  stateValue: this.defaultValue || (this.multiple ? [] : null),
@@ -170,7 +164,6 @@ class itfAirSelect extends Vue {
170
164
  }
171
165
 
172
166
  getOptionColor(optionValue) {
173
- console.info((this.getOption(optionValue) || { [this.itemColor]: '' })[this.itemColor])
174
167
  return (this.getOption(optionValue) || { [this.itemColor]: '' })[this.itemColor];
175
168
  }
176
169
 
@@ -267,6 +260,7 @@ class itfAirSelect extends Vue {
267
260
  align-items: center;
268
261
  width: 100%;
269
262
  min-height: 32px;
263
+ justify-content: space-between;
270
264
  }
271
265
  .placeholder {
272
266
  color: #8993a4;