sard-uniapp 1.19.2 → 1.19.3

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 (216) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/components/accordion/README.md +91 -0
  3. package/components/accordion/accordion.vue +7 -0
  4. package/components/accordion-item/accordion-item.vue +9 -0
  5. package/components/action-sheet/README.md +85 -0
  6. package/components/action-sheet/action-sheet.vue +15 -0
  7. package/components/alert/README.md +74 -0
  8. package/components/alert/alert.vue +10 -0
  9. package/components/avatar/README.md +86 -0
  10. package/components/avatar/avatar.vue +8 -0
  11. package/components/back-top/README.md +134 -0
  12. package/components/back-top/back-top.vue +9 -0
  13. package/components/badge/README.md +95 -0
  14. package/components/badge/badge.vue +11 -0
  15. package/components/button/README.md +162 -0
  16. package/components/button/button.vue +46 -0
  17. package/components/calendar/README.md +94 -0
  18. package/components/calendar/calendar.vue +19 -0
  19. package/components/calendar-input/README.md +65 -0
  20. package/components/calendar-input/calendar-input.vue +31 -0
  21. package/components/calendar-popout/README.md +100 -0
  22. package/components/calendar-popout/calendar-popout.vue +25 -0
  23. package/components/card/README.md +82 -0
  24. package/components/card/card.vue +9 -0
  25. package/components/cascader/README.md +117 -0
  26. package/components/cascader/cascader.vue +13 -0
  27. package/components/cascader-input/README.md +51 -0
  28. package/components/cascader-input/cascader-input.vue +25 -0
  29. package/components/cascader-popout/README.md +53 -0
  30. package/components/cascader-popout/cascader-popout.vue +19 -0
  31. package/components/checkbox/README.md +185 -0
  32. package/components/checkbox/checkbox.vue +17 -0
  33. package/components/checkbox-group/checkbox-group.vue +15 -0
  34. package/components/checkbox-input/README.md +44 -0
  35. package/components/checkbox-input/checkbox-input.vue +22 -0
  36. package/components/checkbox-popout/README.md +52 -0
  37. package/components/checkbox-popout/checkbox-popout.vue +19 -0
  38. package/components/col/col.vue +7 -0
  39. package/components/collapse/README.md +45 -0
  40. package/components/collapse/collapse.vue +3 -0
  41. package/components/config/index.d.ts +2 -0
  42. package/components/config/index.js +1 -0
  43. package/components/count-down/README.md +97 -0
  44. package/components/count-down/count-down.vue +8 -0
  45. package/components/count-to/README.md +61 -0
  46. package/components/count-to/count-to.vue +7 -0
  47. package/components/crop-image/README.md +86 -0
  48. package/components/crop-image/crop-image.vue +15 -0
  49. package/components/datetime-picker/README.md +136 -0
  50. package/components/datetime-picker/datetime-picker.vue +14 -0
  51. package/components/datetime-picker-input/README.md +82 -0
  52. package/components/datetime-picker-input/datetime-picker-input.vue +25 -0
  53. package/components/datetime-picker-popout/README.md +77 -0
  54. package/components/datetime-picker-popout/datetime-picker-popout.vue +19 -0
  55. package/components/datetime-range-picker/README.md +49 -0
  56. package/components/datetime-range-picker/datetime-range-picker.vue +15 -0
  57. package/components/datetime-range-picker-input/README.md +58 -0
  58. package/components/datetime-range-picker-input/datetime-range-picker-input.vue +26 -0
  59. package/components/datetime-range-picker-popout/README.md +53 -0
  60. package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +20 -0
  61. package/components/dialog/README.md +192 -0
  62. package/components/dialog/dialog.vue +33 -0
  63. package/components/dialog-agent/dialog-agent.vue +21 -0
  64. package/components/divider/README.md +80 -0
  65. package/components/divider/divider.vue +8 -0
  66. package/components/dropdown/README.md +168 -0
  67. package/components/dropdown/common.d.ts +7 -0
  68. package/components/dropdown/common.js +1 -0
  69. package/components/dropdown/dropdown.vue +16 -1
  70. package/components/dropdown-item/dropdown-item.vue +51 -4
  71. package/components/empty/README.md +71 -0
  72. package/components/empty/empty.vue +8 -0
  73. package/components/fab/README.md +111 -0
  74. package/components/fab/fab.vue +18 -0
  75. package/components/floating-bubble/README.md +70 -0
  76. package/components/floating-bubble/floating-bubble.vue +11 -0
  77. package/components/floating-panel/README.md +78 -0
  78. package/components/floating-panel/floating-panel.vue +11 -0
  79. package/components/form/README.md +308 -0
  80. package/components/form/form.vue +19 -0
  81. package/components/form-item/form-item.vue +17 -0
  82. package/components/grid/README.md +140 -0
  83. package/components/grid/grid.vue +11 -0
  84. package/components/grid-item/grid-item.vue +15 -0
  85. package/components/icon/README.md +118 -0
  86. package/components/icon/common.d.ts +2 -0
  87. package/components/icon/icon.d.ts +1 -0
  88. package/components/icon/icon.vue +18 -3
  89. package/components/indexes/README.md +83 -0
  90. package/components/indexes/indexes.vue +7 -0
  91. package/components/indexes-anchor/indexes-anchor.vue +5 -0
  92. package/components/input/README.md +170 -0
  93. package/components/input/input.vue +55 -0
  94. package/components/keyboard/README.md +82 -0
  95. package/components/keyboard/keyboard.vue +7 -0
  96. package/components/layout/README.md +89 -0
  97. package/components/list/README.md +118 -0
  98. package/components/list/list.vue +8 -0
  99. package/components/list-item/list-item.vue +15 -0
  100. package/components/load-more/README.md +75 -0
  101. package/components/load-more/load-more.vue +11 -0
  102. package/components/loading/README.md +89 -0
  103. package/components/loading/loading.vue +13 -0
  104. package/components/lucky-draw/README.md +174 -0
  105. package/components/marquee/README.md +65 -0
  106. package/components/marquee/marquee.vue +7 -0
  107. package/components/menu/_README.md +61 -0
  108. package/components/navbar/README.md +123 -0
  109. package/components/navbar/navbar.vue +11 -0
  110. package/components/navbar-item/navbar-item.vue +10 -0
  111. package/components/notice-bar/README.md +135 -0
  112. package/components/notice-bar/notice-bar.vue +17 -0
  113. package/components/notify/README.md +118 -0
  114. package/components/notify/notify.vue +11 -0
  115. package/components/notify-agent/notify-agent.vue +12 -0
  116. package/components/overlay/README.md +56 -0
  117. package/components/overlay/overlay.vue +10 -0
  118. package/components/pagination/README.md +80 -0
  119. package/components/pagination/pagination.vue +15 -0
  120. package/components/password-input/README.md +87 -0
  121. package/components/password-input/password-input.vue +17 -0
  122. package/components/picker/README.md +115 -0
  123. package/components/picker/picker.vue +10 -0
  124. package/components/picker-input/README.md +51 -0
  125. package/components/picker-input/picker-input.vue +21 -0
  126. package/components/picker-popout/README.md +51 -0
  127. package/components/picker-popout/picker-popout.vue +15 -0
  128. package/components/popout/README.md +111 -0
  129. package/components/popout/popout.vue +29 -0
  130. package/components/popout-input/README.md +55 -0
  131. package/components/popout-input/popout-input.vue +15 -0
  132. package/components/popover/README.md +191 -0
  133. package/components/popover/popover.vue +15 -0
  134. package/components/popover-reference/popover-reference.vue +5 -0
  135. package/components/popup/README.md +67 -0
  136. package/components/popup/popup.vue +20 -0
  137. package/components/progress-bar/README.md +90 -0
  138. package/components/progress-bar/progress-bar.vue +13 -0
  139. package/components/progress-circle/README.md +75 -0
  140. package/components/progress-circle/progress-circle.vue +10 -0
  141. package/components/pull-down-refresh/README.md +100 -0
  142. package/components/pull-down-refresh/pull-down-refresh.vue +11 -0
  143. package/components/qrcode/README.md +103 -0
  144. package/components/qrcode/qrcode.vue +13 -0
  145. package/components/radio/README.md +172 -0
  146. package/components/radio/radio.vue +13 -0
  147. package/components/radio-group/radio-group.vue +16 -0
  148. package/components/radio-input/README.md +44 -0
  149. package/components/radio-input/radio-input.vue +23 -0
  150. package/components/radio-popout/README.md +52 -0
  151. package/components/radio-popout/radio-popout.vue +20 -0
  152. package/components/rate/README.md +106 -0
  153. package/components/rate/rate.vue +22 -0
  154. package/components/result/README.md +66 -0
  155. package/components/result/result.vue +10 -0
  156. package/components/row/row.vue +7 -0
  157. package/components/scroll-spy/README.md +70 -0
  158. package/components/scroll-spy/scroll-spy.vue +13 -0
  159. package/components/search/README.md +117 -0
  160. package/components/search/search.vue +25 -0
  161. package/components/share-sheet/README.md +94 -0
  162. package/components/share-sheet/share-sheet.vue +20 -0
  163. package/components/sidebar/README.md +118 -0
  164. package/components/sidebar/sidebar.vue +10 -0
  165. package/components/sidebar-item/sidebar-item.vue +8 -0
  166. package/components/signature/README.md +99 -0
  167. package/components/signature/signature.vue +20 -0
  168. package/components/skeleton/README.md +128 -0
  169. package/components/skeleton/skeleton.vue +12 -0
  170. package/components/skeleton-avatar/skeleton-avatar.vue +9 -0
  171. package/components/skeleton-block/skeleton-block.vue +8 -0
  172. package/components/skeleton-paragraph/skeleton-paragraph.vue +9 -0
  173. package/components/skeleton-title/skeleton-title.vue +8 -0
  174. package/components/slider/README.md +140 -0
  175. package/components/slider/slider.vue +29 -0
  176. package/components/space/README.md +82 -0
  177. package/components/space/space.vue +9 -0
  178. package/components/status-bar/README.md +72 -0
  179. package/components/status-bar/status-bar.vue +6 -0
  180. package/components/step/step.vue +9 -1
  181. package/components/stepper/README.md +94 -0
  182. package/components/stepper/stepper.vue +24 -0
  183. package/components/steps/README.md +142 -0
  184. package/components/steps/steps.vue +15 -0
  185. package/components/style/README.md +20 -0
  186. package/components/swipe-action/README.md +82 -0
  187. package/components/swipe-action/swipe-action.vue +7 -0
  188. package/components/swiper-dot/README.md +45 -0
  189. package/components/swiper-dot/swiper-dot.vue +9 -0
  190. package/components/switch/README.md +89 -0
  191. package/components/switch/switch.vue +18 -0
  192. package/components/tab/tab.vue +8 -0
  193. package/components/tabbar/README.md +111 -0
  194. package/components/tabbar/tabbar.vue +12 -0
  195. package/components/tabbar-item/tabbar-item.vue +12 -0
  196. package/components/tabbar-pit/README.md +41 -0
  197. package/components/tabbar-pit/tabbar-pit.vue +5 -0
  198. package/components/table/README.md +162 -0
  199. package/components/table/table.vue +7 -0
  200. package/components/table-cell/table-cell.vue +7 -0
  201. package/components/table-row/table-row.vue +5 -0
  202. package/components/tabs/README.md +113 -0
  203. package/components/tabs/tabs.vue +10 -0
  204. package/components/tag/README.md +96 -0
  205. package/components/tag/tag.vue +14 -0
  206. package/components/timeline/README.md +66 -0
  207. package/components/timeline/timeline.vue +4 -0
  208. package/components/timeline-item/timeline-item.vue +9 -0
  209. package/components/toast/README.md +111 -0
  210. package/components/toast/toast.vue +11 -0
  211. package/components/toast-agent/toast-agent.vue +11 -0
  212. package/components/tree/README.md +208 -0
  213. package/components/tree/tree.vue +21 -0
  214. package/components/upload/README.md +154 -0
  215. package/components/upload/upload.vue +22 -0
  216. package/package.json +74 -45
@@ -0,0 +1,103 @@
1
+ ---
2
+ nav: 组件
3
+ title: Qrcode
4
+ subtitle: 二维码
5
+ group: 数据展示
6
+ version: 1.4+
7
+ ---
8
+
9
+ ## 介绍
10
+
11
+ 将一段文字或链接编码成图形,以便光学扫描仪或手机摄像头快速读取。
12
+
13
+ ## 引入
14
+
15
+ ```ts
16
+ import Qrcode from 'sard-uniapp/components/qrcode/qrcode.vue'
17
+ ```
18
+
19
+ ## 代码演示
20
+
21
+ ### 基础使用
22
+
23
+ 设置 `text` 属性即可渲染一个二维码图片。其内部通过 `canvas` 来绘制二维码,但最终的呈现是以图片的形式,因此可以覆盖任何东西在二维码上面。
24
+
25
+ @code('${DEMO_PATH}/qrcode/demo/Basic.vue')
26
+
27
+ ### 呈现的大小
28
+
29
+ 使用 `size` 属性设置二维码呈现的大小,可以设置为任意尺寸单位。
30
+
31
+ @code('${DEMO_PATH}/qrcode/demo/DisplaySize.vue')
32
+
33
+ ### 画板的大小
34
+
35
+ 画板大小决定了二维码图片的分辨率。
36
+
37
+ @code('${DEMO_PATH}/qrcode/demo/CanvasSize.vue')
38
+
39
+ ### 自定义颜色
40
+
41
+ 通过设置 `color` 自定义二维码暗模块颜色,
42
+ 通过设置 `bg-color` 自定义二维码亮模块颜色,即背景颜色。
43
+
44
+ @code('${DEMO_PATH}/qrcode/demo/Color.vue')
45
+
46
+ ### 默认插槽
47
+
48
+ 使用默认插槽, 可以把任意内容放置在二维码上面。
49
+
50
+ @code('${DEMO_PATH}/qrcode/demo/Icon.vue')
51
+
52
+ ### 添加图标 <sup>1.19.2+</sup>
53
+
54
+ 使用 `icon` 属性, 可以将一张图片渲染到画布中间,与二维码合并为同一张图片。
55
+
56
+ @code('${DEMO_PATH}/qrcode/demo/IconProps.vue')
57
+
58
+ ### 安静区域模块数
59
+
60
+ 可以简单把设置 `quiet-zone-modules` 当成设置二维码内边距。
61
+
62
+ @code('${DEMO_PATH}/qrcode/demo/QuietZoneModules.vue')
63
+
64
+ ### 错误纠错级别
65
+
66
+ 错误纠错级别越高,二维码抗磨损、抗脏能力越强,同时二维码就越大,可容纳的字符容量越小。
67
+
68
+ `ecl` 属性用于设置错误纠错级别。
69
+
70
+ @code('${DEMO_PATH}/qrcode/demo/ECL.vue')
71
+
72
+ 下面是不同纠错级别的纠错能力表。
73
+
74
+ | 错误纠错级别 | 错误纠错能力 |
75
+ | ------------ | -------------- |
76
+ | L | 恢复 7%的数据 |
77
+ | M | 恢复 15%的数据 |
78
+ | Q | 恢复 25%的数据 |
79
+ | H | 恢复 30%的数据 |
80
+
81
+ ## API
82
+
83
+ ### QrcodeProps
84
+
85
+ | 属性 | 描述 | 类型 | 默认值 |
86
+ | ----------------------------------------- | ---------------------------- | ------------------------ | ------ |
87
+ | root-class | 组件根元素类名 | string | - |
88
+ | root-style | 组件根元素样式 | StyleValue | - |
89
+ | text | 要编码的字符串数据 | string | - |
90
+ | ecl | 错误纠错级别 | 'L' \| 'M' \| 'Q' \| 'H' | 'M' |
91
+ | size | 二维码呈现的大小 | string | 320rpx |
92
+ | canvas-size | 画板的大小 | number | 400 |
93
+ | color | 二维码颜色 | string | #000 |
94
+ | bg-color | 二维码背景颜色 | string | #fff |
95
+ | quiet-zone-modules | 安静区域模块数 | number | 2 |
96
+ | show-menu-by-longpress <sup>1.19.2+</sup> | 长按图片显示菜单(微信小程序) | boolean | false |
97
+ | icon <sup>1.19.2+</sup> | 二维码中图片的地址 | string | - |
98
+
99
+ ### QrcodeSlots
100
+
101
+ | 插槽 | 描述 | 属性 |
102
+ | ------- | -------------- | ---- |
103
+ | default | 自定义额外内容 | - |
@@ -38,6 +38,19 @@ import {
38
38
  qrcode
39
39
  } from "../../utils";
40
40
  import { defaultQrcodeProps } from "./common";
41
+ /**
42
+ * @property {string} rootClass 组件根元素类名,默认值:-。
43
+ * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
44
+ * @property {string} text 要编码的字符串数据,默认值:-。
45
+ * @property {'L' | 'M' | 'Q' | 'H'} ecl 错误纠错级别,默认值:'M'。
46
+ * @property {string} size 二维码呈现的大小,默认值:320rpx。
47
+ * @property {number} canvasSize 画板的大小,默认值:400。
48
+ * @property {string} color 二维码颜色,默认值:#000。
49
+ * @property {string} bgColor 二维码背景颜色,默认值:#fff。
50
+ * @property {number} quietZoneModules 安静区域模块数,默认值:2。
51
+ * @property {boolean} showMenuByLongpress 长按图片显示菜单(微信小程序),默认值:false。
52
+ * @property {string} icon 二维码中图片的地址,默认值:-。
53
+ */
41
54
  export default _defineComponent({
42
55
  ...{
43
56
  options: {
@@ -0,0 +1,172 @@
1
+ ---
2
+ nav: 组件
3
+ title: Radio
4
+ subtitle: 单选按钮
5
+ group: 表单组件
6
+ ---
7
+
8
+ ## 介绍
9
+
10
+ 在一组可选项中进行单一选择。
11
+
12
+ ## 引入
13
+
14
+ ```ts
15
+ import Radio from 'sard-uniapp/components/radio/radio.vue'
16
+ import RadioGroup from 'sard-uniapp/components/radio-group/radio-group.vue'
17
+ ```
18
+
19
+ ## 代码演示
20
+
21
+ ### 基础使用
22
+
23
+ 使用 `v-model` 绑定当前选中值。
24
+
25
+ @code('${DEMO_PATH}/radio/demo/Basic.vue')
26
+
27
+ ### 排列方向
28
+
29
+ 将 `direction` 属性设置为 `horizontal` 后,单选按钮组会变成水平排列。
30
+
31
+ @code('${DEMO_PATH}/radio/demo/Direction.vue')
32
+
33
+ ### 只读和禁用
34
+
35
+ 只读或禁用后不可点击。
36
+
37
+ @code('${DEMO_PATH}/radio/demo/DisabledReadOnly.vue')
38
+
39
+ ### 图标大小
40
+
41
+ 使用 `size` 属性设置图标大小。
42
+
43
+ @code('${DEMO_PATH}/radio/demo/Size.vue')
44
+
45
+ ### 图标颜色
46
+
47
+ 使用 `checked-color` 属性设置选中时的图标颜色。
48
+
49
+ @code('${DEMO_PATH}/radio/demo/Color.vue')
50
+
51
+ ### 图标类型
52
+
53
+ 设置 `type` 属性为 `record` 可以使图标变为圆点类型。
54
+
55
+ @code('${DEMO_PATH}/radio/demo/Type.vue')
56
+
57
+ ### 自定义图标
58
+
59
+ 如果内置的图标不满足需求,可以使用 `icon` 插槽设置为任意的图标。
60
+ 插槽接收`checked`属性表示当前的选中状态。
61
+
62
+ @code('${DEMO_PATH}/radio/demo/Icon.vue')
63
+
64
+ ### 自动渲染单选按钮
65
+
66
+ 使用 `options` 属性设置可选项。
67
+
68
+ @code('${DEMO_PATH}/radio/demo/GroupOptions.vue')
69
+
70
+ ### 自定义 UI
71
+
72
+ 如果只想使用单选的逻辑,并想自定义 UI,可以使用单选按钮组的 `custom` 插槽。
73
+
74
+ 这个插槽接收 `toggle`方法和 `value` 属性作为参数。`toggle` 用于选中指定的选项,`value` 用于判断选中状态。
75
+
76
+ @code('${DEMO_PATH}/radio/demo/Custom1.vue')
77
+
78
+ 结合 `list` 组件使用:
79
+
80
+ @code('${DEMO_PATH}/radio/demo/Custom2.vue')
81
+
82
+ 单选按钮组里面 `radio` 组件,会自动判断选中状态;可以给 `radio` 组件添加 `readonly` 属性以便将点击操作交给其他组件。
83
+
84
+ @code('${DEMO_PATH}/radio/demo/Custom3.vue')
85
+
86
+ ## API
87
+
88
+ ### RadioProps
89
+
90
+ | 属性 | 描述 | 类型 | 默认值 |
91
+ | ------------- | ------------------------------------ | -------------------- | -------- |
92
+ | root-class | 组件根元素类名 | string | - |
93
+ | root-style | 组件根元素样式 | StyleValue | - |
94
+ | checked | 是否选中 | boolean | false |
95
+ | value | 单选按钮的值,配合单选按钮组一起使用 | any | - |
96
+ | label | 单选按钮标签 | string | - |
97
+ | disabled | 禁用状态 | boolean | - |
98
+ | readonly | 只读状态 | boolean | - |
99
+ | size | 图标的尺寸 | string | - |
100
+ | type | 图标类型 | 'circle' \| 'record' | 'circle' |
101
+ | checked-color | 选中时图标的颜色 | string | - |
102
+
103
+ ### RadioSlots
104
+
105
+ | 插槽 | 描述 | 属性 |
106
+ | ------- | -------------- | -------------------- |
107
+ | default | 自定义默认内容 | - |
108
+ | icon | 自定义图标 | { checked: boolean } |
109
+
110
+ ### RadioEmits
111
+
112
+ | 事件 | 描述 | 类型 |
113
+ | ----- | ---------- | -------------------- |
114
+ | click | 点击时触发 | (event: any) => void |
115
+
116
+ ### RadioGroupProps
117
+
118
+ | 属性 | 描述 | 类型 | 默认值 |
119
+ | --------------------- | ------------------------------------- | -------------------------- | -------------------------------- |
120
+ | root-class | 组件根元素类名 | string | - |
121
+ | root-style | 组件根元素样式 | StyleValue | - |
122
+ | model-value (v-model) | 指定选中的选项 | any | - |
123
+ | disabled | 禁用状态 | boolean | - |
124
+ | readonly | 只读状态 | boolean | - |
125
+ | size | 图标的尺寸 | string | - |
126
+ | type | 图标类型 | 'circle' \| 'record' | 'circle' |
127
+ | checked-color | 选中时图标的颜色 | string | - |
128
+ | direction | 排列方向 | 'horizontal' \| 'vertical' | 'vertical' |
129
+ | validate-event | 是否触发表单验证 | boolean | true |
130
+ | options | 自动设置单选按钮 | RadioGroupOption[] | - |
131
+ | option-keys | 自定义 options 的 label、value 的字段 | RadioGroupOptionKeys | {label: 'label', value: 'value'} |
132
+
133
+ ### RadioGroupOption
134
+
135
+ ```ts
136
+ export type RadioGroupOption =
137
+ | {
138
+ [key: PropertyKey]: any
139
+ }
140
+ | string
141
+ | number
142
+ | boolean
143
+ ```
144
+
145
+ ### RadioGroupOptionKeys
146
+
147
+ ```ts
148
+ export interface RadioGroupOptionKeys {
149
+ label?: string
150
+ value?: string
151
+ }
152
+ ```
153
+
154
+ ### RadioGroupSlots
155
+
156
+ | 插槽 | 描述 | 属性 |
157
+ | ------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
158
+ | default | 自定义默认内容 | - |
159
+ | custom | 同默认插槽,额外可以接收 `toggle` 方法切换选中状态,接收 `value` 属性判断选中状态;用于自定义单选按钮结构和样式 | { toggle: (value: any) => void, value: any } |
160
+
161
+ ### RadioGroupEmits
162
+
163
+ | 事件 | 描述 | 类型 |
164
+ | ------------------ | ---------------------- | -------------------- |
165
+ | update:model-value | 单选按钮组值改变时触发 | (value: any) => void |
166
+ | change | 单选按钮组值改变时触发 | (value: any) => void |
167
+
168
+ ## 主题定制
169
+
170
+ ### CSS 变量
171
+
172
+ @code('./variables.scss#variables')
@@ -24,6 +24,19 @@ import {
24
24
  } from "./common";
25
25
  import SarCheckIcon from "../check-icon/check-icon.vue";
26
26
  import { useFormContext } from "../form/common";
27
+ /**
28
+ * @property {string} rootClass 组件根元素类名,默认值:-。
29
+ * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
30
+ * @property {boolean} checked 是否选中,默认值:false。
31
+ * @property {any} value 单选按钮的值,配合单选按钮组一起使用,默认值:-。
32
+ * @property {string} label 单选按钮标签,默认值:-。
33
+ * @property {boolean} disabled 禁用状态,默认值:-。
34
+ * @property {boolean} readonly 只读状态,默认值:-。
35
+ * @property {string} size 图标的尺寸,默认值:-。
36
+ * @property {'circle' | 'record'} type 图标类型,默认值:'circle'。
37
+ * @property {string} checkedColor 选中时图标的颜色,默认值:-。
38
+ * @event {(event: any) => void} click 点击时触发
39
+ */
27
40
  export default _defineComponent({
28
41
  components: {
29
42
  SarCheckIcon,
@@ -40,6 +40,22 @@ import {
40
40
  } from "../../utils";
41
41
  import { useFormItemContext } from "../form/common";
42
42
  import SarRadio from "../radio/radio.vue";
43
+ /**
44
+ * @property {string} rootClass 组件根元素类名,默认值:-。
45
+ * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
46
+ * @property {any} modelValue 指定选中的选项,默认值:-。
47
+ * @property {boolean} disabled 禁用状态,默认值:-。
48
+ * @property {boolean} readonly 只读状态,默认值:-。
49
+ * @property {string} size 图标的尺寸,默认值:-。
50
+ * @property {'circle' | 'record'} type 图标类型,默认值:'circle'。
51
+ * @property {string} checkedColor 选中时图标的颜色,默认值:-。
52
+ * @property {'horizontal' | 'vertical'} direction 排列方向,默认值:'vertical'。
53
+ * @property {boolean} validateEvent 是否触发表单验证,默认值:true。
54
+ * @property {RadioGroupOption[]} options 自动设置单选按钮,默认值:-。
55
+ * @property {RadioGroupOptionKeys} optionKeys 自定义 options 的 label、value 的字段,默认值:{label: 'label', value: 'value'}。
56
+ * @event {(value: any) => void} update 单选按钮组值改变时触发
57
+ * @event {(value: any) => void} change 单选按钮组值改变时触发
58
+ */
43
59
  export default _defineComponent({
44
60
  components: {
45
61
  SarRadio,
@@ -0,0 +1,44 @@
1
+ ---
2
+ nav: 组件
3
+ title: RadioInput
4
+ subtitle: 单选输入框
5
+ group: 表单组件
6
+ version: 1.3+
7
+ ---
8
+
9
+ ## 介绍
10
+
11
+ 组合了单选弹出框、列表、输入框组件,实现了在弹出框中单选的功能。
12
+
13
+ ## 引入
14
+
15
+ ```ts
16
+ import RadioInput from 'sard-uniapp/components/radio-input/radio-input.vue'
17
+ ```
18
+
19
+ ## 代码演示
20
+
21
+ ### 基础使用
22
+
23
+ 通过 `title` 和 `placeholder` 属性设置弹出框标题和输入框占位文本,
24
+ 通过 `options` 属性设置可选项。
25
+
26
+ @code('${DEMO_PATH}/radio-input/demo/Basic.vue')
27
+
28
+ ## API
29
+
30
+ ### RadioInputProps
31
+
32
+ 继承 [`RadioPopoutProps`](./radio-popout#RadioPopoutProps) 并有以下额外属性:
33
+
34
+ | 属性 | 描述 | 类型 | 默认值 |
35
+ | --------------------------------- | ---------------------- | ---------- | --------------- |
36
+ | root-class | 弹出式输入框根元素类名 | string | - |
37
+ | root-style | 弹出式输入框根元素样式 | StyleValue | - |
38
+ | clearable | 是否显示清空按钮 | boolean | false |
39
+ | placeholder | 输入框占位符内容 | string | - |
40
+ | value-on-clear <sup>1.19.2+</sup> | 设置点击清除按钮后的值 | () => any | () => undefined |
41
+
42
+ ### RadioInputEmits
43
+
44
+ 继承 [`RadioPopoutEmits`](./radio-popout#RadioPopoutEmits)
@@ -39,6 +39,29 @@ import {
39
39
  } from "./common";
40
40
  import { getMayPrimitiveOption, isEmptyBinding, isNullish } from "../../utils";
41
41
  import { usePopoutInput } from "../../use";
42
+ /**
43
+ * @property {string} rootClass 弹出式输入框根元素类名,默认值:-。
44
+ * @property {StyleValue} rootStyle 弹出式输入框根元素样式,默认值:-。
45
+ * @property {any} modelValue 指定选中的选项,默认值:-。
46
+ * @property {boolean} disabled 禁用状态,默认值:-。
47
+ * @property {boolean} readonly 只读状态,默认值:-。
48
+ * @property {string} size 图标的尺寸,默认值:-。
49
+ * @property {'circle' | 'record'} type 图标类型,默认值:'circle'。
50
+ * @property {string} checkedColor 选中时图标的颜色,默认值:-。
51
+ * @property {'horizontal' | 'vertical'} direction 排列方向,默认值:'vertical'。
52
+ * @property {boolean} validateEvent 是否触发表单验证,默认值:true。
53
+ * @property {RadioGroupOption[]} options 自动设置单选按钮,默认值:-。
54
+ * @property {RadioGroupOptionKeys} optionKeys 自定义 options 的 label、value 的字段,默认值:{label: 'label', value: 'value'}。
55
+ * @property {string} popoutClass 弹窗框根元素类名,默认值:-。
56
+ * @property {StyleValue} popoutStyle 弹窗框根元素样式,默认值:-。
57
+ * @property {boolean} visible 是否显示弹出框,默认值:-。
58
+ * @property {string} title 弹出框标题,默认值:-。
59
+ * @property {boolean} clearable 是否显示清空按钮,默认值:false。
60
+ * @property {string} placeholder 输入框占位符内容,默认值:-。
61
+ * @property {() => any} valueOnClear 设置点击清除按钮后的值,默认值:() => undefined。
62
+ * @event {(visible: boolean) => void} update 弹出框显隐时触发
63
+ * @event {(value: any | undefined) => void} change 单选输入组件值改变时触发
64
+ */
42
65
  export default _defineComponent({
43
66
  components: {
44
67
  SarPopoutInput,
@@ -0,0 +1,52 @@
1
+ ---
2
+ nav: 组件
3
+ title: RadioPopout
4
+ subtitle: 单选弹出框
5
+ group: 表单组件
6
+ version: 1.16+
7
+ ---
8
+
9
+ ## 介绍
10
+
11
+ 组合了单选框组、列表、弹出框组件,实现了在弹出框中单选的功能。
12
+
13
+ ## 引入
14
+
15
+ ```ts
16
+ import RadioPopout from 'sard-uniapp/components/radio-popout/radio-popout.vue'
17
+ ```
18
+
19
+ ## 代码演示
20
+
21
+ ### 基础使用
22
+
23
+ 使用 `v-model` 双向绑定当前值,使用 `v-model:visible` 控制弹出框显隐。
24
+
25
+ @code('${DEMO_PATH}/radio-popout/demo/Basic.vue')
26
+
27
+ ## API
28
+
29
+ ### RadioPopoutProps
30
+
31
+ 继承 [`RadioGroupProps`](./radio#RadioGroupProps) 并有以下额外属性:
32
+
33
+ | 属性 | 描述 | 类型 | 默认值 |
34
+ | ----------------- | ---------------- | ---------- | ------ |
35
+ | popout-class | 弹窗框根元素类名 | string | - |
36
+ | popout-style | 弹窗框根元素样式 | StyleValue | - |
37
+ | visible (v-model) | 是否显示弹出框 | boolean | - |
38
+ | title | 弹出框标题 | string | - |
39
+
40
+ ### RadioPopoutEmits
41
+
42
+ | 事件 | 描述 | 类型 |
43
+ | ------------------ | ------------------------ | --------------------------------- |
44
+ | update:model-value | 单选输入组件值改变时触发 | (value: any \| undefined) => void |
45
+ | change | 单选输入组件值改变时触发 | (value: any \| undefined) => void |
46
+ | update:visible | 弹出框显隐时触发 | (visible: boolean) => void |
47
+
48
+ ## 主题定制
49
+
50
+ ### CSS 变量
51
+
52
+ @code('./variables.scss#variables')
@@ -69,6 +69,26 @@ import {
69
69
  } from "./common";
70
70
  import { defaultOptionKeys } from "../radio/common";
71
71
  import { useScrollSide, useFormPopout } from "../../use";
72
+ /**
73
+ * @property {string} rootClass 组件根元素类名,默认值:-。
74
+ * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
75
+ * @property {any} modelValue 指定选中的选项,默认值:-。
76
+ * @property {boolean} disabled 禁用状态,默认值:-。
77
+ * @property {boolean} readonly 只读状态,默认值:-。
78
+ * @property {string} size 图标的尺寸,默认值:-。
79
+ * @property {'circle' | 'record'} type 图标类型,默认值:'circle'。
80
+ * @property {string} checkedColor 选中时图标的颜色,默认值:-。
81
+ * @property {'horizontal' | 'vertical'} direction 排列方向,默认值:'vertical'。
82
+ * @property {boolean} validateEvent 是否触发表单验证,默认值:true。
83
+ * @property {RadioGroupOption[]} options 自动设置单选按钮,默认值:-。
84
+ * @property {RadioGroupOptionKeys} optionKeys 自定义 options 的 label、value 的字段,默认值:{label: 'label', value: 'value'}。
85
+ * @property {string} popoutClass 弹窗框根元素类名,默认值:-。
86
+ * @property {StyleValue} popoutStyle 弹窗框根元素样式,默认值:-。
87
+ * @property {boolean} visible 是否显示弹出框,默认值:-。
88
+ * @property {string} title 弹出框标题,默认值:-。
89
+ * @event {(visible: boolean) => void} update 弹出框显隐时触发
90
+ * @event {(value: any | undefined) => void} change 单选输入组件值改变时触发
91
+ */
72
92
  export default _defineComponent({
73
93
  components: {
74
94
  SarPopout,
@@ -0,0 +1,106 @@
1
+ ---
2
+ nav: 组件
3
+ title: Rate
4
+ subtitle: 评分
5
+ group: 表单组件
6
+ ---
7
+
8
+ ## 介绍
9
+
10
+ 用于对事物进行评级操作。
11
+
12
+ ## 引入
13
+
14
+ ```ts
15
+ import Rate from 'sard-uniapp/components/rate/rate.vue'
16
+ ```
17
+
18
+ ## 代码演示
19
+
20
+ ### 基础使用
21
+
22
+ 使用 `v-model` 绑定当前值。
23
+
24
+ @code('${DEMO_PATH}/rate/demo/Basic.vue')
25
+
26
+ ### 半星
27
+
28
+ 设置 `allowHalf` 属性后可以选中半星。
29
+
30
+ @code('${DEMO_PATH}/rate/demo/AllowHalf.vue')
31
+
32
+ ### 自定义图标
33
+
34
+ 通过 `icon` 属性设置选中时的图标,`voidIcon` 属性设置未选中时的图标。
35
+ 或者通过 `text` 和 `voidText` 属性设置文字代替图标。
36
+
37
+ @code('${DEMO_PATH}/rate/demo/CustomIcon.vue')
38
+
39
+ ### 自定义颜色
40
+
41
+ 通过 `color` 属性设置选中时的颜色,`voidColor` 设置未选中时的颜色。
42
+
43
+ @code('${DEMO_PATH}/rate/demo/Color.vue')
44
+
45
+ ### 自定义尺寸和间距
46
+
47
+ 通过 `size` 属性设置图标大小。
48
+ 通过 `gap` 属性设置图标间距。
49
+
50
+ @code('${DEMO_PATH}/rate/demo/Size.vue')
51
+
52
+ ### 自定义数量
53
+
54
+ 通过 `count` 属性设置星星总数。
55
+
56
+ @code('${DEMO_PATH}/rate/demo/Count.vue')
57
+
58
+ ### 允许清空
59
+
60
+ 当 `clearable` 属性设置为 `true`,再次点击相同的值时,可以将值重置为 0。
61
+
62
+ @code('${DEMO_PATH}/rate/demo/Clearable.vue')
63
+
64
+ ### 只读和禁用
65
+
66
+ 只读或禁用后不可操作。
67
+
68
+ @code('${DEMO_PATH}/rate/demo/DisabledReadOnly.vue')
69
+
70
+ ## API
71
+
72
+ ### RateProps
73
+
74
+ | 属性 | 描述 | 类型 | 默认值 |
75
+ | -------------- | ---------------------------- | ---------- | ------ |
76
+ | root-class | 组件根元素类名 | string | - |
77
+ | root-style | 组件根元素样式 | StyleValue | - |
78
+ | model-value | 选中图标数 | number | - |
79
+ | allow-half | 是否允许半选 | boolean | false |
80
+ | clearable | 是否允许清空,划到最左边清空 | boolean | false |
81
+ | count | 图标总数 | number | 5 |
82
+ | size | 图标大小 | string | - |
83
+ | gap | 图标间距 | string | - |
84
+ | icon-family | 图标字体 | string | - |
85
+ | icon | 自定义选中时的图标 | string | - |
86
+ | void-icon | 自定义未选中时的图标 | string | - |
87
+ | text | 自定义选中时的文字 | string | - |
88
+ | void-text | 自定义未选中时的文字 | string | - |
89
+ | color | 选中时的颜色 | string | - |
90
+ | void-color | 未选中时的颜色 | string | - |
91
+ | disabled | 禁用状态 | boolean | false |
92
+ | readonly | 只读状态 | boolean | false |
93
+ | validate-event | 是否触发表单验证 | boolean | true |
94
+
95
+ ### RateEmits
96
+
97
+ | 事件 | 描述 | 类型 |
98
+ | ------------------------ | ------------------ | ----------------------- |
99
+ | update:model-value | 选中的值改变时触发 | (value: number) => void |
100
+ | change <sup>1.9.2+</sup> | 选中的值改变时触发 | (value: number) => void |
101
+
102
+ ## 主题定制
103
+
104
+ ### CSS 变量
105
+
106
+ @code('./variables.scss#variables')
@@ -66,6 +66,28 @@ import SarIcon from "../icon/icon.vue";
66
66
  import { useFormContext, useFormItemContext } from "../form/common";
67
67
  import { defaultRateProps } from "./common";
68
68
  import { useMouseDown } from "../../use";
69
+ /**
70
+ * @property {string} rootClass 组件根元素类名,默认值:-。
71
+ * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
72
+ * @property {number} modelValue 选中图标数,默认值:-。
73
+ * @property {boolean} allowHalf 是否允许半选,默认值:false。
74
+ * @property {boolean} clearable 是否允许清空,划到最左边清空,默认值:false。
75
+ * @property {number} count 图标总数,默认值:5。
76
+ * @property {string} size 图标大小,默认值:-。
77
+ * @property {string} gap 图标间距,默认值:-。
78
+ * @property {string} iconFamily 图标字体,默认值:-。
79
+ * @property {string} icon 自定义选中时的图标,默认值:-。
80
+ * @property {string} voidIcon 自定义未选中时的图标,默认值:-。
81
+ * @property {string} text 自定义选中时的文字,默认值:-。
82
+ * @property {string} voidText 自定义未选中时的文字,默认值:-。
83
+ * @property {string} color 选中时的颜色,默认值:-。
84
+ * @property {string} voidColor 未选中时的颜色,默认值:-。
85
+ * @property {boolean} disabled 禁用状态,默认值:false。
86
+ * @property {boolean} readonly 只读状态,默认值:false。
87
+ * @property {boolean} validateEvent 是否触发表单验证,默认值:true。
88
+ * @event {(value: number) => void} update 选中的值改变时触发
89
+ * @event {(value: number) => void} change 选中的值改变时触发
90
+ */
69
91
  export default _defineComponent({
70
92
  components: {
71
93
  SarIcon,