hy-app 0.4.13 → 0.4.15

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.
@@ -0,0 +1,87 @@
1
+ @use "../../libs/css/theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+ @include b(folding-panel-item) {
5
+ position: relative;
6
+ width: 100%;
7
+
8
+ @include m(disabled) {
9
+ opacity: 0.6;
10
+ pointer-events: none;
11
+ }
12
+
13
+ @include is(active) {
14
+ background-color: $hy-background--active;
15
+ }
16
+
17
+ @include m(border) {
18
+ border-bottom: $hy-border-line;
19
+
20
+ &:last-child {
21
+ border-bottom: none;
22
+ }
23
+ }
24
+
25
+ @include m(large) {
26
+ padding: $hy-border-margin-padding-lg;
27
+ font-size: $hy-font-size-lg;
28
+ }
29
+
30
+ @include m(medium) {
31
+ padding: $hy-border-margin-padding-base;
32
+ font-size: $hy-font-size-base;
33
+ }
34
+
35
+ @include m(small) {
36
+ padding: $hy-border-margin-padding-sm;
37
+ font-size: $hy-font-size-sm;
38
+ }
39
+
40
+ @include e(header) {
41
+ display: flex;
42
+ justify-content: space-between;
43
+ align-items: center;
44
+ transition: background-color 0.2s;
45
+ background: $hy-background--container;
46
+
47
+ @include pseudo(active) {
48
+ background-color: $hy-background--hover;
49
+ }
50
+ }
51
+
52
+ @include e(left) {
53
+ display: flex;
54
+ align-items: center;
55
+ flex: 1;
56
+ }
57
+
58
+ @include e(title) {
59
+ font-weight: 500;
60
+ flex: 1;
61
+ }
62
+
63
+ @include e(right) {
64
+ display: flex;
65
+ align-items: center;
66
+ }
67
+
68
+ @include e(value) {
69
+ font-size: 13px;
70
+ color: $hy-text-color--grey;
71
+ margin-right: 8px;
72
+ }
73
+
74
+ @include e(arrow) {
75
+ transition: transform 0.3s;
76
+
77
+ @include m(up) {
78
+ transform: rotate(180deg);
79
+ }
80
+ }
81
+
82
+ @include e(content) {
83
+ background-color: transparent;
84
+ transition: height 0.3s ease;
85
+ box-sizing: border-box;
86
+ }
87
+ }
@@ -0,0 +1,23 @@
1
+ // 折叠面板项组件的事件接口
2
+ export interface HyFoldingPanelItemEmits {
3
+ /**
4
+ * 点击面板时触发
5
+ */
6
+ (e: "click", index: number | string): void;
7
+ /**
8
+ * 面板打开时触发
9
+ */
10
+ (e: "open", index: number | string): void;
11
+ /**
12
+ * 面板关闭时触发
13
+ */
14
+ (e: "close", index: number | string): void;
15
+ /**
16
+ * 面板状态改变时触发
17
+ */
18
+ (e: "change", expanded: boolean, index: number | string): void;
19
+ /**
20
+ * 子项点击时通知父组件
21
+ */
22
+ (e: "child-click", index: number | string): void;
23
+ }
@@ -41,7 +41,7 @@ export default {
41
41
  import { getCurrentInstance, ref, watch, nextTick } from "vue";
42
42
  import type { IQrcodeEmits } from "./typing";
43
43
  import QRCode from "./qrcode.js";
44
- import { addUnit, error } from "../../libs";
44
+ import { addUnit, error, random } from "../../libs";
45
45
  // 组件
46
46
  import HyLoading from "../hy-loading/hy-loading.vue";
47
47
  import HyImage from "../hy-image/hy-image.vue";
@@ -57,7 +57,7 @@ const props = defineProps({
57
57
  /** 实例ID字符串(如果有多个二维码组件必须设置不一样的cid) */
58
58
  cid: {
59
59
  type: String,
60
- default: "hy-qrcode-canvas" + Math.random().toString(),
60
+ default: "hy-qrcode-canvas_" + random(1, 1000),
61
61
  },
62
62
  /** 二维码大小 */
63
63
  size: {
@@ -10,7 +10,7 @@
10
10
  class="hy-submit-bar__left--item"
11
11
  v-for="(item, i) in menus"
12
12
  :key="i"
13
- @tap="clickMenuFn(i)"
13
+ @tap="clickMenuFn(item, i)"
14
14
  >
15
15
  <HyIcon
16
16
  :name="item.icon"
@@ -84,7 +84,7 @@ export default {
84
84
  <script setup lang="ts">
85
85
  import { computed } from "vue";
86
86
  import type { CSSProperties, PropType } from "vue";
87
- import type { IconMenus, ISubmitBarEmits } from "./typing";
87
+ import type { SubmitBarIconMenus, ISubmitBarEmits } from "./typing";
88
88
  // 组件
89
89
  import HyIcon from "../hy-icon/hy-icon.vue";
90
90
  import HyLoading from "../hy-loading/hy-loading.vue";
@@ -100,7 +100,7 @@ defineOptions({});
100
100
  const props = defineProps({
101
101
  /** 左边菜单栏 */
102
102
  menus: {
103
- type: Array as unknown as PropType<IconMenus[]>,
103
+ type: Array as unknown as PropType<SubmitBarIconMenus[]>,
104
104
  default: [],
105
105
  },
106
106
  /** 绝对定位 */
@@ -251,8 +251,8 @@ const rightBtnStyle = computed(() => {
251
251
  /**
252
252
  * @description 点击左边图标
253
253
  * */
254
- const clickMenuFn = (i: number) => {
255
- emit("menuClick", i);
254
+ const clickMenuFn = (temp: SubmitBarIconMenus, index: number) => {
255
+ emit("menuClick", temp, index);
256
256
  };
257
257
 
258
258
  /**
@@ -1,95 +1,96 @@
1
- import type { CSSProperties } from 'vue'
2
- import type BadgeProps from '../hy-badge/props'
1
+ import type { CSSProperties } from "vue";
2
+ import type BadgeProps from "../hy-badge/props";
3
3
 
4
- export interface IconMenus {
4
+ export interface SubmitBarIconMenus {
5
5
  /**
6
6
  * @description icon图标
7
7
  * */
8
- icon: string
8
+ icon: string;
9
9
  /**
10
10
  * @description 文本
11
11
  * */
12
- text: string
12
+ text: string;
13
13
  /**
14
14
  * @description 徽标值
15
15
  * */
16
- badge?: BadgeProps['badge']
16
+ badge?: BadgeProps["badge"];
17
+ [key: string]: any;
17
18
  }
18
19
 
19
20
  export default interface HySubmitBarProps {
20
21
  /**
21
22
  * @description 左边菜单栏
22
23
  * */
23
- menus?: IconMenus[]
24
+ menus?: IconMenus[];
24
25
  /**
25
26
  * @description 绝对定位
26
27
  * */
27
- fixed?: boolean
28
+ fixed?: boolean;
28
29
  /**
29
30
  * @description 是否显示边框
30
31
  * */
31
- border?: boolean
32
+ border?: boolean;
32
33
  /**
33
34
  * @description 加载左边按钮loading
34
35
  * */
35
- leftLoading?: boolean
36
+ leftLoading?: boolean;
36
37
  /**
37
38
  * @description 加载右边按钮loading
38
39
  * */
39
- rightLoading?: boolean
40
+ rightLoading?: boolean;
40
41
  /**
41
42
  * @description 左边icon的颜色
42
43
  * */
43
- iconColor?: string
44
+ iconColor?: string;
44
45
  /**
45
46
  * @description 左边文字的颜色
46
47
  * */
47
- iconLabelColor?: string
48
+ iconLabelColor?: string;
48
49
  /**
49
50
  * @description 右边按钮文字颜色
50
51
  * */
51
- textColor?: string
52
+ textColor?: string;
52
53
  /**
53
54
  * @description 显示左边按钮
54
55
  * */
55
- showLeftBtn?: boolean
56
+ showLeftBtn?: boolean;
56
57
  /**
57
58
  * @description 显示右边按钮
58
59
  * */
59
- showRightBtn?: boolean
60
+ showRightBtn?: boolean;
60
61
  /**
61
62
  * @description 左边按钮文字
62
63
  * */
63
- leftBtnText?: string
64
+ leftBtnText?: string;
64
65
  /**
65
66
  * @description 右边按钮文字
66
67
  * */
67
- rightBtnText?: string
68
+ rightBtnText?: string;
68
69
  /**
69
70
  * @description 左边按钮颜色,支持渐变色
70
71
  * */
71
- leftBtnColor?: string
72
+ leftBtnColor?: string;
72
73
  /**
73
74
  * @description 有边按钮颜色,支持渐变色
74
75
  * */
75
- rightBtnColor?: string
76
+ rightBtnColor?: string;
76
77
  /**
77
78
  * @description 按钮的形状
78
79
  * */
79
- shape?: HyApp.ShapeType
80
+ shape?: HyApp.ShapeType;
80
81
  /**
81
82
  * @description 按钮点击等待时长(运用了节流方法)
82
83
  * */
83
- warn?: number
84
+ warn?: number;
84
85
  /**
85
86
  * @description 定义需要用到的外部样式
86
87
  * */
87
- customStyle?: CSSProperties
88
+ customStyle?: CSSProperties;
88
89
  }
89
90
 
90
91
  export interface ISubmitBarEmits {
91
92
  /** 点击按钮触发 */
92
- (e: 'click', index: number): void
93
+ (e: "click", index: number): void;
93
94
  /** 点击左侧小菜单图标触发 */
94
- (e: 'menuClick', index: number): void
95
+ (e: "menuClick", temp: SubmitBarIconMenus, index: number): void;
95
96
  }
package/global.d.ts CHANGED
@@ -18,6 +18,7 @@ declare module "vue" {
18
18
  HyConfigProvider: (typeof import("./components/hy-config-provider/hy-config-provider.vue"))["default"];
19
19
  HyCountDown: (typeof import("./components/hy-count-down/hy-count-down.vue"))["default"];
20
20
  HyCountTo: (typeof import("./components/hy-count-to/hy-count-to.vue"))["default"];
21
+ HyCoupon: (typeof import("./components/hy-coupon/hy-coupon.vue"))["default"];
21
22
  HyDatetimePicker: (typeof import("./components/hy-datetime-picker/hy-datetime-picker.vue"))["default"];
22
23
  HyDatetimePickerView: (typeof import("./components/hy-datetime-picker-view/hy-datetime-picker-view.vue"))["default"];
23
24
  HyDivider: (typeof import("./components/hy-divider/hy-divider.vue"))["default"];
@@ -27,6 +28,7 @@ declare module "vue" {
27
28
  HyFlex: (typeof import("./components/hy-flex/hy-flex.vue"))["default"];
28
29
  HyFloatButton: (typeof import("./components/hy-float-button/hy-float-button.vue"))["default"];
29
30
  HyFloatingPanel: (typeof import("./components/hy-floating-panel/hy-floating-panel.vue"))["default"];
31
+ HyFloatingPanelItem: (typeof import("./components/hy-floating-panel-item/hy-floating-panel-item.vue"))["default"];
30
32
  HyForm: (typeof import("@/package/components/hy-form-group/hy-form.vue"))["default"];
31
33
  HyFormItem: (typeof import("./components/hy-form-item/hy-form-item.vue"))["default"];
32
34
  HyFormGroup: (typeof import("./components/hy-form-group/hy-form-group.vue"))["default"];
@@ -39,7 +39,7 @@ $hy-text-color--hover: var(--hy-text-color--hover, #58595b)!default; // 点击
39
39
 
40
40
 
41
41
  /* 背景色 */
42
- $hy-background: var(--hy-background, #f8f8f8) !default; // 背景色
42
+ $hy-background: var(--hy-background, #f8f8f8) !default; // 页面背景色
43
43
  $hy-background--2: var(--hy-background--2, #ffffff) !default; // 弹窗背景色
44
44
  $hy-background--3: var(--hy-background--3, rgb(238, 238, 239)) !default; // 弹窗背景色
45
45
  $hy-background--container: var(--hy-background--container, #ffffff) !default; // 容器背景色
@@ -49,8 +49,8 @@ $hy-background--empty: var(--hy-background--empty, #F3F3F3) !default; // 搜索
49
49
  $hy-background--hover: var(--hy-background--hover, rgba(0,0,0,0.05)) !default; // 点击状态
50
50
  $hy-light-background-mask: var(--hy-light-background-mask, rgba(0, 0, 0, 0.5)); //遮罩颜色
51
51
  $hy-background--active: var(--hy-background--active, #FFFFFF); // 选中背景色
52
- $hy-background--close: var(--hy-background--close, #f0f0f0); // 选中背景色
53
- $hy-background--box: var(--hy-background--box, #FFFFFF); // 选中背景色
52
+ $hy-background--close: var(--hy-background--close, #f0f0f0); // 关闭背景色
53
+ $hy-background--box: var(--hy-background--box, #FFFFFF); // 盒子背景色
54
54
 
55
55
  /* 文字尺寸 */
56
56
  $hy-font-size-sm: 24rpx; // 提示文字大小
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hy-app",
3
- "version": "0.4.13",
4
- "description": "fix: 卡片副标题",
3
+ "version": "0.4.15",
4
+ "description": "fix: 折叠面板拆分实现",
5
5
  "main": "./index.ts",
6
6
  "private": false,
7
7
  "scripts": {},
@@ -1,9 +0,0 @@
1
- @use "../../libs/css/theme" as *;
2
- @use "../../libs/css/mixin.scss" as *;
3
-
4
- @include b(folding-panel) {
5
- @include e(main) {
6
- overflow: auto;
7
- transition: height 0.5s ease;
8
- }
9
- }
@@ -1,17 +0,0 @@
1
- import type IProps from "./typing";
2
- import { ColorConfig } from "../../libs";
3
-
4
- const defaultProps: IProps = {
5
- list: [],
6
- accordion: false,
7
- title: "",
8
- titleBorder: false,
9
- border: true,
10
- verticalColor: ColorConfig.primary,
11
- showVertical: true,
12
- disabled: false,
13
- size: "medium",
14
- contentHeight: 120,
15
- };
16
-
17
- export default defaultProps;