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
@@ -22,10 +22,8 @@
22
22
  justify-content: flex-end;
23
23
  display: flex;
24
24
 
25
- :deep(){
26
- @include b(button) {
27
- margin-left: $hy-border-margin-padding-base;
28
- }
25
+ :deep(.hy-button) {
26
+ margin-left: $hy-border-margin-padding-base;
29
27
  }
30
28
  }
31
29
  }
@@ -2,7 +2,7 @@ import type IProps from "./typing";
2
2
 
3
3
  const defaultProps: IProps = {
4
4
  penColor: "#000",
5
- lineWidth: 1,
5
+ lineWidth: 2,
6
6
  clearText: "清空",
7
7
  revokeText: "撤销",
8
8
  restoreText: "恢复",
@@ -13,6 +13,7 @@ const defaultProps: IProps = {
13
13
  disabled: false,
14
14
  height: 1,
15
15
  width: 1,
16
+ round: "10rpx",
16
17
  backgroundColor: "",
17
18
  disableScroll: true,
18
19
  enableHistory: false,
@@ -6,7 +6,7 @@ export default interface HySignatureProps {
6
6
  * */
7
7
  penColor?: string;
8
8
  /**
9
- * @description 签名笔宽度(默认 1
9
+ * @description 签名笔宽度(默认 2
10
10
  * */
11
11
  lineWidth?: number;
12
12
  /**
@@ -49,6 +49,10 @@ export default interface HySignatureProps {
49
49
  * @description 画布的宽度
50
50
  * */
51
51
  width?: number;
52
+ /**
53
+ * @description 边框圆角
54
+ * */
55
+ round?: string | number;
52
56
  /**
53
57
  * @description 画板的背景色
54
58
  * */
@@ -22,17 +22,17 @@
22
22
 
23
23
  <script lang="ts">
24
24
  export default {
25
- name: 'hy-subsection',
25
+ name: "hy-subsection",
26
26
  options: {
27
27
  addGlobalClass: true,
28
28
  virtualHost: true,
29
- styleIsolation: 'shared'
30
- }
31
- }
29
+ styleIsolation: "shared",
30
+ },
31
+ };
32
32
  </script>
33
33
 
34
34
  <script setup lang="ts">
35
- import {computed, toRefs, ref, onMounted, watch, getCurrentInstance} from "vue";
35
+ import { computed, toRefs, ref, onMounted, getCurrentInstance } from "vue";
36
36
  import type { CSSProperties } from "vue";
37
37
  import defaultProps from "./props";
38
38
  import type IProps from "./typing";
@@ -50,7 +50,7 @@ const {
50
50
  bold,
51
51
  bgColor,
52
52
  inactiveColor,
53
- fieldNames,
53
+ customKeys,
54
54
  } = toRefs(props);
55
55
  const emit = defineEmits(["change", "update:modelValue"]);
56
56
 
@@ -83,7 +83,7 @@ const wrapperClass = computed(() => {
83
83
  "hy-subsection__item",
84
84
  "cursor-pointer",
85
85
  `hy-subsection__item--${innerCurrent.value}__${guidClass}`,
86
- `hy-subsection__item--${mode.value}`,
86
+ `hy-subsection__item--${mode.value}`,
87
87
  index < list.value.length - 1 && "hy-subsection__item--no-border-right",
88
88
  index === 0 && "hy-subsection__item--first",
89
89
  index === list.value.length - 1 && "hy-subsection__item--last",
@@ -175,7 +175,7 @@ const init = () => {
175
175
  if (typeof item === "string" || typeof item === "number") {
176
176
  return item === modelValue.value;
177
177
  } else {
178
- return item[fieldNames.value.value] === modelValue.value;
178
+ return item[customKeys.value.value] === modelValue.value;
179
179
  }
180
180
  });
181
181
 
@@ -184,23 +184,25 @@ const init = () => {
184
184
  innerCurrent.value === -1 ? current.value : innerCurrent.value;
185
185
 
186
186
  // TODO: 多个数组在一起计算宽度, 宽度不一样会有问题,所以必须加guidClass随机数
187
- getRect(`.hy-subsection__item--0__${guidClass}`, false, instance).then((size) => {
188
- itemRect.value = size as UniApp.NodeInfo;
189
- });
187
+ getRect(`.hy-subsection__item--0__${guidClass}`, false, instance).then(
188
+ (size) => {
189
+ itemRect.value = size as UniApp.NodeInfo;
190
+ },
191
+ );
190
192
  };
191
193
 
192
194
  /**
193
195
  * @description 判断值
194
196
  * */
195
197
  const getValue = (item: SubSectionVo) => {
196
- return typeof item === "object" ? item[fieldNames.value.value] : item;
198
+ return typeof item === "object" ? item[customKeys.value.value] : item;
197
199
  };
198
200
 
199
201
  /**
200
202
  * @description 判断展示文本
201
203
  * */
202
204
  const getName = (item: SubSectionVo) => {
203
- return typeof item === "object" ? item[fieldNames.value.label] : item;
205
+ return typeof item === "object" ? item[customKeys.value.name] : item;
204
206
  };
205
207
 
206
208
  /**
@@ -5,8 +5,8 @@ const defaultProps: IProps = {
5
5
  modelValue: "",
6
6
  current: 0,
7
7
  list: [],
8
- fieldNames: {
9
- label: "name",
8
+ customKeys: {
9
+ name: "name",
10
10
  value: "value",
11
11
  },
12
12
  activeColor: "",
@@ -24,7 +24,7 @@ export default interface HySubsectionProps {
24
24
  /**
25
25
  * @description list的键值
26
26
  * */
27
- fieldNames?: HyApp.IFieldNames;
27
+ customKeys?: HyApp.IFieldNames;
28
28
  /**
29
29
  * @description 激活时的颜色(默认 '#3c9cff' )
30
30
  * */
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <view class="hy-tabBar--placeholder"></view>
3
+ <view class="hy-tabBar">
4
+ <view class="hy-tabBar--box" :style="{ backgroundColor: barBgColor }">
5
+ <view class="hy-tabBar--container">
6
+ <view
7
+ :class="[
8
+ 'hy-tabBar--container__item',
9
+ 'list',
10
+ current === i ? 'is-active' : '',
11
+ ]"
12
+ v-for="(item, i) in list"
13
+ :key="i"
14
+ @click="checkItem(i)"
15
+ >
16
+ <view class="hy-tabBar--container__item--bar">
17
+ <view class="icon">
18
+ <HyBadge
19
+ :value="item?.badge"
20
+ absolute
21
+ :offset="[-13, 25]"
22
+ :max="badge?.max"
23
+ :is-dot="badge?.isDot"
24
+ :inverted="badge?.inverted"
25
+ :bg-color="badge?.bgColor"
26
+ :type="badge?.type"
27
+ :number-type="badge?.numberType"
28
+ :shape="badge?.shape"
29
+ :show-zero="badge?.showZero"
30
+ :show="!!item?.badge"
31
+ ></HyBadge>
32
+ <HyIcon :name="item.icon" :color="color" size="25"></HyIcon>
33
+ </view>
34
+ <text class="text" :style="[{ color: color }]">{{
35
+ item.name
36
+ }}</text>
37
+ <text class="circle"></text>
38
+ </view>
39
+ </view>
40
+ <view
41
+ class="hy-tabBar--indicator"
42
+ :style="{
43
+ '--num': `translateX(calc(((100vw - 110rpx - ${list.length} * 70rpx) / ${list.length - 1} + 70rpx) * ${current}))`,
44
+ background: activeColor,
45
+ }"
46
+ ></view>
47
+ </view>
48
+ </view>
49
+ </view>
50
+ </template>
51
+
52
+ <script setup lang="ts">
53
+ import { ref, toRefs, watch } from "vue";
54
+ import defaultProps from "./props";
55
+ import type IProps from "./typing";
56
+
57
+ // 组件
58
+ import HyIcon from "../hy-icon/hy-icon.vue";
59
+ import HyBadge from "../hy-badge/hy-badge.vue";
60
+
61
+ const props = withDefaults(defineProps<IProps>(), defaultProps);
62
+ const { modelValue, baseBgColor } = toRefs(props);
63
+ const emit = defineEmits(["clickTab"]);
64
+
65
+ const baseBackgroundColor = baseBgColor.value
66
+ ? baseBgColor.value
67
+ : "var(--hy-background)";
68
+ const current = ref(0);
69
+ watch(
70
+ () => modelValue.value,
71
+ (newVal) => {
72
+ current.value = newVal;
73
+ },
74
+ );
75
+
76
+ const checkItem = (index: number) => {
77
+ current.value = index;
78
+ emit("clickTab", index);
79
+ };
80
+ </script>
81
+
82
+ <style lang="scss" scoped>
83
+ @import "./index.scss";
84
+ .hy-tabBar {
85
+ background: v-bind(baseBackgroundColor);
86
+ &--indicator {
87
+ border: 12rpx solid v-bind(baseBackgroundColor);
88
+ &::before {
89
+ box-shadow: 1px -15rpx 0 v-bind(baseBackgroundColor);
90
+ }
91
+ &::after {
92
+ box-shadow: -1px -15rpx 0 v-bind(baseBackgroundColor);
93
+ }
94
+ }
95
+ }
96
+ </style>
@@ -0,0 +1,169 @@
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+ @include b(tabBar) {
5
+ height: 135rpx;
6
+ z-index: 999;
7
+ position: fixed;
8
+ bottom: 0;
9
+ @include m(placeholder) {
10
+ height: 135rpx;
11
+ position: relative;
12
+ bottom: 0;
13
+ }
14
+
15
+ @include m(box) {
16
+ margin-top: 15rpx;
17
+ position: relative;
18
+ width: 100vw;
19
+ height: 120rpx;
20
+ display: flex;
21
+ justify-content: center;
22
+ align-items: center;
23
+ border-radius: 15rpx 15rpx 0 0;
24
+ padding: 0 20rpx;
25
+ /* #ifndef APP-PLUS-NVUE */
26
+ box-sizing: border-box;
27
+ /* #endif */
28
+ background-color: $hy-background--container;
29
+ }
30
+ @include m(container) {
31
+ width: 100%;
32
+ display: flex;
33
+ justify-content: space-between;
34
+ align-items: center;
35
+ padding: 0 20rpx;
36
+ &__item {
37
+ position: relative;
38
+ width: 100rpx;
39
+ height: 70rpx;
40
+ z-index: 1;
41
+
42
+ /* #ifndef APP-PLUS-NVUE */
43
+ &:nth-child(1).is-active ~ .hy-tabBar--indicator {
44
+ transform: var(--num);
45
+ }
46
+
47
+ &:nth-child(2).is-active ~ .hy-tabBar--indicator {
48
+ transform: var(--num);
49
+ }
50
+
51
+ &:nth-child(3).is-active ~ .hy-tabBar--indicator {
52
+ transform: var(--num);
53
+ }
54
+
55
+ &:nth-child(4).is-active ~ .hy-tabBar--indicator {
56
+ transform: var(--num);
57
+ }
58
+
59
+ &:nth-child(5).is-active ~ .hy-tabBar--indicator {
60
+ transform: var(--num);
61
+ }
62
+ /* #endif */
63
+
64
+ &--bar {
65
+ position: relative;
66
+ display: flex;
67
+ justify-content: center;
68
+ align-items: center;
69
+ flex-direction: column;
70
+ width: 100%;
71
+ text-align: center;
72
+ font-weight: 500;
73
+ .icon {
74
+ /* #ifndef APP-PLUS-NVUE */
75
+ transition: 0.5s;
76
+ /* #endif */
77
+ position: relative;
78
+ }
79
+ .text {
80
+ position: absolute;
81
+ font-weight: 400;
82
+ font-size: 0.75em;
83
+ /* #ifndef APP-PLUS-NVUE */
84
+ letter-spacing: 0.05em;
85
+ transition: 0.5s;
86
+ /* #endif */
87
+ transform: translateY(20px) scale(0);
88
+ }
89
+ .circle {
90
+ position: absolute;
91
+ /* #ifndef APP-PLUS-NVUE */
92
+ display: block;
93
+ /* #endif */
94
+ width: 75rpx;
95
+ height: 75rpx;
96
+ background: transparent;
97
+ border-radius: 50%;
98
+ border: 3rpx solid #fff;
99
+ transform: translateY(-70rpx) scale(0);
100
+ }
101
+ }
102
+
103
+ @include is(active) {
104
+ @include b(tabBar--container__item--bar) {
105
+ .icon {
106
+ transform: translate(2rpx, -56rpx);
107
+ :deep(.hy-icon) {
108
+ color: #FFFFFF;
109
+ }
110
+ }
111
+ .text {
112
+ opacity: 1;
113
+ transform: translateY(20rpx);
114
+ }
115
+ .circle {
116
+ /* #ifndef APP-PLUS-NVUE */
117
+ margin: 0 auto;
118
+ transition: 0.5s;
119
+ /* #endif */
120
+ transition-delay: 0.5s;
121
+ transform: translate(2rpx, -56rpx) scale(1);
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ @include m(indicator) {
129
+ position: absolute;
130
+ top: -59%;
131
+ left: 30rpx;
132
+ width: 100rpx;
133
+ height: 100rpx;
134
+ border-radius: 50%;
135
+ display: flex;
136
+ justify-content: center;
137
+ align-items: center;
138
+ background-color: $hy-primary;
139
+ /* #ifndef APP-PLUS-NVUE */
140
+ transition: 0.5s;
141
+ /* #endif */
142
+
143
+ @include pseudo(before) {
144
+ /* #ifndef APP-PLUS-NVUE */
145
+ content: "";
146
+ /* #endif */
147
+ position: absolute;
148
+ top: 59%;
149
+ left: -45rpx;
150
+ width: 50rpx;
151
+ height: 40rpx;
152
+ background: transparent;
153
+ border-top-right-radius: 20px;
154
+ }
155
+
156
+ @include pseudo(after) {
157
+ /* #ifndef APP-PLUS-NVUE */
158
+ content: "";
159
+ /* #endif */
160
+ position: absolute;
161
+ top: 58%;
162
+ right: -49rpx;
163
+ width: 50rpx;
164
+ height: 40rpx;
165
+ background: transparent;
166
+ border-top-left-radius: 40rpx;
167
+ }
168
+ }
169
+ }
@@ -0,0 +1,13 @@
1
+ import type IProps from "./typing";
2
+
3
+ const defaultProps: IProps = {
4
+ modelValue: 0,
5
+ list: [],
6
+ color: "",
7
+ baseBgColor: "",
8
+ barBgColor: "",
9
+ activeColor: "",
10
+ badge: {},
11
+ };
12
+
13
+ export default defaultProps;
@@ -0,0 +1,54 @@
1
+ import type HyBadgeProps from "../hy-badge/typing";
2
+
3
+ export interface TabListVo {
4
+ /**
5
+ * @description 标题
6
+ * */
7
+ name: string;
8
+ /**
9
+ * @description icon图标或者图片
10
+ * */
11
+ icon: string;
12
+ /**
13
+ * @description 徽标值
14
+ * */
15
+ badge?: number;
16
+ }
17
+
18
+ export default interface HyTabBarProps {
19
+ /**
20
+ * @description tab当前值
21
+ * */
22
+ modelValue: number;
23
+ /**
24
+ * @description 导航栏值
25
+ * {
26
+ * name: 中文名,
27
+ * icon: uview-plus里面的矢量图标库
28
+ * }
29
+ * */
30
+ list: TabListVo[];
31
+ /**
32
+ * @description 文字颜色
33
+ * */
34
+ color?: string;
35
+ /**
36
+ * @description 底部导航栏底部背景颜色(颜色设置必须要和页面背景颜色一样,才有重合感觉)
37
+ * 支持渐变色--linear-gradient(155deg, #192b6e, #a6307c)
38
+ * */
39
+ baseBgColor?: string;
40
+ /**
41
+ * @description 底部导航栏背景颜色
42
+ * 支持渐变色--linear-gradient(155deg, #192b6e, #a6307c)
43
+ * */
44
+ barBgColor?: string;
45
+ /**
46
+ * @description 点击突出按钮的背景颜色
47
+ * 支持渐变色--linear-gradient(0deg, #ffa576,#0951eb)
48
+ * */
49
+ activeColor?: string;
50
+ /**
51
+ * @description 徽标属性集合
52
+ * */
53
+ badge?: Partial<HyBadgeProps>;
54
+ }