feat:还原更新框架
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
|
||||
// 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
|
||||
const color = {
|
||||
primary: '#3c9cff',
|
||||
@@ -13,4 +14,4 @@ const color = {
|
||||
borderColor: '#e4e7ed'
|
||||
}
|
||||
|
||||
export default color
|
||||
export default color
|
||||
|
||||
@@ -1,58 +1,46 @@
|
||||
const version = '3'
|
||||
|
||||
// 开发环境才提示,生产环境不会提示
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log(`\n %c uview-plus V${version} %c https://uview-plus.jiangruyi.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
|
||||
}
|
||||
|
||||
export default {
|
||||
v: version,
|
||||
version,
|
||||
// 主题名称
|
||||
type: [
|
||||
'primary',
|
||||
'success',
|
||||
'info',
|
||||
'error',
|
||||
'warning'
|
||||
],
|
||||
// 颜色部分,本来可以通过scss的:export导出供js使用,但是奈何nvue不支持
|
||||
color: {
|
||||
'u-primary': '#2979ff',
|
||||
'u-warning': '#ff9900',
|
||||
'u-success': '#19be6b',
|
||||
'u-error': '#fa3534',
|
||||
'u-info': '#909399',
|
||||
'u-main-color': '#303133',
|
||||
'u-content-color': '#606266',
|
||||
'u-tips-color': '#909399',
|
||||
'u-light-color': '#c0c4cc',
|
||||
'up-primary': '#2979ff',
|
||||
'up-warning': '#ff9900',
|
||||
'up-success': '#19be6b',
|
||||
'up-error': '#fa3534',
|
||||
'up-info': '#909399',
|
||||
'up-main-color': '#303133',
|
||||
'up-content-color': '#606266',
|
||||
'up-tips-color': '#909399',
|
||||
'up-light-color': '#c0c4cc'
|
||||
},
|
||||
// 字体图标地址
|
||||
iconUrl: 'https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf',
|
||||
// 自定义图标
|
||||
customIcon: {
|
||||
family: '',
|
||||
url: ''
|
||||
},
|
||||
customIcons: {}, // 自定义图标与unicode对应关系
|
||||
// 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx
|
||||
unit: 'px',
|
||||
// 是否由运行时主题同步原生导航栏、页面背景、tabBar等全局UI
|
||||
nativeThemeSync: false,
|
||||
// 拦截器
|
||||
interceptor: {
|
||||
navbarLeftClick: null
|
||||
},
|
||||
// 只加载一次字体
|
||||
loadFontOnce: false
|
||||
}
|
||||
const version = '3'
|
||||
|
||||
// 开发环境才提示,生产环境不会提示
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log(`\n %c uview-plus V${version} %c https://ijry.github.io/uview-plus/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
|
||||
}
|
||||
|
||||
export default {
|
||||
v: version,
|
||||
version,
|
||||
// 主题名称
|
||||
type: [
|
||||
'primary',
|
||||
'success',
|
||||
'info',
|
||||
'error',
|
||||
'warning'
|
||||
],
|
||||
// 颜色部分,本来可以通过scss的:export导出供js使用,但是奈何nvue不支持
|
||||
color: {
|
||||
'u-primary': '#2979ff',
|
||||
'u-warning': '#ff9900',
|
||||
'u-success': '#19be6b',
|
||||
'u-error': '#fa3534',
|
||||
'u-info': '#909399',
|
||||
'u-main-color': '#303133',
|
||||
'u-content-color': '#606266',
|
||||
'u-tips-color': '#909399',
|
||||
'u-light-color': '#c0c4cc',
|
||||
'up-primary': '#2979ff',
|
||||
'up-warning': '#ff9900',
|
||||
'up-success': '#19be6b',
|
||||
'up-error': '#fa3534',
|
||||
'up-info': '#909399',
|
||||
'up-main-color': '#303133',
|
||||
'up-content-color': '#606266',
|
||||
'up-tips-color': '#909399',
|
||||
'up-light-color': '#c0c4cc'
|
||||
},
|
||||
// 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx
|
||||
unit: 'px',
|
||||
// 拦截器
|
||||
interceptor: {
|
||||
navbarLeftClick: null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,195 +1,190 @@
|
||||
/**
|
||||
* Shared props configuration store.
|
||||
*
|
||||
* Component defaults are registered lazily by each component props.js file so
|
||||
* importing one component no longer pulls defaults for every component.
|
||||
*/
|
||||
import config from './config'
|
||||
import zIndex from './zIndex.js'
|
||||
import color from './color.js'
|
||||
import http from '../function/http.js'
|
||||
import { shallowMerge } from '../function/index.js'
|
||||
|
||||
const componentKeys = [
|
||||
'actionSheet',
|
||||
'album',
|
||||
'alert',
|
||||
'avatar',
|
||||
'avatarGroup',
|
||||
'backtop',
|
||||
'badge',
|
||||
'box',
|
||||
'button',
|
||||
'calendar',
|
||||
'calendarStrip',
|
||||
'carKeyboard',
|
||||
'card',
|
||||
'cell',
|
||||
'cellGroup',
|
||||
'checkbox',
|
||||
'checkboxGroup',
|
||||
'circleProgress',
|
||||
'code',
|
||||
'codeInput',
|
||||
'col',
|
||||
'collapse',
|
||||
'collapseItem',
|
||||
'columnNotice',
|
||||
'countDown',
|
||||
'countTo',
|
||||
'datetimePicker',
|
||||
'divider',
|
||||
'dropdown',
|
||||
'dropdownItem',
|
||||
'empty',
|
||||
'form',
|
||||
'formItem',
|
||||
'gap',
|
||||
'grid',
|
||||
'gridItem',
|
||||
'guide',
|
||||
'icon',
|
||||
'image',
|
||||
'indexAnchor',
|
||||
'indexItem',
|
||||
'indexList',
|
||||
'input',
|
||||
'keyboard',
|
||||
'line',
|
||||
'lineProgress',
|
||||
'link',
|
||||
'list',
|
||||
'listItem',
|
||||
'loadingIcon',
|
||||
'loadingPage',
|
||||
'loadmore',
|
||||
'modal',
|
||||
'navbar',
|
||||
'navbarMini',
|
||||
'noNetwork',
|
||||
'noticeBar',
|
||||
'notify',
|
||||
'numberBox',
|
||||
'numberKeyboard',
|
||||
'overlay',
|
||||
'parse',
|
||||
'pdfReader',
|
||||
'picker',
|
||||
'pickerColumn',
|
||||
'popover',
|
||||
'popup',
|
||||
'radio',
|
||||
'radioGroup',
|
||||
'rate',
|
||||
'readMore',
|
||||
'row',
|
||||
'rowNotice',
|
||||
'safeBottom',
|
||||
'scrollList',
|
||||
'search',
|
||||
'section',
|
||||
'skeleton',
|
||||
'slider',
|
||||
'statusBar',
|
||||
'steps',
|
||||
'stepsItem',
|
||||
'sticky',
|
||||
'subsection',
|
||||
'swipeAction',
|
||||
'swipeActionItem',
|
||||
'swiper',
|
||||
'swiperIndicator',
|
||||
'switch',
|
||||
'tabbar',
|
||||
'tabbarItem',
|
||||
'table',
|
||||
'tabs',
|
||||
'tabsItem',
|
||||
'tag',
|
||||
'td',
|
||||
'text',
|
||||
'textarea',
|
||||
'th',
|
||||
'toast',
|
||||
'toolbar',
|
||||
'tooltip',
|
||||
'tr',
|
||||
'transition',
|
||||
'upload'
|
||||
]
|
||||
|
||||
const props = {}
|
||||
|
||||
function ensureComponentProps(key) {
|
||||
if (!props[key] || typeof props[key] !== 'object') {
|
||||
props[key] = {}
|
||||
}
|
||||
return props[key]
|
||||
}
|
||||
|
||||
function isPlainObject(value) {
|
||||
return Object.prototype.toString.call(value) === '[object Object]'
|
||||
}
|
||||
|
||||
function cloneDefaultValue(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.slice()
|
||||
}
|
||||
if (isPlainObject(value)) {
|
||||
return mergeDefaults({}, value)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
function mergeDefaults(target, defaults = {}) {
|
||||
if (!target || typeof target !== 'object' || !defaults || typeof defaults !== 'object') {
|
||||
return target
|
||||
}
|
||||
Object.keys(defaults).forEach((key) => {
|
||||
const defaultValue = defaults[key]
|
||||
const targetValue = target[key]
|
||||
if (targetValue === undefined) {
|
||||
target[key] = cloneDefaultValue(defaultValue)
|
||||
} else if (isPlainObject(targetValue) && isPlainObject(defaultValue)) {
|
||||
mergeDefaults(targetValue, defaultValue)
|
||||
}
|
||||
})
|
||||
return target
|
||||
}
|
||||
|
||||
componentKeys.forEach(ensureComponentProps)
|
||||
|
||||
export function registerComponentProps(defaultProps = {}) {
|
||||
Object.keys(defaultProps || {}).forEach((key) => {
|
||||
const componentProps = ensureComponentProps(key)
|
||||
mergeDefaults(componentProps, defaultProps[key])
|
||||
})
|
||||
return props
|
||||
}
|
||||
|
||||
export function setPropsConfig(configProps = {}) {
|
||||
Object.keys(configProps || {}).forEach((key) => {
|
||||
shallowMerge(ensureComponentProps(key), configProps[key])
|
||||
})
|
||||
return props
|
||||
}
|
||||
|
||||
function setConfig(configs = {}) {
|
||||
shallowMerge(config, configs.config || {})
|
||||
setPropsConfig(configs.props || {})
|
||||
shallowMerge(color, configs.color || {})
|
||||
shallowMerge(zIndex, configs.zIndex || {})
|
||||
}
|
||||
|
||||
if (typeof uni !== 'undefined' && uni && uni.upuiParams) {
|
||||
console.log('setting uview-plus')
|
||||
let temp = uni.upuiParams()
|
||||
if (temp.httpIns) {
|
||||
temp.httpIns(http)
|
||||
}
|
||||
if (temp.options) {
|
||||
setConfig(temp.options)
|
||||
}
|
||||
}
|
||||
|
||||
export default props
|
||||
/**
|
||||
* 此文件的作用为统一配置所有组件的props参数
|
||||
* 借此用户可以全局覆盖组件的props默认值
|
||||
* 无需在每个引入组件的页面中都配置一次
|
||||
*/
|
||||
import config from './config'
|
||||
|
||||
import ActionSheet from '../../components/u-action-sheet/actionSheet'
|
||||
import Album from '../../components/u-album/album'
|
||||
import Alert from '../../components/u-alert/alert'
|
||||
import Avatar from '../../components/u-avatar/avatar'
|
||||
import AvatarGroup from '../../components/u-avatar-group/avatarGroup'
|
||||
import Backtop from '../../components/u-back-top/backtop'
|
||||
import Badge from '../../components/u-badge/badge'
|
||||
import Button from '../../components/u-button/button'
|
||||
import Calendar from '../../components/u-calendar/calendar'
|
||||
import CarKeyboard from '../../components/u-car-keyboard/carKeyboard'
|
||||
import Cell from '../../components/u-cell/cell'
|
||||
import CellGroup from '../../components/u-cell-group/cellGroup'
|
||||
import Checkbox from '../../components/u-checkbox/checkbox'
|
||||
import CheckboxGroup from '../../components/u-checkbox-group/checkboxGroup'
|
||||
import CircleProgress from '../../components/u-circle-progress/circleProgress'
|
||||
import Code from '../../components/u-code/code'
|
||||
import CodeInput from '../../components/u-code-input/codeInput'
|
||||
import Col from '../../components/u-col/col'
|
||||
import Collapse from '../../components/u-collapse/collapse'
|
||||
import CollapseItem from '../../components/u-collapse-item/collapseItem'
|
||||
import ColumnNotice from '../../components/u-column-notice/columnNotice'
|
||||
import CountDown from '../../components/u-count-down/countDown'
|
||||
import CountTo from '../../components/u-count-to/countTo'
|
||||
import DatetimePicker from '../../components/u-datetime-picker/datetimePicker'
|
||||
import Divider from '../../components/u-divider/divider'
|
||||
import Empty from '../../components/u-empty/empty'
|
||||
import Form from '../../components/u-form/form'
|
||||
import GormItem from '../../components/u-form-item/formItem'
|
||||
import Gap from '../../components/u-gap/gap'
|
||||
import Grid from '../../components/u-grid/grid'
|
||||
import GridItem from '../../components/u-grid-item/gridItem'
|
||||
import Icon from '../../components/u-icon/icon'
|
||||
import Image from '../../components/u-image/image'
|
||||
import IndexAnchor from '../../components/u-index-anchor/indexAnchor'
|
||||
import IndexList from '../../components/u-index-list/indexList'
|
||||
import Input from '../../components/u-input/input'
|
||||
import Keyboard from '../../components/u-keyboard/keyboard'
|
||||
import Line from '../../components/u-line/line'
|
||||
import LineProgress from '../../components/u-line-progress/lineProgress'
|
||||
import Link from '../../components/u-link/link'
|
||||
import List from '../../components/u-list/list'
|
||||
import ListItem from '../../components/u-list-item/listItem'
|
||||
import LoadingIcon from '../../components/u-loading-icon/loadingIcon'
|
||||
import LoadingPage from '../../components/u-loading-page/loadingPage'
|
||||
import Loadmore from '../../components/u-loadmore/loadmore'
|
||||
import Modal from '../../components/u-modal/modal'
|
||||
import Navbar from '../../components/u-navbar/navbar'
|
||||
import NoNetwork from '../../components/u-no-network/noNetwork'
|
||||
import NoticeBar from '../../components/u-notice-bar/noticeBar'
|
||||
import Notify from '../../components/u-notify/notify'
|
||||
import NumberBox from '../../components/u-number-box/numberBox'
|
||||
import NumberKeyboard from '../../components/u-number-keyboard/numberKeyboard'
|
||||
import Overlay from '../../components/u-overlay/overlay'
|
||||
import Parse from '../../components/u-parse/parse'
|
||||
import Picker from '../../components/u-picker/picker'
|
||||
import Popup from '../../components/u-popup/popup'
|
||||
import Radio from '../../components/u-radio/radio'
|
||||
import RadioGroup from '../../components/u-radio-group/radioGroup'
|
||||
import Rate from '../../components/u-rate/rate'
|
||||
import ReadMore from '../../components/u-read-more/readMore'
|
||||
import Row from '../../components/u-row/row'
|
||||
import RowNotice from '../../components/u-row-notice/rowNotice'
|
||||
import ScrollList from '../../components/u-scroll-list/scrollList'
|
||||
import Search from '../../components/u-search/search'
|
||||
import Section from '../../components/u-section/section'
|
||||
import Skeleton from '../../components/u-skeleton/skeleton'
|
||||
import Slider from '../../components/u-slider/slider'
|
||||
import StatusBar from '../../components/u-status-bar/statusBar'
|
||||
import Steps from '../../components/u-steps/steps'
|
||||
import StepsItem from '../../components/u-steps-item/stepsItem'
|
||||
import Sticky from '../../components/u-sticky/sticky'
|
||||
import Subsection from '../../components/u-subsection/subsection'
|
||||
import SwipeAction from '../../components/u-swipe-action/swipeAction'
|
||||
import SwipeActionItem from '../../components/u-swipe-action-item/swipeActionItem'
|
||||
import Swiper from '../../components/u-swiper/swiper'
|
||||
import SwipterIndicator from '../../components/u-swiper-indicator/swipterIndicator'
|
||||
import Switch from '../../components/u-switch/switch'
|
||||
import Tabbar from '../../components/u-tabbar/tabbar'
|
||||
import TabbarItem from '../../components/u-tabbar-item/tabbarItem'
|
||||
import Tabs from '../../components/u-tabs/tabs'
|
||||
import Tag from '../../components/u-tag/tag'
|
||||
import Text from '../../components/u-text/text'
|
||||
import Textarea from '../../components/u-textarea/textarea'
|
||||
import Toast from '../../components/u-toast/toast'
|
||||
import Toolbar from '../../components/u-toolbar/toolbar'
|
||||
import Tooltip from '../../components/u-tooltip/tooltip'
|
||||
import Transition from '../../components/u-transition/transition'
|
||||
import Upload from '../../components/u-upload/upload'
|
||||
|
||||
const {
|
||||
color
|
||||
} = config
|
||||
|
||||
export default {
|
||||
...ActionSheet,
|
||||
...Album,
|
||||
...Alert,
|
||||
...Avatar,
|
||||
...AvatarGroup,
|
||||
...Backtop,
|
||||
...Badge,
|
||||
...Button,
|
||||
...Calendar,
|
||||
...CarKeyboard,
|
||||
...Cell,
|
||||
...CellGroup,
|
||||
...Checkbox,
|
||||
...CheckboxGroup,
|
||||
...CircleProgress,
|
||||
...Code,
|
||||
...CodeInput,
|
||||
...Col,
|
||||
...Collapse,
|
||||
...CollapseItem,
|
||||
...ColumnNotice,
|
||||
...CountDown,
|
||||
...CountTo,
|
||||
...DatetimePicker,
|
||||
...Divider,
|
||||
...Empty,
|
||||
...Form,
|
||||
...GormItem,
|
||||
...Gap,
|
||||
...Grid,
|
||||
...GridItem,
|
||||
...Icon,
|
||||
...Image,
|
||||
...IndexAnchor,
|
||||
...IndexList,
|
||||
...Input,
|
||||
...Keyboard,
|
||||
...Line,
|
||||
...LineProgress,
|
||||
...Link,
|
||||
...List,
|
||||
...ListItem,
|
||||
...LoadingIcon,
|
||||
...LoadingPage,
|
||||
...Loadmore,
|
||||
...Modal,
|
||||
...Navbar,
|
||||
...NoNetwork,
|
||||
...NoticeBar,
|
||||
...Notify,
|
||||
...NumberBox,
|
||||
...NumberKeyboard,
|
||||
...Overlay,
|
||||
...Parse,
|
||||
...Picker,
|
||||
...Popup,
|
||||
...Radio,
|
||||
...RadioGroup,
|
||||
...Rate,
|
||||
...ReadMore,
|
||||
...Row,
|
||||
...RowNotice,
|
||||
...ScrollList,
|
||||
...Search,
|
||||
...Section,
|
||||
...Skeleton,
|
||||
...Slider,
|
||||
...StatusBar,
|
||||
...Steps,
|
||||
...StepsItem,
|
||||
...Sticky,
|
||||
...Subsection,
|
||||
...SwipeAction,
|
||||
...SwipeActionItem,
|
||||
...Swiper,
|
||||
...SwipterIndicator,
|
||||
...Switch,
|
||||
...Tabbar,
|
||||
...TabbarItem,
|
||||
...Tabs,
|
||||
...Tag,
|
||||
...Text,
|
||||
...Textarea,
|
||||
...Toast,
|
||||
...Toolbar,
|
||||
...Tooltip,
|
||||
...Transition,
|
||||
...Upload
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user