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,151 +0,0 @@
1
- <template>
2
- <view v-if="isShow" class="popup-list-container" :class="{ active: props.value }">
3
- <v-overlay v-model:value="props.value" :z-index="8" @click="handleClose"></v-overlay>
4
- <view :class="['popup-list', `popup-list--border--${model}`]">
5
- <view class="popup-header">
6
- <slot name="title-header">
7
- <view class="popup-title">{{ title }}</view>
8
- <view class="popup-close" @click.stop="handleClose">取消</view>
9
- </slot>
10
- </view>
11
- <view class="popup-content">
12
- <scroll-view class="popup-scroll" scroll-y :style="{ height: scrollHeight + 'rpx' }">
13
- <slot></slot>
14
- </scroll-view>
15
- </view>
16
- <view class="popup-footer">
17
- <slot name="buttons-footer">
18
- <v-button class="popup-confirm" @click="handleConfirm" model="circle">确定</v-button>
19
- </slot>
20
- </view>
21
- </view>
22
- </view>
23
- </template>
24
-
25
- <script setup lang="ts">
26
- import { ref, computed, watch, inject } from 'vue';
27
-
28
- /**
29
- * v-popup 弹窗
30
- * show 是否显示弹窗 默认值:false 可选值true显示、false隐藏
31
- * title 弹窗标题
32
- * scrollHeight 滚动区域高度 默认值:400
33
- * model 模式 默认值:square 可选值:semicircle半圆、square方形
34
- */
35
- const props = defineProps({
36
- value: {
37
- type: Boolean,
38
- default: false,
39
- required: true
40
- },
41
- title: {
42
- type: String,
43
- default: ''
44
- },
45
- scrollHeight: {
46
- type: Number,
47
- default: 400
48
- },
49
- model: {
50
- type: String,
51
- default: 'square'
52
- }
53
- });
54
-
55
- const emit = defineEmits(['update:value', 'close', 'confirm']);
56
- const config = inject<any>('config');
57
- const isShow = ref(props.value);
58
-
59
- watch(
60
- () => props.value,
61
- (newVal) => {
62
- isShow.value = newVal;
63
- }
64
- );
65
-
66
- function handleClose() {
67
- isShow.value = false;
68
- emit('update:value', false);
69
- emit('close', false);
70
- }
71
-
72
- function handleConfirm() {
73
- isShow.value = false;
74
- emit('update:value', false);
75
- emit('confirm', false);
76
- }
77
- </script>
78
- <style lang="scss">
79
- .popup-list-container {
80
- position: relative;
81
- width: 100%;
82
- height: 100%;
83
- }
84
- .popup-list {
85
- position: fixed;
86
- bottom: 0;
87
- left: 0;
88
- width: 100%;
89
- background-color: v-bind('config.backgroundColor.reversal');
90
- overflow: hidden;
91
- transform: translateY(100%);
92
- transition: transform 0.5s ease;
93
- z-index: 10;
94
-
95
- &--border--square {
96
- border-radius: 0;
97
- }
98
- &--border--semicircle {
99
- border-radius: 15rpx;
100
- }
101
- }
102
-
103
- .popup-list-container.active {
104
- .popup-list {
105
- transform: translateY(0);
106
- }
107
- }
108
-
109
- .popup-header {
110
- display: flex;
111
- justify-content: space-between;
112
- align-items: center;
113
- padding: 30rpx;
114
- background-color: v-bind('config.backgroundColor.reversal');
115
- border-bottom: 1rpx solid v-bind('config.border.color');
116
- }
117
-
118
- .popup-title {
119
- font-size: v-bind('config.fontSize.smallTitle');
120
- font-weight: 500;
121
- color: v-bind('config.fontColor.mianTitle');
122
- }
123
-
124
- .popup-close {
125
- font-size: v-bind('config.fontSize.mediumText');
126
- color: v-bind('config.fontColor.mainText');
127
- }
128
-
129
- .popup-content {
130
- max-height: 500rpx;
131
- overflow: hidden;
132
- }
133
-
134
- .popup-scroll {
135
- height: 100%;
136
- }
137
-
138
- .popup-footer {
139
- display: flex;
140
- justify-content: flex-end;
141
- padding: 20rpx 30rpx;
142
- background-color: v-bind('config.backgroundColor.reversal');
143
- border-top: 1rpx solid v-bind('config.border.color');
144
- min-height: 125rpx;
145
- }
146
-
147
- .popup-confirm {
148
- width: 160rpx;
149
- height: 60rpx;
150
- }
151
- </style>
@@ -1,86 +0,0 @@
1
- <template>
2
- <view :class="['v-radio-group', vertical ? 'vertical' : 'horizontal']" :style="groupStyle" role="radiogroup">
3
- <slot />
4
- </view>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- import { ref, provide, computed, watch } from 'vue';
9
-
10
- const props = defineProps({
11
- value: {
12
- type: [String, Number],
13
- default: ''
14
- },
15
- vertical: {
16
- type: Boolean,
17
- default: false
18
- },
19
- disabled: {
20
- type: Boolean,
21
- default: false
22
- },
23
- groupStyle: {
24
- type: Object,
25
- default: () => ({})
26
- },
27
- defaultValue: {
28
- type: [String, Number],
29
- default: ''
30
- }
31
- });
32
-
33
- const emit = defineEmits(['update:value', 'change']);
34
- const currentValue = ref(props.value);
35
-
36
- watch(
37
- () => props.value,
38
- (newVal) => {
39
- currentValue.value = newVal;
40
- }
41
- );
42
-
43
- provide('radioGroup', {
44
- value: currentValue,
45
- disabled: computed(() => props.disabled),
46
- defaultValue: computed(() => props.defaultValue), // 提供默认值
47
- emitUpdate: (newValue: any) => {
48
- currentValue.value = newValue;
49
- emit('update:value', newValue);
50
- emit('change', newValue);
51
- }
52
- });
53
-
54
- watch(currentValue, (newVal) => {
55
- emit('update:value', newVal);
56
- emit('change', newVal);
57
- });
58
- </script>
59
-
60
- <style lang="scss">
61
- .v-radio-group {
62
- height: 72rpx;
63
- &.horizontal {
64
- display: flex;
65
- flex-wrap: wrap;
66
-
67
- .v-radio {
68
- margin-right: 32rpx;
69
-
70
- &:last-child {
71
- margin-right: 0;
72
- }
73
- }
74
- }
75
-
76
- &.vertical {
77
- .v-radio {
78
- margin-bottom: 24rpx;
79
-
80
- &:last-child {
81
- margin-bottom: 0;
82
- }
83
- }
84
- }
85
- }
86
- </style>
@@ -1,202 +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
- <v-picker-list
11
- v-model:value="showPicker"
12
- :list="options"
13
- :title="title"
14
- @confirm="handleConfirm"
15
- @select="handleSelect"
16
- :scroll-height="scrollHeight"
17
- :selected="value"
18
- ></v-picker-list>
19
- </view>
20
- </template>
21
-
22
- <script setup lang="ts">
23
- import { ref, watch, onMounted, reactive, inject, computed } from 'vue';
24
-
25
- interface OptionsList {
26
- label: String;
27
- value: String | Number;
28
- }
29
- /**
30
- * v-select-picker 下拉框
31
- * value 双向绑定
32
- * placeholder 提示语
33
- * title 标题
34
- * options 选择值
35
- * initializeCustomizeFunction 自定义初始函数
36
- * borderModel 边框模式 默认:all 可选值:all普通边框 nont无边框模式 bottom底部边框模式 top上边框模式 left左边框模式 right右边框模式 ends左右两端边框模式 up-down上下边框模式
37
- * disabled 是否禁用 默认:false 可选值:true禁用 false不禁用
38
- * 相关事件:confirm、select
39
- */
40
- const props = defineProps({
41
- value: {
42
- type: [String, Number],
43
- required: true
44
- },
45
- placeholder: {
46
- type: String,
47
- default: null
48
- },
49
- title: {
50
- type: String,
51
- required: true
52
- },
53
- options: {
54
- type: Array as () => OptionsList[],
55
- required: true
56
- },
57
- initializeCustomizeFunction: {
58
- type: Function,
59
- default: () => {
60
- return () => {};
61
- }
62
- },
63
- borderModel: {
64
- type: String,
65
- default: 'all',
66
- validator: (value: any) => {
67
- return ['all', 'none', 'bottom', 'top', 'left', 'right', 'ends', 'up-down'].includes(value);
68
- }
69
- },
70
- disabled: {
71
- type: Boolean,
72
- default: false
73
- },
74
- scrollHeight: {
75
- type: Number,
76
- default: 400
77
- },
78
- backgroundColor: {
79
- type: String,
80
- default: null
81
- }
82
- });
83
-
84
- let showPicker = ref(false);
85
-
86
- let row = reactive({
87
- label: null,
88
- value: null
89
- });
90
-
91
- const emit = defineEmits(['update:value', 'confirm', 'select']);
92
- const config = inject<any>('config');
93
-
94
- const computedBackgroundColor = computed(() => {
95
- if (props.backgroundColor) {
96
- return props.backgroundColor;
97
- }
98
- if (config && config.backgroundColor && config.backgroundColor.reversal) {
99
- return config.backgroundColor.reversal;
100
- }
101
- return '#ffffff';
102
- });
103
-
104
- onMounted(async () => {
105
- await props.initializeCustomizeFunction(props.value);
106
- matchingData(props.value);
107
- });
108
-
109
- watch(
110
- () => props.value,
111
- (newValue: any) => {
112
- matchingData(newValue);
113
- }
114
- );
115
-
116
- watch(
117
- () => props.options,
118
- (newValue: any) => {
119
- matchingData(props.value);
120
- }
121
- );
122
-
123
- function matchingData(value: any) {
124
- const matchedItem = props.options.find((item) => item.value === value);
125
- if (matchedItem != undefined) {
126
- Object.assign(row, matchedItem);
127
- }
128
- }
129
-
130
- function handleClick() {
131
- if (!props.disabled) {
132
- showPicker.value = true;
133
- }
134
- }
135
-
136
- function handleConfirm(selected: any) {
137
- Object.assign(row, selected);
138
- emit('update:value', row.value);
139
- emit('confirm', row.value, row);
140
- showPicker.value = false;
141
- }
142
- function handleSelect(selected: any) {
143
- emit('select', selected);
144
- }
145
- </script>
146
-
147
- <style lang="scss" scoped>
148
- .select-input {
149
- width: 100%;
150
- height: 72rpx;
151
- line-height: 72rpx;
152
- background-color: v-bind('computedBackgroundColor');
153
- border-radius: 10rpx;
154
- box-sizing: border-box;
155
-
156
- &--border-all {
157
- border: 1rpx solid v-bind('config.border.color');
158
- }
159
-
160
- &--border-none {
161
- border: none;
162
- }
163
-
164
- &--border-bottom {
165
- border-bottom: 1rpx solid v-bind('config.border.color');
166
- }
167
-
168
- &--border-top {
169
- border-top: 1rpx solid v-bind('config.border.color');
170
- }
171
-
172
- &--border-left {
173
- border-left: 1rpx solid v-bind('config.border.color');
174
- }
175
-
176
- &--border-right {
177
- border-right: 1rpx solid v-bind('config.border.color');
178
- }
179
-
180
- &--border-ends {
181
- border-left: 1rpx solid v-bind('config.border.color');
182
- border-right: 1rpx solid v-bind('config.border.color');
183
- }
184
-
185
- &--border-up-down {
186
- border-top: 1rpx solid v-bind('config.border.color');
187
- border-bottom: 1rpx solid v-bind('config.border.color');
188
- }
189
-
190
- &--disabled {
191
- background-color: v-bind('config.backgroundColor.disabled');
192
- color: v-bind('config.fontColor.text');
193
- opacity: v-bind('config.opacity.disabled');
194
- cursor: not-allowed;
195
- }
196
-
197
- .input {
198
- margin-left: 2%;
199
- font-size: v-bind('config.fontSize.mediumText');
200
- }
201
- }
202
- </style>
@@ -1,221 +0,0 @@
1
- <template>
2
- <v-popup v-model:value="isShow" :title="title" :scrollHeight="scrollHeight" @close="handleClose" @confirm="handleConfirm">
3
- <view class="series-picker-content">
4
- <view v-for="(column, columnIndex) in currentList" :key="columnIndex" class="series-picker-column">
5
- <scroll-view class="series-picker-scroll" scroll-y :style="{ height: scrollHeight + 'rpx' }">
6
- <view
7
- v-for="(item, index) in column"
8
- :key="index"
9
- class="series-picker-item"
10
- :class="{ active: item.value === selectedValues[columnIndex] }"
11
- @click="handleSelect(item, columnIndex)"
12
- >
13
- {{ item.label }}
14
- </view>
15
- </scroll-view>
16
- </view>
17
- <view v-show="safeList.length === 0">
18
- <slot name="is-null">
19
- <v-null text="暂无数据"></v-null>
20
- </slot>
21
- </view>
22
- </view>
23
- </v-popup>
24
- </template>
25
-
26
- <script setup lang="ts">
27
- import { ref, computed, watch, onMounted,inject } from 'vue';
28
-
29
- interface PickerItem {
30
- label: string;
31
- value: string;
32
- children?: PickerItem[];
33
- }
34
-
35
- /**
36
- * v-series-picker 拾取器
37
- * value 是否显示拾取器 默认值:false 可选值true显示、false隐藏
38
- * list 拾取器数据列表
39
- * title 拾取器标题
40
- * selected 默认选中项 默认值:null
41
- * scrollHeight 拾取器滚动区域高度 默认值:400
42
- * 相关事件:confirm选中事件、select选择事件
43
- */
44
- const props = defineProps({
45
- value: {
46
- type: Boolean,
47
- default: false,
48
- required: true
49
- },
50
- list: {
51
- type: Array as () => PickerItem[],
52
- default: () => [],
53
- required: true
54
- },
55
- title: {
56
- type: String,
57
- default: ''
58
- },
59
- selected: {
60
- type: Array as () => string[],
61
- default: () => []
62
- },
63
- scrollHeight: {
64
- type: Number,
65
- default: 400
66
- }
67
- });
68
-
69
- const emit = defineEmits(['update:value','close', 'confirm', 'select']);
70
- const config = inject<any>('config');
71
- const isShow = ref(props.value);
72
- const isActive = ref(false);
73
- const selectedValues = ref(props.selected || []);
74
- const currentList = ref<PickerItem[][]>([]);
75
- const safeList = computed(() => props.list || []);
76
-
77
- const initializeSelectedValues = () => {
78
- selectedValues.value = safeList.value.map((_, index) => {
79
- if (index === 0) return safeList.value[0].value;
80
- return '';
81
- });
82
- };
83
- const updateCurrentList = () => {
84
- const newList: PickerItem[][] = [];
85
- let currentItems: PickerItem[] = [...safeList.value];
86
-
87
- for (let i = 0; i < selectedValues.value.length; i++) {
88
- const selectedValue = selectedValues.value[i];
89
-
90
- if (i === 0) {
91
- newList.push(currentItems);
92
- } else if (newList[i - 1] && newList[i - 1].length > 0) {
93
- const prevItems = newList[i - 1];
94
- const prevSelectedIndex = prevItems.findIndex((item) => item.value === selectedValues.value[i - 1]);
95
-
96
- if (prevSelectedIndex !== -1 && prevItems[prevSelectedIndex].children) {
97
- currentItems = prevItems[prevSelectedIndex].children;
98
- newList.push(currentItems);
99
- } else {
100
- break;
101
- }
102
- } else {
103
- break;
104
- }
105
-
106
- if (selectedValue && currentItems.length) {
107
- const currentIndex = currentItems.findIndex((item) => item.value === selectedValue);
108
- if (currentIndex === -1) {
109
- selectedValues.value = selectedValues.value.map((_, idx) => (idx <= i ? selectedValues.value[idx] : ''));
110
- break;
111
- }
112
- }
113
- }
114
-
115
- currentList.value = newList;
116
- };
117
-
118
- watch(
119
- () => safeList.value,
120
- (newList: any) => {
121
- initializeSelectedValues();
122
- updateCurrentList();
123
- },
124
- { deep: true, immediate: true }
125
- );
126
-
127
- watch(
128
- () => props.list,
129
- (newList: any) => {
130
- console.log(newList);
131
- initializeSelectedValues();
132
- updateCurrentList();
133
- },
134
- { deep: true, immediate: true }
135
- );
136
-
137
- watch(
138
- () => props.value,
139
- (newValue) => {
140
- isShow.value = newValue;
141
- isActive.value = newValue;
142
-
143
- if (newValue) {
144
- initializeSelectedValues();
145
- updateCurrentList();
146
- }
147
- }
148
- );
149
-
150
- const handleClose = () => {
151
- isShow.value = false;
152
- isActive.value = false;
153
- emit('update:value', false);
154
- emit('close', false);
155
- };
156
-
157
- const handleSelect = (item: PickerItem, columnIndex: number) => {
158
- const newSelectedValues = [...selectedValues.value];
159
- newSelectedValues[columnIndex] = item.value;
160
-
161
- if (columnIndex < newSelectedValues.length - 1) {
162
- for (let i = columnIndex + 1; i < newSelectedValues.length; i++) {
163
- newSelectedValues[i] = '';
164
- }
165
- }
166
-
167
- selectedValues.value = newSelectedValues;
168
- emit('select', newSelectedValues[columnIndex]);
169
- updateCurrentList();
170
- };
171
-
172
- const handleConfirm = () => {
173
- const result: any[] = [];
174
-
175
- currentList.value.forEach((column, index) => {
176
- const selectedValue = selectedValues.value[index];
177
- const selectedItem = column.find((item) => item.value === selectedValue);
178
- if (selectedItem) {
179
- result.push(selectedItem);
180
- }
181
- });
182
- isShow.value = false;
183
- isShow.value = false;
184
- isActive.value = false;
185
- emit('update:value', false);
186
- emit('confirm', result);
187
- };
188
- </script>
189
-
190
- <style lang="scss" scoped>
191
- .series-picker-content {
192
- display: flex;
193
- max-height: 500rpx;
194
- overflow: hidden;
195
- }
196
-
197
- .series-picker-column {
198
- flex: 1;
199
- border-right: 1rpx solid v-bind("config.border.color");
200
- }
201
-
202
- .series-picker-column:last-child {
203
- border-right: none;
204
- }
205
-
206
- .series-picker-scroll {
207
- height: 100%;
208
- }
209
-
210
- .series-picker-item {
211
- padding: 20rpx 30rpx;
212
- font-size: v-bind("config.fontSize.mediumText");
213
- color: v-bind("config.fontColor.mainText");
214
- border-bottom: 1rpx solid v-bind("config.border.color");
215
- }
216
-
217
- .series-picker-item.active {
218
- color: v-bind("config.fontColor.default");
219
- font-weight: 500;
220
- }
221
- </style>