hy-app 0.2.1 → 0.2.4

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 (78) hide show
  1. package/components/hy-button/index.scss +2 -0
  2. package/components/hy-cell/index.scss +0 -15
  3. package/components/hy-code-input/hy-code-input.vue +224 -0
  4. package/components/hy-code-input/index.scss +108 -0
  5. package/components/hy-code-input/props.ts +21 -0
  6. package/components/hy-code-input/typing.d.ts +65 -0
  7. package/components/hy-config-provider/hy-config-provider.vue +0 -1
  8. package/components/hy-config-provider/props.ts +1 -1
  9. package/components/hy-dropdown/props.ts +1 -1
  10. package/components/hy-dropdown-item/hy-dropdown-item.vue +2 -5
  11. package/components/hy-dropdown-item/index.scss +11 -13
  12. package/components/hy-grid/hy-grid.vue +7 -8
  13. package/components/hy-grid/props.ts +4 -0
  14. package/components/hy-grid/typing.d.ts +15 -0
  15. package/components/hy-icon/index.scss +2 -1
  16. package/components/hy-login/TheUserLogin.vue +0 -1
  17. package/components/hy-menu/hy-menu.vue +159 -0
  18. package/components/hy-menu/index.scss +58 -0
  19. package/components/hy-menu/props.ts +12 -0
  20. package/components/hy-menu/typing.d.ts +57 -0
  21. package/components/hy-modal/hy-modal.vue +5 -5
  22. package/components/hy-modal/index.scss +0 -6
  23. package/components/hy-notify/hy-notify.vue +169 -0
  24. package/components/hy-notify/index.scss +25 -0
  25. package/components/hy-notify/props.ts +14 -0
  26. package/components/hy-notify/typing.d.ts +44 -0
  27. package/components/hy-pagination/hy-pagination.vue +125 -0
  28. package/components/hy-pagination/index.scss +46 -0
  29. package/components/hy-pagination/props.ts +15 -0
  30. package/components/hy-pagination/typing.d.ts +44 -0
  31. package/components/hy-picker/index.scss +4 -0
  32. package/components/hy-scroll-list/index.scss +1 -1
  33. package/components/hy-search/index.scss +1 -2
  34. package/components/hy-signature/canvasHelper.ts +51 -0
  35. package/components/hy-signature/hy-signature.vue +656 -0
  36. package/components/hy-signature/index.scss +29 -0
  37. package/components/hy-signature/props.ts +29 -0
  38. package/components/hy-signature/typing.d.ts +181 -0
  39. package/components/hy-slider/index.scss +5 -1
  40. package/components/hy-subsection/hy-subsection.vue +15 -13
  41. package/components/hy-subsection/props.ts +2 -2
  42. package/components/hy-subsection/typing.d.ts +1 -1
  43. package/components/hy-swipe-action/hy-swipe-action.vue +288 -248
  44. package/components/hy-swipe-action/index.scss +34 -0
  45. package/components/hy-swipe-action/index.ts +34 -0
  46. package/components/hy-swipe-action/props.ts +15 -9
  47. package/components/hy-swipe-action/typing.d.ts +20 -22
  48. package/components/hy-swiper/index.scss +5 -0
  49. package/components/hy-tabBar/hy-tabBar.vue +96 -0
  50. package/components/hy-tabBar/index.scss +169 -0
  51. package/components/hy-tabBar/props.ts +13 -0
  52. package/components/hy-tabBar/typing.d.ts +54 -0
  53. package/components/hy-tabs/index.scss +2 -2
  54. package/components/hy-tag/index.scss +1 -1
  55. package/components/hy-text/index.scss +2 -2
  56. package/components/hy-textarea/hy-textarea.vue +5 -5
  57. package/components/hy-textarea/index.scss +5 -6
  58. package/components/hy-tooltip/index.scss +2 -2
  59. package/components/hy-upload/index.scss +1 -2
  60. package/components/hy-watermark/hy-watermark.vue +603 -0
  61. package/components/hy-watermark/index.scss +15 -0
  62. package/components/hy-watermark/props.ts +23 -0
  63. package/components/hy-watermark/typing.d.ts +76 -0
  64. package/components/index.ts +2 -2
  65. package/composables/index.ts +1 -0
  66. package/composables/useTouch.ts +48 -0
  67. package/index.ts +1 -1
  68. package/libs/css/mixin.scss +52 -13
  69. package/libs/css/vars.css +12 -2
  70. package/package.json +2 -2
  71. package/theme.scss +24 -46
  72. package/typing/modules/common.d.ts +1 -1
  73. package/utils/inspect.ts +20 -0
  74. package/utils/utils.ts +52 -22
  75. package/components/hy-swipe-action/index.wxs +0 -235
  76. package/components/hy-swipe-action/wxs.js +0 -15
  77. package/components/yk-tabbar/props.ts +0 -49
  78. package/components/yk-tabbar/yk-tabbar.vue +0 -224
@@ -1,4 +1,4 @@
1
- import type { CSSProperties } from "vue";
1
+ import type { CSSProperties, PropType } from "vue";
2
2
 
3
3
  interface SwipeActionOptionsVo {
4
4
  text: string;
@@ -6,36 +6,33 @@ interface SwipeActionOptionsVo {
6
6
  icon?: string;
7
7
  iconSize?: string | number;
8
8
  }
9
+ export type SwipeActionStatus = "close" | "left" | "right";
10
+ // 点击关闭按钮、滑动关闭按钮、通过控制value关闭按钮
11
+ export type SwipeActionReason = "click" | "swipe" | "value";
12
+ export type SwipeActionPosition = SwipeActionStatus | "inside";
13
+ export type SwipeActionBeforeClose = (
14
+ reason: SwipeActionReason,
15
+ position: SwipeActionPosition,
16
+ ) => void;
9
17
 
10
18
  export default interface SwipeActionProps {
11
19
  /**
12
- * @description 数据列表
20
+ * @description 滑动按钮的状态,使用v-model进行双向绑定。
21
+ * 选值为:'left'(左滑)、'close'(关闭状态)、'right'(右滑)。
13
22
  * */
14
- list: Record<string, any>[];
23
+ modelValue?: SwipeActionStatus;
15
24
  /**
16
- * @description 控制打开或者关闭(默认 false )
17
- * */
18
- show?: boolean;
19
- /**
20
- * @description 标识符,如果是v-for,可用index索引值
21
- * */
22
- name?: string;
23
- /**
24
- * @description 唯一键值
25
- * */
26
- key?: string;
27
- /**
28
- * @description 是否禁用(默认 false )
25
+ * @description 是否禁用滑动操作
29
26
  * */
30
27
  disabled?: boolean;
31
- /**
32
- * @description 滑动距离阈值,只有大于此值,才被认为是要打开菜单(默认 30 )
33
- * */
34
- threshold?: number;
35
28
  /**
36
29
  * @description 是否自动关闭其他swipe按钮组(默认 true )
37
30
  * */
38
31
  autoClose?: boolean;
32
+ /**
33
+ * @description 显示底部边框
34
+ * */
35
+ borderBottom?: boolean;
39
36
  /**
40
37
  * @description 右侧按钮内容
41
38
  * */
@@ -45,9 +42,10 @@ export default interface SwipeActionProps {
45
42
  * */
46
43
  duration?: number;
47
44
  /**
48
- * @description 是否关闭
45
+ * @description 在关闭滑动按钮前调用的钩子函数
46
+ * @desc 可以在此函数中执行一些关闭前的操作,如确认提示等。
49
47
  * */
50
- closeOnClick: boolean;
48
+ beforeClose?: funtion | PropType<SwipeActionBeforeClose>;
51
49
  /**
52
50
  * @description 定义需要用到的外部样式
53
51
  * */
@@ -12,6 +12,10 @@
12
12
  &__wrapper {
13
13
  flex: 1;
14
14
 
15
+ :deep(.uni-swiper-wrapper) {
16
+ background-color: $hy-background;
17
+ }
18
+
15
19
  &__item {
16
20
  flex: 1;
17
21
 
@@ -22,6 +26,7 @@
22
26
  transition: transform 0.3s;
23
27
  flex: 1;
24
28
 
29
+
25
30
  &__image {
26
31
  flex: 1;
27
32
  }
@@ -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
+ }
@@ -47,10 +47,10 @@
47
47
  &--text {
48
48
  font-size: 15px;
49
49
  color: $hy-text-color;
50
- white-space: nowrap !important;
50
+ white-space: nowrap;
51
51
 
52
52
  &--disabled {
53
- color: $hy-light-background-disabled !important;
53
+ color: $hy-background--disabled !important;
54
54
  }
55
55
  }
56
56
  }
@@ -13,7 +13,7 @@
13
13
  }
14
14
 
15
15
  /*禁用*/
16
- @include themeColor(disabled, $hy-background--disabled, $hy-color-disable-icon,
16
+ @include themeColor(disabled, $hy-background--disabled, $hy-text-color--disabled,
17
17
  $hy-background--disabled);
18
18
 
19
19
  /*圆角*/
@@ -32,9 +32,9 @@
32
32
  @include themeColor(success, "", "", $hy-success);
33
33
  @include themeColor(info, "", "", $hy-info);
34
34
  @include themeColor(error, "", "", $hy-error);
35
- @include themeColor(main, "", "", $hy-light-color);
35
+ @include themeColor(main, "", "", $hy-text-color);
36
36
  @include themeColor(content, "", "", $hy-text-color--grey);
37
- @include themeColor(tips, "", "",$hy-tips-color);
37
+ @include themeColor(tips, "", "",$hy-text-color--grey);
38
38
  @include themeColor(light, "", "", $hy-border-color-light);
39
39
 
40
40
  }
@@ -5,7 +5,7 @@
5
5
  :style="[textareaStyle, borderStyle(isFocus)]"
6
6
  >
7
7
  <textarea
8
- class="hy-textarea__field"
8
+ class="hy-textarea--field"
9
9
  :value="innerValue"
10
10
  :style="{ height: addUnit(height) }"
11
11
  :placeholder="placeholder || ''"
@@ -47,13 +47,13 @@
47
47
 
48
48
  <script lang="ts">
49
49
  export default {
50
- name: 'hy-textarea',
50
+ name: "hy-textarea",
51
51
  options: {
52
52
  addGlobalClass: true,
53
53
  virtualHost: true,
54
- styleIsolation: 'shared'
55
- }
56
- }
54
+ styleIsolation: "shared",
55
+ },
56
+ };
57
57
  </script>
58
58
 
59
59
  <script setup lang="ts">
@@ -8,31 +8,30 @@
8
8
  flex: 1;
9
9
  padding: $hy-border-margin-padding-base;
10
10
 
11
- &--radius {
11
+ @include m(radius) {
12
12
  border-radius: $hy-border-radius-sm;
13
13
  }
14
14
 
15
- &--no-radius {
15
+ @include m(no-radius) {
16
16
  border-radius: $hy-border-radius-no;
17
17
  }
18
18
 
19
- &--disabled {
19
+ @include m(disabled) {
20
20
  background-color: $hy-background--disabled;
21
21
  color: $hy-text-color--disabled;
22
22
  }
23
23
 
24
- &__field {
24
+ @include m(field) {
25
25
  flex: 1;
26
26
  font-size: 15px;
27
27
  width: 100%;
28
28
  }
29
29
 
30
- &--count {
30
+ @include m(count) {
31
31
  position: absolute;
32
32
  right: 5px;
33
33
  bottom: 2px;
34
34
  font-size: 12px;
35
- color: $hy-text-color--2;
36
35
  background-color: $hy-background--3;
37
36
  padding: 1px 4px;
38
37
  border-radius: $hy-border-radius-sm;
@@ -21,7 +21,7 @@
21
21
  justify-content: center;
22
22
 
23
23
  &__list {
24
- background-color: #060607;
24
+ background-color: rgb(50, 50, 51);
25
25
  position: relative;
26
26
  flex: 1;
27
27
  border-radius: $hy-border-radius-sm;
@@ -49,7 +49,7 @@
49
49
 
50
50
  &__indicator {
51
51
  position: absolute;
52
- background-color: #060607;
52
+ background-color: rgb(50, 50, 51);
53
53
  width: 14px;
54
54
  height: 14px;
55
55
  bottom: -4px;
@@ -37,7 +37,7 @@ $hy-upload-text-font-size: 11px !default;
37
37
 
38
38
  &__text {
39
39
  font-size: $hy-upload-text-font-size;
40
- color: $hy-tips-color;
40
+ color: $hy-text-color--grey;
41
41
  margin-top: 2px;
42
42
  }
43
43
  }
@@ -126,7 +126,6 @@ $hy-upload-text-font-size: 11px !default;
126
126
  .material-sent {
127
127
  width: 100%;
128
128
  height: 100%;
129
- background: rgba(245, 245, 245, 0.3);
130
129
  backdrop-filter: blur(4px);
131
130
  position: absolute;
132
131
  display: flex;