@ezuikit/player-theme 1.0.0-beta.1 → 1.0.0
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/dist/index.js +38 -17
- package/dist/index.mjs +38 -17
- package/dist/index.umd.js +620 -183
- package/dist/style.css +1 -1
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v1.0.0
|
|
3
|
-
* Copyright (c) 2025-
|
|
2
|
+
* @ezuikit/player-theme v1.0.0
|
|
3
|
+
* Copyright (c) 2025-11-03 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
@@ -188,6 +188,7 @@ const EVENTS = {
|
|
|
188
188
|
/** 日期改变 */ dateChange: 'Control.dateChange',
|
|
189
189
|
/** 日期销毁 */ dateDestroy: 'Control.datePanelDestroy',
|
|
190
190
|
/** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
|
|
191
|
+
/** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
|
|
191
192
|
/** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
|
|
192
193
|
/** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
|
|
193
194
|
/** 主题控件挂载完成, 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ mountedControls: 'Control.mountedControls',
|
|
@@ -3703,6 +3704,14 @@ function debounce(func, wait) {
|
|
|
3703
3704
|
theme.controls.timeLineControl.on(EVENTS.control.timeLineChange, (date)=>{
|
|
3704
3705
|
theme.emit(EVENTS.control.timeLineChange, date);
|
|
3705
3706
|
});
|
|
3707
|
+
theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, (open)=>{
|
|
3708
|
+
var _theme_controls_dateControl;
|
|
3709
|
+
if ((_theme_controls_dateControl = theme.controls.dateControl) == null ? void 0 : _theme_controls_dateControl.dataPickerUtil) {
|
|
3710
|
+
var _theme_controls_dateControl_dataPickerUtil, _theme_controls_dateControl1;
|
|
3711
|
+
(_theme_controls_dateControl1 = theme.controls.dateControl) == null ? void 0 : (_theme_controls_dateControl_dataPickerUtil = _theme_controls_dateControl1.dataPickerUtil) == null ? void 0 : _theme_controls_dateControl_dataPickerUtil.hide();
|
|
3712
|
+
}
|
|
3713
|
+
theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
|
|
3714
|
+
});
|
|
3706
3715
|
theme.controls.timeLineControl.on(EVENTS.control.timeLineDestroy, ()=>{
|
|
3707
3716
|
theme.emit(EVENTS.control.timeLineDestroy);
|
|
3708
3717
|
});
|
|
@@ -7009,7 +7018,7 @@ const DEFAULT_OPTIONS = {
|
|
|
7009
7018
|
};
|
|
7010
7019
|
/**
|
|
7011
7020
|
* 日期选择器
|
|
7012
|
-
*/
|
|
7021
|
+
*/ class DatePicker {
|
|
7013
7022
|
_init() {
|
|
7014
7023
|
// 因为挂载在行内,需要父标签设置 position: relative;
|
|
7015
7024
|
this.$container.style.cssText += `;position: relative;`;
|
|
@@ -7137,7 +7146,7 @@ const DEFAULT_OPTIONS = {
|
|
|
7137
7146
|
}
|
|
7138
7147
|
});
|
|
7139
7148
|
}
|
|
7140
|
-
}
|
|
7149
|
+
}
|
|
7141
7150
|
|
|
7142
7151
|
/**
|
|
7143
7152
|
* @description 时间操作
|
|
@@ -7300,7 +7309,7 @@ function _extends$5() {
|
|
|
7300
7309
|
/**
|
|
7301
7310
|
* 日历选择器控件
|
|
7302
7311
|
* @category Control
|
|
7303
|
-
*/ class
|
|
7312
|
+
*/ class DatePickerControl extends Control {
|
|
7304
7313
|
_render() {
|
|
7305
7314
|
if (utilsTools.isMobile()) {
|
|
7306
7315
|
var _this_locale;
|
|
@@ -7315,7 +7324,7 @@ function _extends$5() {
|
|
|
7315
7324
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
|
|
7316
7325
|
});
|
|
7317
7326
|
}
|
|
7318
|
-
this.dataPickerUtil = new DatePicker
|
|
7327
|
+
this.dataPickerUtil = new DatePicker(this.$container, {
|
|
7319
7328
|
staticPath: this.options.staticPath,
|
|
7320
7329
|
language: this.options.language === 'zh' ? 'zh-CN' : 'en-US',
|
|
7321
7330
|
current: new Date(this._value + ' 00:00:00'),
|
|
@@ -7407,10 +7416,16 @@ function _extends$4() {
|
|
|
7407
7416
|
_render() {
|
|
7408
7417
|
var _this_timeLineUtil_updateTimeSections, _this_timeLineUtil;
|
|
7409
7418
|
const _timeLineOptions = {
|
|
7410
|
-
|
|
7419
|
+
language: this._options.language || 'zh',
|
|
7420
|
+
coverQuery: this._options.coverQuery || '',
|
|
7411
7421
|
onChange: (date)=>{
|
|
7412
|
-
this.
|
|
7413
|
-
|
|
7422
|
+
if (this._currentTime !== (date == null ? void 0 : date.getTime())) {
|
|
7423
|
+
this._options.onChange == null ? void 0 : this._options.onChange.call(this._options, date);
|
|
7424
|
+
this.emit(EVENTS.control.timeLineChange, date);
|
|
7425
|
+
}
|
|
7426
|
+
},
|
|
7427
|
+
onPickerOpenChange: (open)=>{
|
|
7428
|
+
this.emit(EVENTS.control.timeLinePanelOpenChange, open);
|
|
7414
7429
|
},
|
|
7415
7430
|
// 2025-10-27 仅移动端支持
|
|
7416
7431
|
onPickerSelect: (item)=>{
|
|
@@ -7486,7 +7501,8 @@ function _extends$4() {
|
|
|
7486
7501
|
tagName: 'div',
|
|
7487
7502
|
controlType: 'block',
|
|
7488
7503
|
classNameSuffix: 'time-line'
|
|
7489
|
-
})), this._$add = null, this._$reduce = null, this.records = [];
|
|
7504
|
+
})), this._$add = null, this._$reduce = null, this._currentTime = 0, this.records = [];
|
|
7505
|
+
this._currentTime = 0;
|
|
7490
7506
|
this._options = options;
|
|
7491
7507
|
this.records = ((_this__options = this._options) == null ? void 0 : (_this__options_props = _this__options.props) == null ? void 0 : _this__options_props.recordList) || [];
|
|
7492
7508
|
this._render();
|
|
@@ -7497,9 +7513,13 @@ function _extends$4() {
|
|
|
7497
7513
|
(_this_timeLineUtil = this.timeLineUtil) == null ? void 0 : (_this_timeLineUtil_updateTimeSections = _this_timeLineUtil.updateTimeSections) == null ? void 0 : _this_timeLineUtil_updateTimeSections.call(_this_timeLineUtil, records);
|
|
7498
7514
|
});
|
|
7499
7515
|
this.on(EVENTS.getOSDTime, (time)=>{
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7516
|
+
if (time) {
|
|
7517
|
+
var // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7518
|
+
_this_timeLineUtil_update, _this_timeLineUtil;
|
|
7519
|
+
const date = new Date(time * 1000);
|
|
7520
|
+
this._currentTime = date.getTime();
|
|
7521
|
+
(_this_timeLineUtil = this.timeLineUtil) == null ? void 0 : (_this_timeLineUtil_update = _this_timeLineUtil.update) == null ? void 0 : _this_timeLineUtil_update.call(_this_timeLineUtil, date);
|
|
7522
|
+
}
|
|
7503
7523
|
});
|
|
7504
7524
|
}
|
|
7505
7525
|
}
|
|
@@ -7565,7 +7585,7 @@ const Controls = {
|
|
|
7565
7585
|
globalFullscreen: GlobalFullscreen,
|
|
7566
7586
|
rec: Rec,
|
|
7567
7587
|
speed: Speed,
|
|
7568
|
-
date:
|
|
7588
|
+
date: DatePickerControl,
|
|
7569
7589
|
timeLine: TimeLineControl
|
|
7570
7590
|
};
|
|
7571
7591
|
|
|
@@ -8135,12 +8155,13 @@ function _renderTheme(theme, data) {
|
|
|
8135
8155
|
}
|
|
8136
8156
|
const _renderTimeLine = (theme, container, props = {})=>{
|
|
8137
8157
|
if (!theme.controls.timeLineControl && theme.options.timeLineOptions !== null) {
|
|
8138
|
-
var _theme_options;
|
|
8158
|
+
var _theme_urlInfo, _theme_options;
|
|
8139
8159
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
8140
8160
|
theme.controls.timeLineControl = new Controls['timeLine'](_extends$1({
|
|
8141
8161
|
getPopupContainer: ()=>container,
|
|
8142
8162
|
language: theme.options.language,
|
|
8143
|
-
locales: theme.i18n.translations
|
|
8163
|
+
locales: theme.i18n.translations,
|
|
8164
|
+
coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? `decodekey=${theme.urlInfo.validateCode}` : ''
|
|
8144
8165
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options[`timeLineOptions`]) || {}, {
|
|
8145
8166
|
props
|
|
8146
8167
|
}));
|
|
@@ -9347,7 +9368,7 @@ const THEME_DEFAULT_OPTIONS = {
|
|
|
9347
9368
|
zh,
|
|
9348
9369
|
en
|
|
9349
9370
|
};
|
|
9350
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '1.0.0
|
|
9371
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '1.0.0';
|
|
9351
9372
|
|
|
9352
9373
|
exports.Control = Control;
|
|
9353
9374
|
exports.Fullscreen = Fullscreen;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v1.0.0
|
|
3
|
-
* Copyright (c) 2025-
|
|
2
|
+
* @ezuikit/player-theme v1.0.0
|
|
3
|
+
* Copyright (c) 2025-11-03 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import EventEmitter from 'eventemitter3';
|
|
@@ -184,6 +184,7 @@ const EVENTS = {
|
|
|
184
184
|
/** 日期改变 */ dateChange: 'Control.dateChange',
|
|
185
185
|
/** 日期销毁 */ dateDestroy: 'Control.datePanelDestroy',
|
|
186
186
|
/** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
|
|
187
|
+
/** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
|
|
187
188
|
/** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
|
|
188
189
|
/** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
|
|
189
190
|
/** 主题控件挂载完成, 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ mountedControls: 'Control.mountedControls',
|
|
@@ -3699,6 +3700,14 @@ function debounce(func, wait) {
|
|
|
3699
3700
|
theme.controls.timeLineControl.on(EVENTS.control.timeLineChange, (date)=>{
|
|
3700
3701
|
theme.emit(EVENTS.control.timeLineChange, date);
|
|
3701
3702
|
});
|
|
3703
|
+
theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, (open)=>{
|
|
3704
|
+
var _theme_controls_dateControl;
|
|
3705
|
+
if ((_theme_controls_dateControl = theme.controls.dateControl) == null ? void 0 : _theme_controls_dateControl.dataPickerUtil) {
|
|
3706
|
+
var _theme_controls_dateControl_dataPickerUtil, _theme_controls_dateControl1;
|
|
3707
|
+
(_theme_controls_dateControl1 = theme.controls.dateControl) == null ? void 0 : (_theme_controls_dateControl_dataPickerUtil = _theme_controls_dateControl1.dataPickerUtil) == null ? void 0 : _theme_controls_dateControl_dataPickerUtil.hide();
|
|
3708
|
+
}
|
|
3709
|
+
theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
|
|
3710
|
+
});
|
|
3702
3711
|
theme.controls.timeLineControl.on(EVENTS.control.timeLineDestroy, ()=>{
|
|
3703
3712
|
theme.emit(EVENTS.control.timeLineDestroy);
|
|
3704
3713
|
});
|
|
@@ -7005,7 +7014,7 @@ const DEFAULT_OPTIONS = {
|
|
|
7005
7014
|
};
|
|
7006
7015
|
/**
|
|
7007
7016
|
* 日期选择器
|
|
7008
|
-
*/
|
|
7017
|
+
*/ class DatePicker {
|
|
7009
7018
|
_init() {
|
|
7010
7019
|
// 因为挂载在行内,需要父标签设置 position: relative;
|
|
7011
7020
|
this.$container.style.cssText += `;position: relative;`;
|
|
@@ -7133,7 +7142,7 @@ const DEFAULT_OPTIONS = {
|
|
|
7133
7142
|
}
|
|
7134
7143
|
});
|
|
7135
7144
|
}
|
|
7136
|
-
}
|
|
7145
|
+
}
|
|
7137
7146
|
|
|
7138
7147
|
/**
|
|
7139
7148
|
* @description 时间操作
|
|
@@ -7296,7 +7305,7 @@ function _extends$5() {
|
|
|
7296
7305
|
/**
|
|
7297
7306
|
* 日历选择器控件
|
|
7298
7307
|
* @category Control
|
|
7299
|
-
*/ class
|
|
7308
|
+
*/ class DatePickerControl extends Control {
|
|
7300
7309
|
_render() {
|
|
7301
7310
|
if (isMobile()) {
|
|
7302
7311
|
var _this_locale;
|
|
@@ -7311,7 +7320,7 @@ function _extends$5() {
|
|
|
7311
7320
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
|
|
7312
7321
|
});
|
|
7313
7322
|
}
|
|
7314
|
-
this.dataPickerUtil = new DatePicker
|
|
7323
|
+
this.dataPickerUtil = new DatePicker(this.$container, {
|
|
7315
7324
|
staticPath: this.options.staticPath,
|
|
7316
7325
|
language: this.options.language === 'zh' ? 'zh-CN' : 'en-US',
|
|
7317
7326
|
current: new Date(this._value + ' 00:00:00'),
|
|
@@ -7403,10 +7412,16 @@ function _extends$4() {
|
|
|
7403
7412
|
_render() {
|
|
7404
7413
|
var _this_timeLineUtil_updateTimeSections, _this_timeLineUtil;
|
|
7405
7414
|
const _timeLineOptions = {
|
|
7406
|
-
|
|
7415
|
+
language: this._options.language || 'zh',
|
|
7416
|
+
coverQuery: this._options.coverQuery || '',
|
|
7407
7417
|
onChange: (date)=>{
|
|
7408
|
-
this.
|
|
7409
|
-
|
|
7418
|
+
if (this._currentTime !== (date == null ? void 0 : date.getTime())) {
|
|
7419
|
+
this._options.onChange == null ? void 0 : this._options.onChange.call(this._options, date);
|
|
7420
|
+
this.emit(EVENTS.control.timeLineChange, date);
|
|
7421
|
+
}
|
|
7422
|
+
},
|
|
7423
|
+
onPickerOpenChange: (open)=>{
|
|
7424
|
+
this.emit(EVENTS.control.timeLinePanelOpenChange, open);
|
|
7410
7425
|
},
|
|
7411
7426
|
// 2025-10-27 仅移动端支持
|
|
7412
7427
|
onPickerSelect: (item)=>{
|
|
@@ -7482,7 +7497,8 @@ function _extends$4() {
|
|
|
7482
7497
|
tagName: 'div',
|
|
7483
7498
|
controlType: 'block',
|
|
7484
7499
|
classNameSuffix: 'time-line'
|
|
7485
|
-
})), this._$add = null, this._$reduce = null, this.records = [];
|
|
7500
|
+
})), this._$add = null, this._$reduce = null, this._currentTime = 0, this.records = [];
|
|
7501
|
+
this._currentTime = 0;
|
|
7486
7502
|
this._options = options;
|
|
7487
7503
|
this.records = ((_this__options = this._options) == null ? void 0 : (_this__options_props = _this__options.props) == null ? void 0 : _this__options_props.recordList) || [];
|
|
7488
7504
|
this._render();
|
|
@@ -7493,9 +7509,13 @@ function _extends$4() {
|
|
|
7493
7509
|
(_this_timeLineUtil = this.timeLineUtil) == null ? void 0 : (_this_timeLineUtil_updateTimeSections = _this_timeLineUtil.updateTimeSections) == null ? void 0 : _this_timeLineUtil_updateTimeSections.call(_this_timeLineUtil, records);
|
|
7494
7510
|
});
|
|
7495
7511
|
this.on(EVENTS.getOSDTime, (time)=>{
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7512
|
+
if (time) {
|
|
7513
|
+
var // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7514
|
+
_this_timeLineUtil_update, _this_timeLineUtil;
|
|
7515
|
+
const date = new Date(time * 1000);
|
|
7516
|
+
this._currentTime = date.getTime();
|
|
7517
|
+
(_this_timeLineUtil = this.timeLineUtil) == null ? void 0 : (_this_timeLineUtil_update = _this_timeLineUtil.update) == null ? void 0 : _this_timeLineUtil_update.call(_this_timeLineUtil, date);
|
|
7518
|
+
}
|
|
7499
7519
|
});
|
|
7500
7520
|
}
|
|
7501
7521
|
}
|
|
@@ -7561,7 +7581,7 @@ const Controls = {
|
|
|
7561
7581
|
globalFullscreen: GlobalFullscreen,
|
|
7562
7582
|
rec: Rec,
|
|
7563
7583
|
speed: Speed,
|
|
7564
|
-
date:
|
|
7584
|
+
date: DatePickerControl,
|
|
7565
7585
|
timeLine: TimeLineControl
|
|
7566
7586
|
};
|
|
7567
7587
|
|
|
@@ -8131,12 +8151,13 @@ function _renderTheme(theme, data) {
|
|
|
8131
8151
|
}
|
|
8132
8152
|
const _renderTimeLine = (theme, container, props = {})=>{
|
|
8133
8153
|
if (!theme.controls.timeLineControl && theme.options.timeLineOptions !== null) {
|
|
8134
|
-
var _theme_options;
|
|
8154
|
+
var _theme_urlInfo, _theme_options;
|
|
8135
8155
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
8136
8156
|
theme.controls.timeLineControl = new Controls['timeLine'](_extends$1({
|
|
8137
8157
|
getPopupContainer: ()=>container,
|
|
8138
8158
|
language: theme.options.language,
|
|
8139
|
-
locales: theme.i18n.translations
|
|
8159
|
+
locales: theme.i18n.translations,
|
|
8160
|
+
coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? `decodekey=${theme.urlInfo.validateCode}` : ''
|
|
8140
8161
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options[`timeLineOptions`]) || {}, {
|
|
8141
8162
|
props
|
|
8142
8163
|
}));
|
|
@@ -9343,6 +9364,6 @@ const THEME_DEFAULT_OPTIONS = {
|
|
|
9343
9364
|
zh,
|
|
9344
9365
|
en
|
|
9345
9366
|
};
|
|
9346
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '1.0.0
|
|
9367
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '1.0.0';
|
|
9347
9368
|
|
|
9348
9369
|
export { Control, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume, Theme as default };
|