提交 e8fce934 作者: 方治民

feat: 更新 firstui v1.9.1

上级 59ded22f
import GCanvas from './env/canvas';
import GImage from './env/image';
import GWebGLRenderingContext from './context-webgl/RenderingContext';
import GWebGLRenderingContext from './context-webgl/RenderingContext';// 2021-5-6变更
import GContext2D from './context-2d/RenderingContext';
import GBridgeWeex from './bridge/bridge-weex';
......@@ -12,12 +12,12 @@ export let WeexBridge = GBridgeWeex;
export function enable(el, {
bridge,
debug,
debug,// 2021-5-6变更
disableAutoSwap,
disableComboCommands
} = {}) {
const GBridge = GImage.GBridge = GCanvas.GBridge = GWebGLRenderingContext.GBridge = GContext2D.GBridge = bridge;
const GBridge = GImage.GBridge = GCanvas.GBridge = GWebGLRenderingContext.GBridge = GContext2D.GBridge = bridge;// 功能需要优化
GBridge.callEnable(el.ref, [
0, // renderMode: 0--RENDERMODE_WHEN_DIRTY, 1--RENDERMODE_CONTINUOUSLY
......@@ -29,7 +29,7 @@ export function enable(el, {
false // sameLevel: newCanvasMode = true && true => GCanvasView and Webview is same level
]);
if (debug === true) {
if (debug === true) {// echo建议
GBridge.callEnableDebug();
}
if (disableComboCommands) {
......@@ -41,7 +41,7 @@ export function enable(el, {
});
let pixelRatio = uni.getSystemInfoSync().pixelRatio;
canvas.width = el.style.width * pixelRatio;
canvas.height = el.style.height * pixelRatio;
canvas.height = el.style.height * pixelRatio;// 新特性待增加
return canvas;
};
......@@ -159,11 +159,11 @@
styl += `width:${this.width}rpx;`
}
if (this.position === 'fixed') {
let tb = this.top ? `top:${this.top}rpx;` : '';
tb += this.bottom ? `bottom:${this.bottom}rpx;` : '';
let tb = Number(this.top) ? `top:${this.top}rpx;` : '';
tb += Number(this.bottom) ? `bottom:${this.bottom}rpx;` : '';
styl += tb ? tb : `top:${this.top}rpx;`
let lr = this.left ? `left:${this.left}rpx;` : '';
lr += this.right ? `right:${this.right}rpx;` : '';
let lr = Number(this.left) ? `left:${this.left}rpx;` : '';
lr += Number(this.right) ? `right:${this.right}rpx;` : '';
styl += lr ? lr : `left:${this.left}rpx;`;
} else {
// #ifdef APP-NVUE
......@@ -184,6 +184,13 @@
break;
}
// #endif
let tb = Number(this.top) ? `margin-top:${this.top}rpx;` : '';
tb += Number(this.bottom) ? `margin-top:-${this.bottom}rpx;` : '';
styl += tb ? tb : `margin-top:${this.top}rpx;`
let lr = Number(this.left) ? `margin-left:${this.left}rpx;` : '';
lr += Number(this.right) ? `margin-left:-${this.right}rpx;` : '';
styl += lr ? lr : `margin-left:${this.left}rpx;`;
}
return styl
},
......@@ -320,6 +327,9 @@
/* #ifdef APP-NVUE */
transition: opacity 0.3s ease-in-out;
/* #endif */
/* margin-top: -120rpx; */
/* margin-left: 20rpx; */
}
......
......@@ -203,9 +203,8 @@
let iphonex = false;
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax',
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini',
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', 'iphone14plus',
'iphone14pro', 'iphone14promax', 'iphone15', 'iphone15mini', 'iphone15plus',
'iphone15pro', 'iphone15promax'
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini',
'iphone14pro', 'iphone14promax'
]
const model = res.model.replace(/\s/g, "").toLowerCase()
const newModel = model.split('<')[0]
......
......@@ -5,22 +5,24 @@
:class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']">
<!-- #endif -->
<!-- #ifdef APP-VUE || MP-WEIXIN || H5 -->
<view class="fui-drag__wrap" :class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']" ref="fui_drag"
:id="elId" :style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :list="list"
<!-- #ifdef VUE2 -->
<view class="fui-drag__wrap" :catch:touchmove="wxDrag?handler.stopTouchMove:''"
:class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']" ref="fui_drag" :id="elId"
:style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :list="list"
:change:list="handler.listChange" :param="param" :change:param="handler.paramChange">
<!-- #ifndef MP-WEIXIN -->
<view class="fui-drag-item__wrap" :style="{width:cellWidth+'px',height:cellHeight+'px'}"
v-for="(item, index) in list" :key="item.id" :data-index="index" @longpress="handler.longPress"
:data-param="param" :data-isdrag="isDrag && dragging?1:0" @touchstart="handler.touchStart"
@touchmove="handler.touchMove" @touchend="handler.touchEnd" @mousedown="handler.mousedown"
@tap="itemClick(index)">
<!-- #endif -->
<!-- #ifdef VUE3 -->
<!-- vue3下编译到小程序data数据与wxs混用中无法获取 $data数据无法直接应用到页面,uni-app官方编译bug-->
<view class="fui-drag__wrap" :catch:touchmove="wxDrag?true:''"
:class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']" ref="fui_drag" :id="elId"
:style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :list="list"
:change:list="handler.listChange" :param="param" :change:param="handler.paramChange">
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="fui-drag-item__wrap" :style="{width:cellWidth+'px',height:cellHeight+'px'}"
v-for="(item, index) in list" :key="item.id" :data-index="index" @longpress="handler.longPress"
:data-param="param" :data-isdrag="isDrag && dragging?1:0" @touchstart="handler.touchStart"
:catch:touchmove="wxDrag?handler.touchMove:''" @touchend="handler.touchEnd" @tap="itemClick(index)">
<!-- #endif -->
@touchmove="handler.touchMove" @touchend="handler.touchEnd" @mousedown="handler.mousedown"
@tap="itemClick(index)">
<template v-if="custom">
<slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot>
</template>
......
......@@ -273,6 +273,10 @@ function mousedown(e, ins) {
}
function stopTouchMove(e) {
return true
}
module.exports = {
longPress: longPress,
touchStart: touchStart,
......@@ -280,5 +284,6 @@ module.exports = {
touchEnd: touchEnd,
paramChange: paramChange,
listChange: listChange,
mousedown: mousedown
mousedown: mousedown,
stopTouchMove:stopTouchMove
}
......@@ -3,7 +3,7 @@
:style="{paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,background:background,marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx',borderRadius:radius}"
@tap="handleClick">
<!-- #ifdef APP-NVUE -->
<view class="fui-form__asterisk" v-if="asterisk">
<view class="fui-form__asterisk" :style="{left:getAkPosi}" v-if="asterisk">
<text :style="{color:asteriskColor || akColor || '#FF2B2B'}">*</text>
</view>
<!-- #endif -->
......@@ -145,7 +145,7 @@
return `${this.labelWidth || this.lWidth || labelWidth}rpx`
},
getLabelRight() {
const labelRight = (uni.$fui && uni.$fui.fuiFormItem && uni.$fui.fuiFormItem.labelRight) || 16
const labelRight = (uni.$fui && uni.$fui.fuiFormItem && uni.$fui.fuiFormItem.labelRight) || 30
return `${this.labelRight || labelRight}rpx`
},
getLabelAlign() {
......
......@@ -11,6 +11,7 @@
<script>
export default {
name: "fui-grid-item",
emits: ['click'],
inject: ['grid'],
// #ifdef MP-WEIXIN
options: {
......@@ -79,11 +80,13 @@
}
},
handleClick() {
this.grid.handleClick({
const e = {
detail: {
index: this.index
}
})
}
this.grid && this.grid.handleClick(e)
this.$emit('click', e)
}
}
}
......
......@@ -307,6 +307,13 @@
font-weight: 500;
}
/* #ifdef H5 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
/* #endif */
.fui-number__disabled {
opacity: 0.6;
}
......
......@@ -64,7 +64,7 @@ export default [{
cn: '晋',
en: 'P'
}]
}, {
}, {// echo建议
id: 'f_p3',
keys: [{
cn: '蒙',
......@@ -82,7 +82,7 @@ export default [{
cn: '贵',
en: 'G'
}, {
cn: '粤',
cn: '粤',// 功能需要优化
en: 'H'
}, {
cn: '青',
......@@ -97,10 +97,10 @@ export default [{
cn: '宁',
en: ''
}]
}, {
}, {// 新特性待增加
id: 'f_p4',
keys: [{
cn: 'ABC',
cn: 'ABC',// echo建议
en: '返回'
}, {
cn: '琼',
......@@ -119,7 +119,7 @@ export default [{
en: 'B'
}, {
cn: '港',
en: 'N'
en: 'N'// 新特性待增加
}, {
cn: '澳',
en: 'M'
......
......@@ -15,10 +15,10 @@
<view class="fui-modal__button"
:class="{'fui-modal__button-col':direction==='column' && index!==vals.length-1,'fui-modal__button-bg':!entity.plain && !entity.background,'fui-modal__button-border':entity.plain,'fui-modal__button-bc':entity.plain && !entity.background}"
:style="{borderRadius:radius+'rpx',background:entity.plain?'transparent':(entity.background || '#465CFF'),borderColor:entity.plain?(entity.background || '#465CFF'):'transparent'}"
v-for="(entity,index) in vals" :key="index" @tap.stop="handleClick($event,index)">
v-for="(entity,index) in vals" :key="index">
<text class="fui-modal__button-inner"
:class="{'fui-modal__button-color': !entity.color && entity.plain}"
:style="{color:entity.color || (entity.plain?'#465CFF':'#fff')}">{{entity.text}}</text>
:style="{color:entity.color || (entity.plain?'#465CFF':'#fff'),borderRadius:radius+'rpx'}" @tap.stop="handleClick($event,index)">{{entity.text}}</text>
</view>
</view>
</view>
......@@ -338,6 +338,9 @@
border-width: 1rpx;
transform: translateZ(0);
/* #endif */
/* #ifdef H5 */
border-width: 1px;
/* #endif */
border-style: solid;
}
......
......@@ -34,9 +34,10 @@
<view class="fui-select__flex">
<view class="fui-select__icon-box"
:class="{'fui-select__icon-ml':!isReverse && type==='select','fui-select__icon-mr':isReverse}"
:style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}" v-if="model.src">
:style="{width:iconWidth+'rpx',height:iconWidth+'rpx',backgroundColor:iconBgColor}"
v-if="model.src">
<image :src="model.src" :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}"
mode="widthFix"></image>
:mode="iconMode"></image>
</view>
<text class="fui-select__item-text"
:class="{'fui-select__text-pl':!isReverse && (type==='select' || model.src),'fui-select__text-pr':isReverse && (type==='select' || model.src)}"
......@@ -181,6 +182,14 @@
type: [Number, String],
default: 48
},
iconBgColor: {
type: String,
default: 'rgba(0,0,0,0)'
},
iconMode: {
type: String,
default: 'widthFix'
},
size: {
type: [Number, String],
default: 30
......@@ -484,7 +493,9 @@
/* #ifndef APP-NVUE */
width: 100%;
/* #endif */
flex: 1;
/* #ifdef APP-NVUE */
width: 750rpx;
/* #endif */
}
.fui-select__list {
......@@ -600,10 +611,12 @@
.fui-select__icon-box {
overflow: hidden;
background-color: #F1F4FA;
/* #ifndef APP-NVUE */
flex-shrink: 0;
display: flex;
/* #endif */
align-items: center;
justify-content: center;
}
.fui-select__icon-ml {
......@@ -619,13 +632,14 @@
width: 100%;
display: flex;
/* #endif */
flex: 1;
/* #ifdef APP-NVUE */
width: 750rpx;
/* #endif */
height: 98rpx;
flex-direction: row;
align-items: center;
justify-content: center;
position: relative;
}
.fui-select__header-line {
......
......@@ -9,7 +9,7 @@ export default {
},
watch: {
show(newVal) {
// if (this.autoClose) return
if (this.autoClose) return
if (this.stop) return
this.stop = true
if (newVal) {
......@@ -55,6 +55,7 @@ export default {
})
},
touchstart(e) {
if (this.disabled) return
// 每次只触发一次,避免多次监听造成闪烁
if (this.stop) return
this.stop = true
......@@ -62,7 +63,7 @@ export default {
this.group.closeAuto(this)
}
const rightWidth = this.button.right.width
const rightWidth = this.button.right.width || 0
let expression = this.range(this.x, -rightWidth, 0)
let rightExpression = this.range(this.x + rightWidth, 0, rightWidth)
......@@ -93,7 +94,7 @@ export default {
},
bindTiming(x) {
const left = this.x
const rightWidth = this.button.right.width
const rightWidth = this.button.right.width || 0
const threshold = Number(this.threshold)
if (!this.isopen) {
if (left < -threshold) {
......@@ -102,7 +103,7 @@ export default {
this.open(false)
}
} else {
if ((x < threshold && x > 0) || (x + leftWidth < -threshold)) {
if ((x < threshold && x > 0) || (x < -threshold)) {
this.open(true)
} else {
this.open(false)
......@@ -120,7 +121,7 @@ export default {
},
animation(type) {
const time = 300
const rightWidth = this.button.right.width
const rightWidth = this.button.right.width || 0
if (this.eventpan && this.eventpan.token) {
BindingX.unbind({
token: this.eventpan.token,
......
......@@ -24,7 +24,11 @@ function getDom(ins, ownerInstance) {
return;
}
if (isH5 || isPC()) {
state.rightWidth = rightDom['$el'].offsetWidth || 0
if (rightDom['$el']) {
state.rightWidth = rightDom['$el'].offsetWidth || 0
} else {
state.rightWidth = 0
}
} else {
var rightStyles = rightDom.getBoundingClientRect()
state.rightWidth = rightStyles.width || 0
......
......@@ -25,9 +25,13 @@ export default {
}
},
mounted() {
this.isShow = this.show
this.isDisabled = this.disabled
this.thresholdVal = Number(this.threshold)
this.$nextTick(() => {
setTimeout(() => {
this.isShow = this.show
this.isDisabled = this.disabled
this.thresholdVal = Number(this.threshold)
}, 10)
})
},
methods: {
closeSwipe(e) {
......@@ -37,7 +41,7 @@ export default {
change(e) {
this.$emit('change', {
isOpen: e.open === 'right',
param:this.param
param: this.param
})
if (this.isShow !== e.open) {
this.isShow = e.open
......
......@@ -9,7 +9,7 @@
<view class="fui-switch__input-def" :style="{background:val?color:'#dfdfdf',borderColor:val?color:borderColor}"
:class="{'fui-switch__input--checked':val,'fui-checkbox__disabled':disabled,'fui-switch__color':val && !color}"
v-if="type==='switch'">
<switch class="fui-switch__hidden" @change="change" :name="name" :checked="val" :disabled="disabled"
<switch class="fui-switch__hidden" :class="{'fui-pointer__events':isLabel}" @change="change" :name="name" :checked="val" :disabled="disabled"
:color="color">
</switch>
</view>
......@@ -18,7 +18,8 @@
:style="{background:val?color:'#fff',border:val?`1px solid ${color}`:`1px solid ${borderColor}`}" v-else>
<view class="fui-check__mark" :style="{borderBottomColor:checkMarkColor,borderRightColor:checkMarkColor}"
v-if="val"></view>
<switch class="fui-switch__hidden" style="opacity: 0;position: absolute;" @change="change" :name="name" :type="isNvue?'switch':'checkbox'"
<switch class="fui-switch__hidden" :class="{'fui-pointer__events':isLabel}"
style="opacity: 0;position: absolute;" @change="change" :name="name" :type="isNvue?'switch':'checkbox'"
:checked="val" :disabled="disabled"></switch>
</view>
</view>
......@@ -87,7 +88,8 @@
// #endif
return {
val: false,
isNvue: isNvue
isNvue: isNvue,
isLabel: false
};
},
watch: {
......@@ -99,6 +101,7 @@
this.val = this.checked;
this.label = this.getParent();
if (this.label) {
this.isLabel = true
this.label.childrens.push(this)
}
},
......@@ -273,6 +276,13 @@
/* #endif */
}
/* #ifdef H5 */
.fui-pointer__events {
pointer-events: none;
}
/* #endif */
.fui-checkbox__disabled {
opacity: 0.6;
}
......
......@@ -482,6 +482,7 @@
.fui-tabs__line-center {
justify-content: center;
left: 0;
}
.fui-tabs__ac-line {
......@@ -492,10 +493,6 @@
width: 45rpx !important;
}
.fui-tabs__line-center {
left: 0;
}
/* #ifndef APP-NVUE */
.fui-tabs__selected-color {
color: var(--fui-color-primary, #465CFF) !important;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论