@itfin/components 1.0.86 → 1.0.89

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.86",
3
+ "version": "1.0.89",
4
4
  "main": "dist/itfin-components.umd.js",
5
5
  "unpkg": "dist/itfin-components.common.js",
6
6
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
@@ -92,6 +92,9 @@ class itfApp extends Vue {
92
92
  }
93
93
 
94
94
  showSuccess(message, title = '') {
95
+ if (typeof document === 'undefined') {
96
+ return;
97
+ }
95
98
  return Message.success({
96
99
  isCollapsed: false,
97
100
  showClose: true,
@@ -104,6 +107,9 @@ class itfApp extends Vue {
104
107
  }
105
108
 
106
109
  showError(message, opts = {}) {
110
+ if (typeof document === 'undefined') {
111
+ return;
112
+ }
107
113
  return Message.error({
108
114
  isCollapsed: false,
109
115
  showClose: true,
@@ -116,6 +122,9 @@ class itfApp extends Vue {
116
122
  }
117
123
 
118
124
  showMessage(options) {
125
+ if (typeof document === 'undefined') {
126
+ return;
127
+ }
119
128
  return Message.toast({
120
129
  isCollapsed: false,
121
130
  showClose: true,
@@ -40,6 +40,7 @@
40
40
  .itf-button.btn {
41
41
  display: inline-flex;
42
42
  align-items: center;
43
+ position: relative;
43
44
 
44
45
  &.btn-primary {
45
46
  color: #fff; // @todo remove when remove vuetify
@@ -52,23 +53,26 @@
52
53
  pointer-events: none;
53
54
  }
54
55
  .itf-spinner {
55
- mix-blend-mode: normal;
56
+ position: absolute;
57
+ top: 50%;
58
+ left: 50%;
59
+ margin: -0.75rem;
56
60
  }
57
61
 
58
62
  &.loading {
59
63
  cursor: progress;
60
64
  pointer-events: none;
65
+ color: transparent;
61
66
 
62
- .itf-spinner {
63
- margin-right: 0.5rem;
64
- }
65
67
  &.btn-sm .itf-spinner {
66
68
  width: 1rem;
67
69
  height: 1rem;
70
+ margin: -0.5rem;
68
71
  }
69
72
  &.btn-lg .itf-spinner {
70
73
  width: 1.75rem;
71
74
  height: 1.75rem;
75
+ margin: -0.875rem;
72
76
  }
73
77
  }
74
78
  &.btn-basic {
@@ -114,6 +114,7 @@ class itfDatePicker extends Vue {
114
114
  @Prop({ type: Boolean, default: false }) onlyCalendar;
115
115
  @Prop({ type: String, default: '' }) placeholder;
116
116
  @Prop({ type: String, default: '' }) prependIcon;
117
+ @Prop({ type: String, default: 'bottom-start' }) placement;
117
118
  @Prop(Boolean) clearable;
118
119
 
119
120
  focused = false;
@@ -158,7 +159,7 @@ class itfDatePicker extends Vue {
158
159
  allowHTML: true,
159
160
  trigger: 'click',
160
161
  interactive: true,
161
- placement: 'bottom-start',
162
+ placement: this.placement,
162
163
  appendTo: context
163
164
  });
164
165
 
@@ -156,6 +156,7 @@ class itfDateRangePicker extends Vue {
156
156
  @Prop({ type: Boolean, default: false }) clearable;
157
157
  @Prop({ type: String, default: '' }) placeholder;
158
158
  @Prop({ type: String, default: '' }) prependIcon;
159
+ @Prop({ type: String, default: 'bottom-start' }) placement;
159
160
 
160
161
  focused = false;
161
162
 
@@ -199,7 +200,7 @@ class itfDateRangePicker extends Vue {
199
200
  allowHTML: true,
200
201
  trigger: 'click',
201
202
  interactive: true,
202
- placement: 'bottom-start',
203
+ placement: this.placement,
203
204
  appendTo: context
204
205
  });
205
206
  }
@@ -86,6 +86,7 @@ class itfMonthPicker extends Vue {
86
86
  @Prop({ type: String, default: 'MMMM, yyyy' }) displayFormat;
87
87
  @Prop({ type: String, default: '' }) placeholder;
88
88
  @Prop({ type: String, default: '' }) prependIcon;
89
+ @Prop({ type: String, default: 'bottom-start' }) placement;
89
90
 
90
91
  focused = false;
91
92
 
@@ -111,7 +112,7 @@ class itfMonthPicker extends Vue {
111
112
  allowHTML: true,
112
113
  trigger: 'click',
113
114
  interactive: true,
114
- placement: 'bottom-start',
115
+ placement: this.placement,
115
116
  appendTo: context
116
117
  });
117
118
  }
@@ -90,9 +90,13 @@ class itfForm extends Vue {
90
90
  }
91
91
 
92
92
  doValidation(showError = true) {
93
+ const invalidComponents = this.components.filter(
94
+ (component) => (component.doValidation && !component.doValidation(true)) || (component.validate && !component.validate(true))
95
+ );
93
96
  // @todo remove validate when migrate from vuetify
94
- const isValid = !this.components.filter(component => (component.doValidation && !component.doValidation(true)) || (component.validate && !component.validate(true))).length;
97
+ const isValid = !invalidComponents.length;
95
98
  if (showError && !isValid && this.$showError) {
99
+ console.debug('Invalid', invalidComponents);
96
100
  this.$showError('Please fix the errors below to proceed.', { duration: 3000 });
97
101
  }
98
102
  return isValid;
@@ -82,7 +82,7 @@ class itfModal extends Vue {
82
82
 
83
83
  @Watch('value')
84
84
  onVisibleChanged(newValue, oldValue) {
85
- if (!this.modalEl || this.preventEvents || typeof oldValue === 'undefined') {
85
+ if (!this.modalEl || this.preventEvents || (typeof oldValue === 'undefined' && !newValue)) {
86
86
  return;
87
87
  }
88
88
  if (newValue) {
@@ -44,7 +44,7 @@
44
44
  @click="!row.summary && $emit('row-click', { row, index: r })">
45
45
  <div
46
46
  class="itf-table__cell"
47
- :class="{'itf-table__cell--sorted': sortedColumns[column.name]}"
47
+ :class="{'itf-table__cell--sorted': sortedColumns[column.name], 'align-left': column.alignLeft}"
48
48
  v-for="(column, k) in columns" :key="`${r}-${k}`">
49
49
  <span>
50
50
  <slot v-if="$scopedSlots[`column.${column.name}${row.summary ? '.summary' : ''}`]" :name="`column.${column.name}${row.summary ? '.summary' : ''}`" :item="row" :column="column">
@@ -223,7 +223,7 @@ html {
223
223
  text-align: right;
224
224
  word-break: break-word;
225
225
 
226
- &:first-child {
226
+ &:first-child, &.align-left {
227
227
  justify-content: flex-start;
228
228
  text-align: left;
229
229
  }