@designcrowd/fe-shared-lib 1.0.4 → 1.0.5
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/src/atoms/components/Dropdown/Dropdown.vue +4 -4
- package/src/atoms/components/Dropdown/DropdownItem.vue +4 -2
- package/src/atoms/components/NumberStepper/NumberStepper.vue +18 -6
- package/public/css/tailwind-brandCrowd.css +0 -2344
- package/public/css/tailwind-brandPage.css +0 -2032
- package/public/css/tailwind-crazyDomains.css +0 -2344
- package/public/css/tailwind-designCom.css +0 -2344
- package/public/css/tailwind-designCrowd.css +0 -2344
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:class="[elementClasses, disabled && 'tw-opacity-40 tw-cursor-not-allowed']"
|
|
6
6
|
@click="() => !disabled && onToggleMenu()"
|
|
7
7
|
>
|
|
8
|
-
<div class="tw-text-left tw-flex-auto tw-pl-3">
|
|
8
|
+
<div class="tw-text-left tw-flex-auto tw-pl-3 tw-truncate">
|
|
9
9
|
<slot name="title">
|
|
10
10
|
{{ title }}
|
|
11
11
|
</slot>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
<div
|
|
22
22
|
v-show="isMenuVisible"
|
|
23
|
-
class="tw-origin-top-right tw-absolute tw-left-0 tw-mt-2 tw-w-full tw-rounded-md tw-shadow-lg tw-bg-white tw-ring-1 tw-ring-black tw-ring-opacity-5"
|
|
23
|
+
class="tw-origin-top-right tw-absolute tw-left-0 tw-mt-2 tw-w-full tw-rounded-md tw-shadow-lg tw-bg-white tw-ring-1 tw-ring-black tw-ring-opacity-5 tw-z-20"
|
|
24
24
|
:class="[
|
|
25
25
|
menuElementClasses,
|
|
26
26
|
{
|
|
@@ -72,7 +72,7 @@ export default {
|
|
|
72
72
|
type: Boolean,
|
|
73
73
|
required: false,
|
|
74
74
|
default: false,
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
76
|
},
|
|
77
77
|
data: () => ({
|
|
78
78
|
isMenuVisible: false,
|
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
watch: {
|
|
86
86
|
show() {
|
|
87
87
|
this.isMenuVisible = this.show;
|
|
88
|
-
}
|
|
88
|
+
},
|
|
89
89
|
},
|
|
90
90
|
mounted() {
|
|
91
91
|
this.isMenuVisible = this.show;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
2
|
+
<div>
|
|
3
|
+
<div class="tw-flex tw-items-center tw-px-2 tw-py-2 drop-down-item tw-cursor-pointer" @click="onClick">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
4
6
|
</div>
|
|
5
7
|
</template>
|
|
6
8
|
<script>
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
<input
|
|
22
22
|
:ref="numberStepperRef"
|
|
23
23
|
class="tw-w-full tw-text-center tw-border tw-border-solid tw-border-secondary-200"
|
|
24
|
+
:class="inputClasses"
|
|
24
25
|
type="text"
|
|
25
26
|
:value="number"
|
|
26
27
|
pattern="[0-9]"
|
|
@@ -97,6 +98,10 @@ export default {
|
|
|
97
98
|
type: String,
|
|
98
99
|
default: 'medium',
|
|
99
100
|
},
|
|
101
|
+
inputClasses: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: undefined,
|
|
104
|
+
},
|
|
100
105
|
},
|
|
101
106
|
setup(props) {
|
|
102
107
|
const numberStepperRef = `js-number-stepper-${props.id}`;
|
|
@@ -106,6 +111,7 @@ export default {
|
|
|
106
111
|
return {
|
|
107
112
|
num: null,
|
|
108
113
|
longPress: null,
|
|
114
|
+
longPressDelayTimeout: null,
|
|
109
115
|
longPressTimeout: null,
|
|
110
116
|
longPressInterval: null,
|
|
111
117
|
};
|
|
@@ -140,6 +146,7 @@ export default {
|
|
|
140
146
|
},
|
|
141
147
|
},
|
|
142
148
|
created() {
|
|
149
|
+
this.DELAY_BEFORE_LONG_PRESS_START = 300;
|
|
143
150
|
this.LONG_PRESS_DELAY = 1000;
|
|
144
151
|
this.LONG_PRESS_INTERVAL_DELAY = 100;
|
|
145
152
|
this.LONG_PRESS_AMOUNT = 5;
|
|
@@ -212,20 +219,25 @@ export default {
|
|
|
212
219
|
|
|
213
220
|
vm.changeNumber(direction);
|
|
214
221
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
// Small delay before long press logic other wise sometimes slight long click once registers twice
|
|
223
|
+
vm.longPressDelayTimeout = setTimeout(() => {
|
|
224
|
+
vm.longPressInterval = setInterval(() => {
|
|
225
|
+
vm.changeNumber(direction, longPressValue);
|
|
226
|
+
}, vm.LONG_PRESS_INTERVAL_DELAY);
|
|
218
227
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
228
|
+
vm.longPressTimeout = setTimeout(() => {
|
|
229
|
+
longPressValue = vm.LONG_PRESS_AMOUNT;
|
|
230
|
+
}, vm.LONG_PRESS_DELAY);
|
|
231
|
+
}, vm.DELAY_BEFORE_LONG_PRESS_START);
|
|
222
232
|
}
|
|
223
233
|
},
|
|
224
234
|
clearLongPressTimers(e) {
|
|
225
235
|
// eslint-disable-next-line no-unused-expressions
|
|
226
236
|
e && e.preventDefault();
|
|
237
|
+
clearTimeout(this.longPressDelayTimeout);
|
|
227
238
|
clearTimeout(this.longPressTimeout);
|
|
228
239
|
clearInterval(this.longPressInterval);
|
|
240
|
+
this.longPressDelayTimeout = null;
|
|
229
241
|
this.longPressTimeout = null;
|
|
230
242
|
this.longPressInterval = null;
|
|
231
243
|
this.longPress = false;
|