hy-app 0.2.2 → 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 (43) hide show
  1. package/components/hy-button/index.scss +1 -3
  2. package/components/hy-cell/index.scss +0 -15
  3. package/components/hy-code-input/hy-code-input.vue +2 -1
  4. package/components/hy-code-input/typing.d.ts +1 -1
  5. package/components/hy-config-provider/props.ts +1 -1
  6. package/components/hy-grid/hy-grid.vue +2 -3
  7. package/components/hy-grid/props.ts +4 -0
  8. package/components/hy-grid/typing.d.ts +15 -0
  9. package/components/hy-icon/index.scss +2 -2
  10. package/components/hy-login/TheUserLogin.vue +0 -1
  11. package/components/hy-menu/hy-menu.vue +159 -0
  12. package/components/hy-menu/index.scss +58 -0
  13. package/components/hy-menu/props.ts +12 -0
  14. package/components/hy-menu/typing.d.ts +57 -0
  15. package/components/hy-notify/typing.d.ts +1 -1
  16. package/components/hy-pagination/typing.d.ts +1 -1
  17. package/components/hy-signature/hy-signature.vue +50 -50
  18. package/components/hy-signature/index.scss +2 -4
  19. package/components/hy-signature/props.ts +2 -1
  20. package/components/hy-signature/typing.d.ts +5 -1
  21. package/components/hy-subsection/hy-subsection.vue +15 -13
  22. package/components/hy-subsection/props.ts +2 -2
  23. package/components/hy-subsection/typing.d.ts +1 -1
  24. package/components/hy-tabBar/hy-tabBar.vue +96 -0
  25. package/components/hy-tabBar/index.scss +169 -0
  26. package/components/hy-tabBar/props.ts +13 -0
  27. package/components/hy-tabBar/typing.d.ts +54 -0
  28. package/components/hy-text/index.scss +2 -2
  29. package/components/hy-upload/index.scss +0 -1
  30. package/components/hy-watermark/hy-watermark.vue +603 -0
  31. package/components/hy-watermark/index.scss +15 -0
  32. package/components/hy-watermark/props.ts +23 -0
  33. package/components/hy-watermark/typing.d.ts +76 -0
  34. package/components/index.ts +2 -2
  35. package/index.ts +1 -1
  36. package/libs/css/vars.css +5 -1
  37. package/package.json +2 -2
  38. package/theme.scss +4 -3
  39. package/typing/modules/common.d.ts +1 -1
  40. package/utils/inspect.ts +20 -0
  41. package/utils/utils.ts +52 -22
  42. package/components/yk-tabbar/props.ts +0 -49
  43. package/components/yk-tabbar/yk-tabbar.vue +0 -224
@@ -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;
@@ -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内容*/
@@ -14,6 +14,7 @@
14
14
  <view
15
15
  class="hy-code-input--item__dot"
16
16
  v-if="dot && current > index"
17
+ :style="{ color: color }"
17
18
  ></view>
18
19
  <text
19
20
  v-else
@@ -215,7 +216,7 @@ const inputHandler = (e: any) => {
215
216
  &__line {
216
217
  &::after {
217
218
  height: v-bind(lineHeight);
218
- background-color: var(--hy-border-color);
219
+ background-color: $hy-border-color;
219
220
  }
220
221
  }
221
222
  }
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties } from "vue";
2
2
 
3
- export default interface HyOverlayProps {
3
+ export default interface HyCodeInputProps {
4
4
  modelValue: string | number;
5
5
  /**
6
6
  * @description 键盘弹起时,是否自动上推页面(默认 true )
@@ -5,7 +5,7 @@ const defaultProps: IProps = {
5
5
  theme: "light",
6
6
  themeColor: ColorConfig.primary,
7
7
  themeLightColor: "#ecf5ff",
8
- padding: "10px",
8
+ padding: "",
9
9
  customClass: "",
10
10
  customStyle: {},
11
11
  };
@@ -10,9 +10,9 @@
10
10
  >
11
11
  <slot :record="item">
12
12
  <HyIcon
13
- :name="item?.icon"
13
+ :name="item[customKeys?.icon]"
14
14
  label-pos="bottom"
15
- :label="item?.name"
15
+ :label="item[customKeys?.name]"
16
16
  :space="item?.iconConfig?.space || iconConfig?.space || 8"
17
17
  :color="item?.iconConfig?.color || iconConfig?.color"
18
18
  :size="item?.iconConfig?.size || iconConfig?.size || 30"
@@ -28,7 +28,6 @@
28
28
  item?.iconConfig?.customStyle || iconConfig?.customStyle
29
29
  "
30
30
  ></HyIcon>
31
- <!-- <view class="hy-grid-item__title">{{ item.name }}</view>-->
32
31
  </slot>
33
32
  </view>
34
33
  </template>
@@ -2,6 +2,10 @@ import type IProps from "./typing";
2
2
 
3
3
  const defaultProps: IProps = {
4
4
  list: [],
5
+ customKeys: {
6
+ name: "name",
7
+ icon: "icon",
8
+ },
5
9
  col: 5,
6
10
  border: false,
7
11
  itemHeight: "80px",
@@ -19,11 +19,26 @@ interface GridItemVo {
19
19
  * */
20
20
  [key: string]: any;
21
21
  }
22
+ export interface CustomKeysVo {
23
+ /**
24
+ * @description 自定义标题键名
25
+ * */
26
+ name: string;
27
+ /**
28
+ * @description 自定义icon键名
29
+ * */
30
+ icon: string;
31
+ }
32
+
22
33
  export default interface HyGridProps {
23
34
  /**
24
35
  * @description 数据集
25
36
  * */
26
37
  list: GridItemVo[];
38
+ /**
39
+ * @description 自定义键值
40
+ * */
41
+ customKeys?: CustomKeysVo;
27
42
  /**
28
43
  * @description 宫格的列数(默认 3 )
29
44
  * */
@@ -66,12 +66,12 @@
66
66
 
67
67
  &__label {
68
68
  @include lineEllipsis;
69
- overflow: hidden;
70
69
  /* #ifndef APP-NVUE */
71
70
  line-height: 1;
72
71
  /* #endif */
73
72
  color: $hy-text-color--grey;
74
- font-size: 12px;
73
+ font-size: $hy-font-size-sm;
74
+ max-width: 150rpx;
75
75
  }
76
76
  }
77
77
  @include b(rotate) {
@@ -104,7 +104,6 @@ const userColumns = computed(() => [
104
104
  },
105
105
  onSuffix: () => {
106
106
  showPwd.value = !showPwd.value;
107
- console.log(showChoice.value);
108
107
  },
109
108
  },
110
109
  rules: [props.customUserValidator, props.pwdNumValidator],
@@ -0,0 +1,159 @@
1
+ <template>
2
+ <view class="hy-menu" :style="{ width: addUnit(width) }">
3
+ <template v-for="(item, i) in list">
4
+ <view
5
+ @click="handleClick(item, i)"
6
+ :class="menuItemClass(item, i)"
7
+ :style="customStyle"
8
+ >
9
+ <slot name="icon">
10
+ <hy-icon
11
+ class="hy-menu-item__icon"
12
+ :name="item.icon"
13
+ :color="current === i ? color || 'var(--hy-theme-color)' : ''"
14
+ :size="icon?.size || 16"
15
+ :bold="icon?.bold"
16
+ :customPrefix="icon?.customPrefix"
17
+ :imgMode="icon?.imgMode"
18
+ :width="icon?.width"
19
+ :height="icon?.height"
20
+ :top="icon?.top"
21
+ :stop="icon?.stop"
22
+ :round="icon?.round"
23
+ :customStyle="icon?.customStyle || { marginRight: '2px' }"
24
+ ></hy-icon>
25
+ </slot>
26
+ <slot>
27
+ <text class="hy-menu-item--title">{{ item.title }}</text>
28
+ </slot>
29
+ <hy-badge
30
+ :value="item?.badge"
31
+ :offset="badge?.offset"
32
+ :shape="badge?.shape"
33
+ :color="badge?.color"
34
+ :bg-color="badge?.bgColor"
35
+ :inverted="badge?.inverted"
36
+ :type="badge?.type"
37
+ :number-type="badge?.numberType"
38
+ :is-dot="badge?.isDot"
39
+ :absolute="badge?.absolute"
40
+ :max="badge?.max"
41
+ :show-zero="badge?.showZero"
42
+ :custom-style="badge?.customStyle"
43
+ >
44
+ </hy-badge>
45
+ </view>
46
+ </template>
47
+ </view>
48
+ </template>
49
+
50
+ <script lang="ts">
51
+ export default {
52
+ name: "hy-menu",
53
+ options: {
54
+ addGlobalClass: true,
55
+ virtualHost: true,
56
+ styleIsolation: "shared",
57
+ },
58
+ };
59
+ </script>
60
+
61
+ <script lang="ts" setup>
62
+ import { computed, ref, toRefs, watch } from "vue";
63
+ import type IProps from "./typing";
64
+ import type { MenusType } from "./typing";
65
+ import defaultProps from "./props";
66
+ import { addUnit } from "../../utils";
67
+
68
+ // 组件
69
+ import HyIcon from "../hy-icon/hy-icon.vue";
70
+ import HyBadge from "../hy-badge/hy-badge.vue";
71
+
72
+ const props = withDefaults(defineProps<IProps>(), defaultProps);
73
+ const { modelValue, list, color } = toRefs(props);
74
+ const emit = defineEmits(["change", "update:modelValue"]);
75
+
76
+ const current = ref<string | number>(0);
77
+
78
+ watch(
79
+ () => modelValue.value,
80
+ (newVal: string | number) => {
81
+ current.value = list.value.findIndex((item) => item.id === newVal);
82
+ // current.value = newVal;
83
+ },
84
+ );
85
+
86
+ const menuItemClass = computed(() => {
87
+ return (temp: MenusType, i: number) => {
88
+ const classes = [
89
+ "hy-menu-item",
90
+ prefix.value && "hy-menu-item--prefix",
91
+ suffix.value && "hy-menu-item--suffix",
92
+ temp.disabled && "hy-menu-item--disabled",
93
+ ];
94
+ if (current.value === i) {
95
+ classes.push(
96
+ "hy-menu-item--active",
97
+ color.value && "hy-menu-item--active__color",
98
+ );
99
+ }
100
+
101
+ return classes;
102
+ };
103
+ });
104
+
105
+ const prefix = computed(() => {
106
+ // let prefix: boolean = false;
107
+ // if (sidebar) {
108
+ // let activeIndex: number = sidebar.children.findIndex((c: any) => {
109
+ // return c.value === sidebar.props.modelValue;
110
+ // });
111
+ //
112
+ // let currentIndex: number = sidebar.children.findIndex((c: any) => {
113
+ // return c.value === props.value;
114
+ // });
115
+ //
116
+ // if (currentIndex === activeIndex - 1) {
117
+ // prefix = true;
118
+ // }
119
+ // }
120
+ return prefix;
121
+ });
122
+
123
+ const suffix = computed(() => {
124
+ let suffix: boolean = false;
125
+ // if (sidebar) {
126
+ // let activeIndex: number = sidebar.children.findIndex((c: any) => {
127
+ // return c.value === sidebar.props.modelValue;
128
+ // });
129
+ //
130
+ // let currentIndex: number = sidebar.children.findIndex((c: any) => {
131
+ // return c.value === props.value;
132
+ // });
133
+ //
134
+ // if (currentIndex === activeIndex + 1) {
135
+ // suffix = true;
136
+ // }
137
+ // }
138
+ return suffix;
139
+ });
140
+
141
+ function handleClick(temp: MenusType, i: number) {
142
+ if (temp?.disabled) {
143
+ return;
144
+ }
145
+ current.value = i;
146
+ emit("update:modelValue", temp.id);
147
+ emit("change", temp);
148
+ }
149
+ </script>
150
+
151
+ <style lang="scss" scoped>
152
+ @import "./index.scss";
153
+ .hy-menu-item--active__color {
154
+ color: v-bind(color);
155
+ &::before {
156
+ background: v-bind(color);
157
+ }
158
+ }
159
+ </style>
@@ -0,0 +1,58 @@
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+
5
+ @include b(menu) {
6
+ max-width: 260rpx;
7
+ background-color: $hy-background--track;
8
+
9
+ &-item {
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: flex-start;
13
+ position: relative;
14
+ padding: $hy-border-margin-padding-lg $hy-border-margin-padding-base;
15
+ //min-height: $-sidebar-item-height;
16
+ box-sizing: border-box;
17
+
18
+ &:active {
19
+ background-color: $hy-background--hover;
20
+ }
21
+
22
+ @include m(active) {
23
+ font-weight: 600;
24
+ background: $hy-background--active;
25
+ color: $hy-primary;
26
+
27
+ &::before {
28
+ content: "";
29
+ position: absolute;
30
+ top: 50%;
31
+ left: 0;
32
+ width: 4px;
33
+ height: 15px;
34
+ background: $hy-primary;
35
+ transform: translateY(-50%);
36
+ border-radius: $hy-border-radius-semicircle;
37
+ }
38
+
39
+ &:active {
40
+ background-color: transparent;
41
+ }
42
+ }
43
+ @include m(title) {
44
+ margin-left: 10rpx;
45
+ font-size: $hy-font-size-base;
46
+ line-height: $hy-font-size-base;
47
+ @include lineEllipsis;
48
+ position: relative;
49
+ }
50
+ @include m(disabled) {
51
+ color: $hy-text-color--disabled;
52
+ background-color: $hy-background--disabled;
53
+ cursor: not-allowed;
54
+
55
+ }
56
+
57
+ }
58
+ }
@@ -0,0 +1,12 @@
1
+ import type IProps from "./typing";
2
+
3
+ const defaultProps: IProps = {
4
+ modelValue: "",
5
+ list: [],
6
+ width: 120,
7
+ color: "",
8
+ icon: {},
9
+ badge: {},
10
+ };
11
+
12
+ export default defaultProps;
@@ -0,0 +1,57 @@
1
+ import type { CSSProperties } from "vue";
2
+ import type HyBadgeProps from "../hy-badge/typing";
3
+ import type HyIconProps from "../hy-icon/typing";
4
+
5
+ export interface MenusType {
6
+ /**
7
+ * @description 唯一id
8
+ * */
9
+ id: string | number;
10
+ /**
11
+ * @description 标题
12
+ * */
13
+ title: string;
14
+ /**
15
+ * @description 是否禁用
16
+ * */
17
+ disabled?: boolean;
18
+ /**
19
+ * @description icon
20
+ * */
21
+ icon?: string;
22
+ /**
23
+ * @description 徽标值
24
+ * */
25
+ badge?: number;
26
+ }
27
+
28
+ export default interface HyMenuProps {
29
+ /**
30
+ * @description 当前值
31
+ * */
32
+ modelValue: string | number;
33
+ /**
34
+ * @description 菜单数据集
35
+ * */
36
+ list: MenusType[];
37
+ /**
38
+ * @description 侧边菜单栏宽度
39
+ * */
40
+ width?: string | number;
41
+ /**
42
+ * @description 选中颜色
43
+ * */
44
+ color?: string;
45
+ /**
46
+ * @description 图标属性值
47
+ * */
48
+ icon?: Partial<HyIconProps>;
49
+ /**
50
+ * @description 徽标属性值
51
+ * */
52
+ badge?: Partial<HyBadgeProps>;
53
+ /**
54
+ * @description 定义需要用到的外部样式
55
+ * */
56
+ customStyle?: CSSProperties;
57
+ }
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties } from "vue";
2
2
 
3
- export default interface HyOverlayProps {
3
+ export default interface HyNotifyProps {
4
4
  /**
5
5
  * @description 到顶部的距离 ( 默认 0 )
6
6
  * */
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties } from "vue";
2
2
 
3
- export default interface HyOverlayProps {
3
+ export default interface HyPaginationProps {
4
4
  /**
5
5
  * @description 当前页
6
6
  */