@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,156 +1,156 @@
1
- <template>
2
- <view class="prism-code-input" :class="{ 'dark-mode': appStore.isDarkMode }">
3
- <view class="code-boxes">
4
- <view
5
- v-for="(item, index) in codeLength"
6
- :key="index"
7
- class="code-box"
8
- :class="{ 'active': focusIndex === index, 'filled': codeArray[index] }"
9
- @click="handleFocus"
10
- >
11
- <text class="code-text">{{ codeArray[index] || '' }}</text>
12
- <view class="cursor" v-if="focusIndex === index && !codeArray[index]"></view>
13
- </view>
14
- </view>
15
- <input
16
- ref="hiddenInput"
17
- class="hidden-input"
18
- type="number"
19
- :maxlength="codeLength"
20
- v-model="codeValue"
21
- :focus="isFocused"
22
- @input="handleInput"
23
- @focus="isFocused = true"
24
- @blur="isFocused = false"
25
- />
26
- </view>
27
- </template>
28
-
29
- <script setup>
30
- import { ref, computed, watch } from 'vue';
31
- import { useAppStore } from '@/store/app';
32
-
33
- const props = defineProps({
34
- length: {
35
- type: Number,
36
- default: 6
37
- },
38
- modelValue: {
39
- type: String,
40
- default: ''
41
- }
42
- });
43
-
44
- const emit = defineEmits(['update:modelValue', 'complete']);
45
-
46
- const appStore = useAppStore();
47
- const codeValue = ref(props.modelValue);
48
- const isFocused = ref(false);
49
-
50
- const codeLength = computed(() => props.length);
51
-
52
- const codeArray = computed(() => {
53
- return codeValue.value.split('').slice(0, props.length);
54
- });
55
-
56
- const focusIndex = computed(() => {
57
- if (!isFocused.value) return -1;
58
- return Math.min(codeArray.value.length, props.length - 1);
59
- });
60
-
61
- function handleFocus() {
62
- isFocused.value = true;
63
- }
64
-
65
- function handleInput(e) {
66
- const value = e.detail.value.replace(/\D/g, '').slice(0, props.length);
67
- codeValue.value = value;
68
- emit('update:modelValue', value);
69
-
70
- if (value.length === props.length) {
71
- emit('complete', value);
72
- }
73
- }
74
-
75
- watch(() => props.modelValue, (val) => {
76
- codeValue.value = val;
77
- });
78
- </script>
79
-
80
- <style lang="scss">
81
- .prism-code-input {
82
- position: relative;
83
-
84
- .code-boxes {
85
- display: flex;
86
- gap: 16rpx;
87
- }
88
-
89
- .code-box {
90
- width: 76rpx;
91
- height: 88rpx;
92
- background: var(--prism-input-bg, #EBEEF2);
93
- border-radius: 12rpx;
94
- display: flex;
95
- align-items: center;
96
- justify-content: center;
97
- position: relative;
98
- transition: all 0.2s ease;
99
- border: 2rpx solid transparent;
100
-
101
- &.active {
102
- border-color: var(--prism-primary-color, #3478F6);
103
- background: var(--prism-primary-light, rgba(52, 120, 246, 0.08));
104
- }
105
-
106
- &.filled {
107
- background: var(--prism-primary-light, rgba(52, 120, 246, 0.08));
108
- }
109
-
110
- .code-text {
111
- font-size: 48rpx;
112
- font-weight: 600;
113
- color: var(--prism-text-primary, #1D2129);
114
- }
115
-
116
- .cursor {
117
- position: absolute;
118
- width: 4rpx;
119
- height: 40rpx;
120
- background: var(--prism-primary-color, #3478F6);
121
- animation: blink 1s infinite;
122
- }
123
- }
124
-
125
- .hidden-input {
126
- position: absolute;
127
- left: -9999rpx;
128
- opacity: 0;
129
- width: 1rpx;
130
- height: 1rpx;
131
- }
132
-
133
- @keyframes blink {
134
- 0%, 50% { opacity: 1; }
135
- 51%, 100% { opacity: 0; }
136
- }
137
- }
138
-
139
- .dark-mode .prism-code-input {
140
- .code-box {
141
- background: var(--prism-input-bg, #2A2A2A);
142
-
143
- &.active {
144
- background: rgba(52, 120, 246, 0.15);
145
- }
146
-
147
- &.filled {
148
- background: rgba(52, 120, 246, 0.15);
149
- }
150
-
151
- .code-text {
152
- color: var(--prism-text-primary, #E5E6EB);
153
- }
154
- }
155
- }
156
- </style>
1
+ <template>
2
+ <view class="prism-code-input" :class="{ 'dark-mode': appStore.isDarkMode }">
3
+ <view class="code-boxes">
4
+ <view
5
+ v-for="(item, index) in codeLength"
6
+ :key="index"
7
+ class="code-box"
8
+ :class="{ 'active': focusIndex === index, 'filled': codeArray[index] }"
9
+ @click="handleFocus"
10
+ >
11
+ <text class="code-text">{{ codeArray[index] || '' }}</text>
12
+ <view class="cursor" v-if="focusIndex === index && !codeArray[index]"></view>
13
+ </view>
14
+ </view>
15
+ <input
16
+ ref="hiddenInput"
17
+ class="hidden-input"
18
+ type="number"
19
+ :maxlength="codeLength"
20
+ v-model="codeValue"
21
+ :focus="isFocused"
22
+ @input="handleInput"
23
+ @focus="isFocused = true"
24
+ @blur="isFocused = false"
25
+ />
26
+ </view>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { ref, computed, watch } from 'vue';
31
+ import { useAppStore } from '@/store/app';
32
+
33
+ const props = defineProps({
34
+ length: {
35
+ type: Number,
36
+ default: 6
37
+ },
38
+ modelValue: {
39
+ type: String,
40
+ default: ''
41
+ }
42
+ });
43
+
44
+ const emit = defineEmits(['update:modelValue', 'complete']);
45
+
46
+ const appStore = useAppStore();
47
+ const codeValue = ref(props.modelValue);
48
+ const isFocused = ref(false);
49
+
50
+ const codeLength = computed(() => props.length);
51
+
52
+ const codeArray = computed(() => {
53
+ return codeValue.value.split('').slice(0, props.length);
54
+ });
55
+
56
+ const focusIndex = computed(() => {
57
+ if (!isFocused.value) return -1;
58
+ return Math.min(codeArray.value.length, props.length - 1);
59
+ });
60
+
61
+ function handleFocus() {
62
+ isFocused.value = true;
63
+ }
64
+
65
+ function handleInput(e) {
66
+ const value = e.detail.value.replace(/\D/g, '').slice(0, props.length);
67
+ codeValue.value = value;
68
+ emit('update:modelValue', value);
69
+
70
+ if (value.length === props.length) {
71
+ emit('complete', value);
72
+ }
73
+ }
74
+
75
+ watch(() => props.modelValue, (val) => {
76
+ codeValue.value = val;
77
+ });
78
+ </script>
79
+
80
+ <style lang="scss">
81
+ .prism-code-input {
82
+ position: relative;
83
+
84
+ .code-boxes {
85
+ display: flex;
86
+ gap: 16rpx;
87
+ }
88
+
89
+ .code-box {
90
+ width: 76rpx;
91
+ height: 88rpx;
92
+ background: var(--prism-input-bg, #EBEEF2);
93
+ border-radius: 12rpx;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ position: relative;
98
+ transition: all 0.2s ease;
99
+ border: 2rpx solid transparent;
100
+
101
+ &.active {
102
+ border-color: var(--prism-primary-color, #3478F6);
103
+ background: var(--prism-primary-light, rgba(52, 120, 246, 0.08));
104
+ }
105
+
106
+ &.filled {
107
+ background: var(--prism-primary-light, rgba(52, 120, 246, 0.08));
108
+ }
109
+
110
+ .code-text {
111
+ font-size: 48rpx;
112
+ font-weight: 600;
113
+ color: var(--prism-text-primary, #1D2129);
114
+ }
115
+
116
+ .cursor {
117
+ position: absolute;
118
+ width: 4rpx;
119
+ height: 40rpx;
120
+ background: var(--prism-primary-color, #3478F6);
121
+ animation: blink 1s infinite;
122
+ }
123
+ }
124
+
125
+ .hidden-input {
126
+ position: absolute;
127
+ left: -9999rpx;
128
+ opacity: 0;
129
+ width: 1rpx;
130
+ height: 1rpx;
131
+ }
132
+
133
+ @keyframes blink {
134
+ 0%, 50% { opacity: 1; }
135
+ 51%, 100% { opacity: 0; }
136
+ }
137
+ }
138
+
139
+ .dark-mode .prism-code-input {
140
+ .code-box {
141
+ background: var(--prism-input-bg, #2A2A2A);
142
+
143
+ &.active {
144
+ background: rgba(52, 120, 246, 0.15);
145
+ }
146
+
147
+ &.filled {
148
+ background: rgba(52, 120, 246, 0.15);
149
+ }
150
+
151
+ .code-text {
152
+ color: var(--prism-text-primary, #E5E6EB);
153
+ }
154
+ }
155
+ }
156
+ </style>