@itfin/components 1.0.102 → 1.0.103

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.102",
3
+ "version": "1.0.103",
4
4
  "main": "dist/itfin-components.umd.js",
5
5
  "unpkg": "dist/itfin-components.common.js",
6
6
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
@@ -161,10 +161,12 @@ class itfButton extends Vue {
161
161
  @Prop({ type: [String, Object] }) to;
162
162
  @Prop(String) href;
163
163
  @Prop(String) target;
164
+ @Prop() class;
164
165
 
165
166
  render (createElement, { data, slots, children, props }) {
166
167
  const {
167
- to, href, target, disabled, color, block, loading, labeled, secondary, primary, small, large, icon, loadingText
168
+ to, href, target, disabled, color, block, loading, labeled, secondary, primary, small, large, icon, loadingText,
169
+ class: classNames
168
170
  } = props;
169
171
  const component = to ? 'nuxt-link' : (props.href ? 'a' : 'button');
170
172
  const staticClass = (data.staticClass || '') + ' itf-button btn';
@@ -175,7 +177,6 @@ class itfButton extends Vue {
175
177
  tabindex: 0
176
178
  },
177
179
  class: {
178
- ...(data.class || {}),
179
180
  [`btn-${color}`]: color,
180
181
  'itf-button__block': block,
181
182
  'labeled': labeled,
@@ -194,6 +195,16 @@ class itfButton extends Vue {
194
195
  props,
195
196
  staticClass
196
197
  };
198
+ if (data.class) {
199
+ if (typeof data.class === 'string') {
200
+ comProps.class[data.class] = true;
201
+ } else {
202
+ comProps.class = {
203
+ ...data.class,
204
+ ...comProps.class
205
+ };
206
+ }
207
+ }
197
208
  if (component === 'button') {
198
209
  comProps.attrs.type = 'button';
199
210
  }
@@ -86,7 +86,7 @@ class itfDropdown extends Vue {
86
86
  return;
87
87
  }
88
88
  const { default: Dropdown } = await import('bootstrap/js/src/dropdown.js');
89
- this.modalEl = new Dropdown(this.$refs.toggle.$el, {
89
+ this.modalEl = new Dropdown(this.$refs.toggle, {
90
90
  reference: 'toggle',
91
91
  autoClose: this.autoclose
92
92
  });