@designcrowd/fe-shared-lib 1.1.7-rte-ast-16.1 → 1.1.7-rte-ast-17

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.7-rte-ast-16.1",
3
+ "version": "1.1.7-rte-ast-17",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -24,7 +24,7 @@ export const Primary = () => {
24
24
  template: `
25
25
  <div>
26
26
  <div>Full width min 12 max 128</div>
27
- <NumberStepper v-model="numberValue" id="id1" :min="12" :max="128" :disabled="false" :timer-to-minimum="500" />
27
+ <NumberStepper v-model="numberValue" id="id1" :min="12" :max="128" :disabled="false" :timer-to-minimum="750" />
28
28
  <div class="tw-mt-4 tw-w-64">
29
29
  <div>Fixed container width</div>
30
30
  <NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="false" />
@@ -176,6 +176,7 @@ export default {
176
176
  },
177
177
  beforeUnmount() {
178
178
  this.clearLongPressTimers();
179
+ this.clearResetToMinTimer();
179
180
  },
180
181
  methods: {
181
182
  addDataAttribute() {
@@ -293,7 +294,7 @@ export default {
293
294
  e.target.value = newNumber;
294
295
  this.$emit('update:modelValue', this.number);
295
296
  this.$emit('input', this.number);
296
- this.startResetToMinTimer();
297
+ this.startResetToMinTimer(e);
297
298
  }
298
299
  },
299
300
  checkLimit(e) {
@@ -314,17 +315,20 @@ export default {
314
315
  this.$emit('update:modelValue', this.number);
315
316
  this.$emit('input', this.number);
316
317
  },
317
- startResetToMinTimer() {
318
+ startResetToMinTimer(e) {
319
+ this.clearResetToMinTimer();
318
320
  if (this.timerToMinimum) {
319
321
  this.resetToMinTimer = setTimeout(() => {
320
- if (this.number < this.min) {
321
- this.number = this.min;
322
- this.$emit('update:modelValue', this.number);
323
- this.$emit('input', this.number);
324
- }
322
+ this.checkLimit(e);
325
323
  }, this.timerToMinimum);
326
324
  }
327
325
  },
326
+ clearResetToMinTimer() {
327
+ if (this.resetToMinTimer) {
328
+ clearTimeout(this.resetToMinTimer);
329
+ this.resetToMinTimer = null;
330
+ }
331
+ },
328
332
  },
329
333
  };
330
334
  </script>