@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/README.md
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
## 简介
|
|
2
|
+
|
|
3
|
+
萤石播放器主题
|
|
4
|
+
|
|
5
|
+
## 快速入门
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import Theme from '@ezuikit/player-theme';
|
|
9
|
+
// 引入样式
|
|
10
|
+
import '@ezuikit/player-theme/dist/style.css';
|
|
11
|
+
|
|
12
|
+
// 使用
|
|
13
|
+
const theme = new Theme({
|
|
14
|
+
// ...
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// 播放器接入主题
|
|
18
|
+
class Player extends Theme {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
super(options);
|
|
21
|
+
// ...
|
|
22
|
+
}
|
|
23
|
+
// ...
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 样式变量
|
|
28
|
+
|
|
29
|
+
```scss
|
|
30
|
+
--ezplayer-default-color: #fff;
|
|
31
|
+
--ezplayer-primary-color: #407aff;
|
|
32
|
+
--ezplayer-active-color: var(--ezplayer-primary-color, #407aff);
|
|
33
|
+
--ezplayer-disabled-color: #aaa;
|
|
34
|
+
--ezplayer-font-size: 14px;
|
|
35
|
+
--ezplayer-icon-font-size: 24px;
|
|
36
|
+
--ezplayer-btn-height: var(--ezplayer-icon-font-size, 24px);
|
|
37
|
+
--ezplayer-border-radius: 8px;
|
|
38
|
+
// 移动端暂时不生效
|
|
39
|
+
--ezplayer-picker-panel-bg-color: rgba(0, 0, 0, 0.7);
|
|
40
|
+
```
|
package/dist/constant.js
CHANGED
package/dist/index.js
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
|
'use strict';
|
|
@@ -1911,7 +1911,10 @@ var VOLUME_DEFAULT_OPTIONS = {
|
|
|
1911
1911
|
if (this._lastVolume !== _volume) {
|
|
1912
1912
|
this._volume = _volume;
|
|
1913
1913
|
this._lastVolume = this._volume;
|
|
1914
|
-
if (this._progress)
|
|
1914
|
+
if (this._progress) {
|
|
1915
|
+
// 静音时进度条为 0
|
|
1916
|
+
this._progress.value = this._muted ? 0 : _volume;
|
|
1917
|
+
}
|
|
1915
1918
|
this._options.onChange == null ? void 0 : this._options.onChange.call(this._options, _volume, this._muted);
|
|
1916
1919
|
this.emit(EVENTS.control.volumechange, _volume, this._muted);
|
|
1917
1920
|
}
|
|
@@ -3186,7 +3189,14 @@ var en = {
|
|
|
3186
3189
|
{
|
|
3187
3190
|
iconId: 'volume',
|
|
3188
3191
|
part: 'left',
|
|
3189
|
-
defaultActive:
|
|
3192
|
+
defaultActive: 0,
|
|
3193
|
+
isrender: 1
|
|
3194
|
+
},
|
|
3195
|
+
{
|
|
3196
|
+
// flv 录制 2.1.0 新增
|
|
3197
|
+
iconId: 'record',
|
|
3198
|
+
part: 'left',
|
|
3199
|
+
defaultActive: 0,
|
|
3190
3200
|
isrender: 1
|
|
3191
3201
|
},
|
|
3192
3202
|
{
|
|
@@ -3729,7 +3739,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3729
3739
|
_inherits$j(Content, EventEmitter);
|
|
3730
3740
|
function Content(options) {
|
|
3731
3741
|
var _this;
|
|
3732
|
-
_this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
|
|
3742
|
+
_this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._cleanUpResizeObserver = null, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
|
|
3733
3743
|
_this.options = options;
|
|
3734
3744
|
_this._scaleMode = options.scaleMode || 0;
|
|
3735
3745
|
_this.$wrapper = document.createElement('div');
|
|
@@ -3745,11 +3755,12 @@ function _set_prototype_of$j(o, p) {
|
|
|
3745
3755
|
$popupContainer.appendChild(_this.$wrapper);
|
|
3746
3756
|
}
|
|
3747
3757
|
_this.on(EVENTS.videoInfo, function(originWidth, originHeight) {
|
|
3748
|
-
_this.
|
|
3749
|
-
});
|
|
3750
|
-
_this.on(EVENTS.resize, function() {
|
|
3751
|
-
_this._rerender();
|
|
3758
|
+
_this.rerender(originWidth, originHeight);
|
|
3752
3759
|
});
|
|
3760
|
+
// prettier-ignore
|
|
3761
|
+
_this._cleanUpResizeObserver = Utils.resizeObserver(_this.$wrapper, throttle(function() {
|
|
3762
|
+
_this.rerender();
|
|
3763
|
+
}, 20));
|
|
3753
3764
|
return _this;
|
|
3754
3765
|
}
|
|
3755
3766
|
var _proto = Content.prototype;
|
|
@@ -3758,7 +3769,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3758
3769
|
* @param {number} originWidth 画面宽度
|
|
3759
3770
|
* @param {number} originHeight 画面高度
|
|
3760
3771
|
* @returns {void}
|
|
3761
|
-
*/ _proto.
|
|
3772
|
+
*/ _proto.rerender = function rerender(originWidth, originHeight) {
|
|
3762
3773
|
if (originWidth === void 0) originWidth = 0;
|
|
3763
3774
|
if (originHeight === void 0) originHeight = 0;
|
|
3764
3775
|
var width = this.$wrapper.clientWidth;
|
|
@@ -3782,6 +3793,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3782
3793
|
if (this._scaleMode === THEME_SCALE_MODE_TYPE.fullAuto) {
|
|
3783
3794
|
objectFill = 'cover';
|
|
3784
3795
|
}
|
|
3796
|
+
// 容器和视频的分辨率都需要有值才能计算
|
|
3785
3797
|
if (width > 0 && height > 0 && this._originWidth > 0 && this._originHeight > 0 && this.$video) {
|
|
3786
3798
|
var left = (width - this._originWidth) / 2;
|
|
3787
3799
|
var top = (height - this._originHeight) / 2;
|
|
@@ -3811,10 +3823,14 @@ function _set_prototype_of$j(o, p) {
|
|
|
3811
3823
|
_proto.setScaleMode = function setScaleMode(scaleMode) {
|
|
3812
3824
|
if (scaleMode === void 0) scaleMode = 0;
|
|
3813
3825
|
this._scaleMode = scaleMode;
|
|
3814
|
-
this.
|
|
3826
|
+
this.rerender();
|
|
3815
3827
|
};
|
|
3816
3828
|
_proto.destroy = function destroy() {
|
|
3817
3829
|
var _this_$wrapper;
|
|
3830
|
+
if (this._cleanUpResizeObserver) {
|
|
3831
|
+
this._cleanUpResizeObserver.unobserve == null ? void 0 : this._cleanUpResizeObserver.unobserve.call(this._cleanUpResizeObserver);
|
|
3832
|
+
this._cleanUpResizeObserver = null;
|
|
3833
|
+
}
|
|
3818
3834
|
if (this.$video) {
|
|
3819
3835
|
this.$video.remove();
|
|
3820
3836
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -3919,11 +3935,13 @@ function _set_prototype_of$i(o, p) {
|
|
|
3919
3935
|
/**
|
|
3920
3936
|
* 添加
|
|
3921
3937
|
* @param control
|
|
3922
|
-
*/ _proto.add = function add(key, part, control) {
|
|
3938
|
+
*/ _proto.add = function add(key, part, control, props) {
|
|
3923
3939
|
this.list.unshift({
|
|
3924
3940
|
part: part,
|
|
3925
3941
|
key: key,
|
|
3926
|
-
control: control
|
|
3942
|
+
control: control,
|
|
3943
|
+
width: props.width,
|
|
3944
|
+
height: props.height
|
|
3927
3945
|
});
|
|
3928
3946
|
};
|
|
3929
3947
|
/**
|
|
@@ -4382,12 +4400,6 @@ function debounce(func, wait) {
|
|
|
4382
4400
|
theme.emit(EVENTS.control.recDestroy);
|
|
4383
4401
|
});
|
|
4384
4402
|
}
|
|
4385
|
-
// content
|
|
4386
|
-
if (theme.contentControl) {
|
|
4387
|
-
theme.contentControl.on(EVENTS.control.contentRerender, function(info) {
|
|
4388
|
-
theme.emit(EVENTS.control.contentRerender, info);
|
|
4389
|
-
});
|
|
4390
|
-
}
|
|
4391
4403
|
}
|
|
4392
4404
|
var ignoreList = [
|
|
4393
4405
|
EVENTS.getOSDTime,
|
|
@@ -8709,7 +8721,7 @@ function _set_prototype_of$6(o, p) {
|
|
|
8709
8721
|
],
|
|
8710
8722
|
badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
|
|
8711
8723
|
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
8712
|
-
current:
|
|
8724
|
+
current: require$$1.DateTime.toDate(this._value),
|
|
8713
8725
|
placement: 'tr',
|
|
8714
8726
|
triggerClose: true,
|
|
8715
8727
|
disabledDate: function(date) {
|
|
@@ -9630,7 +9642,7 @@ function _renderControls(theme, $container, btnList, props) {
|
|
|
9630
9642
|
}
|
|
9631
9643
|
function _renderTheme(theme, data) {
|
|
9632
9644
|
return _async_to_generator$1(function() {
|
|
9633
|
-
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,
|
|
9645
|
+
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;
|
|
9634
9646
|
return _ts_generator$1(this, function(_state) {
|
|
9635
9647
|
switch(_state.label){
|
|
9636
9648
|
case 0:
|
|
@@ -9792,26 +9804,23 @@ function _renderTheme(theme, data) {
|
|
|
9792
9804
|
hasPtz = list.some(function(item) {
|
|
9793
9805
|
return item.iconId === 'ptz';
|
|
9794
9806
|
});
|
|
9795
|
-
if (
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
}
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
}
|
|
9813
|
-
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) {
|
|
9814
|
-
theme.controls.ptzControl.renderMobileExtend(theme._mobileExtend.$content);
|
|
9807
|
+
if (hasPtz || _needTimeLine) {
|
|
9808
|
+
theme._mobileExtend = new MobileExtend(theme.$container);
|
|
9809
|
+
if (theme.options.dateOptions !== null && ((_theme_options_mobileExtendOptions1 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions1.controls.includes('date')) && _needTimeLine) {
|
|
9810
|
+
_renderDatePicker(theme, theme._mobileExtend.$topLeft, props);
|
|
9811
|
+
}
|
|
9812
|
+
if (theme.options.recOptions !== null && ((_theme_options_mobileExtendOptions2 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions2.controls.includes('rec')) && _needTimeLine) {
|
|
9813
|
+
[].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) {
|
|
9814
|
+
var _theme__mobileExtend;
|
|
9815
|
+
if (REC_GROUP.includes(item.iconId)) _renderRecType(theme, (_theme__mobileExtend = theme._mobileExtend) == null ? void 0 : _theme__mobileExtend.$topRight, item.iconId, props);
|
|
9816
|
+
});
|
|
9817
|
+
}
|
|
9818
|
+
if ((theme.options.timeLineOptions !== null || !theme.options.disabledTimeLine) && ((_theme_options_mobileExtendOptions3 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions3.controls.includes('timeLine')) && _needTimeLine) {
|
|
9819
|
+
_renderTimeLine(theme, theme._mobileExtend.$content, props);
|
|
9820
|
+
}
|
|
9821
|
+
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) {
|
|
9822
|
+
theme.controls.ptzControl.renderMobileExtend(theme._mobileExtend.$content);
|
|
9823
|
+
}
|
|
9815
9824
|
}
|
|
9816
9825
|
}
|
|
9817
9826
|
theme.emit(EVENTS.control.mountedControls);
|
|
@@ -10188,6 +10197,9 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10188
10197
|
},
|
|
10189
10198
|
scaleMode: _this.scaleMode
|
|
10190
10199
|
});
|
|
10200
|
+
_this.contentControl.on(EVENTS.control.contentRerender, function(info) {
|
|
10201
|
+
_this.emit(EVENTS.control.contentRerender, info);
|
|
10202
|
+
});
|
|
10191
10203
|
// zoom utils
|
|
10192
10204
|
__zoom(_this, _this.contentControl.$content, _extends({}, _this.options.zoomOptions || {}, {
|
|
10193
10205
|
onTap: function() {
|
|
@@ -10738,138 +10750,153 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10738
10750
|
* 尺寸变化结束时 进行判断,为了节省开销
|
|
10739
10751
|
* @WARN:这里会闪一下, 原因:需要控件渲染后才知是否需要放置到 More 中,
|
|
10740
10752
|
*/ _proto._footerMoreControlShow = function _footerMoreControlShow() {
|
|
10753
|
+
this._displayMore();
|
|
10754
|
+
};
|
|
10755
|
+
_proto._displayMore = function _displayMore() {
|
|
10741
10756
|
var _this = this;
|
|
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
|
-
|
|
10769
|
-
|
|
10770
|
-
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
10771
|
-
}
|
|
10772
|
-
});
|
|
10773
|
-
}
|
|
10774
|
-
//
|
|
10775
|
-
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) {
|
|
10776
|
-
var _this__footerMoreControl;
|
|
10777
|
-
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
10778
|
-
var _this_controls;
|
|
10779
|
-
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
10780
|
-
});
|
|
10781
|
-
return index === -1;
|
|
10782
|
-
});
|
|
10783
|
-
if (list.length <= 0) {
|
|
10784
|
-
return;
|
|
10785
|
-
}
|
|
10786
|
-
if (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
10787
|
-
// 为什么是两个, 因为More 也占用一个位置
|
|
10788
|
-
var popList = [
|
|
10789
|
-
list.pop(),
|
|
10790
|
-
list.pop()
|
|
10791
|
-
];
|
|
10792
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
10793
|
-
var item = _step.value;
|
|
10794
|
-
if (item) {
|
|
10795
|
-
var _this_controls_key_resetPopupContainer, _this_controls_key, _this_controls, _this_controls1, _this__footerMoreControl2;
|
|
10796
|
-
var key = "" + item.iconId + "Control";
|
|
10797
|
-
(_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');
|
|
10798
|
-
(_this__footerMoreControl2 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls1 = _this.controls) == null ? void 0 : _this_controls1[key]);
|
|
10799
|
-
}
|
|
10757
|
+
if (this._footer) {
|
|
10758
|
+
var _this__footer_$left, _this__footer_$right;
|
|
10759
|
+
// 判断 footer 的控件是否能放置的下, 否则隐藏暂时 more 按钮
|
|
10760
|
+
var leftWidth = ((_this__footer_$left = this._footer.$left) == null ? void 0 : _this__footer_$left.clientWidth) || 0;
|
|
10761
|
+
var rightWidth = ((_this__footer_$right = this._footer.$right) == null ? void 0 : _this__footer_$right.clientWidth) || 0;
|
|
10762
|
+
// 当footer 中 left 和 right 宽度之和大于 footer 宽度,则 footer more 显示
|
|
10763
|
+
var collapseControl = this._width - leftWidth - rightWidth < 16; // 收拢控件到 More 中
|
|
10764
|
+
if (collapseControl) {
|
|
10765
|
+
var _this__footer, _this__themeData_footer, _this__themeData, _this__footerMoreControl_list, _this__footerMoreControl, _this__footerMoreControl_list1, _this__footerMoreControl1;
|
|
10766
|
+
if (!this._footerMoreControl && ((_this__footer = this._footer) == null ? void 0 : _this__footer.$right)) {
|
|
10767
|
+
this._footerMoreControl = new More({
|
|
10768
|
+
language: this.options.language,
|
|
10769
|
+
locales: this.i18n.translations,
|
|
10770
|
+
rootContainer: this.$container,
|
|
10771
|
+
getPopupContainer: function() {
|
|
10772
|
+
var _this__footer;
|
|
10773
|
+
return (_this__footer = _this._footer) == null ? void 0 : _this__footer.$right;
|
|
10774
|
+
},
|
|
10775
|
+
placement: 'tr',
|
|
10776
|
+
controls: this.controls,
|
|
10777
|
+
open: false,
|
|
10778
|
+
offset: [
|
|
10779
|
+
0,
|
|
10780
|
+
-8
|
|
10781
|
+
],
|
|
10782
|
+
wrapClassName: "" + PREFIX_CLASS + "-footer-more",
|
|
10783
|
+
onOpenChange: function(open) {
|
|
10784
|
+
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
10800
10785
|
}
|
|
10801
|
-
}
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10786
|
+
});
|
|
10787
|
+
}
|
|
10788
|
+
//
|
|
10789
|
+
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) {
|
|
10790
|
+
var _this__footerMoreControl;
|
|
10791
|
+
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
10792
|
+
var _this_controls;
|
|
10793
|
+
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
10794
|
+
});
|
|
10795
|
+
return index === -1;
|
|
10796
|
+
});
|
|
10797
|
+
if (list.length <= 0) return;
|
|
10798
|
+
if (((_this__footerMoreControl = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
10799
|
+
// 为什么是两个, 因为More 也占用一个位置
|
|
10800
|
+
var popList = [
|
|
10801
|
+
list.pop(),
|
|
10802
|
+
list.pop()
|
|
10803
|
+
];
|
|
10804
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
10805
|
+
var item = _step.value;
|
|
10806
|
+
if (item) {
|
|
10807
|
+
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;
|
|
10808
|
+
var key = "" + item.iconId + "Control";
|
|
10809
|
+
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;
|
|
10810
|
+
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;
|
|
10811
|
+
(_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');
|
|
10812
|
+
(_this__footerMoreControl2 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls3 = this.controls) == null ? void 0 : _this_controls3[key], {
|
|
10813
|
+
width: width,
|
|
10814
|
+
height: height
|
|
10815
|
+
});
|
|
10810
10816
|
}
|
|
10811
10817
|
}
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10818
|
+
} else if (this._footerMoreControl) {
|
|
10819
|
+
var item1 = list.pop();
|
|
10820
|
+
if (item1) {
|
|
10821
|
+
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;
|
|
10822
|
+
var key1 = "" + item1.iconId + "Control";
|
|
10823
|
+
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;
|
|
10824
|
+
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;
|
|
10825
|
+
(_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');
|
|
10826
|
+
(_this__footerMoreControl3 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl3.add(key1, item1.part, (_this_controls7 = this.controls) == null ? void 0 : _this_controls7[key1], {
|
|
10827
|
+
width: width1,
|
|
10828
|
+
height: height1
|
|
10829
|
+
});
|
|
10830
|
+
} else {
|
|
10831
|
+
return;
|
|
10819
10832
|
}
|
|
10820
|
-
}
|
|
10821
|
-
|
|
10833
|
+
}
|
|
10834
|
+
// prettier-ignore
|
|
10835
|
+
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) {
|
|
10836
|
+
return item.key;
|
|
10837
|
+
}));
|
|
10838
|
+
if (this._footerMoreControl) {
|
|
10839
|
+
// 防止 More 不存在导致死循环
|
|
10840
|
+
this._displayMore();
|
|
10841
|
+
}
|
|
10842
|
+
} else {
|
|
10843
|
+
var _this__footerMoreControl_list2, _this__footerMoreControl5, _this__footerMoreControl_list3, _this__footerMoreControl6;
|
|
10844
|
+
var offset = 50;
|
|
10845
|
+
// if (this._footerMoreControl?.list?.length && this._footerMoreControl?.list?.length > 2) {
|
|
10846
|
+
// offset = 16;
|
|
10847
|
+
// }
|
|
10848
|
+
if ((_this__footerMoreControl5 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list2 = _this__footerMoreControl5.list) == null ? void 0 : _this__footerMoreControl_list2.length) {
|
|
10849
|
+
offset = offset + this._footerMoreControl.list[0].width || 0;
|
|
10850
|
+
}
|
|
10851
|
+
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) {
|
|
10852
|
+
var _this__footerMoreControl7, _this__footerMoreControl_list4, _this__footerMoreControl8, _this__footerMoreControl_list5, _this__footerMoreControl9;
|
|
10822
10853
|
// 110 是为了保住个别控件的宽度超出已知的值, 如英文下 按钮的宽度
|
|
10823
10854
|
// 从 More 中一次移除一个控件到 header/footer 中
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
var
|
|
10828
|
-
if (item2) {
|
|
10829
|
-
var
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
var
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
var _item_control_resetPopupContainer2, _item_control2;
|
|
10840
|
-
(_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);
|
|
10841
|
-
}
|
|
10855
|
+
//
|
|
10856
|
+
var item2 = (_this__footerMoreControl7 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl7.list.shift();
|
|
10857
|
+
if (item2) {
|
|
10858
|
+
var _this__footerMoreControl10;
|
|
10859
|
+
if (item2.part === 'left') {
|
|
10860
|
+
var _item_control_resetPopupContainer, _item_control;
|
|
10861
|
+
(_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');
|
|
10862
|
+
} else if (item2.part === 'right') {
|
|
10863
|
+
var _this__footerMoreControl_list6, _this__footerMoreControl11;
|
|
10864
|
+
if (((_this__footerMoreControl11 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list6 = _this__footerMoreControl11.list) == null ? void 0 : _this__footerMoreControl_list6.length) === 0) {
|
|
10865
|
+
var _item_control_resetPopupContainer1, _item_control1;
|
|
10866
|
+
(_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');
|
|
10867
|
+
} else {
|
|
10868
|
+
var _item_control_resetPopupContainer2, _item_control2;
|
|
10869
|
+
(_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);
|
|
10842
10870
|
}
|
|
10843
|
-
(_this__footerMoreControl8 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl8.remove(item2.control);
|
|
10844
10871
|
}
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
(
|
|
10872
|
+
(_this__footerMoreControl10 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl10.remove(item2.control);
|
|
10873
|
+
}
|
|
10874
|
+
if (((_this__footerMoreControl8 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list4 = _this__footerMoreControl8.list) == null ? void 0 : _this__footerMoreControl_list4.length) === 1) {
|
|
10875
|
+
var _this__footerMoreControl12, _this__footerMoreControl_destroy, _this__footerMoreControl13;
|
|
10876
|
+
// 最后一个, 移除 More
|
|
10877
|
+
var item11 = (_this__footerMoreControl12 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl12.list.shift();
|
|
10878
|
+
if (item11) {
|
|
10879
|
+
var _this__footerMoreControl14;
|
|
10880
|
+
if (item11.part === 'left') {
|
|
10881
|
+
var _item1_control_resetPopupContainer, _item1_control;
|
|
10882
|
+
(_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');
|
|
10883
|
+
} else if (item11.part === 'right') {
|
|
10884
|
+
var _item1_control_resetPopupContainer1, _item1_control1;
|
|
10885
|
+
(_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');
|
|
10859
10886
|
}
|
|
10860
|
-
(
|
|
10861
|
-
_this._footerMoreControl = null;
|
|
10887
|
+
(_this__footerMoreControl14 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl14.remove(item11.control);
|
|
10862
10888
|
}
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
return item.key;
|
|
10866
|
-
}));
|
|
10867
|
-
displayMore();
|
|
10889
|
+
(_this__footerMoreControl13 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_destroy = _this__footerMoreControl13.destroy) == null ? void 0 : _this__footerMoreControl_destroy.call(_this__footerMoreControl13);
|
|
10890
|
+
this._footerMoreControl = null;
|
|
10868
10891
|
}
|
|
10892
|
+
// prettier-ignore
|
|
10893
|
+
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) {
|
|
10894
|
+
return item.key;
|
|
10895
|
+
}));
|
|
10896
|
+
this._displayMore();
|
|
10869
10897
|
}
|
|
10870
10898
|
}
|
|
10871
|
-
}
|
|
10872
|
-
displayMore();
|
|
10899
|
+
}
|
|
10873
10900
|
};
|
|
10874
10901
|
/**
|
|
10875
10902
|
* 移除事件
|
|
@@ -11384,7 +11411,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11384
11411
|
zh: zh,
|
|
11385
11412
|
en: en
|
|
11386
11413
|
};
|
|
11387
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0
|
|
11414
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.10';
|
|
11388
11415
|
|
|
11389
11416
|
exports.Control = Control;
|
|
11390
11417
|
exports.EVENTS = EVENTS;
|