v-uni-app-ui 1.0.2 → 1.0.6

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 (65) hide show
  1. package/README.md +127 -0
  2. package/dist/v-uni-app-ui.css +1 -0
  3. package/dist/v-uni-app-ui.es.js +6569 -0
  4. package/dist/v-uni-app-ui.umd.js +7 -0
  5. package/package.json +28 -8
  6. package/components/config.js +0 -123
  7. package/components/layout/v-card/v-card.vue +0 -108
  8. package/components/layout/v-grid/v-grid.vue +0 -162
  9. package/components/layout/v-icon-grid/v-icon-grid.vue +0 -195
  10. package/components/layout/v-infinite-scroll/v-infinite-scroll.vue +0 -172
  11. package/components/layout/v-list/v-list.vue +0 -43
  12. package/components/layout/v-row/v-row.vue +0 -142
  13. package/components/layout/v-waterfall/v-waterfall.vue +0 -79
  14. package/components/model/compound/v-checkbox-group/v-checkbox-group.vue +0 -96
  15. package/components/model/compound/v-console/v-console.js +0 -20
  16. package/components/model/compound/v-console/v-console.vue +0 -299
  17. package/components/model/compound/v-date-time/v-date-time.vue +0 -261
  18. package/components/model/compound/v-dialog/v-dialog.vue +0 -178
  19. package/components/model/compound/v-drum-select-picker/v-drum-select-picker.vue +0 -83
  20. package/components/model/compound/v-form/v-form.vue +0 -226
  21. package/components/model/compound/v-form-item/v-form-item.vue +0 -255
  22. package/components/model/compound/v-image/v-image.vue +0 -357
  23. package/components/model/compound/v-input-desensitize/v-input-desensitize.vue +0 -101
  24. package/components/model/compound/v-page/v-page.vue +0 -11
  25. package/components/model/compound/v-pages/v-pages.vue +0 -141
  26. package/components/model/compound/v-picker-list/v-picker-list.vue +0 -109
  27. package/components/model/compound/v-popup/v-popup.vue +0 -151
  28. package/components/model/compound/v-radio-group/v-radio-group.vue +0 -86
  29. package/components/model/compound/v-select-picker/v-select-picker.vue +0 -202
  30. package/components/model/compound/v-series-picker-list/v-series-picker-list.vue +0 -221
  31. package/components/model/compound/v-series-select-picker/v-series-select-picker.vue +0 -203
  32. package/components/model/compound/v-switch/v-switch.vue +0 -136
  33. package/components/model/compound/v-tabs-page/v-tabs-page.vue +0 -138
  34. package/components/model/native/v-badge/v-badge.vue +0 -143
  35. package/components/model/native/v-button/v-button.vue +0 -273
  36. package/components/model/native/v-carousel/v-carousel.vue +0 -138
  37. package/components/model/native/v-checkbox/v-checkbox.vue +0 -215
  38. package/components/model/native/v-collapse/v-collapse.vue +0 -190
  39. package/components/model/native/v-header-navigation-bar/v-header-navigation-bar.vue +0 -92
  40. package/components/model/native/v-input/v-input.vue +0 -352
  41. package/components/model/native/v-input-code/v-input-code.vue +0 -146
  42. package/components/model/native/v-loading/v-loading.vue +0 -206
  43. package/components/model/native/v-menu/v-menu.vue +0 -222
  44. package/components/model/native/v-menu-slide/v-menu-slide.vue +0 -364
  45. package/components/model/native/v-min-loading/v-min-loading.vue +0 -80
  46. package/components/model/native/v-null/v-null.vue +0 -97
  47. package/components/model/native/v-overlay/v-overlay.vue +0 -96
  48. package/components/model/native/v-pull-up-refresh/v-pull-up-refresh.vue +0 -157
  49. package/components/model/native/v-radio/v-radio.vue +0 -138
  50. package/components/model/native/v-scroll-list/v-scroll-list.vue +0 -169
  51. package/components/model/native/v-steps/v-steps.vue +0 -253
  52. package/components/model/native/v-table/v-table.vue +0 -203
  53. package/components/model/native/v-tabs/v-tabs.vue +0 -235
  54. package/components/model/native/v-tag/v-tag.vue +0 -206
  55. package/components/model/native/v-text/v-text.vue +0 -187
  56. package/components/model/native/v-text-button/v-text-button.vue +0 -139
  57. package/components/model/native/v-textarea/v-textarea.vue +0 -178
  58. package/components/model/native/v-title/v-title.vue +0 -91
  59. package/components/model/native/v-toast/info.png +0 -0
  60. package/components/model/native/v-toast/success.png +0 -0
  61. package/components/model/native/v-toast/v-toast.vue +0 -198
  62. package/components/model/native/v-toast/warn.png +0 -0
  63. package/components/model/native/v-upload-file-button/v-upload-file-button.vue +0 -296
  64. package/components/model/native/v-video/v-video.vue +0 -175
  65. package/components/model/native/v-window/v-window.vue +0 -158
@@ -1,261 +0,0 @@
1
- <template>
2
- <v-popup v-model:value="isPopupVisible" :title="title" :scrollHeight="scrollHeight" model="semicircle" @close="handleClose" @confirm="handleConfirm">
3
- <view class="drum-select-container">
4
- <view class="drum-select-content">
5
- <v-scroll-list
6
- :value="value.getFullYear()"
7
- :options="generateYearRange(props.maxDateTime.getFullYear(), props.minDateTime.getFullYear())"
8
- :scrollHeight="scrollHeight"
9
- @update:value="handleValueChangeYear($event)"
10
- />
11
- <v-text class="separate-symbol">:</v-text>
12
- <v-scroll-list
13
- :value="value.getMonth() + 1"
14
- :options="generateMonthRange(props.maxDateTime.getMonth(), props.minDateTime.getMonth())"
15
- :scrollHeight="scrollHeight"
16
- @update:value="handleValueChangeMonth($event)"
17
- />
18
- <v-text class="separate-symbol">:</v-text>
19
- <v-scroll-list
20
- :value="value.getDate()"
21
- :options="generateDateRange(props.maxDateTime.getDate(), props.minDateTime.getDate())"
22
- :scrollHeight="scrollHeight"
23
- @update:value="handleValueChangeDate($event)"
24
- />
25
- <v-text class="separate-symbol">:</v-text>
26
- <v-scroll-list
27
- :value="hoursSystem ? value.getHours() || 24 : value.getHours() % 12 || 12"
28
- :options="generateHoursRange(props.maxDateTime.getHours(), props.minDateTime.getHours())"
29
- :scrollHeight="scrollHeight"
30
- @update:value="handleValueChangeHours($event)"
31
- />
32
- <v-text class="separate-symbol">:</v-text>
33
- <v-scroll-list
34
- :value="value.getMinutes()"
35
- :options="generateMinutesRange(props.maxDateTime.getMinutes(), props.minDateTime.getMinutes())"
36
- :scrollHeight="scrollHeight"
37
- @update:value="handleValueChangeMinutes($event)"
38
- />
39
- <v-text class="separate-symbol">:</v-text>
40
- <v-scroll-list
41
- :value="value.getSeconds()"
42
- :options="generateSecondsRange(props.maxDateTime.getSeconds(), props.minDateTime.getSeconds())"
43
- :scrollHeight="scrollHeight"
44
- @update:value="handleValueChangeSeconds($event)"
45
- />
46
- </view>
47
- </view>
48
- </v-popup>
49
- </template>
50
-
51
- <script lang="ts" setup>
52
- import { ref, computed, watch, inject } from 'vue';
53
-
54
- interface DrumSelectPicker {
55
- value: any;
56
- label: string;
57
- children?: DrumSelectPicker[];
58
- }
59
- const props = defineProps({
60
- title: {
61
- type: String,
62
- default: '',
63
- required: true
64
- },
65
- scrollHeight: {
66
- type: Number,
67
- default: 400
68
- },
69
- value: {
70
- type: Date,
71
- default: new Date(),
72
- required: true
73
- },
74
- show: {
75
- type: Boolean,
76
- default: true
77
- },
78
- minDateTime: {
79
- type: Date,
80
- default: new Date('1000-1-1'),
81
- required: true
82
- },
83
- maxDateTime: {
84
- type: Date,
85
- default: new Date('9999-12-31'),
86
- required: true
87
- },
88
- hoursSystem: {
89
- type: Boolean,
90
- default: false
91
- }
92
- });
93
-
94
- const emit = defineEmits([
95
- 'update:value',
96
- 'handleValueChangeYear',
97
- 'handleValueChangeMonth',
98
- 'handleValueChangeDate',
99
- 'handleValueChangeHours',
100
- 'handleValueChangeMinutes',
101
- 'handleValueChangeSeconds',
102
- 'close',
103
- 'confirm',
104
- 'update:show'
105
- ]);
106
-
107
- const isPopupVisible = ref(props.show);
108
- const config = inject<any>('config');
109
- function generateYearRange(maxYear: any, minYear: any) {
110
- const yearRange = [];
111
- for (let year = maxYear; year >= minYear; year--) {
112
- yearRange.push({
113
- value: year,
114
- label: `${year}`
115
- });
116
- }
117
- return yearRange;
118
- }
119
-
120
- function generateMonthRange(maxMonth: any, minMonth: any) {
121
- const monthRange = [];
122
- for (let month = maxMonth + 1; month > minMonth; month--) {
123
- monthRange.push({
124
- value: month,
125
- label: `${month}`
126
- });
127
- }
128
- return monthRange;
129
- }
130
-
131
- function generateDateRange(maxDate: any, minDate: any) {
132
- const dayRange = [];
133
- const daysInMonth = new Date(props.value.getFullYear(), props.value.getMonth() + 1, 0).getDate();
134
- const actualMaxDate = Math.min(maxDate, daysInMonth);
135
- for (let day = actualMaxDate; day >= minDate; day--) {
136
- dayRange.push({
137
- value: day,
138
- label: `${day}`
139
- });
140
- }
141
- return dayRange;
142
- }
143
-
144
- function generateHoursRange() {
145
- const hoursRange = [];
146
- if (props.hoursSystem) {
147
- // 24小时制
148
- for (let hour = 24; hour > 0; hour--) {
149
- hoursRange.push({
150
- value: hour,
151
- label: `${hour}`
152
- });
153
- }
154
- } else {
155
- // 12小时制
156
- for (let hour = 12; hour >= 1; hour--) {
157
- hoursRange.push({
158
- value: hour,
159
- label: `${hour}`
160
- });
161
- }
162
- }
163
- return hoursRange;
164
- }
165
-
166
- function generateMinutesRange() {
167
- const minutesRange = [];
168
- for (let minute = 60; minute > 0; minute--) {
169
- minutesRange.push({
170
- value: minute,
171
- label: `${minute < 10 ? '0' + minute : minute}`
172
- });
173
- }
174
- return minutesRange;
175
- }
176
-
177
- function generateSecondsRange() {
178
- const secondsRange = [];
179
- for (let second = 60; second > 0; second--) {
180
- secondsRange.push({
181
- value: second,
182
- label: `${second < 10 ? '0' + second : second}`
183
- });
184
- }
185
- return secondsRange;
186
- }
187
-
188
- const handleValueChangeYear = (year: number) => {
189
- props.value.setFullYear(year);
190
- emit('handleValueChangeYear', year);
191
- };
192
- const handleValueChangeMonth = (month: number) => {
193
- props.value.setMonth(month);
194
- emit('handleValueChangeMonth', month);
195
- };
196
- const handleValueChangeDate = (date: number) => {
197
- props.value.setDate(date);
198
- emit('handleValueChangeDate', date);
199
- };
200
- const handleValueChangeHours = (hours: number) => {
201
- props.value.setHours(hours);
202
- emit('handleValueChangeHours', hours);
203
- };
204
- const handleValueChangeMinutes = (minutes: number) => {
205
- props.value.setMinutes(minutes);
206
- emit('handleValueChangeMinutes', minutes);
207
- };
208
- const handleValueChangeSeconds = (seconds: number) => {
209
- props.value.setSeconds(seconds);
210
- emit('handleValueChangeSeconds', seconds);
211
- };
212
-
213
- watch(
214
- () => props.show,
215
- (val) => {
216
- isPopupVisible.value = val;
217
- }
218
- );
219
-
220
- const handleClose = () => {
221
- isPopupVisible.value = false;
222
- emit('update:show', false);
223
- emit('close', false);
224
- };
225
- const handleConfirm = () => {
226
- isPopupVisible.value = false;
227
- emit('update:show', false);
228
- emit('confirm', props.value);
229
- };
230
- </script>
231
-
232
- <style lang="scss" scoped>
233
- .drum-select-container {
234
- position: relative;
235
- width: 100%;
236
- height: 100%;
237
- display: flex;
238
- align-items: center;
239
- }
240
-
241
- .drum-select-content {
242
- position: relative;
243
- width: 100%;
244
- height: 60%;
245
- overflow: hidden;
246
- display: flex;
247
- view {
248
- flex: 1;
249
- }
250
- }
251
-
252
- .separate-symbol {
253
- font-size: v-bind("config.fontSize.mediumText");
254
- height: 85rpx;
255
- line-height: 85rpx !important;
256
- display: block !important;
257
- background-color: v-bind('config.VDateTime.backgroundColor');
258
- border-top: 1rpx solid v-bind('config.border.color');
259
- border-bottom: 1rpx solid v-bind('config.border.color');
260
- }
261
- </style>
@@ -1,178 +0,0 @@
1
- <template>
2
- <view class="v-dialog-overlay" v-if="visible">
3
- <view :class="['v-dialog', `v-dialog--${size}`]" :style="dialogStyle">
4
- <view class="v-dialog-header">
5
- <slot name="header">
6
- <text class="v-dialog-title">{{ title }}</text>
7
- <button class="v-dialog-close" @click="handleClose">×</button>
8
- </slot>
9
- </view>
10
-
11
- <view class="v-dialog-body">
12
- <slot></slot>
13
- </view>
14
- <view class="v-dialog-footer">
15
- <slot name="footer">
16
- <view class="v-dialog-buttons">
17
- <v-button type="info" @click="handleClose">取消</v-button>
18
- <v-button @click="handleSubmit">确定</v-button>
19
- </view>
20
- </slot>
21
- </view>
22
- </view>
23
- </view>
24
- </template>
25
-
26
- <script setup lang="ts">
27
- import { ref, computed, watch,inject } from 'vue';
28
-
29
- /**
30
- * v-dialog 对话框
31
- * value 是否显示
32
- * title 标题
33
- * size 大小
34
- * width 宽度
35
- * height 长度
36
- * isCover 是否需要遮罩层 默认值:true 可选值:false不需要 true需要
37
- *
38
- * 相关事件close、submit
39
- */
40
- const props = defineProps({
41
- value: {
42
- type: Boolean,
43
- default: false
44
- },
45
- title: {
46
- type: String,
47
- default: ''
48
- },
49
- size: {
50
- type: String,
51
- default: 'medium',
52
- validator: (value: string) => {
53
- return ['small', 'medium', 'large'].includes(value);
54
- }
55
- },
56
- width: {
57
- type: [String, Number],
58
- default: ''
59
- },
60
- height: {
61
- type: [String, Number],
62
- default: ''
63
- },
64
- isCover: {
65
- type: Boolean,
66
- default: true
67
- }
68
- });
69
-
70
- const emit = defineEmits(['update:value', 'close', 'submit']);
71
-
72
- const config = inject<any>('config');
73
- const visible = ref(props.value);
74
-
75
- watch(
76
- () => props.value,
77
- (newVal) => {
78
- visible.value = newVal;
79
- }
80
- );
81
-
82
- const dialogStyle = computed(() => {
83
- const style: Record<string, string | number> = {};
84
- if (props.width) style.width = `${props.width}`;
85
- if (props.height) style.height = `${props.height}`;
86
- return style;
87
- });
88
-
89
- const handleClose = () => {
90
- visible.value = false;
91
- emit('update:value', false);
92
- emit('close');
93
- };
94
-
95
- const handleSubmit = () => {
96
- visible.value = false;
97
- emit('update:value', false);
98
- emit('submit');
99
- };
100
- const overlay = props.isCover ? `rgba(0,0,0,${config.opacity.mask})` : 'transparent';
101
- </script>
102
-
103
- <style lang="scss" scoped>
104
- .v-dialog-overlay {
105
- position: fixed;
106
- top: 0;
107
- left: 0;
108
- right: 0;
109
- bottom: 0;
110
- background-color: v-bind("overlay");
111
- display: flex;
112
- justify-content: center;
113
- align-items: center;
114
- z-index: 1000;
115
- }
116
-
117
- .v-dialog {
118
- width: 600rpx;
119
- background-color: v-bind("config.backgroundColor.reversal");
120
- overflow: hidden;
121
-
122
- &--small {
123
- width: 500rpx;
124
- }
125
-
126
- &--medium {
127
- width: 600rpx;
128
- }
129
-
130
- &--large {
131
- width: 700rpx;
132
- }
133
-
134
- .v-dialog-header {
135
- display: flex;
136
- justify-content: space-between;
137
- align-items: center;
138
- padding: 16rpx;
139
- border-bottom: 1rpx solid v-bind("config.border.color");
140
- }
141
-
142
- .v-dialog-title {
143
- font-size: v-bind("config.fontSize.smallTitle");
144
- font-weight: bold;
145
- color: v-bind("config.fontColor.mianTitle");
146
- }
147
-
148
- .v-dialog-close {
149
- background: none;
150
- border: none;
151
- font-size: v-bind("config.fontSize.mediumText");
152
- cursor: pointer;
153
- color: v-bind("config.fontColor.text");
154
- margin: 0;
155
- }
156
-
157
- .v-dialog-body {
158
- padding: 16rpx;
159
- overflow-y: auto;
160
- }
161
-
162
- .v-dialog-footer {
163
- padding: 16rpx;
164
- border-top: 1rpx solid v-bind("config.border.color");
165
- text-align: right;
166
- .v-dialog-buttons {
167
- display: flex;
168
- justify-content: right;
169
- width: 100%;
170
- height: 100%;
171
-
172
- .v-button {
173
- margin: 0 10rpx;
174
- }
175
- }
176
- }
177
- }
178
- </style>
@@ -1,83 +0,0 @@
1
- <template>
2
- <v-popup v-model:value="isPopupVisible" :title="title" :scrollHeight="400" model="square" @close="handleClose">
3
- <view class="drum-select-container">
4
- <view class="drum-select-content">
5
- <v-scroll-list :options="options" v-model="selectedValue" :scroll-height="scrollHeight" :item-height="itemHeight" @update:value="handleValueUpdate" />
6
- </view>
7
- </view>
8
- </v-popup>
9
- </template>
10
-
11
- <script lang="ts" setup>
12
- import { ref, watch, inject } from 'vue';
13
-
14
- interface DrumSelectPicker {
15
- value: any;
16
- label: string;
17
- }
18
-
19
- const props = defineProps({
20
- title: {
21
- type: String,
22
- default: '选择选项'
23
- },
24
- scrollHeight: {
25
- type: Number,
26
- default: 300
27
- },
28
- options: {
29
- type: Array,
30
- default: () => [],
31
- required: true
32
- },
33
- value: {
34
- type: [String, Number],
35
- default: ''
36
- },
37
- show: {
38
- type: Boolean,
39
- default: false
40
- },
41
- itemHeight: {
42
- type: Number,
43
- default: 80
44
- }
45
- });
46
-
47
- const emit = defineEmits(['update:value', 'close']);
48
-
49
- const isPopupVisible = ref(props.show);
50
- const selectedValue = ref(props.value);
51
- const config = inject<any>('config');
52
-
53
- watch(
54
- () => props.value,
55
- (newVal) => {
56
- selectedValue.value = newVal;
57
- }
58
- );
59
-
60
- function openPopup() {
61
- isPopupVisible.value = true;
62
- }
63
-
64
- function handleClose() {
65
- isPopupVisible.value = false;
66
- emit('close');
67
- }
68
-
69
- function handleValueUpdate(value: any) {
70
- emit('update:value', value);
71
- }
72
- </script>
73
-
74
- <style lang="scss" scoped>
75
- .drum-select-container {
76
- padding: 20rpx;
77
- }
78
-
79
- .drum-select-content {
80
- max-height: 500rpx;
81
- overflow: hidden;
82
- }
83
- </style>