hy-app 0.3.2 → 0.3.3

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 (33) hide show
  1. package/components/hy-address-picker/index.scss +1 -1
  2. package/components/hy-avatar/hy-avatar.vue +10 -13
  3. package/components/hy-avatar/index.scss +1 -1
  4. package/components/hy-back-top/index.scss +1 -1
  5. package/components/hy-button/index.scss +2 -2
  6. package/components/hy-calendar/header.vue +11 -11
  7. package/components/hy-calendar/index.scss +25 -25
  8. package/components/hy-calendar/month.vue +18 -19
  9. package/components/hy-card/hy-card.vue +10 -12
  10. package/components/hy-card/index.scss +11 -9
  11. package/components/hy-cell/hy-cell.vue +13 -13
  12. package/components/hy-cell/index.scss +15 -15
  13. package/components/hy-checkbox/hy-checkbox.vue +10 -10
  14. package/components/hy-checkbox/index.scss +24 -23
  15. package/components/hy-empty/hy-empty.vue +15 -12
  16. package/components/hy-empty/icon.ts +32 -58
  17. package/components/hy-empty/index.scss +2 -2
  18. package/components/hy-empty/typing.d.ts +48 -35
  19. package/components/hy-notice-bar/hy-column-notice.vue +2 -2
  20. package/components/hy-notice-bar/hy-row-notice.vue +1 -1
  21. package/components/hy-notice-bar/index.scss +6 -0
  22. package/components/hy-popover/index.scss +3 -3
  23. package/components/hy-search/hy-search.vue +2 -9
  24. package/components/hy-slider/hy-slider.vue +1 -1
  25. package/components/hy-tag/hy-tag.vue +2 -2
  26. package/components/hy-tag/index.scss +13 -12
  27. package/components/hy-upload/hy-upload.vue +5 -12
  28. package/components/hy-upload/typing.d.ts +21 -0
  29. package/libs/css/mixin.scss +4 -1
  30. package/libs/css/vars.css +2 -0
  31. package/package.json +2 -2
  32. package/theme.scss +1 -0
  33. package/components/avatar.zip +0 -0
@@ -101,7 +101,7 @@ const props = defineProps({
101
101
  },
102
102
  /**
103
103
  * tag的形状
104
- * @values circle,square
104
+ * @values circle,square,opposite
105
105
  * */
106
106
  shape: {
107
107
  type: String,
@@ -143,7 +143,7 @@ const props = defineProps({
143
143
  /** 定义需要用到的外部样式 */
144
144
  customStyle: {
145
145
  type: Object as PropType<CSSProperties>,
146
- default: "",
146
+ default: () => {},
147
147
  },
148
148
  /** 自定义外部类名 */
149
149
  customClass: {
@@ -19,41 +19,42 @@ $hy-background--disabled);
19
19
  /*圆角*/
20
20
  @include borderRadio(circle);
21
21
  @include borderRadio(square);
22
+ @include borderRadio(opposite);
22
23
 
23
- &__icon {
24
+ @include e(icon) {
24
25
  margin-right: $hy-border-margin-padding-sm;
25
26
  }
26
27
 
27
- &__text {
28
- &--small {
28
+ @include e(text) {
29
+ @include m(small) {
29
30
  font-size: $hy-font-size-sm;
30
31
  line-height: $hy-font-size-sm;
31
32
  }
32
33
 
33
- &--medium {
34
+ @include m(medium) {
34
35
  font-size: $hy-font-size-base;
35
36
  line-height: $hy-font-size-base;
36
37
  }
37
38
 
38
- &--large {
39
+ @include m(large) {
39
40
  font-size: $hy-font-size-lg;
40
41
  line-height: $hy-font-size-lg;
41
42
  }
42
43
  }
43
44
 
44
- &--small {
45
+ @include m(small) {
45
46
  height: 22px;
46
47
  line-height: 22px;
47
48
  padding: 0 $hy-border-margin-padding-sm;
48
49
  }
49
50
 
50
- &--medium {
51
+ @include m(medium) {
51
52
  height: 26px;
52
53
  line-height: 26px;
53
54
  padding: 0 $hy-border-margin-padding-base;
54
55
  }
55
56
 
56
- &--large {
57
+ @include m(large) {
57
58
  height: 32px;
58
59
  line-height: 32px;
59
60
  padding: 0 15px;
@@ -82,7 +83,7 @@ $hy-background--disabled);
82
83
  @include themeColor(info--plain__fill, $hy-info-light, $hy-info, $hy-info);
83
84
 
84
85
  /* 关闭按钮 */
85
- &__close {
86
+ @include e(close) {
86
87
  position: absolute;
87
88
  z-index: 999;
88
89
  top: 10px;
@@ -99,17 +100,17 @@ $hy-background--disabled);
99
100
  transform: scale(0.6) translate(50%, -50%);
100
101
  /* #endif */
101
102
 
102
- &--small {
103
+ @include m(small) {
103
104
  width: 18px;
104
105
  height: 18px;
105
106
  }
106
107
 
107
- &--medium {
108
+ @include m(medium) {
108
109
  width: 22px;
109
110
  height: 22px;
110
111
  }
111
112
 
112
- &--large {
113
+ @include m(large) {
113
114
  width: 25px;
114
115
  height: 25px;
115
116
  }
@@ -25,7 +25,7 @@
25
25
  class="hy-upload__wrap__preview__other"
26
26
  @tap="onClickPreview(item, index)"
27
27
  >
28
- <u-icon
28
+ <HyIcon
29
29
  color="#80CBF9"
30
30
  size="26"
31
31
  :name="
@@ -33,7 +33,7 @@
33
33
  ? 'movie'
34
34
  : 'folder'
35
35
  "
36
- ></u-icon>
36
+ ></HyIcon>
37
37
  <text class="hy-upload__wrap__preview__other__text">
38
38
  {{
39
39
  item.isVideo || (item.type && item.type === "video")
@@ -139,8 +139,8 @@ export default {
139
139
  <script setup lang="ts">
140
140
  import { ref, watch } from "vue";
141
141
  import type { PropType, CSSProperties } from "vue";
142
- import type { FileVo, ReadFunctionVo } from "./typing";
143
- import { addUnit, chooseFile, isArray } from "../../utils";
142
+ import type { FileVo, IUploadEmits, ReadFunctionVo } from "./typing";
143
+ import { addUnit, bytesToSize, chooseFile, isArray } from "../../utils";
144
144
  import { IconConfig } from "../../config";
145
145
  // 组件
146
146
  import HyIcon from "../hy-icon/hy-icon.vue";
@@ -278,14 +278,7 @@ const props = defineProps({
278
278
  type: Object as PropType<CSSProperties>,
279
279
  },
280
280
  });
281
- const emit = defineEmits([
282
- "clickPreview",
283
- "beforeRead",
284
- "error",
285
- "delete",
286
- "afterRead",
287
- "oversize",
288
- ]);
281
+ const emit = defineEmits<IUploadEmits>();
289
282
 
290
283
  const lists = ref<FileVo[]>([]);
291
284
  // 上传按钮
@@ -150,3 +150,24 @@ export default interface HyUploadProps {
150
150
  * */
151
151
  customStyle?: CSSProperties;
152
152
  }
153
+
154
+ export interface UploadFileParams {
155
+ file: FileVo | FileVo[];
156
+ name: string;
157
+ index: number;
158
+ }
159
+
160
+ export interface IUploadEmits {
161
+ /** 点击预览大图触发 */
162
+ (e: "clickPreview", params: UploadFileParams): void;
163
+ /** 上传前触发 */
164
+ (e: "beforeRead", params: UploadFileParams): void;
165
+ /** 上传错误触发 */
166
+ (e: "error", error: any): void;
167
+ /** 删除触发 */
168
+ (e: "delete", params: UploadFileParams): void;
169
+ /** 上传完成触发 */
170
+ (e: "afterRead", params: UploadFileParams): void;
171
+ /** 超出最大值 */
172
+ (e: "oversize", params: UploadFileParams): void;
173
+ }
@@ -139,9 +139,12 @@
139
139
  @if $shape == circle {
140
140
  border-radius: theme.$hy-border-radius-semicircle;
141
141
  }
142
- @else {
142
+ @else if($shape == square) {
143
143
  border-radius: theme.$hy-border-radius-sm;
144
144
  }
145
+ @else {
146
+ border-radius: 28rpx theme.$hy-border-radius-sm;
147
+ }
145
148
  }
146
149
  }
147
150
 
package/libs/css/vars.css CHANGED
@@ -20,6 +20,7 @@
20
20
  --hy-background--hover: rgba(0,0,0,0.05);
21
21
  --hy-background--active: #FFFFFF;
22
22
  --hy-background--close: #f0f0f0;
23
+ --hy-background--box: #FFFFFF;
23
24
 
24
25
  --hy-border-line: 1rpx solid #e8e8e8;
25
26
  --hy-border-color: #c2c2c4;
@@ -52,6 +53,7 @@
52
53
  --hy-background--hover: rgba(255,255,255,0.2);
53
54
  --hy-background--active: #000000;
54
55
  --hy-background--close: #323233;
56
+ --hy-background--box: #4b4c4d;
55
57
 
56
58
  --hy-border-line: 1rpx solid #3c3f44;
57
59
  --hy-border-color: #3c3f44;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hy-app",
3
- "version": "0.3.2",
4
- "description": "修复上传提示功能",
3
+ "version": "0.3.3",
4
+ "description": "scss添加颜色变量",
5
5
  "main": "./index.ts",
6
6
  "private": false,
7
7
  "scripts": {},
package/theme.scss CHANGED
@@ -49,6 +49,7 @@ $hy-background--hover: var(--hy-background--hover, rgba(0,0,0,0.05)) !default; /
49
49
  $hy-light-background-mask: var(--hy-light-background-mask, rgba(0, 0, 0, 0.5)); //遮罩颜色
50
50
  $hy-background--active: var(--hy-background--active, #FFFFFF); // 选中背景色
51
51
  $hy-background--close: var(--hy-background--close, #f0f0f0); // 选中背景色
52
+ $hy-background--box: var(--hy-background--box, #FFFFFF); // 选中背景色
52
53
 
53
54
  /* 文字尺寸 */
54
55
  $hy-font-size-sm: 24rpx; // 提示文字大小
Binary file