@itfin/components 1.0.46 → 1.0.47

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.46",
3
+ "version": "1.0.47",
4
4
 
5
5
  "main": "dist/itfin-components.umd.js",
6
6
  "unpkg": "dist/itfin-components.common.js",
@@ -10,6 +10,8 @@
10
10
  :class="className"
11
11
  :type="type"
12
12
  :content="message"
13
+ :button="button"
14
+ :on-click="onClick"
13
15
  :closable="showClose"
14
16
  :is-collapsed="isCollapsed"
15
17
  @close="close"
@@ -85,8 +87,10 @@ class itfToastContainer extends Vue {
85
87
  width: '',
86
88
  className: '',
87
89
  wrapperClassName: '',
90
+ button: '',
88
91
  supportHTML: false,
89
92
  onClose: null,
93
+ onClick: null,
90
94
  timer: null,
91
95
  closed: false
92
96
  };
@@ -14,11 +14,12 @@
14
14
  <button type="button" class="btn-close" :class="{'btn-close-white': type}" data-bs-dismiss="toast" aria-label="Close" @click="close"></button>
15
15
  </div>
16
16
  <div class="d-flex" v-if="!collapsed">
17
- <div class="toast-body">
17
+ <div class="toast-body flex-shrink-1">
18
18
  <div v-if="supportHtml" v-html="content">
19
19
  <slot />
20
20
  </div>
21
21
  <slot v-else>{{ content }}</slot>
22
+ <itf-button small primary block v-if="button" @click="onClick" class="mt-3">{{button}}</itf-button>
22
23
  </div>
23
24
  <div class="me-2 m-auto" v-if="!title && !$slots.title">
24
25
  <button type="button" class="btn-close" :class="{'btn-close-white': type}" data-bs-dismiss="toast" aria-label="Close" @click="close"></button>
@@ -35,10 +36,12 @@
35
36
  </style>
36
37
  <script>
37
38
  import { Vue, Component, Prop, Emit } from 'vue-property-decorator';
39
+ import itfButton from '../button/Button';
38
40
 
39
41
  export default @Component({
40
42
  name: 'itfToastMessage',
41
43
  components: {
44
+ itfButton
42
45
  }
43
46
  })
44
47
  class itfToastMessage extends Vue {
@@ -47,6 +50,8 @@ class itfToastMessage extends Vue {
47
50
  @Prop(Boolean) closable;
48
51
  @Prop(String) title;
49
52
  @Prop(String) content;
53
+ @Prop(String) button;
54
+ @Prop(Function) onClick;
50
55
 
51
56
  @Prop(Boolean) supportHtml;
52
57
  @Prop({ type: Boolean, default: true }) isCollapsed;
@@ -26,7 +26,7 @@ storiesOf('Common', module)
26
26
 
27
27
  <button @click="$showSuccess('Success')">Show success</button>
28
28
  <button @click="$showError('Error')">Show error</button>
29
- <button @click="$showMessage({ title: 'Cool title', message: 'This is the test message' })">Test message</button>
29
+ <button @click="$showMessage({ title: 'New version released', message: 'Pss... Hey, we have released a new version of ITFin! Please refresh the page to reach out to new features.', button: 'Refresh', onClick: () => location.reload() })">Test message</button>
30
30
  <button @click="$try(() => { throw new Error('Invalid function'); })">Try function with error</button>
31
31
 
32
32
  </itf-app>