sard-uniapp 1.24.7 → 1.25.1
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 +27 -0
- package/README.md +1 -1
- package/components/cascader/README.md +1 -1
- package/components/config/index.d.ts +2 -0
- package/components/config/index.js +11 -0
- package/components/empty/README.md +1 -1
- package/components/icon/sari.scss +9 -5
- package/components/image/README.md +108 -0
- package/components/image/common.d.ts +455 -0
- package/components/image/common.js +22 -0
- package/components/image/image.d.ts +38 -0
- package/components/image/image.vue +222 -0
- package/components/image/index.d.ts +1 -0
- package/components/image/index.js +1 -0
- package/components/image/index.scss +72 -0
- package/components/image/variables.scss +13 -0
- package/components/loading/loading.vue +8 -9
- package/components/locale/lang/vi-VN.d.ts +126 -0
- package/components/locale/lang/vi-VN.js +126 -0
- package/components/popout/README.md +22 -17
- package/components/popout/common.d.ts +200 -0
- package/components/popout/popout.d.ts +5 -0
- package/components/popout/popout.vue +15 -0
- package/components/popup/README.md +2 -0
- package/components/popup/popup.vue +2 -0
- package/components/qrcode/README.md +6 -0
- package/components/qrcode/common.d.ts +3 -0
- package/components/qrcode/qrcode.d.ts +6 -2
- package/components/qrcode/qrcode.vue +9 -3
- package/components/resize-sensor/resize-sensor.vue +1 -1
- package/components/share-sheet/share-sheet.vue +2 -0
- package/components/steps/steps.d.ts +1 -1
- package/components/upload/README.md +6 -0
- package/components/upload/common.d.ts +3 -0
- package/components/upload/upload.d.ts +3 -1
- package/components/upload/upload.vue +8 -3
- package/components/watermark/watermark.d.ts +1 -1
- package/global.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.scss +1 -0
- package/package.json +1 -1
- package/utils/array.js +1 -1
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="imageClass" :style="imageStyle" @click="onClick">
|
|
3
|
+
<view
|
|
4
|
+
v-if="props.showLoading && status & STATUS.FIRST_LOADING"
|
|
5
|
+
:class="bem.e('loading')"
|
|
6
|
+
>
|
|
7
|
+
<slot v-if="$slots.loading" name="loading"></slot>
|
|
8
|
+
<sar-icon v-else :family="iconFamily || 'sari'" :name="loadingIcon" />
|
|
9
|
+
</view>
|
|
10
|
+
<view
|
|
11
|
+
v-else-if="props.showError && status & STATUS.ERROR"
|
|
12
|
+
:class="bem.e('error')"
|
|
13
|
+
>
|
|
14
|
+
<slot v-if="$slots.error" name="error"></slot>
|
|
15
|
+
<sar-icon v-else :family="iconFamily || 'sari'" :name="errorIcon" />
|
|
16
|
+
</view>
|
|
17
|
+
<view v-else :class="displayClass" :style="displayStyle"></view>
|
|
18
|
+
<!-- #ifdef WEB -->
|
|
19
|
+
<img
|
|
20
|
+
:src="src"
|
|
21
|
+
:loading="lazyLoad ? 'lazy' : 'eager'"
|
|
22
|
+
:class="interactionClass"
|
|
23
|
+
@load="onLoad"
|
|
24
|
+
@error="onError"
|
|
25
|
+
/>
|
|
26
|
+
<!-- #endif -->
|
|
27
|
+
<!-- #ifndef WEB -->
|
|
28
|
+
<image
|
|
29
|
+
:src="src"
|
|
30
|
+
:lazy-load="lazyLoad"
|
|
31
|
+
:webp="webp"
|
|
32
|
+
:show-menu-by-longpress="showMenuByLongpress"
|
|
33
|
+
:class="interactionClass"
|
|
34
|
+
@load="onLoad"
|
|
35
|
+
@error="onError"
|
|
36
|
+
></image>
|
|
37
|
+
<!-- #endif -->
|
|
38
|
+
<sar-resize-sensor
|
|
39
|
+
v-if="resizeSensorVisible"
|
|
40
|
+
initial
|
|
41
|
+
:threshold="0"
|
|
42
|
+
@resize="onResize"
|
|
43
|
+
/>
|
|
44
|
+
</view>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
49
|
+
import { computed, ref, watch } from "vue";
|
|
50
|
+
import {
|
|
51
|
+
classNames,
|
|
52
|
+
stringifyStyle,
|
|
53
|
+
createBem,
|
|
54
|
+
isNullish
|
|
55
|
+
} from "../../utils";
|
|
56
|
+
import {
|
|
57
|
+
defaultImageProps,
|
|
58
|
+
FIX_MODES,
|
|
59
|
+
IMAGE_MODES
|
|
60
|
+
} from "./common";
|
|
61
|
+
import SarResizeSensor from "../resize-sensor/resize-sensor.vue";
|
|
62
|
+
import SarIcon from "../icon/icon.vue";
|
|
63
|
+
var STATUS = ((STATUS2) => {
|
|
64
|
+
STATUS2[STATUS2["UNSTATED"] = 0] = "UNSTATED";
|
|
65
|
+
STATUS2[STATUS2["FIRST_LOADING"] = 1] = "FIRST_LOADING";
|
|
66
|
+
STATUS2[STATUS2["LATER_LOADING"] = 4] = "LATER_LOADING";
|
|
67
|
+
STATUS2[STATUS2["LOADED"] = 8] = "LOADED";
|
|
68
|
+
STATUS2[STATUS2["ERROR"] = 16] = "ERROR";
|
|
69
|
+
return STATUS2;
|
|
70
|
+
})(STATUS || {});
|
|
71
|
+
/**
|
|
72
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
73
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
74
|
+
* @property {string} src 图片资源地址,默认值:-。
|
|
75
|
+
* @property {'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right'} mode 图片资源地址,默认值:'aspectFill'。
|
|
76
|
+
* @property {boolean} lazyLoad 图片懒加载,默认值:false。
|
|
77
|
+
* @property {boolean} fade 是否需要淡入效果,默认值:true。
|
|
78
|
+
* @property {boolean} webp 在系统不支持webp的情况下是否单独启用webp,默认值:false。
|
|
79
|
+
* @property {boolean} showMenuByLongpress 开启长按图片显示识别小程序码菜单,默认值:true。
|
|
80
|
+
* @property {string} width 图片宽度,默认值:'320px'。
|
|
81
|
+
* @property {string} height 图片高度,默认值:'240px'。
|
|
82
|
+
* @property {'circle' | 'square'} shape 图片形状,默认值:'square'。
|
|
83
|
+
* @property {string} radius 图片圆角,默认值:-。
|
|
84
|
+
* @property {string} loadingIcon 加载中的图标,默认值:'image'。
|
|
85
|
+
* @property {string} errorIcon 加载失败的图标,默认值:'image-error'。
|
|
86
|
+
* @property {string} iconFamily 图标族,默认值:'sari'。
|
|
87
|
+
* @property {boolean} showLoading 是否显示加载中的图标或者自定义的插槽,默认值:true。
|
|
88
|
+
* @property {boolean} showError 是否显示加载失败的图标或者自定义的插槽,默认值:true。
|
|
89
|
+
* @property {string} background 图片背景颜色,默认值:-。
|
|
90
|
+
* @event {(event: any) => void} click 点击图片时触发
|
|
91
|
+
* @event {(event: any) => void} load 图片加载成功时触发
|
|
92
|
+
* @event {(event: any) => void} error 图片加载失败时触发
|
|
93
|
+
*/
|
|
94
|
+
export default _defineComponent({
|
|
95
|
+
components: {
|
|
96
|
+
SarResizeSensor,
|
|
97
|
+
SarIcon,
|
|
98
|
+
},
|
|
99
|
+
...{
|
|
100
|
+
options: {
|
|
101
|
+
virtualHost: true,
|
|
102
|
+
styleIsolation: "shared"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
__name: "image",
|
|
106
|
+
props: _mergeDefaults({
|
|
107
|
+
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
108
|
+
rootClass: { type: String, required: false },
|
|
109
|
+
src: { type: String, required: false },
|
|
110
|
+
mode: { type: String, required: false },
|
|
111
|
+
lazyLoad: { type: Boolean, required: false },
|
|
112
|
+
webp: { type: Boolean, required: false },
|
|
113
|
+
showMenuByLongpress: { type: Boolean, required: false },
|
|
114
|
+
width: { type: String, required: false },
|
|
115
|
+
height: { type: String, required: false },
|
|
116
|
+
shape: { type: String, required: false },
|
|
117
|
+
radius: { type: String, required: false },
|
|
118
|
+
loadingIcon: { type: String, required: false },
|
|
119
|
+
errorIcon: { type: String, required: false },
|
|
120
|
+
iconFamily: { type: String, required: false },
|
|
121
|
+
showLoading: { type: Boolean, required: false },
|
|
122
|
+
showError: { type: Boolean, required: false },
|
|
123
|
+
background: { type: String, required: false },
|
|
124
|
+
fade: { type: Boolean, required: false },
|
|
125
|
+
customLoad: { type: Function, required: false }
|
|
126
|
+
}, defaultImageProps),
|
|
127
|
+
emits: ["click", "load", "error"],
|
|
128
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
129
|
+
const props = __props;
|
|
130
|
+
const emit = __emit;
|
|
131
|
+
const bem = createBem("image");
|
|
132
|
+
const status = ref(0 /* UNSTATED */);
|
|
133
|
+
const isLoaded = ref(false);
|
|
134
|
+
const resizeSensorVisible = computed(
|
|
135
|
+
() => FIX_MODES[props.mode]
|
|
136
|
+
);
|
|
137
|
+
const sensorWidth = ref(0);
|
|
138
|
+
const sensorHeight = ref(0);
|
|
139
|
+
const onResize = (res) => {
|
|
140
|
+
sensorWidth.value = res.width;
|
|
141
|
+
sensorHeight.value = res.height;
|
|
142
|
+
};
|
|
143
|
+
const aspectRatio = ref(0);
|
|
144
|
+
const loadedUrl = ref("");
|
|
145
|
+
const doLoad = (event) => {
|
|
146
|
+
const { width, height } = event.target && !isNullish(event.target.naturalWidth) ? {
|
|
147
|
+
width: event.target.naturalWidth,
|
|
148
|
+
height: event.target.naturalHeight
|
|
149
|
+
} : event.detail;
|
|
150
|
+
aspectRatio.value = width / height;
|
|
151
|
+
status.value = 8 /* LOADED */;
|
|
152
|
+
isLoaded.value = true;
|
|
153
|
+
loadedUrl.value = props.src;
|
|
154
|
+
emit("load", event);
|
|
155
|
+
};
|
|
156
|
+
const onLoad = async (event) => {
|
|
157
|
+
if (!props.customLoad) {
|
|
158
|
+
doLoad(event);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const onError = (event) => {
|
|
162
|
+
status.value = 16 /* ERROR */;
|
|
163
|
+
emit("error", event);
|
|
164
|
+
};
|
|
165
|
+
const onClick = (event) => {
|
|
166
|
+
emit("click", event);
|
|
167
|
+
};
|
|
168
|
+
watch(
|
|
169
|
+
() => props.src,
|
|
170
|
+
async () => {
|
|
171
|
+
if (props.src) {
|
|
172
|
+
status.value = isLoaded.value && !(status.value & 16 /* ERROR */) ? 4 /* LATER_LOADING */ : 1 /* FIRST_LOADING */;
|
|
173
|
+
}
|
|
174
|
+
if (props.customLoad) {
|
|
175
|
+
props.customLoad((event) => {
|
|
176
|
+
doLoad(event);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
immediate: true
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
__expose({});
|
|
185
|
+
const imageClass = computed(() => {
|
|
186
|
+
return classNames(
|
|
187
|
+
bem.b(),
|
|
188
|
+
bem.m(props.shape),
|
|
189
|
+
bem.m("animated", props.fade),
|
|
190
|
+
props.rootClass
|
|
191
|
+
);
|
|
192
|
+
});
|
|
193
|
+
const imageStyle = computed(() => {
|
|
194
|
+
return stringifyStyle(props.rootStyle, {
|
|
195
|
+
width: status.value & 8 /* LOADED */ && props.mode === "heightFix" ? aspectRatio.value * sensorHeight.value + "px" : props.width,
|
|
196
|
+
height: status.value & 8 /* LOADED */ && props.mode === "widthFix" ? sensorWidth.value / aspectRatio.value + "px" : props.height,
|
|
197
|
+
borderRadius: props.shape === "square" ? props.radius : void 0,
|
|
198
|
+
background: status.value & 8 /* LOADED */ ? "transparent" : props.background
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
const displayClass = computed(() => {
|
|
202
|
+
return classNames(bem.e("display"));
|
|
203
|
+
});
|
|
204
|
+
const displayStyle = computed(() => {
|
|
205
|
+
return stringifyStyle({
|
|
206
|
+
backgroundImage: loadedUrl.value ? `url(${loadedUrl.value})` : "none",
|
|
207
|
+
backgroundPosition: IMAGE_MODES[props.mode][0],
|
|
208
|
+
backgroundSize: IMAGE_MODES[props.mode][1]
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
const interactionClass = computed(() => {
|
|
212
|
+
return classNames(bem.e("interaction"));
|
|
213
|
+
});
|
|
214
|
+
const __returned__ = { props, emit, bem, STATUS, status, isLoaded, resizeSensorVisible, sensorWidth, sensorHeight, onResize, aspectRatio, loadedUrl, doLoad, onLoad, onError, onClick, imageClass, imageStyle, displayClass, displayStyle, interactionClass, SarResizeSensor, SarIcon };
|
|
215
|
+
return __returned__;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
</script>
|
|
219
|
+
|
|
220
|
+
<style lang="scss">
|
|
221
|
+
@import './index.scss';
|
|
222
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ImageProps, ImageSlots, ImageEmits, ImageExpose } from './common';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@use '../style/base' as *;
|
|
2
|
+
|
|
3
|
+
@include bem(image) {
|
|
4
|
+
@include b() {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: inline-block;
|
|
7
|
+
width: var(--sar-image-width);
|
|
8
|
+
height: var(--sar-image-height);
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
background: var(--sar-image-bg);
|
|
11
|
+
|
|
12
|
+
@include m(circle) {
|
|
13
|
+
border-radius: 9999px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include e(display) {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
background-repeat: no-repeat;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include m(animated) {
|
|
27
|
+
@include e(display) {
|
|
28
|
+
animation: #{bem-ns(image-fade)} var(--sar-image-fade-duration);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@keyframes #{bem-ns(image-fade)} {
|
|
33
|
+
from {
|
|
34
|
+
opacity: 0;
|
|
35
|
+
}
|
|
36
|
+
to {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@include e(interaction) {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
display: block;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
opacity: 0;
|
|
49
|
+
-webkit-touch-callout: none;
|
|
50
|
+
user-select: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@include e(loading) {
|
|
54
|
+
@include universal;
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
align-items: center;
|
|
59
|
+
font-size: var(--sar-image-loading-font-size);
|
|
60
|
+
color: var(--sar-image-loading-color);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@include e(error) {
|
|
64
|
+
@include universal;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
align-items: center;
|
|
69
|
+
font-size: var(--sar-image-error-font-size);
|
|
70
|
+
color: var(--sar-image-error-color);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// #variables
|
|
2
|
+
page,
|
|
3
|
+
.sar-portal {
|
|
4
|
+
--sar-image-bg: var(--sar-secondary-bg);
|
|
5
|
+
--sar-image-width: 320px;
|
|
6
|
+
--sar-image-height: 240px;
|
|
7
|
+
--sar-image-loading-font-size: 48rpx;
|
|
8
|
+
--sar-image-loading-color: var(--sar-fourth-color);
|
|
9
|
+
--sar-image-error-font-size: 48rpx;
|
|
10
|
+
--sar-image-error-color: var(--sar-fourth-color);
|
|
11
|
+
--sar-image-fade-duration: var(--sar-duration-slow);
|
|
12
|
+
}
|
|
13
|
+
// #endvariables
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view :class="loadingClass">
|
|
2
|
+
<view :class="loadingClass" :style="loadingStyle">
|
|
3
3
|
<view :class="iconClass" :style="iconStyle">
|
|
4
4
|
<slot v-if="type === 'circular'" name="circular">
|
|
5
5
|
<view :class="bem.e('spinner')"></view>
|
|
@@ -89,7 +89,10 @@ export default _defineComponent({
|
|
|
89
89
|
return Math.max(Math.floor(props.progress * 12), 1);
|
|
90
90
|
});
|
|
91
91
|
const loadingClass = computed(() => {
|
|
92
|
-
return classNames(bem.b(), bem.m("vertical", props.vertical));
|
|
92
|
+
return classNames(bem.b(), bem.m("vertical", props.vertical), props.rootClass);
|
|
93
|
+
});
|
|
94
|
+
const loadingStyle = computed(() => {
|
|
95
|
+
return stringifyStyle(props.rootStyle);
|
|
93
96
|
});
|
|
94
97
|
const iconClass = computed(() => {
|
|
95
98
|
return classNames(
|
|
@@ -106,17 +109,13 @@ export default _defineComponent({
|
|
|
106
109
|
},
|
|
107
110
|
props.type === "circular" && !props.animated ? {
|
|
108
111
|
transform: `rotate(${props.progress * 360}deg)`
|
|
109
|
-
} : null
|
|
110
|
-
props.rootClass
|
|
112
|
+
} : null
|
|
111
113
|
);
|
|
112
114
|
});
|
|
113
115
|
const loadingTextStyle = computed(() => {
|
|
114
|
-
return stringifyStyle(
|
|
115
|
-
{ color: props.textColor, fontSize: props.textSize },
|
|
116
|
-
props.rootStyle
|
|
117
|
-
);
|
|
116
|
+
return stringifyStyle({ color: props.textColor, fontSize: props.textSize });
|
|
118
117
|
});
|
|
119
|
-
const __returned__ = { props, bem, scaleShowNum, loadingClass, iconClass, iconStyle, loadingTextStyle, get classNames() {
|
|
118
|
+
const __returned__ = { props, bem, scaleShowNum, loadingClass, loadingStyle, iconClass, iconStyle, loadingTextStyle, get classNames() {
|
|
120
119
|
return classNames;
|
|
121
120
|
}, get isRenderVisible() {
|
|
122
121
|
return isRenderVisible;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
calendar: {
|
|
3
|
+
weeks: {
|
|
4
|
+
0: string;
|
|
5
|
+
1: string;
|
|
6
|
+
2: string;
|
|
7
|
+
3: string;
|
|
8
|
+
4: string;
|
|
9
|
+
5: string;
|
|
10
|
+
6: string;
|
|
11
|
+
};
|
|
12
|
+
monthTitle: string;
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
to: string;
|
|
16
|
+
multipleOutlet: string;
|
|
17
|
+
};
|
|
18
|
+
cascader: {
|
|
19
|
+
pleaseSelect: string;
|
|
20
|
+
};
|
|
21
|
+
cropImage: {
|
|
22
|
+
confirm: string;
|
|
23
|
+
cancel: string;
|
|
24
|
+
};
|
|
25
|
+
datetimePicker: {
|
|
26
|
+
y: string;
|
|
27
|
+
M: string;
|
|
28
|
+
d: string;
|
|
29
|
+
h: string;
|
|
30
|
+
m: string;
|
|
31
|
+
s: string;
|
|
32
|
+
};
|
|
33
|
+
datetimeRangePickerInput: {
|
|
34
|
+
to: string;
|
|
35
|
+
};
|
|
36
|
+
dialog: {
|
|
37
|
+
confirm: string;
|
|
38
|
+
cancel: string;
|
|
39
|
+
};
|
|
40
|
+
empty: {
|
|
41
|
+
noData: string;
|
|
42
|
+
};
|
|
43
|
+
form: {
|
|
44
|
+
defaultValidateMessages: {
|
|
45
|
+
default: string;
|
|
46
|
+
required: string;
|
|
47
|
+
enum: string;
|
|
48
|
+
whitespace: string;
|
|
49
|
+
date: {
|
|
50
|
+
format: string;
|
|
51
|
+
parse: string;
|
|
52
|
+
invalid: string;
|
|
53
|
+
};
|
|
54
|
+
types: {
|
|
55
|
+
string: string;
|
|
56
|
+
function: string;
|
|
57
|
+
array: string;
|
|
58
|
+
object: string;
|
|
59
|
+
number: string;
|
|
60
|
+
date: string;
|
|
61
|
+
boolean: string;
|
|
62
|
+
integer: string;
|
|
63
|
+
float: string;
|
|
64
|
+
regexp: string;
|
|
65
|
+
email: string;
|
|
66
|
+
url: string;
|
|
67
|
+
hex: string;
|
|
68
|
+
};
|
|
69
|
+
string: {
|
|
70
|
+
len: string;
|
|
71
|
+
min: string;
|
|
72
|
+
max: string;
|
|
73
|
+
range: string;
|
|
74
|
+
};
|
|
75
|
+
number: {
|
|
76
|
+
len: string;
|
|
77
|
+
min: string;
|
|
78
|
+
max: string;
|
|
79
|
+
range: string;
|
|
80
|
+
};
|
|
81
|
+
array: {
|
|
82
|
+
len: string;
|
|
83
|
+
min: string;
|
|
84
|
+
max: string;
|
|
85
|
+
range: string;
|
|
86
|
+
};
|
|
87
|
+
pattern: {
|
|
88
|
+
mismatch: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
loadMore: {
|
|
93
|
+
incompleteText: string;
|
|
94
|
+
loadingText: string;
|
|
95
|
+
completeText: string;
|
|
96
|
+
errorText: string;
|
|
97
|
+
};
|
|
98
|
+
pagination: {
|
|
99
|
+
previous: string;
|
|
100
|
+
next: string;
|
|
101
|
+
};
|
|
102
|
+
popout: {
|
|
103
|
+
confirm: string;
|
|
104
|
+
cancel: string;
|
|
105
|
+
};
|
|
106
|
+
readMore: {
|
|
107
|
+
fold: string;
|
|
108
|
+
unfold: string;
|
|
109
|
+
};
|
|
110
|
+
signature: {
|
|
111
|
+
confirm: string;
|
|
112
|
+
clear: string;
|
|
113
|
+
cancel: string;
|
|
114
|
+
};
|
|
115
|
+
tree: {
|
|
116
|
+
addSibling: string;
|
|
117
|
+
addChild: string;
|
|
118
|
+
addRoot: string;
|
|
119
|
+
removeNode: string;
|
|
120
|
+
edit: string;
|
|
121
|
+
please: string;
|
|
122
|
+
error: string;
|
|
123
|
+
noData: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export default _default;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
const formTypeTemplate = '${label}không phải là một ${type} hợp lệ';
|
|
2
|
+
export default {
|
|
3
|
+
calendar: {
|
|
4
|
+
weeks: {
|
|
5
|
+
0: 'CN',
|
|
6
|
+
1: 'T2',
|
|
7
|
+
2: 'T3',
|
|
8
|
+
3: 'T4',
|
|
9
|
+
4: 'T5',
|
|
10
|
+
5: 'T6',
|
|
11
|
+
6: 'T7',
|
|
12
|
+
},
|
|
13
|
+
monthTitle: 'Tháng ${month} năm ${year}',
|
|
14
|
+
start: 'Bắt đầu',
|
|
15
|
+
end: 'Kết thúc',
|
|
16
|
+
to: 'đến',
|
|
17
|
+
multipleOutlet: 'Đã chọn ${count} ngày',
|
|
18
|
+
},
|
|
19
|
+
cascader: {
|
|
20
|
+
pleaseSelect: 'Vui lòng chọn',
|
|
21
|
+
},
|
|
22
|
+
cropImage: {
|
|
23
|
+
confirm: 'Xác nhận',
|
|
24
|
+
cancel: 'Hủy',
|
|
25
|
+
},
|
|
26
|
+
datetimePicker: {
|
|
27
|
+
y: 'năm',
|
|
28
|
+
M: 'tháng',
|
|
29
|
+
d: 'ngày',
|
|
30
|
+
h: 'giờ',
|
|
31
|
+
m: 'phút',
|
|
32
|
+
s: 'giây',
|
|
33
|
+
},
|
|
34
|
+
datetimeRangePickerInput: {
|
|
35
|
+
to: 'đến',
|
|
36
|
+
},
|
|
37
|
+
dialog: {
|
|
38
|
+
confirm: 'Xác nhận',
|
|
39
|
+
cancel: 'Hủy',
|
|
40
|
+
},
|
|
41
|
+
empty: {
|
|
42
|
+
noData: 'Không có dữ liệu',
|
|
43
|
+
},
|
|
44
|
+
form: {
|
|
45
|
+
defaultValidateMessages: {
|
|
46
|
+
default: 'Lỗi xác thực trường ${label}',
|
|
47
|
+
required: '${label} là bắt buộc',
|
|
48
|
+
enum: '${label} phải là một trong [${enum}]',
|
|
49
|
+
whitespace: '${label} không được chứa khoảng trắng trống',
|
|
50
|
+
date: {
|
|
51
|
+
format: 'Định dạng ngày ${label} không hợp lệ',
|
|
52
|
+
parse: 'Không thể chuyển đổi ${label} thành ngày',
|
|
53
|
+
invalid: '${label} là một ngày không hợp lệ',
|
|
54
|
+
},
|
|
55
|
+
types: {
|
|
56
|
+
string: formTypeTemplate,
|
|
57
|
+
function: formTypeTemplate,
|
|
58
|
+
array: formTypeTemplate,
|
|
59
|
+
object: formTypeTemplate,
|
|
60
|
+
number: formTypeTemplate,
|
|
61
|
+
date: formTypeTemplate,
|
|
62
|
+
boolean: formTypeTemplate,
|
|
63
|
+
integer: formTypeTemplate,
|
|
64
|
+
float: formTypeTemplate,
|
|
65
|
+
regexp: formTypeTemplate,
|
|
66
|
+
email: formTypeTemplate,
|
|
67
|
+
url: formTypeTemplate,
|
|
68
|
+
hex: formTypeTemplate,
|
|
69
|
+
},
|
|
70
|
+
string: {
|
|
71
|
+
len: '${label} phải có ${len} ký tự',
|
|
72
|
+
min: '${label} tối thiểu ${min} ký tự',
|
|
73
|
+
max: '${label} tối đa ${max} ký tự',
|
|
74
|
+
range: '${label} phải nằm trong khoảng ${min}-${max} ký tự',
|
|
75
|
+
},
|
|
76
|
+
number: {
|
|
77
|
+
len: '${label} phải bằng ${len}',
|
|
78
|
+
min: 'Giá trị tối thiểu của ${label} là ${min}',
|
|
79
|
+
max: 'Giá trị tối đa của ${label} là ${max}',
|
|
80
|
+
range: '${label} phải nằm trong khoảng ${min}-${max}',
|
|
81
|
+
},
|
|
82
|
+
array: {
|
|
83
|
+
len: 'Phải có ${len} ${label}',
|
|
84
|
+
min: 'Tối thiểu ${min} ${label}',
|
|
85
|
+
max: 'Tối đa ${max} ${label}',
|
|
86
|
+
range: 'Số lượng ${label} phải nằm trong khoảng ${min}-${max}',
|
|
87
|
+
},
|
|
88
|
+
pattern: {
|
|
89
|
+
mismatch: '${label} không khớp với mẫu ${pattern}',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
loadMore: {
|
|
94
|
+
incompleteText: 'Nhấn để tải thêm',
|
|
95
|
+
loadingText: 'Đang tải...',
|
|
96
|
+
completeText: 'Không còn nữa',
|
|
97
|
+
errorText: 'Yêu cầu thất bại, nhấn để tải lại',
|
|
98
|
+
},
|
|
99
|
+
pagination: {
|
|
100
|
+
previous: 'Trang trước',
|
|
101
|
+
next: 'Trang sau',
|
|
102
|
+
},
|
|
103
|
+
popout: {
|
|
104
|
+
confirm: 'Xác nhận',
|
|
105
|
+
cancel: 'Hủy',
|
|
106
|
+
},
|
|
107
|
+
readMore: {
|
|
108
|
+
fold: 'Thu gọn',
|
|
109
|
+
unfold: 'Mở rộng',
|
|
110
|
+
},
|
|
111
|
+
signature: {
|
|
112
|
+
confirm: 'Xác nhận',
|
|
113
|
+
clear: 'Xóa',
|
|
114
|
+
cancel: 'Hủy',
|
|
115
|
+
},
|
|
116
|
+
tree: {
|
|
117
|
+
addSibling: 'Thêm nút kế tiếp',
|
|
118
|
+
addChild: 'Thêm nút con',
|
|
119
|
+
addRoot: 'Thêm nút gốc',
|
|
120
|
+
removeNode: 'Xóa nút',
|
|
121
|
+
edit: 'Chỉnh sửa nút',
|
|
122
|
+
please: 'Vui lòng nhập tiêu đề',
|
|
123
|
+
error: 'Yêu cầu thất bại, nhấn để tải lại',
|
|
124
|
+
noData: 'Không có dữ liệu',
|
|
125
|
+
},
|
|
126
|
+
};
|
|
@@ -39,23 +39,28 @@ import Popout from 'sard-uniapp/components/popout/popout.vue'
|
|
|
39
39
|
|
|
40
40
|
### PopoutProps
|
|
41
41
|
|
|
42
|
-
| 属性
|
|
43
|
-
|
|
|
44
|
-
| root-class
|
|
45
|
-
| root-style
|
|
46
|
-
| title
|
|
47
|
-
| show-cancel
|
|
48
|
-
| cancel-text
|
|
49
|
-
| show-confirm
|
|
50
|
-
| confirm-text
|
|
51
|
-
| show-close
|
|
52
|
-
| show-footer
|
|
53
|
-
| type
|
|
54
|
-
| visible (v-model)
|
|
55
|
-
| before-close
|
|
56
|
-
| duration
|
|
57
|
-
| overlay
|
|
58
|
-
|
|
|
42
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
43
|
+
| -------------------------------- | -------------------------------------------------------------------------------------- | -------------------- | ------- |
|
|
44
|
+
| root-class | 组件根元素类名 | string | - |
|
|
45
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
46
|
+
| title | 弹出框标题 | string | - |
|
|
47
|
+
| show-cancel | 是否显示取消按钮,适用 `loose` 类型 | boolean | false |
|
|
48
|
+
| cancel-text | 取消按钮文案 | string | '取消' |
|
|
49
|
+
| show-confirm | 是否显示确定按钮,适用 `loose` 类型 | boolean | true |
|
|
50
|
+
| confirm-text | 确定按钮文案 | string | '确定' |
|
|
51
|
+
| show-close | 是否显示关闭按钮,适用 `loose` 类型 | boolean | true |
|
|
52
|
+
| show-footer | 是否显示底部按钮 | boolean | true |
|
|
53
|
+
| type | 弹出框按钮排版方式 | 'compact' \| 'loose' | 'loose' |
|
|
54
|
+
| visible (v-model) | 是否显示弹出框 | boolean | - |
|
|
55
|
+
| before-close | 关闭前的回调,返回 `false` 或 `rejected` 状态的 `Promise` 可阻止关闭 | PopoutBeforeClose | - |
|
|
56
|
+
| duration | 显隐动画时长,单位 ms | number | 300 |
|
|
57
|
+
| overlay <sup>1.25.1+</sup> | 是否显示遮罩 | boolean | true |
|
|
58
|
+
| overlay-class <sup>1.25.1+</sup> | 添加到遮罩的类名 | string | - |
|
|
59
|
+
| overlay-style <sup>1.25.1+</sup> | 添加到遮罩的样式 | string | - |
|
|
60
|
+
| background <sup>1.25.1+</sup> | 遮罩背景色 | string | - |
|
|
61
|
+
| transparent <sup>1.25.1+</sup> | 透明遮罩 | boolean | false |
|
|
62
|
+
| overlay-closable | 点击遮罩是否关闭 | boolean | true |
|
|
63
|
+
| keep-render <sup>1.24.3+</sup> | 无论刚挂载还是隐藏,都始终不设置 display 为 none,一般用于内部包含计算尺寸的组件的情况 | boolean | false |
|
|
59
64
|
|
|
60
65
|
### PopoutBeforeClose
|
|
61
66
|
|