hy-app 0.4.0 → 0.4.1

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.
@@ -353,7 +353,7 @@ watch(
353
353
  * */
354
354
  const isShowClear = computed(() => {
355
355
  const { clearable, readonly } = props;
356
- return clearable && !readonly && !!focused.value && innerValue.value !== "";
356
+ return clearable && !readonly && innerValue.value !== "";
357
357
  });
358
358
  /**
359
359
  * @description 组件的类名
@@ -485,7 +485,6 @@ const valueChange = (value: string | number, isOut = false) => {
485
485
  * @description 点击清除控件
486
486
  */
487
487
  const onClear = () => {
488
- debugger;
489
488
  clearInput.value = true;
490
489
  innerValue.value = "";
491
490
  nextTick(() => {
@@ -37,8 +37,8 @@
37
37
  @include m(field-wrapper) {
38
38
  position: relative;
39
39
  @include flex(row);
40
- margin: 0;
41
40
  flex: 1;
41
+ margin-right: $hy-border-margin-padding-base;
42
42
 
43
43
  @include e(field) {
44
44
  background: transparent;
@@ -48,6 +48,11 @@
48
48
  font-size: 15px;
49
49
  flex: 1;
50
50
  color: $hy-text-color;
51
+ caret-color: $hy-text-color;
52
+ }
53
+
54
+ :deep(.input-placeholder) {
55
+ color: $hy-text-color--placeholder;
51
56
  }
52
57
  }
53
58
 
@@ -60,15 +65,14 @@
60
65
  align-items: center;
61
66
  justify-content: center;
62
67
  transform: scale(0.82);
63
- margin-left: 4px;
64
68
  }
65
69
 
66
70
  @include m(subfix-icon) {
67
- margin-left: 4px;
71
+ margin-left: $hy-border-margin-padding-sm;
68
72
  }
69
73
 
70
74
  @include m(prefix-icon) {
71
- margin-right: 4px;
75
+ margin-right: $hy-border-margin-padding-sm;
72
76
  }
73
77
  }
74
78
  }
@@ -6,23 +6,25 @@
6
6
  :class="menuItemClass(item, i)"
7
7
  :style="customStyle"
8
8
  >
9
- <slot v-if="$slots.icon" name="icon"></slot>
10
- <hy-icon
11
- v-else
12
- class="hy-menu__item__icon"
13
- :name="item.icon"
14
- :color="current === i ? color || 'var(--hy-theme-color)' : ''"
15
- :size="icon?.size || 16"
16
- :bold="icon?.bold"
17
- :customPrefix="icon?.customPrefix"
18
- :imgMode="icon?.imgMode"
19
- :width="icon?.width"
20
- :height="icon?.height"
21
- :top="icon?.top"
22
- :stop="icon?.stop"
23
- :round="icon?.round"
24
- :customStyle="icon?.customStyle || { marginRight: '2px' }"
25
- ></hy-icon>
9
+ <template v-if="item.icon">
10
+ <slot v-if="$slots.icon" name="icon" :value="item.icon"></slot>
11
+ <hy-icon
12
+ v-else
13
+ class="hy-menu__item__icon"
14
+ :name="item.icon"
15
+ :color="current === i ? color || 'var(--hy-theme-color)' : ''"
16
+ :size="icon?.size || 16"
17
+ :bold="icon?.bold"
18
+ :customPrefix="icon?.customPrefix"
19
+ :imgMode="icon?.imgMode"
20
+ :width="icon?.width"
21
+ :height="icon?.height"
22
+ :top="icon?.top"
23
+ :stop="icon?.stop"
24
+ :round="icon?.round"
25
+ :customStyle="icon?.customStyle || { marginRight: '2px' }"
26
+ ></hy-icon>
27
+ </template>
26
28
  <slot v-if="$slots.default"></slot>
27
29
  <text v-else class="hy-menu__item--title">{{ item.title }}</text>
28
30
  <hy-badge
@@ -429,13 +429,19 @@ const onTouchEnd2 = (e: TouchEvent, index = 1) => {
429
429
  }
430
430
  };
431
431
  const onClick = (e: TouchEvent) => {
432
- // if (props.isRange) return;
433
432
  if (props.disabled) return;
434
433
  // 直接点击滑块的情况,计算方式与onTouchMove方法相同
435
- // console.log('click', event)
436
434
  // #ifndef APP-NVUE
437
- // nvue下暂时无法获取坐标
438
- let clientX = e.detail.x - sliderRect.value.left!;
435
+
436
+ let x;
437
+ // #ifdef MP-ALIPAY
438
+ x = e.detail.clientX;
439
+ // #endif
440
+ // #ifndef MP-ALIPAY
441
+ x = e.detail.x;
442
+ // #endif
443
+
444
+ const clientX = x - sliderRect.value.left!;
439
445
  newValue.value =
440
446
  (clientX / sliderRect.value.width!) * (props.max - props.min) + props.min;
441
447
  updateValue(newValue.value, false, 1);
@@ -453,12 +459,12 @@ const updateValue = (
453
459
  valueFormat = props.max;
454
460
  }
455
461
  // 设置移动的距离,不能用百分比,因为NVUE不支持。
456
- let width = Math.min(
462
+ const width = Math.min(
457
463
  ((valueFormat - props.min) / (props.max - props.min)) *
458
464
  sliderRect.value.width!,
459
465
  sliderRect.value.width!,
460
466
  );
461
- let barStyle_1: CSSProperties = {
467
+ const barStyle_1: CSSProperties = {
462
468
  width: width + "px",
463
469
  };
464
470
  // 移动期间无需过渡动画
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hy-app",
3
- "version": "0.4.0",
4
- "description": "feat: 适配支付宝小程序",
3
+ "version": "0.4.1",
4
+ "description": "feat: 修复输入框在支付宝无法点击到关闭按钮,水印在支付宝真机调试有问题,后续修复",
5
5
  "main": "./index.ts",
6
6
  "private": false,
7
7
  "scripts": {},
package/utils/utils.ts CHANGED
@@ -406,7 +406,7 @@ const getRect = <T extends boolean>(
406
406
  } else if (!all && rect) {
407
407
  resolve(rect as RectResultType<T>);
408
408
  } else {
409
- error("没找到模块");
409
+ error(`调用getRect方法,没有找到${selector}对应的元素内容`);
410
410
  reject(new Error("No nodes found"));
411
411
  }
412
412
  };