uview-plus 3.8.55 → 3.8.106
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 +2147 -1828
- package/components/u-action-sheet/props.js +3 -1
- package/components/u-action-sheet/u-action-sheet.vue +22 -2
- package/components/u-album/props.js +3 -1
- package/components/u-alert/props.js +4 -2
- package/components/u-avatar/props.js +4 -1
- package/components/u-avatar-group/props.js +4 -1
- package/components/u-back-top/props.js +4 -1
- package/components/u-badge/props.js +4 -1
- package/components/u-barcode/u-barcode.vue +44 -15
- package/components/u-box/props.js +5 -2
- package/components/u-button/props.js +4 -1
- package/components/u-button/u-button.vue +2 -5
- package/components/u-button/vue.scss +3 -3
- package/components/u-calendar/calendar.js +8 -0
- package/components/u-calendar/props.js +43 -1
- package/components/u-calendar/u-calendar.vue +16 -0
- package/components/u-calendar-strip/props.js +3 -1
- package/components/u-canvas/u-canvas.vue +1028 -423
- package/components/u-car-keyboard/props.js +3 -1
- package/components/u-card/props.js +3 -1
- package/components/u-cell/props.js +4 -1
- package/components/u-cell/u-cell.vue +9 -1
- package/components/u-cell-group/props.js +4 -1
- package/components/u-checkbox/props.js +4 -1
- package/components/u-checkbox/u-checkbox.vue +7 -3
- package/components/u-checkbox-group/props.js +3 -1
- package/components/u-circle-progress/props.js +4 -1
- package/components/u-code/props.js +4 -1
- package/components/u-code-input/props.js +4 -1
- package/components/u-col/props.js +4 -1
- package/components/u-collapse/props.js +4 -1
- package/components/u-collapse-item/props.js +4 -1
- package/components/u-color-picker/u-color-picker.vue +1 -0
- package/components/u-column-notice/props.js +4 -1
- package/components/u-count-down/props.js +4 -1
- package/components/u-count-to/props.js +4 -1
- package/components/u-cropper/u-cropper.vue +95 -51
- package/components/u-datetime-picker/props.js +4 -1
- package/components/u-datetime-picker/u-datetime-picker.vue +53 -4
- package/components/u-divider/props.js +4 -1
- package/components/u-dragsort/u-dragsort.vue +57 -32
- package/components/u-dropdown/props.js +3 -1
- package/components/u-dropdown-item/props.js +3 -1
- package/components/u-empty/props.js +4 -1
- package/components/u-form/props.js +4 -1
- package/components/u-form-item/props.js +4 -1
- package/components/u-gap/props.js +4 -1
- package/components/u-grid/props.js +4 -1
- package/components/u-grid-item/props.js +4 -1
- package/components/u-guide/props.js +3 -1
- package/components/u-icon/props.js +4 -1
- package/components/u-icon/u-icon.vue +11 -2
- package/components/u-icon/upicon.ttf +0 -0
- package/components/u-icon/util.js +103 -10
- package/components/u-image/props.js +4 -1
- package/components/u-image/u-image.vue +280 -267
- package/components/u-index-anchor/props.js +4 -1
- package/components/u-index-item/props.js +2 -1
- package/components/u-index-item/u-index-item.vue +1 -1
- package/components/u-index-list/props.js +4 -1
- package/components/u-index-list/u-index-list.vue +1 -1
- package/components/u-input/props.js +3 -1
- package/components/u-keyboard/props.js +4 -1
- package/components/u-line/props.js +4 -1
- package/components/u-line-progress/props.js +6 -3
- package/components/u-link/props.js +4 -1
- package/components/u-list/props.js +4 -1
- package/components/u-list-item/props.js +4 -1
- package/components/u-loading-icon/props.js +4 -1
- package/components/u-loading-page/props.js +3 -1
- package/components/u-loadmore/props.js +4 -1
- package/components/u-markdown/u-markdown.vue +45 -3
- package/components/u-modal/props.js +4 -1
- package/components/u-navbar/props.js +4 -2
- package/components/u-navbar/u-navbar.vue +15 -9
- package/components/u-no-network/props.js +4 -1
- package/components/u-notice-bar/props.js +4 -1
- package/components/u-notify/props.js +4 -1
- package/components/u-novel-reader/content-normalizer.js +80 -0
- package/components/u-novel-reader/layout-engine.js +225 -0
- package/components/u-novel-reader/measure-adapter.js +69 -0
- package/components/u-novel-reader/novelReader.js +35 -0
- package/components/u-novel-reader/persistence.js +144 -0
- package/components/u-novel-reader/props.js +100 -0
- package/components/u-novel-reader/reader-catalog.vue +234 -0
- package/components/u-novel-reader/reader-content.vue +226 -0
- package/components/u-novel-reader/reader-core.js +151 -0
- package/components/u-novel-reader/reader-settings.vue +325 -0
- package/components/u-novel-reader/reader-toolbar.vue +313 -0
- package/components/u-novel-reader/theme-vars.scss +49 -0
- package/components/u-novel-reader/u-novel-reader.vue +836 -0
- package/components/u-number-box/props.js +4 -1
- package/components/u-number-box/u-number-box.vue +2 -2
- package/components/u-number-keyboard/props.js +4 -1
- package/components/u-overlay/props.js +4 -1
- package/components/u-pagination/u-pagination.vue +60 -39
- package/components/u-parse/props.js +4 -1
- package/components/u-picker/props.js +4 -1
- package/components/u-picker-column/props.js +3 -1
- package/components/u-popover/props.js +2 -1
- package/components/u-popup/props.js +4 -1
- package/components/u-poster/u-poster.vue +246 -214
- package/components/u-qrcode/qrcode.js +105 -97
- package/components/u-qrcode/u-qrcode.vue +242 -289
- package/components/u-radio/props.js +4 -1
- package/components/u-radio/u-radio.vue +7 -3
- package/components/u-radio-group/props.js +4 -1
- package/components/u-rate/props.js +4 -1
- package/components/u-read-more/props.js +4 -1
- package/components/u-row/props.js +4 -1
- package/components/u-row-notice/props.js +4 -1
- package/components/u-safe-bottom/props.js +2 -1
- package/components/u-scroll-list/props.js +4 -1
- package/components/u-scroll-list/scrollWxs.wxs +1 -1
- package/components/u-search/props.js +3 -1
- package/components/u-skeleton/props.js +4 -1
- package/components/u-slider/props.js +3 -1
- package/components/u-slider/u-slider.vue +71 -29
- package/components/u-status-bar/props.js +4 -1
- package/components/u-steps/props.js +4 -1
- package/components/u-steps-item/props.js +4 -1
- package/components/u-sticky/props.js +4 -1
- package/components/u-sticky/u-sticky.vue +11 -0
- package/components/u-subsection/props.js +3 -1
- package/components/u-swipe-action/props.js +4 -1
- package/components/u-swipe-action-item/index.wxs +43 -25
- package/components/u-swipe-action-item/nvue.js +9 -0
- package/components/u-swipe-action-item/other.js +32 -21
- package/components/u-swipe-action-item/props.js +9 -1
- package/components/u-swipe-action-item/swipeActionItem.js +1 -0
- package/components/u-swipe-action-item/u-swipe-action-item.vue +42 -4
- package/components/u-swiper/props.js +9 -1
- package/components/u-swiper/swiper.js +1 -0
- package/components/u-swiper/u-swiper.vue +2 -0
- package/components/u-swiper-indicator/props.js +4 -1
- package/components/u-switch/props.js +4 -1
- package/components/u-switch/u-switch.vue +1 -1
- package/components/u-tabbar/props.js +3 -1
- package/components/u-tabbar/u-tabbar.vue +2 -1
- package/components/u-tabbar-item/props.js +4 -1
- package/components/u-tabbar-item/u-tabbar-item.vue +64 -21
- package/components/u-table/props.js +3 -1
- package/components/u-table2/tableRow.vue +155 -69
- package/components/u-table2/u-table2.vue +327 -137
- package/components/u-tabs/props.js +4 -1
- package/components/u-tabs/u-tabs.vue +11 -8
- package/components/u-tabs-item/props.js +3 -1
- package/components/u-tabs-pro/u-tabs-pro.vue +212 -0
- package/components/u-tag/props.js +4 -1
- package/components/u-td/props.js +3 -1
- package/components/u-text/props.js +4 -1
- package/components/u-text/text.js +1 -1
- package/components/u-text/u-text.vue +18 -6
- package/components/u-textarea/props.js +3 -1
- package/components/u-textarea/u-textarea.vue +16 -5
- package/components/u-th/props.js +3 -1
- package/components/u-toolbar/props.js +4 -1
- package/components/u-tooltip/props.js +10 -2
- package/components/u-tooltip/tooltip.js +2 -1
- package/components/u-tooltip/u-tooltip.vue +31 -3
- package/components/u-tr/props.js +3 -1
- package/components/u-transition/nvue-ani-map.js +75 -68
- package/components/u-transition/props.js +4 -1
- package/components/u-transition/transitionMixin.js +164 -163
- package/components/u-upload/props.js +4 -1
- package/components/u-upload/u-upload.vue +48 -41
- package/components/u-waterfall/u-waterfall.vue +162 -110
- package/index.js +65 -8
- package/libs/config/config.js +1 -1
- package/libs/config/props.js +180 -204
- package/libs/css/components.scss +3 -0
- package/libs/function/index.js +66 -0
- package/libs/function/uni-api-shims.js +29 -0
- package/libs/i18n/index.js +71 -36
- package/libs/i18n/locale-packs.js +11 -0
- package/libs/i18n/locales/all.js +23 -0
- package/libs/i18n/locales/{de.json → de.js} +1 -1
- package/libs/i18n/locales/{en.json → en.js} +2 -2
- package/libs/i18n/locales/{es.json → es.js} +1 -1
- package/libs/i18n/locales/{fr.json → fr.js} +2 -2
- package/libs/i18n/locales/{ja.json → ja.js} +1 -1
- package/libs/i18n/locales/{ko.json → ko.js} +1 -1
- package/libs/i18n/locales/{ru.json → ru.js} +1 -1
- package/libs/i18n/locales/{th.json → th.js} +1 -1
- package/libs/i18n/locales/{zh-Hans.json → zh-Hans.js} +1 -1
- package/libs/i18n/locales/{zh-Hant.json → zh-Hant.js} +1 -1
- package/libs/mixin/mixin.js +18 -54
- package/libs/root/index.js +78 -5
- package/libs/root/page.js +7 -7
- package/libs/root/root.js +73 -3
- package/libs/util/app-nvue-webview-canvas.js +486 -0
- package/libs/util/gcanvas/bridge/bridge-weex.js +10 -7
- package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
- package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
- package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
- package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
- package/libs/util/gcanvas/context-webgl/Program.js +0 -0
- package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
- package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
- package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
- package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
- package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
- package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
- package/libs/util/gcanvas/env/canvas.js +0 -0
- package/libs/util/gcanvas/env/image.js +0 -0
- package/libs/util/gcanvas/env/tool.js +0 -0
- package/libs/util/gcanvas/index.js +3 -3
- package/package.json +4 -5
- package/tsconfig.json +18 -0
- package/types/comps/calendar.d.ts +38 -0
- package/types/comps/checkbox.d.ts +12 -0
- package/types/comps/lineProgress.d.ts +5 -0
- package/types/comps/navbar.d.ts +3 -3
- package/types/comps/swipeActionItem.d.ts +13 -0
- package/types/comps/swiper.d.ts +5 -0
- package/types/comps/tabs.d.ts +2 -1
- package/types/comps/text.d.ts +1 -1
- package/types/comps/tooltip.d.ts +36 -1
- package/types/func.d.ts +23 -0
- package/types/index.d.ts +1 -0
- /package/components/u-markdown/{marked.esm.js → marked.esm.mjs} +0 -0
package/libs/config/props.js
CHANGED
|
@@ -1,220 +1,196 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Shared props configuration store.
|
|
3
|
+
*
|
|
4
|
+
* Component defaults are registered lazily by each component props.js file so
|
|
5
|
+
* importing one component no longer pulls defaults for every component.
|
|
5
6
|
*/
|
|
6
7
|
import config from './config'
|
|
7
|
-
// 各个需要fixed的地方的z-index配置文件
|
|
8
8
|
import zIndex from './zIndex.js'
|
|
9
|
-
// 关于颜色的配置,特殊场景使用
|
|
10
9
|
import color from './color.js'
|
|
11
|
-
// http
|
|
12
10
|
import http from '../function/http.js'
|
|
13
11
|
import { shallowMerge } from '../function/index.js'
|
|
14
|
-
// 组件props
|
|
15
|
-
import ActionSheet from '../../components/u-action-sheet/actionSheet'
|
|
16
|
-
import Album from '../../components/u-album/album'
|
|
17
|
-
import Alert from '../../components/u-alert/alert'
|
|
18
|
-
import Avatar from '../../components/u-avatar/avatar'
|
|
19
|
-
import AvatarGroup from '../../components/u-avatar-group/avatarGroup'
|
|
20
|
-
import Backtop from '../../components/u-back-top/backtop'
|
|
21
|
-
import Badge from '../../components/u-badge/badge'
|
|
22
|
-
import Button from '../../components/u-button/button'
|
|
23
|
-
import Calendar from '../../components/u-calendar/calendar'
|
|
24
|
-
import CalendarStrip from '../../components/u-calendar-strip/calendarStrip'
|
|
25
|
-
import CarKeyboard from '../../components/u-car-keyboard/carKeyboard'
|
|
26
|
-
import Card from '../../components/u-card/card'
|
|
27
|
-
import Cell from '../../components/u-cell/cell'
|
|
28
|
-
import CellGroup from '../../components/u-cell-group/cellGroup'
|
|
29
|
-
import Checkbox from '../../components/u-checkbox/checkbox'
|
|
30
|
-
import CheckboxGroup from '../../components/u-checkbox-group/checkboxGroup'
|
|
31
|
-
import CircleProgress from '../../components/u-circle-progress/circleProgress'
|
|
32
|
-
import Code from '../../components/u-code/code'
|
|
33
|
-
import CodeInput from '../../components/u-code-input/codeInput'
|
|
34
|
-
import Col from '../../components/u-col/col'
|
|
35
|
-
import Collapse from '../../components/u-collapse/collapse'
|
|
36
|
-
import CollapseItem from '../../components/u-collapse-item/collapseItem'
|
|
37
|
-
import ColumnNotice from '../../components/u-column-notice/columnNotice'
|
|
38
|
-
import CountDown from '../../components/u-count-down/countDown'
|
|
39
|
-
import CountTo from '../../components/u-count-to/countTo'
|
|
40
|
-
import DatetimePicker from '../../components/u-datetime-picker/datetimePicker'
|
|
41
|
-
import Divider from '../../components/u-divider/divider'
|
|
42
|
-
import Empty from '../../components/u-empty/empty'
|
|
43
|
-
import Form from '../../components/u-form/form'
|
|
44
|
-
import FormItem from '../../components/u-form-item/formItem'
|
|
45
|
-
import Gap from '../../components/u-gap/gap'
|
|
46
|
-
import Guide from '../../components/u-guide/guide'
|
|
47
|
-
import Grid from '../../components/u-grid/grid'
|
|
48
|
-
import GridItem from '../../components/u-grid-item/gridItem'
|
|
49
|
-
import Icon from '../../components/u-icon/icon'
|
|
50
|
-
import Image from '../../components/u-image/image'
|
|
51
|
-
import IndexAnchor from '../../components/u-index-anchor/indexAnchor'
|
|
52
|
-
import IndexList from '../../components/u-index-list/indexList'
|
|
53
|
-
import Input from '../../components/u-input/input'
|
|
54
|
-
import Keyboard from '../../components/u-keyboard/keyboard'
|
|
55
|
-
import Line from '../../components/u-line/line'
|
|
56
|
-
import LineProgress from '../../components/u-line-progress/lineProgress'
|
|
57
|
-
import Link from '../../components/u-link/link'
|
|
58
|
-
import List from '../../components/u-list/list'
|
|
59
|
-
import ListItem from '../../components/u-list-item/listItem'
|
|
60
|
-
import LoadingIcon from '../../components/u-loading-icon/loadingIcon'
|
|
61
|
-
import LoadingPage from '../../components/u-loading-page/loadingPage'
|
|
62
|
-
import Loadmore from '../../components/u-loadmore/loadmore'
|
|
63
|
-
import Modal from '../../components/u-modal/modal'
|
|
64
|
-
import Navbar from '../../components/u-navbar/navbar'
|
|
65
|
-
import NoNetwork from '../../components/u-no-network/noNetwork'
|
|
66
|
-
import NoticeBar from '../../components/u-notice-bar/noticeBar'
|
|
67
|
-
import Notify from '../../components/u-notify/notify'
|
|
68
|
-
import NumberBox from '../../components/u-number-box/numberBox'
|
|
69
|
-
import NumberKeyboard from '../../components/u-number-keyboard/numberKeyboard'
|
|
70
|
-
import Overlay from '../../components/u-overlay/overlay'
|
|
71
|
-
import Parse from '../../components/u-parse/parse'
|
|
72
|
-
import Picker from '../../components/u-picker/picker'
|
|
73
|
-
import Popup from '../../components/u-popup/popup'
|
|
74
|
-
import Radio from '../../components/u-radio/radio'
|
|
75
|
-
import RadioGroup from '../../components/u-radio-group/radioGroup'
|
|
76
|
-
import Rate from '../../components/u-rate/rate'
|
|
77
|
-
import ReadMore from '../../components/u-read-more/readMore'
|
|
78
|
-
import Row from '../../components/u-row/row'
|
|
79
|
-
import RowNotice from '../../components/u-row-notice/rowNotice'
|
|
80
|
-
import ScrollList from '../../components/u-scroll-list/scrollList'
|
|
81
|
-
import Search from '../../components/u-search/search'
|
|
82
|
-
import Section from '../../components/u-section/section'
|
|
83
|
-
import Skeleton from '../../components/u-skeleton/skeleton'
|
|
84
|
-
import Slider from '../../components/u-slider/slider'
|
|
85
|
-
import StatusBar from '../../components/u-status-bar/statusBar'
|
|
86
|
-
import Steps from '../../components/u-steps/steps'
|
|
87
|
-
import StepsItem from '../../components/u-steps-item/stepsItem'
|
|
88
|
-
import Sticky from '../../components/u-sticky/sticky'
|
|
89
|
-
import Subsection from '../../components/u-subsection/subsection'
|
|
90
|
-
import SwipeAction from '../../components/u-swipe-action/swipeAction'
|
|
91
|
-
import SwipeActionItem from '../../components/u-swipe-action-item/swipeActionItem'
|
|
92
|
-
import Swiper from '../../components/u-swiper/swiper'
|
|
93
|
-
import SwipterIndicator from '../../components/u-swiper-indicator/swipterIndicator'
|
|
94
|
-
import Switch from '../../components/u-switch/switch'
|
|
95
|
-
import Tabbar from '../../components/u-tabbar/tabbar'
|
|
96
|
-
import TabbarItem from '../../components/u-tabbar-item/tabbarItem'
|
|
97
|
-
import Tabs from '../../components/u-tabs/tabs'
|
|
98
|
-
import Tag from '../../components/u-tag/tag'
|
|
99
|
-
import Text from '../../components/u-text/text'
|
|
100
|
-
import Textarea from '../../components/u-textarea/textarea'
|
|
101
|
-
import Toast from '../../components/u-toast/toast'
|
|
102
|
-
import Toolbar from '../../components/u-toolbar/toolbar'
|
|
103
|
-
import Tooltip from '../../components/u-tooltip/tooltip'
|
|
104
|
-
import Transition from '../../components/u-transition/transition'
|
|
105
|
-
import Upload from '../../components/u-upload/upload'
|
|
106
12
|
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
13
|
+
const componentKeys = [
|
|
14
|
+
'actionSheet',
|
|
15
|
+
'album',
|
|
16
|
+
'alert',
|
|
17
|
+
'avatar',
|
|
18
|
+
'avatarGroup',
|
|
19
|
+
'backtop',
|
|
20
|
+
'badge',
|
|
21
|
+
'box',
|
|
22
|
+
'button',
|
|
23
|
+
'calendar',
|
|
24
|
+
'calendarStrip',
|
|
25
|
+
'carKeyboard',
|
|
26
|
+
'card',
|
|
27
|
+
'cell',
|
|
28
|
+
'cellGroup',
|
|
29
|
+
'checkbox',
|
|
30
|
+
'checkboxGroup',
|
|
31
|
+
'circleProgress',
|
|
32
|
+
'code',
|
|
33
|
+
'codeInput',
|
|
34
|
+
'col',
|
|
35
|
+
'collapse',
|
|
36
|
+
'collapseItem',
|
|
37
|
+
'columnNotice',
|
|
38
|
+
'countDown',
|
|
39
|
+
'countTo',
|
|
40
|
+
'datetimePicker',
|
|
41
|
+
'divider',
|
|
42
|
+
'dropdown',
|
|
43
|
+
'dropdownItem',
|
|
44
|
+
'empty',
|
|
45
|
+
'form',
|
|
46
|
+
'formItem',
|
|
47
|
+
'gap',
|
|
48
|
+
'grid',
|
|
49
|
+
'gridItem',
|
|
50
|
+
'guide',
|
|
51
|
+
'icon',
|
|
52
|
+
'image',
|
|
53
|
+
'indexAnchor',
|
|
54
|
+
'indexItem',
|
|
55
|
+
'indexList',
|
|
56
|
+
'input',
|
|
57
|
+
'keyboard',
|
|
58
|
+
'line',
|
|
59
|
+
'lineProgress',
|
|
60
|
+
'link',
|
|
61
|
+
'list',
|
|
62
|
+
'listItem',
|
|
63
|
+
'loadingIcon',
|
|
64
|
+
'loadingPage',
|
|
65
|
+
'loadmore',
|
|
66
|
+
'modal',
|
|
67
|
+
'navbar',
|
|
68
|
+
'navbarMini',
|
|
69
|
+
'noNetwork',
|
|
70
|
+
'noticeBar',
|
|
71
|
+
'notify',
|
|
72
|
+
'novelReader',
|
|
73
|
+
'numberBox',
|
|
74
|
+
'numberKeyboard',
|
|
75
|
+
'overlay',
|
|
76
|
+
'parse',
|
|
77
|
+
'pdfReader',
|
|
78
|
+
'picker',
|
|
79
|
+
'pickerColumn',
|
|
80
|
+
'popover',
|
|
81
|
+
'popup',
|
|
82
|
+
'radio',
|
|
83
|
+
'radioGroup',
|
|
84
|
+
'rate',
|
|
85
|
+
'readMore',
|
|
86
|
+
'row',
|
|
87
|
+
'rowNotice',
|
|
88
|
+
'safeBottom',
|
|
89
|
+
'scrollList',
|
|
90
|
+
'search',
|
|
91
|
+
'section',
|
|
92
|
+
'skeleton',
|
|
93
|
+
'slider',
|
|
94
|
+
'statusBar',
|
|
95
|
+
'steps',
|
|
96
|
+
'stepsItem',
|
|
97
|
+
'sticky',
|
|
98
|
+
'subsection',
|
|
99
|
+
'swipeAction',
|
|
100
|
+
'swipeActionItem',
|
|
101
|
+
'swiper',
|
|
102
|
+
'swiperIndicator',
|
|
103
|
+
'switch',
|
|
104
|
+
'tabbar',
|
|
105
|
+
'tabbarItem',
|
|
106
|
+
'table',
|
|
107
|
+
'tabs',
|
|
108
|
+
'tabsItem',
|
|
109
|
+
'tag',
|
|
110
|
+
'td',
|
|
111
|
+
'text',
|
|
112
|
+
'textarea',
|
|
113
|
+
'th',
|
|
114
|
+
'toast',
|
|
115
|
+
'toolbar',
|
|
116
|
+
'tooltip',
|
|
117
|
+
'tr',
|
|
118
|
+
'transition',
|
|
119
|
+
'upload'
|
|
120
|
+
]
|
|
121
|
+
|
|
122
|
+
const props = {}
|
|
123
|
+
|
|
124
|
+
function ensureComponentProps(key) {
|
|
125
|
+
if (!props[key] || typeof props[key] !== 'object') {
|
|
126
|
+
props[key] = {}
|
|
127
|
+
}
|
|
128
|
+
return props[key]
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function isPlainObject(value) {
|
|
132
|
+
return Object.prototype.toString.call(value) === '[object Object]'
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function cloneDefaultValue(value) {
|
|
136
|
+
if (Array.isArray(value)) {
|
|
137
|
+
return value.slice()
|
|
138
|
+
}
|
|
139
|
+
if (isPlainObject(value)) {
|
|
140
|
+
return mergeDefaults({}, value)
|
|
141
|
+
}
|
|
142
|
+
return value
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function mergeDefaults(target, defaults = {}) {
|
|
146
|
+
if (!target || typeof target !== 'object' || !defaults || typeof defaults !== 'object') {
|
|
147
|
+
return target
|
|
148
|
+
}
|
|
149
|
+
Object.keys(defaults).forEach((key) => {
|
|
150
|
+
const defaultValue = defaults[key]
|
|
151
|
+
const targetValue = target[key]
|
|
152
|
+
if (targetValue === undefined) {
|
|
153
|
+
target[key] = cloneDefaultValue(defaultValue)
|
|
154
|
+
} else if (isPlainObject(targetValue) && isPlainObject(defaultValue)) {
|
|
155
|
+
mergeDefaults(targetValue, defaultValue)
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
return target
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
componentKeys.forEach(ensureComponentProps)
|
|
162
|
+
|
|
163
|
+
export function registerComponentProps(defaultProps = {}) {
|
|
164
|
+
Object.keys(defaultProps || {}).forEach((key) => {
|
|
165
|
+
const componentProps = ensureComponentProps(key)
|
|
166
|
+
mergeDefaults(componentProps, defaultProps[key])
|
|
167
|
+
})
|
|
168
|
+
return props
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function setPropsConfig(configProps = {}) {
|
|
172
|
+
Object.keys(configProps || {}).forEach((key) => {
|
|
173
|
+
shallowMerge(ensureComponentProps(key), configProps[key])
|
|
174
|
+
})
|
|
175
|
+
return props
|
|
199
176
|
}
|
|
200
177
|
|
|
201
|
-
function setConfig(configs) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
178
|
+
function setConfig(configs = {}) {
|
|
179
|
+
shallowMerge(config, configs.config || {})
|
|
180
|
+
setPropsConfig(configs.props || {})
|
|
181
|
+
shallowMerge(color, configs.color || {})
|
|
182
|
+
shallowMerge(zIndex, configs.zIndex || {})
|
|
206
183
|
}
|
|
207
184
|
|
|
208
|
-
// 初始化自定义配置
|
|
209
185
|
if (typeof uni !== 'undefined' && uni && uni.upuiParams) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
186
|
+
console.log('setting uview-plus')
|
|
187
|
+
let temp = uni.upuiParams()
|
|
188
|
+
if (temp.httpIns) {
|
|
189
|
+
temp.httpIns(http)
|
|
190
|
+
}
|
|
191
|
+
if (temp.options) {
|
|
192
|
+
setConfig(temp.options)
|
|
193
|
+
}
|
|
218
194
|
}
|
|
219
195
|
|
|
220
196
|
export default props
|
package/libs/css/components.scss
CHANGED
package/libs/function/index.js
CHANGED
|
@@ -5,6 +5,71 @@ import {
|
|
|
5
5
|
} from './test.js'
|
|
6
6
|
import { round } from './digit.js'
|
|
7
7
|
import config from '../config/config.js'
|
|
8
|
+
|
|
9
|
+
function emptyNodeInfo() {
|
|
10
|
+
return {
|
|
11
|
+
width: 0,
|
|
12
|
+
height: 0,
|
|
13
|
+
left: 0,
|
|
14
|
+
right: 0,
|
|
15
|
+
top: 0,
|
|
16
|
+
bottom: 0
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// #ifdef APP-NVUE
|
|
21
|
+
const dom = (typeof uni !== 'undefined' && uni && typeof uni.requireNativePlugin === 'function')
|
|
22
|
+
? uni.requireNativePlugin('dom')
|
|
23
|
+
: null
|
|
24
|
+
|
|
25
|
+
function getNvueRect(ref) {
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
if (!dom || !ref) {
|
|
28
|
+
resolve(emptyNodeInfo())
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
dom.getComponentRect(ref, (res) => {
|
|
32
|
+
resolve(res && res.size ? res.size : emptyNodeInfo())
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
// #endif
|
|
37
|
+
|
|
38
|
+
// 查询节点信息
|
|
39
|
+
export function upGetRect(selector, all = false, comp = null) {
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
// #ifndef APP-NVUE
|
|
42
|
+
const query = uni.createSelectorQuery()
|
|
43
|
+
const scopedQuery = comp ? query.in(comp) : query
|
|
44
|
+
scopedQuery[all ? 'selectAll' : 'select'](selector)
|
|
45
|
+
.boundingClientRect((rect) => {
|
|
46
|
+
if (all) {
|
|
47
|
+
resolve(Array.isArray(rect) ? rect : [])
|
|
48
|
+
return
|
|
49
|
+
}
|
|
50
|
+
resolve(rect || emptyNodeInfo())
|
|
51
|
+
})
|
|
52
|
+
.exec()
|
|
53
|
+
// #endif
|
|
54
|
+
|
|
55
|
+
// #ifdef APP-NVUE
|
|
56
|
+
sleep(30).then(async () => {
|
|
57
|
+
const refs = comp?.$refs || comp?.proxy?.$refs || comp?.refs || {}
|
|
58
|
+
const selectorRef = refs[selector.substring(1)]
|
|
59
|
+
if (all) {
|
|
60
|
+
const selectorRefs = Array.isArray(selectorRef)
|
|
61
|
+
? selectorRef
|
|
62
|
+
: selectorRef ? [selectorRef] : []
|
|
63
|
+
resolve(await Promise.all(selectorRefs.map(ref => getNvueRect(ref))))
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
const ref = Array.isArray(selectorRef) ? selectorRef[0] : selectorRef
|
|
67
|
+
resolve(await getNvueRect(ref))
|
|
68
|
+
})
|
|
69
|
+
// #endif
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
8
73
|
/**
|
|
9
74
|
* @description 如果value小于min,取min;如果value大于max,取max
|
|
10
75
|
* @param {number} min
|
|
@@ -841,6 +906,7 @@ function hslToHex(h, s, l) {
|
|
|
841
906
|
}
|
|
842
907
|
|
|
843
908
|
export default {
|
|
909
|
+
upGetRect,
|
|
844
910
|
range,
|
|
845
911
|
getPx,
|
|
846
912
|
sleep,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* uni API shims
|
|
3
|
+
*
|
|
4
|
+
* 部分小程序平台(如支付宝)不支持某些 uni API,直接调用会抛出 TypeError。
|
|
5
|
+
* 本模块在库初始化时检测缺失的 API 并自动补齐空实现,防止运行时报错。
|
|
6
|
+
*
|
|
7
|
+
* 扩展方式:在 needShims 数组中追加 { name, fallback } 即可。
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const needShims = [
|
|
11
|
+
{
|
|
12
|
+
name: 'onWindowResize',
|
|
13
|
+
fallback: function (_callback) { /* no-op */ }
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'offWindowResize',
|
|
17
|
+
fallback: function (_callback) { /* no-op */ }
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
export function applyUniApiShims() {
|
|
22
|
+
if (typeof uni === 'undefined') return
|
|
23
|
+
|
|
24
|
+
for (const { name, fallback } of needShims) {
|
|
25
|
+
if (typeof uni[name] !== 'function') {
|
|
26
|
+
uni[name] = fallback
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/libs/i18n/index.js
CHANGED
|
@@ -1,54 +1,89 @@
|
|
|
1
|
-
import zhHans from './locales/zh-Hans.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import ko from './locales/ko.json'
|
|
8
|
-
import ja from './locales/ja.json'
|
|
9
|
-
import ru from './locales/ru.json'
|
|
10
|
-
|
|
11
|
-
let settings = {
|
|
12
|
-
lang: uni.getLocale(),
|
|
1
|
+
import zhHans from './locales/zh-Hans.js'
|
|
2
|
+
|
|
3
|
+
const settings = {
|
|
4
|
+
lang: typeof uni !== 'undefined' && typeof uni.getLocale === 'function'
|
|
5
|
+
? uni.getLocale()
|
|
6
|
+
: 'zh-Hans',
|
|
13
7
|
locales: {
|
|
14
|
-
en,
|
|
15
|
-
es,
|
|
16
|
-
fr,
|
|
17
|
-
de,
|
|
18
|
-
ko,
|
|
19
|
-
ja,
|
|
20
|
-
ru,
|
|
21
|
-
'zh-Hant': zhHant,
|
|
22
8
|
'zh-Hans': zhHans
|
|
23
9
|
}
|
|
24
|
-
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (typeof uni !== 'undefined' && typeof uni.onLocaleChange === 'function') {
|
|
13
|
+
uni.onLocaleChange((locale) => {
|
|
14
|
+
// uni-app 部分平台回调可能是字符串,也可能是 { locale }
|
|
15
|
+
settings.lang = typeof locale === 'string'
|
|
16
|
+
? locale
|
|
17
|
+
: (locale && locale.locale) || settings.lang
|
|
18
|
+
})
|
|
19
|
+
}
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
21
|
+
function isPlainObject(value) {
|
|
22
|
+
return Object.prototype.toString.call(value) === '[object Object]'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function hasLocale(locale) {
|
|
26
|
+
return !!(locale && settings.locales[locale])
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getLocale() {
|
|
30
|
+
return settings.lang
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function setLocale(locale) {
|
|
34
|
+
if (!locale || typeof locale !== 'string') return settings.lang
|
|
35
|
+
settings.lang = locale
|
|
36
|
+
if (typeof uni !== 'undefined' && typeof uni.setLocale === 'function') {
|
|
37
|
+
try {
|
|
38
|
+
uni.setLocale(locale)
|
|
39
|
+
} catch (e) {
|
|
40
|
+
// 部分平台 setLocale 可能受限,忽略以保持 set 内部状态成功
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return settings.lang
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 注册语言包
|
|
48
|
+
* registerLocale('en', messages)
|
|
49
|
+
* registerLocale({ en: messages, ja: messages2 })
|
|
50
|
+
*/
|
|
51
|
+
export function registerLocale(localeOrMap, messages) {
|
|
52
|
+
if (typeof localeOrMap === 'string') {
|
|
53
|
+
if (!localeOrMap || !isPlainObject(messages)) return
|
|
54
|
+
settings.locales[localeOrMap] = messages
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
if (!isPlainObject(localeOrMap)) return
|
|
58
|
+
Object.keys(localeOrMap).forEach((key) => {
|
|
59
|
+
const value = localeOrMap[key]
|
|
60
|
+
if (isPlainObject(value)) {
|
|
61
|
+
settings.locales[key] = value
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}
|
|
29
65
|
|
|
30
66
|
/**
|
|
31
67
|
* 多语言方法
|
|
32
68
|
*/
|
|
33
69
|
export function t(value, params = {}) {
|
|
34
|
-
// console.log(settings.locales[settings.lang])
|
|
35
70
|
if (value) {
|
|
36
71
|
let lang = settings.lang
|
|
37
72
|
if (!settings.locales[settings.lang]) {
|
|
38
73
|
lang = 'zh-Hans'
|
|
39
74
|
}
|
|
40
|
-
let result = settings.locales[lang][value] || value
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return value;
|
|
75
|
+
let result = settings.locales[lang][value] || value
|
|
76
|
+
if (params && typeof params === 'object') {
|
|
77
|
+
Object.keys(params).forEach((key) => {
|
|
78
|
+
const reg = new RegExp(`{${key}}`, 'g')
|
|
79
|
+
result = String(result).replace(reg, params[key])
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
return result
|
|
49
83
|
}
|
|
84
|
+
return value
|
|
50
85
|
}
|
|
51
86
|
|
|
52
87
|
export default {
|
|
53
|
-
settings
|
|
54
|
-
}
|
|
88
|
+
settings
|
|
89
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as zhHans } from './locales/zh-Hans.js'
|
|
2
|
+
export { default as zhHant } from './locales/zh-Hant.js'
|
|
3
|
+
export { default as en } from './locales/en.js'
|
|
4
|
+
export { default as es } from './locales/es.js'
|
|
5
|
+
export { default as fr } from './locales/fr.js'
|
|
6
|
+
export { default as de } from './locales/de.js'
|
|
7
|
+
export { default as ko } from './locales/ko.js'
|
|
8
|
+
export { default as ja } from './locales/ja.js'
|
|
9
|
+
export { default as ru } from './locales/ru.js'
|
|
10
|
+
export { default as th } from './locales/th.js'
|
|
11
|
+
export { default as all } from './locales/all.js'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import zhHans from './zh-Hans.js'
|
|
2
|
+
import zhHant from './zh-Hant.js'
|
|
3
|
+
import en from './en.js'
|
|
4
|
+
import es from './es.js'
|
|
5
|
+
import fr from './fr.js'
|
|
6
|
+
import de from './de.js'
|
|
7
|
+
import ko from './ko.js'
|
|
8
|
+
import ja from './ja.js'
|
|
9
|
+
import ru from './ru.js'
|
|
10
|
+
import th from './th.js'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
'zh-Hans': zhHans,
|
|
14
|
+
'zh-Hant': zhHant,
|
|
15
|
+
en,
|
|
16
|
+
es,
|
|
17
|
+
fr,
|
|
18
|
+
de,
|
|
19
|
+
ko,
|
|
20
|
+
ja,
|
|
21
|
+
ru,
|
|
22
|
+
th
|
|
23
|
+
}
|