sard-uniapp 1.24.4 → 1.24.6

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 (89) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/components/accordion-item/index.scss +2 -2
  3. package/components/action-sheet/index.scss +4 -4
  4. package/components/avatar/README.md +60 -8
  5. package/components/avatar/avatar.d.ts +5 -1
  6. package/components/avatar/avatar.vue +42 -7
  7. package/components/avatar/common.d.ts +4 -0
  8. package/components/avatar/index.scss +21 -1
  9. package/components/avatar/variables.scss +5 -0
  10. package/components/avatar-group/avatar-group.d.ts +17 -0
  11. package/components/avatar-group/avatar-group.vue +75 -0
  12. package/components/avatar-group/common.d.ts +31 -0
  13. package/components/avatar-group/common.js +3 -0
  14. package/components/avatar-group/index.d.ts +1 -0
  15. package/components/avatar-group/index.js +1 -0
  16. package/components/avatar-group/index.scss +9 -0
  17. package/components/back-top/index.scss +1 -1
  18. package/components/badge/index.scss +1 -1
  19. package/components/button/index.scss +2 -2
  20. package/components/calendar-month/index.scss +3 -3
  21. package/components/card/index.scss +2 -2
  22. package/components/cascader/index.scss +1 -1
  23. package/components/check-icon/index.scss +1 -1
  24. package/components/checkbox-input/checkbox-input.vue +6 -2
  25. package/components/config/index.d.ts +4 -0
  26. package/components/config/index.js +4 -0
  27. package/components/count-down/common.js +1 -1
  28. package/components/crop-image/index.scss +1 -1
  29. package/components/dialog/index.scss +1 -1
  30. package/components/dropdown/index.scss +1 -1
  31. package/components/fab/index.scss +1 -0
  32. package/components/fab-item/index.scss +1 -1
  33. package/components/floating-bubble/index.scss +1 -1
  34. package/components/form/index.scss +1 -1
  35. package/components/grid-item/index.scss +2 -2
  36. package/components/indexes-anchor/index.scss +1 -1
  37. package/components/indexes-nav/index.scss +2 -2
  38. package/components/input/index.scss +2 -2
  39. package/components/keyboard/index.scss +5 -5
  40. package/components/list-item/index.scss +2 -2
  41. package/components/menu-item/index.scss +2 -2
  42. package/components/notice-bar/index.scss +3 -2
  43. package/components/overlay/index.scss +1 -1
  44. package/components/pagination/index.scss +2 -2
  45. package/components/pagination/pagination.d.ts +1 -1
  46. package/components/password-input/index.scss +6 -7
  47. package/components/picker/common.js +2 -1
  48. package/components/picker/picker.vue +11 -14
  49. package/components/picker-input/README.md +4 -0
  50. package/components/picker-input/picker-input.vue +2 -2
  51. package/components/picker-popout/README.md +4 -0
  52. package/components/picker-popout/picker-popout.vue +7 -7
  53. package/components/popout/index.scss +1 -1
  54. package/components/popout/popout.vue +50 -48
  55. package/components/popover/index.scss +3 -3
  56. package/components/progress-bar/index.scss +5 -5
  57. package/components/progress-circle/index.scss +1 -1
  58. package/components/scroll-list/index.scss +2 -2
  59. package/components/search/index.scss +3 -3
  60. package/components/segmented/index.scss +2 -2
  61. package/components/segmented-item/index.scss +1 -1
  62. package/components/share-sheet/index.scss +4 -4
  63. package/components/sidebar-item/index.scss +1 -1
  64. package/components/signature/index.scss +2 -2
  65. package/components/skeleton/index.scss +1 -1
  66. package/components/skeleton-block/index.scss +1 -1
  67. package/components/slider/index.scss +7 -7
  68. package/components/step/index.scss +3 -3
  69. package/components/stepper/index.scss +4 -4
  70. package/components/swiper-dot/index.scss +4 -4
  71. package/components/swiper-dot/swiper-dot.d.ts +1 -1
  72. package/components/switch/index.scss +3 -3
  73. package/components/tab/index.scss +3 -2
  74. package/components/tabbar/index.scss +1 -1
  75. package/components/table/index.scss +1 -1
  76. package/components/table-cell/index.scss +1 -1
  77. package/components/table-row/index.scss +1 -1
  78. package/components/tabs/index.scss +1 -1
  79. package/components/timeline-item/index.scss +2 -2
  80. package/components/toast/index.scss +1 -1
  81. package/components/tree/index.scss +1 -1
  82. package/components/tree-node/index.scss +3 -3
  83. package/components/upload/index.scss +2 -2
  84. package/components/upload-preview/index.scss +5 -5
  85. package/global.d.ts +1 -0
  86. package/index.d.ts +1 -0
  87. package/index.js +1 -0
  88. package/package.json +1 -1
  89. package/utils/dom.js +20 -12
package/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ ## [1.24.6](https://github.com/sutras/sard-uniapp/compare/v1.24.5...v1.24.6) (2025-09-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **picker:** 将空数组视为空值, 修复级联选择初始选择问题 ([2fd8d18](https://github.com/sutras/sard-uniapp/commit/2fd8d18e411a526dc65cb1c99826162bae3ba4c6))
7
+ * 修复getWindowInfo在支付宝端缺少safeAreaInsets的问题 ([cbd26d7](https://github.com/sutras/sard-uniapp/commit/cbd26d74074d9afe9299db92b9245de7cc46177a))
8
+
9
+
10
+
11
+ ## [1.24.5](https://github.com/sutras/sard-uniapp/compare/v1.24.4...v1.24.5) (2025-09-20)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **popout:** 修复popout类组件不显示按钮的问题 ([47bcea9](https://github.com/sutras/sard-uniapp/commit/47bcea986609b927a79d2bd917f907eda1757f82))
17
+ * **utils:** 修复 支付宝getWindowInfo没有safeAreaInsets属性的问题 ([3d64401](https://github.com/sutras/sard-uniapp/commit/3d64401aa9f71d468e9463160493c981a3caa323))
18
+ * 修复倒计时小时溢出的问题 ([823faa1](https://github.com/sutras/sard-uniapp/commit/823faa107517f91b1b630d70986a3e8b1206c39e))
19
+
20
+
21
+ ### Features
22
+
23
+ * 新增 avatar-group 组件 ([4954219](https://github.com/sutras/sard-uniapp/commit/4954219095bc3cff12d7de74c90af188b54a99fc))
24
+
25
+
26
+
1
27
  ## [1.24.4](https://github.com/sutras/sard-uniapp/compare/v1.24.3...v1.24.4) (2025-09-13)
2
28
 
3
29
 
@@ -3,7 +3,7 @@
3
3
  @include bem(accordion-item) {
4
4
  @include b() {
5
5
  @include universal;
6
- background-color: var(--sar-accordion-bg);
6
+ background: var(--sar-accordion-bg);
7
7
 
8
8
  &::before {
9
9
  @include border-top(var(--sar-accordion-border-color));
@@ -64,7 +64,7 @@
64
64
  @include m-not(disabled) {
65
65
  @include e(header) {
66
66
  &:active {
67
- background-color: var(--sar-accordion-active-bg);
67
+ background: var(--sar-accordion-active-bg);
68
68
  }
69
69
  }
70
70
  }
@@ -5,7 +5,7 @@
5
5
  padding-bottom: env(safe-area-inset-bottom);
6
6
  border-top-left-radius: var(--sar-action-sheet-border-radius);
7
7
  border-top-right-radius: var(--sar-action-sheet-border-radius);
8
- background-color: var(--sar-action-sheet-bg);
8
+ background: var(--sar-action-sheet-bg);
9
9
  touch-action: none;
10
10
  }
11
11
 
@@ -24,7 +24,7 @@
24
24
  @include e(gap) {
25
25
  @include universal;
26
26
  height: var(--sar-action-sheet-gap-height);
27
- background-color: var(--sar-action-sheet-gap-bg);
27
+ background: var(--sar-action-sheet-gap-bg);
28
28
  }
29
29
 
30
30
  @include e(content) {
@@ -55,7 +55,7 @@
55
55
 
56
56
  @include m-not(disabled, loading) {
57
57
  &:active {
58
- background-color: var(--sar-action-sheet-active-bg);
58
+ background: var(--sar-action-sheet-active-bg);
59
59
  }
60
60
  }
61
61
  }
@@ -88,7 +88,7 @@
88
88
  cursor: pointer;
89
89
 
90
90
  &:active {
91
- background-color: var(--sar-action-sheet-active-bg);
91
+ background: var(--sar-action-sheet-active-bg);
92
92
  }
93
93
  }
94
94
 
@@ -13,6 +13,7 @@ group: 数据展示
13
13
 
14
14
  ```ts
15
15
  import Avatar from 'sard-uniapp/components/avatar/avatar.vue'
16
+ import AvatarGroup from 'sard-uniapp/components/avatar-group/avatar-group.vue'
16
17
  ```
17
18
 
18
19
  ## 代码演示
@@ -59,18 +60,39 @@ import Avatar from 'sard-uniapp/components/avatar/avatar.vue'
59
60
 
60
61
  @code('${DEMO_PATH}/avatar/demo/Extra.vue')
61
62
 
63
+ ### 头像组 <sup>1.24.5+</sup>
64
+
65
+ 把一组 `Avatar` 组件放置在 `AvatarGroup` 组件里面,可形成层叠效果的头像组。
66
+
67
+ `AvatarGroup` 组件需传递 `total` 和 `max` 属性,以便计算省略的头像数。
68
+
69
+ @code('${DEMO_PATH}/avatar/demo/Group.vue')
70
+
71
+ ### 实际头像数不超过最大数 <sup>1.24.5+</sup>
72
+
73
+ 实际头像数不超过最大数时,会隐藏剩余数量显示。
74
+
75
+ @code('${DEMO_PATH}/avatar/demo/GroupLess.vue')
76
+
77
+ ### 覆盖面 <sup>1.24.5+</sup>
78
+
79
+ 使用 `coverage` 属性设置头像间的覆盖面,设置0时不覆盖,设置1时完全覆盖。
80
+
81
+ @code('${DEMO_PATH}/avatar/demo/GroupCoverage.vue')
82
+
62
83
  ## API
63
84
 
64
85
  ### AvatarProps
65
86
 
66
- | 属性 | 描述 | 类型 | 默认值 |
67
- | ---------- | ---------------------- | -------------------- | -------- |
68
- | root-class | 组件根元素类名 | string | - |
69
- | root-style | 组件根元素样式 | StyleValue | - |
70
- | shape | 头像形状 | 'circle' \| 'square' | 'circle' |
71
- | size | 头像尺寸 | string | - |
72
- | icon-size | 图标尺寸 | string | - |
73
- | src | 图片类型头像的图片地址 | string | - |
87
+ | 属性 | 描述 | 类型 | 默认值 |
88
+ | ------------------------ | -------------------------------------------- | -------------------- | -------- |
89
+ | root-class | 组件根元素类名 | string | - |
90
+ | root-style | 组件根元素样式 | StyleValue | - |
91
+ | shape | 头像形状 | 'circle' \| 'square' | 'circle' |
92
+ | size | 头像尺寸 | string | - |
93
+ | icon-size | 图标尺寸 | string | - |
94
+ | src | 图片类型头像的图片地址 | string | - |
95
+ | index <sup>1.24.5+</sup> | 位于头像组中时必传,当前头像在头像组中的下标 | number | - |
74
96
 
75
97
  ### AvatarSlots
76
98
 
@@ -79,6 +101,36 @@ import Avatar from 'sard-uniapp/components/avatar/avatar.vue'
79
101
  | default | 自定义默认内容 | - |
80
102
  | extra | 额外内容,常用于展示徽标 | - |
81
103
 
104
+ ### AvatarEmits
105
+
106
+ | 事件 | 描述 | 类型 |
107
+ | ------------------------ | ---------- | -------------------- |
108
+ | click <sup>1.24.5+</sup> | 点击时触发 | (event: any) => void |
109
+
110
+ ### AvatarGroupProps <sup>1.24.5+</sup>
111
+
112
+ | 属性 | 描述 | 类型 | 默认值 |
113
+ | ----------- | ------------------------ | ----------------- | ------ |
114
+ | root-class | 组件根元素类名 | string | - |
115
+ | root-style | 组件根元素样式 | StyleValue | - |
116
+ | max | 最大头像展示数量,必填 | number | - |
117
+ | total | 总的头像个数,必填 | number | - |
118
+ | coverage | 头像间的覆盖面 | number | 0.5 |
119
+ | show-remain | 是否显示剩余头像数量 | boolean | true |
120
+ | remain-text | 自定义剩余头像数量的内容 | string \| boolean | - |
121
+
122
+ ### AvatarGroupSlots <sup>1.24.5+</sup>
123
+
124
+ | 插槽 | 描述 | 属性 |
125
+ | ------- | -------------- | ---- |
126
+ | default | 自定义默认内容 | - |
127
+
128
+ ### AvatarGroupEmits <sup>1.24.5+</sup>
129
+
130
+ | 事件 | 描述 | 类型 |
131
+ | ------------------------------- | ------------------ | -------------------- |
132
+ | remain-click <sup>1.24.5+</sup> | 点击剩余数量时触发 | (event: any) => void |
133
+
82
134
  ## 主题定制
83
135
 
84
136
  ### CSS 变量
@@ -1,6 +1,10 @@
1
1
  import { type AvatarProps, type AvatarSlots } from './common';
2
2
  declare function __VLS_template(): Readonly<AvatarSlots> & AvatarSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<AvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{}>, {
3
+ declare const __VLS_component: import("vue").DefineComponent<AvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ click: (event: any) => any;
5
+ }, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{
6
+ onClick?: ((event: any) => any) | undefined;
7
+ }>, {
4
8
  shape: "circle" | "square";
5
9
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
10
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view :class="avatarClass" :style="avatarStyle">
2
+ <view :class="avatarClass" :style="avatarStyle" @click="onClick">
3
3
  <slot>
4
4
  <image
5
5
  v-if="src"
@@ -16,17 +16,30 @@
16
16
  />
17
17
  </slot>
18
18
  <slot name="extra"></slot>
19
+
20
+ <view
21
+ v-if="
22
+ context && context.showRemain && context.total > context.max && isLast
23
+ "
24
+ :class="remainClass"
25
+ @click="context.onRemainClick"
26
+ >
27
+ {{ context.remainText }}
28
+ </view>
19
29
  </view>
20
30
  </template>
21
31
 
22
32
  <script>
23
33
  import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
24
- import { computed } from "vue";
34
+ import { computed, inject } from "vue";
25
35
  import { classNames, stringifyStyle, createBem } from "../../utils";
26
36
  import SarIcon from "../icon/icon.vue";
27
37
  import {
28
38
  defaultAvatarProps
29
39
  } from "./common";
40
+ import {
41
+ avatarGroupContextSymbol
42
+ } from "../avatar-group/common";
30
43
  /**
31
44
  * @property {string} rootClass 组件根元素类名,默认值:-。
32
45
  * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
@@ -34,6 +47,8 @@ import {
34
47
  * @property {string} size 头像尺寸,默认值:-。
35
48
  * @property {string} iconSize 图标尺寸,默认值:-。
36
49
  * @property {string} src 图片类型头像的图片地址,默认值:-。
50
+ * @property {number} index 位于头像组中时必传,当前头像在头像组中的下标,默认值:-。
51
+ * @event {(event: any) => void} click 点击时触发
37
52
  */
38
53
  export default _defineComponent({
39
54
  components: {
@@ -54,14 +69,30 @@ export default _defineComponent({
54
69
  iconSize: { type: String, required: false },
55
70
  background: { type: String, required: false },
56
71
  color: { type: String, required: false },
57
- src: { type: String, required: false }
72
+ src: { type: String, required: false },
73
+ index: { type: Number, required: false }
58
74
  }, defaultAvatarProps),
59
- setup(__props, { expose: __expose }) {
75
+ emits: ["click"],
76
+ setup(__props, { expose: __expose, emit: __emit }) {
60
77
  __expose();
61
78
  const props = __props;
79
+ const emit = __emit;
62
80
  const bem = createBem("avatar");
81
+ const context = inject(
82
+ avatarGroupContextSymbol,
83
+ null
84
+ );
85
+ const isLast = computed(() => context && context.max - 1 === props.index);
86
+ const onClick = (event) => {
87
+ emit("click", event);
88
+ };
63
89
  const avatarClass = computed(() => {
64
- return classNames(bem.b(), bem.m(props.shape), props.rootClass);
90
+ return classNames(
91
+ bem.b(),
92
+ bem.m(props.shape),
93
+ bem.m("in-group", !!context),
94
+ props.rootClass
95
+ );
65
96
  });
66
97
  const avatarStyle = computed(() => {
67
98
  return stringifyStyle(
@@ -70,12 +101,16 @@ export default _defineComponent({
70
101
  height: props.size,
71
102
  color: props.color,
72
103
  fontSize: props.iconSize,
73
- background: props.background
104
+ background: props.background,
105
+ marginLeft: context && props.index !== 0 ? `calc(${props.size ? props.size : `var(--sar-avatar-width)`} * ${-context.coverage})` : void 0
74
106
  },
75
107
  props.rootStyle
76
108
  );
77
109
  });
78
- const __returned__ = { props, bem, avatarClass, avatarStyle, get classNames() {
110
+ const remainClass = computed(() => {
111
+ return classNames(bem.e("remain"));
112
+ });
113
+ const __returned__ = { props, emit, bem, context, isLast, onClick, avatarClass, avatarStyle, remainClass, get classNames() {
79
114
  return classNames;
80
115
  }, SarIcon };
81
116
  return __returned__;
@@ -8,6 +8,7 @@ export interface AvatarProps {
8
8
  background?: string;
9
9
  color?: string;
10
10
  src?: string;
11
+ index?: number;
11
12
  }
12
13
  export declare const defaultAvatarProps: {
13
14
  shape: AvatarProps["shape"];
@@ -16,3 +17,6 @@ export interface AvatarSlots {
16
17
  default?(props: Record<string, never>): any;
17
18
  extra?(props: Record<string, never>): any;
18
19
  }
20
+ export interface AvatarEmits {
21
+ (e: 'click', event: any): void;
22
+ }
@@ -10,7 +10,8 @@
10
10
  width: var(--sar-avatar-width);
11
11
  height: var(--sar-avatar-height);
12
12
  font-size: var(--sar-avatar-font-size);
13
- background-color: var(--sar-avatar-bg);
13
+ background: var(--sar-avatar-bg);
14
+ border: 1px solid transparent;
14
15
  }
15
16
 
16
17
  @include e(image) {
@@ -26,4 +27,23 @@
26
27
  @include m(square) {
27
28
  border-radius: var(--sar-avatar-square-border-radius);
28
29
  }
30
+
31
+ @include m(in-group) {
32
+ border-color: var(--sar-avatar-border-color);
33
+ }
34
+
35
+ @include e('remain') {
36
+ @include universal;
37
+ justify-content: center;
38
+ align-items: center;
39
+ position: absolute;
40
+ top: 0;
41
+ left: 0;
42
+ width: 100%;
43
+ height: 100%;
44
+ font-size: var(--sar-avatar-remain-font-size);
45
+ color: var(--sar-avatar-remain-color);
46
+ background: var(--sar-avatar-remain-bg);
47
+ border-radius: inherit;
48
+ }
29
49
  }
@@ -5,7 +5,12 @@ page,
5
5
  --sar-avatar-height: 128rpx;
6
6
  --sar-avatar-font-size: 64rpx;
7
7
  --sar-avatar-bg: var(--sar-secondary-bg);
8
+ --sar-avatar-border-color: var(--sar-emphasis-bg);
8
9
 
9
10
  --sar-avatar-square-border-radius: var(--sar-rounded);
11
+
12
+ --sar-avatar-remain-bg: var(--sar-mask);
13
+ --sar-avatar-remain-color: var(--sar-white);
14
+ --sar-avatar-remain-font-size: var(--sar-text-base);
10
15
  }
11
16
  // #endvariables
@@ -0,0 +1,17 @@
1
+ import { type AvatarGroupProps, type AvatarGroupSlots } from './common';
2
+ declare function __VLS_template(): Readonly<AvatarGroupSlots> & AvatarGroupSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<AvatarGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ "remain-click": (event: any) => any;
5
+ }, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{
6
+ "onRemain-click"?: ((event: any) => any) | undefined;
7
+ }>, {
8
+ showRemain: boolean;
9
+ coverage: number;
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <view :class="avatarGroupClass" :style="avatarGroupStyle">
3
+ <slot></slot>
4
+ </view>
5
+ </template>
6
+
7
+ <script>
8
+ import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
9
+ import { computed, provide, reactive, toRef } from "vue";
10
+ import { classNames, stringifyStyle, createBem } from "../../utils";
11
+ import {
12
+ defaultAvatarGroupProps,
13
+ avatarGroupContextSymbol
14
+ } from "./common";
15
+ /**
16
+ * @property {string} rootClass 组件根元素类名,默认值:-。
17
+ * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
18
+ * @property {number} max 最大头像展示数量,必填,默认值:-。
19
+ * @property {number} total 总的头像个数,必填,默认值:-。
20
+ * @property {number} coverage 头像间的覆盖面,默认值:0.5。
21
+ * @property {boolean} showRemain 是否显示剩余头像数量,默认值:true。
22
+ * @property {string | boolean} remainText 自定义剩余头像数量的内容,默认值:-。
23
+ * @event {(event: any) => void} remain-click 点击剩余数量时触发
24
+ */
25
+ export default _defineComponent({
26
+ ...{
27
+ options: {
28
+ virtualHost: true,
29
+ styleIsolation: "shared"
30
+ }
31
+ },
32
+ __name: "avatar-group",
33
+ props: _mergeDefaults({
34
+ rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
35
+ rootClass: { type: String, required: false },
36
+ max: { type: Number, required: true },
37
+ total: { type: Number, required: true },
38
+ coverage: { type: Number, required: false },
39
+ showRemain: { type: Boolean, required: false },
40
+ remainText: { type: [String, Number], required: false }
41
+ }, defaultAvatarGroupProps),
42
+ emits: ["remain-click"],
43
+ setup(__props, { expose: __expose, emit: __emit }) {
44
+ const props = __props;
45
+ const emit = __emit;
46
+ const bem = createBem("avatar-group");
47
+ provide(
48
+ avatarGroupContextSymbol,
49
+ reactive({
50
+ total: toRef(() => props.total),
51
+ max: toRef(() => props.max),
52
+ showRemain: toRef(() => props.showRemain),
53
+ coverage: toRef(() => props.coverage),
54
+ remainText: toRef(() => props.remainText ?? `+${props.total - props.max}`),
55
+ onRemainClick: (event) => {
56
+ emit("remain-click", event);
57
+ }
58
+ })
59
+ );
60
+ __expose({});
61
+ const avatarGroupClass = computed(() => {
62
+ return classNames(bem.b(), props.rootClass);
63
+ });
64
+ const avatarGroupStyle = computed(() => {
65
+ return stringifyStyle(props.rootStyle);
66
+ });
67
+ const __returned__ = { props, emit, bem, avatarGroupClass, avatarGroupStyle };
68
+ return __returned__;
69
+ }
70
+ });
71
+ </script>
72
+
73
+ <style lang="scss">
74
+ @import './index.scss';
75
+ </style>
@@ -0,0 +1,31 @@
1
+ import { type StyleValue } from 'vue';
2
+ export interface AvatarGroupProps {
3
+ rootStyle?: StyleValue;
4
+ rootClass?: string;
5
+ max: number;
6
+ total: number;
7
+ coverage?: number;
8
+ showRemain?: boolean;
9
+ remainText?: string | number;
10
+ }
11
+ export declare const defaultAvatarGroupProps: {
12
+ coverage: number;
13
+ showRemain: boolean;
14
+ };
15
+ export interface AvatarGroupSlots {
16
+ default?(props: Record<string, never>): any;
17
+ }
18
+ export interface AvatarGroupEmits {
19
+ (e: 'remain-click', event: any): void;
20
+ }
21
+ export interface AvatarGroupExpose {
22
+ }
23
+ export interface AvatarGroupContext {
24
+ total: number;
25
+ max: number;
26
+ showRemain: boolean;
27
+ remainText?: string | number;
28
+ coverage: number;
29
+ onRemainClick: (event: any) => void;
30
+ }
31
+ export declare const avatarGroupContextSymbol: unique symbol;
@@ -0,0 +1,3 @@
1
+ import { defaultConfig } from '../config';
2
+ export const defaultAvatarGroupProps = defaultConfig.avatarGroup;
3
+ export const avatarGroupContextSymbol = Symbol('avatar-group-context');
@@ -0,0 +1 @@
1
+ export type { AvatarGroupProps, AvatarGroupSlots, AvatarGroupEmits, AvatarGroupExpose, } from './common';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ @use '../style/base' as *;
2
+
3
+ @include bem(avatar-group) {
4
+ @include b() {
5
+ @include universal;
6
+ flex-direction: row;
7
+ align-items: center;
8
+ }
9
+ }
@@ -15,7 +15,7 @@
15
15
  border-radius: var(--sar-back-top-border-radius);
16
16
  font-size: var(--sar-back-top-font-size);
17
17
  color: var(--sar-back-top-color);
18
- background-color: var(--sar-back-top-bg);
18
+ background: var(--sar-back-top-bg);
19
19
  box-shadow: var(--sar-back-top-box-shadow);
20
20
  cursor: pointer;
21
21
  pointer-events: none;
@@ -17,7 +17,7 @@
17
17
  border: 1px solid var(--sar-badge-border-color);
18
18
  border-radius: var(--sar-rounded-full);
19
19
  color: var(--sar-badge-color);
20
- background-color: var(--sar-badge-bg);
20
+ background: var(--sar-badge-bg);
21
21
 
22
22
  @include m(fixed) {
23
23
  position: absolute;
@@ -43,7 +43,7 @@
43
43
  height: 100%;
44
44
  border-radius: inherit;
45
45
  opacity: 0;
46
- background-color: var(--sar-button-active-bg);
46
+ background: var(--sar-button-active-bg);
47
47
  pointer-events: none;
48
48
  }
49
49
 
@@ -152,7 +152,7 @@
152
152
  @include m(mild-#{$theme}) {
153
153
  @include button-set-theme {
154
154
  color: $color;
155
- background-color: var(--sar-button-mild-bg);
155
+ background: var(--sar-button-mild-bg);
156
156
  }
157
157
  }
158
158
 
@@ -66,12 +66,12 @@
66
66
  @include m(selected, same) {
67
67
  border-radius: var(--sar-calendar-day-border-radius);
68
68
  color: var(--sar-calendar-day-selected-color);
69
- background-color: var(--sar-calendar-day-selected-bg);
69
+ background: var(--sar-calendar-day-selected-bg);
70
70
  }
71
71
 
72
72
  @include m(start, end) {
73
73
  color: var(--sar-calendar-day-selected-color);
74
- background-color: var(--sar-calendar-day-selected-bg);
74
+ background: var(--sar-calendar-day-selected-bg);
75
75
  }
76
76
 
77
77
  @include m(start) {
@@ -86,7 +86,7 @@
86
86
 
87
87
  @include m(middle) {
88
88
  color: var(--sar-calendar-day-middle-color);
89
- background-color: var(--sar-calendar-day-middle-bg);
89
+ background: var(--sar-calendar-day-middle-bg);
90
90
  }
91
91
  }
92
92
 
@@ -3,14 +3,14 @@
3
3
  @include bem(card) {
4
4
  @include b() {
5
5
  @include universal;
6
- background-color: var(--sar-card-bg);
6
+ background: var(--sar-card-bg);
7
7
  border-radius: var(--sar-card-border-radius);
8
8
 
9
9
  @include m(hover) {
10
10
  cursor: pointer;
11
11
 
12
12
  &:active {
13
- background-color: var(--sar-card-active-bg);
13
+ background: var(--sar-card-active-bg);
14
14
  }
15
15
  }
16
16
  }
@@ -57,7 +57,7 @@
57
57
 
58
58
  @include m-not(disabled) {
59
59
  &:active {
60
- background-color: var(--sar-cascader-option-active-bg);
60
+ background: var(--sar-cascader-option-active-bg);
61
61
  }
62
62
  }
63
63
  }
@@ -23,7 +23,7 @@
23
23
 
24
24
  @include m(disabled) {
25
25
  color: var(--sar-check-icon-disabled-color);
26
- background-color: var(--sar-check-icon-disabled-bg);
26
+ background: var(--sar-check-icon-disabled-bg);
27
27
  border-color: var(--sar-check-icon-disabled-border-color);
28
28
  }
29
29
  }
@@ -53,7 +53,11 @@ import {
53
53
  import {
54
54
  defaultCheckboxInputProps
55
55
  } from "./common";
56
- import { getMayPrimitiveOption, isEmptyBinding } from "../../utils";
56
+ import {
57
+ getMayPrimitiveOption,
58
+ isEmptyArray,
59
+ isEmptyBinding
60
+ } from "../../utils";
57
61
  import { usePopoutInput } from "../../use";
58
62
  /**
59
63
  * @property {string} rootClass 弹出式输入框根元素类名,默认值:-。
@@ -162,7 +166,7 @@ export default _defineComponent({
162
166
  ).map((option) => getMayPrimitiveOption(option, optionKeys.label)).join(", ");
163
167
  }
164
168
  function getInputValue() {
165
- if (isEmptyBinding(innerValue.value) || Array.isArray(innerValue.value) && innerValue.value.length === 0) {
169
+ if (isEmptyBinding(innerValue.value) || isEmptyArray(innerValue.value)) {
166
170
  return "";
167
171
  }
168
172
  return getOutletText(props.options, fieldKeys.value, innerValue.value);
@@ -80,6 +80,10 @@ export declare const defaultConfig: {
80
80
  avatar: {
81
81
  shape: AvatarProps["shape"];
82
82
  };
83
+ avatarGroup: {
84
+ coverage: number;
85
+ showRemain: boolean;
86
+ };
83
87
  backTop: {
84
88
  visibleHeight: number;
85
89
  };
@@ -29,6 +29,10 @@ export const defaultConfig = {
29
29
  avatar: {
30
30
  shape: 'circle',
31
31
  },
32
+ avatarGroup: {
33
+ coverage: 0.5,
34
+ showRemain: true,
35
+ },
32
36
  backTop: {
33
37
  visibleHeight: 200,
34
38
  },
@@ -5,7 +5,7 @@ export function getCurrentTime(remainTime) {
5
5
  milliseconds: remainTime % 1000,
6
6
  seconds: ~~(remainTime / 1000) % 60,
7
7
  minutes: ~~(remainTime / 1000 / 60) % 60,
8
- hours: ~~(remainTime / 1000 / 60 / 60) % 60,
8
+ hours: ~~(remainTime / 1000 / 60 / 60) % 24,
9
9
  days: ~~(remainTime / 1000 / 60 / 60 / 24),
10
10
  total: remainTime,
11
11
  };