@designcrowd/fe-shared-lib 1.0.4-ast-number-stepper-5 → 1.0.4-cg1

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.0.4-ast-number-stepper-5",
3
+ "version": "1.0.4-cg1",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -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 tw-z-20"
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"
24
24
  :class="[
25
25
  menuElementClasses,
26
26
  {
@@ -1,8 +1,6 @@
1
1
  <template>
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>
2
+ <div class="tw-flex tw-items-center tw-px-2 tw-py-2 drop-down-item tw-cursor-pointer" @click="onClick">
3
+ <slot></slot>
6
4
  </div>
7
5
  </template>
8
6
  <script>
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <path
3
3
  d="M8.58929 1.26673L12.0179 4.76844C12.3661 5.09673 12.3661 5.67123 12.0179 5.99951C11.6964 6.35515 11.1339 6.35515 10.8125 5.99951L8.85714 4.00244V9.74744C8.85714 10.2399 8.45536 10.6229 8 10.6229C7.51786 10.6229 7.14286 10.2399 7.14286 9.74744V4.00244L5.16071 5.99951C4.83929 6.35515 4.27679 6.35515 3.95536 5.99951C3.60714 5.67123 3.60714 5.09673 3.95536 4.76844L7.38393 1.26673C7.70536 0.911089 8.26786 0.911089 8.58929 1.26673ZM3.71429 10.6229V12.3737C3.71429 12.8661 4.08929 13.2491 4.57143 13.2491H11.4286C11.8839 13.2491 12.2857 12.8661 12.2857 12.3737V10.6229C12.2857 10.1578 12.6607 9.74744 13.1429 9.74744C13.5982 9.74744 14 10.1578 14 10.6229V12.3737C14 13.8236 12.8482 15 11.4286 15H4.57143C3.15179 15 2 13.8236 2 12.3737V10.6229C2 10.1578 2.375 9.74744 2.85714 9.74744C3.3125 9.74744 3.71429 10.1578 3.71429 10.6229Z"
4
- fill="black"
5
4
  />
6
5
  </template>
@@ -21,7 +21,6 @@
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"
25
24
  type="text"
26
25
  :value="number"
27
26
  pattern="[0-9]"
@@ -98,10 +97,6 @@ export default {
98
97
  type: String,
99
98
  default: 'medium',
100
99
  },
101
- inputClasses: {
102
- type: String,
103
- default: undefined,
104
- },
105
100
  },
106
101
  setup(props) {
107
102
  const numberStepperRef = `js-number-stepper-${props.id}`;
@@ -111,7 +106,6 @@ export default {
111
106
  return {
112
107
  num: null,
113
108
  longPress: null,
114
- longPressDelayTimeout: null,
115
109
  longPressTimeout: null,
116
110
  longPressInterval: null,
117
111
  };
@@ -146,7 +140,6 @@ export default {
146
140
  },
147
141
  },
148
142
  created() {
149
- this.DELAY_BEFORE_LONG_PRESS_START = 300;
150
143
  this.LONG_PRESS_DELAY = 1000;
151
144
  this.LONG_PRESS_INTERVAL_DELAY = 100;
152
145
  this.LONG_PRESS_AMOUNT = 5;
@@ -219,25 +212,20 @@ export default {
219
212
 
220
213
  vm.changeNumber(direction);
221
214
 
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);
215
+ vm.longPressInterval = setInterval(() => {
216
+ vm.changeNumber(direction, longPressValue);
217
+ }, vm.LONG_PRESS_INTERVAL_DELAY);
227
218
 
228
- vm.longPressTimeout = setTimeout(() => {
229
- longPressValue = vm.LONG_PRESS_AMOUNT;
230
- }, vm.LONG_PRESS_DELAY);
231
- }, vm.DELAY_BEFORE_LONG_PRESS_START);
219
+ vm.longPressTimeout = setTimeout(() => {
220
+ longPressValue = vm.LONG_PRESS_AMOUNT;
221
+ }, vm.LONG_PRESS_DELAY);
232
222
  }
233
223
  },
234
224
  clearLongPressTimers(e) {
235
225
  // eslint-disable-next-line no-unused-expressions
236
226
  e && e.preventDefault();
237
- clearTimeout(this.longPressDelayTimeout);
238
227
  clearTimeout(this.longPressTimeout);
239
228
  clearInterval(this.longPressInterval);
240
- this.longPressDelayTimeout = null;
241
229
  this.longPressTimeout = null;
242
230
  this.longPressInterval = null;
243
231
  this.longPress = false;