@ezuikit/player-theme 2.0.2-beta.6 → 2.0.2-beta.8
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 +1 -40
- package/dist/index.js +146 -637
- package/dist/index.mjs +147 -638
- package/dist/index.umd.js +167 -621
- package/dist/style.css +3 -2
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +68 -44
- package/package.json +4 -9
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.0.2-beta.
|
|
3
|
-
* Copyright (c) 2025-12-
|
|
2
|
+
* @ezuikit/player-theme v2.0.2-beta.8
|
|
3
|
+
* Copyright (c) 2025-12-12 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
@@ -13,6 +13,7 @@ var require$$1 = require('@ezuikit/utils-tools');
|
|
|
13
13
|
var screenfull = require('screenfull');
|
|
14
14
|
var I18n = require('@ezuikit/utils-i18n');
|
|
15
15
|
var Logger = require('@ezuikit/utils-logger');
|
|
16
|
+
var controlDatePicker = require('@ezuikit/control-date-picker');
|
|
16
17
|
var controlTimeLine = require('@ezuikit/control-time-line');
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -43,7 +44,8 @@ var THEME_PROPS = [
|
|
|
43
44
|
'speed',
|
|
44
45
|
'urlInfo',
|
|
45
46
|
'videoLevelList',
|
|
46
|
-
'videoLevel'
|
|
47
|
+
'videoLevel',
|
|
48
|
+
'recMonth'
|
|
47
49
|
];
|
|
48
50
|
/**
|
|
49
51
|
* 当移动端 picker 控件打开时需要关闭动画(定时器)
|
|
@@ -189,8 +191,9 @@ var EVENTS = {
|
|
|
189
191
|
/** 全局全屏控件销毁 */ globalFullscreenDestroy: 'Control.globalFullscreenDestroy',
|
|
190
192
|
/** 日期面板展示隐藏变换 */ datePanelOpenChange: 'Control.datePanelOpenChange',
|
|
191
193
|
/** 日期改变 */ dateChange: 'Control.dateChange',
|
|
194
|
+
/** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
|
|
192
195
|
/** 日期销毁 */ dateDestroy: 'Control.datePanelDestroy',
|
|
193
|
-
/**
|
|
196
|
+
/** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
|
|
194
197
|
/** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
|
|
195
198
|
/** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
|
|
196
199
|
/** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
|
|
@@ -201,7 +204,7 @@ var EVENTS = {
|
|
|
201
204
|
/** 加载控件销毁 */ loadingDestroy: 'Control.loadingDestroy',
|
|
202
205
|
/** 消息控件销毁 */ messageDestroy: 'Control.messageDestroy',
|
|
203
206
|
/** 播放器内容区域销毁 */ contentDestroy: 'Control.contentDestroy',
|
|
204
|
-
contentRerender: 'Control.contentRerender'
|
|
207
|
+
/** 播放器内容区域重新渲染 */ contentRerender: 'Control.contentRerender'
|
|
205
208
|
},
|
|
206
209
|
/**
|
|
207
210
|
* 主题控件相关
|
|
@@ -268,9 +271,14 @@ function _set_prototype_of$r(o, p) {
|
|
|
268
271
|
function Control(options) {
|
|
269
272
|
var _this;
|
|
270
273
|
var _this___options;
|
|
271
|
-
_this = EventEmitter.call(this) || this, /** 具体语言对应的值 */ _this.locale = null, _this.__options = {}, _this._disabled = false, _this._active = false;
|
|
274
|
+
_this = EventEmitter.call(this) || this, /** 具体语言对应的值 */ _this.locale = null, _this.__options = {}, _this._disabled = false, _this._active = false, _this._camelCaseName = '';
|
|
272
275
|
_this.__options = options;
|
|
273
276
|
_this.locale = getLocale(_this.__options.locales, _this.__options.language);
|
|
277
|
+
_this._camelCaseName = _this.__options.classNameSuffix ? _this.__options.classNameSuffix.replace(/[-_\s]+(.)?/g, function(_, c) {
|
|
278
|
+
return c ? c.toUpperCase() : '';
|
|
279
|
+
}).replace(/^(.)/, function(first) {
|
|
280
|
+
return first.toLowerCase();
|
|
281
|
+
}) : '';
|
|
274
282
|
_this.$container = document.createElement(options.tagName || 'span');
|
|
275
283
|
_this.$container.classList.add("" + PREFIX_CLASS + "-control"); // 默认隐藏
|
|
276
284
|
if ((options == null ? void 0 : options.controlType) === 'text') {
|
|
@@ -429,19 +437,6 @@ function _set_prototype_of$r(o, p) {
|
|
|
429
437
|
this._disabled = disabled;
|
|
430
438
|
this._updateDisabledState(disabled);
|
|
431
439
|
}
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
key: "_camelCaseName",
|
|
435
|
-
get: function get() {
|
|
436
|
-
if (this.__options.classNameSuffix) {
|
|
437
|
-
return this.__options.classNameSuffix.replace(/[-_\s]+(.)?/g, function(_, c) {
|
|
438
|
-
return c ? c.toUpperCase() : '';
|
|
439
|
-
}).replace(/^(.)/, function(first) {
|
|
440
|
-
return first.toLowerCase();
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
return null;
|
|
444
|
-
}
|
|
445
440
|
}
|
|
446
441
|
]);
|
|
447
442
|
return Control;
|
|
@@ -4062,11 +4057,11 @@ function debounce(func, wait) {
|
|
|
4062
4057
|
// 对讲
|
|
4063
4058
|
// =======================================================
|
|
4064
4059
|
theme.on(EVENTS.talkingChange, function(talking) {
|
|
4065
|
-
var _theme_controls_talkControl,
|
|
4060
|
+
var _theme_controls, _theme_controls_talkControl, _theme_controls1;
|
|
4066
4061
|
theme._talking = talking;
|
|
4067
|
-
if (talking !== ((
|
|
4068
|
-
var _theme_controls_talkControl1,
|
|
4069
|
-
(
|
|
4062
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.talkControl) && talking !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls1.talkControl) == null ? void 0 : _theme_controls_talkControl.active)) {
|
|
4063
|
+
var _theme_controls_talkControl1, _theme_controls2;
|
|
4064
|
+
(_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls2.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
|
|
4070
4065
|
}
|
|
4071
4066
|
});
|
|
4072
4067
|
theme.on(EVENTS.talkVolumeChange, function(value) {
|
|
@@ -4077,9 +4072,9 @@ function debounce(func, wait) {
|
|
|
4077
4072
|
// 录制
|
|
4078
4073
|
// =======================================================
|
|
4079
4074
|
theme.on(EVENTS.recordingChange, function(recording) {
|
|
4080
|
-
var _theme_controls_recordControl,
|
|
4075
|
+
var _theme_controls, _theme_controls_recordControl, _theme_controls1;
|
|
4081
4076
|
theme._recording = recording;
|
|
4082
|
-
if (recording !== ((
|
|
4077
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.recordControl) && recording !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_recordControl = _theme_controls1.recordControl) == null ? void 0 : _theme_controls_recordControl.active)) theme.controls.recordControl.active = recording;
|
|
4083
4078
|
});
|
|
4084
4079
|
// =======================================================
|
|
4085
4080
|
// 清晰度
|
|
@@ -4096,14 +4091,14 @@ function debounce(func, wait) {
|
|
|
4096
4091
|
// 放大
|
|
4097
4092
|
// =======================================================
|
|
4098
4093
|
theme.on(EVENTS.zoomingChange, function(zooming) {
|
|
4099
|
-
var _theme_controls_zoomControl1,
|
|
4100
|
-
if (((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 =
|
|
4094
|
+
var _theme_controls1, _theme_controls_zoomControl1, _theme_controls2;
|
|
4095
|
+
if (((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1.zoomControl) && ((_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 = _theme_controls2.zoomControl) == null ? void 0 : _theme_controls_zoomControl1.active) !== zooming) {
|
|
4101
4096
|
theme.controls.zoomControl.active = zooming;
|
|
4102
4097
|
}
|
|
4103
4098
|
});
|
|
4104
4099
|
theme.on(EVENTS.zoomChange, function(zoom) {
|
|
4105
|
-
var _theme_controls_zoomControl,
|
|
4106
|
-
if (((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_zoomControl =
|
|
4100
|
+
var _theme_controls, _theme_controls_zoomControl, _theme_controls1;
|
|
4101
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.zoomControl) && ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl = _theme_controls1.zoomControl) == null ? void 0 : _theme_controls_zoomControl.value) !== zoom) {
|
|
4107
4102
|
theme.controls.zoomControl.value = zoom;
|
|
4108
4103
|
}
|
|
4109
4104
|
});
|
|
@@ -4129,31 +4124,40 @@ function debounce(func, wait) {
|
|
|
4129
4124
|
// 全屏
|
|
4130
4125
|
// =======================================================
|
|
4131
4126
|
theme == null ? void 0 : theme.on(EVENTS.fullscreenChange, function(info) {
|
|
4132
|
-
if (
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4127
|
+
if (theme.zoomUtil) {
|
|
4128
|
+
if ([
|
|
4129
|
+
0,
|
|
4130
|
+
180
|
|
4131
|
+
].includes(theme.orientationAngle) && info.isMobile && info.isCurrentFullscreen) {
|
|
4132
|
+
var // 代表移动端播放内容节点被旋转了 90度
|
|
4133
|
+
_theme_zoomUtil_setTransform, _theme_zoomUtil;
|
|
4134
|
+
(_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
|
|
4135
|
+
} else {
|
|
4136
|
+
var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
|
|
4137
|
+
(_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
|
|
4138
|
+
}
|
|
4142
4139
|
}
|
|
4143
4140
|
});
|
|
4144
4141
|
theme == null ? void 0 : theme.on(EVENTS.orientationChange, function(angle) {
|
|
4145
|
-
if (
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4142
|
+
if (theme.zoomUtil) {
|
|
4143
|
+
if ([
|
|
4144
|
+
0,
|
|
4145
|
+
180
|
|
4146
|
+
].includes(angle) && Utils.isMobile && theme.isCurrentFullscreen) {
|
|
4147
|
+
var // 代表移动端播放内容节点被旋转了 90度
|
|
4148
|
+
_theme_zoomUtil_setTransform, _theme_zoomUtil;
|
|
4149
|
+
(_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
|
|
4150
|
+
} else {
|
|
4151
|
+
var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
|
|
4152
|
+
(_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
|
|
4153
|
+
}
|
|
4155
4154
|
}
|
|
4156
4155
|
});
|
|
4156
|
+
// 日期选择器
|
|
4157
|
+
theme == null ? void 0 : theme.on(EVENTS.control.dateMonthChange, function(dates) {
|
|
4158
|
+
var _theme_controls_dateControl_emit, _theme_controls_dateControl, _theme_controls;
|
|
4159
|
+
(_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : (_theme_controls_dateControl_emit = _theme_controls_dateControl.emit) == null ? void 0 : _theme_controls_dateControl_emit.call(_theme_controls_dateControl, EVENTS.control.dateMonthChange, dates);
|
|
4160
|
+
});
|
|
4157
4161
|
}
|
|
4158
4162
|
/**
|
|
4159
4163
|
* 控件向主题发现通信消息 control.on -> theme.emit ,仅用来转发控件的事件
|
|
@@ -4356,9 +4360,9 @@ function debounce(func, wait) {
|
|
|
4356
4360
|
});
|
|
4357
4361
|
theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, function(open) {
|
|
4358
4362
|
var _theme_controls_dateControl, _theme_controls;
|
|
4359
|
-
if ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : _theme_controls_dateControl.
|
|
4360
|
-
var
|
|
4361
|
-
(_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_dateControl1 = _theme_controls1.dateControl) == null ? void 0 : (
|
|
4363
|
+
if ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : _theme_controls_dateControl.datePicker) {
|
|
4364
|
+
var _theme_controls_dateControl_datePicker, _theme_controls_dateControl1, _theme_controls1;
|
|
4365
|
+
(_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_dateControl1 = _theme_controls1.dateControl) == null ? void 0 : (_theme_controls_dateControl_datePicker = _theme_controls_dateControl1.datePicker) == null ? void 0 : _theme_controls_dateControl_datePicker.hide();
|
|
4362
4366
|
}
|
|
4363
4367
|
theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
|
|
4364
4368
|
});
|
|
@@ -4651,12 +4655,12 @@ function getDefaultExportFromCjs (x) {
|
|
|
4651
4655
|
* Released under the MIT License.
|
|
4652
4656
|
*/
|
|
4653
4657
|
|
|
4654
|
-
var dist$
|
|
4655
|
-
var hasRequiredDist$
|
|
4658
|
+
var dist$1;
|
|
4659
|
+
var hasRequiredDist$1;
|
|
4656
4660
|
|
|
4657
|
-
function requireDist$
|
|
4658
|
-
if (hasRequiredDist$
|
|
4659
|
-
hasRequiredDist$
|
|
4661
|
+
function requireDist$1 () {
|
|
4662
|
+
if (hasRequiredDist$1) return dist$1;
|
|
4663
|
+
hasRequiredDist$1 = 1;
|
|
4660
4664
|
|
|
4661
4665
|
/**
|
|
4662
4666
|
* Zoom position
|
|
@@ -5363,12 +5367,12 @@ function requireDist$2 () {
|
|
|
5363
5367
|
}();
|
|
5364
5368
|
Zoom.VERSION = '0.0.2';
|
|
5365
5369
|
|
|
5366
|
-
dist$
|
|
5367
|
-
return dist$
|
|
5370
|
+
dist$1 = Zoom;
|
|
5371
|
+
return dist$1;
|
|
5368
5372
|
}
|
|
5369
5373
|
|
|
5370
|
-
var distExports$
|
|
5371
|
-
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$
|
|
5374
|
+
var distExports$1 = requireDist$1();
|
|
5375
|
+
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
|
|
5372
5376
|
|
|
5373
5377
|
function _extends$h() {
|
|
5374
5378
|
_extends$h = Object.assign || function(target) {
|
|
@@ -6443,7 +6447,7 @@ function _set_prototype_of$d(o, p) {
|
|
|
6443
6447
|
return CapturePicture;
|
|
6444
6448
|
}(Control);
|
|
6445
6449
|
|
|
6446
|
-
var dist
|
|
6450
|
+
var dist = {};
|
|
6447
6451
|
|
|
6448
6452
|
/*
|
|
6449
6453
|
* @ezuikit/control-ptz v0.0.1
|
|
@@ -6451,11 +6455,11 @@ var dist$1 = {};
|
|
|
6451
6455
|
* Released under the MIT License.
|
|
6452
6456
|
*/
|
|
6453
6457
|
|
|
6454
|
-
var hasRequiredDist
|
|
6458
|
+
var hasRequiredDist;
|
|
6455
6459
|
|
|
6456
|
-
function requireDist
|
|
6457
|
-
if (hasRequiredDist
|
|
6458
|
-
hasRequiredDist
|
|
6460
|
+
function requireDist () {
|
|
6461
|
+
if (hasRequiredDist) return dist;
|
|
6462
|
+
hasRequiredDist = 1;
|
|
6459
6463
|
|
|
6460
6464
|
var deepmerge$1 = deepmerge;
|
|
6461
6465
|
var utilsTools = require$$1;
|
|
@@ -7378,13 +7382,13 @@ function requireDist$1 () {
|
|
|
7378
7382
|
return Ptz;
|
|
7379
7383
|
}(BasePtz);
|
|
7380
7384
|
|
|
7381
|
-
dist
|
|
7382
|
-
dist
|
|
7383
|
-
dist
|
|
7384
|
-
return dist
|
|
7385
|
+
dist.BasePtz = BasePtz;
|
|
7386
|
+
dist.MobilePtz = MobilePtz;
|
|
7387
|
+
dist.Ptz = Ptz;
|
|
7388
|
+
return dist;
|
|
7385
7389
|
}
|
|
7386
7390
|
|
|
7387
|
-
var distExports
|
|
7391
|
+
var distExports = requireDist();
|
|
7388
7392
|
|
|
7389
7393
|
function _defineProperties$4(target, props) {
|
|
7390
7394
|
for(var i = 0; i < props.length; i++){
|
|
@@ -7483,7 +7487,7 @@ function _set_prototype_of$c(o, p) {
|
|
|
7483
7487
|
this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
|
|
7484
7488
|
this.$panel.appendChild(this.$turntable);
|
|
7485
7489
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7486
|
-
this._ptzControl = new distExports
|
|
7490
|
+
this._ptzControl = new distExports.Ptz(this.$turntable, _extends$b({}, this._options, {
|
|
7487
7491
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
7488
7492
|
onDirection: this._onDirection.bind(this)
|
|
7489
7493
|
}));
|
|
@@ -7492,7 +7496,7 @@ function _set_prototype_of$c(o, p) {
|
|
|
7492
7496
|
};
|
|
7493
7497
|
_proto.renderMobileExtend = function renderMobileExtend($container) {
|
|
7494
7498
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7495
|
-
if (!this._ptzControl1) this._ptzControl1 = new distExports
|
|
7499
|
+
if (!this._ptzControl1) this._ptzControl1 = new distExports.MobilePtz($container, _extends$b({}, this._options, {
|
|
7496
7500
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
7497
7501
|
onDirection: this._onDirection.bind(this)
|
|
7498
7502
|
}));
|
|
@@ -8620,541 +8624,6 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8620
8624
|
return Speed;
|
|
8621
8625
|
}(Select);
|
|
8622
8626
|
|
|
8623
|
-
/*
|
|
8624
|
-
* @ezuikit/control-date-picker v0.0.1-alpha.2
|
|
8625
|
-
* Copyright (c) 2025-11-12 Ezviz-OpenBiz
|
|
8626
|
-
* Released under the MIT License.
|
|
8627
|
-
*/
|
|
8628
|
-
|
|
8629
|
-
var dist;
|
|
8630
|
-
var hasRequiredDist;
|
|
8631
|
-
|
|
8632
|
-
function requireDist () {
|
|
8633
|
-
if (hasRequiredDist) return dist;
|
|
8634
|
-
hasRequiredDist = 1;
|
|
8635
|
-
|
|
8636
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8637
|
-
try {
|
|
8638
|
-
var info = gen[key](arg);
|
|
8639
|
-
var value = info.value;
|
|
8640
|
-
} catch (error) {
|
|
8641
|
-
reject(error);
|
|
8642
|
-
return;
|
|
8643
|
-
}
|
|
8644
|
-
if (info.done) {
|
|
8645
|
-
resolve(value);
|
|
8646
|
-
} else {
|
|
8647
|
-
Promise.resolve(value).then(_next, _throw);
|
|
8648
|
-
}
|
|
8649
|
-
}
|
|
8650
|
-
function _async_to_generator(fn) {
|
|
8651
|
-
return function() {
|
|
8652
|
-
var self = this, args = arguments;
|
|
8653
|
-
return new Promise(function(resolve, reject) {
|
|
8654
|
-
var gen = fn.apply(self, args);
|
|
8655
|
-
function _next(value) {
|
|
8656
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
8657
|
-
}
|
|
8658
|
-
function _throw(err) {
|
|
8659
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8660
|
-
}
|
|
8661
|
-
_next(undefined);
|
|
8662
|
-
});
|
|
8663
|
-
};
|
|
8664
|
-
}
|
|
8665
|
-
function _ts_generator(thisArg, body) {
|
|
8666
|
-
var f, y, t, _ = {
|
|
8667
|
-
label: 0,
|
|
8668
|
-
sent: function() {
|
|
8669
|
-
if (t[0] & 1) throw t[1];
|
|
8670
|
-
return t[1];
|
|
8671
|
-
},
|
|
8672
|
-
trys: [],
|
|
8673
|
-
ops: []
|
|
8674
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
8675
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
8676
|
-
return this;
|
|
8677
|
-
}), g;
|
|
8678
|
-
function verb(n) {
|
|
8679
|
-
return function(v) {
|
|
8680
|
-
return step([
|
|
8681
|
-
n,
|
|
8682
|
-
v
|
|
8683
|
-
]);
|
|
8684
|
-
};
|
|
8685
|
-
}
|
|
8686
|
-
function step(op) {
|
|
8687
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8688
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
8689
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
8690
|
-
if (y = 0, t) op = [
|
|
8691
|
-
op[0] & 2,
|
|
8692
|
-
t.value
|
|
8693
|
-
];
|
|
8694
|
-
switch(op[0]){
|
|
8695
|
-
case 0:
|
|
8696
|
-
case 1:
|
|
8697
|
-
t = op;
|
|
8698
|
-
break;
|
|
8699
|
-
case 4:
|
|
8700
|
-
_.label++;
|
|
8701
|
-
return {
|
|
8702
|
-
value: op[1],
|
|
8703
|
-
done: false
|
|
8704
|
-
};
|
|
8705
|
-
case 5:
|
|
8706
|
-
_.label++;
|
|
8707
|
-
y = op[1];
|
|
8708
|
-
op = [
|
|
8709
|
-
0
|
|
8710
|
-
];
|
|
8711
|
-
continue;
|
|
8712
|
-
case 7:
|
|
8713
|
-
op = _.ops.pop();
|
|
8714
|
-
_.trys.pop();
|
|
8715
|
-
continue;
|
|
8716
|
-
default:
|
|
8717
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
8718
|
-
_ = 0;
|
|
8719
|
-
continue;
|
|
8720
|
-
}
|
|
8721
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
8722
|
-
_.label = op[1];
|
|
8723
|
-
break;
|
|
8724
|
-
}
|
|
8725
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
8726
|
-
_.label = t[1];
|
|
8727
|
-
t = op;
|
|
8728
|
-
break;
|
|
8729
|
-
}
|
|
8730
|
-
if (t && _.label < t[2]) {
|
|
8731
|
-
_.label = t[2];
|
|
8732
|
-
_.ops.push(op);
|
|
8733
|
-
break;
|
|
8734
|
-
}
|
|
8735
|
-
if (t[2]) _.ops.pop();
|
|
8736
|
-
_.trys.pop();
|
|
8737
|
-
continue;
|
|
8738
|
-
}
|
|
8739
|
-
op = body.call(thisArg, _);
|
|
8740
|
-
} catch (e) {
|
|
8741
|
-
op = [
|
|
8742
|
-
6,
|
|
8743
|
-
e
|
|
8744
|
-
];
|
|
8745
|
-
y = 0;
|
|
8746
|
-
} finally{
|
|
8747
|
-
f = t = 0;
|
|
8748
|
-
}
|
|
8749
|
-
if (op[0] & 5) throw op[1];
|
|
8750
|
-
return {
|
|
8751
|
-
value: op[0] ? op[1] : void 0,
|
|
8752
|
-
done: true
|
|
8753
|
-
};
|
|
8754
|
-
}
|
|
8755
|
-
}
|
|
8756
|
-
var AppendJS = /*#__PURE__*/ function() {
|
|
8757
|
-
function AppendJS() {}
|
|
8758
|
-
AppendJS.loadScript = function loadScript(src) {
|
|
8759
|
-
return _async_to_generator(function() {
|
|
8760
|
-
return _ts_generator(this, function(_state) {
|
|
8761
|
-
switch(_state.label){
|
|
8762
|
-
case 0:
|
|
8763
|
-
return [
|
|
8764
|
-
4,
|
|
8765
|
-
new Promise(function(resolve, reject) {
|
|
8766
|
-
if (AppendJS.LoadedScr.includes(src)) {
|
|
8767
|
-
return resolve(src);
|
|
8768
|
-
}
|
|
8769
|
-
if (AppendJS.LoadingScrQueue[src]) {
|
|
8770
|
-
return AppendJS.LoadingScrQueue[src].push(resolve);
|
|
8771
|
-
} else {
|
|
8772
|
-
AppendJS.LoadingScrQueue[src] = [
|
|
8773
|
-
resolve
|
|
8774
|
-
];
|
|
8775
|
-
}
|
|
8776
|
-
var link;
|
|
8777
|
-
if (src.includes('.js')) {
|
|
8778
|
-
link = document.createElement('script');
|
|
8779
|
-
link.src = src;
|
|
8780
|
-
link.async = true;
|
|
8781
|
-
} else if (src.includes('.css')) {
|
|
8782
|
-
link = document.createElement('link');
|
|
8783
|
-
link.rel = 'stylesheet';
|
|
8784
|
-
link.href = src;
|
|
8785
|
-
}
|
|
8786
|
-
link.onload = function() {
|
|
8787
|
-
AppendJS.LoadedScr.push(src);
|
|
8788
|
-
AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
|
|
8789
|
-
return resolve(src);
|
|
8790
|
-
});
|
|
8791
|
-
AppendJS.LoadingScrQueue[src] = [];
|
|
8792
|
-
};
|
|
8793
|
-
link.onerror = function() {
|
|
8794
|
-
return reject(new Error('Failed to load ' + src));
|
|
8795
|
-
};
|
|
8796
|
-
document.head.appendChild(link);
|
|
8797
|
-
})
|
|
8798
|
-
];
|
|
8799
|
-
case 1:
|
|
8800
|
-
return [
|
|
8801
|
-
2,
|
|
8802
|
-
_state.sent()
|
|
8803
|
-
];
|
|
8804
|
-
}
|
|
8805
|
-
});
|
|
8806
|
-
})();
|
|
8807
|
-
};
|
|
8808
|
-
AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
|
|
8809
|
-
return _async_to_generator(function() {
|
|
8810
|
-
return _ts_generator(this, function(_state) {
|
|
8811
|
-
switch(_state.label){
|
|
8812
|
-
case 0:
|
|
8813
|
-
return [
|
|
8814
|
-
4,
|
|
8815
|
-
Promise.all(srcArr.map(AppendJS.loadScript))
|
|
8816
|
-
];
|
|
8817
|
-
case 1:
|
|
8818
|
-
return [
|
|
8819
|
-
2,
|
|
8820
|
-
_state.sent()
|
|
8821
|
-
];
|
|
8822
|
-
}
|
|
8823
|
-
});
|
|
8824
|
-
})();
|
|
8825
|
-
};
|
|
8826
|
-
AppendJS.remove = function remove(src) {
|
|
8827
|
-
src.forEach(function(item) {
|
|
8828
|
-
var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
|
|
8829
|
-
if (link) {
|
|
8830
|
-
link.remove();
|
|
8831
|
-
}
|
|
8832
|
-
});
|
|
8833
|
-
};
|
|
8834
|
-
AppendJS.clear = function clear() {
|
|
8835
|
-
AppendJS.remove(AppendJS.LoadedScr);
|
|
8836
|
-
};
|
|
8837
|
-
return AppendJS;
|
|
8838
|
-
}();
|
|
8839
|
-
/** 已经加载完的js/css */ AppendJS.LoadedScr = [];
|
|
8840
|
-
/** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
|
|
8841
|
-
|
|
8842
|
-
function _defineProperties(target, props) {
|
|
8843
|
-
for(var i = 0; i < props.length; i++){
|
|
8844
|
-
var descriptor = props[i];
|
|
8845
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
8846
|
-
descriptor.configurable = true;
|
|
8847
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
8848
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
8849
|
-
}
|
|
8850
|
-
}
|
|
8851
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
8852
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
8853
|
-
return Constructor;
|
|
8854
|
-
}
|
|
8855
|
-
var DEFAULT_OPTIONS = {
|
|
8856
|
-
staticPath: '.',
|
|
8857
|
-
place: 'top-right',
|
|
8858
|
-
language: 'zh-CN',
|
|
8859
|
-
current: new Date(),
|
|
8860
|
-
maxDate: new Date()
|
|
8861
|
-
};
|
|
8862
|
-
/**
|
|
8863
|
-
* 日期选择器
|
|
8864
|
-
*/ var DatePicker = /*#__PURE__*/ function() {
|
|
8865
|
-
function DatePicker(container, options) {
|
|
8866
|
-
var _this = this;
|
|
8867
|
-
this._open = false;
|
|
8868
|
-
this._change = true;
|
|
8869
|
-
this.$container = container;
|
|
8870
|
-
this.options = Object.assign({}, DEFAULT_OPTIONS, options);
|
|
8871
|
-
this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
|
|
8872
|
-
if (this.options.current) {
|
|
8873
|
-
this._date = this.options.current;
|
|
8874
|
-
}
|
|
8875
|
-
this._init();
|
|
8876
|
-
this.$container.addEventListener('click', function() {
|
|
8877
|
-
if (_this._open) _this.hide();
|
|
8878
|
-
else _this.show();
|
|
8879
|
-
});
|
|
8880
|
-
document.body.addEventListener('click', function(e) {
|
|
8881
|
-
if (!_this.$container.contains(e.target)) {
|
|
8882
|
-
_this.hide();
|
|
8883
|
-
}
|
|
8884
|
-
});
|
|
8885
|
-
}
|
|
8886
|
-
var _proto = DatePicker.prototype;
|
|
8887
|
-
_proto._init = function _init() {
|
|
8888
|
-
var _this = this;
|
|
8889
|
-
// 因为挂载在行内,需要父标签设置 position: relative;
|
|
8890
|
-
this.$container.style.cssText += ";position: relative;";
|
|
8891
|
-
this.$container.classList.add("datepicker-inline-" + this.options.place);
|
|
8892
|
-
AppendJS.loadScriptsBatch([
|
|
8893
|
-
"" + this.options.staticPath + "/rec/jquery.min.js",
|
|
8894
|
-
"" + this.options.staticPath + "/rec/datepicker.min.css"
|
|
8895
|
-
]).then(function() {
|
|
8896
|
-
AppendJS.loadScriptsBatch([
|
|
8897
|
-
"" + _this.options.staticPath + "/rec/datepicker.js"
|
|
8898
|
-
]).then(function() {
|
|
8899
|
-
AppendJS.loadScriptsBatch([
|
|
8900
|
-
"" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
|
|
8901
|
-
"" + _this.options.staticPath + "/rec/datepicker.en-US.js"
|
|
8902
|
-
]).then(function() {
|
|
8903
|
-
window.$(_this.$container).datepicker({
|
|
8904
|
-
date: _this.options.current,
|
|
8905
|
-
language: _this.options.language,
|
|
8906
|
-
endDate: _this.options.maxDate,
|
|
8907
|
-
inline: true
|
|
8908
|
-
});
|
|
8909
|
-
_this.hide();
|
|
8910
|
-
window.$(_this.$container).on('pick.datepicker', function(e) {
|
|
8911
|
-
var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
|
|
8912
|
-
if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
|
|
8913
|
-
_this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
|
|
8914
|
-
} else if (e.view === 'month' && (((_this__date1 = _this._date) == null ? void 0 : _this__date1.getMonth()) !== e.date.getMonth() || ((_this__date2 = _this._date) == null ? void 0 : _this__date2.getFullYear()) !== e.date.getFullYear())) {
|
|
8915
|
-
_this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
|
|
8916
|
-
} else if ([
|
|
8917
|
-
'day',
|
|
8918
|
-
'pick'
|
|
8919
|
-
].includes(e.view || e.type) && (((_this__date3 = _this._date) == null ? void 0 : _this__date3.getDate()) !== e.date.getDate() || ((_this__date4 = _this._date) == null ? void 0 : _this__date4.getMonth()) !== e.date.getMonth() || ((_this__date5 = _this._date) == null ? void 0 : _this__date5.getFullYear()) !== e.date.getFullYear())) {
|
|
8920
|
-
if (_this._change) {
|
|
8921
|
-
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
|
|
8922
|
-
}
|
|
8923
|
-
_this._date = new Date(e.date.getTime());
|
|
8924
|
-
}
|
|
8925
|
-
if (e.view === 'day') _this.hide();
|
|
8926
|
-
_this._change = true;
|
|
8927
|
-
});
|
|
8928
|
-
});
|
|
8929
|
-
});
|
|
8930
|
-
});
|
|
8931
|
-
};
|
|
8932
|
-
/**
|
|
8933
|
-
* 设置日期, change = true 时触发 onChange 事件
|
|
8934
|
-
*
|
|
8935
|
-
* @param date 设置的日期
|
|
8936
|
-
* @param change 是否触发 onChange 事件
|
|
8937
|
-
*/ _proto.setDate = function setDate(date, change) {
|
|
8938
|
-
if (change === void 0) change = true;
|
|
8939
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8940
|
-
if ($datepicker) {
|
|
8941
|
-
this._change = change;
|
|
8942
|
-
window.$(this.$container).datepicker('setDate', date);
|
|
8943
|
-
}
|
|
8944
|
-
};
|
|
8945
|
-
/**
|
|
8946
|
-
* 隐藏面板, 会触发 onPanelChange 事件
|
|
8947
|
-
*/ _proto.hide = function hide() {
|
|
8948
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8949
|
-
if ($datepicker) {
|
|
8950
|
-
if (this._open) {
|
|
8951
|
-
this._open = false;
|
|
8952
|
-
this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
|
|
8953
|
-
}
|
|
8954
|
-
$datepicker.classList.add('datepicker-hide');
|
|
8955
|
-
}
|
|
8956
|
-
};
|
|
8957
|
-
/**
|
|
8958
|
-
* 显示面板, 会触发 onPanelChange 事件
|
|
8959
|
-
*/ _proto.show = function show() {
|
|
8960
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8961
|
-
if ($datepicker) {
|
|
8962
|
-
var _window_$_datepicker, _window_$;
|
|
8963
|
-
if (!this._open) {
|
|
8964
|
-
this._open = true;
|
|
8965
|
-
this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
|
|
8966
|
-
}
|
|
8967
|
-
if (this._date) this.setDate(this._date, false);
|
|
8968
|
-
(_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
|
|
8969
|
-
if (this.options.place === 'bottom-left') {
|
|
8970
|
-
$datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
|
|
8971
|
-
} else {
|
|
8972
|
-
$datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
|
|
8973
|
-
}
|
|
8974
|
-
$datepicker.classList.remove('datepicker-hide');
|
|
8975
|
-
}
|
|
8976
|
-
};
|
|
8977
|
-
/**
|
|
8978
|
-
* 销毁
|
|
8979
|
-
*/ _proto.destroy = function destroy() {
|
|
8980
|
-
this.hide();
|
|
8981
|
-
this._date = undefined;
|
|
8982
|
-
window.$(this.$container).datepicker('destroy');
|
|
8983
|
-
// AppendJS.remove([
|
|
8984
|
-
// `${this.options.staticPath}/rec/jquery.min.js`,
|
|
8985
|
-
// `${this.options.staticPath}/rec/datepicker.min.css`,
|
|
8986
|
-
// `${this.options.staticPath}/rec/datepicker.js`,
|
|
8987
|
-
// `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
|
|
8988
|
-
// `${this.options.staticPath}/rec/datepicker.en-US.js`,
|
|
8989
|
-
// ]);
|
|
8990
|
-
};
|
|
8991
|
-
_create_class(DatePicker, [
|
|
8992
|
-
{
|
|
8993
|
-
key: "date",
|
|
8994
|
-
get: /**
|
|
8995
|
-
* 获取日期
|
|
8996
|
-
*/ function get() {
|
|
8997
|
-
return this._date;
|
|
8998
|
-
}
|
|
8999
|
-
}
|
|
9000
|
-
]);
|
|
9001
|
-
return DatePicker;
|
|
9002
|
-
}();
|
|
9003
|
-
|
|
9004
|
-
dist = DatePicker;
|
|
9005
|
-
return dist;
|
|
9006
|
-
}
|
|
9007
|
-
|
|
9008
|
-
var distExports = requireDist();
|
|
9009
|
-
var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
9010
|
-
|
|
9011
|
-
/**
|
|
9012
|
-
* @description 时间操作
|
|
9013
|
-
*/ var DateTime = /*#__PURE__*/ function() {
|
|
9014
|
-
function DateTime() {}
|
|
9015
|
-
/**
|
|
9016
|
-
* @description 时间格式化
|
|
9017
|
-
* @param {Date | number | string} date
|
|
9018
|
-
* @param {string} formatType 格式 'YYYY-MM-DD hh:mm:ss' 或 'YYYYMMDDhhmmss' 或 'YYYY/MM/DD hh:mm:ss' 或 'hh:mm:ss' 或 'YYYYMMDDThhmmssZ'
|
|
9019
|
-
* @param {number} timeZone 时区偏移量 默认 0
|
|
9020
|
-
*/ DateTime.formate = function formate(date, formatType, timeZone) {
|
|
9021
|
-
if (timeZone === void 0) timeZone = 0;
|
|
9022
|
-
var dateTime = date;
|
|
9023
|
-
if (typeof date === 'string') {
|
|
9024
|
-
dateTime = DateTime.strToDate(date);
|
|
9025
|
-
} else if (typeof date === 'number') {
|
|
9026
|
-
dateTime = new Date(date);
|
|
9027
|
-
}
|
|
9028
|
-
dateTime = new Date(dateTime.getTime() - timeZone * 3600 * 1000);
|
|
9029
|
-
var year = dateTime.getFullYear();
|
|
9030
|
-
var month = String(dateTime.getMonth() + 1).padStart(2, '0');
|
|
9031
|
-
var day = String(dateTime.getDate()).padStart(2, '0');
|
|
9032
|
-
var hours = String(dateTime.getHours()).padStart(2, '0');
|
|
9033
|
-
var minutes = String(dateTime.getMinutes()).padStart(2, '0');
|
|
9034
|
-
var seconds = String(dateTime.getSeconds()).padStart(2, '0');
|
|
9035
|
-
switch(formatType){
|
|
9036
|
-
case 'YYYY-MM-DD hh:mm:ss':
|
|
9037
|
-
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
9038
|
-
case 'YYYYMMDDhhmmss':
|
|
9039
|
-
return "" + year + month + day + hours + minutes + seconds;
|
|
9040
|
-
case 'YYYY/MM/DD hh:mm:ss':
|
|
9041
|
-
return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
9042
|
-
case 'YYYYMMDDThhmmssZ':
|
|
9043
|
-
return "" + year + month + day + "T" + hours + minutes + seconds + "Z";
|
|
9044
|
-
case 'YYYY/MM/DD':
|
|
9045
|
-
return year + "/" + month + "/" + day;
|
|
9046
|
-
case 'YYYYMMDD':
|
|
9047
|
-
return "" + year + month + day;
|
|
9048
|
-
case 'YYYY-MM-DD':
|
|
9049
|
-
return year + "-" + month + "-" + day;
|
|
9050
|
-
case 'YYYY':
|
|
9051
|
-
return "" + year;
|
|
9052
|
-
case 'MM':
|
|
9053
|
-
return "" + month;
|
|
9054
|
-
case 'DD':
|
|
9055
|
-
return "" + day;
|
|
9056
|
-
case 'hh:mm:ss':
|
|
9057
|
-
return hours + ":" + minutes + ":" + seconds;
|
|
9058
|
-
case 'hh':
|
|
9059
|
-
return "" + hours;
|
|
9060
|
-
case 'mm':
|
|
9061
|
-
return "" + minutes;
|
|
9062
|
-
case 'ss':
|
|
9063
|
-
return "" + seconds;
|
|
9064
|
-
default:
|
|
9065
|
-
throw new Error('Unsupported format type');
|
|
9066
|
-
}
|
|
9067
|
-
};
|
|
9068
|
-
/**
|
|
9069
|
-
* @description 对比两个时间的差值
|
|
9070
|
-
* @param {Date | string | number} date1
|
|
9071
|
-
* @param {Date | string | number} date2
|
|
9072
|
-
* @param {"year" | "month" | "day" | "hour" | "minute" | "second"} diffType
|
|
9073
|
-
*/ DateTime.diff = function diff(date1, date2, diffType) {
|
|
9074
|
-
/** @type {Date} */ var dateTime1 = date1;
|
|
9075
|
-
if (typeof date1 === 'string') {
|
|
9076
|
-
dateTime1 = DateTime.strToDate(date1);
|
|
9077
|
-
} else if (typeof date1 === 'number') {
|
|
9078
|
-
dateTime1 = new Date(date1);
|
|
9079
|
-
}
|
|
9080
|
-
/** @type {Date} */ var dateTime2 = date2;
|
|
9081
|
-
if (typeof date2 === 'string') {
|
|
9082
|
-
dateTime1 = DateTime.strToDate(date2);
|
|
9083
|
-
} else if (typeof date2 === 'number') {
|
|
9084
|
-
dateTime1 = new Date(date2);
|
|
9085
|
-
}
|
|
9086
|
-
var diffSecond = dateTime1.getTime() - dateTime2.getTime();
|
|
9087
|
-
// diff
|
|
9088
|
-
switch(diffType){
|
|
9089
|
-
case 'year':
|
|
9090
|
-
return dateTime1.getFullYear() - dateTime2.getFullYear();
|
|
9091
|
-
case 'month':
|
|
9092
|
-
// 计算总月份差
|
|
9093
|
-
// eslint-disable-next-line no-case-declarations
|
|
9094
|
-
var months = (dateTime1.getFullYear() - dateTime2.getFullYear()) * 12 + (dateTime1.getMonth() - dateTime2.getMonth());
|
|
9095
|
-
// 如果结束日的日期小于开始日的日期,则减去一个月
|
|
9096
|
-
if (dateTime1.getDate() < dateTime2.getDate()) {
|
|
9097
|
-
months--;
|
|
9098
|
-
}
|
|
9099
|
-
return months;
|
|
9100
|
-
case 'day':
|
|
9101
|
-
return diffSecond / 60 / 60 / 24;
|
|
9102
|
-
case 'hour':
|
|
9103
|
-
return diffSecond / 60 / 60;
|
|
9104
|
-
case 'minute':
|
|
9105
|
-
return diffSecond / 60;
|
|
9106
|
-
case 'second':
|
|
9107
|
-
return diffSecond;
|
|
9108
|
-
default:
|
|
9109
|
-
throw new Error('Unsupported diff type');
|
|
9110
|
-
}
|
|
9111
|
-
};
|
|
9112
|
-
DateTime.now = function now() {
|
|
9113
|
-
return Date.now();
|
|
9114
|
-
};
|
|
9115
|
-
/**
|
|
9116
|
-
*
|
|
9117
|
-
* @param {string} str 日期, 2025-04-10 10:10:10 或 2025/04/10 10:10:10 或 20250410101010 或 20250410T101010Z 或 秒 或 毫秒
|
|
9118
|
-
* @example
|
|
9119
|
-
* DateTime.strToDate("2025/04/10 10:10:10") // Date
|
|
9120
|
-
* DateTime.strToDate("2025-04-10 10:10:10") // Date
|
|
9121
|
-
* DateTime.strToDate("20250410101010") // Date
|
|
9122
|
-
* DateTime.strToDate("20250410T101010Z") // Date
|
|
9123
|
-
*/ DateTime.strToDate = function strToDate(str) {
|
|
9124
|
-
var time = (str + '').replace(/-/gi, '').replace(/:/gi, '').replace(/\//gi, '').replace(/ /gi, '').replace(/T|Z/gi, '');
|
|
9125
|
-
// 兼容
|
|
9126
|
-
if ((str + '').length === 10) {
|
|
9127
|
-
// 时间戳 秒
|
|
9128
|
-
return new Date(+str);
|
|
9129
|
-
} else if ((str + '').length === 13) {
|
|
9130
|
-
// 时间戳 毫秒
|
|
9131
|
-
return new Date(+str);
|
|
9132
|
-
}
|
|
9133
|
-
var year = time.slice(0, 4);
|
|
9134
|
-
var month = time.slice(4, 6);
|
|
9135
|
-
var day = time.slice(6, 8);
|
|
9136
|
-
var hour = time.slice(8, 10);
|
|
9137
|
-
var minute = time.slice(10, 12);
|
|
9138
|
-
var second = time.slice(12, 14);
|
|
9139
|
-
return new Date(year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second);
|
|
9140
|
-
};
|
|
9141
|
-
/**
|
|
9142
|
-
* @description 补充十位
|
|
9143
|
-
* @param {number} num
|
|
9144
|
-
* @returns {string}
|
|
9145
|
-
* @example
|
|
9146
|
-
* DateTime.padStart(1) // "01"
|
|
9147
|
-
* DateTime.padStart(33) // "33"
|
|
9148
|
-
*/ DateTime.padStart = function padStart(num) {
|
|
9149
|
-
if (num < 10) {
|
|
9150
|
-
return '0' + num;
|
|
9151
|
-
} else {
|
|
9152
|
-
return num + '';
|
|
9153
|
-
}
|
|
9154
|
-
};
|
|
9155
|
-
return DateTime;
|
|
9156
|
-
}();
|
|
9157
|
-
|
|
9158
8627
|
function _extends$5() {
|
|
9159
8628
|
_extends$5 = Object.assign || function(target) {
|
|
9160
8629
|
for(var i = 1; i < arguments.length; i++){
|
|
@@ -9197,20 +8666,29 @@ function _set_prototype_of$6(o, p) {
|
|
|
9197
8666
|
function DatePickerControl(options) {
|
|
9198
8667
|
var _this;
|
|
9199
8668
|
var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
|
|
9200
|
-
_this = Control.call(this, _extends$5({
|
|
8669
|
+
_this = Control.call(this, _extends$5({
|
|
8670
|
+
maxDate: new Date()
|
|
8671
|
+
}, options, {
|
|
9201
8672
|
tagName: 'span',
|
|
9202
8673
|
controlType: 'button',
|
|
9203
8674
|
classNameSuffix: 'date'
|
|
9204
8675
|
})) || this;
|
|
9205
8676
|
_this.options = options;
|
|
9206
|
-
_this._value = DateTime.
|
|
8677
|
+
_this._value = require$$1.DateTime.format(((_this_options_props = _this.options.props) == null ? void 0 : (_this_options_props_urlInfo = _this_options_props.urlInfo) == null ? void 0 : (_this_options_props_urlInfo_searchParams = _this_options_props_urlInfo.searchParams) == null ? void 0 : _this_options_props_urlInfo_searchParams.begin) || new Date(), 'YYYY-MM-DD');
|
|
9207
8678
|
_this._render();
|
|
8679
|
+
// 日期上的点
|
|
8680
|
+
_this.on(EVENTS.control.dateMonthChange, function(dates) {
|
|
8681
|
+
var _this_datePicker_updateBadges, _this_datePicker;
|
|
8682
|
+
(_this_datePicker = _this.datePicker) == null ? void 0 : (_this_datePicker_updateBadges = _this_datePicker.updateBadges) == null ? void 0 : _this_datePicker_updateBadges.call(_this_datePicker, dates);
|
|
8683
|
+
});
|
|
9208
8684
|
return _this;
|
|
9209
8685
|
}
|
|
9210
8686
|
var _proto = DatePickerControl.prototype;
|
|
9211
8687
|
_proto._render = function _render() {
|
|
9212
8688
|
var _this = this;
|
|
9213
|
-
|
|
8689
|
+
var _this_options_props;
|
|
8690
|
+
var isMobile1 = require$$1.isMobile();
|
|
8691
|
+
if (isMobile1) {
|
|
9214
8692
|
var _this_locale;
|
|
9215
8693
|
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + '-mobile-date-filter" title="' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CALENDAR) || '') + '">\n <span class="' + PREFIX_CLASS + '-mobile-date-filter-value">' + this._getDateStr() + "</span>\n " + IconComponents.filter() + "\n <span>";
|
|
9216
8694
|
} else {
|
|
@@ -9219,25 +8697,45 @@ function _set_prototype_of$6(o, p) {
|
|
|
9219
8697
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
|
|
9220
8698
|
});
|
|
9221
8699
|
}
|
|
9222
|
-
this.
|
|
9223
|
-
|
|
9224
|
-
|
|
8700
|
+
this.datePicker = new controlDatePicker.DatePicker(this.$container, {
|
|
8701
|
+
isMobile: isMobile1,
|
|
8702
|
+
getPopupContainer: function() {
|
|
8703
|
+
return _this.$container;
|
|
8704
|
+
},
|
|
8705
|
+
mode: 'date',
|
|
8706
|
+
offset: [
|
|
8707
|
+
0,
|
|
8708
|
+
-10
|
|
8709
|
+
],
|
|
8710
|
+
badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
|
|
8711
|
+
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
9225
8712
|
current: new Date(this._value + ' 00:00:00'),
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
8713
|
+
placement: 'tr',
|
|
8714
|
+
triggerClose: true,
|
|
8715
|
+
disabledDate: function(date) {
|
|
8716
|
+
return date.getTime() > (_this.options.maxDate || new Date()).getTime();
|
|
8717
|
+
},
|
|
8718
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8719
|
+
onOk: function(date, _mode) {
|
|
8720
|
+
if (date && _this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD') && isMobile1) {
|
|
8721
|
+
_this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
|
|
8722
|
+
_this.options.onOk == null ? void 0 : _this.options.onOk.call(_this.options, date);
|
|
9232
8723
|
_this.emit(EVENTS.control.dateChange, date);
|
|
9233
8724
|
if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
9234
8725
|
_this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
|
|
9235
8726
|
}
|
|
9236
8727
|
}
|
|
9237
8728
|
},
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
8729
|
+
onChange: function(date, mode) {
|
|
8730
|
+
if (date && _this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
|
|
8731
|
+
_this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
|
|
8732
|
+
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
|
|
8733
|
+
_this.emit(EVENTS.control.dateChange, date);
|
|
8734
|
+
}
|
|
8735
|
+
},
|
|
8736
|
+
onOpenChange: function(open) {
|
|
8737
|
+
_this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.datePicker.current);
|
|
8738
|
+
_this.emit(EVENTS.control.datePanelOpenChange, open, _this.datePicker.current);
|
|
9241
8739
|
}
|
|
9242
8740
|
});
|
|
9243
8741
|
};
|
|
@@ -9247,28 +8745,27 @@ function _set_prototype_of$6(o, p) {
|
|
|
9247
8745
|
* @param change 是否触发 onChange 事件
|
|
9248
8746
|
*/ _proto.setDate = function setDate(date, change) {
|
|
9249
8747
|
if (change === void 0) change = true;
|
|
9250
|
-
var
|
|
9251
|
-
(
|
|
9252
|
-
if (date && !change && this._value !== DateTime.
|
|
9253
|
-
this._value = DateTime.
|
|
8748
|
+
var _this_datePicker;
|
|
8749
|
+
(_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
|
|
8750
|
+
if (date && !change && this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD')) {
|
|
8751
|
+
this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
|
|
9254
8752
|
if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
9255
8753
|
this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
|
|
9256
8754
|
}
|
|
9257
8755
|
}
|
|
9258
8756
|
};
|
|
9259
8757
|
_proto.reset = function reset() {
|
|
9260
|
-
|
|
9261
|
-
(_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
|
|
8758
|
+
if (this.datePicker) this.datePicker.open = false;
|
|
9262
8759
|
Control.prototype.reset.call(this);
|
|
9263
8760
|
};
|
|
9264
8761
|
/**
|
|
9265
8762
|
* 销毁控件
|
|
9266
8763
|
* @override
|
|
9267
8764
|
*/ _proto.destroy = function destroy() {
|
|
9268
|
-
if (this.
|
|
9269
|
-
this.
|
|
8765
|
+
if (this.datePicker) {
|
|
8766
|
+
this.datePicker.destroy();
|
|
9270
8767
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9271
|
-
this.
|
|
8768
|
+
this.datePicker = null;
|
|
9272
8769
|
}
|
|
9273
8770
|
Control.prototype.destroy.call(this);
|
|
9274
8771
|
};
|
|
@@ -9278,6 +8775,7 @@ function _set_prototype_of$6(o, p) {
|
|
|
9278
8775
|
};
|
|
9279
8776
|
/**
|
|
9280
8777
|
* 点击 Control 会触发
|
|
8778
|
+
* @overload super._onControlClick(e: Event)
|
|
9281
8779
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9282
8780
|
Control.prototype._onControlClick.call(this, e);
|
|
9283
8781
|
};
|
|
@@ -10350,8 +9848,7 @@ var _renderDatePicker = function(theme, container, props) {
|
|
|
10350
9848
|
return container;
|
|
10351
9849
|
},
|
|
10352
9850
|
language: theme.options.language,
|
|
10353
|
-
locales: theme.i18n.translations
|
|
10354
|
-
staticPath: theme.options.staticPath
|
|
9851
|
+
locales: theme.i18n.translations
|
|
10355
9852
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
|
|
10356
9853
|
props: props
|
|
10357
9854
|
}));
|
|
@@ -10650,7 +10147,18 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10650
10147
|
*/ _this._footerMoreControl = null, /** 头部控件 @since 0.0.1 @private */ _this._header = null, /** 低部控件 @since 0.0.1 @private */ _this._footer = null, /** 回放底部时间轴 @since 0.0.1 @private */ _this._recFooter = null, /**
|
|
10651
10148
|
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
10652
10149
|
* @private
|
|
10653
|
-
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null,
|
|
10150
|
+
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
|
|
10151
|
+
// * 记录回放的月份
|
|
10152
|
+
// *
|
|
10153
|
+
// * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
|
|
10154
|
+
// *
|
|
10155
|
+
// * value: 月份列表 比如 ["2025-12-01", "2025-12-02"]
|
|
10156
|
+
// * @private
|
|
10157
|
+
// */
|
|
10158
|
+
// _recMonthObj: Record<string, string[]> = {};
|
|
10159
|
+
/**
|
|
10160
|
+
* 录像回放的月份列表 @private
|
|
10161
|
+
*/ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
|
|
10654
10162
|
_this._initOptions(options);
|
|
10655
10163
|
if (_this.options.type === 'ezopen') {
|
|
10656
10164
|
var _this_urlInfo_searchParams, _this_urlInfo;
|
|
@@ -10660,7 +10168,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10660
10168
|
}
|
|
10661
10169
|
if (_this.urlInfo.type === 'rec') {
|
|
10662
10170
|
var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
|
|
10663
|
-
_this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? DateTime.
|
|
10171
|
+
_this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? require$$1.DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : require$$1.DateTime.toDate(require$$1.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
|
|
10664
10172
|
}
|
|
10665
10173
|
}
|
|
10666
10174
|
_this._getRecType(_this.options.url);
|
|
@@ -10907,6 +10415,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10907
10415
|
this._themeData = null;
|
|
10908
10416
|
if (this.i18n) this.i18n = null;
|
|
10909
10417
|
this.recType = '';
|
|
10418
|
+
this.recMonth = []; // 清空数据
|
|
10910
10419
|
this.emit(EVENTS.theme.destroyed);
|
|
10911
10420
|
this.removeAllListeners();
|
|
10912
10421
|
if (this.logger) this.logger = null;
|
|
@@ -11872,7 +11381,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11872
11381
|
zh: zh,
|
|
11873
11382
|
en: en
|
|
11874
11383
|
};
|
|
11875
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.
|
|
11384
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.8';
|
|
11876
11385
|
|
|
11877
11386
|
exports.Control = Control;
|
|
11878
11387
|
exports.Fullscreen = Fullscreen;
|