@ezuikit/player-theme 2.0.2-beta.1 → 2.0.2-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v2.0.2-beta.1
3
- * Copyright (c) 2025-12-05 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.0.2-beta.10
3
+ * Copyright (c) 2025-12-13 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
  * 主题控件相关
@@ -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, _theme_controls;
4060
+ var _theme_controls, _theme_controls_talkControl, _theme_controls1;
4066
4061
  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);
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, _theme_controls;
4075
+ var _theme_controls, _theme_controls_recordControl, _theme_controls1;
4081
4076
  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;
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, _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) {
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, _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) {
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
- 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);
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
- 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);
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 ,仅用来转发控件的事件
@@ -4333,13 +4337,16 @@ function debounce(func, wait) {
4333
4337
  // prettier-ignore
4334
4338
  theme.controls.recControl.on(EVENTS.control.recTypeChange, function(type) {
4335
4339
  if (theme.recType !== type) {
4336
- var _theme__headerMoreControl;
4340
+ var _theme__headerMoreControl, _theme_controls;
4337
4341
  theme.recType = type;
4338
4342
  theme.emit(EVENTS.control.recTypeChange, type);
4339
4343
  // theme.emit(EVENTS.recTypeChange, type);
4340
4344
  if ((_theme__headerMoreControl = theme._headerMoreControl) == null ? void 0 : _theme__headerMoreControl.picker) {
4341
4345
  theme._headerMoreControl.picker.open = false;
4342
4346
  }
4347
+ if ((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.speedControl) {
4348
+ theme.controls.speedControl.emit(EVENTS.control.recTypeChange, type);
4349
+ }
4343
4350
  }
4344
4351
  });
4345
4352
  theme.controls.recControl.on(EVENTS.control.recDestroy, function() {
@@ -4352,10 +4359,10 @@ function debounce(func, wait) {
4352
4359
  theme.emit(EVENTS.control.timeLineChange, date);
4353
4360
  });
4354
4361
  theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, function(open) {
4355
- var _theme_controls_dateControl;
4356
- if ((_theme_controls_dateControl = theme.controls.dateControl) == null ? void 0 : _theme_controls_dateControl.dataPickerUtil) {
4357
- var _theme_controls_dateControl_dataPickerUtil, _theme_controls_dateControl1;
4358
- (_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();
4362
+ var _theme_controls_dateControl, _theme_controls;
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();
4359
4366
  }
4360
4367
  theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
4361
4368
  });
@@ -4648,12 +4655,12 @@ function getDefaultExportFromCjs (x) {
4648
4655
  * Released under the MIT License.
4649
4656
  */
4650
4657
 
4651
- var dist$2;
4652
- var hasRequiredDist$2;
4658
+ var dist$1;
4659
+ var hasRequiredDist$1;
4653
4660
 
4654
- function requireDist$2 () {
4655
- if (hasRequiredDist$2) return dist$2;
4656
- hasRequiredDist$2 = 1;
4661
+ function requireDist$1 () {
4662
+ if (hasRequiredDist$1) return dist$1;
4663
+ hasRequiredDist$1 = 1;
4657
4664
 
4658
4665
  /**
4659
4666
  * Zoom position
@@ -5360,12 +5367,12 @@ function requireDist$2 () {
5360
5367
  }();
5361
5368
  Zoom.VERSION = '0.0.2';
5362
5369
 
5363
- dist$2 = Zoom;
5364
- return dist$2;
5370
+ dist$1 = Zoom;
5371
+ return dist$1;
5365
5372
  }
5366
5373
 
5367
- var distExports$2 = requireDist$2();
5368
- var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$2);
5374
+ var distExports$1 = requireDist$1();
5375
+ var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
5369
5376
 
5370
5377
  function _extends$h() {
5371
5378
  _extends$h = Object.assign || function(target) {
@@ -6440,7 +6447,7 @@ function _set_prototype_of$d(o, p) {
6440
6447
  return CapturePicture;
6441
6448
  }(Control);
6442
6449
 
6443
- var dist$1 = {};
6450
+ var dist = {};
6444
6451
 
6445
6452
  /*
6446
6453
  * @ezuikit/control-ptz v0.0.1
@@ -6448,11 +6455,11 @@ var dist$1 = {};
6448
6455
  * Released under the MIT License.
6449
6456
  */
6450
6457
 
6451
- var hasRequiredDist$1;
6458
+ var hasRequiredDist;
6452
6459
 
6453
- function requireDist$1 () {
6454
- if (hasRequiredDist$1) return dist$1;
6455
- hasRequiredDist$1 = 1;
6460
+ function requireDist () {
6461
+ if (hasRequiredDist) return dist;
6462
+ hasRequiredDist = 1;
6456
6463
 
6457
6464
  var deepmerge$1 = deepmerge;
6458
6465
  var utilsTools = require$$1;
@@ -7375,13 +7382,13 @@ function requireDist$1 () {
7375
7382
  return Ptz;
7376
7383
  }(BasePtz);
7377
7384
 
7378
- dist$1.BasePtz = BasePtz;
7379
- dist$1.MobilePtz = MobilePtz;
7380
- dist$1.Ptz = Ptz;
7381
- return dist$1;
7385
+ dist.BasePtz = BasePtz;
7386
+ dist.MobilePtz = MobilePtz;
7387
+ dist.Ptz = Ptz;
7388
+ return dist;
7382
7389
  }
7383
7390
 
7384
- var distExports$1 = requireDist$1();
7391
+ var distExports = requireDist();
7385
7392
 
7386
7393
  function _defineProperties$4(target, props) {
7387
7394
  for(var i = 0; i < props.length; i++){
@@ -7480,7 +7487,7 @@ function _set_prototype_of$c(o, p) {
7480
7487
  this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
7481
7488
  this.$panel.appendChild(this.$turntable);
7482
7489
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
7483
- this._ptzControl = new distExports$1.Ptz(this.$turntable, _extends$b({}, this._options, {
7490
+ this._ptzControl = new distExports.Ptz(this.$turntable, _extends$b({}, this._options, {
7484
7491
  onSpeedChange: this._onSpeedChange.bind(this),
7485
7492
  onDirection: this._onDirection.bind(this)
7486
7493
  }));
@@ -7489,7 +7496,7 @@ function _set_prototype_of$c(o, p) {
7489
7496
  };
7490
7497
  _proto.renderMobileExtend = function renderMobileExtend($container) {
7491
7498
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
7492
- if (!this._ptzControl1) this._ptzControl1 = new distExports$1.MobilePtz($container, _extends$b({}, this._options, {
7499
+ if (!this._ptzControl1) this._ptzControl1 = new distExports.MobilePtz($container, _extends$b({}, this._options, {
7493
7500
  onSpeedChange: this._onSpeedChange.bind(this),
7494
7501
  onDirection: this._onDirection.bind(this)
7495
7502
  }));
@@ -8581,12 +8588,35 @@ var SPEED_DEFAULT_OPTIONS = {
8581
8588
  _assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
8582
8589
  }
8583
8590
  })) || this;
8591
+ _this._filterSpeedList(options.list, options.props.recType);
8584
8592
  _this.on(EVENTS.speedChange, function(speed) {
8585
8593
  if (_this.value !== speed + '') _this.value = speed + '';
8586
8594
  });
8595
+ _this.on(EVENTS.control.recTypeChange, function(type) {
8596
+ _this._filterSpeedList(options.list, type);
8597
+ });
8587
8598
  return _this;
8588
8599
  }
8589
8600
  var _proto = Speed.prototype;
8601
+ /**
8602
+ * 滤掉本地回放不支持的倍速
8603
+ * @param optionsList 初始化配置倍速列表
8604
+ * @param type 回放类型
8605
+ */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
8606
+ if (!optionsList) {
8607
+ // 非用户自定义
8608
+ if (type === 'rec') {
8609
+ // 本地回放 不支持 8 16 32 倍速
8610
+ var list = this.list.filter(function(item) {
8611
+ return (item == null ? void 0 : item.value) && +item.value < 8;
8612
+ });
8613
+ this.updateOptions(list);
8614
+ } else {
8615
+ // 云端回放 支持 8 16 32 倍速
8616
+ this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
8617
+ }
8618
+ }
8619
+ };
8590
8620
  _proto.reset = function reset(hide) {
8591
8621
  this.value = 1 + '';
8592
8622
  Select.prototype.reset.call(this, hide);
@@ -8594,541 +8624,6 @@ var SPEED_DEFAULT_OPTIONS = {
8594
8624
  return Speed;
8595
8625
  }(Select);
8596
8626
 
8597
- /*
8598
- * @ezuikit/control-date-picker v0.0.1-alpha.2
8599
- * Copyright (c) 2025-11-12 Ezviz-OpenBiz
8600
- * Released under the MIT License.
8601
- */
8602
-
8603
- var dist;
8604
- var hasRequiredDist;
8605
-
8606
- function requireDist () {
8607
- if (hasRequiredDist) return dist;
8608
- hasRequiredDist = 1;
8609
-
8610
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8611
- try {
8612
- var info = gen[key](arg);
8613
- var value = info.value;
8614
- } catch (error) {
8615
- reject(error);
8616
- return;
8617
- }
8618
- if (info.done) {
8619
- resolve(value);
8620
- } else {
8621
- Promise.resolve(value).then(_next, _throw);
8622
- }
8623
- }
8624
- function _async_to_generator(fn) {
8625
- return function() {
8626
- var self = this, args = arguments;
8627
- return new Promise(function(resolve, reject) {
8628
- var gen = fn.apply(self, args);
8629
- function _next(value) {
8630
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
8631
- }
8632
- function _throw(err) {
8633
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
8634
- }
8635
- _next(undefined);
8636
- });
8637
- };
8638
- }
8639
- function _ts_generator(thisArg, body) {
8640
- var f, y, t, _ = {
8641
- label: 0,
8642
- sent: function() {
8643
- if (t[0] & 1) throw t[1];
8644
- return t[1];
8645
- },
8646
- trys: [],
8647
- ops: []
8648
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
8649
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
8650
- return this;
8651
- }), g;
8652
- function verb(n) {
8653
- return function(v) {
8654
- return step([
8655
- n,
8656
- v
8657
- ]);
8658
- };
8659
- }
8660
- function step(op) {
8661
- if (f) throw new TypeError("Generator is already executing.");
8662
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
8663
- 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;
8664
- if (y = 0, t) op = [
8665
- op[0] & 2,
8666
- t.value
8667
- ];
8668
- switch(op[0]){
8669
- case 0:
8670
- case 1:
8671
- t = op;
8672
- break;
8673
- case 4:
8674
- _.label++;
8675
- return {
8676
- value: op[1],
8677
- done: false
8678
- };
8679
- case 5:
8680
- _.label++;
8681
- y = op[1];
8682
- op = [
8683
- 0
8684
- ];
8685
- continue;
8686
- case 7:
8687
- op = _.ops.pop();
8688
- _.trys.pop();
8689
- continue;
8690
- default:
8691
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
8692
- _ = 0;
8693
- continue;
8694
- }
8695
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
8696
- _.label = op[1];
8697
- break;
8698
- }
8699
- if (op[0] === 6 && _.label < t[1]) {
8700
- _.label = t[1];
8701
- t = op;
8702
- break;
8703
- }
8704
- if (t && _.label < t[2]) {
8705
- _.label = t[2];
8706
- _.ops.push(op);
8707
- break;
8708
- }
8709
- if (t[2]) _.ops.pop();
8710
- _.trys.pop();
8711
- continue;
8712
- }
8713
- op = body.call(thisArg, _);
8714
- } catch (e) {
8715
- op = [
8716
- 6,
8717
- e
8718
- ];
8719
- y = 0;
8720
- } finally{
8721
- f = t = 0;
8722
- }
8723
- if (op[0] & 5) throw op[1];
8724
- return {
8725
- value: op[0] ? op[1] : void 0,
8726
- done: true
8727
- };
8728
- }
8729
- }
8730
- var AppendJS = /*#__PURE__*/ function() {
8731
- function AppendJS() {}
8732
- AppendJS.loadScript = function loadScript(src) {
8733
- return _async_to_generator(function() {
8734
- return _ts_generator(this, function(_state) {
8735
- switch(_state.label){
8736
- case 0:
8737
- return [
8738
- 4,
8739
- new Promise(function(resolve, reject) {
8740
- if (AppendJS.LoadedScr.includes(src)) {
8741
- return resolve(src);
8742
- }
8743
- if (AppendJS.LoadingScrQueue[src]) {
8744
- return AppendJS.LoadingScrQueue[src].push(resolve);
8745
- } else {
8746
- AppendJS.LoadingScrQueue[src] = [
8747
- resolve
8748
- ];
8749
- }
8750
- var link;
8751
- if (src.includes('.js')) {
8752
- link = document.createElement('script');
8753
- link.src = src;
8754
- link.async = true;
8755
- } else if (src.includes('.css')) {
8756
- link = document.createElement('link');
8757
- link.rel = 'stylesheet';
8758
- link.href = src;
8759
- }
8760
- link.onload = function() {
8761
- AppendJS.LoadedScr.push(src);
8762
- AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
8763
- return resolve(src);
8764
- });
8765
- AppendJS.LoadingScrQueue[src] = [];
8766
- };
8767
- link.onerror = function() {
8768
- return reject(new Error('Failed to load ' + src));
8769
- };
8770
- document.head.appendChild(link);
8771
- })
8772
- ];
8773
- case 1:
8774
- return [
8775
- 2,
8776
- _state.sent()
8777
- ];
8778
- }
8779
- });
8780
- })();
8781
- };
8782
- AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
8783
- return _async_to_generator(function() {
8784
- return _ts_generator(this, function(_state) {
8785
- switch(_state.label){
8786
- case 0:
8787
- return [
8788
- 4,
8789
- Promise.all(srcArr.map(AppendJS.loadScript))
8790
- ];
8791
- case 1:
8792
- return [
8793
- 2,
8794
- _state.sent()
8795
- ];
8796
- }
8797
- });
8798
- })();
8799
- };
8800
- AppendJS.remove = function remove(src) {
8801
- src.forEach(function(item) {
8802
- var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
8803
- if (link) {
8804
- link.remove();
8805
- }
8806
- });
8807
- };
8808
- AppendJS.clear = function clear() {
8809
- AppendJS.remove(AppendJS.LoadedScr);
8810
- };
8811
- return AppendJS;
8812
- }();
8813
- /** 已经加载完的js/css */ AppendJS.LoadedScr = [];
8814
- /** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
8815
-
8816
- function _defineProperties(target, props) {
8817
- for(var i = 0; i < props.length; i++){
8818
- var descriptor = props[i];
8819
- descriptor.enumerable = descriptor.enumerable || false;
8820
- descriptor.configurable = true;
8821
- if ("value" in descriptor) descriptor.writable = true;
8822
- Object.defineProperty(target, descriptor.key, descriptor);
8823
- }
8824
- }
8825
- function _create_class(Constructor, protoProps, staticProps) {
8826
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
8827
- return Constructor;
8828
- }
8829
- var DEFAULT_OPTIONS = {
8830
- staticPath: '.',
8831
- place: 'top-right',
8832
- language: 'zh-CN',
8833
- current: new Date(),
8834
- maxDate: new Date()
8835
- };
8836
- /**
8837
- * 日期选择器
8838
- */ var DatePicker = /*#__PURE__*/ function() {
8839
- function DatePicker(container, options) {
8840
- var _this = this;
8841
- this._open = false;
8842
- this._change = true;
8843
- this.$container = container;
8844
- this.options = Object.assign({}, DEFAULT_OPTIONS, options);
8845
- this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
8846
- if (this.options.current) {
8847
- this._date = this.options.current;
8848
- }
8849
- this._init();
8850
- this.$container.addEventListener('click', function() {
8851
- if (_this._open) _this.hide();
8852
- else _this.show();
8853
- });
8854
- document.body.addEventListener('click', function(e) {
8855
- if (!_this.$container.contains(e.target)) {
8856
- _this.hide();
8857
- }
8858
- });
8859
- }
8860
- var _proto = DatePicker.prototype;
8861
- _proto._init = function _init() {
8862
- var _this = this;
8863
- // 因为挂载在行内,需要父标签设置 position: relative;
8864
- this.$container.style.cssText += ";position: relative;";
8865
- this.$container.classList.add("datepicker-inline-" + this.options.place);
8866
- AppendJS.loadScriptsBatch([
8867
- "" + this.options.staticPath + "/rec/jquery.min.js",
8868
- "" + this.options.staticPath + "/rec/datepicker.min.css"
8869
- ]).then(function() {
8870
- AppendJS.loadScriptsBatch([
8871
- "" + _this.options.staticPath + "/rec/datepicker.js"
8872
- ]).then(function() {
8873
- AppendJS.loadScriptsBatch([
8874
- "" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
8875
- "" + _this.options.staticPath + "/rec/datepicker.en-US.js"
8876
- ]).then(function() {
8877
- window.$(_this.$container).datepicker({
8878
- date: _this.options.current,
8879
- language: _this.options.language,
8880
- endDate: _this.options.maxDate,
8881
- inline: true
8882
- });
8883
- _this.hide();
8884
- window.$(_this.$container).on('pick.datepicker', function(e) {
8885
- var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
8886
- if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
8887
- _this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
8888
- } 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())) {
8889
- _this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
8890
- } else if ([
8891
- 'day',
8892
- 'pick'
8893
- ].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())) {
8894
- if (_this._change) {
8895
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
8896
- }
8897
- _this._date = new Date(e.date.getTime());
8898
- }
8899
- if (e.view === 'day') _this.hide();
8900
- _this._change = true;
8901
- });
8902
- });
8903
- });
8904
- });
8905
- };
8906
- /**
8907
- * 设置日期, change = true 时触发 onChange 事件
8908
- *
8909
- * @param date 设置的日期
8910
- * @param change 是否触发 onChange 事件
8911
- */ _proto.setDate = function setDate(date, change) {
8912
- if (change === void 0) change = true;
8913
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8914
- if ($datepicker) {
8915
- this._change = change;
8916
- window.$(this.$container).datepicker('setDate', date);
8917
- }
8918
- };
8919
- /**
8920
- * 隐藏面板, 会触发 onPanelChange 事件
8921
- */ _proto.hide = function hide() {
8922
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8923
- if ($datepicker) {
8924
- if (this._open) {
8925
- this._open = false;
8926
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
8927
- }
8928
- $datepicker.classList.add('datepicker-hide');
8929
- }
8930
- };
8931
- /**
8932
- * 显示面板, 会触发 onPanelChange 事件
8933
- */ _proto.show = function show() {
8934
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8935
- if ($datepicker) {
8936
- var _window_$_datepicker, _window_$;
8937
- if (!this._open) {
8938
- this._open = true;
8939
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
8940
- }
8941
- if (this._date) this.setDate(this._date, false);
8942
- (_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
8943
- if (this.options.place === 'bottom-left') {
8944
- $datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
8945
- } else {
8946
- $datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
8947
- }
8948
- $datepicker.classList.remove('datepicker-hide');
8949
- }
8950
- };
8951
- /**
8952
- * 销毁
8953
- */ _proto.destroy = function destroy() {
8954
- this.hide();
8955
- this._date = undefined;
8956
- window.$(this.$container).datepicker('destroy');
8957
- // AppendJS.remove([
8958
- // `${this.options.staticPath}/rec/jquery.min.js`,
8959
- // `${this.options.staticPath}/rec/datepicker.min.css`,
8960
- // `${this.options.staticPath}/rec/datepicker.js`,
8961
- // `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
8962
- // `${this.options.staticPath}/rec/datepicker.en-US.js`,
8963
- // ]);
8964
- };
8965
- _create_class(DatePicker, [
8966
- {
8967
- key: "date",
8968
- get: /**
8969
- * 获取日期
8970
- */ function get() {
8971
- return this._date;
8972
- }
8973
- }
8974
- ]);
8975
- return DatePicker;
8976
- }();
8977
-
8978
- dist = DatePicker;
8979
- return dist;
8980
- }
8981
-
8982
- var distExports = requireDist();
8983
- var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports);
8984
-
8985
- /**
8986
- * @description 时间操作
8987
- */ var DateTime = /*#__PURE__*/ function() {
8988
- function DateTime() {}
8989
- /**
8990
- * @description 时间格式化
8991
- * @param {Date | number | string} date
8992
- * @param {string} formatType 格式 'YYYY-MM-DD hh:mm:ss' 或 'YYYYMMDDhhmmss' 或 'YYYY/MM/DD hh:mm:ss' 或 'hh:mm:ss' 或 'YYYYMMDDThhmmssZ'
8993
- * @param {number} timeZone 时区偏移量 默认 0
8994
- */ DateTime.formate = function formate(date, formatType, timeZone) {
8995
- if (timeZone === void 0) timeZone = 0;
8996
- var dateTime = date;
8997
- if (typeof date === 'string') {
8998
- dateTime = DateTime.strToDate(date);
8999
- } else if (typeof date === 'number') {
9000
- dateTime = new Date(date);
9001
- }
9002
- dateTime = new Date(dateTime.getTime() - timeZone * 3600 * 1000);
9003
- var year = dateTime.getFullYear();
9004
- var month = String(dateTime.getMonth() + 1).padStart(2, '0');
9005
- var day = String(dateTime.getDate()).padStart(2, '0');
9006
- var hours = String(dateTime.getHours()).padStart(2, '0');
9007
- var minutes = String(dateTime.getMinutes()).padStart(2, '0');
9008
- var seconds = String(dateTime.getSeconds()).padStart(2, '0');
9009
- switch(formatType){
9010
- case 'YYYY-MM-DD hh:mm:ss':
9011
- return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
9012
- case 'YYYYMMDDhhmmss':
9013
- return "" + year + month + day + hours + minutes + seconds;
9014
- case 'YYYY/MM/DD hh:mm:ss':
9015
- return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
9016
- case 'YYYYMMDDThhmmssZ':
9017
- return "" + year + month + day + "T" + hours + minutes + seconds + "Z";
9018
- case 'YYYY/MM/DD':
9019
- return year + "/" + month + "/" + day;
9020
- case 'YYYYMMDD':
9021
- return "" + year + month + day;
9022
- case 'YYYY-MM-DD':
9023
- return year + "-" + month + "-" + day;
9024
- case 'YYYY':
9025
- return "" + year;
9026
- case 'MM':
9027
- return "" + month;
9028
- case 'DD':
9029
- return "" + day;
9030
- case 'hh:mm:ss':
9031
- return hours + ":" + minutes + ":" + seconds;
9032
- case 'hh':
9033
- return "" + hours;
9034
- case 'mm':
9035
- return "" + minutes;
9036
- case 'ss':
9037
- return "" + seconds;
9038
- default:
9039
- throw new Error('Unsupported format type');
9040
- }
9041
- };
9042
- /**
9043
- * @description 对比两个时间的差值
9044
- * @param {Date | string | number} date1
9045
- * @param {Date | string | number} date2
9046
- * @param {"year" | "month" | "day" | "hour" | "minute" | "second"} diffType
9047
- */ DateTime.diff = function diff(date1, date2, diffType) {
9048
- /** @type {Date} */ var dateTime1 = date1;
9049
- if (typeof date1 === 'string') {
9050
- dateTime1 = DateTime.strToDate(date1);
9051
- } else if (typeof date1 === 'number') {
9052
- dateTime1 = new Date(date1);
9053
- }
9054
- /** @type {Date} */ var dateTime2 = date2;
9055
- if (typeof date2 === 'string') {
9056
- dateTime1 = DateTime.strToDate(date2);
9057
- } else if (typeof date2 === 'number') {
9058
- dateTime1 = new Date(date2);
9059
- }
9060
- var diffSecond = dateTime1.getTime() - dateTime2.getTime();
9061
- // diff
9062
- switch(diffType){
9063
- case 'year':
9064
- return dateTime1.getFullYear() - dateTime2.getFullYear();
9065
- case 'month':
9066
- // 计算总月份差
9067
- // eslint-disable-next-line no-case-declarations
9068
- var months = (dateTime1.getFullYear() - dateTime2.getFullYear()) * 12 + (dateTime1.getMonth() - dateTime2.getMonth());
9069
- // 如果结束日的日期小于开始日的日期,则减去一个月
9070
- if (dateTime1.getDate() < dateTime2.getDate()) {
9071
- months--;
9072
- }
9073
- return months;
9074
- case 'day':
9075
- return diffSecond / 60 / 60 / 24;
9076
- case 'hour':
9077
- return diffSecond / 60 / 60;
9078
- case 'minute':
9079
- return diffSecond / 60;
9080
- case 'second':
9081
- return diffSecond;
9082
- default:
9083
- throw new Error('Unsupported diff type');
9084
- }
9085
- };
9086
- DateTime.now = function now() {
9087
- return Date.now();
9088
- };
9089
- /**
9090
- *
9091
- * @param {string} str 日期, 2025-04-10 10:10:10 或 2025/04/10 10:10:10 或 20250410101010 或 20250410T101010Z 或 秒 或 毫秒
9092
- * @example
9093
- * DateTime.strToDate("2025/04/10 10:10:10") // Date
9094
- * DateTime.strToDate("2025-04-10 10:10:10") // Date
9095
- * DateTime.strToDate("20250410101010") // Date
9096
- * DateTime.strToDate("20250410T101010Z") // Date
9097
- */ DateTime.strToDate = function strToDate(str) {
9098
- var time = (str + '').replace(/-/gi, '').replace(/:/gi, '').replace(/\//gi, '').replace(/ /gi, '').replace(/T|Z/gi, '');
9099
- // 兼容
9100
- if ((str + '').length === 10) {
9101
- // 时间戳 秒
9102
- return new Date(+str);
9103
- } else if ((str + '').length === 13) {
9104
- // 时间戳 毫秒
9105
- return new Date(+str);
9106
- }
9107
- var year = time.slice(0, 4);
9108
- var month = time.slice(4, 6);
9109
- var day = time.slice(6, 8);
9110
- var hour = time.slice(8, 10);
9111
- var minute = time.slice(10, 12);
9112
- var second = time.slice(12, 14);
9113
- return new Date(year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second);
9114
- };
9115
- /**
9116
- * @description 补充十位
9117
- * @param {number} num
9118
- * @returns {string}
9119
- * @example
9120
- * DateTime.padStart(1) // "01"
9121
- * DateTime.padStart(33) // "33"
9122
- */ DateTime.padStart = function padStart(num) {
9123
- if (num < 10) {
9124
- return '0' + num;
9125
- } else {
9126
- return num + '';
9127
- }
9128
- };
9129
- return DateTime;
9130
- }();
9131
-
9132
8627
  function _extends$5() {
9133
8628
  _extends$5 = Object.assign || function(target) {
9134
8629
  for(var i = 1; i < arguments.length; i++){
@@ -9171,20 +8666,29 @@ function _set_prototype_of$6(o, p) {
9171
8666
  function DatePickerControl(options) {
9172
8667
  var _this;
9173
8668
  var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
9174
- _this = Control.call(this, _extends$5({}, options, {
8669
+ _this = Control.call(this, _extends$5({
8670
+ maxDate: new Date()
8671
+ }, options, {
9175
8672
  tagName: 'span',
9176
8673
  controlType: 'button',
9177
8674
  classNameSuffix: 'date'
9178
8675
  })) || this;
9179
8676
  _this.options = options;
9180
- _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');
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');
9181
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
+ });
9182
8684
  return _this;
9183
8685
  }
9184
8686
  var _proto = DatePickerControl.prototype;
9185
8687
  _proto._render = function _render() {
9186
8688
  var _this = this;
9187
- if (require$$1.isMobile()) {
8689
+ var _this_options_props;
8690
+ var isMobile1 = require$$1.isMobile();
8691
+ if (isMobile1) {
9188
8692
  var _this_locale;
9189
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>";
9190
8694
  } else {
@@ -9193,25 +8697,45 @@ function _set_prototype_of$6(o, p) {
9193
8697
  title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
9194
8698
  });
9195
8699
  }
9196
- this.dataPickerUtil = new DatePickerUtil(this.$container, {
9197
- staticPath: this.options.staticPath,
9198
- language: this.options.language === 'zh' ? 'zh-CN' : 'en-US',
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',
9199
8712
  current: new Date(this._value + ' 00:00:00'),
9200
- maxDate: this.options.maxDate || new Date(),
9201
- place: require$$1.isMobile() ? 'bottom-left' : 'top-right',
9202
- onChange: function(date) {
9203
- if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
9204
- _this._value = DateTime.formate(date, 'YYYY-MM-DD');
9205
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
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);
9206
8723
  _this.emit(EVENTS.control.dateChange, date);
9207
8724
  if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
9208
8725
  _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
9209
8726
  }
9210
8727
  }
9211
8728
  },
9212
- onPanelChange: function(open, date) {
9213
- _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, date);
9214
- _this.emit(EVENTS.control.datePanelOpenChange, open, date);
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);
9215
8739
  }
9216
8740
  });
9217
8741
  };
@@ -9221,28 +8745,27 @@ function _set_prototype_of$6(o, p) {
9221
8745
  * @param change 是否触发 onChange 事件
9222
8746
  */ _proto.setDate = function setDate(date, change) {
9223
8747
  if (change === void 0) change = true;
9224
- var _this_dataPickerUtil;
9225
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.setDate(date, change);
9226
- if (date && !change && this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
9227
- this._value = DateTime.formate(date, 'YYYY-MM-DD');
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');
9228
8752
  if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
9229
8753
  this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
9230
8754
  }
9231
8755
  }
9232
8756
  };
9233
8757
  _proto.reset = function reset() {
9234
- var _this_dataPickerUtil;
9235
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
8758
+ if (this.datePicker) this.datePicker.open = false;
9236
8759
  Control.prototype.reset.call(this);
9237
8760
  };
9238
8761
  /**
9239
8762
  * 销毁控件
9240
8763
  * @override
9241
8764
  */ _proto.destroy = function destroy() {
9242
- if (this.dataPickerUtil) {
9243
- this.dataPickerUtil.destroy();
8765
+ if (this.datePicker) {
8766
+ this.datePicker.destroy();
9244
8767
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9245
- this.dataPickerUtil = null;
8768
+ this.datePicker = null;
9246
8769
  }
9247
8770
  Control.prototype.destroy.call(this);
9248
8771
  };
@@ -9252,6 +8775,7 @@ function _set_prototype_of$6(o, p) {
9252
8775
  };
9253
8776
  /**
9254
8777
  * 点击 Control 会触发
8778
+ * @overload super._onControlClick(e: Event)
9255
8779
  */ _proto._onControlClick = function _onControlClick(e) {
9256
8780
  Control.prototype._onControlClick.call(this, e);
9257
8781
  };
@@ -10324,8 +9848,7 @@ var _renderDatePicker = function(theme, container, props) {
10324
9848
  return container;
10325
9849
  },
10326
9850
  language: theme.options.language,
10327
- locales: theme.i18n.translations,
10328
- staticPath: theme.options.staticPath
9851
+ locales: theme.i18n.translations
10329
9852
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
10330
9853
  props: props
10331
9854
  }));
@@ -10624,7 +10147,18 @@ var THEME_DEFAULT_OPTIONS = {
10624
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, /**
10625
10148
  * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
10626
10149
  * @private
10627
- */ _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;
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;
10628
10162
  _this._initOptions(options);
10629
10163
  if (_this.options.type === 'ezopen') {
10630
10164
  var _this_urlInfo_searchParams, _this_urlInfo;
@@ -10634,7 +10168,7 @@ var THEME_DEFAULT_OPTIONS = {
10634
10168
  }
10635
10169
  if (_this.urlInfo.type === 'rec') {
10636
10170
  var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
10637
- _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');
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');
10638
10172
  }
10639
10173
  }
10640
10174
  _this._getRecType(_this.options.url);
@@ -10881,6 +10415,7 @@ var THEME_DEFAULT_OPTIONS = {
10881
10415
  this._themeData = null;
10882
10416
  if (this.i18n) this.i18n = null;
10883
10417
  this.recType = '';
10418
+ this.recMonth = []; // 清空数据
10884
10419
  this.emit(EVENTS.theme.destroyed);
10885
10420
  this.removeAllListeners();
10886
10421
  if (this.logger) this.logger = null;
@@ -11846,7 +11381,7 @@ var THEME_DEFAULT_OPTIONS = {
11846
11381
  zh: zh,
11847
11382
  en: en
11848
11383
  };
11849
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.1';
11384
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.10';
11850
11385
 
11851
11386
  exports.Control = Control;
11852
11387
  exports.Fullscreen = Fullscreen;