@ezuikit/player-theme 2.0.3-beta.2 → 2.1.0-beta.10
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 +40 -1
- package/dist/constant.js +2 -2
- package/dist/index.js +187 -160
- package/dist/index.mjs +187 -160
- package/dist/index.umd.js +283 -520
- package/dist/style.css +4 -4
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +14 -33
- package/package.json +20 -4
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.0
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* @ezuikit/player-theme v2.1.0-beta.10
|
|
3
|
+
* Copyright (c) 2026-01-14 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import EventEmitter from 'eventemitter3';
|
|
@@ -1909,7 +1909,10 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1909
1909
|
if (this._lastVolume !== _volume) {
|
|
1910
1910
|
this._volume = _volume;
|
|
1911
1911
|
this._lastVolume = this._volume;
|
|
1912
|
-
if (this._progress)
|
|
1912
|
+
if (this._progress) {
|
|
1913
|
+
// 静音时进度条为 0
|
|
1914
|
+
this._progress.value = this._muted ? 0 : _volume;
|
|
1915
|
+
}
|
|
1913
1916
|
this._options.onChange == null ? void 0 : this._options.onChange.call(this._options, _volume, this._muted);
|
|
1914
1917
|
this.emit(EVENTS.control.volumechange, _volume, this._muted);
|
|
1915
1918
|
}
|
|
@@ -3184,7 +3187,14 @@ var en = {
|
|
|
3184
3187
|
{
|
|
3185
3188
|
iconId: 'volume',
|
|
3186
3189
|
part: 'left',
|
|
3187
|
-
defaultActive:
|
|
3190
|
+
defaultActive: 0,
|
|
3191
|
+
isrender: 1
|
|
3192
|
+
},
|
|
3193
|
+
{
|
|
3194
|
+
// flv 录制 2.1.0 新增
|
|
3195
|
+
iconId: 'record',
|
|
3196
|
+
part: 'left',
|
|
3197
|
+
defaultActive: 0,
|
|
3188
3198
|
isrender: 1
|
|
3189
3199
|
},
|
|
3190
3200
|
{
|
|
@@ -3727,7 +3737,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3727
3737
|
_inherits$j(Content, EventEmitter);
|
|
3728
3738
|
function Content(options) {
|
|
3729
3739
|
var _this;
|
|
3730
|
-
_this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
|
|
3740
|
+
_this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._cleanUpResizeObserver = null, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
|
|
3731
3741
|
_this.options = options;
|
|
3732
3742
|
_this._scaleMode = options.scaleMode || 0;
|
|
3733
3743
|
_this.$wrapper = document.createElement('div');
|
|
@@ -3743,11 +3753,12 @@ function _set_prototype_of$j(o, p) {
|
|
|
3743
3753
|
$popupContainer.appendChild(_this.$wrapper);
|
|
3744
3754
|
}
|
|
3745
3755
|
_this.on(EVENTS.videoInfo, function(originWidth, originHeight) {
|
|
3746
|
-
_this.
|
|
3747
|
-
});
|
|
3748
|
-
_this.on(EVENTS.resize, function() {
|
|
3749
|
-
_this._rerender();
|
|
3756
|
+
_this.rerender(originWidth, originHeight);
|
|
3750
3757
|
});
|
|
3758
|
+
// prettier-ignore
|
|
3759
|
+
_this._cleanUpResizeObserver = Utils.resizeObserver(_this.$wrapper, throttle(function() {
|
|
3760
|
+
_this.rerender();
|
|
3761
|
+
}, 20));
|
|
3751
3762
|
return _this;
|
|
3752
3763
|
}
|
|
3753
3764
|
var _proto = Content.prototype;
|
|
@@ -3756,7 +3767,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3756
3767
|
* @param {number} originWidth 画面宽度
|
|
3757
3768
|
* @param {number} originHeight 画面高度
|
|
3758
3769
|
* @returns {void}
|
|
3759
|
-
*/ _proto.
|
|
3770
|
+
*/ _proto.rerender = function rerender(originWidth, originHeight) {
|
|
3760
3771
|
if (originWidth === void 0) originWidth = 0;
|
|
3761
3772
|
if (originHeight === void 0) originHeight = 0;
|
|
3762
3773
|
var width = this.$wrapper.clientWidth;
|
|
@@ -3780,6 +3791,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3780
3791
|
if (this._scaleMode === THEME_SCALE_MODE_TYPE.fullAuto) {
|
|
3781
3792
|
objectFill = 'cover';
|
|
3782
3793
|
}
|
|
3794
|
+
// 容器和视频的分辨率都需要有值才能计算
|
|
3783
3795
|
if (width > 0 && height > 0 && this._originWidth > 0 && this._originHeight > 0 && this.$video) {
|
|
3784
3796
|
var left = (width - this._originWidth) / 2;
|
|
3785
3797
|
var top = (height - this._originHeight) / 2;
|
|
@@ -3809,10 +3821,14 @@ function _set_prototype_of$j(o, p) {
|
|
|
3809
3821
|
_proto.setScaleMode = function setScaleMode(scaleMode) {
|
|
3810
3822
|
if (scaleMode === void 0) scaleMode = 0;
|
|
3811
3823
|
this._scaleMode = scaleMode;
|
|
3812
|
-
this.
|
|
3824
|
+
this.rerender();
|
|
3813
3825
|
};
|
|
3814
3826
|
_proto.destroy = function destroy() {
|
|
3815
3827
|
var _this_$wrapper;
|
|
3828
|
+
if (this._cleanUpResizeObserver) {
|
|
3829
|
+
this._cleanUpResizeObserver.unobserve == null ? void 0 : this._cleanUpResizeObserver.unobserve.call(this._cleanUpResizeObserver);
|
|
3830
|
+
this._cleanUpResizeObserver = null;
|
|
3831
|
+
}
|
|
3816
3832
|
if (this.$video) {
|
|
3817
3833
|
this.$video.remove();
|
|
3818
3834
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -3917,11 +3933,13 @@ function _set_prototype_of$i(o, p) {
|
|
|
3917
3933
|
/**
|
|
3918
3934
|
* 添加
|
|
3919
3935
|
* @param control
|
|
3920
|
-
*/ _proto.add = function add(key, part, control) {
|
|
3936
|
+
*/ _proto.add = function add(key, part, control, props) {
|
|
3921
3937
|
this.list.unshift({
|
|
3922
3938
|
part: part,
|
|
3923
3939
|
key: key,
|
|
3924
|
-
control: control
|
|
3940
|
+
control: control,
|
|
3941
|
+
width: props.width,
|
|
3942
|
+
height: props.height
|
|
3925
3943
|
});
|
|
3926
3944
|
};
|
|
3927
3945
|
/**
|
|
@@ -4380,12 +4398,6 @@ function debounce(func, wait) {
|
|
|
4380
4398
|
theme.emit(EVENTS.control.recDestroy);
|
|
4381
4399
|
});
|
|
4382
4400
|
}
|
|
4383
|
-
// content
|
|
4384
|
-
if (theme.contentControl) {
|
|
4385
|
-
theme.contentControl.on(EVENTS.control.contentRerender, function(info) {
|
|
4386
|
-
theme.emit(EVENTS.control.contentRerender, info);
|
|
4387
|
-
});
|
|
4388
|
-
}
|
|
4389
4401
|
}
|
|
4390
4402
|
var ignoreList = [
|
|
4391
4403
|
EVENTS.getOSDTime,
|
|
@@ -8707,7 +8719,7 @@ function _set_prototype_of$6(o, p) {
|
|
|
8707
8719
|
],
|
|
8708
8720
|
badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
|
|
8709
8721
|
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
8710
|
-
current:
|
|
8722
|
+
current: DateTime.toDate(this._value),
|
|
8711
8723
|
placement: 'tr',
|
|
8712
8724
|
triggerClose: true,
|
|
8713
8725
|
disabledDate: function(date) {
|
|
@@ -9628,7 +9640,7 @@ function _renderControls(theme, $container, btnList, props) {
|
|
|
9628
9640
|
}
|
|
9629
9641
|
function _renderTheme(theme, data) {
|
|
9630
9642
|
return _async_to_generator$1(function() {
|
|
9631
|
-
var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4,
|
|
9643
|
+
var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1;
|
|
9632
9644
|
return _ts_generator$1(this, function(_state) {
|
|
9633
9645
|
switch(_state.label){
|
|
9634
9646
|
case 0:
|
|
@@ -9790,26 +9802,23 @@ function _renderTheme(theme, data) {
|
|
|
9790
9802
|
hasPtz = list.some(function(item) {
|
|
9791
9803
|
return item.iconId === 'ptz';
|
|
9792
9804
|
});
|
|
9793
|
-
if (
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
}
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
}
|
|
9811
|
-
if (Utils.isMobile && ((_theme_options_mobileExtendOptions4 = theme.options.mobileExtendOptions) == null ? void 0 : (_theme_options_mobileExtendOptions_controls1 = _theme_options_mobileExtendOptions4.controls) == null ? void 0 : _theme_options_mobileExtendOptions_controls1.includes('ptz')) && hasPtz && theme.controls.ptzControl) {
|
|
9812
|
-
theme.controls.ptzControl.renderMobileExtend(theme._mobileExtend.$content);
|
|
9805
|
+
if (hasPtz || _needTimeLine) {
|
|
9806
|
+
theme._mobileExtend = new MobileExtend(theme.$container);
|
|
9807
|
+
if (theme.options.dateOptions !== null && ((_theme_options_mobileExtendOptions1 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions1.controls.includes('date')) && _needTimeLine) {
|
|
9808
|
+
_renderDatePicker(theme, theme._mobileExtend.$topLeft, props);
|
|
9809
|
+
}
|
|
9810
|
+
if (theme.options.recOptions !== null && ((_theme_options_mobileExtendOptions2 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions2.controls.includes('rec')) && _needTimeLine) {
|
|
9811
|
+
[].concat(((_filterThemeData_header1 = filterThemeData.header) == null ? void 0 : _filterThemeData_header1.btnList) || [], (_filterThemeData_footer_btnList1 = (_filterThemeData_footer1 = filterThemeData.footer) == null ? void 0 : _filterThemeData_footer1.btnList) != null ? _filterThemeData_footer_btnList1 : []).forEach(function(item) {
|
|
9812
|
+
var _theme__mobileExtend;
|
|
9813
|
+
if (REC_GROUP.includes(item.iconId)) _renderRecType(theme, (_theme__mobileExtend = theme._mobileExtend) == null ? void 0 : _theme__mobileExtend.$topRight, item.iconId, props);
|
|
9814
|
+
});
|
|
9815
|
+
}
|
|
9816
|
+
if ((theme.options.timeLineOptions !== null || !theme.options.disabledTimeLine) && ((_theme_options_mobileExtendOptions3 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions3.controls.includes('timeLine')) && _needTimeLine) {
|
|
9817
|
+
_renderTimeLine(theme, theme._mobileExtend.$content, props);
|
|
9818
|
+
}
|
|
9819
|
+
if (Utils.isMobile && ((_theme_options_mobileExtendOptions4 = theme.options.mobileExtendOptions) == null ? void 0 : (_theme_options_mobileExtendOptions_controls1 = _theme_options_mobileExtendOptions4.controls) == null ? void 0 : _theme_options_mobileExtendOptions_controls1.includes('ptz')) && hasPtz && theme.controls.ptzControl) {
|
|
9820
|
+
theme.controls.ptzControl.renderMobileExtend(theme._mobileExtend.$content);
|
|
9821
|
+
}
|
|
9813
9822
|
}
|
|
9814
9823
|
}
|
|
9815
9824
|
theme.emit(EVENTS.control.mountedControls);
|
|
@@ -10186,6 +10195,9 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10186
10195
|
},
|
|
10187
10196
|
scaleMode: _this.scaleMode
|
|
10188
10197
|
});
|
|
10198
|
+
_this.contentControl.on(EVENTS.control.contentRerender, function(info) {
|
|
10199
|
+
_this.emit(EVENTS.control.contentRerender, info);
|
|
10200
|
+
});
|
|
10189
10201
|
// zoom utils
|
|
10190
10202
|
__zoom(_this, _this.contentControl.$content, _extends({}, _this.options.zoomOptions || {}, {
|
|
10191
10203
|
onTap: function() {
|
|
@@ -10736,138 +10748,153 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10736
10748
|
* 尺寸变化结束时 进行判断,为了节省开销
|
|
10737
10749
|
* @WARN:这里会闪一下, 原因:需要控件渲染后才知是否需要放置到 More 中,
|
|
10738
10750
|
*/ _proto._footerMoreControlShow = function _footerMoreControlShow() {
|
|
10751
|
+
this._displayMore();
|
|
10752
|
+
};
|
|
10753
|
+
_proto._displayMore = function _displayMore() {
|
|
10739
10754
|
var _this = this;
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
|
|
10768
|
-
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
10769
|
-
}
|
|
10770
|
-
});
|
|
10771
|
-
}
|
|
10772
|
-
//
|
|
10773
|
-
var list = (((_this__themeData = _this._themeData) == null ? void 0 : (_this__themeData_footer = _this__themeData.footer) == null ? void 0 : _this__themeData_footer.btnList) || []).filter(function(item) {
|
|
10774
|
-
var _this__footerMoreControl;
|
|
10775
|
-
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
10776
|
-
var _this_controls;
|
|
10777
|
-
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
10778
|
-
});
|
|
10779
|
-
return index === -1;
|
|
10780
|
-
});
|
|
10781
|
-
if (list.length <= 0) {
|
|
10782
|
-
return;
|
|
10783
|
-
}
|
|
10784
|
-
if (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
10785
|
-
// 为什么是两个, 因为More 也占用一个位置
|
|
10786
|
-
var popList = [
|
|
10787
|
-
list.pop(),
|
|
10788
|
-
list.pop()
|
|
10789
|
-
];
|
|
10790
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
10791
|
-
var item = _step.value;
|
|
10792
|
-
if (item) {
|
|
10793
|
-
var _this_controls_key_resetPopupContainer, _this_controls_key, _this_controls, _this_controls1, _this__footerMoreControl2;
|
|
10794
|
-
var key = "" + item.iconId + "Control";
|
|
10795
|
-
(_this_controls = _this.controls) == null ? void 0 : (_this_controls_key = _this_controls[key]) == null ? void 0 : (_this_controls_key_resetPopupContainer = _this_controls_key.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer.call(_this_controls_key, _this._footerMoreControl.$panel, 'prepend');
|
|
10796
|
-
(_this__footerMoreControl2 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls1 = _this.controls) == null ? void 0 : _this_controls1[key]);
|
|
10797
|
-
}
|
|
10755
|
+
if (this._footer) {
|
|
10756
|
+
var _this__footer_$left, _this__footer_$right;
|
|
10757
|
+
// 判断 footer 的控件是否能放置的下, 否则隐藏暂时 more 按钮
|
|
10758
|
+
var leftWidth = ((_this__footer_$left = this._footer.$left) == null ? void 0 : _this__footer_$left.clientWidth) || 0;
|
|
10759
|
+
var rightWidth = ((_this__footer_$right = this._footer.$right) == null ? void 0 : _this__footer_$right.clientWidth) || 0;
|
|
10760
|
+
// 当footer 中 left 和 right 宽度之和大于 footer 宽度,则 footer more 显示
|
|
10761
|
+
var collapseControl = this._width - leftWidth - rightWidth < 16; // 收拢控件到 More 中
|
|
10762
|
+
if (collapseControl) {
|
|
10763
|
+
var _this__footer, _this__themeData_footer, _this__themeData, _this__footerMoreControl_list, _this__footerMoreControl, _this__footerMoreControl_list1, _this__footerMoreControl1;
|
|
10764
|
+
if (!this._footerMoreControl && ((_this__footer = this._footer) == null ? void 0 : _this__footer.$right)) {
|
|
10765
|
+
this._footerMoreControl = new More({
|
|
10766
|
+
language: this.options.language,
|
|
10767
|
+
locales: this.i18n.translations,
|
|
10768
|
+
rootContainer: this.$container,
|
|
10769
|
+
getPopupContainer: function() {
|
|
10770
|
+
var _this__footer;
|
|
10771
|
+
return (_this__footer = _this._footer) == null ? void 0 : _this__footer.$right;
|
|
10772
|
+
},
|
|
10773
|
+
placement: 'tr',
|
|
10774
|
+
controls: this.controls,
|
|
10775
|
+
open: false,
|
|
10776
|
+
offset: [
|
|
10777
|
+
0,
|
|
10778
|
+
-8
|
|
10779
|
+
],
|
|
10780
|
+
wrapClassName: "" + PREFIX_CLASS + "-footer-more",
|
|
10781
|
+
onOpenChange: function(open) {
|
|
10782
|
+
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
10798
10783
|
}
|
|
10799
|
-
}
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10784
|
+
});
|
|
10785
|
+
}
|
|
10786
|
+
//
|
|
10787
|
+
var list = (((_this__themeData = this._themeData) == null ? void 0 : (_this__themeData_footer = _this__themeData.footer) == null ? void 0 : _this__themeData_footer.btnList) || []).filter(function(item) {
|
|
10788
|
+
var _this__footerMoreControl;
|
|
10789
|
+
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
10790
|
+
var _this_controls;
|
|
10791
|
+
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
10792
|
+
});
|
|
10793
|
+
return index === -1;
|
|
10794
|
+
});
|
|
10795
|
+
if (list.length <= 0) return;
|
|
10796
|
+
if (((_this__footerMoreControl = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
10797
|
+
// 为什么是两个, 因为More 也占用一个位置
|
|
10798
|
+
var popList = [
|
|
10799
|
+
list.pop(),
|
|
10800
|
+
list.pop()
|
|
10801
|
+
];
|
|
10802
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
10803
|
+
var item = _step.value;
|
|
10804
|
+
if (item) {
|
|
10805
|
+
var _this_controls_key_$container, _this_controls_key, _this_controls, _this_controls_key_$container1, _this_controls_key1, _this_controls1, _this_controls_key_resetPopupContainer, _this_controls_key2, _this_controls2, _this_controls3, _this__footerMoreControl2;
|
|
10806
|
+
var key = "" + item.iconId + "Control";
|
|
10807
|
+
var width = ((_this_controls = this.controls) == null ? void 0 : (_this_controls_key = _this_controls[key]) == null ? void 0 : (_this_controls_key_$container = _this_controls_key.$container) == null ? void 0 : _this_controls_key_$container.clientWidth) || 0;
|
|
10808
|
+
var height = ((_this_controls1 = this.controls) == null ? void 0 : (_this_controls_key1 = _this_controls1[key]) == null ? void 0 : (_this_controls_key_$container1 = _this_controls_key1.$container) == null ? void 0 : _this_controls_key_$container1.clientHeight) || 0;
|
|
10809
|
+
(_this_controls2 = this.controls) == null ? void 0 : (_this_controls_key2 = _this_controls2[key]) == null ? void 0 : (_this_controls_key_resetPopupContainer = _this_controls_key2.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer.call(_this_controls_key2, this._footerMoreControl.$panel, 'prepend');
|
|
10810
|
+
(_this__footerMoreControl2 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls3 = this.controls) == null ? void 0 : _this_controls3[key], {
|
|
10811
|
+
width: width,
|
|
10812
|
+
height: height
|
|
10813
|
+
});
|
|
10808
10814
|
}
|
|
10809
10815
|
}
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10816
|
-
|
|
10816
|
+
} else if (this._footerMoreControl) {
|
|
10817
|
+
var item1 = list.pop();
|
|
10818
|
+
if (item1) {
|
|
10819
|
+
var _this_controls_key_$container2, _this_controls_key3, _this_controls4, _this_controls_key_$container3, _this_controls_key4, _this_controls5, _this_controls_key_resetPopupContainer1, _this_controls_key5, _this_controls6, _this_controls7, _this__footerMoreControl3;
|
|
10820
|
+
var key1 = "" + item1.iconId + "Control";
|
|
10821
|
+
var width1 = ((_this_controls4 = this.controls) == null ? void 0 : (_this_controls_key3 = _this_controls4[key1]) == null ? void 0 : (_this_controls_key_$container2 = _this_controls_key3.$container) == null ? void 0 : _this_controls_key_$container2.clientWidth) || 0;
|
|
10822
|
+
var height1 = ((_this_controls5 = this.controls) == null ? void 0 : (_this_controls_key4 = _this_controls5[key1]) == null ? void 0 : (_this_controls_key_$container3 = _this_controls_key4.$container) == null ? void 0 : _this_controls_key_$container3.clientHeight) || 0;
|
|
10823
|
+
(_this_controls6 = this.controls) == null ? void 0 : (_this_controls_key5 = _this_controls6[key1]) == null ? void 0 : (_this_controls_key_resetPopupContainer1 = _this_controls_key5.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer1.call(_this_controls_key5, this._footerMoreControl.$panel, 'prepend');
|
|
10824
|
+
(_this__footerMoreControl3 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl3.add(key1, item1.part, (_this_controls7 = this.controls) == null ? void 0 : _this_controls7[key1], {
|
|
10825
|
+
width: width1,
|
|
10826
|
+
height: height1
|
|
10827
|
+
});
|
|
10828
|
+
} else {
|
|
10829
|
+
return;
|
|
10817
10830
|
}
|
|
10818
|
-
}
|
|
10819
|
-
|
|
10831
|
+
}
|
|
10832
|
+
// prettier-ignore
|
|
10833
|
+
this.emit(Theme.EVENTS.control.footerMoreShowControlsChange, !!this._footerMoreControl, (_this__footerMoreControl1 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list1 = _this__footerMoreControl1.list) == null ? void 0 : _this__footerMoreControl_list1.map(function(item) {
|
|
10834
|
+
return item.key;
|
|
10835
|
+
}));
|
|
10836
|
+
if (this._footerMoreControl) {
|
|
10837
|
+
// 防止 More 不存在导致死循环
|
|
10838
|
+
this._displayMore();
|
|
10839
|
+
}
|
|
10840
|
+
} else {
|
|
10841
|
+
var _this__footerMoreControl_list2, _this__footerMoreControl5, _this__footerMoreControl_list3, _this__footerMoreControl6;
|
|
10842
|
+
var offset = 50;
|
|
10843
|
+
// if (this._footerMoreControl?.list?.length && this._footerMoreControl?.list?.length > 2) {
|
|
10844
|
+
// offset = 16;
|
|
10845
|
+
// }
|
|
10846
|
+
if ((_this__footerMoreControl5 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list2 = _this__footerMoreControl5.list) == null ? void 0 : _this__footerMoreControl_list2.length) {
|
|
10847
|
+
offset = offset + this._footerMoreControl.list[0].width || 0;
|
|
10848
|
+
}
|
|
10849
|
+
if (((_this__footerMoreControl6 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list3 = _this__footerMoreControl6.list) == null ? void 0 : _this__footerMoreControl_list3.length) && this._width - leftWidth - rightWidth > offset) {
|
|
10850
|
+
var _this__footerMoreControl7, _this__footerMoreControl_list4, _this__footerMoreControl8, _this__footerMoreControl_list5, _this__footerMoreControl9;
|
|
10820
10851
|
// 110 是为了保住个别控件的宽度超出已知的值, 如英文下 按钮的宽度
|
|
10821
10852
|
// 从 More 中一次移除一个控件到 header/footer 中
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
var
|
|
10826
|
-
if (item2) {
|
|
10827
|
-
var
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
var
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
var _item_control_resetPopupContainer2, _item_control2;
|
|
10838
|
-
(_item_control2 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer2 = _item_control2.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer2.call(_item_control2, _this._footer.$right, 'before', _this._footerMoreControl.$container);
|
|
10839
|
-
}
|
|
10853
|
+
//
|
|
10854
|
+
var item2 = (_this__footerMoreControl7 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl7.list.shift();
|
|
10855
|
+
if (item2) {
|
|
10856
|
+
var _this__footerMoreControl10;
|
|
10857
|
+
if (item2.part === 'left') {
|
|
10858
|
+
var _item_control_resetPopupContainer, _item_control;
|
|
10859
|
+
(_item_control = item2.control) == null ? void 0 : (_item_control_resetPopupContainer = _item_control.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer.call(_item_control, this._footer.$left, 'append');
|
|
10860
|
+
} else if (item2.part === 'right') {
|
|
10861
|
+
var _this__footerMoreControl_list6, _this__footerMoreControl11;
|
|
10862
|
+
if (((_this__footerMoreControl11 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list6 = _this__footerMoreControl11.list) == null ? void 0 : _this__footerMoreControl_list6.length) === 0) {
|
|
10863
|
+
var _item_control_resetPopupContainer1, _item_control1;
|
|
10864
|
+
(_item_control1 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer1 = _item_control1.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer1.call(_item_control1, this._footer.$right, 'append');
|
|
10865
|
+
} else {
|
|
10866
|
+
var _item_control_resetPopupContainer2, _item_control2;
|
|
10867
|
+
(_item_control2 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer2 = _item_control2.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer2.call(_item_control2, this._footer.$right, 'before', this._footerMoreControl.$container);
|
|
10840
10868
|
}
|
|
10841
|
-
(_this__footerMoreControl8 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl8.remove(item2.control);
|
|
10842
10869
|
}
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
(
|
|
10870
|
+
(_this__footerMoreControl10 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl10.remove(item2.control);
|
|
10871
|
+
}
|
|
10872
|
+
if (((_this__footerMoreControl8 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list4 = _this__footerMoreControl8.list) == null ? void 0 : _this__footerMoreControl_list4.length) === 1) {
|
|
10873
|
+
var _this__footerMoreControl12, _this__footerMoreControl_destroy, _this__footerMoreControl13;
|
|
10874
|
+
// 最后一个, 移除 More
|
|
10875
|
+
var item11 = (_this__footerMoreControl12 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl12.list.shift();
|
|
10876
|
+
if (item11) {
|
|
10877
|
+
var _this__footerMoreControl14;
|
|
10878
|
+
if (item11.part === 'left') {
|
|
10879
|
+
var _item1_control_resetPopupContainer, _item1_control;
|
|
10880
|
+
(_item1_control = item11.control) == null ? void 0 : (_item1_control_resetPopupContainer = _item1_control.resetPopupContainer) == null ? void 0 : _item1_control_resetPopupContainer.call(_item1_control, this._footer.$left, 'append');
|
|
10881
|
+
} else if (item11.part === 'right') {
|
|
10882
|
+
var _item1_control_resetPopupContainer1, _item1_control1;
|
|
10883
|
+
(_item1_control1 = item11.control) == null ? void 0 : (_item1_control_resetPopupContainer1 = _item1_control1.resetPopupContainer) == null ? void 0 : _item1_control_resetPopupContainer1.call(_item1_control1, this._footer.$right, 'append');
|
|
10857
10884
|
}
|
|
10858
|
-
(
|
|
10859
|
-
_this._footerMoreControl = null;
|
|
10885
|
+
(_this__footerMoreControl14 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl14.remove(item11.control);
|
|
10860
10886
|
}
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
return item.key;
|
|
10864
|
-
}));
|
|
10865
|
-
displayMore();
|
|
10887
|
+
(_this__footerMoreControl13 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_destroy = _this__footerMoreControl13.destroy) == null ? void 0 : _this__footerMoreControl_destroy.call(_this__footerMoreControl13);
|
|
10888
|
+
this._footerMoreControl = null;
|
|
10866
10889
|
}
|
|
10890
|
+
// prettier-ignore
|
|
10891
|
+
this.emit(Theme.EVENTS.control.footerMoreShowControlsChange, !!this._footerMoreControl, (_this__footerMoreControl9 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list5 = _this__footerMoreControl9.list) == null ? void 0 : _this__footerMoreControl_list5.map(function(item) {
|
|
10892
|
+
return item.key;
|
|
10893
|
+
}));
|
|
10894
|
+
this._displayMore();
|
|
10867
10895
|
}
|
|
10868
10896
|
}
|
|
10869
|
-
}
|
|
10870
|
-
displayMore();
|
|
10897
|
+
}
|
|
10871
10898
|
};
|
|
10872
10899
|
/**
|
|
10873
10900
|
* 移除事件
|
|
@@ -11382,6 +11409,6 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11382
11409
|
zh: zh,
|
|
11383
11410
|
en: en
|
|
11384
11411
|
};
|
|
11385
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0
|
|
11412
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.10';
|
|
11386
11413
|
|
|
11387
11414
|
export { Control, EVENTS, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume };
|