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,203 +0,0 @@
1
- <template>
2
- <view class="select-picker">
3
- <view :class="['select-input', `select-input--border-${borderModel}`, { 'select-input--disabled': disabled }]" @click="handleClick">
4
- <slot :placeholder="placeholder" :row="row" >
5
- <view class="input">
6
- {{ row.label !== null ? row.label : props.placeholder }}
7
- </view>
8
- </slot>
9
- </view>
10
-
11
- <v-series-picker-list
12
- v-model:value="showPicker"
13
- :list="props.options"
14
- :title="props.title"
15
- @confirm="handleConfirm"
16
- @select="handleSelect"
17
- :scroll-height="scrollHeight"
18
- :selected="value"
19
- ></v-series-picker-list>
20
- </view>
21
- </template>
22
-
23
- <script setup lang="ts">
24
- import { ref, watch, onMounted, reactive,inject } from 'vue';
25
-
26
- interface PickerItem {
27
- label: string;
28
- value: string;
29
- children?: PickerItem[];
30
- }
31
-
32
- /**
33
- * v-series-select-picker 多选下拉框
34
- * value 双向绑定
35
- * placeholder 提示语
36
- * title 标题
37
- * options 选择值
38
- * initializeCustomizeFunction 自定义初始函数
39
- * borderModel 边框模式 默认:all 可选值:all普通边框 nont无边框模式 bottom底部边框模式 top上边框模式 left左边框模式 right右边框模式 ends左右两端边框模式 up-down上下边框模式
40
- * disabled 是否禁用 默认:false 可选值:true禁用 false不禁用
41
- * 相关事件:confirm、select
42
- */
43
- const props = defineProps({
44
- value: {
45
- type: [String, Number, Array],
46
- required: true
47
- },
48
- placeholder: {
49
- type: String,
50
- default: null
51
- },
52
- title: {
53
- type: String,
54
- required: true
55
- },
56
- options: {
57
- type: Array as () => PickerItem[],
58
- required: true
59
- },
60
- isInputBoder: {
61
- type: Boolean,
62
- default: true
63
- },
64
- initializeCustomizeFunction: {
65
- type: Function,
66
- default: () => {
67
- return () => {};
68
- }
69
- },
70
- borderModel: {
71
- type: String,
72
- default: 'all',
73
- validator: (value: any) => {
74
- return ['all', 'none', 'bottom', 'top', 'left', 'right', 'ends', 'up-down'].includes(value);
75
- }
76
- },
77
- disabled: {
78
- type: Boolean,
79
- default: false
80
- },
81
- scrollHeight: {
82
- type: Number,
83
- default: 400
84
- }
85
- });
86
-
87
- let row = reactive({
88
- label: null,
89
- value: null
90
- });
91
-
92
- const emit = defineEmits(['update:value', 'confirm', 'select']);
93
-
94
- const config = inject<any>('config');
95
- onMounted(async () => {
96
- await props.initializeCustomizeFunction(props.value);
97
- matchingData(props.value);
98
- });
99
-
100
- watch(
101
- () => props.value,
102
- (newValue: any) => {
103
- matchingData(newValue);
104
- }
105
- );
106
- watch(
107
- () => props.options,
108
- (newValue: any) => {
109
- matchingData(props.value);
110
- }
111
- );
112
-
113
- function matchingData(value: any) {
114
- const result = props.options
115
- .filter((option) => {
116
- return option.children && Array.isArray(option.children) && option.children.some((child) => child.value === value);
117
- })
118
- .map((option) => {
119
- return option.children && Array.isArray(option.children) ? option.children.find((child) => child.value === value) : undefined;
120
- })
121
- .filter(Boolean);
122
-
123
- if (result.length > 0) {
124
- Object.assign(row, result[0]);
125
- }
126
- }
127
-
128
- const showPicker = ref(false);
129
-
130
- function handleClick() {
131
- if (!props.disabled) {
132
- showPicker.value = true;
133
- }
134
- }
135
-
136
- function handleConfirm(result: any) {
137
- Object.assign(row, result[result.length - 1]);
138
- emit('update:value', row.value);
139
- emit('confirm', row);
140
- showPicker.value = false;
141
- }
142
-
143
- function handleSelect(selected: any) {
144
- emit('select', selected);
145
- }
146
- </script>
147
-
148
- <style lang="scss" scoped>
149
- .select-input {
150
- width: 100%;
151
- height: 72rpx;
152
- line-height: 72rpx;
153
- background-color: v-bind("config.backgroundColor.reversal");
154
- border-radius: 10rpx;
155
- box-sizing: border-box;
156
-
157
- &--border-all {
158
- border: 1rpx solid v-bind("config.border.color");
159
- }
160
-
161
- &--border-none {
162
- border: none;
163
- }
164
-
165
- &--border-bottom {
166
- border-bottom: 1rpx solid v-bind("config.border.color");
167
- }
168
-
169
- &--border-top {
170
- border-top: 1rpx solid v-bind("config.border.color");
171
- }
172
-
173
- &--border-left {
174
- border-left: 1rpx solid v-bind("config.border.color");
175
- }
176
-
177
- &--border-right {
178
- border-right: 1rpx solid v-bind("config.border.color");
179
- }
180
-
181
- &--border-ends {
182
- border-left: 1rpx solid v-bind("config.border.color");
183
- border-right: 1rpx solid v-bind("config.border.color");
184
- }
185
-
186
- &--border-up-down {
187
- border-top: 1rpx solid v-bind("config.border.color");
188
- border-bottom: 1rpx solid v-bind("config.border.color");
189
- }
190
-
191
- &--disabled {
192
- background-color: v-bind("config.backgroundColor.disabled");
193
- color: v-bind("config.fontColor.mainText");
194
- opacity: v-bind("config.opacity.disabled");
195
- cursor: not-allowed;
196
- }
197
-
198
- .input {
199
- width: 100%;
200
- font-size: v-bind("config.fontSize.mediumText");
201
- }
202
- }
203
- </style>
@@ -1,136 +0,0 @@
1
- <template>
2
- <view class="v-switch" :class="{ 'is-disabled': disabled }" @click="toggleSwitch" :style="{ width: trackWidth, height: trackHeight }">
3
- <view class="switch-track" :style="trackStyle">
4
- <view class="switch-thumb" :style="thumbStyle">
5
- <v-min-loading
6
- v-model:value="props.loading"
7
- type="customize"
8
- :customize-color="props.loadingCustomizeColor"
9
- :vacancy-color="props.loadingVacancyColor"
10
- ></v-min-loading>
11
- </view>
12
- </view>
13
- </view>
14
- </template>
15
-
16
- <script lang="ts" setup>
17
- import { computed,inject } from 'vue';
18
-
19
- /**
20
- * v-switch 开关
21
- * value 默认值:false 可选值:false关、true开
22
- * disabled 默认值:false 可选值:false不禁用、true禁用
23
- * activeColor 开启颜色
24
- * inactiveColor 关闭颜色
25
- * size 大小
26
- * loading 是否加载
27
- * loadingCustomizeColor 加载圈自定义颜色
28
- * loadingVacancyColor 加载圈缺口自定义颜色
29
- */
30
- const props = defineProps({
31
- value: {
32
- type: Boolean,
33
- default: false
34
- },
35
- disabled: {
36
- type: Boolean,
37
- default: false
38
- },
39
- activeColor: {
40
- type: String,
41
- default: '#4cd964'
42
- },
43
- inactiveColor: {
44
- type: String,
45
- default: '#ebedf0'
46
- },
47
- size: {
48
- type: [String, Number],
49
- default: 'medium'
50
- },
51
- loading: {
52
- type: Boolean,
53
- default: false
54
- },
55
- loadingCustomizeColor: {
56
- type: String,
57
- default: "#969696"
58
- },
59
- loadingVacancyColor: {
60
- type: String,
61
- default: '#fff'
62
- }
63
- });
64
-
65
- const emit = defineEmits(['update:value']);
66
- const config = inject<any>('config');
67
- // 尺寸计算
68
- const sizeMap = {
69
- small: 40,
70
- medium: 50,
71
- large: 60
72
- };
73
-
74
- const trackWidth = computed(() => {
75
- if (typeof props.size === 'number') return `${props.size}px`;
76
- return `${sizeMap[props.size] || sizeMap.medium}px`;
77
- });
78
-
79
- const trackHeight = computed(() => {
80
- const baseSize = typeof props.size === 'number' ? props.size : sizeMap[props.size] || sizeMap.medium;
81
- return `${baseSize * 0.5}px`;
82
- });
83
-
84
- // 滑块样式
85
- const thumbStyle = computed(() => ({
86
- transform: `translateX(${props.value ? 'calc(100% - -5rpx)' : '4rpx'})`,
87
- width: `calc(${trackHeight.value} - 8rpx)`,
88
- height: `calc(${trackHeight.value} - 8rpx)`
89
- }));
90
-
91
- // 轨道样式
92
- const trackStyle = computed(() => ({
93
- backgroundColor: props.value ? props.activeColor : props.inactiveColor,
94
- opacity: props.disabled ? 0.6 : 1
95
- }));
96
-
97
- // 切换状态
98
- const toggleSwitch = () => {
99
- if (props.disabled) return;
100
- emit('update:value', !props.value);
101
- };
102
- </script>
103
-
104
- <style lang="scss">
105
- .v-switch {
106
- position: relative;
107
- display: inline-block;
108
- vertical-align: middle;
109
- cursor: pointer;
110
- transition: all 0.3s;
111
-
112
- &.is-disabled {
113
- cursor: not-allowed;
114
- opacity: v-bind("config.opacity.disabled");
115
- }
116
-
117
- .switch-track {
118
- position: relative;
119
- width: 100%;
120
- height: 100%;
121
- border-radius: 100px;
122
- background-color: v-bind("config.VSwitch.backgroundColor");
123
- transition: all 0.3s;
124
- }
125
-
126
- .switch-thumb {
127
- display: flex;
128
- position: absolute;
129
- top: 4rpx;
130
- background-color: v-bind("config.backgroundColor.reversal");
131
- border-radius: 50%;
132
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.2);
133
- transition: all 0.3s cubic-bezier(0.3, 0.85, 0.5, 1);
134
- }
135
- }
136
- </style>
@@ -1,138 +0,0 @@
1
- <template>
2
- <view class="v-tabs-page">
3
- <v-tabs
4
- v-model:value="activeIndex"
5
- :tabs="items"
6
- :activeColor="activeColor"
7
- :inactiveColor="inactiveColor"
8
- @change="onTabChange"
9
- :is-line="isLine"
10
- :line-height="lineHeight"
11
- :line-width="lineWidth"
12
- :line-offset="lineOffset"
13
- :min-tab-width="minTabWidth"
14
- :item-padding="itemPadding"
15
- :hover-class="hoverClass"
16
- />
17
-
18
- <v-carousel v-model:current="activeIndex" :items="items" :indicator-dots="false" :autoplay="false" :isEndsButton="false" :box-height="boxHeight" @change="onCarouselChange">
19
- <template v-for="(item, index) in items" #[`item-${index}`]>
20
- <slot :name="`content-${index}`" :item="item" :index="index">
21
- <view class="default-content">
22
- <v-loading text="加载中..." :show="true" />
23
- </view>
24
- </slot>
25
- </template>
26
- </v-carousel>
27
- </view>
28
- </template>
29
-
30
- <script lang="ts" setup>
31
- import { ref, watch, inject } from 'vue';
32
-
33
- interface ContentList {
34
- title: string;
35
- content?: any;
36
- key?: string;
37
- }
38
-
39
- /**
40
- * v-tabs-page 标签页
41
- * items 标签标题
42
- * value 目前显示标签页内容
43
- * activeColor 标签标题高亮颜色
44
- * inactiveColor 标签标题颜色
45
- * isLine 是否显示下划线
46
- */
47
- const props = defineProps({
48
- items: {
49
- type: Array as () => ContentList[],
50
- required: true,
51
- default: () => []
52
- },
53
- value: {
54
- type: Number,
55
- default: 0
56
- },
57
- activeColor: {
58
- type: String,
59
- default: '#287afa'
60
- },
61
- inactiveColor: {
62
- type: String,
63
- default: '#666'
64
- },
65
- isLine: {
66
- type: Boolean,
67
- default: true
68
- },
69
- lineHeight: {
70
- type: String,
71
- default: '5'
72
- },
73
- lineWidth: {
74
- type: Number,
75
- default: 0
76
- },
77
- lineOffset: {
78
- type: Number,
79
- default: 8
80
- },
81
- minTabWidth: {
82
- type: Number,
83
- default: 120
84
- },
85
- itemPadding: {
86
- type: Number,
87
- default: 32
88
- },
89
- hoverClass: {
90
- type: String,
91
- default: 'tabs-hover'
92
- },
93
- boxHeight: {
94
- type: String,
95
- default: '400rpx'
96
- }
97
- });
98
-
99
- const emit = defineEmits(['update:value', 'change']);
100
- const config = inject<any>('config');
101
- const activeIndex = ref(props.value);
102
-
103
- watch(
104
- () => props.value,
105
- (val) => {
106
- activeIndex.value = val;
107
- emit('update:value', val);
108
- },
109
- { immediate: true }
110
- );
111
-
112
- const onTabChange = (index: number) => {
113
- activeIndex.value = index;
114
- emit('update:value', index);
115
- emit('change', index);
116
- };
117
- const onCarouselChange = (index: number) => {
118
- activeIndex.value = index;
119
- emit('update:value', index);
120
- emit('change', index);
121
- };
122
- </script>
123
-
124
- <style lang="scss" scoped>
125
- .v-tabs-page {
126
- display: flex;
127
- flex-direction: column;
128
- height: 100%;
129
- }
130
-
131
- .default-content {
132
- width: 100%;
133
- padding: 20rpx;
134
- font-size: v-bind('config.fontSize.mediumText');
135
- color: v-bind('config.fontColor.mainText');
136
- min-height: 400rpx;
137
- }
138
- </style>
@@ -1,143 +0,0 @@
1
- <template>
2
- <view :class="['v-badge', { 'v-badge--dot': dot }, `v-badge--size-${size}`, `v-badge--position-${position}`]" :style="badgeStyle">
3
- <slot></slot>
4
- <view v-if="!dot && (isShowContent)" class="v-badge-content">
5
- {{ displayContent }}
6
- </view>
7
- </view>
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import { computed,inject } from 'vue';
12
-
13
- /**
14
- * v-badge 标徽
15
- * value 双向绑定值
16
- * dot 省略显示
17
- * max 最大值
18
- * color 标徽颜色
19
- * size 标徽大小 默认值:medium 可选值small小、medium中、large大
20
- * position 标徽位置 默认值:right 可选值left左、right右
21
- */
22
- const props = defineProps({
23
- value: {
24
- type: [Number, String],
25
- default: 0
26
- },
27
- dot: {
28
- type: Boolean,
29
- default: false
30
- },
31
- max: {
32
- type: Number,
33
- default: 99
34
- },
35
- color: {
36
- type: String,
37
- default: '#ff5357'
38
- },
39
- fontColor: {
40
- type: String,
41
- default: '#fff'
42
- },
43
- size: {
44
- type: String,
45
- default: 'medium',
46
- validator: (value: string) => {
47
- return ['small', 'medium', 'large'].includes(value);
48
- }
49
- },
50
- position: {
51
- type: String,
52
- default: 'right',
53
- validator: (value: string) => {
54
- return ['left', 'right'].includes(value);
55
- }
56
- }
57
- });
58
-
59
-
60
- const config = inject<any>('config');
61
- const displayContent = computed(() => {
62
- if (props.dot) return '';
63
- if (props.max && props.value > props.max) {
64
- return `${props.max}+`;
65
- }
66
- return props.value;
67
- });
68
-
69
- const isShowContent = computed(() => {
70
- if (props.dot) return false;
71
- if (typeof props.value === 'string') return props.value.length > 0;
72
- return props.value > 0;
73
- });
74
-
75
- const badgeStyle = computed(() => {
76
- return {
77
- '--badge-color': props.color
78
- };
79
- });
80
- </script>
81
-
82
- <style lang="scss" scoped>
83
- .v-badge {
84
- position: relative;
85
- display: inline-flex;
86
- align-items: center;
87
-
88
- .v-badge-content {
89
- position: absolute;
90
- top: -12rpx;
91
- right: -12rpx;
92
- background-color: var(--badge-color, #ff4500);
93
- color: v-bind('fontColor');
94
- border-radius: v-bind("config.borderRadius.circle");
95
- padding: 0 8rpx;
96
- font-size: v-bind("config.fontSize.hintText");
97
- height: 30rpx;
98
- line-height: 30rpx;
99
- text-align: center;
100
- min-width: 26rpx;
101
- transform: scale(0.8);
102
- }
103
-
104
- &--dot::after {
105
- content: '';
106
- position: absolute;
107
- top: -6rpx;
108
- right: -6rpx;
109
- width: 16rpx;
110
- height: 16rpx;
111
- background-color: var(--badge-color, #ff4500);
112
- border-radius: 50%;
113
- }
114
-
115
- &--size-small .v-badge-content {
116
- font-size: v-bind("config.fontSize.smallText");
117
- height: 22rpx;
118
- line-height: 22rpx;
119
- min-width: 22rpx;
120
- padding: 6rpx 12rpx;
121
- transform: scale(0.7);
122
- }
123
-
124
- &--size-large .v-badge-content {
125
- font-size: v-bind("config.fontSize.largeText");
126
- height: 25rpx;
127
- line-height: 25rpx;
128
- min-width: 25px;
129
- padding: 3rpx 8rpx;
130
- transform: scale(0.9);
131
- }
132
-
133
- &--position-left .v-badge-content {
134
- left: -12rpx;
135
- right: auto;
136
- }
137
-
138
- &--position-left::after {
139
- left: -12rpx;
140
- right: auto;
141
- }
142
- }
143
- </style>