hy-app 0.2.2 → 0.2.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.
Files changed (62) hide show
  1. package/components/hy-button/hy-button.vue +88 -120
  2. package/components/hy-button/index.scss +1 -3
  3. package/components/hy-calendar/index.scss +1 -1
  4. package/components/hy-cell/index.scss +2 -17
  5. package/components/hy-checkbox/index.scss +10 -10
  6. package/components/hy-code-input/hy-code-input.vue +85 -74
  7. package/components/hy-code-input/index.scss +31 -1
  8. package/components/hy-code-input/props.ts +8 -7
  9. package/components/hy-code-input/typing.d.ts +22 -18
  10. package/components/hy-config-provider/props.ts +1 -1
  11. package/components/hy-config-provider/typing.d.ts +7 -7
  12. package/components/hy-dropdown-item/hy-dropdown-item.vue +69 -75
  13. package/components/hy-dropdown-item/index.scss +1 -1
  14. package/components/hy-float-button/hy-float-button.vue +69 -86
  15. package/components/hy-form/index.scss +1 -1
  16. package/components/hy-grid/hy-grid.vue +2 -3
  17. package/components/hy-grid/props.ts +4 -0
  18. package/components/hy-grid/typing.d.ts +15 -0
  19. package/components/hy-icon/index.scss +2 -2
  20. package/components/hy-login/TheUserLogin.vue +0 -1
  21. package/components/hy-menu/hy-menu.vue +159 -0
  22. package/components/hy-menu/index.scss +58 -0
  23. package/components/hy-menu/props.ts +12 -0
  24. package/components/hy-menu/typing.d.ts +57 -0
  25. package/components/hy-navbar/index.scss +2 -2
  26. package/components/hy-notice-bar/index.scss +3 -3
  27. package/components/hy-notify/typing.d.ts +1 -1
  28. package/components/hy-pagination/typing.d.ts +1 -1
  29. package/components/hy-picker/hy-picker.vue +9 -8
  30. package/components/hy-picker/index.scss +6 -2
  31. package/components/hy-radio/index.scss +2 -2
  32. package/components/hy-scroll-list/index.scss +1 -1
  33. package/components/hy-signature/hy-signature.vue +50 -50
  34. package/components/hy-signature/index.scss +2 -4
  35. package/components/hy-signature/props.ts +2 -1
  36. package/components/hy-signature/typing.d.ts +5 -1
  37. package/components/hy-subsection/hy-subsection.vue +15 -13
  38. package/components/hy-subsection/props.ts +2 -2
  39. package/components/hy-subsection/typing.d.ts +1 -1
  40. package/components/hy-tabBar/hy-tabBar.vue +96 -0
  41. package/components/hy-tabBar/index.scss +169 -0
  42. package/components/hy-tabBar/props.ts +13 -0
  43. package/components/hy-tabBar/typing.d.ts +54 -0
  44. package/components/hy-text/hy-text.vue +76 -87
  45. package/components/hy-text/index.scss +8 -8
  46. package/components/hy-upload/index.scss +0 -1
  47. package/components/hy-watermark/hy-watermark.vue +583 -0
  48. package/components/hy-watermark/index.scss +17 -0
  49. package/components/hy-watermark/props.ts +23 -0
  50. package/components/hy-watermark/typing.d.ts +76 -0
  51. package/components/index.ts +2 -2
  52. package/index.scss +1 -1
  53. package/index.ts +1 -1
  54. package/libs/css/common.scss +9 -1
  55. package/libs/css/vars.css +5 -1
  56. package/package.json +2 -2
  57. package/theme.scss +8 -18
  58. package/typing/modules/common.d.ts +1 -1
  59. package/utils/inspect.ts +20 -0
  60. package/utils/utils.ts +52 -22
  61. package/components/yk-tabbar/props.ts +0 -49
  62. package/components/yk-tabbar/yk-tabbar.vue +0 -224
@@ -26,16 +26,10 @@
26
26
  :class="['hy-button', 'hy-reset-button', bemClass]"
27
27
  >
28
28
  <template v-if="loading">
29
- <HyLoading
30
- :mode="loadingMode"
31
- :size="loadingSize"
32
- :color="loadingColor"
33
- ></HyLoading>
34
- <text
35
- class="hy-button__loading-text"
36
- :style="[{ fontSize: textSize + 'px' }]"
37
- >{{ loadingText || text }}</text
38
- >
29
+ <HyLoading :mode="loadingMode" :size="loadingSize" :color="loadingColor"></HyLoading>
30
+ <text class="hy-button__loading-text" :style="[{ fontSize: textSize + 'px' }]">
31
+ {{ loadingText || text }}
32
+ </text>
39
33
  </template>
40
34
  <template v-else>
41
35
  <HyIcon
@@ -54,11 +48,7 @@
54
48
  :customStyle="icon?.customStyle || { marginRight: '2px' }"
55
49
  ></HyIcon>
56
50
  <slot>
57
- <text
58
- class="hy-button__text"
59
- :style="[{ fontSize: textSize + 'px' }]"
60
- >{{ text }}</text
61
- >
51
+ <text class="hy-button__text" :style="[{ fontSize: textSize + 'px' }]">{{ text }}</text>
62
52
  </slot>
63
53
  </template>
64
54
  </button>
@@ -81,17 +71,14 @@
81
71
  :style="[baseColor, customStyle]"
82
72
  >
83
73
  <template v-if="loading">
84
- <HyLoading
85
- :mode="loadingMode"
86
- :size="loadingSize"
87
- :color="loadingColor"
88
- ></HyLoading>
74
+ <HyLoading :mode="loadingMode" :size="loadingSize" :color="loadingColor"></HyLoading>
89
75
  <text
90
76
  class="hy-button__loading-text"
91
77
  :style="[nvueTextStyle]"
92
78
  :class="[plain && `hy-button__text--plain--${type}`]"
93
- >{{ loadingText || text }}</text
94
79
  >
80
+ {{ loadingText || text }}
81
+ </text>
95
82
  </template>
96
83
  <template v-else>
97
84
  <HyIcon
@@ -118,8 +105,9 @@
118
105
  nvueTextStyle,
119
106
  ]"
120
107
  :class="[plain && `hy-button__text--plain--${type}`]"
121
- >{{ text }}</text
122
108
  >
109
+ {{ text }}
110
+ </text>
123
111
  </template>
124
112
  </view>
125
113
  <!-- #endif -->
@@ -127,49 +115,39 @@
127
115
 
128
116
  <script lang="ts">
129
117
  export default {
130
- name: "hy-button",
118
+ name: 'hy-button',
131
119
  options: {
132
120
  addGlobalClass: true,
133
121
  virtualHost: true,
134
- styleIsolation: "shared",
122
+ styleIsolation: 'shared',
135
123
  },
136
- };
124
+ }
137
125
  </script>
138
126
 
139
127
  <script setup lang="ts">
140
- import { computed, type CSSProperties, toRefs } from "vue";
141
- import { bem, throttle } from "../../utils";
142
- import defaultProps from "./props";
143
- import { ColorConfig } from "../../config";
144
- import type IProps from "./typing";
128
+ import { computed, type CSSProperties, toRefs } from 'vue'
129
+ import { bem, throttle } from '../../utils'
130
+ import defaultProps from './props'
131
+ import { ColorConfig } from '../../config'
132
+ import type IProps from './typing'
145
133
 
146
134
  // 组件
147
- import HyIcon from "../hy-icon/hy-icon.vue";
148
- import HyLoading from "../hy-loading/hy-loading.vue";
135
+ import HyIcon from '../hy-icon/hy-icon.vue'
136
+ import HyLoading from '../hy-loading/hy-loading.vue'
149
137
 
150
- const props = withDefaults(defineProps<IProps>(), defaultProps);
151
- const {
152
- disabled,
153
- loading,
154
- throttleTime,
155
- stop,
156
- size,
157
- type,
158
- plain,
159
- color,
160
- icon,
161
- } = toRefs(props);
138
+ const props = withDefaults(defineProps<IProps>(), defaultProps)
139
+ const { disabled, loading, throttleTime, stop, size, type, plain, color, icon } = toRefs(props)
162
140
  const emit = defineEmits([
163
- "click",
164
- "getphonenumber",
165
- "getuserinfo",
166
- "error",
167
- "opensetting",
168
- "launchapp",
169
- "agreeprivacyauthorization",
170
- ]);
141
+ 'click',
142
+ 'getphonenumber',
143
+ 'getuserinfo',
144
+ 'error',
145
+ 'opensetting',
146
+ 'launchapp',
147
+ 'agreeprivacyauthorization',
148
+ ])
171
149
 
172
- const textColor = (ColorConfig as any)[type.value];
150
+ const textColor = (ColorConfig as any)[type.value]
173
151
 
174
152
  /**
175
153
  * @description 生成bem风格的类名
@@ -177,133 +155,123 @@ const textColor = (ColorConfig as any)[type.value];
177
155
  const bemClass = computed(() => {
178
156
  // this.bem为一个computed变量,在mixin中
179
157
  if (!color.value) {
180
- return bem(
181
- "button",
182
- props,
183
- ["type", "shape", "size"],
184
- ["disabled", "plain", "hairline"],
185
- );
158
+ return bem('button', props, ['type', 'shape', 'size'], ['disabled', 'plain', 'hairline'])
186
159
  } else {
187
160
  // 由于nvue的原因,在有color参数时,不需要传入type,否则会生成type相关的类型,影响最终的样式
188
- return bem(
189
- "button",
190
- props,
191
- ["shape", "size"],
192
- ["disabled", "plain", "hairline"],
193
- );
161
+ return bem('button', props, ['shape', 'size'], ['disabled', 'plain', 'hairline'])
194
162
  }
195
- });
163
+ })
196
164
 
197
165
  const loadingColor = computed(() => {
198
166
  if (plain.value) {
199
167
  // 如果有设置color值,则用color值,否则使用type主题颜色
200
- return color.value ? color.value : "";
168
+ return color.value ? color.value : ''
201
169
  }
202
- if (type.value === "info") {
203
- return "#c9c9c9";
170
+ if (type.value === 'info') {
171
+ return '#c9c9c9'
204
172
  }
205
- return "#fff";
206
- });
173
+ return '#fff'
174
+ })
207
175
 
208
176
  const iconColorCom = computed((): string => {
209
177
  // 如果是镂空状态,设置了color就用color值,否则使用主题颜色,
210
- if (icon.value?.color) return icon.value?.color;
178
+ if (icon.value?.color) return icon.value?.color
211
179
  if (plain.value) {
212
- return color.value ? color.value : "";
180
+ return color.value ? color.value : ''
213
181
  } else {
214
- return (type.value = "#ffffff");
182
+ return '#ffffff'
215
183
  }
216
- });
184
+ })
217
185
  const baseColor = computed((): CSSProperties => {
218
- let style: CSSProperties = {};
186
+ let style: CSSProperties = {}
219
187
  if (color.value) {
220
188
  // 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
221
- style.color = plain.value ? color.value : "white";
189
+ style.color = plain.value ? color.value : 'white'
222
190
  if (!plain.value) {
223
191
  // 非镂空,背景色使用自定义的颜色
224
- style["background"] = color.value;
192
+ style['background'] = color.value
225
193
  }
226
- if (color.value.indexOf("gradient") !== -1) {
194
+ if (color.value.indexOf('gradient') !== -1) {
227
195
  // 如果自定义的颜色为渐变色,不显示边框,以及通过backgroundImage设置渐变色
228
196
  // weex文档说明可以写borderWidth的形式,为什么这里需要分开写?
229
197
  // 因为weex是阿里巴巴为了部门业绩考核而做的你懂的东西,所以需要这么写才有效
230
- style.borderTopWidth = 0;
231
- style.borderRightWidth = 0;
232
- style.borderBottomWidth = 0;
233
- style.borderLeftWidth = 0;
198
+ style.borderTopWidth = 0
199
+ style.borderRightWidth = 0
200
+ style.borderBottomWidth = 0
201
+ style.borderLeftWidth = 0
234
202
  if (!plain.value) {
235
- style.backgroundImage = color.value;
203
+ style.backgroundImage = color.value
236
204
  }
237
205
  } else {
238
206
  // 非渐变色,则设置边框相关的属性
239
- style.borderColor = color.value;
240
- style.borderWidth = "1px";
241
- style.borderStyle = "solid";
207
+ style.borderColor = color.value
208
+ style.borderWidth = '1px'
209
+ style.borderStyle = 'solid'
242
210
  }
243
211
  } else {
244
212
  // 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
245
213
  // style.color = plain.value ? textColor : "";
246
214
  }
247
- return style;
248
- });
215
+ return style
216
+ })
249
217
 
250
218
  // nvue版本按钮的字体不会继承父组件的颜色,需要对每一个text组件进行单独的设置
251
219
  const nvueTextStyle = computed((): CSSProperties => {
252
- let style: CSSProperties = {};
220
+ let style: CSSProperties = {}
253
221
  // 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
254
- if (type.value === "info") {
255
- style.color = "#323233";
222
+ if (type.value === 'info') {
223
+ style.color = '#323233'
256
224
  }
257
225
  if (color.value) {
258
- style.color = plain.value ? color.value : "white";
226
+ style.color = plain.value ? color.value : 'white'
259
227
  }
260
- style.fontSize = textSize.value + "px";
261
- return style;
262
- });
228
+ style.fontSize = textSize.value + 'px'
229
+ return style
230
+ })
263
231
  /**
264
232
  * @description 字体大小
265
233
  * */
266
234
  const textSize = computed((): number => {
267
- let fontSize = 14;
268
- if (size.value === "large") fontSize = 16;
269
- if (size.value === "medium") fontSize = 14;
270
- if (size.value === "small") fontSize = 12;
271
- if (size.value === "mini") fontSize = 10;
272
- return fontSize;
273
- });
235
+ let fontSize = 14
236
+ if (size.value === 'large') fontSize = 16
237
+ if (size.value === 'medium') fontSize = 14
238
+ if (size.value === 'small') fontSize = 12
239
+ if (size.value === 'mini') fontSize = 10
240
+ return fontSize
241
+ })
274
242
 
275
243
  const clickHandler = (e: any) => {
276
244
  // 非禁止并且非加载中,才能点击
277
245
  if (!disabled.value && !loading.value) {
278
246
  // 进行节流控制,每this.throttle毫秒内,只在开始处执行
279
247
  throttle(() => {
280
- emit("click", e);
281
- }, throttleTime.value);
248
+ emit('click', e)
249
+ }, throttleTime.value)
282
250
  }
283
251
  // 是否阻止事件传播
284
- stop.value && e.stopPropagation();
285
- };
252
+ stop.value && e.stopPropagation()
253
+ }
286
254
 
287
255
  const getphonenumber = (e: any) => {
288
- emit("getphonenumber", e);
289
- };
256
+ emit('getphonenumber', e)
257
+ }
290
258
  const getuserinfo = (e: any) => {
291
- emit("getuserinfo", e);
292
- };
259
+ emit('getuserinfo', e)
260
+ }
293
261
  const error = (e: any) => {
294
- emit("error", e);
295
- };
262
+ emit('error', e)
263
+ }
296
264
  const opensetting = (e: any) => {
297
- emit("opensetting", e);
298
- };
265
+ emit('opensetting', e)
266
+ }
299
267
  const launchapp = (e: any) => {
300
- emit("launchapp", e);
301
- };
268
+ emit('launchapp', e)
269
+ }
302
270
  const agreeprivacyauthorization = (e: any) => {
303
- emit("agreeprivacyauthorization", e);
304
- };
271
+ emit('agreeprivacyauthorization', e)
272
+ }
305
273
  </script>
306
274
 
307
275
  <style lang="scss" scoped>
308
- @import "./index.scss";
276
+ @import './index.scss';
309
277
  </style>
@@ -1,15 +1,13 @@
1
1
  @use "../../libs/css/mixin.scss" as *;
2
2
  @use "../../theme.scss" as *;
3
3
 
4
- uni-button {
5
- margin: 0;
6
- }
7
4
 
8
5
  @include b(button){
9
6
  height: 40px;
10
7
  position: relative;
11
8
  align-items: center;
12
9
  justify-content: center;
10
+ margin: 0;
13
11
  @include flex;
14
12
  /* #ifndef APP-NVUE */
15
13
  box-sizing: border-box;
@@ -109,8 +109,8 @@
109
109
  border-radius: 3px;
110
110
  @include m(center) {
111
111
  border-radius: 0;
112
- //color: #000000;
113
112
  background-color: $hy-primary-light;
113
+ color: $hy-primary;
114
114
  }
115
115
  }
116
116
 
@@ -25,21 +25,6 @@
25
25
  &__text {
26
26
  font-size: $hy-font-size-lg;
27
27
  }
28
- //&-nav {
29
- // display: flex;
30
- // align-items: center;
31
- //
32
- // &--ver {
33
- // border-radius: 4rpx;
34
- // width: 4px;
35
- // height: 20px;
36
- // margin-right: 16rpx;
37
- // }
38
- // &--text {
39
- // font-size: $hy-font-size-subtitle;
40
- // line-height: 16px;
41
- // }
42
- //}
43
28
  }
44
29
 
45
30
  /*row内容*/
@@ -47,7 +32,7 @@
47
32
  /* #ifndef APP-NVUE */
48
33
  box-sizing: border-box;
49
34
  /* #endif */
50
- font-size: $hy-font-size-paragraph;
35
+ font-size: $hy-font-size-base;
51
36
  align-items: center;
52
37
  border-radius: $hy-border-margin-padding-sm;
53
38
  overflow: hidden;
@@ -96,7 +81,7 @@
96
81
  /*行头部*/
97
82
  &-title {
98
83
  margin-right: $hy-border-margin-padding-sm;
99
- flex: $hy-font-size-subtitle;
84
+ flex: 33rpx;
100
85
  display: flex;
101
86
  flex-direction: column;
102
87
 
@@ -2,6 +2,15 @@
2
2
  @use "../../theme.scss" as *;
3
3
 
4
4
  @include b(checkbox) {
5
+ /* #ifndef APP-NVUE */
6
+ @include flex(row);
7
+ /* #endif */
8
+ overflow: hidden;
9
+ flex-direction: row;
10
+ align-items: center;
11
+ margin-bottom: 5px;
12
+ margin-top: 5px;
13
+
5
14
  &-group {
6
15
  &--row {
7
16
  /* #ifndef APP-NVUE */
@@ -15,15 +24,6 @@
15
24
  }
16
25
  }
17
26
 
18
- /* #ifndef APP-NVUE */
19
- @include flex(row);
20
- /* #endif */
21
- overflow: hidden;
22
- flex-direction: row;
23
- align-items: center;
24
- margin-bottom: 5px;
25
- margin-top: 5px;
26
-
27
27
  &-label--left {
28
28
  flex-direction: row;
29
29
  }
@@ -98,4 +98,4 @@
98
98
  color: $hy-text-color--disabled;
99
99
  }
100
100
  }
101
- }
101
+ }