@vtj/materials 0.10.1-alpha.6 → 0.10.1
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.
- package/dist/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +2 -2
- package/dist/assets/uni-ui/index.umd.js +3 -3
- package/dist/assets/vant/index.umd.js +5 -5
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +2 -2
- package/dist/deps/@vtj/utils/index.umd.js +2 -2
- package/dist/deps/uni-ui/index.umd.js +1 -1
- package/dist/deps/uni-ui/style.css +1 -1
- package/package.json +6 -6
- package/src/uni-ui/components/badge.ts +5 -1
- package/src/uni-ui/components/breadcrumb.ts +76 -0
- package/src/uni-ui/components/calendar.ts +63 -0
- package/src/uni-ui/components/card.ts +113 -0
- package/src/uni-ui/components/collapse.ts +118 -0
- package/src/uni-ui/components/combox.ts +51 -0
- package/src/uni-ui/components/countdown.ts +92 -0
- package/src/uni-ui/components/dataCheckbox.ts +104 -0
- package/src/uni-ui/components/dataPicker.ts +146 -0
- package/src/uni-ui/components/dataSelect.ts +68 -0
- package/src/uni-ui/components/dateformat.ts +42 -0
- package/src/uni-ui/components/datetimePicker.ts +103 -0
- package/src/uni-ui/components/drawer.ts +38 -0
- package/src/uni-ui/components/easyinput.ts +159 -0
- package/src/uni-ui/components/fab.ts +89 -0
- package/src/uni-ui/components/fav.ts +65 -0
- package/src/uni-ui/components/filePicker.ts +127 -0
- package/src/uni-ui/components/forms.ts +209 -0
- package/src/uni-ui/components/goodsNav.ts +31 -0
- package/src/uni-ui/components/grid.ts +104 -0
- package/src/uni-ui/components/group.ts +50 -0
- package/src/uni-ui/components/icons.ts +47 -0
- package/src/uni-ui/components/index.ts +89 -1
- package/src/uni-ui/components/indexedList.ts +51 -0
- package/src/uni-ui/components/link.ts +60 -0
- package/src/uni-ui/components/list.ts +259 -0
- package/src/uni-ui/components/loadMore.ts +61 -0
- package/src/uni-ui/components/navbar.ts +121 -0
- package/src/uni-ui/components/noticeBar.ts +83 -0
- package/src/uni-ui/components/numberbox.ts +49 -0
- package/src/uni-ui/components/pagination.ts +59 -0
- package/src/uni-ui/components/popup.ts +206 -0
- package/src/uni-ui/components/rate.ts +89 -0
- package/src/uni-ui/components/row.ts +126 -0
- package/src/uni-ui/components/searchBar.ts +84 -0
- package/src/uni-ui/components/section.ts +68 -0
- package/src/uni-ui/components/segmentedControl.ts +48 -0
- package/src/uni-ui/components/steps.ts +55 -0
- package/src/uni-ui/components/swipeAction.ts +133 -0
- package/src/uni-ui/components/swiperDot.ts +114 -0
- package/src/uni-ui/components/table.ts +132 -0
- package/src/uni-ui/components/tag.ts +56 -0
- package/src/uni-ui/components/title.ts +49 -0
- package/src/uni-ui/components/tooltip.ts +32 -0
- package/src/uni-ui/components/transition.ts +49 -0
- package/src/uni-ui/index.ts +30 -13
- package/src/uni-ui/lib/uni-col/uni-col.vue +324 -0
- package/src/uni-ui/lib/uni-data-select/uni-data-select.vue +590 -0
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +177 -177
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +947 -947
- package/src/uni-ui/lib/uni-datetime-picker/i18n/en.json +22 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/index.js +7 -7
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +939 -939
- package/src/uni-ui/lib/uni-datetime-picker/util.js +419 -419
- package/src/uni-ui/lib/uni-easyinput/common.js +54 -0
- package/src/uni-ui/lib/uni-easyinput/uni-easyinput.vue +790 -0
- package/src/uni-ui/lib/uni-forms/uni-forms.vue +416 -416
- package/src/uni-ui/lib/uni-forms/utils.js +281 -281
- package/src/uni-ui/lib/uni-forms/validate.js +485 -485
- package/src/uni-ui/lib/uni-forms-item/uni-forms-item.vue +630 -0
- package/src/uni-ui/lib/uni-goods-nav/i18n/en.json +6 -0
- package/src/uni-ui/lib/uni-goods-nav/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hans.json +6 -0
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hant.json +6 -0
- package/src/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +231 -0
- package/src/uni-ui/lib/uni-icons/uni-icons.uvue +91 -0
- package/src/uni-ui/lib/uni-icons/uni-icons.vue +114 -0
- package/src/uni-ui/lib/uni-icons/uniicons.css +664 -0
- package/src/uni-ui/lib/uni-icons/uniicons.ttf +0 -0
- package/src/uni-ui/lib/uni-icons/uniicons_file.ts +664 -0
- package/src/uni-ui/lib/uni-icons/uniicons_file_vue.js +649 -0
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +144 -0
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +404 -0
- package/src/uni-ui/lib/uni-list/uni-list.vue +123 -0
- package/src/uni-ui/lib/uni-list/uni-refresh.vue +65 -0
- package/src/uni-ui/lib/uni-list/uni-refresh.wxs +87 -0
- package/src/uni-ui/lib/uni-popup-dialog/keypress.js +45 -0
- package/src/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +324 -0
- package/src/uni-ui/lib/uni-rate/uni-rate.vue +361 -0
- package/src/uni-ui/lib/uni-table/uni-table.vue +496 -0
- package/src/uni-ui/lib/uni-td/uni-td.vue +99 -0
- package/src/uni-ui/lib/uni-th/uni-th.vue +310 -283
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +194 -170
- package/src/version.ts +2 -2
@@ -0,0 +1,54 @@
|
|
1
|
+
/**
|
2
|
+
* @desc 函数防抖
|
3
|
+
* @param func 目标函数
|
4
|
+
* @param wait 延迟执行毫秒数
|
5
|
+
* @param immediate true - 立即执行, false - 延迟执行
|
6
|
+
*/
|
7
|
+
export const debounce = function(func, wait = 1000, immediate = true) {
|
8
|
+
let timer;
|
9
|
+
return function() {
|
10
|
+
let context = this,
|
11
|
+
args = arguments;
|
12
|
+
if (timer) clearTimeout(timer);
|
13
|
+
if (immediate) {
|
14
|
+
let callNow = !timer;
|
15
|
+
timer = setTimeout(() => {
|
16
|
+
timer = null;
|
17
|
+
}, wait);
|
18
|
+
if (callNow) func.apply(context, args);
|
19
|
+
} else {
|
20
|
+
timer = setTimeout(() => {
|
21
|
+
func.apply(context, args);
|
22
|
+
}, wait)
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* @desc 函数节流
|
28
|
+
* @param func 函数
|
29
|
+
* @param wait 延迟执行毫秒数
|
30
|
+
* @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发
|
31
|
+
*/
|
32
|
+
export const throttle = (func, wait = 1000, type = 1) => {
|
33
|
+
let previous = 0;
|
34
|
+
let timeout;
|
35
|
+
return function() {
|
36
|
+
let context = this;
|
37
|
+
let args = arguments;
|
38
|
+
if (type === 1) {
|
39
|
+
let now = Date.now();
|
40
|
+
|
41
|
+
if (now - previous > wait) {
|
42
|
+
func.apply(context, args);
|
43
|
+
previous = now;
|
44
|
+
}
|
45
|
+
} else if (type === 2) {
|
46
|
+
if (!timeout) {
|
47
|
+
timeout = setTimeout(() => {
|
48
|
+
timeout = null;
|
49
|
+
func.apply(context, args)
|
50
|
+
}, wait)
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|