提交 e2fc7700 编写于 作者: fxy060608's avatar fxy060608

chore: merge

......@@ -2135,6 +2135,15 @@ function removeMediaQueryObserver({ reqId, component }, _pageId) {
UniServiceJSBridge.unsubscribe(getEventName(reqId));
}
function getFileName(path) {
const array = path.split('/');
return array[array.length - 1];
}
function getExtName(path) {
const array = path.split('.');
return array.length > 1 ? '.' + array[array.length - 1] : '';
}
const DEVICE_FREQUENCY = 200;
const NETWORK_TYPES = [
'unknown',
......@@ -12691,15 +12700,6 @@ const openDocument = defineAsyncApi(API_OPEN_DOCUMENT, ({ filePath, fileType },
plus.runtime.openDocument(getRealPath(filePath), undefined, resolve, errorCallback);
}, OpenDocumentProtocol, OpenDocumentOptions);
function getFileName(path) {
const array = path.split('/');
return array[array.length - 1];
}
function getExtName(path) {
const array = path.split('.');
return array.length > 1 ? '.' + array[array.length - 1] : '';
}
let index$1 = 0;
const SAVED_DIR = 'uniapp_save';
const SAVE_PATH = `_doc/${SAVED_DIR}`;
......
......@@ -7,3 +7,77 @@ export function getExtName(path: string) {
const array = path.split('.')
return array.length > 1 ? '.' + array[array.length - 1] : ''
}
function getBase64(path: string): Promise<string> {
return new Promise(function (resolve, reject) {
// H5+ 沙箱外路径在iOS无法使用 plus.io 读取
function onError() {
const bitmap = new plus.nativeObj.Bitmap!(
`bitmap_${Date.now()}_${Math.random()}}`
)
bitmap.load(
path,
function () {
resolve(bitmap.toBase64Data())
bitmap.clear()
},
function (err) {
bitmap.clear()
reject(err)
}
)
}
plus.io.resolveLocalFileSystemURL(
path,
function (entry) {
;(entry as unknown as PlusIoFileEntry).file(function (file) {
var fileReader = new plus.io.FileReader!()
fileReader.onload = function (data) {
resolve((data.target as unknown as PlusIoFileReader).result!)
}
fileReader.onerror = onError
fileReader.readAsDataURL(file)
}, onError)
},
onError
)
})
}
function download(url: string): Promise<string> {
return new Promise(function (resolve, reject) {
if (url.indexOf('http://') !== 0 && url.indexOf('https://') !== 0) {
resolve(url)
return
}
plus.downloader
.createDownload(
url,
{
filename: '_doc/uniapp_temp/download/',
},
function (d, status) {
if (status === 200) {
resolve(d.filename!)
} else {
reject(new Error('network fail'))
}
}
)
.start()
})
}
export function getSameOriginUrl(url: string) {
return download(url).then(function (url) {
// WKWebView
interface WindowExt extends Window {
webkit?: { messageHandlers: any }
}
const g = window as WindowExt
if (g.webkit && g.webkit.messageHandlers) {
return getBase64(url)
}
return plus.io.convertLocalFileSystemURL(url)
})
}
......@@ -16,9 +16,7 @@ export {
} from '../service/api/ui/mediaQueryObserver'
export { saveImage } from './saveImage'
export function getSameOriginUrl(url: string): Promise<string> {
return Promise.resolve(url)
}
export { getSameOriginUrl } from '../helpers/file'
export { TEMP_PATH } from '../service/api/constants'
export {
......
let index = 0
type Format = 'jpg' | 'png' | undefined
export function saveImage(
base64: string,
dataURL: string,
dirname: string,
callback: (error: Error | null, tempFilePath?: string) => void
callback: (error: any, tempFilePath?: string) => void
) {
const id = `${Date.now()}${index++}`
const bitmap = new plus.nativeObj.Bitmap!(`bitmap${id}`)
bitmap.loadBase64Data(
base64,
function () {
const base64Match = base64.match(/data:image\/(\S+?);/) || [null, 'png']
let format
if (base64Match[1]) {
format = base64Match[1].replace('jpeg', 'jpg') as Format
}
const tempFilePath = `${dirname}/${id}.${format}`
bitmap.save(
tempFilePath,
const array = dataURL.split(',')
const scheme = array[0]
const base64 = array[1]
const format = (scheme.match(/data:image\/(\S+?);/) || [
'',
'png',
])[1].replace('jpeg', 'jpg')
const fileName = `${id}.${format}`
const tempFilePath = `${dirname}/${fileName}`
const i = dirname.indexOf('/')
const basePath = dirname.substring(0, i)
const dirPath = dirname.substring(i + 1)
plus.io.resolveLocalFileSystemURL(
basePath,
function (entry: PlusIoDirectoryEntry) {
entry.getDirectory(
dirPath,
{
overwrite: true,
quality: 100,
format,
create: true,
exclusive: false,
},
function () {
clear()
callback(null, tempFilePath)
function (entry) {
entry.getFile(
fileName,
{
create: true,
exclusive: false,
},
function (entry) {
entry.createWriter(function (writer) {
writer.onwrite = function () {
callback(null, tempFilePath)
}
writer.onerror = callback
writer.seek(0)
writer.writeAsBinary(base64)
}, callback)
},
callback
)
},
function (error) {
clear()
callback(error)
}
callback
)
},
function (error) {
clear()
callback(error)
}
callback
)
function clear() {
bitmap.clear()
}
}
import { createElementVNode, defineComponent, createVNode, mergeProps, getCurrentInstance, provide, watch, onUnmounted, shallowRef, reactive, watchEffect, ref, inject, onBeforeUnmount, computed, Text, isVNode, Fragment, onMounted } from "vue";
import { hasOwn, extend, isPlainObject } from "@vue/shared";
import { cacheStringFunction } from "@dcloudio/uni-shared";
import { extend, hasOwn, isPlainObject } from "@vue/shared";
import { cacheStringFunction, PRIMARY_COLOR } from "@dcloudio/uni-shared";
const OPEN_TYPES = [
"navigate",
"redirect",
......@@ -1751,11 +1751,189 @@ function useMovableViewState(props, trigger, rootRef, setTouchMovableViewContext
};
return touchStart;
}
const FONT_SIZE = 16;
const PROGRESS_VALUES = {
activeColor: PRIMARY_COLOR,
backgroundColor: "#EBEBEB",
activeMode: "backwards"
};
const progressProps = {
percent: {
type: [Number, String],
default: 0,
validator(value) {
return !isNaN(parseFloat(value));
}
},
fontSize: {
type: [String, Number],
default: FONT_SIZE
},
showInfo: {
type: [Boolean, String],
default: false
},
strokeWidth: {
type: [Number, String],
default: 6,
validator(value) {
return !isNaN(parseFloat(value));
}
},
color: {
type: String,
default: PROGRESS_VALUES.activeColor
},
activeColor: {
type: String,
default: PROGRESS_VALUES.activeColor
},
backgroundColor: {
type: String,
default: PROGRESS_VALUES.backgroundColor
},
active: {
type: [Boolean, String],
default: false
},
activeMode: {
type: String,
default: PROGRESS_VALUES.activeMode
},
duration: {
type: [Number, String],
default: 30,
validator(value) {
return !isNaN(parseFloat(value));
}
}
};
const progressStyles = [{
"uni-progress": {
flex: 1,
flexDirection: "row",
alignItems: "center"
},
"uni-progress-bar": {
flex: 1
},
"uni-progress-inner-bar": {
position: "absolute"
},
"uni-progress-info": {
marginLeft: "15px"
}
}];
var Progress = defineComponent({
name: "Progress",
props: progressProps,
styles: progressStyles,
emits: ["activeend"],
setup(props, {
emit
}) {
const progressRef = ref(null);
const progressBarRef = ref(null);
const trigger = useCustomEvent(progressRef, emit);
const state = useProgressState(props);
watch(() => state.realPercent, (newValue, oldValue) => {
state.lastPercent = oldValue || 0;
_activeAnimation(state, props, trigger);
});
onMounted(() => {
setTimeout(() => {
getComponentSize(progressBarRef.value).then(({
width
}) => {
state.progressWidth = width || 0;
_activeAnimation(state, props, trigger);
});
}, 50);
});
return () => {
const {
showInfo,
fontSize
} = props;
const {
outerBarStyle,
innerBarStyle,
currentPercent
} = state;
return createVNode("div", {
"ref": progressRef,
"class": "uni-progress"
}, [createVNode("div", {
"ref": progressBarRef,
"style": outerBarStyle,
"class": "uni-progress-bar"
}, [createVNode("div", {
"style": innerBarStyle,
"class": "uni-progress-inner-bar"
}, null)]), showInfo ? createNVueTextVNode(currentPercent + "%", {
class: "uni-progress-info",
style: {
fontSize
}
}) : null]);
};
}
});
function useProgressState(props) {
const currentPercent = ref(0);
const progressWidth = ref(0);
const outerBarStyle = computed(() => ({
backgroundColor: props.backgroundColor,
height: props.strokeWidth
}));
const innerBarStyle = computed(() => {
const backgroundColor = props.color !== PROGRESS_VALUES.activeColor && props.activeColor === PROGRESS_VALUES.activeColor ? props.color : props.activeColor;
return {
width: currentPercent.value * progressWidth.value / 100,
height: props.strokeWidth,
backgroundColor
};
});
const realPercent = computed(() => {
let realValue = parseFloat(props.percent);
realValue < 0 && (realValue = 0);
realValue > 100 && (realValue = 100);
return realValue;
});
const state = reactive({
outerBarStyle,
innerBarStyle,
realPercent,
currentPercent,
strokeTimer: 0,
lastPercent: 0,
progressWidth
});
return state;
}
function _activeAnimation(state, props, trigger) {
state.strokeTimer && clearInterval(state.strokeTimer);
if (props.active) {
state.currentPercent = props.activeMode === PROGRESS_VALUES.activeMode ? 0 : state.lastPercent;
state.strokeTimer = setInterval(() => {
if (state.currentPercent + 1 > state.realPercent) {
state.currentPercent = state.realPercent;
state.strokeTimer && clearInterval(state.strokeTimer);
trigger("activeend", {});
} else {
state.currentPercent += 1;
}
}, parseFloat(props.duration));
} else {
state.currentPercent = state.realPercent;
}
}
var components = {
Navigator,
Label,
Button,
MovableArea,
MovableView
MovableView,
Progress
};
export { components as default };
import { PRIMARY_COLOR } from '@dcloudio/uni-shared'
const FONT_SIZE = 16
export const PROGRESS_VALUES = {
activeColor: PRIMARY_COLOR,
backgroundColor: '#EBEBEB',
activeMode: 'backwards',
}
export const progressProps = {
percent: {
type: [Number, String],
default: 0,
validator(value: number | string) {
return !isNaN(parseFloat(value as string))
},
},
fontSize: {
type: [String, Number],
default: FONT_SIZE,
},
showInfo: {
type: [Boolean, String],
default: false,
},
strokeWidth: {
type: [Number, String],
default: 6,
validator(value: number | string) {
return !isNaN(parseFloat(value as string))
},
},
color: {
type: String,
default: PROGRESS_VALUES.activeColor,
},
activeColor: {
type: String,
default: PROGRESS_VALUES.activeColor,
},
backgroundColor: {
type: String,
default: PROGRESS_VALUES.backgroundColor,
},
active: {
type: [Boolean, String],
default: false,
},
activeMode: {
type: String,
default: PROGRESS_VALUES.activeMode,
},
duration: {
type: [Number, String],
default: 30,
validator(value: number | string) {
return !isNaN(parseFloat(value as string))
},
},
}
......@@ -3,10 +3,12 @@ import Label from './label'
import Button from './button'
import MovableArea from './movable-area'
import MovableView from './movable-view'
import Progress from './progress'
export default {
Navigator,
Label,
Button,
MovableArea,
MovableView,
Progress,
}
import {
defineComponent,
Ref,
ref,
reactive,
watch,
computed,
onMounted,
ExtractPropTypes,
} from 'vue'
import {
useCustomEvent,
EmitEvent,
CustomEventTrigger,
} from '../../helpers/useNVueEvent'
import { getComponentSize } from '../helpers'
import { createNVueTextVNode } from '../utils'
import { PROGRESS_VALUES, progressProps } from '../../components/progress'
const progressStyles: Record<string, Record<string, string | number>>[] = [
{
'uni-progress': {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
},
'uni-progress-bar': {
flex: 1,
},
'uni-progress-inner-bar': {
position: 'absolute',
},
'uni-progress-info': {
marginLeft: '15px',
},
},
]
type ProgressProps = ExtractPropTypes<typeof progressProps>
type ProgerssState = ReturnType<typeof useProgressState>
export default defineComponent({
name: 'Progress',
props: progressProps,
styles: progressStyles,
emits: ['activeend'],
setup(props, { emit }) {
const progressRef: Ref<HTMLElement | null> = ref(null)
const progressBarRef: Ref<HTMLElement | null> = ref(null)
const trigger = useCustomEvent<EmitEvent<typeof emit>>(progressRef, emit)
const state = useProgressState(props)
watch(
() => state.realPercent,
(newValue, oldValue) => {
state.lastPercent = oldValue || 0
_activeAnimation(state, props, trigger)
}
)
onMounted(() => {
setTimeout(() => {
getComponentSize(progressBarRef.value!).then(({ width }) => {
state.progressWidth = width || 0
_activeAnimation(state, props, trigger)
})
}, 50)
})
return () => {
const { showInfo, fontSize } = props
const { outerBarStyle, innerBarStyle, currentPercent } = state
return (
<div ref={progressRef} class="uni-progress">
<div
ref={progressBarRef}
style={outerBarStyle}
class="uni-progress-bar"
>
<div style={innerBarStyle} class="uni-progress-inner-bar"></div>
</div>
{showInfo
? createNVueTextVNode(currentPercent + '%', {
class: 'uni-progress-info',
style: {
fontSize,
},
})
: null}
</div>
)
}
},
})
function useProgressState(props: ProgressProps) {
const currentPercent = ref<number>(0)
const progressWidth = ref<number>(0)
const outerBarStyle = computed(() => ({
backgroundColor: props.backgroundColor,
height: props.strokeWidth,
}))
const innerBarStyle = computed(() => {
// 兼容下不推荐的属性,activeColor 优先级高于 color。
// nvue 不支持百分比,宽度必须为数值。
const backgroundColor =
props.color !== PROGRESS_VALUES.activeColor &&
props.activeColor === PROGRESS_VALUES.activeColor
? props.color
: props.activeColor
return {
width: (currentPercent.value * progressWidth.value) / 100,
height: props.strokeWidth,
backgroundColor: backgroundColor,
}
})
const realPercent = computed(() => {
// 确保最终计算时使用的是 Number 类型的值,并且在有效范围内。
let realValue = parseFloat(props.percent as string)
realValue < 0 && (realValue = 0)
realValue > 100 && (realValue = 100)
return realValue
})
const state = reactive({
outerBarStyle,
innerBarStyle,
realPercent,
currentPercent,
strokeTimer: 0,
lastPercent: 0,
progressWidth,
})
return state
}
function _activeAnimation(
state: ProgerssState,
props: ProgressProps,
trigger: CustomEventTrigger
) {
state.strokeTimer && clearInterval(state.strokeTimer)
if (props.active) {
state.currentPercent =
props.activeMode === PROGRESS_VALUES.activeMode ? 0 : state.lastPercent
state.strokeTimer = setInterval(() => {
if (state.currentPercent + 1 > state.realPercent) {
state.currentPercent = state.realPercent
state.strokeTimer && clearInterval(state.strokeTimer)
trigger('activeend', {})
} else {
state.currentPercent += 1
}
}, parseFloat(props.duration as string)) as unknown as number
} else {
state.currentPercent = state.realPercent
}
}
import { PRIMARY_COLOR } from '@dcloudio/uni-shared'
import { ref, reactive, watch, computed, ExtractPropTypes } from 'vue'
import { defineBuiltInComponent } from '../../helpers/component'
const VALUES = {
activeColor: PRIMARY_COLOR,
backgroundColor: '#EBEBEB',
activeMode: 'backwards',
}
const props = {
percent: {
type: [Number, String],
default: 0,
validator(value: number | string) {
return !isNaN(parseFloat(value as string))
},
},
showInfo: {
type: [Boolean, String],
default: false,
},
strokeWidth: {
type: [Number, String],
default: 6,
validator(value: number | string) {
return !isNaN(parseFloat(value as string))
},
},
color: {
type: String,
default: VALUES.activeColor,
},
activeColor: {
type: String,
default: VALUES.activeColor,
},
backgroundColor: {
type: String,
default: VALUES.backgroundColor,
},
active: {
type: [Boolean, String],
default: false,
},
activeMode: {
type: String,
default: VALUES.activeMode,
},
duration: {
type: [Number, String],
default: 30,
validator(value: number | string) {
return !isNaN(parseFloat(value as string))
},
},
}
import { PROGRESS_VALUES, progressProps } from '../../components/progress'
type ProgressProps = ExtractPropTypes<typeof props>
type ProgressProps = ExtractPropTypes<typeof progressProps>
type ProgerssState = ReturnType<typeof useProgressState>
export default /*#__PURE__*/ defineBuiltInComponent({
name: 'Progress',
props,
props: progressProps,
setup(props) {
const state = useProgressState(props)
......@@ -107,8 +54,8 @@ function useProgressState(props: ProgressProps) {
const innerBarStyle = computed(() => {
// 兼容下不推荐的属性,activeColor 优先级高于 color。
const backgroundColor =
props.color !== VALUES.activeColor &&
props.activeColor === VALUES.activeColor
props.color !== PROGRESS_VALUES.activeColor &&
props.activeColor === PROGRESS_VALUES.activeColor
? props.color
: props.activeColor
return `width: ${currentPercent.value}%;background-color: ${backgroundColor}`
......@@ -136,7 +83,7 @@ function useProgressState(props: ProgressProps) {
function _activeAnimation(state: ProgerssState, props: ProgressProps) {
if (props.active) {
state.currentPercent =
props.activeMode === VALUES.activeMode ? 0 : state.lastPercent
props.activeMode === PROGRESS_VALUES.activeMode ? 0 : state.lastPercent
state.strokeTimer = setInterval(() => {
if (state.currentPercent + 1 > state.realPercent) {
state.currentPercent = state.realPercent
......
......@@ -1626,7 +1626,7 @@ function getTempCanvas(width = 0, height = 0) {
tempCanvas.height = height;
return tempCanvas;
}
const props$q = {
const props$p = {
canvasId: {
type: String,
default: ""
......@@ -1646,7 +1646,7 @@ var index$B = /* @__PURE__ */ defineBuiltInComponent({
compatConfig: {
MODE: 3
},
props: props$q,
props: props$p,
computed: {
id() {
return this.canvasId;
......@@ -2104,7 +2104,7 @@ function useMethods(props2, canvasRef, actionsWaiting) {
});
}
const uniCheckGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg");
const props$p = {
const props$o = {
name: {
type: String,
default: ""
......@@ -2112,7 +2112,7 @@ const props$p = {
};
var index$A = /* @__PURE__ */ defineBuiltInComponent({
name: "CheckboxGroup",
props: props$p,
props: props$o,
emits: ["change"],
setup(props2, {
emit: emit2,
......@@ -2164,7 +2164,7 @@ function useProvideCheckGroup(props2, trigger) {
}
return getFieldsValue;
}
const props$o = {
const props$n = {
checked: {
type: [Boolean, String],
default: false
......@@ -2188,7 +2188,7 @@ const props$o = {
};
var index$z = /* @__PURE__ */ defineBuiltInComponent({
name: "Checkbox",
props: props$o,
props: props$n,
setup(props2, {
slots
}) {
......@@ -2255,7 +2255,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) {
let resetTimer;
function iosHideKeyboard() {
}
const props$n = {
const props$m = {
cursorSpacing: {
type: [Number, String],
default: 0
......@@ -2427,7 +2427,7 @@ function useQuill(props2, rootRef, trigger) {
useContextInfo();
useSubscribe();
}
const props$m = /* @__PURE__ */ shared.extend({}, props$n, {
const props$l = /* @__PURE__ */ shared.extend({}, props$m, {
id: {
type: String,
default: ""
......@@ -2455,7 +2455,7 @@ const props$m = /* @__PURE__ */ shared.extend({}, props$n, {
});
var index$y = /* @__PURE__ */ defineBuiltInComponent({
name: "Editor",
props: props$m,
props: props$l,
emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1],
setup(props2, {
emit: emit2
......@@ -2541,7 +2541,7 @@ var index$x = /* @__PURE__ */ defineBuiltInComponent({
};
}
});
const props$l = {
const props$k = {
src: {
type: String,
default: ""
......@@ -2580,7 +2580,7 @@ const IMAGE_MODES = {
};
var index$w = /* @__PURE__ */ defineBuiltInComponent({
name: "Image",
props: props$l,
props: props$k,
setup(props2, {
emit: emit2
}) {
......@@ -2829,7 +2829,7 @@ const UniViewJSBridgeSubscribe = function() {
function getValueString(value) {
return value === null ? "" : String(value);
}
const props$k = /* @__PURE__ */ shared.extend({}, {
const props$j = /* @__PURE__ */ shared.extend({}, {
name: {
type: String,
default: ""
......@@ -2898,7 +2898,7 @@ const props$k = /* @__PURE__ */ shared.extend({}, {
type: Boolean,
default: false
}
}, props$n);
}, props$m);
const emit = [
"input",
"focus",
......@@ -3093,7 +3093,7 @@ function useField(props2, rootRef, emit2, beforeInput) {
trigger
};
}
const props$j = /* @__PURE__ */ shared.extend({}, props$k, {
const props$i = /* @__PURE__ */ shared.extend({}, props$j, {
placeholderClass: {
type: String,
default: "input-placeholder"
......@@ -3105,7 +3105,7 @@ const props$j = /* @__PURE__ */ shared.extend({}, props$k, {
});
var Input = /* @__PURE__ */ defineBuiltInComponent({
name: "Input",
props: props$j,
props: props$i,
emits: ["confirm", ...emit],
setup(props2, {
emit: emit2
......@@ -4550,12 +4550,13 @@ var PickerViewColumn = /* @__PURE__ */ defineBuiltInComponent({
};
}
});
const VALUES = {
const FONT_SIZE = 16;
const PROGRESS_VALUES = {
activeColor: uniShared.PRIMARY_COLOR,
backgroundColor: "#EBEBEB",
activeMode: "backwards"
};
const props$i = {
const progressProps = {
percent: {
type: [Number, String],
default: 0,
......@@ -4563,6 +4564,10 @@ const props$i = {
return !isNaN(parseFloat(value));
}
},
fontSize: {
type: [String, Number],
default: FONT_SIZE
},
showInfo: {
type: [Boolean, String],
default: false
......@@ -4576,15 +4581,15 @@ const props$i = {
},
color: {
type: String,
default: VALUES.activeColor
default: PROGRESS_VALUES.activeColor
},
activeColor: {
type: String,
default: VALUES.activeColor
default: PROGRESS_VALUES.activeColor
},
backgroundColor: {
type: String,
default: VALUES.backgroundColor
default: PROGRESS_VALUES.backgroundColor
},
active: {
type: [Boolean, String],
......@@ -4592,7 +4597,7 @@ const props$i = {
},
activeMode: {
type: String,
default: VALUES.activeMode
default: PROGRESS_VALUES.activeMode
},
duration: {
type: [Number, String],
......@@ -4604,7 +4609,7 @@ const props$i = {
};
var index$s = /* @__PURE__ */ defineBuiltInComponent({
name: "Progress",
props: props$i,
props: progressProps,
setup(props2) {
const state = useProgressState(props2);
_activeAnimation(state, props2);
......@@ -4640,7 +4645,7 @@ function useProgressState(props2) {
const currentPercent = vue.ref(0);
const outerBarStyle = vue.computed(() => `background-color: ${props2.backgroundColor}; height: ${props2.strokeWidth}px;`);
const innerBarStyle = vue.computed(() => {
const backgroundColor = props2.color !== VALUES.activeColor && props2.activeColor === VALUES.activeColor ? props2.color : props2.activeColor;
const backgroundColor = props2.color !== PROGRESS_VALUES.activeColor && props2.activeColor === PROGRESS_VALUES.activeColor ? props2.color : props2.activeColor;
return `width: ${currentPercent.value}%;background-color: ${backgroundColor}`;
});
const realPercent = vue.computed(() => {
......@@ -4661,7 +4666,7 @@ function useProgressState(props2) {
}
function _activeAnimation(state, props2) {
if (props2.active) {
state.currentPercent = props2.activeMode === VALUES.activeMode ? 0 : state.lastPercent;
state.currentPercent = props2.activeMode === PROGRESS_VALUES.activeMode ? 0 : state.lastPercent;
state.strokeTimer = setInterval(() => {
if (state.currentPercent + 1 > state.realPercent) {
state.currentPercent = state.realPercent;
......@@ -6370,7 +6375,7 @@ var index$j = /* @__PURE__ */ defineBuiltInComponent({
};
}
});
const props$9 = /* @__PURE__ */ shared.extend({}, props$k, {
const props$9 = /* @__PURE__ */ shared.extend({}, props$j, {
placeholderClass: {
type: String,
default: "input-placeholder"
......
......@@ -6416,7 +6416,7 @@ function getTempCanvas(width = 0, height = 0) {
tempCanvas.height = height;
return tempCanvas;
}
const props$x = {
const props$w = {
canvasId: {
type: String,
default: ""
......@@ -6436,7 +6436,7 @@ var index$w = /* @__PURE__ */ defineBuiltInComponent({
compatConfig: {
MODE: 3
},
props: props$x,
props: props$w,
computed: {
id() {
return this.canvasId;
......@@ -6897,7 +6897,7 @@ function useMethods(props2, canvasRef, actionsWaiting) {
});
}
const uniCheckGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg");
const props$w = {
const props$v = {
name: {
type: String,
default: ""
......@@ -6905,7 +6905,7 @@ const props$w = {
};
var index$v = /* @__PURE__ */ defineBuiltInComponent({
name: "CheckboxGroup",
props: props$w,
props: props$v,
emits: ["change"],
setup(props2, {
emit: emit2,
......@@ -6957,7 +6957,7 @@ function useProvideCheckGroup(props2, trigger) {
}
return getFieldsValue;
}
const props$v = {
const props$u = {
checked: {
type: [Boolean, String],
default: false
......@@ -6981,7 +6981,7 @@ const props$v = {
};
var index$u = /* @__PURE__ */ defineBuiltInComponent({
name: "Checkbox",
props: props$v,
props: props$u,
setup(props2, {
slots
}) {
......@@ -7058,7 +7058,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) {
let resetTimer;
function iosHideKeyboard() {
}
const props$u = {
const props$t = {
cursorSpacing: {
type: [Number, String],
default: 0
......@@ -7835,7 +7835,7 @@ function useQuill(props2, rootRef, trigger) {
}
}, id2, true);
}
const props$t = /* @__PURE__ */ extend({}, props$u, {
const props$s = /* @__PURE__ */ extend({}, props$t, {
id: {
type: String,
default: ""
......@@ -7863,7 +7863,7 @@ const props$t = /* @__PURE__ */ extend({}, props$u, {
});
var index$t = /* @__PURE__ */ defineBuiltInComponent({
name: "Editor",
props: props$t,
props: props$s,
emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1],
setup(props2, {
emit: emit2
......@@ -7950,7 +7950,7 @@ var index$s = /* @__PURE__ */ defineBuiltInComponent({
};
}
});
const props$s = {
const props$r = {
src: {
type: String,
default: ""
......@@ -7989,7 +7989,7 @@ const IMAGE_MODES = {
};
var index$r = /* @__PURE__ */ defineBuiltInComponent({
name: "Image",
props: props$s,
props: props$r,
setup(props2, {
emit: emit2
}) {
......@@ -8303,7 +8303,7 @@ const UniViewJSBridgeSubscribe = function() {
function getValueString(value) {
return value === null ? "" : String(value);
}
const props$r = /* @__PURE__ */ extend({}, {
const props$q = /* @__PURE__ */ extend({}, {
name: {
type: String,
default: ""
......@@ -8372,7 +8372,7 @@ const props$r = /* @__PURE__ */ extend({}, {
type: Boolean,
default: false
}
}, props$u);
}, props$t);
const emit = [
"input",
"focus",
......@@ -8576,7 +8576,7 @@ function useField(props2, rootRef, emit2, beforeInput) {
trigger
};
}
const props$q = /* @__PURE__ */ extend({}, props$r, {
const props$p = /* @__PURE__ */ extend({}, props$q, {
placeholderClass: {
type: String,
default: "input-placeholder"
......@@ -8588,7 +8588,7 @@ const props$q = /* @__PURE__ */ extend({}, props$r, {
});
var Input = /* @__PURE__ */ defineBuiltInComponent({
name: "Input",
props: props$q,
props: props$p,
emits: ["confirm", ...emit],
setup(props2, {
emit: emit2
......@@ -11136,12 +11136,13 @@ var PickerViewColumn = /* @__PURE__ */ defineBuiltInComponent({
};
}
});
const VALUES = {
const FONT_SIZE = 16;
const PROGRESS_VALUES = {
activeColor: PRIMARY_COLOR,
backgroundColor: "#EBEBEB",
activeMode: "backwards"
};
const props$p = {
const progressProps = {
percent: {
type: [Number, String],
default: 0,
......@@ -11149,6 +11150,10 @@ const props$p = {
return !isNaN(parseFloat(value));
}
},
fontSize: {
type: [String, Number],
default: FONT_SIZE
},
showInfo: {
type: [Boolean, String],
default: false
......@@ -11162,15 +11167,15 @@ const props$p = {
},
color: {
type: String,
default: VALUES.activeColor
default: PROGRESS_VALUES.activeColor
},
activeColor: {
type: String,
default: VALUES.activeColor
default: PROGRESS_VALUES.activeColor
},
backgroundColor: {
type: String,
default: VALUES.backgroundColor
default: PROGRESS_VALUES.backgroundColor
},
active: {
type: [Boolean, String],
......@@ -11178,7 +11183,7 @@ const props$p = {
},
activeMode: {
type: String,
default: VALUES.activeMode
default: PROGRESS_VALUES.activeMode
},
duration: {
type: [Number, String],
......@@ -11190,7 +11195,7 @@ const props$p = {
};
var index$p = /* @__PURE__ */ defineBuiltInComponent({
name: "Progress",
props: props$p,
props: progressProps,
setup(props2) {
const state2 = useProgressState(props2);
_activeAnimation(state2, props2);
......@@ -11226,7 +11231,7 @@ function useProgressState(props2) {
const currentPercent = ref(0);
const outerBarStyle = computed(() => `background-color: ${props2.backgroundColor}; height: ${props2.strokeWidth}px;`);
const innerBarStyle = computed(() => {
const backgroundColor = props2.color !== VALUES.activeColor && props2.activeColor === VALUES.activeColor ? props2.color : props2.activeColor;
const backgroundColor = props2.color !== PROGRESS_VALUES.activeColor && props2.activeColor === PROGRESS_VALUES.activeColor ? props2.color : props2.activeColor;
return `width: ${currentPercent.value}%;background-color: ${backgroundColor}`;
});
const realPercent = computed(() => {
......@@ -11247,7 +11252,7 @@ function useProgressState(props2) {
}
function _activeAnimation(state2, props2) {
if (props2.active) {
state2.currentPercent = props2.activeMode === VALUES.activeMode ? 0 : state2.lastPercent;
state2.currentPercent = props2.activeMode === PROGRESS_VALUES.activeMode ? 0 : state2.lastPercent;
state2.strokeTimer = setInterval(() => {
if (state2.currentPercent + 1 > state2.realPercent) {
state2.currentPercent = state2.realPercent;
......@@ -13280,7 +13285,7 @@ var index$j = /* @__PURE__ */ defineBuiltInComponent({
};
}
});
const props$g = /* @__PURE__ */ extend({}, props$r, {
const props$g = /* @__PURE__ */ extend({}, props$q, {
placeholderClass: {
type: String,
default: "input-placeholder"
......
......@@ -104,6 +104,7 @@ const NVUE_BUILT_IN_TAGS = [
'timepicker',
'marquee',
'countdown',
'dc-switch',
];
const NVUE_U_BUILT_IN_TAGS = [
'text',
......@@ -113,6 +114,8 @@ const NVUE_U_BUILT_IN_TAGS = [
'video',
'web-view',
'slider',
'ad',
'ad-draw',
];
function isBuiltInComponent(tag) {
// h5 平台会被转换为 v-uni-
......
......@@ -100,6 +100,7 @@ const NVUE_BUILT_IN_TAGS = [
'timepicker',
'marquee',
'countdown',
'dc-switch',
];
const NVUE_U_BUILT_IN_TAGS = [
'text',
......@@ -109,6 +110,8 @@ const NVUE_U_BUILT_IN_TAGS = [
'video',
'web-view',
'slider',
'ad',
'ad-draw',
];
function isBuiltInComponent(tag) {
// h5 平台会被转换为 v-uni-
......
......@@ -103,6 +103,7 @@ export const NVUE_BUILT_IN_TAGS = [
'timepicker',
'marquee',
'countdown',
'dc-switch',
]
export const NVUE_U_BUILT_IN_TAGS = [
......@@ -113,6 +114,8 @@ export const NVUE_U_BUILT_IN_TAGS = [
'video',
'web-view',
'slider',
'ad',
'ad-draw',
]
export function isBuiltInComponent(tag: string) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册