sard-uniapp 1.23.5 → 1.24.1

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 (101) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +2 -2
  3. package/components/calendar-input/calendar-input.vue +1 -0
  4. package/components/card/README.md +7 -0
  5. package/components/card/card.vue +17 -8
  6. package/components/card/common.d.ts +1 -0
  7. package/components/card/index.scss +1 -1
  8. package/components/cascader-input/cascader-input.vue +1 -0
  9. package/components/checkbox-input/checkbox-input.d.ts +1 -0
  10. package/components/checkbox-input/checkbox-input.vue +4 -0
  11. package/components/checkbox-input/common.d.ts +1 -0
  12. package/components/checkbox-popout/README.md +11 -10
  13. package/components/checkbox-popout/checkbox-popout.d.ts +1 -0
  14. package/components/checkbox-popout/checkbox-popout.vue +11 -1
  15. package/components/checkbox-popout/common.d.ts +2 -0
  16. package/components/config/index.d.ts +24 -0
  17. package/components/config/index.js +21 -1
  18. package/components/cool-icon/README.md +81 -0
  19. package/components/cool-icon/common.d.ts +21 -0
  20. package/components/cool-icon/common.js +2 -0
  21. package/components/cool-icon/cool-icon.d.ts +16 -0
  22. package/components/cool-icon/cool-icon.vue +86 -0
  23. package/components/cool-icon/index.d.ts +1 -0
  24. package/components/cool-icon/index.js +1 -0
  25. package/components/cool-icon/index.scss +186 -0
  26. package/components/cool-icon/variables.scss +12 -0
  27. package/components/datetime-picker-input/datetime-picker-input.vue +1 -0
  28. package/components/datetime-range-picker-input/datetime-range-picker-input.vue +1 -0
  29. package/components/form/README.md +38 -36
  30. package/components/form/common.d.ts +3 -0
  31. package/components/form/form.d.ts +1 -0
  32. package/components/form/form.vue +2 -0
  33. package/components/form/useForm.js +1 -0
  34. package/components/form-item/form-item.vue +12 -3
  35. package/components/form-item/index.scss +4 -2
  36. package/components/form-item/useFormItem.d.ts +1 -0
  37. package/components/form-item/useFormItem.js +2 -0
  38. package/components/form-item-plain/form-item-plain.vue +2 -0
  39. package/components/form-plain/form-plain.d.ts +1 -0
  40. package/components/form-plain/form-plain.vue +2 -0
  41. package/components/input/README.md +48 -47
  42. package/components/input/input.vue +1 -0
  43. package/components/keyboard/README.md +16 -14
  44. package/components/keyboard/common.d.ts +4 -1
  45. package/components/keyboard/index.d.ts +1 -1
  46. package/components/keyboard/keyboard.d.ts +4 -1
  47. package/components/keyboard/keyboard.vue +24 -14
  48. package/components/locale/lang/ar-SA.d.ts +124 -0
  49. package/components/locale/lang/ar-SA.js +124 -0
  50. package/components/popout-input/index.scss +5 -0
  51. package/components/popout-input/popout-input.vue +11 -2
  52. package/components/popout-input/variables.scss +1 -0
  53. package/components/radio-input/common.d.ts +1 -0
  54. package/components/radio-input/radio-input.d.ts +1 -0
  55. package/components/radio-input/radio-input.vue +4 -0
  56. package/components/radio-popout/README.md +10 -9
  57. package/components/radio-popout/common.d.ts +2 -0
  58. package/components/radio-popout/radio-popout.d.ts +1 -0
  59. package/components/radio-popout/radio-popout.vue +10 -1
  60. package/components/rate/index.scss +2 -3
  61. package/components/segmented/README.md +147 -0
  62. package/components/segmented/common.d.ts +52 -0
  63. package/components/segmented/common.js +8 -0
  64. package/components/segmented/index.d.ts +1 -0
  65. package/components/segmented/index.js +1 -0
  66. package/components/segmented/index.scss +60 -0
  67. package/components/segmented/segmented.d.ts +21 -0
  68. package/components/segmented/segmented.vue +163 -0
  69. package/components/segmented/variables.scss +21 -0
  70. package/components/segmented-item/common.d.ts +21 -0
  71. package/components/segmented-item/common.js +1 -0
  72. package/components/segmented-item/index.d.ts +1 -0
  73. package/components/segmented-item/index.js +1 -0
  74. package/components/segmented-item/index.scss +60 -0
  75. package/components/segmented-item/segmented-item.d.ts +14 -0
  76. package/components/segmented-item/segmented-item.vue +99 -0
  77. package/components/stepper/index.scss +2 -3
  78. package/components/sticky/README.md +4 -0
  79. package/components/switch/index.scss +8 -4
  80. package/components/tree/README.md +6 -4
  81. package/components/tree/common.d.ts +10 -1
  82. package/components/tree/tree.d.ts +16 -0
  83. package/components/tree/tree.vue +21 -4
  84. package/components/tree-node/tree-node.vue +3 -2
  85. package/components/watermark/README.md +74 -0
  86. package/components/watermark/common.d.ts +37 -0
  87. package/components/watermark/common.js +10 -0
  88. package/components/watermark/index.d.ts +1 -0
  89. package/components/watermark/index.js +1 -0
  90. package/components/watermark/index.scss +28 -0
  91. package/components/watermark/variables.scss +5 -0
  92. package/components/watermark/watermark.d.ts +16 -0
  93. package/components/watermark/watermark.vue +263 -0
  94. package/global.d.ts +4 -0
  95. package/index.d.ts +4 -0
  96. package/index.js +4 -0
  97. package/index.scss +3 -0
  98. package/package.json +3 -2
  99. package/utils/geometry.d.ts +11 -0
  100. package/utils/geometry.js +28 -0
  101. package/components/upload-preview/play.png +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,43 @@
1
+ ## [1.24.1](https://github.com/sutras/sard-uniapp/compare/v1.24.0...v1.24.1) (2025-08-31)
2
+
3
+
4
+ ### Features
5
+
6
+ * **form:** 新增content-position属性 ([b588249](https://github.com/sutras/sard-uniapp/commit/b5882493653491d6a03f0b04f898b6b9c31a06c5))
7
+ * **keyboard:** 为车牌键盘模式添加双向绑定支持 ([740f7bf](https://github.com/sutras/sard-uniapp/commit/740f7bf074658d845d49ad5582663af639757260))
8
+ * **tree:** 新增node-click事件 ([a70e5d7](https://github.com/sutras/sard-uniapp/commit/a70e5d786305e580cbac7eb8c897ed79cff54059))
9
+ * 新增checkbox-popout和radio-popout新增icon-position属性 ([32f458a](https://github.com/sutras/sard-uniapp/commit/32f458aa46ceebdb4ed46f51733f3749e60461a0))
10
+ * 新增阿拉伯语支持 ([b0b2c60](https://github.com/sutras/sard-uniapp/commit/b0b2c6050bad21f476e767659c8ac6802bfcadb6))
11
+
12
+
13
+
14
+ # [1.24.0](https://github.com/sutras/sard-uniapp/compare/v1.23.5...v1.24.0) (2025-08-24)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * *-input 类组件允许修改输入框箭头图标 ([2d2a719](https://github.com/sutras/sard-uniapp/commit/2d2a7199fcdf9cd9760a151edae8c28bb39c6f8a))
20
+ * **cascader-input:** 修复arrow属性失效; ([5b67a7a](https://github.com/sutras/sard-uniapp/commit/5b67a7a631abb04f86de28507d4195268338a0e1))
21
+ * **datetime-picker-input:** 修复arrow属性失效; ([f530c73](https://github.com/sutras/sard-uniapp/commit/f530c7384f78ed14e1af7f2fc5978fdcf26be17e))
22
+
23
+
24
+ ### Features
25
+
26
+ * card 组件新增 collapsed 属性 ([9e6ec3b](https://github.com/sutras/sard-uniapp/commit/9e6ec3bd5e9b7a7e9834d7c1cdd69d0f0b8efaac))
27
+ * **keyboard:** 扩展键盘toggle方法支持传入mode参数 ([25c6767](https://github.com/sutras/sard-uniapp/commit/25c67671fc35dd349380c80e83eb1d26dc582ad5))
28
+ * **keyboard:** 添加键盘模式配置支持 ([e1dda90](https://github.com/sutras/sard-uniapp/commit/e1dda90788460c3c3b7af9f7c82d9c7a704fa910))
29
+ * tree 组件新增 check 事件 ([4985f46](https://github.com/sutras/sard-uniapp/commit/4985f4629029744cd6298b37d04a40235379fb89))
30
+ * 新增 cool-icon 组件 ([ba51ef1](https://github.com/sutras/sard-uniapp/commit/ba51ef12a312a7cde65d629170f8c9da2394cebb))
31
+ * 新增 segmented 组件 ([f70464a](https://github.com/sutras/sard-uniapp/commit/f70464aa3bbef71ed44be967995c210f64d1a536))
32
+ * 新增 watermark 组件 ([ce36afd](https://github.com/sutras/sard-uniapp/commit/ce36afd833dbc4eba4a06741faea3ba47dc704fd))
33
+
34
+
35
+ ### Performance Improvements
36
+
37
+ * 压缩图片 ([8cd341f](https://github.com/sutras/sard-uniapp/commit/8cd341f601449bb8ab8d2b0c65da1faedbe3373f))
38
+
39
+
40
+
1
41
  ## [1.23.5](https://github.com/sutras/sard-uniapp/compare/v1.23.4...v1.23.5) (2025-08-12)
2
42
 
3
43
 
package/README.md CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  ## 特性
27
27
 
28
- - 🧩 96+个高质量组件,覆盖移动端主流场景
28
+ - 🧩 101+个高质量组件,覆盖移动端主流场景
29
29
  - 💪 支持一套代码同时开发 H5 / 小程序 / App
30
30
  - 🌿 支持按需引入和 `Tree Shaking`
31
31
  - 📖 详尽的文档和案例展示
@@ -137,7 +137,7 @@ npm run release
137
137
 
138
138
  - 运行 `npm run nc` 命令创建组件
139
139
  - 运行 `npm run nsc` 命令创建子组件
140
- - 编写组件代码
140
+ - 编写组件代码(接口、类型、结构、样式、交互)
141
141
  - 编写案例代码
142
142
  - 编写组件文档
143
143
  - 编写测试用例
@@ -7,6 +7,7 @@
7
7
  :clearable="clearable"
8
8
  :root-class="rootClass"
9
9
  :root-style="rootStyle"
10
+ :arrow="arrow"
10
11
  :internal-arrow="$slots.arrow ? 1 : 0"
11
12
  :input-props="inputProps"
12
13
  @clear="onClear"
@@ -53,6 +53,12 @@ import Card from 'sard-uniapp/components/card/card.vue'
53
53
 
54
54
  @code('${DEMO_PATH}/card/demo/Style.vue')
55
55
 
56
+ ### 折叠 <sup>1.24+</sup>
57
+
58
+ 可使用 `collapsed` 属性设置卡片折叠,折叠时将隐藏主体和底部,只显示头部。
59
+
60
+ @code('${DEMO_PATH}/card/demo/Collapsed.vue')
61
+
56
62
  ## API
57
63
 
58
64
  ### CardProps
@@ -67,6 +73,7 @@ import Card from 'sard-uniapp/components/card/card.vue'
67
73
  | hover <sup>1.12.3+</sup> | 是否开启点击反馈 | boolean | false |
68
74
  | hide-header-border <sup>1.20+</sup> | 是否隐藏头部边框 | boolean | false |
69
75
  | hide-footer-border <sup>1.20+</sup> | 是否隐藏底部边框 | boolean | false |
76
+ | collapsed <sup>1.24+</sup> | 是否折叠 | boolean | false |
70
77
 
71
78
  ### CardSlots
72
79
 
@@ -8,12 +8,14 @@
8
8
  <slot name="extra">{{ extra }}</slot>
9
9
  </view>
10
10
  </view>
11
- <view :class="bem.e('body')">
12
- <slot></slot>
13
- </view>
14
- <view v-if="!footless" :class="bem.e('footer')">
15
- <slot name="footer">{{ footer }}</slot>
16
- </view>
11
+ <sar-collapse :visible="!collapsed">
12
+ <view :class="bem.e('body')">
13
+ <slot></slot>
14
+ </view>
15
+ <view v-if="!footless" :class="bem.e('footer')">
16
+ <slot name="footer">{{ footer }}</slot>
17
+ </view>
18
+ </sar-collapse>
17
19
  </view>
18
20
  </template>
19
21
 
@@ -26,6 +28,7 @@ import {
26
28
  createBem,
27
29
  isVisibleEmpty
28
30
  } from "../../utils";
31
+ import SarCollapse from "../collapse/collapse.vue";
29
32
  /**
30
33
  * @property {string} rootClass 组件根元素类名,默认值:-。
31
34
  * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
@@ -35,9 +38,13 @@ import {
35
38
  * @property {boolean} hover 是否开启点击反馈,默认值:false。
36
39
  * @property {boolean} hideHeaderBorder 是否隐藏头部边框,默认值:false。
37
40
  * @property {boolean} hideFooterBorder 是否隐藏底部边框,默认值:false。
41
+ * @property {boolean} collapsed 是否折叠,默认值:false。
38
42
  * @event {(event: any) => void} click 点击卡片时触发
39
43
  */
40
44
  export default _defineComponent({
45
+ components: {
46
+ SarCollapse,
47
+ },
41
48
  ...{
42
49
  options: {
43
50
  virtualHost: true,
@@ -53,7 +60,8 @@ export default _defineComponent({
53
60
  footer: { type: String, required: false },
54
61
  hover: { type: Boolean, required: false },
55
62
  hideHeaderBorder: { type: Boolean, required: false },
56
- hideFooterBorder: { type: Boolean, required: false }
63
+ hideFooterBorder: { type: Boolean, required: false },
64
+ collapsed: { type: Boolean, required: false }
57
65
  },
58
66
  emits: ["click"],
59
67
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -79,13 +87,14 @@ export default _defineComponent({
79
87
  bem.m("footless", footless.value),
80
88
  bem.m("head-borderless", props.hideHeaderBorder),
81
89
  bem.m("foot-borderless", props.hideFooterBorder),
90
+ bem.m("collapsed", props.collapsed),
82
91
  props.rootClass
83
92
  );
84
93
  });
85
94
  const cardStyle = computed(() => {
86
95
  return stringifyStyle(props.rootStyle);
87
96
  });
88
- const __returned__ = { props, slots, emit, bem, headless, footless, onClick, cardClass, cardStyle };
97
+ const __returned__ = { props, slots, emit, bem, headless, footless, onClick, cardClass, cardStyle, SarCollapse };
89
98
  return __returned__;
90
99
  }
91
100
  });
@@ -8,6 +8,7 @@ export interface CardProps {
8
8
  hover?: boolean;
9
9
  hideHeaderBorder?: boolean;
10
10
  hideFooterBorder?: boolean;
11
+ collapsed?: boolean;
11
12
  }
12
13
  export interface CardSlots {
13
14
  default?(props: Record<string, never>): any;
@@ -63,7 +63,7 @@
63
63
  }
64
64
  }
65
65
 
66
- @include m(head-borderless) {
66
+ @include m(head-borderless, collapsed) {
67
67
  @include e(header) {
68
68
  &::after {
69
69
  display: none;
@@ -8,6 +8,7 @@
8
8
  :loading="loading"
9
9
  :root-class="rootClass"
10
10
  :root-style="rootStyle"
11
+ :arrow="arrow"
11
12
  :internal-arrow="$slots.arrow ? 1 : 0"
12
13
  :input-props="inputProps"
13
14
  @clear="onClear"
@@ -9,6 +9,7 @@ declare const __VLS_component: import("vue").DefineComponent<CheckboxInputProps,
9
9
  }>, {
10
10
  options: import("../checkbox/common").CheckboxGroupOption[];
11
11
  valueOnClear: () => any;
12
+ iconPosition: "left" | "right";
12
13
  validateEvent: boolean;
13
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
15
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -8,6 +8,7 @@
8
8
  multiline
9
9
  :root-class="rootClass"
10
10
  :root-style="rootStyle"
11
+ :arrow="arrow"
11
12
  :internal-arrow="$slots.arrow ? 1 : 0"
12
13
  :input-props="inputProps"
13
14
  @clear="onClear"
@@ -33,6 +34,7 @@
33
34
  :searchable="searchable"
34
35
  :filter-placeholder="filterPlaceholder"
35
36
  :resettable="resettable"
37
+ :icon-position="iconPosition"
36
38
  @change="onChange"
37
39
  @visible-hook="onVisibleHook"
38
40
  @confirm="onConfirm"
@@ -73,6 +75,7 @@ import { usePopoutInput } from "../../use";
73
75
  * @property {boolean} searchable 是否可搜索,默认值:false。
74
76
  * @property {string} filterPlaceholder 搜索输入框占位符内容,默认值:-。
75
77
  * @property {boolean} resettable 关闭弹出框后,是否可复位弹出框值,默认值:false。
78
+ * @property {'left' | 'right'} iconPosition 可定义复选框的位置,默认值:'left'。
76
79
  * @property {boolean} clearable 是否显示清空按钮,默认值:false。
77
80
  * @property {string} placeholder 输入框占位符内容,默认值:-。
78
81
  * @property {() => any} valueOnClear 设置点击清除按钮后的值,默认值:() => undefined。
@@ -114,6 +117,7 @@ export default _defineComponent({
114
117
  searchable: { type: Boolean, required: false },
115
118
  filterPlaceholder: { type: String, required: false },
116
119
  resettable: { type: Boolean, required: false },
120
+ iconPosition: { type: String, required: false },
117
121
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
118
122
  rootClass: { type: String, required: false },
119
123
  modelValue: { type: Array, required: false },
@@ -9,6 +9,7 @@ export declare const defaultCheckboxInputProps: () => {
9
9
  valueOnClear: CheckboxInputProps["valueOnClear"];
10
10
  options: () => never[];
11
11
  validateEvent: boolean;
12
+ iconPosition: CheckboxPopoutProps["iconPosition"];
12
13
  };
13
14
  export interface CheckboxInputSlots extends PopoutInputSlots {
14
15
  }
@@ -48,16 +48,17 @@ import CheckboxPopout from 'sard-uniapp/components/checkbox-popout/checkbox-popo
48
48
 
49
49
  继承 [`CheckboxGroupProps`](./checkbox#CheckboxGroupProps) 并有以下额外属性:
50
50
 
51
- | 属性 | 描述 | 类型 | 默认值 |
52
- | ----------------------------------- | -------------------------------- | ---------- | ------ |
53
- | popout-class | 弹窗框根元素类名 | string | - |
54
- | popout-style | 弹窗框根元素样式 | StyleValue | - |
55
- | visible (v-model) | 是否显示弹出框 | boolean | - |
56
- | title | 弹出框标题 | string | - |
57
- | show-check-all <sup>1.20+</sup> | 是否显示全选 | boolean | false |
58
- | searchable <sup>1.20+</sup> | 是否可搜索 | boolean | false |
59
- | filter-placeholder <sup>1.20+</sup> | 搜索输入框占位符内容 | string | - |
60
- | resettable <sup>1.23.3+</sup> | 关闭弹出框后,是否可复位弹出框值 | boolean | false |
51
+ | 属性 | 描述 | 类型 | 默认值 |
52
+ | ----------------------------------- | -------------------------------- | ----------------- | ------ |
53
+ | popout-class | 弹窗框根元素类名 | string | - |
54
+ | popout-style | 弹窗框根元素样式 | StyleValue | - |
55
+ | visible (v-model) | 是否显示弹出框 | boolean | - |
56
+ | title | 弹出框标题 | string | - |
57
+ | show-check-all <sup>1.20+</sup> | 是否显示全选 | boolean | false |
58
+ | searchable <sup>1.20+</sup> | 是否可搜索 | boolean | false |
59
+ | filter-placeholder <sup>1.20+</sup> | 搜索输入框占位符内容 | string | - |
60
+ | resettable <sup>1.23.3+</sup> | 关闭弹出框后,是否可复位弹出框值 | boolean | false |
61
+ | icon-position <sup>1.24.1+</sup> | 可定义复选框的位置 | 'left' \| 'right' | 'left' |
61
62
 
62
63
  ### CheckboxPopoutEmits
63
64
 
@@ -8,6 +8,7 @@ declare const __VLS_component: import("vue").DefineComponent<CheckboxPopoutProps
8
8
  [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
9
9
  }>, {
10
10
  options: import("../checkbox/common").CheckboxGroupOption[];
11
+ iconPosition: "left" | "right";
11
12
  validateEvent: boolean;
12
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
14
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -61,7 +61,15 @@
61
61
  :hover="!option.disabled"
62
62
  @click="select(option, toggle)"
63
63
  >
64
- <template #icon>
64
+ <template v-if="iconPosition === 'left'" #icon>
65
+ <sar-checkbox
66
+ readonly
67
+ :disabled="option.disabled"
68
+ :value="option.value"
69
+ :validate-event="false"
70
+ />
71
+ </template>
72
+ <template v-if="iconPosition === 'right'" #value>
65
73
  <sar-checkbox
66
74
  readonly
67
75
  :disabled="option.disabled"
@@ -116,6 +124,7 @@ import { defaultOptionKeys } from "../checkbox/common";
116
124
  * @property {boolean} searchable 是否可搜索,默认值:false。
117
125
  * @property {string} filterPlaceholder 搜索输入框占位符内容,默认值:-。
118
126
  * @property {boolean} resettable 关闭弹出框后,是否可复位弹出框值,默认值:false。
127
+ * @property {'left' | 'right'} iconPosition 可定义复选框的位置,默认值:'left'。
119
128
  * @event {(visible: boolean) => void} update 弹出框显隐时触发
120
129
  * @event {(value: any[] | undefined) => void} change 复选输入组件值改变时触发
121
130
  * @event {() => void} confirm 点击确定按钮时触发
@@ -155,6 +164,7 @@ export default _defineComponent({
155
164
  searchable: { type: Boolean, required: false },
156
165
  filterPlaceholder: { type: String, required: false },
157
166
  resettable: { type: Boolean, required: false },
167
+ iconPosition: { type: String, required: false },
158
168
  rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
159
169
  rootClass: { type: String, required: false },
160
170
  modelValue: { type: Array, required: false },
@@ -10,10 +10,12 @@ export interface CheckboxPopoutProps extends CheckboxGroupProps {
10
10
  searchable?: boolean;
11
11
  filterPlaceholder?: string;
12
12
  resettable?: boolean;
13
+ iconPosition?: 'left' | 'right';
13
14
  }
14
15
  export declare const defaultCheckboxPopoutProps: () => {
15
16
  options: () => never[];
16
17
  validateEvent: boolean;
18
+ iconPosition: CheckboxPopoutProps["iconPosition"];
17
19
  };
18
20
  export interface CheckboxPopoutSlots {
19
21
  default?(props: Record<string, never>): any;
@@ -5,7 +5,9 @@ import { type CalendarInputProps } from '../calendar-input';
5
5
  import { type CalendarProps } from '../calendar';
6
6
  import { type CascaderInputProps } from '../cascader-input';
7
7
  import { type CheckboxGroupProps } from '../checkbox';
8
+ import { type CheckboxPopoutProps } from '../checkbox-popout';
8
9
  import { type CheckboxInputProps } from '../checkbox-input';
10
+ import { type CoolIconProps } from '../cool-icon';
9
11
  import { type DatetimePickerInputProps } from '../datetime-picker-input';
10
12
  import { type DatetimeRangePickerInputProps } from '../datetime-range-picker-input';
11
13
  import { type DialogProps } from '../dialog';
@@ -34,6 +36,7 @@ import { type RadioInputProps } from '../radio-input';
34
36
  import { type RadioPopoutProps } from '../radio-popout';
35
37
  import { type ResultProps } from '../result';
36
38
  import { type SearchProps } from '../search';
39
+ import { type SegmentedProps } from '../segmented';
37
40
  import { type SpaceProps } from '../space';
38
41
  import { type StepperProps } from '../stepper';
39
42
  import { type StepsProps } from '../steps';
@@ -43,6 +46,7 @@ import { type TagProps } from '../tag';
43
46
  import { type ToastProps } from '../toast';
44
47
  import { type TreeProps } from '../tree';
45
48
  import { type UploadPreviewProps, type UploadProps } from '../upload';
49
+ import { type WatermarkProps } from '../watermark';
46
50
  type DeepPartial<T> = {
47
51
  [P in keyof T]?: T[P] extends Record<any, any> ? DeepPartial<T[P]> : T[P];
48
52
  };
@@ -124,6 +128,10 @@ export declare const defaultConfig: {
124
128
  };
125
129
  checkboxPopout: {
126
130
  validateEvent: boolean;
131
+ iconPosition: CheckboxPopoutProps["iconPosition"];
132
+ };
133
+ coolIcon: {
134
+ shape: CoolIconProps["shape"];
127
135
  };
128
136
  countDown: {
129
137
  time: number;
@@ -212,6 +220,7 @@ export declare const defaultConfig: {
212
220
  labelAlign: FormProps["labelAlign"];
213
221
  labelValign: FormProps["labelValign"];
214
222
  starPosition: FormProps["starPosition"];
223
+ contentPosition: FormProps["contentPosition"];
215
224
  showError: boolean;
216
225
  scrollDuration: number;
217
226
  };
@@ -248,6 +257,7 @@ export declare const defaultConfig: {
248
257
  };
249
258
  keyboard: {
250
259
  type: KeyboardProps["type"];
260
+ mode: KeyboardProps["mode"];
251
261
  };
252
262
  listItem: {
253
263
  arrowDirection: ListItemProps["arrowDirection"];
@@ -361,6 +371,7 @@ export declare const defaultConfig: {
361
371
  radioPopout: {
362
372
  validateEvent: boolean;
363
373
  type: RadioPopoutProps["type"];
374
+ iconPosition: RadioPopoutProps["iconPosition"];
364
375
  };
365
376
  rate: {
366
377
  count: number;
@@ -381,6 +392,12 @@ export declare const defaultConfig: {
381
392
  shape: SearchProps["shape"];
382
393
  focus: boolean;
383
394
  };
395
+ segmented: {
396
+ size: SegmentedProps["size"];
397
+ shape: SegmentedProps["shape"];
398
+ direction: SegmentedProps["direction"];
399
+ validateEvent: boolean;
400
+ };
384
401
  shareSheet: {
385
402
  overlayClosable: boolean;
386
403
  duration: number;
@@ -490,6 +507,13 @@ export declare const defaultConfig: {
490
507
  columnGap: number;
491
508
  rowGap: number;
492
509
  };
510
+ watermark: {
511
+ width: number;
512
+ height: number;
513
+ rotate: number;
514
+ zIndex: number;
515
+ gap: () => NonNullable<WatermarkProps["gap"]>;
516
+ };
493
517
  };
494
518
  export type ConfigOptions = typeof defaultConfig;
495
519
  export declare function setConfig(...optionsArgs: DeepPartial<ConfigOptions>[]): void;
@@ -78,6 +78,10 @@ export const defaultConfig = {
78
78
  },
79
79
  checkboxPopout: {
80
80
  validateEvent: true,
81
+ iconPosition: 'left',
82
+ },
83
+ coolIcon: {
84
+ shape: 'oval',
81
85
  },
82
86
  countDown: {
83
87
  time: 0,
@@ -166,6 +170,7 @@ export const defaultConfig = {
166
170
  labelAlign: 'start',
167
171
  labelValign: 'center',
168
172
  starPosition: 'left',
173
+ contentPosition: 'left',
169
174
  showError: true,
170
175
  scrollDuration: 150,
171
176
  },
@@ -194,7 +199,7 @@ export const defaultConfig = {
194
199
  modelValue: '',
195
200
  validateEvent: true,
196
201
  cursorSpacing: 30,
197
- confirmType: 'done',
202
+ confirmType: undefined,
198
203
  cursor: -1,
199
204
  selectionStart: -1,
200
205
  selectionEnd: -1,
@@ -202,6 +207,7 @@ export const defaultConfig = {
202
207
  },
203
208
  keyboard: {
204
209
  type: 'number',
210
+ mode: 'chinese',
205
211
  },
206
212
  listItem: {
207
213
  arrowDirection: 'right',
@@ -315,6 +321,7 @@ export const defaultConfig = {
315
321
  radioPopout: {
316
322
  validateEvent: true,
317
323
  type: 'circle',
324
+ iconPosition: 'left',
318
325
  },
319
326
  rate: {
320
327
  count: 5,
@@ -335,6 +342,12 @@ export const defaultConfig = {
335
342
  shape: 'square',
336
343
  focus: false,
337
344
  },
345
+ segmented: {
346
+ size: 'middle',
347
+ shape: 'square',
348
+ direction: 'horizontal',
349
+ validateEvent: true,
350
+ },
338
351
  shareSheet: {
339
352
  overlayClosable: true,
340
353
  duration: 250,
@@ -444,6 +457,13 @@ export const defaultConfig = {
444
457
  columnGap: 16,
445
458
  rowGap: 16,
446
459
  },
460
+ watermark: {
461
+ width: 120,
462
+ height: 64,
463
+ rotate: -22,
464
+ zIndex: 9,
465
+ gap: () => [30, 30],
466
+ },
447
467
  };
448
468
  function extendProps(source, target) {
449
469
  Object.keys(target).forEach((key) => {
@@ -0,0 +1,81 @@
1
+ ---
2
+ nav: 组件
3
+ title: CoolIcon
4
+ subtitle: 酷炫图标
5
+ group: 数据展示
6
+ version: 1.24+
7
+ ---
8
+
9
+ ## 介绍
10
+
11
+ 为一般的图标添加颜色、外框、背景和装饰物等元素,让其变得炫酷,可在缺少设计时也能展示不一般的效果。
12
+
13
+ ## 引入
14
+
15
+ ```ts
16
+ import CoolIcon from 'sard-uniapp/components/cool-icon/cool-icon.vue'
17
+ ```
18
+
19
+ ## 代码演示
20
+
21
+ ### 椭圆
22
+
23
+ 把图标放置在默认插槽,使用 `background` 属性设置外框背景色,使用 `color` 属性设置图标颜色,使用 `shape="oval"` 属性设置外框为椭圆形,就能得到一个精致漂亮的图标。
24
+
25
+ @code('${DEMO_PATH}/cool-icon/demo/Oval.vue')
26
+
27
+ ### 圆形
28
+
29
+ 使用 `shape="circle"` 属性设置外框为圆形。
30
+
31
+ @code('${DEMO_PATH}/cool-icon/demo/Circle.vue')
32
+
33
+ ### 方形
34
+
35
+ 使用 `shape="square"` 属性设置外框为方形。
36
+
37
+ @code('${DEMO_PATH}/cool-icon/demo/Square.vue')
38
+
39
+ ### 三角形
40
+
41
+ 使用 `shape="triangle"` 属性设置外框为三角形。
42
+
43
+ @code('${DEMO_PATH}/cool-icon/demo/Triangle.vue')
44
+
45
+ ### 花朵
46
+
47
+ 使用 `shape="flower"` 属性设置外框为花朵形状。
48
+
49
+ @code('${DEMO_PATH}/cool-icon/demo/Flower.vue')
50
+
51
+ ### 尺寸
52
+
53
+ 使用 `size` 属性设置外框尺寸,使用 `icon-size` 设置图标尺寸。
54
+
55
+ @code('${DEMO_PATH}/cool-icon/demo/Size.vue')
56
+
57
+ ## API
58
+
59
+ ### CoolIconProps
60
+
61
+ | 属性 | 描述 | 类型 | 默认值 |
62
+ | ---------- | ------------------ | -------------------------------------------------------- | ------ |
63
+ | root-class | 组件根元素类名 | string | - |
64
+ | root-style | 组件根元素样式 | StyleValue | - |
65
+ | shape | 设置外框的形状 | 'circle' \| 'square' \| 'oval' \| 'triangle' \| 'flower' | 'oval' |
66
+ | color | 设置图标颜色 | string | - |
67
+ | background | 设置外框背景色颜色 | string | - |
68
+ | size | 设置外框尺寸 | string | - |
69
+ | icon-size | 设置图标尺寸 | string | - |
70
+
71
+ ### CoolIconSlots
72
+
73
+ | 插槽 | 描述 | 属性 |
74
+ | ------- | -------------- | ---- |
75
+ | default | 自定义默认内容 | - |
76
+
77
+ ## 主题定制
78
+
79
+ ### CSS 变量
80
+
81
+ @code('./variables.scss#variables')
@@ -0,0 +1,21 @@
1
+ import { type StyleValue } from 'vue';
2
+ export interface CoolIconProps {
3
+ rootStyle?: StyleValue;
4
+ rootClass?: string;
5
+ shape?: 'circle' | 'square' | 'oval' | 'triangle' | 'flower';
6
+ size?: string;
7
+ iconSize?: string;
8
+ color?: string;
9
+ background?: string;
10
+ }
11
+ export declare const defaultCoolIconProps: {
12
+ shape: CoolIconProps["shape"];
13
+ };
14
+ export interface CoolIconSlots {
15
+ default?(props: Record<string, never>): any;
16
+ }
17
+ export interface CoolIconEmits {
18
+ (e: 'click', event: any): void;
19
+ }
20
+ export interface CoolIconExpose {
21
+ }
@@ -0,0 +1,2 @@
1
+ import { defaultConfig } from '../config';
2
+ export const defaultCoolIconProps = defaultConfig.coolIcon;
@@ -0,0 +1,16 @@
1
+ import { type CoolIconProps, type CoolIconSlots } from './common';
2
+ declare function __VLS_template(): Readonly<CoolIconSlots> & CoolIconSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<CoolIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ click: (event: any) => any;
5
+ }, string, import("vue").PublicProps, Readonly<CoolIconProps> & Readonly<{
6
+ onClick?: ((event: any) => any) | undefined;
7
+ }>, {
8
+ shape: "circle" | "square" | "oval" | "triangle" | "flower";
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
11
+ export default _default;
12
+ type __VLS_WithTemplateSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };