stellar-ui-plus 1.24.26 → 1.25.0

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 (44) hide show
  1. package/components/ste-app-update/method.ts +1 -0
  2. package/components/ste-app-update/props.ts +11 -11
  3. package/components/ste-app-update/ste-app-update.vue +2 -7
  4. package/components/ste-radio/README.md +1 -1
  5. package/components/ste-radio/ste-radio.vue +2 -7
  6. package/components/ste-radio-group/ste-radio-group.vue +2 -1
  7. package/components/ste-select-seat/ATTRIBUTES.md +18 -0
  8. package/components/ste-select-seat/README.md +280 -0
  9. package/components/ste-select-seat/canvasUtils.ts +42 -0
  10. package/components/ste-select-seat/config.json +5 -0
  11. package/components/ste-select-seat/internals/gridUtils.ts +23 -0
  12. package/components/ste-select-seat/internals/seatLayout.ts +169 -0
  13. package/components/ste-select-seat/internals/useSeatInteraction.ts +540 -0
  14. package/components/ste-select-seat/props.ts +37 -0
  15. package/components/ste-select-seat/ste-select-seat.easycom.json +62 -0
  16. package/components/ste-select-seat/ste-select-seat.vue +517 -0
  17. package/components/ste-select-seat/types.d.ts +33 -0
  18. package/components/ste-select-seat/useData.ts +179 -0
  19. package/components/ste-select-seat/useTouchCompat.ts +89 -0
  20. package/components/ste-simple-calendar/ATTRIBUTES.md +17 -0
  21. package/components/ste-simple-calendar/README.md +112 -0
  22. package/components/ste-simple-calendar/config.json +5 -0
  23. package/components/ste-simple-calendar/props.ts +32 -0
  24. package/components/ste-simple-calendar/ste-simple-calendar.easycom.json +60 -0
  25. package/components/ste-simple-calendar/ste-simple-calendar.vue +265 -0
  26. package/components/ste-simple-calendar/type.d.ts +30 -0
  27. package/components/ste-simple-calendar/useData.ts +60 -0
  28. package/components/ste-skeleton/ATTRIBUTES.md +7 -0
  29. package/components/ste-skeleton/README.md +82 -0
  30. package/components/ste-skeleton/config.json +5 -0
  31. package/components/ste-skeleton/props.ts +7 -0
  32. package/components/ste-skeleton/ste-skeleton.easycom.json +38 -0
  33. package/components/ste-skeleton/ste-skeleton.vue +90 -0
  34. package/components/ste-slide-verify/ATTRIBUTES.md +27 -0
  35. package/components/ste-slide-verify/README.md +118 -0
  36. package/components/ste-slide-verify/config.json +5 -0
  37. package/components/ste-slide-verify/props.ts +43 -0
  38. package/components/ste-slide-verify/ste-slide-verify.easycom.json +119 -0
  39. package/components/ste-slide-verify/ste-slide-verify.vue +535 -0
  40. package/index.ts +8 -0
  41. package/package.json +1 -1
  42. package/types/components.d.ts +8 -0
  43. package/types/index.d.ts +2 -0
  44. package/types/refComponents.d.ts +8 -0
@@ -0,0 +1,118 @@
1
+ # Slide Verify 滑动验证
2
+
3
+ 通过拖动滑块完成验证,支持普通滑动验证和图片旋转验证两种模式。
4
+
5
+ ---$
6
+
7
+ ### 代码演示
8
+
9
+ #### 基础用法
10
+
11
+ ```html
12
+ <script setup lang="ts">
13
+ import { ref } from 'vue';
14
+ const value1 = ref(false);
15
+ </script>
16
+
17
+ <template>
18
+ <ste-slide-verify v-model="value1"></ste-slide-verify>
19
+ </template>
20
+ ```
21
+
22
+ #### 没有错误提示
23
+
24
+ ```html
25
+ <script setup lang="ts">
26
+ import { ref } from 'vue';
27
+ const value3 = ref(false);
28
+ </script>
29
+
30
+ <template>
31
+ <ste-slide-verify v-model="value3" text="向右滑动验证" :showFail="false"></ste-slide-verify>
32
+ </template>
33
+ ```
34
+
35
+ #### 转动图片
36
+
37
+ ```html
38
+ <script setup lang="ts">
39
+ import { ref } from 'vue';
40
+ const value2 = ref(false);
41
+ </script>
42
+
43
+ <template>
44
+ <ste-slide-verify v-model="value2" mode="image" imageUrl="https://image.whzb.com/chain/StellarUI/mp-logo.png" successText="图片校验通过"></ste-slide-verify>
45
+ </template>
46
+ ```
47
+
48
+ #### 禁用状态
49
+
50
+ ```html
51
+ <template>
52
+ <ste-slide-verify disabled text="当前不可操作"></ste-slide-verify>
53
+ </template>
54
+ ```
55
+
56
+ #### 失败态停留更久
57
+
58
+ ```html
59
+ <script setup lang="ts">
60
+ import { ref } from 'vue';
61
+ const value5 = ref(false);
62
+ </script>
63
+
64
+ <template>
65
+ <ste-slide-verify v-model="value5" failText="请慢一点再试" :failDuration="1800"></ste-slide-verify>
66
+ </template>
67
+ ```
68
+
69
+ #### 尺寸、颜色与文案
70
+
71
+ ```html
72
+ <script setup lang="ts">
73
+ import { ref } from 'vue';
74
+ const value6 = ref(false);
75
+ </script>
76
+
77
+ <template>
78
+ <ste-slide-verify
79
+ v-model="value6"
80
+ size="52"
81
+ imageSize="180"
82
+ text="拖动完成领取"
83
+ successText="领取成功"
84
+ failText="再试一次"
85
+ activeColor="linear-gradient(90deg, #ff7a18, #ffb800)"
86
+ successColor="#1f9d55"
87
+ failColor="#d93025"
88
+ ></ste-slide-verify>
89
+ </template>
90
+ ```
91
+
92
+ ---$
93
+
94
+ ### API
95
+
96
+ <!-- props -->
97
+
98
+ #### Methods
99
+
100
+ | 方法名 | 说明 | 参数 |
101
+ | ------- | -------------------------- | ---- |
102
+ | `init` | 重新计算轨道宽度并同步状态 | - |
103
+ | `reset` | 重置验证状态 | - |
104
+
105
+ `detail` 数据结构:
106
+
107
+ ```ts
108
+ {
109
+ mode: 'slide' | 'image';
110
+ progress: number;
111
+ angle: number;
112
+ left: number;
113
+ maxLeft: number;
114
+ }
115
+ ```
116
+
117
+ ---$
118
+ {{fuyuwei}}
@@ -0,0 +1,5 @@
1
+ {
2
+ "group": "业务组件",
3
+ "title": "Slide Verify 滑动验证",
4
+ "icon": "https://image.whzb.com/chain/StellarUI/组件图标/slide-verify.png"
5
+ }
@@ -0,0 +1,43 @@
1
+ import type { ExtractPropTypes, PropType } from 'vue'
2
+
3
+ export type SlideVerifyMode = 'slide' | 'image'
4
+
5
+ export interface SlideVerifyDetail {
6
+ mode: SlideVerifyMode
7
+ progress: number
8
+ angle: number
9
+ left: number
10
+ maxLeft: number
11
+ }
12
+
13
+ const slideVerifyProps = {
14
+ modelValue: { type: Boolean, default: false },
15
+ mode: { type: String as PropType<SlideVerifyMode>, default: 'slide' },
16
+ size: { type: [String, Number], default: 80 },
17
+ disabled: { type: Boolean, default: false },
18
+ imageUrl: { type: String, default: '' },
19
+ imageSize: { type: [String, Number], default: 168 },
20
+ angleThreshold: { type: Number, default: 10 },
21
+ text: { type: String, default: '' },
22
+ successText: { type: String, default: '验证成功' },
23
+ showFail: { type: Boolean, default: true },
24
+ failText: { type: String, default: '验证失败' },
25
+ failDuration: { type: Number, default: 800 },
26
+ activeColor: { type: String, default: '' },
27
+ inactiveColor: { type: String, default: '' },
28
+ successColor: { type: String, default: '#13ce66' },
29
+ failColor: { type: String, default: '#ee0a24' },
30
+ }
31
+
32
+ export default slideVerifyProps
33
+
34
+ export type SlideVerifyProps = ExtractPropTypes<typeof slideVerifyProps>
35
+
36
+ export const slideVerifyEmits = {
37
+ 'update:modelValue': (value: boolean) => typeof value === 'boolean',
38
+ success: (detail: SlideVerifyDetail) => detail instanceof Object,
39
+ fail: (detail: SlideVerifyDetail) => detail instanceof Object,
40
+ change: (detail: SlideVerifyDetail) => detail instanceof Object,
41
+ }
42
+
43
+ export type SlideVerifyEmits = typeof slideVerifyEmits
@@ -0,0 +1,119 @@
1
+ {
2
+ "name": "ste-slide-verify",
3
+ "description": "滑动验证组件,支持普通滑动验证和图片旋转验证。",
4
+ "example": "<ste-slide-verify v-model='value'></ste-slide-verify>",
5
+ "tutorial": "https://stellar-ui.intecloud.com.cn/?projectName=stellar-ui-plus&menu=%E7%BB%84%E4%BB%B6&active=ste-slide-verify",
6
+ "attributes": [
7
+ {
8
+ "name": "modelValue",
9
+ "description": "验证状态(支持 v-model 双向绑定)",
10
+ "type": "Boolean",
11
+ "default": false
12
+ },
13
+ {
14
+ "name": "mode",
15
+ "description": "验证模式,可选值为 slide / image",
16
+ "type": "String",
17
+ "default": "slide"
18
+ },
19
+ {
20
+ "name": "size",
21
+ "description": "轨道高度和滑块大小,默认单位 rpx",
22
+ "type": "Number|String",
23
+ "default": 40
24
+ },
25
+ {
26
+ "name": "disabled",
27
+ "description": "是否禁用",
28
+ "type": "Boolean",
29
+ "default": false
30
+ },
31
+ {
32
+ "name": "imageUrl",
33
+ "description": "图片旋转模式下的图片地址",
34
+ "type": "String",
35
+ "default": ""
36
+ },
37
+ {
38
+ "name": "imageSize",
39
+ "description": "图片旋转模式下的图片尺寸,默认单位 rpx",
40
+ "type": "Number|String",
41
+ "default": 150
42
+ },
43
+ {
44
+ "name": "angleThreshold",
45
+ "description": "图片旋转验证的角度容差",
46
+ "type": "Number",
47
+ "default": 10
48
+ },
49
+ {
50
+ "name": "text",
51
+ "description": "默认提示文案",
52
+ "type": "String",
53
+ "default": ""
54
+ },
55
+ {
56
+ "name": "successText",
57
+ "description": "验证成功文案",
58
+ "type": "String",
59
+ "default": "验证成功"
60
+ },
61
+ {
62
+ "name": "showFail",
63
+ "description": "失败时是否显示失败态",
64
+ "type": "Boolean",
65
+ "default": true
66
+ },
67
+ {
68
+ "name": "failText",
69
+ "description": "失败提示文案",
70
+ "type": "String",
71
+ "default": "验证失败"
72
+ },
73
+ {
74
+ "name": "failDuration",
75
+ "description": "失败态停留时长,单位 ms",
76
+ "type": "Number",
77
+ "default": 800
78
+ },
79
+ {
80
+ "name": "activeColor",
81
+ "description": "拖动过程中的激活颜色",
82
+ "type": "String",
83
+ "default": "#0090FF"
84
+ },
85
+ {
86
+ "name": "inactiveColor",
87
+ "description": "未激活背景色",
88
+ "type": "String",
89
+ "default": "#f3f4f6"
90
+ },
91
+ {
92
+ "name": "successColor",
93
+ "description": "成功态颜色",
94
+ "type": "String",
95
+ "default": "#13ce66"
96
+ },
97
+ {
98
+ "name": "failColor",
99
+ "description": "失败态颜色",
100
+ "type": "String",
101
+ "default": "#ee0a24"
102
+ },
103
+ {
104
+ "name": "[event]change",
105
+ "description": "拖动过程中实时触发",
106
+ "type": "(detail) => void"
107
+ },
108
+ {
109
+ "name": "[event]success",
110
+ "description": "验证成功时触发",
111
+ "type": "(detail) => void"
112
+ },
113
+ {
114
+ "name": "[event]fail",
115
+ "description": "验证失败时触发",
116
+ "type": "(detail) => void"
117
+ }
118
+ ]
119
+ }