@itfin/components 1.2.119 → 1.2.121

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.2.119",
3
+ "version": "1.2.121",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -3,13 +3,13 @@
3
3
  <div class="itf-dropdown" :class="`drop${placement}`">
4
4
  <div v-if="disabled"><slot name="button">{{label}}</slot></div>
5
5
  <itf-button
6
- v-else-if="!text"
7
- :class="{ 'dropdown-toggle': toggle }"
8
- v-bind="buttonOptions"
9
- ref="toggle"
10
- :id="modalId"
11
- data-bs-toggle="dropdown"
12
- aria-expanded="false"
6
+ v-else-if="!text"
7
+ :class="{ 'dropdown-toggle': toggle }"
8
+ v-bind="buttonOptions"
9
+ ref="toggle"
10
+ :id="modalId"
11
+ data-bs-toggle="dropdown"
12
+ aria-expanded="false"
13
13
  >
14
14
  <slot name="button">{{label}}</slot>
15
15
  </itf-button>
@@ -17,10 +17,11 @@
17
17
  <slot name="button">{{label}}</slot>
18
18
  </div>
19
19
  <div
20
- class="itf-dropdown__menu dropdown-menu"
21
- :class="{'dropdown-menu-end': right, 'shadow': shadow}"
22
- ref="dropdown"
23
- :aria-labelledby="modalId">
20
+ class="itf-dropdown__menu dropdown-menu"
21
+ :class="{'dropdown-menu-end': right, 'shadow': shadow}"
22
+ ref="dropdown"
23
+ v-bind="menuOptions"
24
+ :aria-labelledby="modalId">
24
25
  <slot></slot>
25
26
  </div>
26
27
  </div>
@@ -51,6 +52,7 @@ class itfDropdown extends Vue {
51
52
  @Prop({ type: Boolean }) appendToBody;
52
53
  @Prop({ validator: (value) => [true, false, 'inside', 'outside'].includes(value), default: true }) autoclose;
53
54
  @Prop({ type: Object, default: () => ({}) }) buttonOptions;
55
+ @Prop({ type: Object, default: () => ({}) }) menuOptions;
54
56
 
55
57
  modalId = '';
56
58
  modalEl = null;
@@ -116,8 +116,15 @@ class itfMoneyField extends Vue {
116
116
  return this.currencies.find(({ Id }) => this.currency.Id === Id);
117
117
  }
118
118
 
119
- @Emit('input')
120
119
  setValue (val) {
120
+ if (!isNumeric(val)) {
121
+ return;
122
+ }
123
+ this.$emit('input', val);
124
+
125
+ function isNumeric(value) {
126
+ return /^-?\d+([\,\.]\d+)?$/.test(value);
127
+ }
121
128
  }
122
129
  }
123
130
  </script>