@itfin/components 1.0.112 → 1.0.116

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.112",
3
+ "version": "1.0.116",
4
4
  "main": "dist/itfin-components.umd.js",
5
5
  "unpkg": "dist/itfin-components.common.js",
6
6
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
@@ -70,18 +70,19 @@
70
70
  }
71
71
  </style>
72
72
  <script>
73
- import { Vue, Component, Provide } from 'vue-property-decorator';
73
+ import { Vue, Component } from 'vue-property-decorator';
74
74
  import Message from './message';
75
75
 
76
76
  let globalApp = null;
77
77
 
78
78
  export default @Component({
79
79
  name: 'itfApp',
80
- components: {}
80
+ components: {},
81
+ provide() {
82
+ return { globalApp: this }; // do not use Provide from vue-property-decorator
83
+ }
81
84
  })
82
85
  class itfApp extends Vue {
83
- @Provide() globalApp = this;
84
-
85
86
  created() {
86
87
  globalApp = this;
87
88
  Vue.prototype.$globalApp = this;
@@ -9,14 +9,15 @@
9
9
 
10
10
  </style>
11
11
  <script>
12
- import { Vue, Component, Prop, Model, Provide } from 'vue-property-decorator';
12
+ import { Vue, Component, Prop, Model } from 'vue-property-decorator';
13
13
 
14
14
  export default @Component({
15
- name: 'itfCheckboxGroup'
15
+ name: 'itfCheckboxGroup',
16
+ provide() {
17
+ return { checkboxGroup: this }; // do not use Provide from vue-property-decorator
18
+ }
16
19
  })
17
20
  class itfCheckboxGroup extends Vue {
18
- @Provide() checkboxGroup = this;
19
-
20
21
  @Model('input', { type: Array, default: () => [] }) value;
21
22
 
22
23
  @Prop(Boolean) disabled;
@@ -9,16 +9,17 @@
9
9
 
10
10
  </style>
11
11
  <script>
12
- import { Vue, Component, Prop, Model, Provide } from 'vue-property-decorator';
12
+ import { Vue, Component, Prop, Model } from 'vue-property-decorator';
13
13
 
14
14
  let globalRadioGroupId = 0;
15
15
 
16
16
  export default @Component({
17
- name: 'itfRadioGroup'
17
+ name: 'itfRadioGroup',
18
+ provide() {
19
+ return { radioGroup: this }; // do not use Provide from vue-property-decorator
20
+ }
18
21
  })
19
22
  class itfRadioGroup extends Vue {
20
- @Provide() radioGroup = this;
21
-
22
23
  @Model('input', { default: null }) value;
23
24
 
24
25
  @Prop(Boolean) disabled;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
 
3
- <div class="itf-dropdown dropdown">
3
+ <div class="itf-dropdown" :class="`drop${placement}`">
4
4
  <itf-button
5
5
  :class="{ 'dropdown-toggle': toggle }"
6
6
  v-bind="buttonOptions"
@@ -13,7 +13,7 @@
13
13
  </itf-button>
14
14
  <div
15
15
  class="itf-dropdown__menu dropdown-menu"
16
- :class="{'dropdown-menu-end': right}"
16
+ :class="{'dropdown-menu-end': right, 'shadow': shadow}"
17
17
  ref="dropdown"
18
18
  :aria-labelledby="modalId">
19
19
  <slot></slot>
@@ -49,11 +49,12 @@ export default @Component({
49
49
  })
50
50
  class itfDropdown extends Vue {
51
51
  @PropSync('visible') value;
52
- @Prop({ type: String, default: 'bottom', validator: (value) => ['bottom', 'left', 'right', 'top'].includes(value) }) placement;
52
+ @Prop({ type: String, default: 'down', validator: (value) => ['down', 'start', 'end', 'up'].includes(value) }) placement;
53
53
  @Prop({ type: String, default: 'click', validator: (value) => ['click', 'focus', 'hover', 'manual'].includes(value) }) trigger;
54
54
  @Prop({ type: String, default: 'Dropdown' }) label;
55
55
  @Prop({ type: Boolean }) right;
56
56
  @Prop({ type: Boolean }) toggle;
57
+ @Prop({ type: Boolean }) shadow;
57
58
  @Prop({ validator: (value) => [true, false, 'inside', 'outside'].includes(value), default: true }) autoclose;
58
59
  @Prop({ type: Object, default: () => ({}) }) buttonOptions;
59
60
 
@@ -8,7 +8,7 @@
8
8
  //@import '~bootstrap/scss/forms';
9
9
  </style>
10
10
  <script>
11
- import { Vue, Component, Watch, Provide, Model } from 'vue-property-decorator';
11
+ import { Vue, Component, Watch, Model } from 'vue-property-decorator';
12
12
  import * as validators from '../../helpers/validators';
13
13
 
14
14
  Vue.prototype.$v = validators;
@@ -16,10 +16,11 @@ Vue.prototype.$v = validators;
16
16
  export default @Component({
17
17
  name: 'itfForm',
18
18
  components: {},
19
+ provide() {
20
+ return { form: this }; // do not use Provide from vue-property-decorator
21
+ }
19
22
  })
20
23
  class itfForm extends Vue {
21
- @Provide() form = this;
22
-
23
24
  @Model('input') valid;
24
25
 
25
26
  watchers = [];
@@ -48,16 +48,18 @@
48
48
  }
49
49
  </style>
50
50
  <script>
51
- import { Component, Prop, Provide, Inject, Mixins } from 'vue-property-decorator';
51
+ import { Component, Prop, Inject, Mixins } from 'vue-property-decorator';
52
52
  import ValidatableMixin from '../../mixins/ValidatableMixin';
53
53
 
54
54
  export default
55
55
  @Component({
56
56
  name: 'itfLabel',
57
- components: {}
57
+ components: {},
58
+ provide() {
59
+ return { itemLabel: this }; // do not use Provide from vue-property-decorator
60
+ }
58
61
  })
59
62
  class itfLabel extends Mixins(ValidatableMixin) {
60
- @Provide() itemLabel = this;
61
63
  @Inject({ default: null }) form;
62
64
 
63
65
  @Prop() value;
@@ -1283,8 +1283,8 @@ export default {
1283
1283
  if (this.mousedown && !this.searching) {
1284
1284
  this.mousedown = false
1285
1285
  } else {
1286
- const { clearSearchOnSelect, multiple } = this
1287
- if (this.clearSearchOnBlur({ clearSearchOnSelect, multiple })) {
1286
+ const { clearSearchOnSelect, multiple, combobox } = this
1287
+ if (this.clearSearchOnBlur({ clearSearchOnSelect, multiple, combobox })) {
1288
1288
  this.search = ''
1289
1289
  }
1290
1290
  this.closeSearchOptions()
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import {
3
- Vue, Component, Provide, Model, Emit, Prop
3
+ Vue, Component, Model, Emit, Prop
4
4
  } from 'vue-property-decorator';
5
5
  import itfTab from './Tab';
6
6
  import './tabs.scss';
@@ -10,10 +10,11 @@ export default @Component({
10
10
  components: {
11
11
  itfTab
12
12
  },
13
+ provide() {
14
+ return { tabsManager: this }; // do not use Provide from vue-property-decorator
15
+ }
13
16
  })
14
17
  class itfTabs extends Vue {
15
- @Provide() tabsManager = this;
16
-
17
18
  @Model('input') value;
18
19
  @Prop(Boolean) vertical;
19
20
 
@@ -24,7 +24,7 @@
24
24
  display: flex;
25
25
  flex-direction: row-reverse;
26
26
 
27
- .itf-tabs-panel {
27
+ & > .itf-tabs-panel {
28
28
  flex-direction: column;
29
29
  width: var(--itf-tabs-panel-width);
30
30
  padding-top: 6px;
@@ -32,7 +32,7 @@
32
32
  margin-right: 0;
33
33
  padding-bottom: calc(var(--itf-tabs-tab-padding) * 3);
34
34
 
35
- .itf-tab {
35
+ & > .itf-tab {
36
36
  padding: var(--itf-tabs-tab-padding) 10px 0;
37
37
  width: calc(100% - 2px);
38
38
  margin-bottom: calc(var(--itf-tabs-tab-padding) * 1.5);
@@ -79,7 +79,7 @@
79
79
  }
80
80
  }
81
81
  }
82
- .itf-tabs-content {
82
+ & > .itf-tabs-content {
83
83
  flex-grow: 1;
84
84
  z-index: 1;
85
85
  margin-right: -1px;
@@ -87,7 +87,7 @@
87
87
  }
88
88
  }
89
89
 
90
- .itf-tabs-panel {
90
+ & > .itf-tabs-panel {
91
91
  margin: 0;
92
92
  padding: 0;
93
93
  overflow: hidden;
@@ -97,7 +97,7 @@
97
97
  justify-content: start;
98
98
  flex-wrap: wrap;
99
99
 
100
- .itf-tab {
100
+ & > .itf-tab {
101
101
  white-space: nowrap;
102
102
  display: block;
103
103
  //float: right;
@@ -170,7 +170,7 @@
170
170
  }
171
171
  }
172
172
  .itf-tabs-content {
173
- .itf-tab-content {
173
+ & > .itf-tab-content {
174
174
  height: 100%;
175
175
 
176
176
  &.filled {
@@ -106,7 +106,7 @@
106
106
  }
107
107
  </style>
108
108
  <script>
109
- import { Vue, Component, Prop, Emit, Inject, Provide } from 'vue-property-decorator';
109
+ import { Vue, Component, Prop, Emit, Inject } from 'vue-property-decorator';
110
110
  import itfForm from '../form/Form';
111
111
  import itfButton from '../button/Button';
112
112
  import loading from '../../directives/loading';
@@ -119,12 +119,14 @@ export default @Component({
119
119
  },
120
120
  directives: {
121
121
  loading
122
+ },
123
+ provide() {
124
+ return { step: this }; // do not use Provide from vue-property-decorator
122
125
  }
123
126
  })
124
127
  class itfWizardStep extends Vue {
125
128
  @Inject({ default: null }) upApp;
126
129
  @Inject() stepsManager;
127
- @Provide() step = this;
128
130
 
129
131
  @Prop() id;
130
132
  @Prop() cardTitle;
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import {
3
- Vue, Component, Prop, Provide, Model, Emit,
3
+ Vue, Component, Prop, Model, Emit,
4
4
  } from 'vue-property-decorator';
5
5
  import itfWizardStep from './Step';
6
6
  import itfWizardSidebar from './Sidebar';
@@ -12,10 +12,11 @@ export default @Component({
12
12
  itfWizardStep,
13
13
  itfWizardSidebar,
14
14
  },
15
+ provide() {
16
+ return { stepsManager: this }; // do not use Provide from vue-property-decorator
17
+ }
15
18
  })
16
19
  class itfWizard extends Vue {
17
- @Provide() stepsManager = this;
18
-
19
20
  @Model('input') value;
20
21
 
21
22
  @Prop(Boolean) keepAlive;
@@ -21,7 +21,7 @@ class ValidatableMixin extends Vue {
21
21
  @Prop({ type: [String, Array], default: () => [] }) errorMessages;
22
22
  @Prop({ type: [String, Array], default: () => [] }) successMessages;
23
23
  @Prop({ type: [String, Array], default: () => [] }) messages;
24
- @Prop({ type: Array, default: () => [] }) rules;
24
+ @Prop({ type: Array, default: () => [], validator: (value) => Array.isArray(value) }) rules;
25
25
  @Prop({ required: false }) value;
26
26
 
27
27
  errorBucket = [];