@ruixinkeji/prism-ui 1.0.0 → 1.0.2

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 (34) hide show
  1. package/README.md +1 -1
  2. package/components/PrismAIAssist/PrismAIAssist.vue +98 -98
  3. package/components/PrismAddressInput/PrismAddressInput.vue +597 -597
  4. package/components/PrismCityCascadeSelect/PrismCityCascadeSelect.vue +793 -793
  5. package/components/PrismCityPicker/PrismCityPicker.vue +1008 -1008
  6. package/components/PrismCitySelect/PrismCitySelect.vue +435 -435
  7. package/components/PrismCode/PrismCode.vue +749 -749
  8. package/components/PrismCodeInput/PrismCodeInput.vue +156 -156
  9. package/components/PrismDateTimePicker/PrismDateTimePicker.vue +953 -953
  10. package/components/PrismDropdown/PrismDropdown.vue +77 -77
  11. package/components/PrismGroupSticky/PrismGroupSticky.vue +352 -352
  12. package/components/PrismIdCardInput/PrismIdCardInput.vue +253 -253
  13. package/components/PrismImagePicker/PrismImagePicker.vue +457 -457
  14. package/components/PrismIndexBar/PrismIndexBar.vue +243 -243
  15. package/components/PrismLicensePlateInput/PrismLicensePlateInput.vue +1100 -1100
  16. package/components/PrismMusicPlayer/PrismMusicPlayer.vue +530 -530
  17. package/components/PrismNavBar/PrismNavBar.vue +199 -199
  18. package/components/PrismSecureInput/PrismSecureInput.vue +360 -360
  19. package/components/PrismSticky/PrismSticky.vue +173 -173
  20. package/components/PrismSwiper/PrismSwiper.vue +338 -338
  21. package/components/PrismSwitch/PrismSwitch.vue +202 -202
  22. package/components/PrismTabBar/PrismTabBar.vue +147 -147
  23. package/components/PrismTabs/PrismTabs.vue +49 -49
  24. package/components/PrismVoiceInput/PrismVoiceInput.vue +529 -529
  25. package/fonts/fa-brands-400.woff2 +0 -0
  26. package/fonts/fa-regular-400.woff2 +0 -0
  27. package/fonts/fa-solid-900.woff2 +0 -0
  28. package/fonts/fa-v4compatibility.woff2 +0 -0
  29. package/fonts/font-awesome.css +913 -0
  30. package/fonts/iconfont.woff2 +0 -0
  31. package/package.json +7 -1
  32. package/store/app.d.ts +21 -0
  33. package/store/app.js +68 -0
  34. package/styles/base.scss +2 -2
@@ -1,202 +1,202 @@
1
- <template>
2
- <view
3
- class="prism-switch-component"
4
- :class="{
5
- 'dark-mode': appStore.isDarkMode,
6
- 'active': modelValue,
7
- 'square': square,
8
- 'disabled': disabled,
9
- 'with-text': showText
10
- }"
11
- @click="handleToggle"
12
- >
13
- <!-- 文字显示 -->
14
- <view class="switch-text off-text" v-if="showText">{{ offText }}</view>
15
- <view class="switch-text on-text" v-if="showText">{{ onText }}</view>
16
- <!-- 滑块 -->
17
- <view class="switch-thumb"></view>
18
- </view>
19
- </template>
20
-
21
- <script setup>
22
- import { computed } from 'vue';
23
- import { useAppStore } from '@/store/app';
24
-
25
- const props = defineProps({
26
- modelValue: {
27
- type: Boolean,
28
- default: false
29
- },
30
- // 开启时文字
31
- onText: {
32
- type: String,
33
- default: 'ON'
34
- },
35
- // 关闭时文字
36
- offText: {
37
- type: String,
38
- default: 'OFF'
39
- },
40
- // 是否显示文字
41
- showText: {
42
- type: Boolean,
43
- default: false
44
- },
45
- // 方形开关
46
- square: {
47
- type: Boolean,
48
- default: false
49
- },
50
- // 禁用状态
51
- disabled: {
52
- type: Boolean,
53
- default: false
54
- }
55
- });
56
-
57
- const emit = defineEmits(['update:modelValue', 'change']);
58
-
59
- const appStore = useAppStore();
60
-
61
- function handleToggle() {
62
- if (props.disabled) return;
63
- const newValue = !props.modelValue;
64
- emit('update:modelValue', newValue);
65
- emit('change', newValue);
66
- }
67
- </script>
68
-
69
- <style lang="scss">
70
- .prism-switch-component {
71
- position: relative;
72
- width: 100rpx;
73
- height: 56rpx;
74
- background: var(--prism-border-color-base, #E5E6EB);
75
- border-radius: 28rpx;
76
- transition: all 0.3s ease;
77
- cursor: pointer;
78
- display: inline-flex;
79
- align-items: center;
80
-
81
- // 滑块
82
- .switch-thumb {
83
- position: absolute;
84
- top: 4rpx;
85
- left: 4rpx;
86
- width: 48rpx;
87
- height: 48rpx;
88
- background: #FFFFFF;
89
- border-radius: 50%;
90
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.15);
91
- transition: all 0.3s ease;
92
- z-index: 2;
93
- }
94
-
95
- // 文字样式
96
- .switch-text {
97
- position: absolute;
98
- font-size: 20rpx;
99
- font-weight: 500;
100
- transition: all 0.3s ease;
101
- z-index: 1;
102
- white-space: nowrap;
103
- }
104
-
105
- .on-text {
106
- left: 10rpx;
107
- color: transparent;
108
- }
109
-
110
- .off-text {
111
- right: 10rpx;
112
- color: var(--prism-text-secondary, #86909C);
113
- }
114
-
115
- // 激活状态
116
- &.active {
117
- background: var(--prism-primary-color, #3478F6);
118
-
119
- .switch-thumb {
120
- left: calc(100% - 52rpx);
121
- }
122
-
123
- .on-text {
124
- color: #FFFFFF;
125
- }
126
-
127
- .off-text {
128
- color: transparent;
129
- }
130
- }
131
-
132
- // 带文字时宽度稍大
133
- &.with-text {
134
- width: 88rpx;
135
- height: 48rpx;
136
-
137
- .switch-thumb {
138
- width: 40rpx;
139
- height: 40rpx;
140
- top: 4rpx;
141
- left: 4rpx;
142
- }
143
-
144
- .on-text {
145
- left: 8rpx;
146
- }
147
-
148
- .off-text {
149
- right: 8rpx;
150
- }
151
-
152
- &.active .switch-thumb {
153
- left: calc(100% - 44rpx);
154
- }
155
- }
156
-
157
- // 方形开关
158
- &.square {
159
- border-radius: 12rpx;
160
-
161
- .switch-thumb {
162
- border-radius: 8rpx;
163
- }
164
- }
165
-
166
- // 禁用状态
167
- &.disabled {
168
- opacity: 0.5;
169
- cursor: not-allowed;
170
- pointer-events: none;
171
- }
172
- }
173
-
174
- // 深色模式
175
- .dark-mode.prism-switch-component {
176
- // 关闭状态 - 与checkbox保持一致
177
- background: var(--prism-bg-color-card, #1A1A1A);
178
- border: 2rpx solid var(--prism-border-color-base, #3A3A3A);
179
-
180
- .switch-thumb {
181
- background: var(--prism-text-secondary, #86909C);
182
- }
183
-
184
- .off-text {
185
- color: var(--prism-text-secondary, #86909C);
186
- }
187
-
188
- // 开启状态 - 蓝色(与checkbox一致)
189
- &.active {
190
- background: var(--prism-primary-color, #3478F6);
191
- border-color: var(--prism-primary-color, #3478F6);
192
-
193
- .switch-thumb {
194
- background: #FFFFFF;
195
- }
196
-
197
- .on-text {
198
- color: #FFFFFF;
199
- }
200
- }
201
- }
202
- </style>
1
+ <template>
2
+ <view
3
+ class="prism-switch-component"
4
+ :class="{
5
+ 'dark-mode': appStore.isDarkMode,
6
+ 'active': modelValue,
7
+ 'square': square,
8
+ 'disabled': disabled,
9
+ 'with-text': showText
10
+ }"
11
+ @click="handleToggle"
12
+ >
13
+ <!-- 文字显示 -->
14
+ <view class="switch-text off-text" v-if="showText">{{ offText }}</view>
15
+ <view class="switch-text on-text" v-if="showText">{{ onText }}</view>
16
+ <!-- 滑块 -->
17
+ <view class="switch-thumb"></view>
18
+ </view>
19
+ </template>
20
+
21
+ <script setup>
22
+ import { computed } from 'vue';
23
+ import { useAppStore } from '@/store/app';
24
+
25
+ const props = defineProps({
26
+ modelValue: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ // 开启时文字
31
+ onText: {
32
+ type: String,
33
+ default: 'ON'
34
+ },
35
+ // 关闭时文字
36
+ offText: {
37
+ type: String,
38
+ default: 'OFF'
39
+ },
40
+ // 是否显示文字
41
+ showText: {
42
+ type: Boolean,
43
+ default: false
44
+ },
45
+ // 方形开关
46
+ square: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ // 禁用状态
51
+ disabled: {
52
+ type: Boolean,
53
+ default: false
54
+ }
55
+ });
56
+
57
+ const emit = defineEmits(['update:modelValue', 'change']);
58
+
59
+ const appStore = useAppStore();
60
+
61
+ function handleToggle() {
62
+ if (props.disabled) return;
63
+ const newValue = !props.modelValue;
64
+ emit('update:modelValue', newValue);
65
+ emit('change', newValue);
66
+ }
67
+ </script>
68
+
69
+ <style lang="scss">
70
+ .prism-switch-component {
71
+ position: relative;
72
+ width: 100rpx;
73
+ height: 56rpx;
74
+ background: var(--prism-border-color-base, #E5E6EB);
75
+ border-radius: 28rpx;
76
+ transition: all 0.3s ease;
77
+ cursor: pointer;
78
+ display: inline-flex;
79
+ align-items: center;
80
+
81
+ // 滑块
82
+ .switch-thumb {
83
+ position: absolute;
84
+ top: 4rpx;
85
+ left: 4rpx;
86
+ width: 48rpx;
87
+ height: 48rpx;
88
+ background: #FFFFFF;
89
+ border-radius: 50%;
90
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.15);
91
+ transition: all 0.3s ease;
92
+ z-index: 2;
93
+ }
94
+
95
+ // 文字样式
96
+ .switch-text {
97
+ position: absolute;
98
+ font-size: 20rpx;
99
+ font-weight: 500;
100
+ transition: all 0.3s ease;
101
+ z-index: 1;
102
+ white-space: nowrap;
103
+ }
104
+
105
+ .on-text {
106
+ left: 10rpx;
107
+ color: transparent;
108
+ }
109
+
110
+ .off-text {
111
+ right: 10rpx;
112
+ color: var(--prism-text-secondary, #86909C);
113
+ }
114
+
115
+ // 激活状态
116
+ &.active {
117
+ background: var(--prism-primary-color, #3478F6);
118
+
119
+ .switch-thumb {
120
+ left: calc(100% - 52rpx);
121
+ }
122
+
123
+ .on-text {
124
+ color: #FFFFFF;
125
+ }
126
+
127
+ .off-text {
128
+ color: transparent;
129
+ }
130
+ }
131
+
132
+ // 带文字时宽度稍大
133
+ &.with-text {
134
+ width: 88rpx;
135
+ height: 48rpx;
136
+
137
+ .switch-thumb {
138
+ width: 40rpx;
139
+ height: 40rpx;
140
+ top: 4rpx;
141
+ left: 4rpx;
142
+ }
143
+
144
+ .on-text {
145
+ left: 8rpx;
146
+ }
147
+
148
+ .off-text {
149
+ right: 8rpx;
150
+ }
151
+
152
+ &.active .switch-thumb {
153
+ left: calc(100% - 44rpx);
154
+ }
155
+ }
156
+
157
+ // 方形开关
158
+ &.square {
159
+ border-radius: 12rpx;
160
+
161
+ .switch-thumb {
162
+ border-radius: 8rpx;
163
+ }
164
+ }
165
+
166
+ // 禁用状态
167
+ &.disabled {
168
+ opacity: 0.5;
169
+ cursor: not-allowed;
170
+ pointer-events: none;
171
+ }
172
+ }
173
+
174
+ // 深色模式
175
+ .dark-mode.prism-switch-component {
176
+ // 关闭状态 - 与checkbox保持一致
177
+ background: var(--prism-bg-color-card, #1A1A1A);
178
+ border: 2rpx solid var(--prism-border-color-base, #3A3A3A);
179
+
180
+ .switch-thumb {
181
+ background: var(--prism-text-secondary, #86909C);
182
+ }
183
+
184
+ .off-text {
185
+ color: var(--prism-text-secondary, #86909C);
186
+ }
187
+
188
+ // 开启状态 - 蓝色(与checkbox一致)
189
+ &.active {
190
+ background: var(--prism-primary-color, #3478F6);
191
+ border-color: var(--prism-primary-color, #3478F6);
192
+
193
+ .switch-thumb {
194
+ background: #FFFFFF;
195
+ }
196
+
197
+ .on-text {
198
+ color: #FFFFFF;
199
+ }
200
+ }
201
+ }
202
+ </style>