@ezuikit/player-theme 2.1.0-beta.1 → 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 +161 -138
- package/dist/index.mjs +161 -138
- package/dist/index.umd.js +257 -498
- 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.1.0-beta.
|
|
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
|
}
|
|
@@ -3736,7 +3739,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3736
3739
|
_inherits$j(Content, EventEmitter);
|
|
3737
3740
|
function Content(options) {
|
|
3738
3741
|
var _this;
|
|
3739
|
-
_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;
|
|
3740
3743
|
_this.options = options;
|
|
3741
3744
|
_this._scaleMode = options.scaleMode || 0;
|
|
3742
3745
|
_this.$wrapper = document.createElement('div');
|
|
@@ -3752,11 +3755,12 @@ function _set_prototype_of$j(o, p) {
|
|
|
3752
3755
|
$popupContainer.appendChild(_this.$wrapper);
|
|
3753
3756
|
}
|
|
3754
3757
|
_this.on(EVENTS.videoInfo, function(originWidth, originHeight) {
|
|
3755
|
-
_this.
|
|
3756
|
-
});
|
|
3757
|
-
_this.on(EVENTS.resize, function() {
|
|
3758
|
-
_this._rerender();
|
|
3758
|
+
_this.rerender(originWidth, originHeight);
|
|
3759
3759
|
});
|
|
3760
|
+
// prettier-ignore
|
|
3761
|
+
_this._cleanUpResizeObserver = Utils.resizeObserver(_this.$wrapper, throttle(function() {
|
|
3762
|
+
_this.rerender();
|
|
3763
|
+
}, 20));
|
|
3760
3764
|
return _this;
|
|
3761
3765
|
}
|
|
3762
3766
|
var _proto = Content.prototype;
|
|
@@ -3765,7 +3769,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3765
3769
|
* @param {number} originWidth 画面宽度
|
|
3766
3770
|
* @param {number} originHeight 画面高度
|
|
3767
3771
|
* @returns {void}
|
|
3768
|
-
*/ _proto.
|
|
3772
|
+
*/ _proto.rerender = function rerender(originWidth, originHeight) {
|
|
3769
3773
|
if (originWidth === void 0) originWidth = 0;
|
|
3770
3774
|
if (originHeight === void 0) originHeight = 0;
|
|
3771
3775
|
var width = this.$wrapper.clientWidth;
|
|
@@ -3789,6 +3793,7 @@ function _set_prototype_of$j(o, p) {
|
|
|
3789
3793
|
if (this._scaleMode === THEME_SCALE_MODE_TYPE.fullAuto) {
|
|
3790
3794
|
objectFill = 'cover';
|
|
3791
3795
|
}
|
|
3796
|
+
// 容器和视频的分辨率都需要有值才能计算
|
|
3792
3797
|
if (width > 0 && height > 0 && this._originWidth > 0 && this._originHeight > 0 && this.$video) {
|
|
3793
3798
|
var left = (width - this._originWidth) / 2;
|
|
3794
3799
|
var top = (height - this._originHeight) / 2;
|
|
@@ -3818,10 +3823,14 @@ function _set_prototype_of$j(o, p) {
|
|
|
3818
3823
|
_proto.setScaleMode = function setScaleMode(scaleMode) {
|
|
3819
3824
|
if (scaleMode === void 0) scaleMode = 0;
|
|
3820
3825
|
this._scaleMode = scaleMode;
|
|
3821
|
-
this.
|
|
3826
|
+
this.rerender();
|
|
3822
3827
|
};
|
|
3823
3828
|
_proto.destroy = function destroy() {
|
|
3824
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
|
+
}
|
|
3825
3834
|
if (this.$video) {
|
|
3826
3835
|
this.$video.remove();
|
|
3827
3836
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -3926,11 +3935,13 @@ function _set_prototype_of$i(o, p) {
|
|
|
3926
3935
|
/**
|
|
3927
3936
|
* 添加
|
|
3928
3937
|
* @param control
|
|
3929
|
-
*/ _proto.add = function add(key, part, control) {
|
|
3938
|
+
*/ _proto.add = function add(key, part, control, props) {
|
|
3930
3939
|
this.list.unshift({
|
|
3931
3940
|
part: part,
|
|
3932
3941
|
key: key,
|
|
3933
|
-
control: control
|
|
3942
|
+
control: control,
|
|
3943
|
+
width: props.width,
|
|
3944
|
+
height: props.height
|
|
3934
3945
|
});
|
|
3935
3946
|
};
|
|
3936
3947
|
/**
|
|
@@ -4389,12 +4400,6 @@ function debounce(func, wait) {
|
|
|
4389
4400
|
theme.emit(EVENTS.control.recDestroy);
|
|
4390
4401
|
});
|
|
4391
4402
|
}
|
|
4392
|
-
// content
|
|
4393
|
-
if (theme.contentControl) {
|
|
4394
|
-
theme.contentControl.on(EVENTS.control.contentRerender, function(info) {
|
|
4395
|
-
theme.emit(EVENTS.control.contentRerender, info);
|
|
4396
|
-
});
|
|
4397
|
-
}
|
|
4398
4403
|
}
|
|
4399
4404
|
var ignoreList = [
|
|
4400
4405
|
EVENTS.getOSDTime,
|
|
@@ -8716,7 +8721,7 @@ function _set_prototype_of$6(o, p) {
|
|
|
8716
8721
|
],
|
|
8717
8722
|
badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
|
|
8718
8723
|
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
8719
|
-
current:
|
|
8724
|
+
current: require$$1.DateTime.toDate(this._value),
|
|
8720
8725
|
placement: 'tr',
|
|
8721
8726
|
triggerClose: true,
|
|
8722
8727
|
disabledDate: function(date) {
|
|
@@ -10192,6 +10197,9 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10192
10197
|
},
|
|
10193
10198
|
scaleMode: _this.scaleMode
|
|
10194
10199
|
});
|
|
10200
|
+
_this.contentControl.on(EVENTS.control.contentRerender, function(info) {
|
|
10201
|
+
_this.emit(EVENTS.control.contentRerender, info);
|
|
10202
|
+
});
|
|
10195
10203
|
// zoom utils
|
|
10196
10204
|
__zoom(_this, _this.contentControl.$content, _extends({}, _this.options.zoomOptions || {}, {
|
|
10197
10205
|
onTap: function() {
|
|
@@ -10742,138 +10750,153 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10742
10750
|
* 尺寸变化结束时 进行判断,为了节省开销
|
|
10743
10751
|
* @WARN:这里会闪一下, 原因:需要控件渲染后才知是否需要放置到 More 中,
|
|
10744
10752
|
*/ _proto._footerMoreControlShow = function _footerMoreControlShow() {
|
|
10753
|
+
this._displayMore();
|
|
10754
|
+
};
|
|
10755
|
+
_proto._displayMore = function _displayMore() {
|
|
10745
10756
|
var _this = this;
|
|
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
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
10775
|
-
}
|
|
10776
|
-
});
|
|
10777
|
-
}
|
|
10778
|
-
//
|
|
10779
|
-
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) {
|
|
10780
|
-
var _this__footerMoreControl;
|
|
10781
|
-
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
10782
|
-
var _this_controls;
|
|
10783
|
-
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
10784
|
-
});
|
|
10785
|
-
return index === -1;
|
|
10786
|
-
});
|
|
10787
|
-
if (list.length <= 0) {
|
|
10788
|
-
return;
|
|
10789
|
-
}
|
|
10790
|
-
if (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
10791
|
-
// 为什么是两个, 因为More 也占用一个位置
|
|
10792
|
-
var popList = [
|
|
10793
|
-
list.pop(),
|
|
10794
|
-
list.pop()
|
|
10795
|
-
];
|
|
10796
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
10797
|
-
var item = _step.value;
|
|
10798
|
-
if (item) {
|
|
10799
|
-
var _this_controls_key_resetPopupContainer, _this_controls_key, _this_controls, _this_controls1, _this__footerMoreControl2;
|
|
10800
|
-
var key = "" + item.iconId + "Control";
|
|
10801
|
-
(_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');
|
|
10802
|
-
(_this__footerMoreControl2 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls1 = _this.controls) == null ? void 0 : _this_controls1[key]);
|
|
10803
|
-
}
|
|
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);
|
|
10804
10785
|
}
|
|
10805
|
-
}
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
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
|
+
});
|
|
10814
10816
|
}
|
|
10815
10817
|
}
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
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;
|
|
10823
10832
|
}
|
|
10824
|
-
}
|
|
10825
|
-
|
|
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;
|
|
10826
10853
|
// 110 是为了保住个别控件的宽度超出已知的值, 如英文下 按钮的宽度
|
|
10827
10854
|
// 从 More 中一次移除一个控件到 header/footer 中
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
var
|
|
10832
|
-
if (item2) {
|
|
10833
|
-
var
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
var
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
var _item_control_resetPopupContainer2, _item_control2;
|
|
10844
|
-
(_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);
|
|
10845
|
-
}
|
|
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);
|
|
10846
10870
|
}
|
|
10847
|
-
(_this__footerMoreControl8 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl8.remove(item2.control);
|
|
10848
10871
|
}
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
(
|
|
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');
|
|
10863
10886
|
}
|
|
10864
|
-
(
|
|
10865
|
-
_this._footerMoreControl = null;
|
|
10887
|
+
(_this__footerMoreControl14 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl14.remove(item11.control);
|
|
10866
10888
|
}
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
return item.key;
|
|
10870
|
-
}));
|
|
10871
|
-
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;
|
|
10872
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();
|
|
10873
10897
|
}
|
|
10874
10898
|
}
|
|
10875
|
-
}
|
|
10876
|
-
displayMore();
|
|
10899
|
+
}
|
|
10877
10900
|
};
|
|
10878
10901
|
/**
|
|
10879
10902
|
* 移除事件
|
|
@@ -11388,7 +11411,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11388
11411
|
zh: zh,
|
|
11389
11412
|
en: en
|
|
11390
11413
|
};
|
|
11391
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.
|
|
11414
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.10';
|
|
11392
11415
|
|
|
11393
11416
|
exports.Control = Control;
|
|
11394
11417
|
exports.EVENTS = EVENTS;
|