zartui 3.1.23-beta.1 → 3.1.23
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/README.md +4 -0
- package/es/audio/Audio.d.ts +82 -0
- package/es/audio/Audio.mjs +224 -0
- package/es/audio/index.css +1 -0
- package/es/audio/index.d.ts +66 -0
- package/es/audio/index.mjs +10 -0
- package/es/audio/style/index.d.ts +1 -0
- package/es/audio/style/index.mjs +5 -0
- package/es/audio/types.d.ts +3 -0
- package/es/audio/types.mjs +4 -0
- package/es/icon/config.mjs +1 -0
- package/es/icon/index.css +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.mjs +4 -1
- package/es/slider/Slider.d.ts +29 -3
- package/es/slider/Slider.mjs +15 -5
- package/es/slider/index.d.ts +21 -3
- package/es/stepper/Stepper.d.ts +2 -2
- package/es/stepper/index.d.ts +2 -2
- package/es/swipe/Swipe.d.ts +2 -2
- package/es/swipe/index.d.ts +2 -2
- package/es/table/Table.mjs +13 -2
- package/es/utils/format.d.ts +1 -0
- package/es/utils/format.mjs +15 -0
- package/es/video/Video.mjs +4 -25
- package/lib/audio/Audio.d.ts +82 -0
- package/lib/audio/Audio.js +253 -0
- package/lib/audio/index.css +1 -0
- package/lib/audio/index.d.ts +66 -0
- package/lib/audio/index.js +39 -0
- package/lib/audio/style/index.d.ts +1 -0
- package/lib/audio/style/index.js +5 -0
- package/lib/audio/types.d.ts +3 -0
- package/lib/audio/types.js +23 -0
- package/lib/icon/config.js +1 -0
- package/lib/icon/index.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/slider/Slider.d.ts +29 -3
- package/lib/slider/Slider.js +14 -4
- package/lib/slider/index.d.ts +21 -3
- package/lib/stepper/Stepper.d.ts +2 -2
- package/lib/stepper/index.d.ts +2 -2
- package/lib/swipe/Swipe.d.ts +2 -2
- package/lib/swipe/index.d.ts +2 -2
- package/lib/table/Table.js +13 -2
- package/lib/utils/format.d.ts +1 -0
- package/lib/utils/format.js +15 -0
- package/lib/video/Video.js +3 -24
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +2349 -2114
- package/lib/zartui.es.js +2350 -2115
- package/lib/zartui.js +11344 -11109
- package/lib/zartui.min.js +1 -1
- package/package.json +81 -81
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./action-sheet";
|
|
2
|
+
export * from "./audio";
|
|
2
3
|
export * from "./avatar";
|
|
3
4
|
export * from "./badge";
|
|
4
5
|
export * from "./button";
|
|
@@ -82,4 +83,4 @@ declare namespace _default {
|
|
|
82
83
|
}
|
|
83
84
|
export default _default;
|
|
84
85
|
export function install(app: any): void;
|
|
85
|
-
export const version: "3.1.23
|
|
86
|
+
export const version: "3.1.23";
|
package/lib/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(stdin_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(stdin_exports);
|
|
26
26
|
var import_action_sheet = require("./action-sheet");
|
|
27
|
+
var import_audio = require("./audio");
|
|
27
28
|
var import_avatar = require("./avatar");
|
|
28
29
|
var import_badge = require("./badge");
|
|
29
30
|
var import_button = require("./button");
|
|
@@ -101,6 +102,7 @@ var import_toast = require("./toast");
|
|
|
101
102
|
var import_uploader = require("./uploader");
|
|
102
103
|
var import_video = require("./video");
|
|
103
104
|
__reExport(stdin_exports, require("./action-sheet"), module.exports);
|
|
105
|
+
__reExport(stdin_exports, require("./audio"), module.exports);
|
|
104
106
|
__reExport(stdin_exports, require("./avatar"), module.exports);
|
|
105
107
|
__reExport(stdin_exports, require("./badge"), module.exports);
|
|
106
108
|
__reExport(stdin_exports, require("./button"), module.exports);
|
|
@@ -178,10 +180,11 @@ __reExport(stdin_exports, require("./timeline"), module.exports);
|
|
|
178
180
|
__reExport(stdin_exports, require("./toast"), module.exports);
|
|
179
181
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
|
180
182
|
__reExport(stdin_exports, require("./video"), module.exports);
|
|
181
|
-
const version = "3.1.23
|
|
183
|
+
const version = "3.1.23";
|
|
182
184
|
function install(app) {
|
|
183
185
|
const components = [
|
|
184
186
|
import_action_sheet.ActionSheet,
|
|
187
|
+
import_audio.Audio,
|
|
185
188
|
import_avatar.Avatar,
|
|
186
189
|
import_badge.Badge,
|
|
187
190
|
import_button.Button,
|
package/lib/slider/Slider.d.ts
CHANGED
|
@@ -40,6 +40,14 @@ export declare const sliderProps: {
|
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
default: true;
|
|
42
42
|
};
|
|
43
|
+
barEdgeOffset: {
|
|
44
|
+
type: NumberConstructor;
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
barEdgeOffsetBoundary: {
|
|
48
|
+
type: NumberConstructor;
|
|
49
|
+
default: number;
|
|
50
|
+
};
|
|
43
51
|
};
|
|
44
52
|
export type SliderProps = ExtractPropTypes<typeof sliderProps>;
|
|
45
53
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -80,7 +88,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
80
88
|
type: BooleanConstructor;
|
|
81
89
|
default: true;
|
|
82
90
|
};
|
|
83
|
-
|
|
91
|
+
barEdgeOffset: {
|
|
92
|
+
type: NumberConstructor;
|
|
93
|
+
default: number;
|
|
94
|
+
};
|
|
95
|
+
barEdgeOffsetBoundary: {
|
|
96
|
+
type: NumberConstructor;
|
|
97
|
+
default: number;
|
|
98
|
+
};
|
|
99
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "dragEnd" | "dragStart")[], "update:modelValue" | "change" | "dragEnd" | "dragStart", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
84
100
|
min: {
|
|
85
101
|
type: (NumberConstructor | StringConstructor)[];
|
|
86
102
|
default: number;
|
|
@@ -118,11 +134,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
118
134
|
type: BooleanConstructor;
|
|
119
135
|
default: true;
|
|
120
136
|
};
|
|
137
|
+
barEdgeOffset: {
|
|
138
|
+
type: NumberConstructor;
|
|
139
|
+
default: number;
|
|
140
|
+
};
|
|
141
|
+
barEdgeOffsetBoundary: {
|
|
142
|
+
type: NumberConstructor;
|
|
143
|
+
default: number;
|
|
144
|
+
};
|
|
121
145
|
}>> & {
|
|
122
146
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
123
147
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
124
|
-
onDragStart?: ((...args: any[]) => any) | undefined;
|
|
125
148
|
onDragEnd?: ((...args: any[]) => any) | undefined;
|
|
149
|
+
onDragStart?: ((...args: any[]) => any) | undefined;
|
|
126
150
|
}, {
|
|
127
151
|
reverse: boolean;
|
|
128
152
|
range: boolean;
|
|
@@ -132,8 +156,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
132
156
|
direction: SliderDirection;
|
|
133
157
|
modelValue: SliderValue;
|
|
134
158
|
readonly: boolean;
|
|
135
|
-
step: string | number;
|
|
136
159
|
min: string | number;
|
|
160
|
+
step: string | number;
|
|
137
161
|
showPercent: boolean;
|
|
162
|
+
barEdgeOffset: number;
|
|
163
|
+
barEdgeOffsetBoundary: number;
|
|
138
164
|
}, {}>;
|
|
139
165
|
export default _default;
|
package/lib/slider/Slider.js
CHANGED
|
@@ -47,7 +47,10 @@ const sliderProps = {
|
|
|
47
47
|
title: String,
|
|
48
48
|
// 标题跟进度与主体进度条的排列方式
|
|
49
49
|
direction: (0, import_utils.makeStringProp)("horizontal"),
|
|
50
|
-
showPercent: import_utils.truthProp
|
|
50
|
+
showPercent: import_utils.truthProp,
|
|
51
|
+
// 进度条在边缘时,为了防止进度条显示被挤压,对进度条边缘进行扩充,扩充的宽度
|
|
52
|
+
barEdgeOffset: (0, import_utils.makeNumberProp)(4),
|
|
53
|
+
barEdgeOffsetBoundary: (0, import_utils.makeNumberProp)(10)
|
|
51
54
|
};
|
|
52
55
|
var stdin_default = (0, import_vue2.defineComponent)({
|
|
53
56
|
name,
|
|
@@ -73,15 +76,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
73
76
|
};
|
|
74
77
|
});
|
|
75
78
|
const isRange = (val) => props.range && Array.isArray(val);
|
|
79
|
+
function calcBarWidthInEdge(originWidth) {
|
|
80
|
+
if (originWidth < props.barEdgeOffsetBoundary && originWidth > 0) {
|
|
81
|
+
return props.barEdgeOffset + originWidth;
|
|
82
|
+
}
|
|
83
|
+
return originWidth;
|
|
84
|
+
}
|
|
76
85
|
const calcMainAxis = () => {
|
|
77
86
|
const {
|
|
78
87
|
modelValue,
|
|
79
88
|
min
|
|
80
89
|
} = props;
|
|
81
90
|
if (isRange(modelValue)) {
|
|
82
|
-
return `${(modelValue[1] - modelValue[0]) * 100 / scope.value}%`;
|
|
91
|
+
return `${calcBarWidthInEdge(modelValue[1] - modelValue[0]) * 100 / scope.value}%`;
|
|
83
92
|
}
|
|
84
|
-
return `${(modelValue - Number(min)) * 100 / scope.value}%`;
|
|
93
|
+
return `${calcBarWidthInEdge(modelValue - Number(min)) * 100 / scope.value}%`;
|
|
85
94
|
};
|
|
86
95
|
const calcOffset = () => {
|
|
87
96
|
const {
|
|
@@ -89,7 +98,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
89
98
|
min
|
|
90
99
|
} = props;
|
|
91
100
|
if (isRange(modelValue)) {
|
|
92
|
-
|
|
101
|
+
const diff = modelValue[0] - Number(min);
|
|
102
|
+
return `${diff * 100 / scope.value}%`;
|
|
93
103
|
}
|
|
94
104
|
return "0%";
|
|
95
105
|
};
|
package/lib/slider/index.d.ts
CHANGED
|
@@ -36,7 +36,15 @@ export declare const Slider: import("../utils").WithInstall<import("vue").Define
|
|
|
36
36
|
type: BooleanConstructor;
|
|
37
37
|
default: true;
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
barEdgeOffset: {
|
|
40
|
+
type: NumberConstructor;
|
|
41
|
+
default: number;
|
|
42
|
+
};
|
|
43
|
+
barEdgeOffsetBoundary: {
|
|
44
|
+
type: NumberConstructor;
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "dragEnd" | "dragStart")[], "update:modelValue" | "change" | "dragEnd" | "dragStart", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
48
|
min: {
|
|
41
49
|
type: (NumberConstructor | StringConstructor)[];
|
|
42
50
|
default: number;
|
|
@@ -74,11 +82,19 @@ export declare const Slider: import("../utils").WithInstall<import("vue").Define
|
|
|
74
82
|
type: BooleanConstructor;
|
|
75
83
|
default: true;
|
|
76
84
|
};
|
|
85
|
+
barEdgeOffset: {
|
|
86
|
+
type: NumberConstructor;
|
|
87
|
+
default: number;
|
|
88
|
+
};
|
|
89
|
+
barEdgeOffsetBoundary: {
|
|
90
|
+
type: NumberConstructor;
|
|
91
|
+
default: number;
|
|
92
|
+
};
|
|
77
93
|
}>> & {
|
|
78
94
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
79
95
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
80
|
-
onDragStart?: ((...args: any[]) => any) | undefined;
|
|
81
96
|
onDragEnd?: ((...args: any[]) => any) | undefined;
|
|
97
|
+
onDragStart?: ((...args: any[]) => any) | undefined;
|
|
82
98
|
}, {
|
|
83
99
|
reverse: boolean;
|
|
84
100
|
range: boolean;
|
|
@@ -88,9 +104,11 @@ export declare const Slider: import("../utils").WithInstall<import("vue").Define
|
|
|
88
104
|
direction: import("./Slider").SliderDirection;
|
|
89
105
|
modelValue: number | [number, number];
|
|
90
106
|
readonly: boolean;
|
|
91
|
-
step: string | number;
|
|
92
107
|
min: string | number;
|
|
108
|
+
step: string | number;
|
|
93
109
|
showPercent: boolean;
|
|
110
|
+
barEdgeOffset: number;
|
|
111
|
+
barEdgeOffsetBoundary: number;
|
|
94
112
|
}, {}>>;
|
|
95
113
|
export default Slider;
|
|
96
114
|
export { sliderProps } from './Slider';
|
package/lib/stepper/Stepper.d.ts
CHANGED
|
@@ -165,9 +165,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
165
165
|
name: string | number;
|
|
166
166
|
max: string | number;
|
|
167
167
|
disabled: boolean;
|
|
168
|
-
longPress: boolean;
|
|
169
|
-
step: string | number;
|
|
170
168
|
min: string | number;
|
|
169
|
+
step: string | number;
|
|
170
|
+
longPress: boolean;
|
|
171
171
|
integer: boolean;
|
|
172
172
|
showPlus: boolean;
|
|
173
173
|
showMinus: boolean;
|
package/lib/stepper/index.d.ts
CHANGED
|
@@ -110,9 +110,9 @@ export declare const Stepper: import("../utils").WithInstall<import("vue").Defin
|
|
|
110
110
|
name: string | number;
|
|
111
111
|
max: string | number;
|
|
112
112
|
disabled: boolean;
|
|
113
|
-
longPress: boolean;
|
|
114
|
-
step: string | number;
|
|
115
113
|
min: string | number;
|
|
114
|
+
step: string | number;
|
|
115
|
+
longPress: boolean;
|
|
116
116
|
integer: boolean;
|
|
117
117
|
showPlus: boolean;
|
|
118
118
|
showMinus: boolean;
|
package/lib/swipe/Swipe.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
73
73
|
default: true;
|
|
74
74
|
};
|
|
75
75
|
title: ArrayConstructor;
|
|
76
|
-
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "
|
|
76
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "dragEnd" | "dragStart")[], "change" | "dragEnd" | "dragStart", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
77
77
|
loop: {
|
|
78
78
|
type: BooleanConstructor;
|
|
79
79
|
default: true;
|
|
@@ -110,8 +110,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
110
110
|
title: ArrayConstructor;
|
|
111
111
|
}>> & {
|
|
112
112
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
113
|
-
onDragStart?: ((...args: any[]) => any) | undefined;
|
|
114
113
|
onDragEnd?: ((...args: any[]) => any) | undefined;
|
|
114
|
+
onDragStart?: ((...args: any[]) => any) | undefined;
|
|
115
115
|
}, {
|
|
116
116
|
autoplay: string | number;
|
|
117
117
|
loop: boolean;
|
package/lib/swipe/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare const Swipe: import("../utils").WithInstall<import("vue").DefineC
|
|
|
34
34
|
default: true;
|
|
35
35
|
};
|
|
36
36
|
title: ArrayConstructor;
|
|
37
|
-
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "
|
|
37
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "dragEnd" | "dragStart")[], "change" | "dragEnd" | "dragStart", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
38
|
loop: {
|
|
39
39
|
type: BooleanConstructor;
|
|
40
40
|
default: true;
|
|
@@ -71,8 +71,8 @@ export declare const Swipe: import("../utils").WithInstall<import("vue").DefineC
|
|
|
71
71
|
title: ArrayConstructor;
|
|
72
72
|
}>> & {
|
|
73
73
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
74
|
-
onDragStart?: ((...args: any[]) => any) | undefined;
|
|
75
74
|
onDragEnd?: ((...args: any[]) => any) | undefined;
|
|
75
|
+
onDragStart?: ((...args: any[]) => any) | undefined;
|
|
76
76
|
}, {
|
|
77
77
|
autoplay: string | number;
|
|
78
78
|
loop: boolean;
|
package/lib/table/Table.js
CHANGED
|
@@ -38,6 +38,7 @@ var import_icon = require("../icon");
|
|
|
38
38
|
var import_types = require("./types");
|
|
39
39
|
var import_text_ellipsis = __toESM(require("../text-ellipsis"));
|
|
40
40
|
const [name, bem] = (0, import_utils.createNamespace)("table");
|
|
41
|
+
const BODY_CELL_SLOTS_NAME = "bodyCell";
|
|
41
42
|
const tableProps = {
|
|
42
43
|
headList: (0, import_utils.makeArrayProp)(),
|
|
43
44
|
dataList: (0, import_utils.makeArrayProp)(),
|
|
@@ -184,10 +185,20 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
184
185
|
}, null)]) : ""])]);
|
|
185
186
|
}
|
|
186
187
|
};
|
|
187
|
-
const getElement = (rowData, colData) => {
|
|
188
|
+
const getElement = (rowData, colData, rowIndex) => {
|
|
188
189
|
if (rowData[colData.key] && rowData[colData.key].id && slots[`data-${rowData[colData.key].id}`]) {
|
|
189
190
|
return slots[`data-${rowData[colData.key].id}`](rowData[colData.key]);
|
|
190
191
|
}
|
|
192
|
+
const slotProps = {
|
|
193
|
+
column: colData,
|
|
194
|
+
record: rowData,
|
|
195
|
+
text: rowData[colData.key],
|
|
196
|
+
index: rowIndex
|
|
197
|
+
};
|
|
198
|
+
const bodyCellSlots = slots[BODY_CELL_SLOTS_NAME] && slots[BODY_CELL_SLOTS_NAME](slotProps);
|
|
199
|
+
if (bodyCellSlots && bodyCellSlots.length) {
|
|
200
|
+
return bodyCellSlots[0];
|
|
201
|
+
}
|
|
191
202
|
return colData.ellipsis ? (0, import_vue.createVNode)(import_text_ellipsis.default, {
|
|
192
203
|
"content": rowData[colData.key],
|
|
193
204
|
"expandType": "dialog"
|
|
@@ -209,7 +220,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
209
220
|
"colspan": (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.colSpan : null,
|
|
210
221
|
"rowspan": (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.rowSpan : null,
|
|
211
222
|
"style": style
|
|
212
|
-
}, [getElement(rowData, colData)]);
|
|
223
|
+
}, [getElement(rowData, colData, rowIndex)]);
|
|
213
224
|
})]);
|
|
214
225
|
const getCol = () => {
|
|
215
226
|
const cols = [];
|
package/lib/utils/format.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export declare function padZero(num: Numeric, targetLength?: number): string;
|
|
|
11
11
|
export declare const clamp: (num: number, min: number, max: number) => number;
|
|
12
12
|
export declare function formatNumber(value: string, allowDot?: boolean, allowMinus?: boolean): string;
|
|
13
13
|
export declare function addNumber(num1: number, num2: number): number;
|
|
14
|
+
export declare function formatSeconds(value?: string | number): string;
|
package/lib/utils/format.js
CHANGED
|
@@ -22,6 +22,7 @@ __export(stdin_exports, {
|
|
|
22
22
|
camelize: () => camelize,
|
|
23
23
|
clamp: () => clamp,
|
|
24
24
|
formatNumber: () => formatNumber,
|
|
25
|
+
formatSeconds: () => formatSeconds,
|
|
25
26
|
getSizeStyle: () => getSizeStyle,
|
|
26
27
|
getZIndexStyle: () => getZIndexStyle,
|
|
27
28
|
kebabCase: () => kebabCase,
|
|
@@ -137,3 +138,17 @@ function addNumber(num1, num2) {
|
|
|
137
138
|
const cardinal = 10 ** 10;
|
|
138
139
|
return Math.round((num1 + num2) * cardinal) / cardinal;
|
|
139
140
|
}
|
|
141
|
+
function formatSeconds(value = 0) {
|
|
142
|
+
if (!value) {
|
|
143
|
+
return "00:00:00";
|
|
144
|
+
}
|
|
145
|
+
const time = typeof value === "number" ? value : parseInt(value);
|
|
146
|
+
const hours = Math.floor(time / 3600);
|
|
147
|
+
const minutes = Math.floor((time - hours * 3600) / 60);
|
|
148
|
+
const seconds = time - hours * 3600 - minutes * 60;
|
|
149
|
+
let result = "";
|
|
150
|
+
result += ("0" + hours.toString()).slice(-2) + ":";
|
|
151
|
+
result += ("0" + minutes.toString()).slice(-2) + ":";
|
|
152
|
+
result += ("0" + seconds.toString()).slice(-2);
|
|
153
|
+
return result;
|
|
154
|
+
}
|
package/lib/video/Video.js
CHANGED
|
@@ -39,7 +39,7 @@ var import_util = require("../lazyload/vue-lazyload/util");
|
|
|
39
39
|
var import_utils = require("../utils");
|
|
40
40
|
const [name, bem] = (0, import_utils.createNamespace)("video");
|
|
41
41
|
const videoProps = {
|
|
42
|
-
src: (0, import_utils.makeStringProp)("
|
|
42
|
+
src: (0, import_utils.makeStringProp)(""),
|
|
43
43
|
// 控制控制器和标题的显示
|
|
44
44
|
showToolBox: Boolean,
|
|
45
45
|
options: {
|
|
@@ -206,27 +206,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
|
-
const timeFormat = (t = 0) => {
|
|
210
|
-
let h = Math.floor(t / 3600);
|
|
211
|
-
if (+h < 10) {
|
|
212
|
-
h = "0" + h;
|
|
213
|
-
}
|
|
214
|
-
let m = Math.floor(t % 3600 / 60);
|
|
215
|
-
if (+m < 10) {
|
|
216
|
-
m = "0" + m;
|
|
217
|
-
}
|
|
218
|
-
let s = Math.round(t % 3600 % 60);
|
|
219
|
-
if (+s < 10) {
|
|
220
|
-
s = "0" + s;
|
|
221
|
-
}
|
|
222
|
-
let str = "";
|
|
223
|
-
if (h != 0) {
|
|
224
|
-
str = h + ":" + m + ":" + s;
|
|
225
|
-
} else {
|
|
226
|
-
str = m + ":" + s;
|
|
227
|
-
}
|
|
228
|
-
return str;
|
|
229
|
-
};
|
|
230
209
|
const getLoadTime = () => {
|
|
231
210
|
var _a, _b;
|
|
232
211
|
state.videoSet.loaded = (((_a = root.value) == null ? void 0 : _a.buffered.end(0)) || 0) / (((_b = root.value) == null ? void 0 : _b.duration) || 1) * 100;
|
|
@@ -237,8 +216,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
237
216
|
const currentTime = Number.isNaN((_c = root.value) == null ? void 0 : _c.currentTime) ? 0 : (_d = root.value) == null ? void 0 : _d.currentTime;
|
|
238
217
|
const percent = (currentTime || 0) / (durationTime || 1);
|
|
239
218
|
state.videoSet.progress.current = Math.round(state.videoSet.progress.width * percent);
|
|
240
|
-
state.videoSet.totalTime =
|
|
241
|
-
state.videoSet.displayTime =
|
|
219
|
+
state.videoSet.totalTime = (0, import_utils.formatSeconds)(durationTime);
|
|
220
|
+
state.videoSet.displayTime = (0, import_utils.formatSeconds)((_e = root.value) == null ? void 0 : _e.currentTime);
|
|
242
221
|
emit("time", currentTime, durationTime, state.videoSet.displayTime, state.videoSet.totalTime);
|
|
243
222
|
};
|
|
244
223
|
const playEnded = () => {
|