@designcrowd/fe-shared-lib 1.1.5-rte-ast-12.3 → 1.1.5-rte-ast-13

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": "@designcrowd/fe-shared-lib",
3
- "version": "1.1.5-rte-ast-12.3",
3
+ "version": "1.1.5-rte-ast-13",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -156,10 +156,6 @@ export default {
156
156
  this.sliderValue = v;
157
157
  },
158
158
  },
159
- beforeUnmount() {
160
- console.log('is this before unmount');
161
- this.blurOnUnmount(this.sliderValue);
162
- },
163
159
  methods: {
164
160
  focus() {
165
161
  this.$refs.inputSlider.focus();
@@ -186,19 +182,22 @@ export default {
186
182
  if (this.decimalRegex.test(newNumber)) {
187
183
  this.updateValue(newNumber, e);
188
184
  } else {
189
- const numbersOnly = newVal.replace(/[^\d.]/g, '');
185
+ // Remove all non-digit/non-dot characters
186
+ let numbersOnly = newVal.replace(/[^\d.]/g, '');
187
+
188
+ // Remove all dots except the first one
189
+ const firstDotIndex = numbersOnly.indexOf('.');
190
+ if (firstDotIndex !== -1) {
191
+ numbersOnly =
192
+ numbersOnly.slice(0, firstDotIndex + 1) + numbersOnly.slice(firstDotIndex + 1).replace(/\./g, '');
193
+ }
194
+
190
195
  this.updateValue(numbersOnly, e);
191
196
  }
192
197
  } else {
193
198
  this.updateValue(newNumber, e);
194
199
  }
195
200
  },
196
- blurOnUnmount(value) {
197
- if (value <= this.min) {
198
- this.sliderValue = this.min;
199
- this.$emit('update:model-value', this.min);
200
- }
201
- },
202
201
  checkLimit(e) {
203
202
  let newNumber = 0;
204
203
  if (e.target.value === '') {