uview-pro 0.0.4 → 0.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.
@@ -0,0 +1,185 @@
1
+ declare module 'vue' {
2
+ export interface GlobalComponents {
3
+ // 基础组件
4
+ uActionSheet: typeof import('../components/u-action-sheet/u-action-sheet.vue')['default'];
5
+ uAlertTips: typeof import('../components/u-alert-tips/u-alert-tips.vue')['default'];
6
+ uAvatar: typeof import('../components/u-avatar/u-avatar.vue')['default'];
7
+ uAvatarCropper: typeof import('../components/u-avatar-cropper/u-avatar-cropper.vue')['default'];
8
+ uBackTop: typeof import('../components/u-back-top/u-back-top.vue')['default'];
9
+ uBadge: typeof import('../components/u-badge/u-badge.vue')['default'];
10
+ uButton: typeof import('../components/u-button/u-button.vue')['default'];
11
+ uCalendar: typeof import('../components/u-calendar/u-calendar.vue')['default'];
12
+ uCard: typeof import('../components/u-card/u-card.vue')['default'];
13
+ uCarKeyboard: typeof import('../components/u-car-keyboard/u-car-keyboard.vue')['default'];
14
+ uCellGroup: typeof import('../components/u-cell-group/u-cell-group.vue')['default'];
15
+ uCellItem: typeof import('../components/u-cell-item/u-cell-item.vue')['default'];
16
+ uCheckbox: typeof import('../components/u-checkbox/u-checkbox.vue')['default'];
17
+ uCheckboxGroup: typeof import('../components/u-checkbox-group/u-checkbox-group.vue')['default'];
18
+ uCircleProgress: typeof import('../components/u-circle-progress/u-circle-progress.vue')['default'];
19
+ uCitySelect: typeof import('../components/u-city-select/u-city-select.vue')['default'];
20
+ uCol: typeof import('../components/u-col/u-col.vue')['default'];
21
+ uCollapse: typeof import('../components/u-collapse/u-collapse.vue')['default'];
22
+ uCollapseItem: typeof import('../components/u-collapse-item/u-collapse-item.vue')['default'];
23
+ uColumnNotice: typeof import('../components/u-column-notice/u-column-notice.vue')['default'];
24
+ uCountDown: typeof import('../components/u-count-down/u-count-down.vue')['default'];
25
+ uCountTo: typeof import('../components/u-count-to/u-count-to.vue')['default'];
26
+ uDivider: typeof import('../components/u-divider/u-divider.vue')['default'];
27
+ uDropdown: typeof import('../components/u-dropdown/u-dropdown.vue')['default'];
28
+ uDropdownItem: typeof import('../components/u-dropdown-item/u-dropdown-item.vue')['default'];
29
+ uEmpty: typeof import('../components/u-empty/u-empty.vue')['default'];
30
+ uField: typeof import('../components/u-field/u-field.vue')['default'];
31
+ uForm: typeof import('../components/u-form/u-form.vue')['default'];
32
+ uFormItem: typeof import('../components/u-form-item/u-form-item.vue')['default'];
33
+ uFullScreen: typeof import('../components/u-full-screen/u-full-screen.vue')['default'];
34
+ uGap: typeof import('../components/u-gap/u-gap.vue')['default'];
35
+ uGrid: typeof import('../components/u-grid/u-grid.vue')['default'];
36
+ uGridItem: typeof import('../components/u-grid-item/u-grid-item.vue')['default'];
37
+ uIcon: typeof import('../components/u-icon/u-icon.vue')['default'];
38
+ uImage: typeof import('../components/u-image/u-image.vue')['default'];
39
+ uIndexAnchor: typeof import('../components/u-index-anchor/u-index-anchor.vue')['default'];
40
+ uIndexList: typeof import('../components/u-index-list/u-index-list.vue')['default'];
41
+ uInput: typeof import('../components/u-input/u-input.vue')['default'];
42
+ uKeyboard: typeof import('../components/u-keyboard/u-keyboard.vue')['default'];
43
+ uLazyLoad: typeof import('../components/u-lazy-load/u-lazy-load.vue')['default'];
44
+ uLine: typeof import('../components/u-line/u-line.vue')['default'];
45
+ uLineProgress: typeof import('../components/u-line-progress/u-line-progress.vue')['default'];
46
+ uLink: typeof import('../components/u-link/u-link.vue')['default'];
47
+ uLoadMore: typeof import('../components/u-loadmore/u-loadmore.vue')['default'];
48
+ uLoading: typeof import('../components/u-loading/u-loading.vue')['default'];
49
+ uMask: typeof import('../components/u-mask/u-mask.vue')['default'];
50
+ uMessageInput: typeof import('../components/u-message-input/u-message-input.vue')['default'];
51
+ uModal: typeof import('../components/u-modal/u-modal.vue')['default'];
52
+ uNavbar: typeof import('../components/u-navbar/u-navbar.vue')['default'];
53
+ uNoNetwork: typeof import('../components/u-no-network/u-no-network.vue')['default'];
54
+ uNoticeBar: typeof import('../components/u-notice-bar/u-notice-bar.vue')['default'];
55
+ uNumberBox: typeof import('../components/u-number-box/u-number-box.vue')['default'];
56
+ uNumberKeyboard: typeof import('../components/u-number-keyboard/u-number-keyboard.vue')['default'];
57
+ uPicker: typeof import('../components/u-picker/u-picker.vue')['default'];
58
+ uPopup: typeof import('../components/u-popup/u-popup.vue')['default'];
59
+ uRadio: typeof import('../components/u-radio/u-radio.vue')['default'];
60
+ uRadioGroup: typeof import('../components/u-radio-group/u-radio-group.vue')['default'];
61
+ uRate: typeof import('../components/u-rate/u-rate.vue')['default'];
62
+ uReadMore: typeof import('../components/u-read-more/u-read-more.vue')['default'];
63
+ uRow: typeof import('../components/u-row/u-row.vue')['default'];
64
+ uRowNotice: typeof import('../components/u-row-notice/u-row-notice.vue')['default'];
65
+ uSearch: typeof import('../components/u-search/u-search.vue')['default'];
66
+ uSection: typeof import('../components/u-section/u-section.vue')['default'];
67
+ uSelect: typeof import('../components/u-select/u-select.vue')['default'];
68
+ uSkeleton: typeof import('../components/u-skeleton/u-skeleton.vue')['default'];
69
+ uSlider: typeof import('../components/u-slider/u-slider.vue')['default'];
70
+ uSteps: typeof import('../components/u-steps/u-steps.vue')['default'];
71
+ uSticky: typeof import('../components/u-sticky/u-sticky.vue')['default'];
72
+ uSubsection: typeof import('../components/u-subsection/u-subsection.vue')['default'];
73
+ uSwipeAction: typeof import('../components/u-swipe-action/u-swipe-action.vue')['default'];
74
+ uSwiper: typeof import('../components/u-swiper/u-swiper.vue')['default'];
75
+ uSwitch: typeof import('../components/u-switch/u-switch.vue')['default'];
76
+ uTabbar: typeof import('../components/u-tabbar/u-tabbar.vue')['default'];
77
+ uTable: typeof import('../components/u-table/u-table.vue')['default'];
78
+ uTabs: typeof import('../components/u-tabs/u-tabs.vue')['default'];
79
+ uTabsSwiper: typeof import('../components/u-tabs-swiper/u-tabs-swiper.vue')['default'];
80
+ uTag: typeof import('../components/u-tag/u-tag.vue')['default'];
81
+ uTd: typeof import('../components/u-td/u-td.vue')['default'];
82
+ uTh: typeof import('../components/u-th/u-th.vue')['default'];
83
+ uTimeLine: typeof import('../components/u-time-line/u-time-line.vue')['default'];
84
+ uTimeLineItem: typeof import('../components/u-time-line-item/u-time-line-item.vue')['default'];
85
+ uToast: typeof import('../components/u-toast/u-toast.vue')['default'];
86
+ uTopTips: typeof import('../components/u-top-tips/u-top-tips.vue')['default'];
87
+ uTr: typeof import('../components/u-tr/u-tr.vue')['default'];
88
+ uUpload: typeof import('../components/u-upload/u-upload.vue')['default'];
89
+ uVerificationCode: typeof import('../components/u-verification-code/u-verification-code.vue')['default'];
90
+ uWaterfall: typeof import('../components/u-waterfall/u-waterfall.vue')['default'];
91
+ }
92
+ }
93
+
94
+ // 导出组件类型,供外部使用
95
+ export interface UViewProComponents {
96
+ uActionSheet: any;
97
+ uAlertTips: any;
98
+ uAvatar: any;
99
+ uAvatarCropper: any;
100
+ uBackTop: any;
101
+ uBadge: any;
102
+ uButton: any;
103
+ uCalendar: any;
104
+ uCard: any;
105
+ uCarKeyboard: any;
106
+ uCellGroup: any;
107
+ uCellItem: any;
108
+ uCheckbox: any;
109
+ uCheckboxGroup: any;
110
+ uCircleProgress: any;
111
+ uCitySelect: any;
112
+ uCol: any;
113
+ uCollapse: any;
114
+ uCollapseItem: any;
115
+ uColumnNotice: any;
116
+ uCountDown: any;
117
+ uCountTo: any;
118
+ uDivider: any;
119
+ uDropdown: any;
120
+ uDropdownItem: any;
121
+ uEmpty: any;
122
+ uField: any;
123
+ uForm: any;
124
+ uFormItem: any;
125
+ uFullScreen: any;
126
+ uGap: any;
127
+ uGrid: any;
128
+ uGridItem: any;
129
+ uIcon: any;
130
+ uImage: any;
131
+ uIndexAnchor: any;
132
+ uIndexList: any;
133
+ uInput: any;
134
+ uKeyboard: any;
135
+ uLazyLoad: any;
136
+ uLine: any;
137
+ uLineProgress: any;
138
+ uLink: any;
139
+ uLoadMore: any;
140
+ uLoading: any;
141
+ uMask: any;
142
+ uMessageInput: any;
143
+ uModal: any;
144
+ uNavbar: any;
145
+ uNoNetwork: any;
146
+ uNoticeBar: any;
147
+ uNumberBox: any;
148
+ uNumberKeyboard: any;
149
+ uPicker: any;
150
+ uPopup: any;
151
+ uRadio: any;
152
+ uRadioGroup: any;
153
+ uRate: any;
154
+ uReadMore: any;
155
+ uRow: any;
156
+ uRowNotice: any;
157
+ uSearch: any;
158
+ uSection: any;
159
+ uSelect: any;
160
+ uSkeleton: any;
161
+ uSlider: any;
162
+ uSteps: any;
163
+ uSticky: any;
164
+ uSubsection: any;
165
+ uSwipeAction: any;
166
+ uSwiper: any;
167
+ uSwitch: any;
168
+ uTabbar: any;
169
+ uTable: any;
170
+ uTabs: any;
171
+ uTabsSwiper: any;
172
+ uTag: any;
173
+ uTd: any;
174
+ uTh: any;
175
+ uTimeLine: any;
176
+ uTimeLineItem: any;
177
+ uToast: any;
178
+ uTopTips: any;
179
+ uTr: any;
180
+ uUpload: any;
181
+ uVerificationCode: any;
182
+ uWaterfall: any;
183
+ }
184
+
185
+ export {};
@@ -0,0 +1,30 @@
1
+ // 忽略 uview-pro 组件库内部的 TypeScript 错误
2
+ // 这些错误不影响组件的正常使用和类型提示
3
+
4
+ // 忽略 WeCropper 相关的类型错误
5
+ declare module 'weCropper' {
6
+ export class WeCropper {
7
+ constructor(params: any);
8
+ [key: string]: any;
9
+ }
10
+ }
11
+
12
+ // 忽略 base64 模块的类型错误
13
+ declare module 'base64' {
14
+ export function encode(data: any): string;
15
+ export function decode(data: string): any;
16
+ }
17
+
18
+ // 忽略其他内部模块的类型错误
19
+ declare module 'uview-pro/components/*' {
20
+ const component: any;
21
+ export default component;
22
+ }
23
+
24
+ // 忽略工具函数的类型错误
25
+ declare module 'uview-pro/libs/function/*' {
26
+ const func: any;
27
+ export default func;
28
+ }
29
+
30
+ export {};
@@ -0,0 +1,127 @@
1
+ import http from './libs/request/index';
2
+ import queryParams from '../libs/function/queryParams';
3
+ import route from '../libs/function/route';
4
+ import timeFormat from '../libs/function/timeFormat';
5
+ import timeFrom from '../libs/function/timeFrom';
6
+ import colorGradient from '../libs/function/colorGradient';
7
+ import guid from '../libs/function/guid';
8
+ import color from '../libs/function/color';
9
+ import type2icon from '../libs/function/type2icon';
10
+ import randomArray from '../libs/function/randomArray';
11
+ import deepClone from '../libs/function/deepClone';
12
+ import deepMerge from '../libs/function/deepMerge';
13
+ import addUnit from '../libs/function/addUnit';
14
+ import test from '../libs/function/test';
15
+ import random from '../libs/function/random';
16
+ import trim from '../libs/function/trim';
17
+ import toast from '../libs/function/toast';
18
+ import getParent from '../libs/function/getParent';
19
+ import $parent from '../libs/function/$parent';
20
+ import debounce from '../libs/function/debounce';
21
+ import throttle from '../libs/function/throttle';
22
+ import getRect from '../libs/function/getRect';
23
+ import { sys, os } from '../libs/function/sys';
24
+ import { parentData, parent } from '../libs/function/parent';
25
+ import config from '../libs/config/config';
26
+ import zIndex from '../libs/config/zIndex';
27
+ import { dispatch, broadcast } from '../libs/util/emitter';
28
+ import { mitt } from '../libs/util/mitt';
29
+
30
+ // uview-pro 模块类型声明
31
+ declare module 'uview-pro' {
32
+ import { App } from 'vue';
33
+
34
+ // 导出安装函数
35
+ export function install(app: App): void;
36
+
37
+ // 导出 $u 工具类型
38
+ export interface $Utils {
39
+ queryParams: typeof queryParams;
40
+ route: typeof route;
41
+ timeFormat: typeof timeFormat;
42
+ date: typeof timeFormat;
43
+ timeFrom: typeof timeFrom;
44
+ colorGradient: typeof colorGradient.colorGradient;
45
+ colorToRgb: typeof colorGradient.colorToRgb;
46
+ guid: typeof guid;
47
+ color: typeof color;
48
+ sys: typeof sys;
49
+ os: typeof os;
50
+ type2icon: typeof type2icon;
51
+ randomArray: typeof randomArray;
52
+ dispatch: typeof dispatch;
53
+ broadcast: typeof broadcast;
54
+ get: typeof http.get;
55
+ post: typeof http.post;
56
+ put: typeof http.put;
57
+ delete: typeof http.delete;
58
+ hexToRgb: typeof colorGradient.hexToRgb;
59
+ rgbToHex: typeof colorGradient.rgbToHex;
60
+ test: typeof test;
61
+ random: typeof random;
62
+ deepClone: typeof deepClone;
63
+ deepMerge: typeof deepMerge;
64
+ getParent: typeof getParent;
65
+ $parent: typeof $parent;
66
+ parent: typeof parent;
67
+ parentData: typeof parentData;
68
+ addUnit: typeof addUnit;
69
+ trim: typeof trim;
70
+ type: string[];
71
+ http: typeof http;
72
+ toast: typeof toast;
73
+ config: typeof config;
74
+ zIndex: typeof zIndex;
75
+ debounce: typeof debounce;
76
+ throttle: typeof throttle;
77
+ mitt: ReturnType<typeof mitt>;
78
+ getRect: typeof getRect;
79
+ }
80
+
81
+ // 导出组件类型
82
+ export * from './components';
83
+
84
+ // 导出工具函数类型
85
+ export * from './libs/request/index';
86
+ export * from './libs/function/queryParams';
87
+ export * from './libs/function/route';
88
+ export * from './libs/function/timeFormat';
89
+ export * from './libs/function/timeFrom';
90
+ export * from './libs/function/colorGradient';
91
+ export * from './libs/function/guid';
92
+ export * from './libs/function/color';
93
+ export * from './libs/function/type2icon';
94
+ export * from './libs/function/randomArray';
95
+ export * from './libs/function/deepClone';
96
+ export * from './libs/function/deepMerge';
97
+ export * from './libs/function/addUnit';
98
+ export * from './libs/function/test';
99
+ export * from './libs/function/random';
100
+ export * from './libs/function/trim';
101
+ export * from './libs/function/toast';
102
+ export * from './libs/function/getParent';
103
+ export * from './libs/function/$parent';
104
+ export * from './libs/function/debounce';
105
+ export * from './libs/function/throttle';
106
+ export * from './libs/function/getRect';
107
+ export * from './libs/function/sys';
108
+ export * from './libs/config/config';
109
+ export * from './libs/config/zIndex';
110
+ export * from './libs/util/emitter';
111
+ export * from './libs/util/mitt';
112
+ // 导出 uni-app 全局属性类型声明
113
+ export * from './uni-app.d';
114
+ }
115
+
116
+ // 全局类型扩展
117
+ declare global {
118
+ interface Uni {
119
+ $u: import('uview-pro').$Utils;
120
+ }
121
+
122
+ interface Window {
123
+ $u: import('uview-pro').$Utils;
124
+ }
125
+ }
126
+
127
+ export {};
@@ -0,0 +1,61 @@
1
+ // /src/uni_modules/uview-pro/types/uni-app.d.ts
2
+ // 扩展全局 HTMLAttributes 以支持 uni-app/小程序自定义属性
3
+ import 'vue';
4
+
5
+ declare module 'vue' {
6
+ export interface GlobalComponents {
7
+ // UniApp core/native tags
8
+ view: any;
9
+ 'scroll-view': any;
10
+ swiper: any;
11
+ 'swiper-item': any;
12
+ image: any;
13
+ 'rich-text': any;
14
+ canvas: any;
15
+ block: any;
16
+
17
+ // Basic HTML shims often used by uni-app compiler
18
+ text: any;
19
+ }
20
+ interface HTMLAttributes {
21
+ // 支持小程序/uni-app 特有属性
22
+ 'hover-class'?: string;
23
+ 'hover-stop-propagation'?: boolean;
24
+ 'hover-start-time'?: number;
25
+ 'hover-stay-time'?: number;
26
+ animation?: string;
27
+ 'data-*'?: any;
28
+ catchtap?: (e: any) => void;
29
+ catchlongpress?: (e: any) => void;
30
+ catchtouchstart?: (e: any) => void;
31
+ catchtouchmove?: (e: any) => void;
32
+ catchtouchend?: (e: any) => void;
33
+ catchtouchcancel?: (e: any) => void;
34
+ // 其他常用 uni-app 事件和属性可按需补充
35
+ src?: string;
36
+ }
37
+ }
38
+
39
+ // 兼容 JSX/TSX 场景
40
+ declare global {
41
+ namespace JSX {
42
+ interface IntrinsicAttributes {
43
+ 'hover-class'?: string;
44
+ 'hover-stop-propagation'?: boolean;
45
+ 'hover-start-time'?: number;
46
+ 'hover-stay-time'?: number;
47
+ animation?: string;
48
+ 'data-*'?: any;
49
+ catchtap?: (e: any) => void;
50
+ catchlongpress?: (e: any) => void;
51
+ catchtouchstart?: (e: any) => void;
52
+ catchtouchmove?: (e: any) => void;
53
+ catchtouchend?: (e: any) => void;
54
+ catchtouchcancel?: (e: any) => void;
55
+ src?: string;
56
+ }
57
+ interface IntrinsicElements {
58
+ [elem: string]: any;
59
+ }
60
+ }
61
+ }
@@ -1,100 +0,0 @@
1
- const cfg = require('./config.js'),
2
- isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
3
-
4
- function CssHandler(tagStyle) {
5
- var styles = Object.assign(Object.create(null), cfg.userAgentStyles);
6
- for (var item in tagStyle)
7
- styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
8
- this.styles = styles;
9
- }
10
- CssHandler.prototype.getStyle = function(data) {
11
- this.styles = new parser(data, this.styles).parse();
12
- }
13
- CssHandler.prototype.match = function(name, attrs) {
14
- var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : '';
15
- if (attrs.class) {
16
- var items = attrs.class.split(' ');
17
- for (var i = 0, item; item = items[i]; i++)
18
- if (tmp = this.styles['.' + item])
19
- matched += tmp + ';';
20
- }
21
- if (tmp = this.styles['#' + attrs.id])
22
- matched += tmp + ';';
23
- return matched;
24
- }
25
- module.exports = CssHandler;
26
-
27
- function parser(data, init) {
28
- this.data = data;
29
- this.floor = 0;
30
- this.i = 0;
31
- this.list = [];
32
- this.res = init;
33
- this.state = this.Space;
34
- }
35
- parser.prototype.parse = function() {
36
- for (var c; c = this.data[this.i]; this.i++)
37
- this.state(c);
38
- return this.res;
39
- }
40
- parser.prototype.section = function() {
41
- return this.data.substring(this.start, this.i);
42
- }
43
- // 状态机
44
- parser.prototype.Space = function(c) {
45
- if (c == '.' || c == '#' || isLetter(c)) {
46
- this.start = this.i;
47
- this.state = this.Name;
48
- } else if (c == '/' && this.data[this.i + 1] == '*')
49
- this.Comment();
50
- else if (!cfg.blankChar[c] && c != ';')
51
- this.state = this.Ignore;
52
- }
53
- parser.prototype.Comment = function() {
54
- this.i = this.data.indexOf('*/', this.i) + 1;
55
- if (!this.i) this.i = this.data.length;
56
- this.state = this.Space;
57
- }
58
- parser.prototype.Ignore = function(c) {
59
- if (c == '{') this.floor++;
60
- else if (c == '}' && !--this.floor) {
61
- this.list = [];
62
- this.state = this.Space;
63
- }
64
- }
65
- parser.prototype.Name = function(c) {
66
- if (cfg.blankChar[c]) {
67
- this.list.push(this.section());
68
- this.state = this.NameSpace;
69
- } else if (c == '{') {
70
- this.list.push(this.section());
71
- this.Content();
72
- } else if (c == ',') {
73
- this.list.push(this.section());
74
- this.Comma();
75
- } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
76
- this.state = this.Ignore;
77
- }
78
- parser.prototype.NameSpace = function(c) {
79
- if (c == '{') this.Content();
80
- else if (c == ',') this.Comma();
81
- else if (!cfg.blankChar[c]) this.state = this.Ignore;
82
- }
83
- parser.prototype.Comma = function() {
84
- while (cfg.blankChar[this.data[++this.i]]);
85
- if (this.data[this.i] == '{') this.Content();
86
- else {
87
- this.start = this.i--;
88
- this.state = this.Name;
89
- }
90
- }
91
- parser.prototype.Content = function() {
92
- this.start = ++this.i;
93
- if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
94
- var content = this.section();
95
- for (var i = 0, item; item = this.list[i++];)
96
- if (this.res[item]) this.res[item] += ';' + content;
97
- else this.res[item] = content;
98
- this.list = [];
99
- this.state = this.Space;
100
- }