@designcrowd/fe-shared-lib 1.1.7-rte-haider-16 → 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 +1 -1
- package/public/css/tailwind-brandCrowd.css +4 -0
- package/public/css/tailwind-brandPage.css +4 -0
- package/public/css/tailwind-crazyDomains.css +4 -0
- package/public/css/tailwind-designCom.css +4 -0
- package/public/css/tailwind-designCrowd.css +4 -0
- package/src/atoms/components/NumberStepper/NumberStepper.stories.js +1 -1
- package/src/atoms/components/NumberStepper/NumberStepper.vue +21 -0
package/package.json
CHANGED
|
@@ -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" />
|
|
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" />
|
|
@@ -114,6 +114,10 @@ export default {
|
|
|
114
114
|
type: Boolean,
|
|
115
115
|
default: false,
|
|
116
116
|
},
|
|
117
|
+
timerToMinimum: {
|
|
118
|
+
type: Number,
|
|
119
|
+
default: false,
|
|
120
|
+
},
|
|
117
121
|
},
|
|
118
122
|
setup(props) {
|
|
119
123
|
const numberStepperRef = `js-number-stepper-${props.id}`;
|
|
@@ -126,6 +130,7 @@ export default {
|
|
|
126
130
|
longPressDelayTimeout: null,
|
|
127
131
|
longPressTimeout: null,
|
|
128
132
|
longPressInterval: null,
|
|
133
|
+
resetToMinTimer: null,
|
|
129
134
|
};
|
|
130
135
|
},
|
|
131
136
|
computed: {
|
|
@@ -171,6 +176,7 @@ export default {
|
|
|
171
176
|
},
|
|
172
177
|
beforeUnmount() {
|
|
173
178
|
this.clearLongPressTimers();
|
|
179
|
+
this.clearResetToMinTimer();
|
|
174
180
|
},
|
|
175
181
|
methods: {
|
|
176
182
|
addDataAttribute() {
|
|
@@ -288,6 +294,7 @@ export default {
|
|
|
288
294
|
e.target.value = newNumber;
|
|
289
295
|
this.$emit('update:modelValue', this.number);
|
|
290
296
|
this.$emit('input', this.number);
|
|
297
|
+
this.startResetToMinTimer(e);
|
|
291
298
|
}
|
|
292
299
|
},
|
|
293
300
|
checkLimit(e) {
|
|
@@ -308,6 +315,20 @@ export default {
|
|
|
308
315
|
this.$emit('update:modelValue', this.number);
|
|
309
316
|
this.$emit('input', this.number);
|
|
310
317
|
},
|
|
318
|
+
startResetToMinTimer(e) {
|
|
319
|
+
this.clearResetToMinTimer();
|
|
320
|
+
if (this.timerToMinimum) {
|
|
321
|
+
this.resetToMinTimer = setTimeout(() => {
|
|
322
|
+
this.checkLimit(e);
|
|
323
|
+
}, this.timerToMinimum);
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
clearResetToMinTimer() {
|
|
327
|
+
if (this.resetToMinTimer) {
|
|
328
|
+
clearTimeout(this.resetToMinTimer);
|
|
329
|
+
this.resetToMinTimer = null;
|
|
330
|
+
}
|
|
331
|
+
},
|
|
311
332
|
},
|
|
312
333
|
};
|
|
313
334
|
</script>
|