@gmcb/uv-ui 0.2.26
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/CHANGELOG.md +295 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/components/uv-action-sheet/props.js +50 -0
- package/components/uv-action-sheet/uv-action-sheet.vue +280 -0
- package/components/uv-album/uv-album.vue +312 -0
- package/components/uv-alert/props.js +45 -0
- package/components/uv-alert/uv-alert.vue +246 -0
- package/components/uv-avatar/props.js +85 -0
- package/components/uv-avatar/uv-avatar.vue +182 -0
- package/components/uv-avatar-group/props.js +53 -0
- package/components/uv-avatar-group/uv-avatar-group.vue +106 -0
- package/components/uv-back-top/props.js +58 -0
- package/components/uv-back-top/uv-back-top.vue +116 -0
- package/components/uv-badge/props.js +73 -0
- package/components/uv-badge/uv-badge.vue +176 -0
- package/components/uv-button/nvue.scss +46 -0
- package/components/uv-button/props.js +163 -0
- package/components/uv-button/uv-button.vue +529 -0
- package/components/uv-button/vue.scss +93 -0
- package/components/uv-calendar/calendar.js +546 -0
- package/components/uv-calendar/header.vue +104 -0
- package/components/uv-calendar/month.vue +616 -0
- package/components/uv-calendar/props.js +145 -0
- package/components/uv-calendar/uv-calendar.vue +390 -0
- package/components/uv-calendars/calendar-body.vue +376 -0
- package/components/uv-calendars/calendar-item.vue +248 -0
- package/components/uv-calendars/calendar.js +546 -0
- package/components/uv-calendars/i18n/en.json +12 -0
- package/components/uv-calendars/i18n/index.js +8 -0
- package/components/uv-calendars/i18n/zh-Hans.json +12 -0
- package/components/uv-calendars/i18n/zh-Hant.json +12 -0
- package/components/uv-calendars/util.js +435 -0
- package/components/uv-calendars/uv-calendars.vue +452 -0
- package/components/uv-cell/props.js +116 -0
- package/components/uv-cell/uv-cell.vue +209 -0
- package/components/uv-cell-group/props.js +15 -0
- package/components/uv-cell-group/uv-cell-group.vue +63 -0
- package/components/uv-checkbox/props.js +70 -0
- package/components/uv-checkbox/uv-checkbox.vue +371 -0
- package/components/uv-checkbox-group/props.js +84 -0
- package/components/uv-checkbox-group/uv-checkbox-group.vue +119 -0
- package/components/uv-code/props.js +35 -0
- package/components/uv-code/uv-code.vue +136 -0
- package/components/uv-code-input/props.js +83 -0
- package/components/uv-code-input/uv-code-input.vue +272 -0
- package/components/uv-col/props.js +30 -0
- package/components/uv-col/uv-col.vue +165 -0
- package/components/uv-collapse/props.js +20 -0
- package/components/uv-collapse/uv-collapse.vue +86 -0
- package/components/uv-collapse-item/props.js +60 -0
- package/components/uv-collapse-item/uv-collapse-item.vue +228 -0
- package/components/uv-column-notice/props.js +61 -0
- package/components/uv-column-notice/uv-column-notice.vue +176 -0
- package/components/uv-count-down/props.js +25 -0
- package/components/uv-count-down/utils.js +62 -0
- package/components/uv-count-down/uv-count-down.vue +169 -0
- package/components/uv-count-to/props.js +60 -0
- package/components/uv-count-to/uv-count-to.vue +187 -0
- package/components/uv-datetime-picker/props.js +130 -0
- package/components/uv-datetime-picker/uv-datetime-picker.vue +355 -0
- package/components/uv-divider/props.js +45 -0
- package/components/uv-divider/uv-divider.vue +113 -0
- package/components/uv-drop-down/uv-drop-down.vue +135 -0
- package/components/uv-drop-down-item/uv-drop-down-item.vue +169 -0
- package/components/uv-drop-down-popup/uv-drop-down-popup.vue +242 -0
- package/components/uv-empty/props.js +60 -0
- package/components/uv-empty/uv-empty.vue +126 -0
- package/components/uv-form/props.js +46 -0
- package/components/uv-form/uv-form.vue +209 -0
- package/components/uv-form/valid.js +1343 -0
- package/components/uv-form-item/props.js +49 -0
- package/components/uv-form-item/uv-form-item.vue +226 -0
- package/components/uv-gap/props.js +25 -0
- package/components/uv-gap/uv-gap.vue +36 -0
- package/components/uv-grid/props.js +20 -0
- package/components/uv-grid/uv-grid.vue +100 -0
- package/components/uv-grid-item/props.js +15 -0
- package/components/uv-grid-item/uv-grid-item.vue +223 -0
- package/components/uv-icon/icons.js +160 -0
- package/components/uv-icon/props.js +90 -0
- package/components/uv-icon/uv-icon.vue +226 -0
- package/components/uv-icon/uvicons.ttf +0 -0
- package/components/uv-image/props.js +100 -0
- package/components/uv-image/uv-image.vue +296 -0
- package/components/uv-index-anchor/props.js +30 -0
- package/components/uv-index-anchor/uv-index-anchor.vue +98 -0
- package/components/uv-index-item/uv-index-item.vue +87 -0
- package/components/uv-index-list/props.js +30 -0
- package/components/uv-index-list/uv-index-list.vue +461 -0
- package/components/uv-input/props.js +175 -0
- package/components/uv-input/uv-input.vue +348 -0
- package/components/uv-keyboard/props.js +95 -0
- package/components/uv-keyboard/uv-keyboard.vue +180 -0
- package/components/uv-keyboard-car/props.js +24 -0
- package/components/uv-keyboard-car/uv-keyboard-car.vue +347 -0
- package/components/uv-keyboard-number/props.js +19 -0
- package/components/uv-keyboard-number/uv-keyboard-number.vue +201 -0
- package/components/uv-line/props.js +34 -0
- package/components/uv-line/uv-line.vue +60 -0
- package/components/uv-line-progress/props.js +29 -0
- package/components/uv-line-progress/uv-line-progress.vue +146 -0
- package/components/uv-link/props.js +40 -0
- package/components/uv-link/uv-link.vue +83 -0
- package/components/uv-list/uv-list.vue +147 -0
- package/components/uv-list-item/uv-list-item.vue +535 -0
- package/components/uv-load-more/props.js +95 -0
- package/components/uv-load-more/uv-load-more.vue +152 -0
- package/components/uv-loading-icon/props.js +67 -0
- package/components/uv-loading-icon/uv-loading-icon.vue +347 -0
- package/components/uv-loading-page/props.js +55 -0
- package/components/uv-loading-page/uv-loading-page.vue +96 -0
- package/components/uv-modal/props.js +90 -0
- package/components/uv-modal/uv-modal.vue +245 -0
- package/components/uv-navbar/props.js +89 -0
- package/components/uv-navbar/uv-navbar.vue +245 -0
- package/components/uv-no-network/props.js +20 -0
- package/components/uv-no-network/uv-no-network.vue +222 -0
- package/components/uv-notice-bar/props.js +76 -0
- package/components/uv-notice-bar/uv-notice-bar.vue +110 -0
- package/components/uv-notify/props.js +45 -0
- package/components/uv-notify/uv-notify.vue +220 -0
- package/components/uv-number-box/props.js +118 -0
- package/components/uv-number-box/uv-number-box.vue +397 -0
- package/components/uv-overlay/props.js +25 -0
- package/components/uv-overlay/uv-overlay.vue +85 -0
- package/components/uv-parse/node/node.vue +576 -0
- package/components/uv-parse/parser.js +1335 -0
- package/components/uv-parse/uv-parse.vue +498 -0
- package/components/uv-pick-color/colors.js +217 -0
- package/components/uv-pick-color/props.js +47 -0
- package/components/uv-pick-color/uv-pick-color.vue +551 -0
- package/components/uv-picker/props.js +95 -0
- package/components/uv-picker/uv-picker.vue +329 -0
- package/components/uv-popup/keypress.js +45 -0
- package/components/uv-popup/uv-popup.vue +537 -0
- package/components/uv-preview-video/uv-preview-video.vue +52 -0
- package/components/uv-qrcode/cache.js +1 -0
- package/components/uv-qrcode/gcanvas/bridge/bridge-weex.js +241 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStylePattern.js +8 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
- package/components/uv-qrcode/gcanvas/context-2d/RenderingContext.js +666 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ActiveInfo.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Buffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Framebuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLenum.js +298 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLmethod.js +142 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLtype.js +23 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Program.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Renderbuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/RenderingContext.js +1191 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Shader.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Texture.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/UniformLocation.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/classUtils.js +3 -0
- package/components/uv-qrcode/gcanvas/env/canvas.js +74 -0
- package/components/uv-qrcode/gcanvas/env/image.js +96 -0
- package/components/uv-qrcode/gcanvas/env/tool.js +24 -0
- package/components/uv-qrcode/gcanvas/index.js +39 -0
- package/components/uv-qrcode/props.js +85 -0
- package/components/uv-qrcode/qrcode.js +34 -0
- package/components/uv-qrcode/queue.js +41 -0
- package/components/uv-qrcode/uv-qrcode.vue +1038 -0
- package/components/uv-radio/props.js +65 -0
- package/components/uv-radio/uv-radio.vue +349 -0
- package/components/uv-radio-group/props.js +89 -0
- package/components/uv-radio-group/uv-radio-group.vue +115 -0
- package/components/uv-rate/props.js +73 -0
- package/components/uv-rate/uv-rate.vue +274 -0
- package/components/uv-read-more/props.js +62 -0
- package/components/uv-read-more/uv-read-more.vue +162 -0
- package/components/uv-row/props.js +20 -0
- package/components/uv-row/uv-row.vue +95 -0
- package/components/uv-row-notice/props.js +40 -0
- package/components/uv-row-notice/uv-row-notice.vue +341 -0
- package/components/uv-safe-bottom/uv-safe-bottom.vue +67 -0
- package/components/uv-scroll-list/nvue.js +29 -0
- package/components/uv-scroll-list/props.js +35 -0
- package/components/uv-scroll-list/scrollWxs.wxs +51 -0
- package/components/uv-scroll-list/uv-scroll-list.vue +218 -0
- package/components/uv-search/props.js +127 -0
- package/components/uv-search/uv-search.vue +311 -0
- package/components/uv-skeleton/props.js +65 -0
- package/components/uv-skeleton/uv-skeleton.vue +250 -0
- package/components/uv-skeletons/uv-skeletons.vue +247 -0
- package/components/uv-slider/props.js +58 -0
- package/components/uv-slider/uv-slider.vue +58 -0
- package/components/uv-status-bar/props.js +8 -0
- package/components/uv-status-bar/uv-status-bar.vue +54 -0
- package/components/uv-steps/props.js +40 -0
- package/components/uv-steps/uv-steps.vue +83 -0
- package/components/uv-steps-item/props.js +25 -0
- package/components/uv-steps-item/uv-steps-item.vue +347 -0
- package/components/uv-sticky/props.js +41 -0
- package/components/uv-sticky/uv-sticky.vue +223 -0
- package/components/uv-subsection/props.js +54 -0
- package/components/uv-subsection/uv-subsection.vue +269 -0
- package/components/uv-swipe-action/props.js +10 -0
- package/components/uv-swipe-action/uv-swipe-action.vue +65 -0
- package/components/uv-swipe-action-item/index - backup.wxs +256 -0
- package/components/uv-swipe-action-item/index.wxs +225 -0
- package/components/uv-swipe-action-item/nvue - backup.js +264 -0
- package/components/uv-swipe-action-item/nvue.js +182 -0
- package/components/uv-swipe-action-item/props.js +40 -0
- package/components/uv-swipe-action-item/uv-swipe-action-item.vue +200 -0
- package/components/uv-swipe-action-item/wxs.js +15 -0
- package/components/uv-swiper/props.js +136 -0
- package/components/uv-swiper/uv-swiper.vue +263 -0
- package/components/uv-swiper-indicator/props.js +30 -0
- package/components/uv-swiper-indicator/uv-swiper-indicator.vue +112 -0
- package/components/uv-switch/props.js +58 -0
- package/components/uv-switch/uv-switch.vue +182 -0
- package/components/uv-tabbar/props.js +50 -0
- package/components/uv-tabbar/uv-tabbar.vue +146 -0
- package/components/uv-tabbar-item/props.js +40 -0
- package/components/uv-tabbar-item/uv-tabbar-item.vue +146 -0
- package/components/uv-tabs/props.js +71 -0
- package/components/uv-tabs/uv-tabs.vue +391 -0
- package/components/uv-tags/props.js +104 -0
- package/components/uv-tags/uv-tags.vue +379 -0
- package/components/uv-text/props.js +113 -0
- package/components/uv-text/uv-text.vue +218 -0
- package/components/uv-text/value.js +87 -0
- package/components/uv-textarea/props.js +138 -0
- package/components/uv-textarea/uv-textarea.vue +238 -0
- package/components/uv-toast/uv-toast.vue +292 -0
- package/components/uv-toolbar/props.js +40 -0
- package/components/uv-toolbar/uv-toolbar.vue +109 -0
- package/components/uv-tooltip/props.js +60 -0
- package/components/uv-tooltip/uv-tooltip.vue +372 -0
- package/components/uv-transition/createAnimation.js +131 -0
- package/components/uv-transition/props.js +31 -0
- package/components/uv-transition/uv-transition.vue +320 -0
- package/components/uv-upload/mixin.js +22 -0
- package/components/uv-upload/props.js +130 -0
- package/components/uv-upload/utils.js +151 -0
- package/components/uv-upload/uv-upload.vue +488 -0
- package/components/uv-vtabs/props.js +79 -0
- package/components/uv-vtabs/uv-vtabs.vue +438 -0
- package/components/uv-vtabs-item/uv-vtabs-item.vue +68 -0
- package/components/uv-waterfall/props.js +69 -0
- package/components/uv-waterfall/uv-waterfall.vue +265 -0
- package/index.js +82 -0
- package/index.scss +7 -0
- package/libs/config/config.js +34 -0
- package/libs/css/color.scss +32 -0
- package/libs/css/common.scss +100 -0
- package/libs/css/components.scss +23 -0
- package/libs/css/variable.scss +111 -0
- package/libs/css/vue.scss +40 -0
- package/libs/function/colorGradient.js +134 -0
- package/libs/function/compress.js +27 -0
- package/libs/function/debounce.js +29 -0
- package/libs/function/digit.js +167 -0
- package/libs/function/index.js +734 -0
- package/libs/function/platform.js +75 -0
- package/libs/function/test.js +287 -0
- package/libs/function/throttle.js +30 -0
- package/libs/luch-request/adapters/index.js +132 -0
- package/libs/luch-request/core/InterceptorManager.js +51 -0
- package/libs/luch-request/core/Request.js +201 -0
- package/libs/luch-request/core/buildFullPath.js +20 -0
- package/libs/luch-request/core/defaults.js +33 -0
- package/libs/luch-request/core/dispatchRequest.js +6 -0
- package/libs/luch-request/core/mergeConfig.js +126 -0
- package/libs/luch-request/core/settle.js +16 -0
- package/libs/luch-request/helpers/buildURL.js +64 -0
- package/libs/luch-request/helpers/combineURLs.js +14 -0
- package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
- package/libs/luch-request/index.d.ts +197 -0
- package/libs/luch-request/index.js +2 -0
- package/libs/luch-request/utils/clone.js +264 -0
- package/libs/luch-request/utils.js +135 -0
- package/libs/mixin/button.js +13 -0
- package/libs/mixin/mixin.js +172 -0
- package/libs/mixin/mpMixin.js +8 -0
- package/libs/mixin/mpShare.js +13 -0
- package/libs/mixin/openType.js +47 -0
- package/libs/mixin/touch.js +59 -0
- package/libs/util/dayjs.js +216 -0
- package/libs/util/route.js +126 -0
- package/package.json +28 -0
- package/theme.scss +43 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const MIN_DISTANCE = 10
|
|
2
|
+
|
|
3
|
+
function getDirection(x, y) {
|
|
4
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
5
|
+
return 'horizontal'
|
|
6
|
+
}
|
|
7
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
8
|
+
return 'vertical'
|
|
9
|
+
}
|
|
10
|
+
return ''
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
methods: {
|
|
15
|
+
getTouchPoint(e) {
|
|
16
|
+
if (!e) {
|
|
17
|
+
return {
|
|
18
|
+
x: 0,
|
|
19
|
+
y: 0
|
|
20
|
+
}
|
|
21
|
+
} if (e.touches && e.touches[0]) {
|
|
22
|
+
return {
|
|
23
|
+
x: e.touches[0].pageX,
|
|
24
|
+
y: e.touches[0].pageY
|
|
25
|
+
}
|
|
26
|
+
} if (e.changedTouches && e.changedTouches[0]) {
|
|
27
|
+
return {
|
|
28
|
+
x: e.changedTouches[0].pageX,
|
|
29
|
+
y: e.changedTouches[0].pageY
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
x: e.clientX || 0,
|
|
34
|
+
y: e.clientY || 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
resetTouchStatus() {
|
|
38
|
+
this.direction = ''
|
|
39
|
+
this.deltaX = 0
|
|
40
|
+
this.deltaY = 0
|
|
41
|
+
this.offsetX = 0
|
|
42
|
+
this.offsetY = 0
|
|
43
|
+
},
|
|
44
|
+
touchStart(event) {
|
|
45
|
+
this.resetTouchStatus()
|
|
46
|
+
const touch = this.getTouchPoint(event)
|
|
47
|
+
this.startX = touch.x
|
|
48
|
+
this.startY = touch.y
|
|
49
|
+
},
|
|
50
|
+
touchMove(event) {
|
|
51
|
+
const touch = this.getTouchPoint(event)
|
|
52
|
+
this.deltaX = touch.x - this.startX
|
|
53
|
+
this.deltaY = touch.y - this.startY
|
|
54
|
+
this.offsetX = Math.abs(this.deltaX)
|
|
55
|
+
this.offsetY = Math.abs(this.deltaY)
|
|
56
|
+
this.direction = this.direction || getDirection(this.offsetX, this.offsetY)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
var require_dayjs_min = __commonJS({
|
|
7
|
+
"uvuidayjs"(exports, module) {
|
|
8
|
+
!function(t, e) {
|
|
9
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
|
10
|
+
}(exports, function() {
|
|
11
|
+
"use strict";
|
|
12
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h = "quarter", c = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
13
|
+
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
14
|
+
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
15
|
+
} }, m = function(t2, e2, n2) {
|
|
16
|
+
var r2 = String(t2);
|
|
17
|
+
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
18
|
+
}, v = { s: m, z: function(t2) {
|
|
19
|
+
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
20
|
+
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
21
|
+
}, m: function t2(e2, n2) {
|
|
22
|
+
if (e2.date() < n2.date())
|
|
23
|
+
return -t2(n2, e2);
|
|
24
|
+
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f);
|
|
25
|
+
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
26
|
+
}, a: function(t2) {
|
|
27
|
+
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
28
|
+
}, p: function(t2) {
|
|
29
|
+
return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
30
|
+
}, u: function(t2) {
|
|
31
|
+
return void 0 === t2;
|
|
32
|
+
} }, g = "en", D = {};
|
|
33
|
+
D[g] = M;
|
|
34
|
+
var p = function(t2) {
|
|
35
|
+
return t2 instanceof _;
|
|
36
|
+
}, S = function t2(e2, n2, r2) {
|
|
37
|
+
var i2;
|
|
38
|
+
if (!e2)
|
|
39
|
+
return g;
|
|
40
|
+
if ("string" == typeof e2) {
|
|
41
|
+
var s2 = e2.toLowerCase();
|
|
42
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
43
|
+
var u2 = e2.split("-");
|
|
44
|
+
if (!i2 && u2.length > 1)
|
|
45
|
+
return t2(u2[0]);
|
|
46
|
+
} else {
|
|
47
|
+
var a2 = e2.name;
|
|
48
|
+
D[a2] = e2, i2 = a2;
|
|
49
|
+
}
|
|
50
|
+
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
51
|
+
}, w = function(t2, e2) {
|
|
52
|
+
if (p(t2))
|
|
53
|
+
return t2.clone();
|
|
54
|
+
var n2 = "object" == typeof e2 ? e2 : {};
|
|
55
|
+
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
56
|
+
}, O = v;
|
|
57
|
+
O.l = S, O.i = p, O.w = function(t2, e2) {
|
|
58
|
+
return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
59
|
+
};
|
|
60
|
+
var _ = function() {
|
|
61
|
+
function M2(t2) {
|
|
62
|
+
this.$L = S(t2.locale, null, true), this.parse(t2);
|
|
63
|
+
}
|
|
64
|
+
var m2 = M2.prototype;
|
|
65
|
+
return m2.parse = function(t2) {
|
|
66
|
+
this.$d = function(t3) {
|
|
67
|
+
var e2 = t3.date, n2 = t3.utc;
|
|
68
|
+
if (null === e2)
|
|
69
|
+
return new Date(NaN);
|
|
70
|
+
if (O.u(e2))
|
|
71
|
+
return new Date();
|
|
72
|
+
if (e2 instanceof Date)
|
|
73
|
+
return new Date(e2);
|
|
74
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
75
|
+
var r2 = e2.match($);
|
|
76
|
+
if (r2) {
|
|
77
|
+
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
78
|
+
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return new Date(e2);
|
|
82
|
+
}(t2), this.$x = t2.x || {}, this.init();
|
|
83
|
+
}, m2.init = function() {
|
|
84
|
+
var t2 = this.$d;
|
|
85
|
+
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
86
|
+
}, m2.$utils = function() {
|
|
87
|
+
return O;
|
|
88
|
+
}, m2.isValid = function() {
|
|
89
|
+
return !(this.$d.toString() === l);
|
|
90
|
+
}, m2.isSame = function(t2, e2) {
|
|
91
|
+
var n2 = w(t2);
|
|
92
|
+
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
93
|
+
}, m2.isAfter = function(t2, e2) {
|
|
94
|
+
return w(t2) < this.startOf(e2);
|
|
95
|
+
}, m2.isBefore = function(t2, e2) {
|
|
96
|
+
return this.endOf(e2) < w(t2);
|
|
97
|
+
}, m2.$g = function(t2, e2, n2) {
|
|
98
|
+
return O.u(t2) ? this[e2] : this.set(n2, t2);
|
|
99
|
+
}, m2.unix = function() {
|
|
100
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
101
|
+
}, m2.valueOf = function() {
|
|
102
|
+
return this.$d.getTime();
|
|
103
|
+
}, m2.startOf = function(t2, e2) {
|
|
104
|
+
var n2 = this, r2 = !!O.u(e2) || e2, h2 = O.p(t2), l2 = function(t3, e3) {
|
|
105
|
+
var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
106
|
+
return r2 ? i2 : i2.endOf(a);
|
|
107
|
+
}, $2 = function(t3, e3) {
|
|
108
|
+
return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
109
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
110
|
+
switch (h2) {
|
|
111
|
+
case c:
|
|
112
|
+
return r2 ? l2(1, 0) : l2(31, 11);
|
|
113
|
+
case f:
|
|
114
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
115
|
+
case o:
|
|
116
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
117
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
118
|
+
case a:
|
|
119
|
+
case d:
|
|
120
|
+
return $2(v2 + "Hours", 0);
|
|
121
|
+
case u:
|
|
122
|
+
return $2(v2 + "Minutes", 1);
|
|
123
|
+
case s:
|
|
124
|
+
return $2(v2 + "Seconds", 2);
|
|
125
|
+
case i:
|
|
126
|
+
return $2(v2 + "Milliseconds", 3);
|
|
127
|
+
default:
|
|
128
|
+
return this.clone();
|
|
129
|
+
}
|
|
130
|
+
}, m2.endOf = function(t2) {
|
|
131
|
+
return this.startOf(t2, false);
|
|
132
|
+
}, m2.$set = function(t2, e2) {
|
|
133
|
+
var n2, o2 = O.p(t2), h2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = h2 + "Date", n2[d] = h2 + "Date", n2[f] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s] = h2 + "Minutes", n2[i] = h2 + "Seconds", n2[r] = h2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
134
|
+
if (o2 === f || o2 === c) {
|
|
135
|
+
var y2 = this.clone().set(d, 1);
|
|
136
|
+
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
137
|
+
} else
|
|
138
|
+
l2 && this.$d[l2]($2);
|
|
139
|
+
return this.init(), this;
|
|
140
|
+
}, m2.set = function(t2, e2) {
|
|
141
|
+
return this.clone().$set(t2, e2);
|
|
142
|
+
}, m2.get = function(t2) {
|
|
143
|
+
return this[O.p(t2)]();
|
|
144
|
+
}, m2.add = function(r2, h2) {
|
|
145
|
+
var d2, l2 = this;
|
|
146
|
+
r2 = Number(r2);
|
|
147
|
+
var $2 = O.p(h2), y2 = function(t2) {
|
|
148
|
+
var e2 = w(l2);
|
|
149
|
+
return O.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
150
|
+
};
|
|
151
|
+
if ($2 === f)
|
|
152
|
+
return this.set(f, this.$M + r2);
|
|
153
|
+
if ($2 === c)
|
|
154
|
+
return this.set(c, this.$y + r2);
|
|
155
|
+
if ($2 === a)
|
|
156
|
+
return y2(1);
|
|
157
|
+
if ($2 === o)
|
|
158
|
+
return y2(7);
|
|
159
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
160
|
+
return O.w(m3, this);
|
|
161
|
+
}, m2.subtract = function(t2, e2) {
|
|
162
|
+
return this.add(-1 * t2, e2);
|
|
163
|
+
}, m2.format = function(t2) {
|
|
164
|
+
var e2 = this, n2 = this.$locale();
|
|
165
|
+
if (!this.isValid())
|
|
166
|
+
return n2.invalidDate || l;
|
|
167
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h2 = function(t3, n3, i3, s3) {
|
|
168
|
+
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
169
|
+
}, c2 = function(t3) {
|
|
170
|
+
return O.s(s2 % 12 || 12, t3, "0");
|
|
171
|
+
}, d2 = n2.meridiem || function(t3, e3, n3) {
|
|
172
|
+
var r3 = t3 < 12 ? "AM" : "PM";
|
|
173
|
+
return n3 ? r3.toLowerCase() : r3;
|
|
174
|
+
}, $2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f2, 3), MMMM: h2(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o2, 2), ddd: h2(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 };
|
|
175
|
+
return r2.replace(y, function(t3, e3) {
|
|
176
|
+
return e3 || $2[t3] || i2.replace(":", "");
|
|
177
|
+
});
|
|
178
|
+
}, m2.utcOffset = function() {
|
|
179
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
180
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
181
|
+
var $2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, v2 = this - M3, g2 = O.m(this, M3);
|
|
182
|
+
return g2 = ($2 = {}, $2[c] = g2 / 12, $2[f] = g2, $2[h] = g2 / 3, $2[o] = (v2 - m3) / 6048e5, $2[a] = (v2 - m3) / 864e5, $2[u] = v2 / n, $2[s] = v2 / e, $2[i] = v2 / t, $2)[y2] || v2, l2 ? g2 : O.a(g2);
|
|
183
|
+
}, m2.daysInMonth = function() {
|
|
184
|
+
return this.endOf(f).$D;
|
|
185
|
+
}, m2.$locale = function() {
|
|
186
|
+
return D[this.$L];
|
|
187
|
+
}, m2.locale = function(t2, e2) {
|
|
188
|
+
if (!t2)
|
|
189
|
+
return this.$L;
|
|
190
|
+
var n2 = this.clone(), r2 = S(t2, e2, true);
|
|
191
|
+
return r2 && (n2.$L = r2), n2;
|
|
192
|
+
}, m2.clone = function() {
|
|
193
|
+
return O.w(this.$d, this);
|
|
194
|
+
}, m2.toDate = function() {
|
|
195
|
+
return new Date(this.valueOf());
|
|
196
|
+
}, m2.toJSON = function() {
|
|
197
|
+
return this.isValid() ? this.toISOString() : null;
|
|
198
|
+
}, m2.toISOString = function() {
|
|
199
|
+
return this.$d.toISOString();
|
|
200
|
+
}, m2.toString = function() {
|
|
201
|
+
return this.$d.toUTCString();
|
|
202
|
+
}, M2;
|
|
203
|
+
}(), T = _.prototype;
|
|
204
|
+
return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) {
|
|
205
|
+
T[t2[1]] = function(e2) {
|
|
206
|
+
return this.$g(e2, t2[0], t2[1]);
|
|
207
|
+
};
|
|
208
|
+
}), w.extend = function(t2, e2) {
|
|
209
|
+
return t2.$i || (t2(e2, _, w), t2.$i = true), w;
|
|
210
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
|
|
211
|
+
return w(1e3 * t2);
|
|
212
|
+
}, w.en = D[g], w.Ls = D, w.p = {}, w;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
export default require_dayjs_min();
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
|
|
3
|
+
* 并且带有路由拦截功能
|
|
4
|
+
*/
|
|
5
|
+
import { queryParams, deepMerge, page } from '../../libs/function/index.js'
|
|
6
|
+
class Router {
|
|
7
|
+
constructor() {
|
|
8
|
+
// 原始属性定义
|
|
9
|
+
this.config = {
|
|
10
|
+
type: 'navigateTo',
|
|
11
|
+
url: '',
|
|
12
|
+
delta: 1, // navigateBack页面后退时,回退的层数
|
|
13
|
+
params: {}, // 传递的参数
|
|
14
|
+
animationType: 'pop-in', // 窗口动画,只在APP有效
|
|
15
|
+
animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
|
|
16
|
+
intercept: false ,// 是否需要拦截
|
|
17
|
+
events: {} // 页面间通信接口,用于监听被打开页面发送到当前页面的数据。hbuilderx 2.8.9+ 开始支持。
|
|
18
|
+
}
|
|
19
|
+
// 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
|
|
20
|
+
// 这里在构造函数中进行this绑定
|
|
21
|
+
this.route = this.route.bind(this)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
|
|
25
|
+
addRootPath(url) {
|
|
26
|
+
return url[0] === '/' ? url : `/${url}`
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 整合路由参数
|
|
30
|
+
mixinParam(url, params) {
|
|
31
|
+
url = url && this.addRootPath(url)
|
|
32
|
+
|
|
33
|
+
// 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
|
|
34
|
+
// 如果有url中有get参数,转换后无需带上"?"
|
|
35
|
+
let query = ''
|
|
36
|
+
if (/.*\/.*\?.*=.*/.test(url)) {
|
|
37
|
+
// object对象转为get类型的参数
|
|
38
|
+
query = queryParams(params, false)
|
|
39
|
+
// 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
|
|
40
|
+
return url += `&${query}`
|
|
41
|
+
}
|
|
42
|
+
// 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
|
|
43
|
+
query = queryParams(params)
|
|
44
|
+
return url += query
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 对外的方法名称
|
|
48
|
+
async route(options = {}, params = {}) {
|
|
49
|
+
// 合并用户的配置和内部的默认配置
|
|
50
|
+
let mergeConfig = {}
|
|
51
|
+
|
|
52
|
+
if (typeof options === 'string') {
|
|
53
|
+
// 如果options为字符串,则为route(url, params)的形式
|
|
54
|
+
mergeConfig.url = this.mixinParam(options, params)
|
|
55
|
+
mergeConfig.type = 'navigateTo'
|
|
56
|
+
} else {
|
|
57
|
+
mergeConfig = deepMerge(this.config, options)
|
|
58
|
+
// 否则正常使用mergeConfig中的url和params进行拼接
|
|
59
|
+
mergeConfig.url = this.mixinParam(options.url, options.params)
|
|
60
|
+
}
|
|
61
|
+
// 如果本次跳转的路径和本页面路径一致,不执行跳转,防止用户快速点击跳转按钮,造成多次跳转同一个页面的问题
|
|
62
|
+
if (mergeConfig.url === page()) return
|
|
63
|
+
|
|
64
|
+
if (params.intercept) {
|
|
65
|
+
mergeConfig.intercept = params.intercept
|
|
66
|
+
}
|
|
67
|
+
// params参数也带给拦截器
|
|
68
|
+
mergeConfig.params = params
|
|
69
|
+
// 合并内外部参数
|
|
70
|
+
mergeConfig = deepMerge(this.config, mergeConfig)
|
|
71
|
+
// 判断用户是否定义了拦截器
|
|
72
|
+
if (typeof mergeConfig.intercept === 'function') {
|
|
73
|
+
// 定一个promise,根据用户执行resolve(true)或者resolve(false)来决定是否进行路由跳转
|
|
74
|
+
const isNext = await new Promise((resolve, reject) => {
|
|
75
|
+
mergeConfig.intercept(mergeConfig, resolve)
|
|
76
|
+
})
|
|
77
|
+
// 如果isNext为true,则执行路由跳转
|
|
78
|
+
isNext && this.openPage(mergeConfig)
|
|
79
|
+
} else {
|
|
80
|
+
this.openPage(mergeConfig)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 执行路由跳转
|
|
85
|
+
openPage(config) {
|
|
86
|
+
// 解构参数
|
|
87
|
+
const {
|
|
88
|
+
url,
|
|
89
|
+
type,
|
|
90
|
+
delta,
|
|
91
|
+
animationType,
|
|
92
|
+
animationDuration,
|
|
93
|
+
events
|
|
94
|
+
} = config
|
|
95
|
+
if (config.type == 'navigateTo' || config.type == 'to') {
|
|
96
|
+
uni.navigateTo({
|
|
97
|
+
url,
|
|
98
|
+
animationType,
|
|
99
|
+
animationDuration,
|
|
100
|
+
events
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
if (config.type == 'redirectTo' || config.type == 'redirect') {
|
|
104
|
+
uni.redirectTo({
|
|
105
|
+
url
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
if (config.type == 'switchTab' || config.type == 'tab') {
|
|
109
|
+
uni.switchTab({
|
|
110
|
+
url
|
|
111
|
+
})
|
|
112
|
+
}
|
|
113
|
+
if (config.type == 'reLaunch' || config.type == 'launch') {
|
|
114
|
+
uni.reLaunch({
|
|
115
|
+
url
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
if (config.type == 'navigateBack' || config.type == 'back') {
|
|
119
|
+
uni.navigateBack({
|
|
120
|
+
delta
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export default (new Router()).route
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gmcb/uv-ui",
|
|
3
|
+
"version": "0.2.26",
|
|
4
|
+
"description": "uv-ui 破釜沉舟之兼容vue3+2、nvue、app、h5、小程序等多端基于uni-app和uView2.x的生态框架,支持单独导入,开箱即用,利剑出击。",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"homepage": "https://git.keeprisk.cn/gmcb/front-end/tree/master/packages/uv-ui",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"uv-ui",
|
|
12
|
+
"uvui",
|
|
13
|
+
"uni-app 框架",
|
|
14
|
+
"uv_UI",
|
|
15
|
+
"uv UI"
|
|
16
|
+
],
|
|
17
|
+
"author": "yinjiazeng@163.com",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"files": [
|
|
20
|
+
"libs",
|
|
21
|
+
"components",
|
|
22
|
+
"CHANGELOG.md",
|
|
23
|
+
"README.md",
|
|
24
|
+
"index.scss",
|
|
25
|
+
"theme.scss"
|
|
26
|
+
],
|
|
27
|
+
"gitHead": "295849adc75d0a7f7197f2ff4d8264b3cce8b913"
|
|
28
|
+
}
|
package/theme.scss
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// 此文件为uvUI的主题变量,这些变量目前只能通过uni.scss引入才有效,另外由于
|
|
2
|
+
// uni.scss中引入的样式会同时混入到全局样式文件和单独每一个页面的样式中,造成微信程序包太大,
|
|
3
|
+
// 故uni.scss只建议放scss变量名相关样式,其他的样式可以通过main.js或者App.vue引入
|
|
4
|
+
|
|
5
|
+
$uv-main-color: #303133;
|
|
6
|
+
$uv-content-color: #606266;
|
|
7
|
+
$uv-tips-color: #909193;
|
|
8
|
+
$uv-light-color: #c0c4cc;
|
|
9
|
+
$uv-border-color: #dadbde;
|
|
10
|
+
$uv-bg-color: #f3f4f6;
|
|
11
|
+
$uv-disabled-color: #c8c9cc;
|
|
12
|
+
|
|
13
|
+
$uv-primary: #3c9cff;
|
|
14
|
+
$uv-primary-dark: #398ade;
|
|
15
|
+
$uv-primary-disabled: #9acafc;
|
|
16
|
+
$uv-primary-light: #ecf5ff;
|
|
17
|
+
|
|
18
|
+
$uv-warning: #f9ae3d;
|
|
19
|
+
$uv-warning-dark: #f1a532;
|
|
20
|
+
$uv-warning-disabled: #f9d39b;
|
|
21
|
+
$uv-warning-light: #fdf6ec;
|
|
22
|
+
|
|
23
|
+
$uv-success: #5ac725;
|
|
24
|
+
$uv-success-dark: #53c21d;
|
|
25
|
+
$uv-success-disabled: #a9e08f;
|
|
26
|
+
$uv-success-light: #f5fff0;
|
|
27
|
+
|
|
28
|
+
$uv-error: #f56c6c;
|
|
29
|
+
$uv-error-dark: #e45656;
|
|
30
|
+
$uv-error-disabled: #f7b2b2;
|
|
31
|
+
$uv-error-light: #fef0f0;
|
|
32
|
+
|
|
33
|
+
$uv-info: #909399;
|
|
34
|
+
$uv-info-dark: #767a82;
|
|
35
|
+
$uv-info-disabled: #c4c6c9;
|
|
36
|
+
$uv-info-light: #f4f4f5;
|
|
37
|
+
|
|
38
|
+
@mixin flex($direction: row) {
|
|
39
|
+
/* #ifndef APP-NVUE */
|
|
40
|
+
display: flex;
|
|
41
|
+
/* #endif */
|
|
42
|
+
flex-direction: $direction;
|
|
43
|
+
}
|