papayaui 0.2.9 → 0.2.11
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/components/cell/cell.scss +7 -4
- package/components/cell/cell.vue +9 -2
- package/components/input/input.scss +4 -0
- package/components/input/input.vue +11 -8
- package/components/input/props.ts +2 -4
- package/components/picker-popup/picker-popup.vue +1 -0
- package/components/picker-popup/props.ts +1 -0
- package/components/textarea/textarea.scss +1 -0
- package/components/textarea/textarea.vue +3 -1
- package/components/uploader/props.ts +1 -0
- package/components/uploader/uploader.vue +8 -1
- package/package.json +1 -1
- package/utils/cos.ts +1 -8
- package/components/dialog/dialog.ts +0 -14
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
font-size: _var(cell-font-size, 14px);
|
|
11
11
|
line-height: _var(cell-line-height, 24px);
|
|
12
12
|
overflow: hidden;
|
|
13
|
-
&__title
|
|
13
|
+
&__title {
|
|
14
|
+
flex: _var(cell-title-flex, 1);
|
|
15
|
+
}
|
|
14
16
|
&__value {
|
|
15
|
-
flex: 1;
|
|
17
|
+
flex: _var(cell-value-flex, 1);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
&__icon,
|
|
@@ -34,7 +36,7 @@
|
|
|
34
36
|
&__value {
|
|
35
37
|
position: relative;
|
|
36
38
|
overflow: hidden;
|
|
37
|
-
text-align: right;
|
|
39
|
+
text-align: _var(cell-value-text-align, right);
|
|
38
40
|
vertical-align: middle;
|
|
39
41
|
word-wrap: break-word;
|
|
40
42
|
@include _setVar(textarea-padding, 0);
|
|
@@ -51,7 +53,8 @@
|
|
|
51
53
|
transform: rotate(_var(cell-icon-right-rotate, 0));
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
&__icon,
|
|
56
|
+
&__icon,
|
|
57
|
+
&__icon-right {
|
|
55
58
|
font-size: _var(cell-icon-size, 16px);
|
|
56
59
|
}
|
|
57
60
|
|
package/components/cell/cell.vue
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<view
|
|
15
15
|
v-if="!!title || $slots.title"
|
|
16
16
|
:class="[ns.e('title'), titleClass]"
|
|
17
|
-
:style="{ flex: titleWidth ? `0 ${getUnitValue(titleWidth)}` :
|
|
17
|
+
:style="ns.style({ flex: titleWidth ? `0 ${getUnitValue(titleWidth)}` : undefined })"
|
|
18
18
|
>
|
|
19
19
|
<slot v-if="$slots.title" name="title" />
|
|
20
20
|
<template v-else>
|
|
@@ -22,7 +22,14 @@
|
|
|
22
22
|
<view v-if="label" :class="ns.e('label')">{{ label }}</view>
|
|
23
23
|
</template>
|
|
24
24
|
</view>
|
|
25
|
-
<view
|
|
25
|
+
<view
|
|
26
|
+
:class="[ns.e('value'), valueClass]"
|
|
27
|
+
:style="
|
|
28
|
+
ns.style({
|
|
29
|
+
textAlign: valueAlign !== cellProps.valueAlign.default ? valueAlign : undefined,
|
|
30
|
+
})
|
|
31
|
+
"
|
|
32
|
+
>
|
|
26
33
|
<slot v-if="$slots.default" />
|
|
27
34
|
<text v-else :selectable="selectable" :user-select="selectable">{{ value }}</text>
|
|
28
35
|
|
|
@@ -5,12 +5,7 @@
|
|
|
5
5
|
>
|
|
6
6
|
<slot name="prefix" />
|
|
7
7
|
|
|
8
|
-
<view
|
|
9
|
-
v-if="showMask"
|
|
10
|
-
:class="[ns.e('mask')]"
|
|
11
|
-
:style="{ textAlign: inputAlign }"
|
|
12
|
-
@tap.stop="onFocus"
|
|
13
|
-
>
|
|
8
|
+
<view v-if="showMask" :class="[ns.e('mask')]" :style="customStyle" @tap.stop="onFocus">
|
|
14
9
|
{{ inputValue }}
|
|
15
10
|
</view>
|
|
16
11
|
|
|
@@ -22,7 +17,7 @@
|
|
|
22
17
|
:disabled="readonly || disabled"
|
|
23
18
|
:placeholder="placeholder"
|
|
24
19
|
:placeholder-class="ns.e('placeholder')"
|
|
25
|
-
:style="
|
|
20
|
+
:style="customStyle"
|
|
26
21
|
:maxlength="maxLength"
|
|
27
22
|
:focus="inputSelection.focus"
|
|
28
23
|
:selection-start="inputSelection.start"
|
|
@@ -50,7 +45,7 @@
|
|
|
50
45
|
</template>
|
|
51
46
|
|
|
52
47
|
<script setup lang="ts">
|
|
53
|
-
import { computed, ref } from 'vue'
|
|
48
|
+
import { computed, ref, type CSSProperties } from 'vue'
|
|
54
49
|
import { formatNumericTypeString, minAndMax, useNamespace } from '../../core'
|
|
55
50
|
import type { EventDetail } from '../../types'
|
|
56
51
|
import IconComponent from '../icon/icon.vue'
|
|
@@ -72,6 +67,14 @@ const inputValue = computed<string>({
|
|
|
72
67
|
},
|
|
73
68
|
})
|
|
74
69
|
|
|
70
|
+
const customStyle = computed(() => {
|
|
71
|
+
const style: CSSProperties = {}
|
|
72
|
+
if (props.inputAlign !== inputProps.inputAlign.default) {
|
|
73
|
+
style.textAlign = props.inputAlign
|
|
74
|
+
}
|
|
75
|
+
return style
|
|
76
|
+
})
|
|
77
|
+
|
|
75
78
|
const inputSelection = ref({ focus: false, start: -1, end: -1 })
|
|
76
79
|
|
|
77
80
|
const showMask = computed(() => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue'
|
|
2
2
|
import { isString } from '../../utils'
|
|
3
|
+
import { cellProps } from '../cell'
|
|
3
4
|
|
|
4
5
|
export type InputType = 'text' | 'number'
|
|
5
6
|
export type InputValue = string | number
|
|
@@ -52,10 +53,7 @@ export const inputProps = {
|
|
|
52
53
|
/**
|
|
53
54
|
* 内容对齐方式
|
|
54
55
|
*/
|
|
55
|
-
inputAlign:
|
|
56
|
-
type: String as PropType<'left' | 'center' | 'right'>,
|
|
57
|
-
default: 'right',
|
|
58
|
-
},
|
|
56
|
+
inputAlign: cellProps.valueAlign,
|
|
59
57
|
/**
|
|
60
58
|
* 是否禁用
|
|
61
59
|
*/
|
|
@@ -118,6 +118,7 @@ export const pickerPopupEmits = {
|
|
|
118
118
|
...bottomPopupEmits,
|
|
119
119
|
'update:modelValue': (value: OptionValue | OptionValue[]) =>
|
|
120
120
|
isString(value) || isNumber(value) || isArray(value),
|
|
121
|
+
select: (item: Option) => isObject(item),
|
|
121
122
|
change: (item: Option | Option[]) => isObject(item) || isArray(item),
|
|
122
123
|
/**
|
|
123
124
|
* 新增选项
|
|
@@ -50,7 +50,9 @@ const customStyle = computed(() => {
|
|
|
50
50
|
if (props.height && !props.autoHeight) {
|
|
51
51
|
style.height = getUnitValue(props.height)
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
if (props.inputAlign !== textareaProps.inputAlign.default) {
|
|
54
|
+
style.textAlign = props.inputAlign
|
|
55
|
+
}
|
|
54
56
|
return style
|
|
55
57
|
})
|
|
56
58
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<view v-for="(file, index) in fileList" :key="index" :class="ns.e('preview')">
|
|
7
7
|
<view :class="ns.e('preview-image')" :style="sizeStyle">
|
|
8
8
|
<ImageComponent
|
|
9
|
-
:src="file.url"
|
|
9
|
+
:src="file.thumbUrl ?? file.url"
|
|
10
10
|
width="100%"
|
|
11
11
|
height="100%"
|
|
12
12
|
mode="aspectFill"
|
|
@@ -133,6 +133,13 @@ const onPreview = (file: FileItem, index: number) => {
|
|
|
133
133
|
uni.previewMedia({
|
|
134
134
|
sources: props.fileList,
|
|
135
135
|
current: index,
|
|
136
|
+
fail: () => {
|
|
137
|
+
// 前面的API可能存在兼容问题,失败时使用降级方法
|
|
138
|
+
uni.previewImage({
|
|
139
|
+
urls: props.fileList.map((file) => file.url),
|
|
140
|
+
current: index,
|
|
141
|
+
})
|
|
142
|
+
},
|
|
136
143
|
})
|
|
137
144
|
// #endif
|
|
138
145
|
// #ifndef MP
|
package/package.json
CHANGED
package/utils/cos.ts
CHANGED
|
@@ -230,7 +230,7 @@ export class PaCOS {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
async getAuthorization(options: any) {
|
|
233
|
-
if (this.cosAuthorization && this.cosAuthorization.expiredTime
|
|
233
|
+
if (this.cosAuthorization && this.cosAuthorization.expiredTime > Date.now() / 1000) {
|
|
234
234
|
return this.cosAuthorization
|
|
235
235
|
}
|
|
236
236
|
const authorization = await this.config.getAuthorization(options)
|
|
@@ -249,13 +249,6 @@ export class PaCOS {
|
|
|
249
249
|
const cosConfig = await this.getConfig()
|
|
250
250
|
const Key = `${cosConfig.prefix}/${params?.Key ?? filePath.replace(/^.+\/(.+)$/, '$1')}`
|
|
251
251
|
return new Promise<UploadFileResult>((resolve, reject) => {
|
|
252
|
-
console.log('uploadFile params', {
|
|
253
|
-
Bucket: cosConfig.bucket,
|
|
254
|
-
Region: cosConfig.region,
|
|
255
|
-
FilePath: filePath,
|
|
256
|
-
...params,
|
|
257
|
-
Key,
|
|
258
|
-
})
|
|
259
252
|
this.cos.uploadFile(
|
|
260
253
|
{
|
|
261
254
|
Bucket: cosConfig.bucket,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defaultNamespace } from '../../core'
|
|
2
|
-
|
|
3
|
-
const Dialog = () => {
|
|
4
|
-
const node = uni
|
|
5
|
-
.createSelectorQuery()
|
|
6
|
-
.select(`#${defaultNamespace}-dialog`)
|
|
7
|
-
.node((result) => {
|
|
8
|
-
console.log('result', result)
|
|
9
|
-
})
|
|
10
|
-
.exec()
|
|
11
|
-
console.log(node)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default Dialog
|