@ezuikit/player-theme 2.0.2-beta.5 → 2.0.2-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v2.0.2-beta.5
3
- * Copyright (c) 2025-12-09 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.0.2-beta.7
3
+ * Copyright (c) 2025-12-10 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
- /** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
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
  * 主题控件相关
@@ -4062,11 +4065,11 @@ function debounce(func, wait) {
4062
4065
  // 对讲
4063
4066
  // =======================================================
4064
4067
  theme.on(EVENTS.talkingChange, function(talking) {
4065
- var _theme_controls_talkControl, _theme_controls;
4068
+ var _theme_controls, _theme_controls_talkControl, _theme_controls1;
4066
4069
  theme._talking = talking;
4067
- if (talking !== ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls.talkControl) == null ? void 0 : _theme_controls_talkControl.active)) {
4068
- var _theme_controls_talkControl1, _theme_controls1;
4069
- (_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls1.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
4070
+ 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)) {
4071
+ var _theme_controls_talkControl1, _theme_controls2;
4072
+ (_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls2.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
4070
4073
  }
4071
4074
  });
4072
4075
  theme.on(EVENTS.talkVolumeChange, function(value) {
@@ -4077,9 +4080,9 @@ function debounce(func, wait) {
4077
4080
  // 录制
4078
4081
  // =======================================================
4079
4082
  theme.on(EVENTS.recordingChange, function(recording) {
4080
- var _theme_controls_recordControl, _theme_controls;
4083
+ var _theme_controls, _theme_controls_recordControl, _theme_controls1;
4081
4084
  theme._recording = recording;
4082
- if (recording !== ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_recordControl = _theme_controls.recordControl) == null ? void 0 : _theme_controls_recordControl.active)) theme.controls.recordControl.active = recording;
4085
+ 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
4086
  });
4084
4087
  // =======================================================
4085
4088
  // 清晰度
@@ -4096,14 +4099,14 @@ function debounce(func, wait) {
4096
4099
  // 放大
4097
4100
  // =======================================================
4098
4101
  theme.on(EVENTS.zoomingChange, function(zooming) {
4099
- var _theme_controls_zoomControl1, _theme_controls1;
4100
- if (((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 = _theme_controls1.zoomControl) == null ? void 0 : _theme_controls_zoomControl1.active) !== zooming) {
4102
+ var _theme_controls1, _theme_controls_zoomControl1, _theme_controls2;
4103
+ 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
4104
  theme.controls.zoomControl.active = zooming;
4102
4105
  }
4103
4106
  });
4104
4107
  theme.on(EVENTS.zoomChange, function(zoom) {
4105
- var _theme_controls_zoomControl, _theme_controls;
4106
- if (((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_zoomControl = _theme_controls.zoomControl) == null ? void 0 : _theme_controls_zoomControl.value) !== zoom) {
4108
+ var _theme_controls, _theme_controls_zoomControl, _theme_controls1;
4109
+ 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
4110
  theme.controls.zoomControl.value = zoom;
4108
4111
  }
4109
4112
  });
@@ -4129,31 +4132,40 @@ function debounce(func, wait) {
4129
4132
  // 全屏
4130
4133
  // =======================================================
4131
4134
  theme == null ? void 0 : theme.on(EVENTS.fullscreenChange, function(info) {
4132
- if ([
4133
- 0,
4134
- 180
4135
- ].includes(theme.orientationAngle) && info.isMobile && info.isCurrentFullscreen) {
4136
- var // 代表移动端播放内容节点被旋转了 90度
4137
- _theme_zoomUtil_setTransform, _theme_zoomUtil;
4138
- (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
4139
- } else {
4140
- var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
4141
- (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
4135
+ if (theme.zoomUtil) {
4136
+ if ([
4137
+ 0,
4138
+ 180
4139
+ ].includes(theme.orientationAngle) && info.isMobile && info.isCurrentFullscreen) {
4140
+ var // 代表移动端播放内容节点被旋转了 90度
4141
+ _theme_zoomUtil_setTransform, _theme_zoomUtil;
4142
+ (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
4143
+ } else {
4144
+ var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
4145
+ (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
4146
+ }
4142
4147
  }
4143
4148
  });
4144
4149
  theme == null ? void 0 : theme.on(EVENTS.orientationChange, function(angle) {
4145
- if ([
4146
- 0,
4147
- 180
4148
- ].includes(angle) && Utils.isMobile && theme.isCurrentFullscreen) {
4149
- var // 代表移动端播放内容节点被旋转了 90度
4150
- _theme_zoomUtil_setTransform, _theme_zoomUtil;
4151
- (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
4152
- } else {
4153
- var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
4154
- (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
4150
+ if (theme.zoomUtil) {
4151
+ if ([
4152
+ 0,
4153
+ 180
4154
+ ].includes(angle) && Utils.isMobile && theme.isCurrentFullscreen) {
4155
+ var // 代表移动端播放内容节点被旋转了 90度
4156
+ _theme_zoomUtil_setTransform, _theme_zoomUtil;
4157
+ (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
4158
+ } else {
4159
+ var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
4160
+ (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
4161
+ }
4155
4162
  }
4156
4163
  });
4164
+ // 日期选择器
4165
+ theme == null ? void 0 : theme.on(EVENTS.control.dateMonthChange, function(dates) {
4166
+ var _theme_controls_dateControl_emit, _theme_controls_dateControl, _theme_controls;
4167
+ (_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);
4168
+ });
4157
4169
  }
4158
4170
  /**
4159
4171
  * 控件向主题发现通信消息 control.on -> theme.emit ,仅用来转发控件的事件
@@ -4355,10 +4367,10 @@ function debounce(func, wait) {
4355
4367
  theme.emit(EVENTS.control.timeLineChange, date);
4356
4368
  });
4357
4369
  theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, function(open) {
4358
- var _theme_controls_dateControl;
4359
- if ((_theme_controls_dateControl = theme.controls.dateControl) == null ? void 0 : _theme_controls_dateControl.dataPickerUtil) {
4360
- var _theme_controls_dateControl_dataPickerUtil, _theme_controls_dateControl1;
4361
- (_theme_controls_dateControl1 = theme.controls.dateControl) == null ? void 0 : (_theme_controls_dateControl_dataPickerUtil = _theme_controls_dateControl1.dataPickerUtil) == null ? void 0 : _theme_controls_dateControl_dataPickerUtil.hide();
4370
+ var _theme_controls_dateControl, _theme_controls;
4371
+ if ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : _theme_controls_dateControl.datePicker) {
4372
+ var _theme_controls_dateControl_datePicker, _theme_controls_dateControl1, _theme_controls1;
4373
+ (_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
4374
  }
4363
4375
  theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
4364
4376
  });
@@ -4651,12 +4663,12 @@ function getDefaultExportFromCjs (x) {
4651
4663
  * Released under the MIT License.
4652
4664
  */
4653
4665
 
4654
- var dist$2;
4655
- var hasRequiredDist$2;
4666
+ var dist$1;
4667
+ var hasRequiredDist$1;
4656
4668
 
4657
- function requireDist$2 () {
4658
- if (hasRequiredDist$2) return dist$2;
4659
- hasRequiredDist$2 = 1;
4669
+ function requireDist$1 () {
4670
+ if (hasRequiredDist$1) return dist$1;
4671
+ hasRequiredDist$1 = 1;
4660
4672
 
4661
4673
  /**
4662
4674
  * Zoom position
@@ -5363,12 +5375,12 @@ function requireDist$2 () {
5363
5375
  }();
5364
5376
  Zoom.VERSION = '0.0.2';
5365
5377
 
5366
- dist$2 = Zoom;
5367
- return dist$2;
5378
+ dist$1 = Zoom;
5379
+ return dist$1;
5368
5380
  }
5369
5381
 
5370
- var distExports$2 = requireDist$2();
5371
- var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$2);
5382
+ var distExports$1 = requireDist$1();
5383
+ var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
5372
5384
 
5373
5385
  function _extends$h() {
5374
5386
  _extends$h = Object.assign || function(target) {
@@ -6443,7 +6455,7 @@ function _set_prototype_of$d(o, p) {
6443
6455
  return CapturePicture;
6444
6456
  }(Control);
6445
6457
 
6446
- var dist$1 = {};
6458
+ var dist = {};
6447
6459
 
6448
6460
  /*
6449
6461
  * @ezuikit/control-ptz v0.0.1
@@ -6451,11 +6463,11 @@ var dist$1 = {};
6451
6463
  * Released under the MIT License.
6452
6464
  */
6453
6465
 
6454
- var hasRequiredDist$1;
6466
+ var hasRequiredDist;
6455
6467
 
6456
- function requireDist$1 () {
6457
- if (hasRequiredDist$1) return dist$1;
6458
- hasRequiredDist$1 = 1;
6468
+ function requireDist () {
6469
+ if (hasRequiredDist) return dist;
6470
+ hasRequiredDist = 1;
6459
6471
 
6460
6472
  var deepmerge$1 = deepmerge;
6461
6473
  var utilsTools = require$$1;
@@ -7378,13 +7390,13 @@ function requireDist$1 () {
7378
7390
  return Ptz;
7379
7391
  }(BasePtz);
7380
7392
 
7381
- dist$1.BasePtz = BasePtz;
7382
- dist$1.MobilePtz = MobilePtz;
7383
- dist$1.Ptz = Ptz;
7384
- return dist$1;
7393
+ dist.BasePtz = BasePtz;
7394
+ dist.MobilePtz = MobilePtz;
7395
+ dist.Ptz = Ptz;
7396
+ return dist;
7385
7397
  }
7386
7398
 
7387
- var distExports$1 = requireDist$1();
7399
+ var distExports = requireDist();
7388
7400
 
7389
7401
  function _defineProperties$4(target, props) {
7390
7402
  for(var i = 0; i < props.length; i++){
@@ -7483,7 +7495,7 @@ function _set_prototype_of$c(o, p) {
7483
7495
  this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
7484
7496
  this.$panel.appendChild(this.$turntable);
7485
7497
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
7486
- this._ptzControl = new distExports$1.Ptz(this.$turntable, _extends$b({}, this._options, {
7498
+ this._ptzControl = new distExports.Ptz(this.$turntable, _extends$b({}, this._options, {
7487
7499
  onSpeedChange: this._onSpeedChange.bind(this),
7488
7500
  onDirection: this._onDirection.bind(this)
7489
7501
  }));
@@ -7492,7 +7504,7 @@ function _set_prototype_of$c(o, p) {
7492
7504
  };
7493
7505
  _proto.renderMobileExtend = function renderMobileExtend($container) {
7494
7506
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
7495
- if (!this._ptzControl1) this._ptzControl1 = new distExports$1.MobilePtz($container, _extends$b({}, this._options, {
7507
+ if (!this._ptzControl1) this._ptzControl1 = new distExports.MobilePtz($container, _extends$b({}, this._options, {
7496
7508
  onSpeedChange: this._onSpeedChange.bind(this),
7497
7509
  onDirection: this._onDirection.bind(this)
7498
7510
  }));
@@ -8584,27 +8596,35 @@ var SPEED_DEFAULT_OPTIONS = {
8584
8596
  _assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
8585
8597
  }
8586
8598
  })) || this;
8599
+ _this._filterSpeedList(options.list, options.props.recType);
8587
8600
  _this.on(EVENTS.speedChange, function(speed) {
8588
8601
  if (_this.value !== speed + '') _this.value = speed + '';
8589
8602
  });
8590
8603
  _this.on(EVENTS.control.recTypeChange, function(type) {
8591
- if (!(options == null ? void 0 : options.list)) {
8592
- // 非用户自定义
8593
- if (type === 'rec') {
8594
- // 本地回放 不支持 8 16 32 倍速
8595
- var list = _this.list.filter(function(item) {
8596
- return (item == null ? void 0 : item.value) && +item.value < 8;
8597
- });
8598
- _this.updateOptions(list);
8599
- } else {
8600
- // 云端回放 支持 8 16 32 倍速
8601
- _this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
8602
- }
8603
- }
8604
+ _this._filterSpeedList(options.list, type);
8604
8605
  });
8605
8606
  return _this;
8606
8607
  }
8607
8608
  var _proto = Speed.prototype;
8609
+ /**
8610
+ * 滤掉本地回放不支持的倍速
8611
+ * @param optionsList 初始化配置倍速列表
8612
+ * @param type 回放类型
8613
+ */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
8614
+ if (!optionsList) {
8615
+ // 非用户自定义
8616
+ if (type === 'rec') {
8617
+ // 本地回放 不支持 8 16 32 倍速
8618
+ var list = this.list.filter(function(item) {
8619
+ return (item == null ? void 0 : item.value) && +item.value < 8;
8620
+ });
8621
+ this.updateOptions(list);
8622
+ } else {
8623
+ // 云端回放 支持 8 16 32 倍速
8624
+ this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
8625
+ }
8626
+ }
8627
+ };
8608
8628
  _proto.reset = function reset(hide) {
8609
8629
  this.value = 1 + '';
8610
8630
  Select.prototype.reset.call(this, hide);
@@ -8612,541 +8632,6 @@ var SPEED_DEFAULT_OPTIONS = {
8612
8632
  return Speed;
8613
8633
  }(Select);
8614
8634
 
8615
- /*
8616
- * @ezuikit/control-date-picker v0.0.1-alpha.2
8617
- * Copyright (c) 2025-11-12 Ezviz-OpenBiz
8618
- * Released under the MIT License.
8619
- */
8620
-
8621
- var dist;
8622
- var hasRequiredDist;
8623
-
8624
- function requireDist () {
8625
- if (hasRequiredDist) return dist;
8626
- hasRequiredDist = 1;
8627
-
8628
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8629
- try {
8630
- var info = gen[key](arg);
8631
- var value = info.value;
8632
- } catch (error) {
8633
- reject(error);
8634
- return;
8635
- }
8636
- if (info.done) {
8637
- resolve(value);
8638
- } else {
8639
- Promise.resolve(value).then(_next, _throw);
8640
- }
8641
- }
8642
- function _async_to_generator(fn) {
8643
- return function() {
8644
- var self = this, args = arguments;
8645
- return new Promise(function(resolve, reject) {
8646
- var gen = fn.apply(self, args);
8647
- function _next(value) {
8648
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
8649
- }
8650
- function _throw(err) {
8651
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
8652
- }
8653
- _next(undefined);
8654
- });
8655
- };
8656
- }
8657
- function _ts_generator(thisArg, body) {
8658
- var f, y, t, _ = {
8659
- label: 0,
8660
- sent: function() {
8661
- if (t[0] & 1) throw t[1];
8662
- return t[1];
8663
- },
8664
- trys: [],
8665
- ops: []
8666
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
8667
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
8668
- return this;
8669
- }), g;
8670
- function verb(n) {
8671
- return function(v) {
8672
- return step([
8673
- n,
8674
- v
8675
- ]);
8676
- };
8677
- }
8678
- function step(op) {
8679
- if (f) throw new TypeError("Generator is already executing.");
8680
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
8681
- 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;
8682
- if (y = 0, t) op = [
8683
- op[0] & 2,
8684
- t.value
8685
- ];
8686
- switch(op[0]){
8687
- case 0:
8688
- case 1:
8689
- t = op;
8690
- break;
8691
- case 4:
8692
- _.label++;
8693
- return {
8694
- value: op[1],
8695
- done: false
8696
- };
8697
- case 5:
8698
- _.label++;
8699
- y = op[1];
8700
- op = [
8701
- 0
8702
- ];
8703
- continue;
8704
- case 7:
8705
- op = _.ops.pop();
8706
- _.trys.pop();
8707
- continue;
8708
- default:
8709
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
8710
- _ = 0;
8711
- continue;
8712
- }
8713
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
8714
- _.label = op[1];
8715
- break;
8716
- }
8717
- if (op[0] === 6 && _.label < t[1]) {
8718
- _.label = t[1];
8719
- t = op;
8720
- break;
8721
- }
8722
- if (t && _.label < t[2]) {
8723
- _.label = t[2];
8724
- _.ops.push(op);
8725
- break;
8726
- }
8727
- if (t[2]) _.ops.pop();
8728
- _.trys.pop();
8729
- continue;
8730
- }
8731
- op = body.call(thisArg, _);
8732
- } catch (e) {
8733
- op = [
8734
- 6,
8735
- e
8736
- ];
8737
- y = 0;
8738
- } finally{
8739
- f = t = 0;
8740
- }
8741
- if (op[0] & 5) throw op[1];
8742
- return {
8743
- value: op[0] ? op[1] : void 0,
8744
- done: true
8745
- };
8746
- }
8747
- }
8748
- var AppendJS = /*#__PURE__*/ function() {
8749
- function AppendJS() {}
8750
- AppendJS.loadScript = function loadScript(src) {
8751
- return _async_to_generator(function() {
8752
- return _ts_generator(this, function(_state) {
8753
- switch(_state.label){
8754
- case 0:
8755
- return [
8756
- 4,
8757
- new Promise(function(resolve, reject) {
8758
- if (AppendJS.LoadedScr.includes(src)) {
8759
- return resolve(src);
8760
- }
8761
- if (AppendJS.LoadingScrQueue[src]) {
8762
- return AppendJS.LoadingScrQueue[src].push(resolve);
8763
- } else {
8764
- AppendJS.LoadingScrQueue[src] = [
8765
- resolve
8766
- ];
8767
- }
8768
- var link;
8769
- if (src.includes('.js')) {
8770
- link = document.createElement('script');
8771
- link.src = src;
8772
- link.async = true;
8773
- } else if (src.includes('.css')) {
8774
- link = document.createElement('link');
8775
- link.rel = 'stylesheet';
8776
- link.href = src;
8777
- }
8778
- link.onload = function() {
8779
- AppendJS.LoadedScr.push(src);
8780
- AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
8781
- return resolve(src);
8782
- });
8783
- AppendJS.LoadingScrQueue[src] = [];
8784
- };
8785
- link.onerror = function() {
8786
- return reject(new Error('Failed to load ' + src));
8787
- };
8788
- document.head.appendChild(link);
8789
- })
8790
- ];
8791
- case 1:
8792
- return [
8793
- 2,
8794
- _state.sent()
8795
- ];
8796
- }
8797
- });
8798
- })();
8799
- };
8800
- AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
8801
- return _async_to_generator(function() {
8802
- return _ts_generator(this, function(_state) {
8803
- switch(_state.label){
8804
- case 0:
8805
- return [
8806
- 4,
8807
- Promise.all(srcArr.map(AppendJS.loadScript))
8808
- ];
8809
- case 1:
8810
- return [
8811
- 2,
8812
- _state.sent()
8813
- ];
8814
- }
8815
- });
8816
- })();
8817
- };
8818
- AppendJS.remove = function remove(src) {
8819
- src.forEach(function(item) {
8820
- var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
8821
- if (link) {
8822
- link.remove();
8823
- }
8824
- });
8825
- };
8826
- AppendJS.clear = function clear() {
8827
- AppendJS.remove(AppendJS.LoadedScr);
8828
- };
8829
- return AppendJS;
8830
- }();
8831
- /** 已经加载完的js/css */ AppendJS.LoadedScr = [];
8832
- /** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
8833
-
8834
- function _defineProperties(target, props) {
8835
- for(var i = 0; i < props.length; i++){
8836
- var descriptor = props[i];
8837
- descriptor.enumerable = descriptor.enumerable || false;
8838
- descriptor.configurable = true;
8839
- if ("value" in descriptor) descriptor.writable = true;
8840
- Object.defineProperty(target, descriptor.key, descriptor);
8841
- }
8842
- }
8843
- function _create_class(Constructor, protoProps, staticProps) {
8844
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
8845
- return Constructor;
8846
- }
8847
- var DEFAULT_OPTIONS = {
8848
- staticPath: '.',
8849
- place: 'top-right',
8850
- language: 'zh-CN',
8851
- current: new Date(),
8852
- maxDate: new Date()
8853
- };
8854
- /**
8855
- * 日期选择器
8856
- */ var DatePicker = /*#__PURE__*/ function() {
8857
- function DatePicker(container, options) {
8858
- var _this = this;
8859
- this._open = false;
8860
- this._change = true;
8861
- this.$container = container;
8862
- this.options = Object.assign({}, DEFAULT_OPTIONS, options);
8863
- this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
8864
- if (this.options.current) {
8865
- this._date = this.options.current;
8866
- }
8867
- this._init();
8868
- this.$container.addEventListener('click', function() {
8869
- if (_this._open) _this.hide();
8870
- else _this.show();
8871
- });
8872
- document.body.addEventListener('click', function(e) {
8873
- if (!_this.$container.contains(e.target)) {
8874
- _this.hide();
8875
- }
8876
- });
8877
- }
8878
- var _proto = DatePicker.prototype;
8879
- _proto._init = function _init() {
8880
- var _this = this;
8881
- // 因为挂载在行内,需要父标签设置 position: relative;
8882
- this.$container.style.cssText += ";position: relative;";
8883
- this.$container.classList.add("datepicker-inline-" + this.options.place);
8884
- AppendJS.loadScriptsBatch([
8885
- "" + this.options.staticPath + "/rec/jquery.min.js",
8886
- "" + this.options.staticPath + "/rec/datepicker.min.css"
8887
- ]).then(function() {
8888
- AppendJS.loadScriptsBatch([
8889
- "" + _this.options.staticPath + "/rec/datepicker.js"
8890
- ]).then(function() {
8891
- AppendJS.loadScriptsBatch([
8892
- "" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
8893
- "" + _this.options.staticPath + "/rec/datepicker.en-US.js"
8894
- ]).then(function() {
8895
- window.$(_this.$container).datepicker({
8896
- date: _this.options.current,
8897
- language: _this.options.language,
8898
- endDate: _this.options.maxDate,
8899
- inline: true
8900
- });
8901
- _this.hide();
8902
- window.$(_this.$container).on('pick.datepicker', function(e) {
8903
- var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
8904
- if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
8905
- _this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
8906
- } 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())) {
8907
- _this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
8908
- } else if ([
8909
- 'day',
8910
- 'pick'
8911
- ].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())) {
8912
- if (_this._change) {
8913
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
8914
- }
8915
- _this._date = new Date(e.date.getTime());
8916
- }
8917
- if (e.view === 'day') _this.hide();
8918
- _this._change = true;
8919
- });
8920
- });
8921
- });
8922
- });
8923
- };
8924
- /**
8925
- * 设置日期, change = true 时触发 onChange 事件
8926
- *
8927
- * @param date 设置的日期
8928
- * @param change 是否触发 onChange 事件
8929
- */ _proto.setDate = function setDate(date, change) {
8930
- if (change === void 0) change = true;
8931
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8932
- if ($datepicker) {
8933
- this._change = change;
8934
- window.$(this.$container).datepicker('setDate', date);
8935
- }
8936
- };
8937
- /**
8938
- * 隐藏面板, 会触发 onPanelChange 事件
8939
- */ _proto.hide = function hide() {
8940
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8941
- if ($datepicker) {
8942
- if (this._open) {
8943
- this._open = false;
8944
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
8945
- }
8946
- $datepicker.classList.add('datepicker-hide');
8947
- }
8948
- };
8949
- /**
8950
- * 显示面板, 会触发 onPanelChange 事件
8951
- */ _proto.show = function show() {
8952
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8953
- if ($datepicker) {
8954
- var _window_$_datepicker, _window_$;
8955
- if (!this._open) {
8956
- this._open = true;
8957
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
8958
- }
8959
- if (this._date) this.setDate(this._date, false);
8960
- (_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
8961
- if (this.options.place === 'bottom-left') {
8962
- $datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
8963
- } else {
8964
- $datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
8965
- }
8966
- $datepicker.classList.remove('datepicker-hide');
8967
- }
8968
- };
8969
- /**
8970
- * 销毁
8971
- */ _proto.destroy = function destroy() {
8972
- this.hide();
8973
- this._date = undefined;
8974
- window.$(this.$container).datepicker('destroy');
8975
- // AppendJS.remove([
8976
- // `${this.options.staticPath}/rec/jquery.min.js`,
8977
- // `${this.options.staticPath}/rec/datepicker.min.css`,
8978
- // `${this.options.staticPath}/rec/datepicker.js`,
8979
- // `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
8980
- // `${this.options.staticPath}/rec/datepicker.en-US.js`,
8981
- // ]);
8982
- };
8983
- _create_class(DatePicker, [
8984
- {
8985
- key: "date",
8986
- get: /**
8987
- * 获取日期
8988
- */ function get() {
8989
- return this._date;
8990
- }
8991
- }
8992
- ]);
8993
- return DatePicker;
8994
- }();
8995
-
8996
- dist = DatePicker;
8997
- return dist;
8998
- }
8999
-
9000
- var distExports = requireDist();
9001
- var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports);
9002
-
9003
- /**
9004
- * @description 时间操作
9005
- */ var DateTime = /*#__PURE__*/ function() {
9006
- function DateTime() {}
9007
- /**
9008
- * @description 时间格式化
9009
- * @param {Date | number | string} date
9010
- * @param {string} formatType 格式 'YYYY-MM-DD hh:mm:ss' 或 'YYYYMMDDhhmmss' 或 'YYYY/MM/DD hh:mm:ss' 或 'hh:mm:ss' 或 'YYYYMMDDThhmmssZ'
9011
- * @param {number} timeZone 时区偏移量 默认 0
9012
- */ DateTime.formate = function formate(date, formatType, timeZone) {
9013
- if (timeZone === void 0) timeZone = 0;
9014
- var dateTime = date;
9015
- if (typeof date === 'string') {
9016
- dateTime = DateTime.strToDate(date);
9017
- } else if (typeof date === 'number') {
9018
- dateTime = new Date(date);
9019
- }
9020
- dateTime = new Date(dateTime.getTime() - timeZone * 3600 * 1000);
9021
- var year = dateTime.getFullYear();
9022
- var month = String(dateTime.getMonth() + 1).padStart(2, '0');
9023
- var day = String(dateTime.getDate()).padStart(2, '0');
9024
- var hours = String(dateTime.getHours()).padStart(2, '0');
9025
- var minutes = String(dateTime.getMinutes()).padStart(2, '0');
9026
- var seconds = String(dateTime.getSeconds()).padStart(2, '0');
9027
- switch(formatType){
9028
- case 'YYYY-MM-DD hh:mm:ss':
9029
- return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
9030
- case 'YYYYMMDDhhmmss':
9031
- return "" + year + month + day + hours + minutes + seconds;
9032
- case 'YYYY/MM/DD hh:mm:ss':
9033
- return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
9034
- case 'YYYYMMDDThhmmssZ':
9035
- return "" + year + month + day + "T" + hours + minutes + seconds + "Z";
9036
- case 'YYYY/MM/DD':
9037
- return year + "/" + month + "/" + day;
9038
- case 'YYYYMMDD':
9039
- return "" + year + month + day;
9040
- case 'YYYY-MM-DD':
9041
- return year + "-" + month + "-" + day;
9042
- case 'YYYY':
9043
- return "" + year;
9044
- case 'MM':
9045
- return "" + month;
9046
- case 'DD':
9047
- return "" + day;
9048
- case 'hh:mm:ss':
9049
- return hours + ":" + minutes + ":" + seconds;
9050
- case 'hh':
9051
- return "" + hours;
9052
- case 'mm':
9053
- return "" + minutes;
9054
- case 'ss':
9055
- return "" + seconds;
9056
- default:
9057
- throw new Error('Unsupported format type');
9058
- }
9059
- };
9060
- /**
9061
- * @description 对比两个时间的差值
9062
- * @param {Date | string | number} date1
9063
- * @param {Date | string | number} date2
9064
- * @param {"year" | "month" | "day" | "hour" | "minute" | "second"} diffType
9065
- */ DateTime.diff = function diff(date1, date2, diffType) {
9066
- /** @type {Date} */ var dateTime1 = date1;
9067
- if (typeof date1 === 'string') {
9068
- dateTime1 = DateTime.strToDate(date1);
9069
- } else if (typeof date1 === 'number') {
9070
- dateTime1 = new Date(date1);
9071
- }
9072
- /** @type {Date} */ var dateTime2 = date2;
9073
- if (typeof date2 === 'string') {
9074
- dateTime1 = DateTime.strToDate(date2);
9075
- } else if (typeof date2 === 'number') {
9076
- dateTime1 = new Date(date2);
9077
- }
9078
- var diffSecond = dateTime1.getTime() - dateTime2.getTime();
9079
- // diff
9080
- switch(diffType){
9081
- case 'year':
9082
- return dateTime1.getFullYear() - dateTime2.getFullYear();
9083
- case 'month':
9084
- // 计算总月份差
9085
- // eslint-disable-next-line no-case-declarations
9086
- var months = (dateTime1.getFullYear() - dateTime2.getFullYear()) * 12 + (dateTime1.getMonth() - dateTime2.getMonth());
9087
- // 如果结束日的日期小于开始日的日期,则减去一个月
9088
- if (dateTime1.getDate() < dateTime2.getDate()) {
9089
- months--;
9090
- }
9091
- return months;
9092
- case 'day':
9093
- return diffSecond / 60 / 60 / 24;
9094
- case 'hour':
9095
- return diffSecond / 60 / 60;
9096
- case 'minute':
9097
- return diffSecond / 60;
9098
- case 'second':
9099
- return diffSecond;
9100
- default:
9101
- throw new Error('Unsupported diff type');
9102
- }
9103
- };
9104
- DateTime.now = function now() {
9105
- return Date.now();
9106
- };
9107
- /**
9108
- *
9109
- * @param {string} str 日期, 2025-04-10 10:10:10 或 2025/04/10 10:10:10 或 20250410101010 或 20250410T101010Z 或 秒 或 毫秒
9110
- * @example
9111
- * DateTime.strToDate("2025/04/10 10:10:10") // Date
9112
- * DateTime.strToDate("2025-04-10 10:10:10") // Date
9113
- * DateTime.strToDate("20250410101010") // Date
9114
- * DateTime.strToDate("20250410T101010Z") // Date
9115
- */ DateTime.strToDate = function strToDate(str) {
9116
- var time = (str + '').replace(/-/gi, '').replace(/:/gi, '').replace(/\//gi, '').replace(/ /gi, '').replace(/T|Z/gi, '');
9117
- // 兼容
9118
- if ((str + '').length === 10) {
9119
- // 时间戳 秒
9120
- return new Date(+str);
9121
- } else if ((str + '').length === 13) {
9122
- // 时间戳 毫秒
9123
- return new Date(+str);
9124
- }
9125
- var year = time.slice(0, 4);
9126
- var month = time.slice(4, 6);
9127
- var day = time.slice(6, 8);
9128
- var hour = time.slice(8, 10);
9129
- var minute = time.slice(10, 12);
9130
- var second = time.slice(12, 14);
9131
- return new Date(year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second);
9132
- };
9133
- /**
9134
- * @description 补充十位
9135
- * @param {number} num
9136
- * @returns {string}
9137
- * @example
9138
- * DateTime.padStart(1) // "01"
9139
- * DateTime.padStart(33) // "33"
9140
- */ DateTime.padStart = function padStart(num) {
9141
- if (num < 10) {
9142
- return '0' + num;
9143
- } else {
9144
- return num + '';
9145
- }
9146
- };
9147
- return DateTime;
9148
- }();
9149
-
9150
8635
  function _extends$5() {
9151
8636
  _extends$5 = Object.assign || function(target) {
9152
8637
  for(var i = 1; i < arguments.length; i++){
@@ -9189,20 +8674,29 @@ function _set_prototype_of$6(o, p) {
9189
8674
  function DatePickerControl(options) {
9190
8675
  var _this;
9191
8676
  var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
9192
- _this = Control.call(this, _extends$5({}, options, {
8677
+ _this = Control.call(this, _extends$5({
8678
+ maxDate: new Date()
8679
+ }, options, {
9193
8680
  tagName: 'span',
9194
8681
  controlType: 'button',
9195
8682
  classNameSuffix: 'date'
9196
8683
  })) || this;
9197
8684
  _this.options = options;
9198
- _this._value = DateTime.formate(((_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');
8685
+ _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');
9199
8686
  _this._render();
8687
+ // 日期上的点
8688
+ _this.on(EVENTS.control.dateMonthChange, function(dates) {
8689
+ var _this_datePicker_updateBadges, _this_datePicker;
8690
+ (_this_datePicker = _this.datePicker) == null ? void 0 : (_this_datePicker_updateBadges = _this_datePicker.updateBadges) == null ? void 0 : _this_datePicker_updateBadges.call(_this_datePicker, dates);
8691
+ });
9200
8692
  return _this;
9201
8693
  }
9202
8694
  var _proto = DatePickerControl.prototype;
9203
8695
  _proto._render = function _render() {
9204
8696
  var _this = this;
9205
- if (require$$1.isMobile()) {
8697
+ var _this_options_props;
8698
+ var isMobile1 = require$$1.isMobile();
8699
+ if (isMobile1) {
9206
8700
  var _this_locale;
9207
8701
  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>";
9208
8702
  } else {
@@ -9211,25 +8705,45 @@ function _set_prototype_of$6(o, p) {
9211
8705
  title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
9212
8706
  });
9213
8707
  }
9214
- this.dataPickerUtil = new DatePickerUtil(this.$container, {
9215
- staticPath: this.options.staticPath,
9216
- language: this.options.language === 'zh' ? 'zh-CN' : 'en-US',
8708
+ this.datePicker = new controlDatePicker.DatePicker(this.$container, {
8709
+ isMobile: isMobile1,
8710
+ getPopupContainer: function() {
8711
+ return _this.$container;
8712
+ },
8713
+ mode: 'date',
8714
+ offset: [
8715
+ 0,
8716
+ -10
8717
+ ],
8718
+ badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
8719
+ language: this.options.language === 'zh' ? 'zh' : 'en',
9217
8720
  current: new Date(this._value + ' 00:00:00'),
9218
- maxDate: this.options.maxDate || new Date(),
9219
- place: require$$1.isMobile() ? 'bottom-left' : 'top-right',
9220
- onChange: function(date) {
9221
- if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
9222
- _this._value = DateTime.formate(date, 'YYYY-MM-DD');
9223
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
8721
+ placement: 'tr',
8722
+ triggerClose: true,
8723
+ disabledDate: function(date) {
8724
+ return date.getTime() > (_this.options.maxDate || new Date()).getTime();
8725
+ },
8726
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8727
+ onOk: function(date, _mode) {
8728
+ if (date && _this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD') && isMobile1) {
8729
+ _this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
8730
+ _this.options.onOk == null ? void 0 : _this.options.onOk.call(_this.options, date);
9224
8731
  _this.emit(EVENTS.control.dateChange, date);
9225
8732
  if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
9226
8733
  _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
9227
8734
  }
9228
8735
  }
9229
8736
  },
9230
- onPanelChange: function(open, date) {
9231
- _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, date);
9232
- _this.emit(EVENTS.control.datePanelOpenChange, open, date);
8737
+ onChange: function(date, mode) {
8738
+ if (date && _this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
8739
+ _this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
8740
+ _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
8741
+ _this.emit(EVENTS.control.dateChange, date);
8742
+ }
8743
+ },
8744
+ onOpenChange: function(open) {
8745
+ _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.datePicker.current);
8746
+ _this.emit(EVENTS.control.datePanelOpenChange, open, _this.datePicker.current);
9233
8747
  }
9234
8748
  });
9235
8749
  };
@@ -9239,28 +8753,27 @@ function _set_prototype_of$6(o, p) {
9239
8753
  * @param change 是否触发 onChange 事件
9240
8754
  */ _proto.setDate = function setDate(date, change) {
9241
8755
  if (change === void 0) change = true;
9242
- var _this_dataPickerUtil;
9243
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.setDate(date, change);
9244
- if (date && !change && this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
9245
- this._value = DateTime.formate(date, 'YYYY-MM-DD');
8756
+ var _this_datePicker;
8757
+ (_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
8758
+ if (date && !change && this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD')) {
8759
+ this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
9246
8760
  if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
9247
8761
  this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
9248
8762
  }
9249
8763
  }
9250
8764
  };
9251
8765
  _proto.reset = function reset() {
9252
- var _this_dataPickerUtil;
9253
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
8766
+ if (this.datePicker) this.datePicker.open = false;
9254
8767
  Control.prototype.reset.call(this);
9255
8768
  };
9256
8769
  /**
9257
8770
  * 销毁控件
9258
8771
  * @override
9259
8772
  */ _proto.destroy = function destroy() {
9260
- if (this.dataPickerUtil) {
9261
- this.dataPickerUtil.destroy();
8773
+ if (this.datePicker) {
8774
+ this.datePicker.destroy();
9262
8775
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9263
- this.dataPickerUtil = null;
8776
+ this.datePicker = null;
9264
8777
  }
9265
8778
  Control.prototype.destroy.call(this);
9266
8779
  };
@@ -9270,6 +8783,7 @@ function _set_prototype_of$6(o, p) {
9270
8783
  };
9271
8784
  /**
9272
8785
  * 点击 Control 会触发
8786
+ * @overload super._onControlClick(e: Event)
9273
8787
  */ _proto._onControlClick = function _onControlClick(e) {
9274
8788
  Control.prototype._onControlClick.call(this, e);
9275
8789
  };
@@ -10342,8 +9856,7 @@ var _renderDatePicker = function(theme, container, props) {
10342
9856
  return container;
10343
9857
  },
10344
9858
  language: theme.options.language,
10345
- locales: theme.i18n.translations,
10346
- staticPath: theme.options.staticPath
9859
+ locales: theme.i18n.translations
10347
9860
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
10348
9861
  props: props
10349
9862
  }));
@@ -10642,7 +10155,18 @@ var THEME_DEFAULT_OPTIONS = {
10642
10155
  */ _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, /**
10643
10156
  * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
10644
10157
  * @private
10645
- */ _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, /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
10158
+ */ _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, // /**
10159
+ // * 记录回放的月份
10160
+ // *
10161
+ // * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
10162
+ // *
10163
+ // * value: 月份列表 比如 ["2025-12-01", "2025-12-02"]
10164
+ // * @private
10165
+ // */
10166
+ // _recMonthObj: Record<string, string[]> = {};
10167
+ /**
10168
+ * 录像回放的月份列表 @private
10169
+ */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
10646
10170
  _this._initOptions(options);
10647
10171
  if (_this.options.type === 'ezopen') {
10648
10172
  var _this_urlInfo_searchParams, _this_urlInfo;
@@ -10652,7 +10176,7 @@ var THEME_DEFAULT_OPTIONS = {
10652
10176
  }
10653
10177
  if (_this.urlInfo.type === 'rec') {
10654
10178
  var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
10655
- _this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? DateTime.strToDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : DateTime.strToDate(DateTime.formate(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
10179
+ _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');
10656
10180
  }
10657
10181
  }
10658
10182
  _this._getRecType(_this.options.url);
@@ -10899,6 +10423,7 @@ var THEME_DEFAULT_OPTIONS = {
10899
10423
  this._themeData = null;
10900
10424
  if (this.i18n) this.i18n = null;
10901
10425
  this.recType = '';
10426
+ this.recMonth = []; // 清空数据
10902
10427
  this.emit(EVENTS.theme.destroyed);
10903
10428
  this.removeAllListeners();
10904
10429
  if (this.logger) this.logger = null;
@@ -11864,7 +11389,7 @@ var THEME_DEFAULT_OPTIONS = {
11864
11389
  zh: zh,
11865
11390
  en: en
11866
11391
  };
11867
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.5';
11392
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.7';
11868
11393
 
11869
11394
  exports.Control = Control;
11870
11395
  exports.Fullscreen = Fullscreen;