hy-app 0.3.16 → 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.
Files changed (102) hide show
  1. package/components/hy-action-sheet/hy-action-sheet.vue +2 -2
  2. package/components/hy-action-sheet/typing.d.ts +32 -33
  3. package/components/hy-back-top/hy-back-top.vue +36 -32
  4. package/components/hy-button/hy-button.vue +7 -7
  5. package/components/hy-button/typing.d.ts +39 -40
  6. package/components/hy-calendar/index.scss +1 -1
  7. package/components/hy-card/hy-card.vue +3 -3
  8. package/components/hy-cell/hy-cell.vue +125 -118
  9. package/components/hy-cell/index.scss +7 -7
  10. package/components/hy-checkbox/hy-checkbox.vue +17 -16
  11. package/components/hy-checkbox/index.scss +1 -1
  12. package/components/hy-checkbox-item/hy-checkbox-item.vue +25 -30
  13. package/components/hy-checkbox-item/index.scss +1 -1
  14. package/components/hy-code-input/hy-code-input.vue +314 -314
  15. package/components/hy-code-input/index.scss +12 -12
  16. package/components/hy-count-down/index.scss +1 -1
  17. package/components/hy-datetime-picker/index.scss +1 -1
  18. package/components/hy-datetime-picker/typing.d.ts +0 -1
  19. package/components/hy-divider/index.scss +3 -3
  20. package/components/hy-dropdown-item/hy-dropdown-item.vue +2 -2
  21. package/components/hy-dropdown-item/index.scss +5 -5
  22. package/components/hy-float-button/hy-float-button.vue +1 -1
  23. package/components/hy-float-button/index.scss +9 -18
  24. package/components/hy-folding-panel/index.scss +1 -1
  25. package/components/hy-form-item/hy-form-item.vue +10 -11
  26. package/components/hy-grid/hy-grid.vue +23 -23
  27. package/components/hy-grid/index.scss +2 -8
  28. package/components/hy-icon/index.scss +8 -8
  29. package/components/hy-input/hy-input.vue +45 -45
  30. package/components/hy-input/index.scss +20 -15
  31. package/components/hy-line-progress/index.scss +3 -3
  32. package/components/hy-list/hy-list.vue +2 -2
  33. package/components/hy-list/index.scss +4 -4
  34. package/components/hy-loading/hy-loading.vue +2 -3
  35. package/components/hy-loading/index.scss +17 -15
  36. package/components/hy-menu/hy-menu.vue +26 -16
  37. package/components/hy-menu/index.scss +1 -1
  38. package/components/hy-menu/typing.d.ts +16 -12
  39. package/components/hy-modal/hy-modal.vue +11 -11
  40. package/components/hy-modal/index.scss +17 -17
  41. package/components/hy-modal/typing.d.ts +0 -2
  42. package/components/hy-navbar/hy-navbar.vue +3 -3
  43. package/components/hy-navbar/index.scss +10 -11
  44. package/components/hy-notice-bar/hy-column-notice.vue +2 -2
  45. package/components/hy-notice-bar/hy-row-notice.vue +3 -3
  46. package/components/hy-notice-bar/index.scss +9 -12
  47. package/components/hy-notify/hy-notify.vue +8 -5
  48. package/components/hy-notify/index.scss +2 -2
  49. package/components/hy-number-step/index.scss +9 -10
  50. package/components/hy-pagination/index.scss +7 -2
  51. package/components/hy-parse/index.scss +0 -9
  52. package/components/hy-picker/hy-picker.vue +1 -1
  53. package/components/hy-picker/index.scss +9 -16
  54. package/components/hy-popover/hy-popover.vue +6 -4
  55. package/components/hy-popup/hy-popup.vue +4 -2
  56. package/components/hy-popup/index.scss +45 -32
  57. package/components/hy-qrcode/hy-qrcode.vue +3 -3
  58. package/components/hy-qrcode/index.scss +18 -17
  59. package/components/hy-radio/hy-radio.vue +20 -18
  60. package/components/hy-radio/index.scss +26 -22
  61. package/components/hy-rate/hy-rate.vue +5 -5
  62. package/components/hy-rate/index.scss +4 -4
  63. package/components/hy-read-more/hy-read-more.vue +19 -20
  64. package/components/hy-read-more/index.scss +12 -6
  65. package/components/hy-scroll-list/hy-scroll-list.vue +3 -6
  66. package/components/hy-scroll-list/index.scss +4 -4
  67. package/components/hy-search/index.scss +9 -8
  68. package/components/hy-slider/hy-slider.vue +17 -11
  69. package/components/hy-slider/index.scss +12 -12
  70. package/components/hy-status-bar/index.scss +3 -1
  71. package/components/hy-steps/hy-steps.vue +50 -23
  72. package/components/hy-submit-bar/hy-submit-bar.vue +1 -1
  73. package/components/hy-submit-bar/index.scss +5 -4
  74. package/components/hy-subsection/hy-subsection.vue +3 -3
  75. package/components/hy-subsection/index.scss +7 -7
  76. package/components/hy-swipe-action/hy-swipe-action.vue +8 -8
  77. package/components/hy-swipe-action/index.scss +8 -4
  78. package/components/hy-swiper/hy-swiper-indicator.vue +2 -2
  79. package/components/hy-swiper/hy-swiper.vue +6 -6
  80. package/components/hy-swiper/index.scss +6 -10
  81. package/components/hy-switch/hy-switch.vue +4 -4
  82. package/components/hy-switch/index.scss +4 -22
  83. package/components/hy-tabs/hy-tabs.vue +16 -16
  84. package/components/hy-tabs/index.scss +16 -16
  85. package/components/hy-tag/index.scss +1 -1
  86. package/components/hy-text/index.scss +3 -3
  87. package/components/hy-textarea/hy-textarea.vue +11 -11
  88. package/components/hy-textarea/index.scss +11 -10
  89. package/components/hy-toast/hy-toast.vue +5 -5
  90. package/components/hy-toast/index.scss +8 -8
  91. package/components/hy-tooltip/hy-tooltip.vue +193 -183
  92. package/components/hy-tooltip/index.scss +69 -45
  93. package/components/hy-upload/hy-upload.vue +15 -10
  94. package/components/hy-upload/index.scss +37 -36
  95. package/components/hy-warn/hy-warn.vue +11 -11
  96. package/components/hy-warn/index.scss +76 -82
  97. package/components/hy-waterfall/index.scss +2 -1
  98. package/composables/usePopover.ts +2 -2
  99. package/libs/css/mixin.scss +0 -9
  100. package/package.json +2 -2
  101. package/utils/inside.ts +4 -1
  102. package/utils/utils.ts +187 -162
@@ -12,12 +12,12 @@
12
12
  align-items: center;
13
13
  position: relative;
14
14
 
15
- &__text {
15
+ @include e(text) {
16
16
  font-size: 15px;
17
17
  color: $hy-icon-color;
18
18
  }
19
19
 
20
- &__dot {
20
+ @include e(dot) {
21
21
  width: 7px;
22
22
  height: 7px;
23
23
  border-radius: 100px;
@@ -25,10 +25,10 @@
25
25
  }
26
26
 
27
27
  /* 无边框 */
28
- &__not {
28
+ @include e(no) {
29
29
  background-color: $hy-background--track;
30
30
  border-radius: $hy-border-radius-sm;
31
- &__active {
31
+ @include m(active) {
32
32
  &:before {
33
33
  content: "";
34
34
  background-color: $hy-text-color;
@@ -41,28 +41,28 @@
41
41
  }
42
42
 
43
43
  /* 方块模式 */
44
- &__box {
44
+ @include e(box) {
45
45
  border-color: $hy-border-color--2;
46
- &__border {
46
+ @include e(border) {
47
47
  border-color: $hy-primary !important;
48
48
 
49
49
  @include b(code-input--item__dot) {
50
50
  background-color: $hy-primary;
51
51
  }
52
52
 
53
- text {
53
+ @include b(code-input--item__text) {
54
54
  color: $hy-primary;
55
55
  }
56
56
  }
57
57
 
58
- &__active {
58
+ @include e(active) {
59
59
  border-color: $hy-primary !important;
60
60
  animation: 1.5s hy-cursor-flicker infinite;
61
61
  }
62
62
  }
63
63
 
64
64
  /* 线条模式 */
65
- &__line {
65
+ @include e(line) {
66
66
  &::after {
67
67
  content: "";
68
68
  position: absolute;
@@ -73,7 +73,7 @@
73
73
  }
74
74
 
75
75
  /* 边框 */
76
- &__border {
76
+ @include e(border) {
77
77
  @include b(code-input--item__dot) {
78
78
  background-color: $hy-primary;
79
79
  }
@@ -87,7 +87,7 @@
87
87
  }
88
88
 
89
89
  /* 状态 */
90
- &__active {
90
+ @include e(active) {
91
91
  &::after {
92
92
  content: "";
93
93
  background-color: $hy-primary !important;
@@ -97,7 +97,7 @@
97
97
  }
98
98
  }
99
99
 
100
- &__input {
100
+ @include e(input) {
101
101
  // 之所以需要input输入框,是因为有它才能唤起键盘
102
102
  // 这里将它设置为两倍的屏幕宽度,再将左边的一半移出屏幕,为了不让用户看到输入的内容
103
103
  position: absolute;
@@ -2,7 +2,7 @@
2
2
  @use "../../libs/css/theme" as *;
3
3
 
4
4
  @include b(count-down) {
5
- &__text {
5
+ @include e(text) {
6
6
  font-size: 15px;
7
7
  line-height: 22px;
8
8
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  @include b(datetime-picker) {
4
4
  flex: 1;
5
- &__has-input {
5
+ @include e(has-input) {
6
6
  position: relative;
7
7
  display: flex;
8
8
  flex-direction: column;
@@ -1,7 +1,6 @@
1
1
  import { DateModeEnum } from "../../typing";
2
2
  import type { CSSProperties } from "vue";
3
3
  import type HyInputProps from "../hy-input/typing";
4
- import HyApp from "hy-app";
5
4
 
6
5
  export default interface HyDatetimeProps {
7
6
  /**
@@ -8,18 +8,18 @@
8
8
  align-items: center;
9
9
  min-height: 35px;
10
10
 
11
- &__line {
11
+ @include e(line) {
12
12
  /* #ifndef APP-NVUE */
13
13
  vertical-align: middle;
14
14
  /* #endif */
15
15
  }
16
16
 
17
- &__text {
17
+ @include e(text) {
18
18
  color: $hy-text-color--3;
19
19
  margin: 0 $hy-border-margin-padding-sm;
20
20
  }
21
21
 
22
- &__dot {
22
+ @include e(dot) {
23
23
  font-size: $hy-font-size-sm;
24
24
  margin: 0 $hy-border-margin-padding-sm;
25
25
  color: $hy-text-color--3;
@@ -101,7 +101,7 @@ defineOptions({});
101
101
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
102
102
  const props = defineProps({
103
103
  /** 获取值 */
104
- modelValue: String,
104
+ modelValue: [String, Number],
105
105
  /** 标题 */
106
106
  title: String,
107
107
  /** 下拉选择值 */
@@ -206,7 +206,7 @@ const onSelect = (item: DropdownMenuItem, index: number) => {
206
206
  if (index !== currentIndex.value) {
207
207
  currentIndex.value = index;
208
208
  emit("change", item, index);
209
- emit("update:modelValue", item);
209
+ emit("update:modelValue", item.value);
210
210
  }
211
211
  };
212
212
 
@@ -2,7 +2,7 @@
2
2
  @use "../../libs/css/mixin.scss" as *;
3
3
 
4
4
  @include b(dropdown-item) {
5
- &__header {
5
+ @include e(header) {
6
6
  width: 100%;
7
7
  height: 100%;
8
8
  padding: $hy-border-margin-padding-base;
@@ -26,7 +26,7 @@
26
26
  }
27
27
  }
28
28
 
29
- &__main {
29
+ @include e(main) {
30
30
  position: fixed;
31
31
  left: 0;
32
32
  right: 0;
@@ -36,7 +36,7 @@
36
36
  box-sizing: border-box;
37
37
  background-color: rgba(0, 0, 0, 0);
38
38
 
39
- &--container {
39
+ @include m(container) {
40
40
  background-color: $hy-background--container;
41
41
  min-height: 200rpx;
42
42
  position: absolute;
@@ -52,7 +52,7 @@
52
52
  &.hidden {
53
53
  animation: hiddenAnimaFrames 0.5s forwards;
54
54
  }
55
- &__list {
55
+ @include e(list) {
56
56
  width: 100%;
57
57
  padding: 0 35rpx;
58
58
  box-sizing: border-box;
@@ -74,7 +74,7 @@
74
74
  border-bottom: $hy-border-line;
75
75
  }
76
76
 
77
- &--label {
77
+ @include m(label) {
78
78
  font-size: 30rpx;
79
79
  flex: 1;
80
80
  width: 0;
@@ -8,7 +8,7 @@
8
8
  'hy-float-button__animation': float,
9
9
  'hy-float-button__shadow': shadow,
10
10
  },
11
- `hy-float-button__${shape}`,
11
+ `hy-float-button--${shape}`,
12
12
  customClass,
13
13
  ]"
14
14
  @touchmove.stop.prevent="handleTouchMove"
@@ -6,19 +6,15 @@
6
6
  position: relative;
7
7
  background-color: $hy-primary;
8
8
  color: #FFFFFF;
9
- &__circle {
10
- border-radius: $hy-border-radius-semicircle;
11
- }
12
9
 
13
- &__square {
14
- border-radius: $hy-border-radius-sm;
15
- }
10
+ @include borderRadio(circle);
11
+ @include borderRadio(square);
16
12
 
17
- &__shadow {
13
+ @include e(shadow) {
18
14
  box-shadow: $hy-box-shadow;
19
15
  }
20
16
 
21
- &__animation {
17
+ @include e(animation) {
22
18
  animation: floatAnimation 2s ease-in-out infinite;
23
19
  @keyframes floatAnimation {
24
20
  0%,
@@ -31,7 +27,7 @@
31
27
  }
32
28
  }
33
29
 
34
- &__container {
30
+ @include e(container) {
35
31
  border-radius: 50%;
36
32
  width: 100%;
37
33
  height: 100%;
@@ -45,14 +41,14 @@
45
41
  }
46
42
  }
47
43
 
48
- &__menus {
44
+ @include e(menus) {
49
45
  position: absolute;
50
46
  z-index: -1;
51
47
  overflow: hidden;
52
48
  max-height: 250px;
53
49
  box-sizing: border-box;
54
50
  background-color: $hy-primary;
55
- &--item {
51
+ @include m(item) {
56
52
  font-size: 28rpx;
57
53
  box-sizing: border-box;
58
54
  white-space: nowrap;
@@ -62,12 +58,7 @@
62
58
  align-items: center;
63
59
  }
64
60
 
65
- &--circle {
66
- border-radius: $hy-border-radius-semicircle;
67
- }
68
-
69
- &--square {
70
- border-radius: $hy-border-radius-sm;
71
- }
61
+ @include borderRadio(circle);
62
+ @include borderRadio(square);
72
63
  }
73
64
  }
@@ -2,7 +2,7 @@
2
2
  @use "../../libs/css/mixin.scss" as *;
3
3
 
4
4
  @include b(folding-panel) {
5
- &__main {
5
+ @include e(main) {
6
6
  overflow: auto;
7
7
  transition: height 0.5s ease;
8
8
  }
@@ -1,20 +1,19 @@
1
1
  <template>
2
- <view
3
- class="hy-form-item"
4
- :class="[
5
- `hy-form-item--${labelPosition}`,
6
- formContext.border && 'hy-border__bottom',
7
- ]"
8
- >
2
+ <view class="hy-form-item" :class="[`hy-form-item--${labelPosition}`]">
9
3
  <view v-if="label" class="hy-form-item__label" :style="labelStyle">
10
4
  <text v-if="isRequired" class="hy-form-item__label--required">*</text>
11
5
  {{ label }}
12
6
  </view>
13
- <view class="hy-form-item__content">
7
+ <view
8
+ :class="[
9
+ 'hy-form-item__content',
10
+ formContext.border && 'hy-border__bottom',
11
+ ]"
12
+ >
14
13
  <slot></slot>
15
- <view v-if="errorMessage" class="hy-form-item__error">
16
- {{ errorMessage }}
17
- </view>
14
+ </view>
15
+ <view v-if="errorMessage" class="hy-form-item__error">
16
+ {{ errorMessage }}
18
17
  </view>
19
18
  </view>
20
19
  </template>
@@ -2,33 +2,33 @@
2
2
  <view class="hy-grid" ref="hy-grid" :style="gridStyle">
3
3
  <template v-for="(item, i) in list" :key="i">
4
4
  <view
5
- class="hy-grid-item"
6
- hover-class="hy-grid-item--hover-class"
5
+ class="hy-grid__item"
6
+ hover-class="hy-grid__item--hover-class"
7
7
  :hover-stay-time="200"
8
8
  @tap="childClick(item)"
9
9
  :style="itemStyle"
10
10
  >
11
- <slot :record="item">
12
- <HyIcon
13
- :name="item[customKeys?.icon]"
14
- label-pos="bottom"
15
- :label="item[customKeys?.name]"
16
- :space="item?.iconConfig?.space || iconConfig?.space || 8"
17
- :color="item?.iconConfig?.color || iconConfig?.color"
18
- :size="item?.iconConfig?.size || iconConfig?.size || 30"
19
- :bold="item?.iconConfig?.bold || iconConfig?.bold"
20
- :customPrefix="item?.iconConfig?.customPrefix"
21
- :imgMode="item?.iconConfig?.imgMode || iconConfig?.imgMode"
22
- :width="item?.iconConfig?.width || iconConfig?.width"
23
- :height="item?.iconConfig?.height || iconConfig?.height"
24
- :top="item?.iconConfig?.top || iconConfig?.top"
25
- :stop="item?.iconConfig?.stop || iconConfig?.stop"
26
- :round="item?.iconConfig?.round || iconConfig?.round || 6"
27
- :customStyle="
28
- item?.iconConfig?.customStyle || iconConfig?.customStyle
29
- "
30
- ></HyIcon>
31
- </slot>
11
+ <slot v-if="$slots.default" :record="item"></slot>
12
+ <HyIcon
13
+ v-else
14
+ :name="item[customKeys?.icon]"
15
+ label-pos="bottom"
16
+ :label="item[customKeys?.name]"
17
+ :space="item?.iconConfig?.space || iconConfig?.space || 8"
18
+ :color="item?.iconConfig?.color || iconConfig?.color"
19
+ :size="item?.iconConfig?.size || iconConfig?.size || 30"
20
+ :bold="item?.iconConfig?.bold || iconConfig?.bold"
21
+ :customPrefix="item?.iconConfig?.customPrefix"
22
+ :imgMode="item?.iconConfig?.imgMode || iconConfig?.imgMode"
23
+ :width="item?.iconConfig?.width || iconConfig?.width"
24
+ :height="item?.iconConfig?.height || iconConfig?.height"
25
+ :top="item?.iconConfig?.top || iconConfig?.top"
26
+ :stop="item?.iconConfig?.stop || iconConfig?.stop"
27
+ :round="item?.iconConfig?.round || iconConfig?.round || 6"
28
+ :customStyle="
29
+ item?.iconConfig?.customStyle || iconConfig?.customStyle
30
+ "
31
+ ></HyIcon>
32
32
  </view>
33
33
  </template>
34
34
  </view>
@@ -11,7 +11,7 @@
11
11
  /* #ifndef APP-NVUE */
12
12
  display: grid;
13
13
  /* #endif */
14
- &-item {
14
+ @include e(item) {
15
15
  align-items: center;
16
16
  justify-content: center;
17
17
  position: relative;
@@ -27,14 +27,8 @@
27
27
  float: left;
28
28
  /* #endif */
29
29
 
30
- &--hover-class {
30
+ @include m(hover-class) {
31
31
  opacity: 0.7;
32
32
  }
33
-
34
- &__title {
35
- color: $hy-text-color;
36
- line-height: 60rpx;
37
- font-size: $hy-font-size-sm;
38
- }
39
33
  }
40
34
  }
@@ -30,41 +30,41 @@
30
30
  justify-content: center;
31
31
  }
32
32
 
33
- &__icon {
33
+ @include e(icon) {
34
34
  position: relative;
35
35
  @include flex;
36
36
  align-items: center;
37
37
  vertical-align: -100%;
38
38
 
39
- &--primary {
39
+ @include m(primary) {
40
40
  color: $hy-primary;
41
41
  }
42
42
 
43
- &--success {
43
+ @include m(success) {
44
44
  color: $hy-success;
45
45
  }
46
46
 
47
- &--error {
47
+ @include m(error) {
48
48
  color: $hy-error;
49
49
  }
50
50
 
51
- &--warning {
51
+ @include m(warning) {
52
52
  color: $hy-warning;
53
53
  }
54
54
 
55
- &--info {
55
+ @include m(info) {
56
56
  color: $hy-info;
57
57
  }
58
58
  }
59
59
 
60
- &__img {
60
+ @include e(mg) {
61
61
  /* #ifndef APP-NVUE */
62
62
  height: auto;
63
63
  will-change: transform;
64
64
  /* #endif */
65
65
  }
66
66
 
67
- &__label {
67
+ @include e(label) {
68
68
  @include lineEllipsis;
69
69
  /* #ifndef APP-NVUE */
70
70
  line-height: 1;
@@ -5,34 +5,34 @@
5
5
  >
6
6
  <view class="hy-input__content">
7
7
  <view
8
- class="hy-input__content__prefix-icon"
8
+ class="hy-input__content--prefix-icon"
9
9
  v-if="prefixIcon?.name || $slots.prefix"
10
- @tap="onPrefix"
10
+ @tap.stop="onPrefix"
11
11
  >
12
- <slot name="prefix">
13
- <HyIcon
14
- :name="prefixIcon?.name"
15
- :size="prefixIcon?.size"
16
- :color="prefixIcon?.color"
17
- :bold="prefixIcon?.bold"
18
- :customPrefix="prefixIcon?.customPrefix"
19
- :imgMode="prefixIcon?.imgMode"
20
- :width="prefixIcon?.width"
21
- :height="prefixIcon?.height"
22
- :top="prefixIcon?.top"
23
- :stop="prefixIcon?.stop"
24
- :round="prefixIcon?.round"
25
- :customStyle="prefixIcon?.customStyle"
26
- ></HyIcon>
27
- </slot>
12
+ <slot v-if="$slots.prefix" name="prefix"></slot>
13
+ <HyIcon
14
+ v-else
15
+ :name="prefixIcon?.name"
16
+ :size="prefixIcon?.size"
17
+ :color="prefixIcon?.color"
18
+ :bold="prefixIcon?.bold"
19
+ :customPrefix="prefixIcon?.customPrefix"
20
+ :imgMode="prefixIcon?.imgMode"
21
+ :width="prefixIcon?.width"
22
+ :height="prefixIcon?.height"
23
+ :top="prefixIcon?.top"
24
+ :stop="prefixIcon?.stop"
25
+ :round="prefixIcon?.round"
26
+ :customStyle="prefixIcon?.customStyle"
27
+ ></HyIcon>
28
28
  </view>
29
- <view class="hy-input__content__field-wrapper" @tap="clickHandler">
29
+ <view class="hy-input__content--field-wrapper" @tap="clickHandler">
30
30
  <!-- 根据uni-app的input组件文档,H5和APP中只要声明了password参数(无论true还是false),type均失效,此时
31
31
  为了防止type=number时,又存在password属性,type无效,此时需要设置password为undefined
32
32
  -->
33
33
  <input
34
34
  ref="input-native"
35
- class="hy-input__content__field-wrapper__field"
35
+ class="hy-input__content--field-wrapper__field"
36
36
  :style="[inputStyle]"
37
37
  :type="type"
38
38
  :focus="focus"
@@ -61,9 +61,9 @@
61
61
  />
62
62
  </view>
63
63
  <view
64
- class="hy-input__content__clear"
64
+ class="hy-input__content--clear"
65
65
  v-if="isShowClear"
66
- @click="onClear"
66
+ @tap.stop="onClear"
67
67
  >
68
68
  <HyIcon
69
69
  :name="IconConfig.CLOSE"
@@ -73,26 +73,26 @@
73
73
  ></HyIcon>
74
74
  </view>
75
75
  <view
76
- class="hy-input__content__subfix-icon"
76
+ class="hy-input__content--subfix-icon"
77
77
  v-if="suffixIcon?.name || $slots.suffix"
78
- @tap="onSuffix"
78
+ @tap.stop="onSuffix"
79
79
  >
80
- <slot name="suffix">
81
- <HyIcon
82
- :name="suffixIcon?.name"
83
- :size="suffixIcon?.size"
84
- :color="suffixIcon?.color"
85
- :bold="suffixIcon?.bold"
86
- :customPrefix="suffixIcon?.customPrefix"
87
- :imgMode="suffixIcon?.imgMode"
88
- :width="suffixIcon?.width"
89
- :height="suffixIcon?.height"
90
- :top="suffixIcon?.top"
91
- :stop="suffixIcon?.stop"
92
- :round="suffixIcon?.round"
93
- :customStyle="suffixIcon?.customStyle"
94
- ></HyIcon>
95
- </slot>
80
+ <slot v-if="$slots.suffix" name="suffix"></slot>
81
+ <HyIcon
82
+ v-else
83
+ :name="suffixIcon?.name"
84
+ :size="suffixIcon?.size"
85
+ :color="suffixIcon?.color"
86
+ :bold="suffixIcon?.bold"
87
+ :customPrefix="suffixIcon?.customPrefix"
88
+ :imgMode="suffixIcon?.imgMode"
89
+ :width="suffixIcon?.width"
90
+ :height="suffixIcon?.height"
91
+ :top="suffixIcon?.top"
92
+ :stop="suffixIcon?.stop"
93
+ :round="suffixIcon?.round"
94
+ :customStyle="suffixIcon?.customStyle"
95
+ ></HyIcon>
96
96
  </view>
97
97
  </view>
98
98
  </view>
@@ -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 组件的类名
@@ -362,11 +362,11 @@ const inputClass = computed((): string => {
362
362
  let classes: string[] = [],
363
363
  { border, shape } = props;
364
364
  border === "surround" &&
365
- (classes = classes.concat(["hy-border", "hy-input--radius"]));
366
- classes.push(`hy-input--${shape}`);
365
+ (classes = classes.concat(["hy-border", "hy-input__radius"]));
366
+ classes.push(`hy-input__${shape}`);
367
367
  border === "bottom" &&
368
- (classes = classes.concat(["hy-border__bottom", "hy-input--no-radius"]));
369
- props.disabled && classes.push("hy-input--disabled");
368
+ (classes = classes.concat(["hy-border__bottom", "hy-input__no-radius"]));
369
+ props.disabled && classes.push("hy-input__disabled");
370
370
  return classes.join(" ");
371
371
  });
372
372
 
@@ -8,12 +8,11 @@
8
8
  flex: 1;
9
9
  color: $hy-text-color;
10
10
 
11
- &--radius,
12
- &--square {
11
+ @include e(radius, square) {
13
12
  border-radius: 4px;
14
13
  }
15
14
 
16
- @include m(disabled) {
15
+ @include e(disabled) {
17
16
  background-color: $hy-background--disabled;
18
17
  color: $hy-text-color--disabled;
19
18
  :deep(.hy-icon) {
@@ -21,36 +20,43 @@
21
20
  }
22
21
  }
23
22
 
24
- &--no-radius {
23
+ @include e(no-radius){
25
24
  border-radius: 0;
26
25
  }
27
26
 
28
- &--circle {
27
+ @include e(circle) {
29
28
  border-radius: 100px;
30
29
  }
31
30
 
32
- &__content {
31
+ @include e(content) {
33
32
  flex: 1;
34
33
  @include flex(row);
35
34
  align-items: center;
36
35
  justify-content: space-between;
37
36
 
38
- &__field-wrapper {
37
+ @include m(field-wrapper) {
39
38
  position: relative;
40
39
  @include flex(row);
41
- margin: 0;
42
40
  flex: 1;
41
+ margin-right: $hy-border-margin-padding-base;
43
42
 
44
- &__field {
43
+ @include e(field) {
44
+ background: transparent;
45
45
  line-height: 26px;
46
46
  text-align: left;
47
47
  height: 24px;
48
48
  font-size: 15px;
49
49
  flex: 1;
50
+ color: $hy-text-color;
51
+ caret-color: $hy-text-color;
52
+ }
53
+
54
+ :deep(.input-placeholder) {
55
+ color: $hy-text-color--placeholder;
50
56
  }
51
57
  }
52
58
 
53
- &__clear {
59
+ @include m(clear) {
54
60
  width: 20px;
55
61
  height: 20px;
56
62
  border-radius: 100px;
@@ -59,15 +65,14 @@
59
65
  align-items: center;
60
66
  justify-content: center;
61
67
  transform: scale(0.82);
62
- margin-left: 4px;
63
68
  }
64
69
 
65
- &__subfix-icon {
66
- margin-left: 4px;
70
+ @include m(subfix-icon) {
71
+ margin-left: $hy-border-margin-padding-sm;
67
72
  }
68
73
 
69
- &__prefix-icon {
70
- margin-right: 4px;
74
+ @include m(prefix-icon) {
75
+ margin-right: $hy-border-margin-padding-sm;
71
76
  }
72
77
  }
73
78
  }