@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.mjs CHANGED
@@ -1,16 +1,17 @@
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
  import EventEmitter from 'eventemitter3';
7
7
  import Picker from '@skax/picker';
8
8
  import delegate from '@skax/delegate';
9
9
  import deepmerge from 'deepmerge';
10
- import require$$1, { isMobile, parseEzopenUrl } from '@ezuikit/utils-tools';
10
+ import require$$1, { isMobile, DateTime, parseEzopenUrl } from '@ezuikit/utils-tools';
11
11
  import screenfull from 'screenfull';
12
12
  import I18n from '@ezuikit/utils-i18n';
13
13
  import Logger from '@ezuikit/utils-logger';
14
+ import { DatePicker } from '@ezuikit/control-date-picker';
14
15
  import { MobileTimeLine, TimeLine } from '@ezuikit/control-time-line';
15
16
 
16
17
  /**
@@ -41,7 +42,8 @@ var THEME_PROPS = [
41
42
  'speed',
42
43
  'urlInfo',
43
44
  'videoLevelList',
44
- 'videoLevel'
45
+ 'videoLevel',
46
+ 'recMonth'
45
47
  ];
46
48
  /**
47
49
  * 当移动端 picker 控件打开时需要关闭动画(定时器)
@@ -187,8 +189,9 @@ var EVENTS = {
187
189
  /** 全局全屏控件销毁 */ globalFullscreenDestroy: 'Control.globalFullscreenDestroy',
188
190
  /** 日期面板展示隐藏变换 */ datePanelOpenChange: 'Control.datePanelOpenChange',
189
191
  /** 日期改变 */ dateChange: 'Control.dateChange',
192
+ /** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
190
193
  /** 日期销毁 */ dateDestroy: 'Control.datePanelDestroy',
191
- /** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
194
+ /** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
192
195
  /** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
193
196
  /** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
194
197
  /** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
@@ -199,7 +202,7 @@ var EVENTS = {
199
202
  /** 加载控件销毁 */ loadingDestroy: 'Control.loadingDestroy',
200
203
  /** 消息控件销毁 */ messageDestroy: 'Control.messageDestroy',
201
204
  /** 播放器内容区域销毁 */ contentDestroy: 'Control.contentDestroy',
202
- contentRerender: 'Control.contentRerender'
205
+ /** 播放器内容区域重新渲染 */ contentRerender: 'Control.contentRerender'
203
206
  },
204
207
  /**
205
208
  * 主题控件相关
@@ -266,9 +269,14 @@ function _set_prototype_of$r(o, p) {
266
269
  function Control(options) {
267
270
  var _this;
268
271
  var _this___options;
269
- _this = EventEmitter.call(this) || this, /** 具体语言对应的值 */ _this.locale = null, _this.__options = {}, _this._disabled = false, _this._active = false;
272
+ _this = EventEmitter.call(this) || this, /** 具体语言对应的值 */ _this.locale = null, _this.__options = {}, _this._disabled = false, _this._active = false, _this._camelCaseName = '';
270
273
  _this.__options = options;
271
274
  _this.locale = getLocale(_this.__options.locales, _this.__options.language);
275
+ _this._camelCaseName = _this.__options.classNameSuffix ? _this.__options.classNameSuffix.replace(/[-_\s]+(.)?/g, function(_, c) {
276
+ return c ? c.toUpperCase() : '';
277
+ }).replace(/^(.)/, function(first) {
278
+ return first.toLowerCase();
279
+ }) : '';
272
280
  _this.$container = document.createElement(options.tagName || 'span');
273
281
  _this.$container.classList.add("" + PREFIX_CLASS + "-control"); // 默认隐藏
274
282
  if ((options == null ? void 0 : options.controlType) === 'text') {
@@ -427,19 +435,6 @@ function _set_prototype_of$r(o, p) {
427
435
  this._disabled = disabled;
428
436
  this._updateDisabledState(disabled);
429
437
  }
430
- },
431
- {
432
- key: "_camelCaseName",
433
- get: function get() {
434
- if (this.__options.classNameSuffix) {
435
- return this.__options.classNameSuffix.replace(/[-_\s]+(.)?/g, function(_, c) {
436
- return c ? c.toUpperCase() : '';
437
- }).replace(/^(.)/, function(first) {
438
- return first.toLowerCase();
439
- });
440
- }
441
- return null;
442
- }
443
438
  }
444
439
  ]);
445
440
  return Control;
@@ -4060,11 +4055,11 @@ function debounce(func, wait) {
4060
4055
  // 对讲
4061
4056
  // =======================================================
4062
4057
  theme.on(EVENTS.talkingChange, function(talking) {
4063
- var _theme_controls_talkControl, _theme_controls;
4058
+ var _theme_controls, _theme_controls_talkControl, _theme_controls1;
4064
4059
  theme._talking = talking;
4065
- if (talking !== ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls.talkControl) == null ? void 0 : _theme_controls_talkControl.active)) {
4066
- var _theme_controls_talkControl1, _theme_controls1;
4067
- (_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls1.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
4060
+ 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)) {
4061
+ var _theme_controls_talkControl1, _theme_controls2;
4062
+ (_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls2.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
4068
4063
  }
4069
4064
  });
4070
4065
  theme.on(EVENTS.talkVolumeChange, function(value) {
@@ -4075,9 +4070,9 @@ function debounce(func, wait) {
4075
4070
  // 录制
4076
4071
  // =======================================================
4077
4072
  theme.on(EVENTS.recordingChange, function(recording) {
4078
- var _theme_controls_recordControl, _theme_controls;
4073
+ var _theme_controls, _theme_controls_recordControl, _theme_controls1;
4079
4074
  theme._recording = recording;
4080
- 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;
4075
+ 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;
4081
4076
  });
4082
4077
  // =======================================================
4083
4078
  // 清晰度
@@ -4094,14 +4089,14 @@ function debounce(func, wait) {
4094
4089
  // 放大
4095
4090
  // =======================================================
4096
4091
  theme.on(EVENTS.zoomingChange, function(zooming) {
4097
- var _theme_controls_zoomControl1, _theme_controls1;
4098
- if (((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 = _theme_controls1.zoomControl) == null ? void 0 : _theme_controls_zoomControl1.active) !== zooming) {
4092
+ var _theme_controls1, _theme_controls_zoomControl1, _theme_controls2;
4093
+ 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) {
4099
4094
  theme.controls.zoomControl.active = zooming;
4100
4095
  }
4101
4096
  });
4102
4097
  theme.on(EVENTS.zoomChange, function(zoom) {
4103
- var _theme_controls_zoomControl, _theme_controls;
4104
- if (((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_zoomControl = _theme_controls.zoomControl) == null ? void 0 : _theme_controls_zoomControl.value) !== zoom) {
4098
+ var _theme_controls, _theme_controls_zoomControl, _theme_controls1;
4099
+ 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) {
4105
4100
  theme.controls.zoomControl.value = zoom;
4106
4101
  }
4107
4102
  });
@@ -4127,31 +4122,40 @@ function debounce(func, wait) {
4127
4122
  // 全屏
4128
4123
  // =======================================================
4129
4124
  theme == null ? void 0 : theme.on(EVENTS.fullscreenChange, function(info) {
4130
- if ([
4131
- 0,
4132
- 180
4133
- ].includes(theme.orientationAngle) && info.isMobile && info.isCurrentFullscreen) {
4134
- var // 代表移动端播放内容节点被旋转了 90度
4135
- _theme_zoomUtil_setTransform, _theme_zoomUtil;
4136
- (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
4137
- } else {
4138
- var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
4139
- (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
4125
+ if (theme.zoomUtil) {
4126
+ if ([
4127
+ 0,
4128
+ 180
4129
+ ].includes(theme.orientationAngle) && info.isMobile && info.isCurrentFullscreen) {
4130
+ var // 代表移动端播放内容节点被旋转了 90度
4131
+ _theme_zoomUtil_setTransform, _theme_zoomUtil;
4132
+ (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
4133
+ } else {
4134
+ var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
4135
+ (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
4136
+ }
4140
4137
  }
4141
4138
  });
4142
4139
  theme == null ? void 0 : theme.on(EVENTS.orientationChange, function(angle) {
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);
4140
+ if (theme.zoomUtil) {
4141
+ if ([
4142
+ 0,
4143
+ 180
4144
+ ].includes(angle) && Utils.isMobile && theme.isCurrentFullscreen) {
4145
+ var // 代表移动端播放内容节点被旋转了 90度
4146
+ _theme_zoomUtil_setTransform, _theme_zoomUtil;
4147
+ (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
4148
+ } else {
4149
+ var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
4150
+ (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
4151
+ }
4153
4152
  }
4154
4153
  });
4154
+ // 日期选择器
4155
+ theme == null ? void 0 : theme.on(EVENTS.control.dateMonthChange, function(dates) {
4156
+ var _theme_controls_dateControl_emit, _theme_controls_dateControl, _theme_controls;
4157
+ (_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);
4158
+ });
4155
4159
  }
4156
4160
  /**
4157
4161
  * 控件向主题发现通信消息 control.on -> theme.emit ,仅用来转发控件的事件
@@ -4331,13 +4335,16 @@ function debounce(func, wait) {
4331
4335
  // prettier-ignore
4332
4336
  theme.controls.recControl.on(EVENTS.control.recTypeChange, function(type) {
4333
4337
  if (theme.recType !== type) {
4334
- var _theme__headerMoreControl;
4338
+ var _theme__headerMoreControl, _theme_controls;
4335
4339
  theme.recType = type;
4336
4340
  theme.emit(EVENTS.control.recTypeChange, type);
4337
4341
  // theme.emit(EVENTS.recTypeChange, type);
4338
4342
  if ((_theme__headerMoreControl = theme._headerMoreControl) == null ? void 0 : _theme__headerMoreControl.picker) {
4339
4343
  theme._headerMoreControl.picker.open = false;
4340
4344
  }
4345
+ if ((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.speedControl) {
4346
+ theme.controls.speedControl.emit(EVENTS.control.recTypeChange, type);
4347
+ }
4341
4348
  }
4342
4349
  });
4343
4350
  theme.controls.recControl.on(EVENTS.control.recDestroy, function() {
@@ -4350,10 +4357,10 @@ function debounce(func, wait) {
4350
4357
  theme.emit(EVENTS.control.timeLineChange, date);
4351
4358
  });
4352
4359
  theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, function(open) {
4353
- var _theme_controls_dateControl;
4354
- if ((_theme_controls_dateControl = theme.controls.dateControl) == null ? void 0 : _theme_controls_dateControl.dataPickerUtil) {
4355
- var _theme_controls_dateControl_dataPickerUtil, _theme_controls_dateControl1;
4356
- (_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();
4360
+ var _theme_controls_dateControl, _theme_controls;
4361
+ if ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : _theme_controls_dateControl.datePicker) {
4362
+ var _theme_controls_dateControl_datePicker, _theme_controls_dateControl1, _theme_controls1;
4363
+ (_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();
4357
4364
  }
4358
4365
  theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
4359
4366
  });
@@ -4646,12 +4653,12 @@ function getDefaultExportFromCjs (x) {
4646
4653
  * Released under the MIT License.
4647
4654
  */
4648
4655
 
4649
- var dist$2;
4650
- var hasRequiredDist$2;
4656
+ var dist$1;
4657
+ var hasRequiredDist$1;
4651
4658
 
4652
- function requireDist$2 () {
4653
- if (hasRequiredDist$2) return dist$2;
4654
- hasRequiredDist$2 = 1;
4659
+ function requireDist$1 () {
4660
+ if (hasRequiredDist$1) return dist$1;
4661
+ hasRequiredDist$1 = 1;
4655
4662
 
4656
4663
  /**
4657
4664
  * Zoom position
@@ -5358,12 +5365,12 @@ function requireDist$2 () {
5358
5365
  }();
5359
5366
  Zoom.VERSION = '0.0.2';
5360
5367
 
5361
- dist$2 = Zoom;
5362
- return dist$2;
5368
+ dist$1 = Zoom;
5369
+ return dist$1;
5363
5370
  }
5364
5371
 
5365
- var distExports$2 = requireDist$2();
5366
- var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$2);
5372
+ var distExports$1 = requireDist$1();
5373
+ var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
5367
5374
 
5368
5375
  function _extends$h() {
5369
5376
  _extends$h = Object.assign || function(target) {
@@ -6438,7 +6445,7 @@ function _set_prototype_of$d(o, p) {
6438
6445
  return CapturePicture;
6439
6446
  }(Control);
6440
6447
 
6441
- var dist$1 = {};
6448
+ var dist = {};
6442
6449
 
6443
6450
  /*
6444
6451
  * @ezuikit/control-ptz v0.0.1
@@ -6446,11 +6453,11 @@ var dist$1 = {};
6446
6453
  * Released under the MIT License.
6447
6454
  */
6448
6455
 
6449
- var hasRequiredDist$1;
6456
+ var hasRequiredDist;
6450
6457
 
6451
- function requireDist$1 () {
6452
- if (hasRequiredDist$1) return dist$1;
6453
- hasRequiredDist$1 = 1;
6458
+ function requireDist () {
6459
+ if (hasRequiredDist) return dist;
6460
+ hasRequiredDist = 1;
6454
6461
 
6455
6462
  var deepmerge$1 = deepmerge;
6456
6463
  var utilsTools = require$$1;
@@ -7373,13 +7380,13 @@ function requireDist$1 () {
7373
7380
  return Ptz;
7374
7381
  }(BasePtz);
7375
7382
 
7376
- dist$1.BasePtz = BasePtz;
7377
- dist$1.MobilePtz = MobilePtz;
7378
- dist$1.Ptz = Ptz;
7379
- return dist$1;
7383
+ dist.BasePtz = BasePtz;
7384
+ dist.MobilePtz = MobilePtz;
7385
+ dist.Ptz = Ptz;
7386
+ return dist;
7380
7387
  }
7381
7388
 
7382
- var distExports$1 = requireDist$1();
7389
+ var distExports = requireDist();
7383
7390
 
7384
7391
  function _defineProperties$4(target, props) {
7385
7392
  for(var i = 0; i < props.length; i++){
@@ -7478,7 +7485,7 @@ function _set_prototype_of$c(o, p) {
7478
7485
  this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
7479
7486
  this.$panel.appendChild(this.$turntable);
7480
7487
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
7481
- this._ptzControl = new distExports$1.Ptz(this.$turntable, _extends$b({}, this._options, {
7488
+ this._ptzControl = new distExports.Ptz(this.$turntable, _extends$b({}, this._options, {
7482
7489
  onSpeedChange: this._onSpeedChange.bind(this),
7483
7490
  onDirection: this._onDirection.bind(this)
7484
7491
  }));
@@ -7487,7 +7494,7 @@ function _set_prototype_of$c(o, p) {
7487
7494
  };
7488
7495
  _proto.renderMobileExtend = function renderMobileExtend($container) {
7489
7496
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
7490
- if (!this._ptzControl1) this._ptzControl1 = new distExports$1.MobilePtz($container, _extends$b({}, this._options, {
7497
+ if (!this._ptzControl1) this._ptzControl1 = new distExports.MobilePtz($container, _extends$b({}, this._options, {
7491
7498
  onSpeedChange: this._onSpeedChange.bind(this),
7492
7499
  onDirection: this._onDirection.bind(this)
7493
7500
  }));
@@ -8579,12 +8586,35 @@ var SPEED_DEFAULT_OPTIONS = {
8579
8586
  _assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
8580
8587
  }
8581
8588
  })) || this;
8589
+ _this._filterSpeedList(options.list, options.props.recType);
8582
8590
  _this.on(EVENTS.speedChange, function(speed) {
8583
8591
  if (_this.value !== speed + '') _this.value = speed + '';
8584
8592
  });
8593
+ _this.on(EVENTS.control.recTypeChange, function(type) {
8594
+ _this._filterSpeedList(options.list, type);
8595
+ });
8585
8596
  return _this;
8586
8597
  }
8587
8598
  var _proto = Speed.prototype;
8599
+ /**
8600
+ * 滤掉本地回放不支持的倍速
8601
+ * @param optionsList 初始化配置倍速列表
8602
+ * @param type 回放类型
8603
+ */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
8604
+ if (!optionsList) {
8605
+ // 非用户自定义
8606
+ if (type === 'rec') {
8607
+ // 本地回放 不支持 8 16 32 倍速
8608
+ var list = this.list.filter(function(item) {
8609
+ return (item == null ? void 0 : item.value) && +item.value < 8;
8610
+ });
8611
+ this.updateOptions(list);
8612
+ } else {
8613
+ // 云端回放 支持 8 16 32 倍速
8614
+ this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
8615
+ }
8616
+ }
8617
+ };
8588
8618
  _proto.reset = function reset(hide) {
8589
8619
  this.value = 1 + '';
8590
8620
  Select.prototype.reset.call(this, hide);
@@ -8592,541 +8622,6 @@ var SPEED_DEFAULT_OPTIONS = {
8592
8622
  return Speed;
8593
8623
  }(Select);
8594
8624
 
8595
- /*
8596
- * @ezuikit/control-date-picker v0.0.1-alpha.2
8597
- * Copyright (c) 2025-11-12 Ezviz-OpenBiz
8598
- * Released under the MIT License.
8599
- */
8600
-
8601
- var dist;
8602
- var hasRequiredDist;
8603
-
8604
- function requireDist () {
8605
- if (hasRequiredDist) return dist;
8606
- hasRequiredDist = 1;
8607
-
8608
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8609
- try {
8610
- var info = gen[key](arg);
8611
- var value = info.value;
8612
- } catch (error) {
8613
- reject(error);
8614
- return;
8615
- }
8616
- if (info.done) {
8617
- resolve(value);
8618
- } else {
8619
- Promise.resolve(value).then(_next, _throw);
8620
- }
8621
- }
8622
- function _async_to_generator(fn) {
8623
- return function() {
8624
- var self = this, args = arguments;
8625
- return new Promise(function(resolve, reject) {
8626
- var gen = fn.apply(self, args);
8627
- function _next(value) {
8628
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
8629
- }
8630
- function _throw(err) {
8631
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
8632
- }
8633
- _next(undefined);
8634
- });
8635
- };
8636
- }
8637
- function _ts_generator(thisArg, body) {
8638
- var f, y, t, _ = {
8639
- label: 0,
8640
- sent: function() {
8641
- if (t[0] & 1) throw t[1];
8642
- return t[1];
8643
- },
8644
- trys: [],
8645
- ops: []
8646
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
8647
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
8648
- return this;
8649
- }), g;
8650
- function verb(n) {
8651
- return function(v) {
8652
- return step([
8653
- n,
8654
- v
8655
- ]);
8656
- };
8657
- }
8658
- function step(op) {
8659
- if (f) throw new TypeError("Generator is already executing.");
8660
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
8661
- 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;
8662
- if (y = 0, t) op = [
8663
- op[0] & 2,
8664
- t.value
8665
- ];
8666
- switch(op[0]){
8667
- case 0:
8668
- case 1:
8669
- t = op;
8670
- break;
8671
- case 4:
8672
- _.label++;
8673
- return {
8674
- value: op[1],
8675
- done: false
8676
- };
8677
- case 5:
8678
- _.label++;
8679
- y = op[1];
8680
- op = [
8681
- 0
8682
- ];
8683
- continue;
8684
- case 7:
8685
- op = _.ops.pop();
8686
- _.trys.pop();
8687
- continue;
8688
- default:
8689
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
8690
- _ = 0;
8691
- continue;
8692
- }
8693
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
8694
- _.label = op[1];
8695
- break;
8696
- }
8697
- if (op[0] === 6 && _.label < t[1]) {
8698
- _.label = t[1];
8699
- t = op;
8700
- break;
8701
- }
8702
- if (t && _.label < t[2]) {
8703
- _.label = t[2];
8704
- _.ops.push(op);
8705
- break;
8706
- }
8707
- if (t[2]) _.ops.pop();
8708
- _.trys.pop();
8709
- continue;
8710
- }
8711
- op = body.call(thisArg, _);
8712
- } catch (e) {
8713
- op = [
8714
- 6,
8715
- e
8716
- ];
8717
- y = 0;
8718
- } finally{
8719
- f = t = 0;
8720
- }
8721
- if (op[0] & 5) throw op[1];
8722
- return {
8723
- value: op[0] ? op[1] : void 0,
8724
- done: true
8725
- };
8726
- }
8727
- }
8728
- var AppendJS = /*#__PURE__*/ function() {
8729
- function AppendJS() {}
8730
- AppendJS.loadScript = function loadScript(src) {
8731
- return _async_to_generator(function() {
8732
- return _ts_generator(this, function(_state) {
8733
- switch(_state.label){
8734
- case 0:
8735
- return [
8736
- 4,
8737
- new Promise(function(resolve, reject) {
8738
- if (AppendJS.LoadedScr.includes(src)) {
8739
- return resolve(src);
8740
- }
8741
- if (AppendJS.LoadingScrQueue[src]) {
8742
- return AppendJS.LoadingScrQueue[src].push(resolve);
8743
- } else {
8744
- AppendJS.LoadingScrQueue[src] = [
8745
- resolve
8746
- ];
8747
- }
8748
- var link;
8749
- if (src.includes('.js')) {
8750
- link = document.createElement('script');
8751
- link.src = src;
8752
- link.async = true;
8753
- } else if (src.includes('.css')) {
8754
- link = document.createElement('link');
8755
- link.rel = 'stylesheet';
8756
- link.href = src;
8757
- }
8758
- link.onload = function() {
8759
- AppendJS.LoadedScr.push(src);
8760
- AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
8761
- return resolve(src);
8762
- });
8763
- AppendJS.LoadingScrQueue[src] = [];
8764
- };
8765
- link.onerror = function() {
8766
- return reject(new Error('Failed to load ' + src));
8767
- };
8768
- document.head.appendChild(link);
8769
- })
8770
- ];
8771
- case 1:
8772
- return [
8773
- 2,
8774
- _state.sent()
8775
- ];
8776
- }
8777
- });
8778
- })();
8779
- };
8780
- AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
8781
- return _async_to_generator(function() {
8782
- return _ts_generator(this, function(_state) {
8783
- switch(_state.label){
8784
- case 0:
8785
- return [
8786
- 4,
8787
- Promise.all(srcArr.map(AppendJS.loadScript))
8788
- ];
8789
- case 1:
8790
- return [
8791
- 2,
8792
- _state.sent()
8793
- ];
8794
- }
8795
- });
8796
- })();
8797
- };
8798
- AppendJS.remove = function remove(src) {
8799
- src.forEach(function(item) {
8800
- var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
8801
- if (link) {
8802
- link.remove();
8803
- }
8804
- });
8805
- };
8806
- AppendJS.clear = function clear() {
8807
- AppendJS.remove(AppendJS.LoadedScr);
8808
- };
8809
- return AppendJS;
8810
- }();
8811
- /** 已经加载完的js/css */ AppendJS.LoadedScr = [];
8812
- /** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
8813
-
8814
- function _defineProperties(target, props) {
8815
- for(var i = 0; i < props.length; i++){
8816
- var descriptor = props[i];
8817
- descriptor.enumerable = descriptor.enumerable || false;
8818
- descriptor.configurable = true;
8819
- if ("value" in descriptor) descriptor.writable = true;
8820
- Object.defineProperty(target, descriptor.key, descriptor);
8821
- }
8822
- }
8823
- function _create_class(Constructor, protoProps, staticProps) {
8824
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
8825
- return Constructor;
8826
- }
8827
- var DEFAULT_OPTIONS = {
8828
- staticPath: '.',
8829
- place: 'top-right',
8830
- language: 'zh-CN',
8831
- current: new Date(),
8832
- maxDate: new Date()
8833
- };
8834
- /**
8835
- * 日期选择器
8836
- */ var DatePicker = /*#__PURE__*/ function() {
8837
- function DatePicker(container, options) {
8838
- var _this = this;
8839
- this._open = false;
8840
- this._change = true;
8841
- this.$container = container;
8842
- this.options = Object.assign({}, DEFAULT_OPTIONS, options);
8843
- this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
8844
- if (this.options.current) {
8845
- this._date = this.options.current;
8846
- }
8847
- this._init();
8848
- this.$container.addEventListener('click', function() {
8849
- if (_this._open) _this.hide();
8850
- else _this.show();
8851
- });
8852
- document.body.addEventListener('click', function(e) {
8853
- if (!_this.$container.contains(e.target)) {
8854
- _this.hide();
8855
- }
8856
- });
8857
- }
8858
- var _proto = DatePicker.prototype;
8859
- _proto._init = function _init() {
8860
- var _this = this;
8861
- // 因为挂载在行内,需要父标签设置 position: relative;
8862
- this.$container.style.cssText += ";position: relative;";
8863
- this.$container.classList.add("datepicker-inline-" + this.options.place);
8864
- AppendJS.loadScriptsBatch([
8865
- "" + this.options.staticPath + "/rec/jquery.min.js",
8866
- "" + this.options.staticPath + "/rec/datepicker.min.css"
8867
- ]).then(function() {
8868
- AppendJS.loadScriptsBatch([
8869
- "" + _this.options.staticPath + "/rec/datepicker.js"
8870
- ]).then(function() {
8871
- AppendJS.loadScriptsBatch([
8872
- "" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
8873
- "" + _this.options.staticPath + "/rec/datepicker.en-US.js"
8874
- ]).then(function() {
8875
- window.$(_this.$container).datepicker({
8876
- date: _this.options.current,
8877
- language: _this.options.language,
8878
- endDate: _this.options.maxDate,
8879
- inline: true
8880
- });
8881
- _this.hide();
8882
- window.$(_this.$container).on('pick.datepicker', function(e) {
8883
- var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
8884
- if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
8885
- _this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
8886
- } 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())) {
8887
- _this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
8888
- } else if ([
8889
- 'day',
8890
- 'pick'
8891
- ].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())) {
8892
- if (_this._change) {
8893
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
8894
- }
8895
- _this._date = new Date(e.date.getTime());
8896
- }
8897
- if (e.view === 'day') _this.hide();
8898
- _this._change = true;
8899
- });
8900
- });
8901
- });
8902
- });
8903
- };
8904
- /**
8905
- * 设置日期, change = true 时触发 onChange 事件
8906
- *
8907
- * @param date 设置的日期
8908
- * @param change 是否触发 onChange 事件
8909
- */ _proto.setDate = function setDate(date, change) {
8910
- if (change === void 0) change = true;
8911
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8912
- if ($datepicker) {
8913
- this._change = change;
8914
- window.$(this.$container).datepicker('setDate', date);
8915
- }
8916
- };
8917
- /**
8918
- * 隐藏面板, 会触发 onPanelChange 事件
8919
- */ _proto.hide = function hide() {
8920
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8921
- if ($datepicker) {
8922
- if (this._open) {
8923
- this._open = false;
8924
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
8925
- }
8926
- $datepicker.classList.add('datepicker-hide');
8927
- }
8928
- };
8929
- /**
8930
- * 显示面板, 会触发 onPanelChange 事件
8931
- */ _proto.show = function show() {
8932
- var $datepicker = this.$container.querySelector(".datepicker-inline");
8933
- if ($datepicker) {
8934
- var _window_$_datepicker, _window_$;
8935
- if (!this._open) {
8936
- this._open = true;
8937
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
8938
- }
8939
- if (this._date) this.setDate(this._date, false);
8940
- (_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
8941
- if (this.options.place === 'bottom-left') {
8942
- $datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
8943
- } else {
8944
- $datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
8945
- }
8946
- $datepicker.classList.remove('datepicker-hide');
8947
- }
8948
- };
8949
- /**
8950
- * 销毁
8951
- */ _proto.destroy = function destroy() {
8952
- this.hide();
8953
- this._date = undefined;
8954
- window.$(this.$container).datepicker('destroy');
8955
- // AppendJS.remove([
8956
- // `${this.options.staticPath}/rec/jquery.min.js`,
8957
- // `${this.options.staticPath}/rec/datepicker.min.css`,
8958
- // `${this.options.staticPath}/rec/datepicker.js`,
8959
- // `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
8960
- // `${this.options.staticPath}/rec/datepicker.en-US.js`,
8961
- // ]);
8962
- };
8963
- _create_class(DatePicker, [
8964
- {
8965
- key: "date",
8966
- get: /**
8967
- * 获取日期
8968
- */ function get() {
8969
- return this._date;
8970
- }
8971
- }
8972
- ]);
8973
- return DatePicker;
8974
- }();
8975
-
8976
- dist = DatePicker;
8977
- return dist;
8978
- }
8979
-
8980
- var distExports = requireDist();
8981
- var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports);
8982
-
8983
- /**
8984
- * @description 时间操作
8985
- */ var DateTime = /*#__PURE__*/ function() {
8986
- function DateTime() {}
8987
- /**
8988
- * @description 时间格式化
8989
- * @param {Date | number | string} date
8990
- * @param {string} formatType 格式 'YYYY-MM-DD hh:mm:ss' 或 'YYYYMMDDhhmmss' 或 'YYYY/MM/DD hh:mm:ss' 或 'hh:mm:ss' 或 'YYYYMMDDThhmmssZ'
8991
- * @param {number} timeZone 时区偏移量 默认 0
8992
- */ DateTime.formate = function formate(date, formatType, timeZone) {
8993
- if (timeZone === void 0) timeZone = 0;
8994
- var dateTime = date;
8995
- if (typeof date === 'string') {
8996
- dateTime = DateTime.strToDate(date);
8997
- } else if (typeof date === 'number') {
8998
- dateTime = new Date(date);
8999
- }
9000
- dateTime = new Date(dateTime.getTime() - timeZone * 3600 * 1000);
9001
- var year = dateTime.getFullYear();
9002
- var month = String(dateTime.getMonth() + 1).padStart(2, '0');
9003
- var day = String(dateTime.getDate()).padStart(2, '0');
9004
- var hours = String(dateTime.getHours()).padStart(2, '0');
9005
- var minutes = String(dateTime.getMinutes()).padStart(2, '0');
9006
- var seconds = String(dateTime.getSeconds()).padStart(2, '0');
9007
- switch(formatType){
9008
- case 'YYYY-MM-DD hh:mm:ss':
9009
- return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
9010
- case 'YYYYMMDDhhmmss':
9011
- return "" + year + month + day + hours + minutes + seconds;
9012
- case 'YYYY/MM/DD hh:mm:ss':
9013
- return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
9014
- case 'YYYYMMDDThhmmssZ':
9015
- return "" + year + month + day + "T" + hours + minutes + seconds + "Z";
9016
- case 'YYYY/MM/DD':
9017
- return year + "/" + month + "/" + day;
9018
- case 'YYYYMMDD':
9019
- return "" + year + month + day;
9020
- case 'YYYY-MM-DD':
9021
- return year + "-" + month + "-" + day;
9022
- case 'YYYY':
9023
- return "" + year;
9024
- case 'MM':
9025
- return "" + month;
9026
- case 'DD':
9027
- return "" + day;
9028
- case 'hh:mm:ss':
9029
- return hours + ":" + minutes + ":" + seconds;
9030
- case 'hh':
9031
- return "" + hours;
9032
- case 'mm':
9033
- return "" + minutes;
9034
- case 'ss':
9035
- return "" + seconds;
9036
- default:
9037
- throw new Error('Unsupported format type');
9038
- }
9039
- };
9040
- /**
9041
- * @description 对比两个时间的差值
9042
- * @param {Date | string | number} date1
9043
- * @param {Date | string | number} date2
9044
- * @param {"year" | "month" | "day" | "hour" | "minute" | "second"} diffType
9045
- */ DateTime.diff = function diff(date1, date2, diffType) {
9046
- /** @type {Date} */ var dateTime1 = date1;
9047
- if (typeof date1 === 'string') {
9048
- dateTime1 = DateTime.strToDate(date1);
9049
- } else if (typeof date1 === 'number') {
9050
- dateTime1 = new Date(date1);
9051
- }
9052
- /** @type {Date} */ var dateTime2 = date2;
9053
- if (typeof date2 === 'string') {
9054
- dateTime1 = DateTime.strToDate(date2);
9055
- } else if (typeof date2 === 'number') {
9056
- dateTime1 = new Date(date2);
9057
- }
9058
- var diffSecond = dateTime1.getTime() - dateTime2.getTime();
9059
- // diff
9060
- switch(diffType){
9061
- case 'year':
9062
- return dateTime1.getFullYear() - dateTime2.getFullYear();
9063
- case 'month':
9064
- // 计算总月份差
9065
- // eslint-disable-next-line no-case-declarations
9066
- var months = (dateTime1.getFullYear() - dateTime2.getFullYear()) * 12 + (dateTime1.getMonth() - dateTime2.getMonth());
9067
- // 如果结束日的日期小于开始日的日期,则减去一个月
9068
- if (dateTime1.getDate() < dateTime2.getDate()) {
9069
- months--;
9070
- }
9071
- return months;
9072
- case 'day':
9073
- return diffSecond / 60 / 60 / 24;
9074
- case 'hour':
9075
- return diffSecond / 60 / 60;
9076
- case 'minute':
9077
- return diffSecond / 60;
9078
- case 'second':
9079
- return diffSecond;
9080
- default:
9081
- throw new Error('Unsupported diff type');
9082
- }
9083
- };
9084
- DateTime.now = function now() {
9085
- return Date.now();
9086
- };
9087
- /**
9088
- *
9089
- * @param {string} str 日期, 2025-04-10 10:10:10 或 2025/04/10 10:10:10 或 20250410101010 或 20250410T101010Z 或 秒 或 毫秒
9090
- * @example
9091
- * DateTime.strToDate("2025/04/10 10:10:10") // Date
9092
- * DateTime.strToDate("2025-04-10 10:10:10") // Date
9093
- * DateTime.strToDate("20250410101010") // Date
9094
- * DateTime.strToDate("20250410T101010Z") // Date
9095
- */ DateTime.strToDate = function strToDate(str) {
9096
- var time = (str + '').replace(/-/gi, '').replace(/:/gi, '').replace(/\//gi, '').replace(/ /gi, '').replace(/T|Z/gi, '');
9097
- // 兼容
9098
- if ((str + '').length === 10) {
9099
- // 时间戳 秒
9100
- return new Date(+str);
9101
- } else if ((str + '').length === 13) {
9102
- // 时间戳 毫秒
9103
- return new Date(+str);
9104
- }
9105
- var year = time.slice(0, 4);
9106
- var month = time.slice(4, 6);
9107
- var day = time.slice(6, 8);
9108
- var hour = time.slice(8, 10);
9109
- var minute = time.slice(10, 12);
9110
- var second = time.slice(12, 14);
9111
- return new Date(year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second);
9112
- };
9113
- /**
9114
- * @description 补充十位
9115
- * @param {number} num
9116
- * @returns {string}
9117
- * @example
9118
- * DateTime.padStart(1) // "01"
9119
- * DateTime.padStart(33) // "33"
9120
- */ DateTime.padStart = function padStart(num) {
9121
- if (num < 10) {
9122
- return '0' + num;
9123
- } else {
9124
- return num + '';
9125
- }
9126
- };
9127
- return DateTime;
9128
- }();
9129
-
9130
8625
  function _extends$5() {
9131
8626
  _extends$5 = Object.assign || function(target) {
9132
8627
  for(var i = 1; i < arguments.length; i++){
@@ -9169,20 +8664,29 @@ function _set_prototype_of$6(o, p) {
9169
8664
  function DatePickerControl(options) {
9170
8665
  var _this;
9171
8666
  var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
9172
- _this = Control.call(this, _extends$5({}, options, {
8667
+ _this = Control.call(this, _extends$5({
8668
+ maxDate: new Date()
8669
+ }, options, {
9173
8670
  tagName: 'span',
9174
8671
  controlType: 'button',
9175
8672
  classNameSuffix: 'date'
9176
8673
  })) || this;
9177
8674
  _this.options = options;
9178
- _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');
8675
+ _this._value = 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');
9179
8676
  _this._render();
8677
+ // 日期上的点
8678
+ _this.on(EVENTS.control.dateMonthChange, function(dates) {
8679
+ var _this_datePicker_updateBadges, _this_datePicker;
8680
+ (_this_datePicker = _this.datePicker) == null ? void 0 : (_this_datePicker_updateBadges = _this_datePicker.updateBadges) == null ? void 0 : _this_datePicker_updateBadges.call(_this_datePicker, dates);
8681
+ });
9180
8682
  return _this;
9181
8683
  }
9182
8684
  var _proto = DatePickerControl.prototype;
9183
8685
  _proto._render = function _render() {
9184
8686
  var _this = this;
9185
- if (isMobile()) {
8687
+ var _this_options_props;
8688
+ var isMobile1 = isMobile();
8689
+ if (isMobile1) {
9186
8690
  var _this_locale;
9187
8691
  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>";
9188
8692
  } else {
@@ -9191,25 +8695,45 @@ function _set_prototype_of$6(o, p) {
9191
8695
  title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
9192
8696
  });
9193
8697
  }
9194
- this.dataPickerUtil = new DatePickerUtil(this.$container, {
9195
- staticPath: this.options.staticPath,
9196
- language: this.options.language === 'zh' ? 'zh-CN' : 'en-US',
8698
+ this.datePicker = new DatePicker(this.$container, {
8699
+ isMobile: isMobile1,
8700
+ getPopupContainer: function() {
8701
+ return _this.$container;
8702
+ },
8703
+ mode: 'date',
8704
+ offset: [
8705
+ 0,
8706
+ -10
8707
+ ],
8708
+ badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
8709
+ language: this.options.language === 'zh' ? 'zh' : 'en',
9197
8710
  current: new Date(this._value + ' 00:00:00'),
9198
- maxDate: this.options.maxDate || new Date(),
9199
- place: isMobile() ? 'bottom-left' : 'top-right',
9200
- onChange: function(date) {
9201
- if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
9202
- _this._value = DateTime.formate(date, 'YYYY-MM-DD');
9203
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
8711
+ placement: 'tr',
8712
+ triggerClose: true,
8713
+ disabledDate: function(date) {
8714
+ return date.getTime() > (_this.options.maxDate || new Date()).getTime();
8715
+ },
8716
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8717
+ onOk: function(date, _mode) {
8718
+ if (date && _this._value !== DateTime.format(date, 'YYYY-MM-DD') && isMobile1) {
8719
+ _this._value = DateTime.format(date, 'YYYY-MM-DD');
8720
+ _this.options.onOk == null ? void 0 : _this.options.onOk.call(_this.options, date);
9204
8721
  _this.emit(EVENTS.control.dateChange, date);
9205
8722
  if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
9206
8723
  _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
9207
8724
  }
9208
8725
  }
9209
8726
  },
9210
- onPanelChange: function(open, date) {
9211
- _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, date);
9212
- _this.emit(EVENTS.control.datePanelOpenChange, open, date);
8727
+ onChange: function(date, mode) {
8728
+ if (date && _this._value !== DateTime.format(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
8729
+ _this._value = DateTime.format(date, 'YYYY-MM-DD');
8730
+ _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
8731
+ _this.emit(EVENTS.control.dateChange, date);
8732
+ }
8733
+ },
8734
+ onOpenChange: function(open) {
8735
+ _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.datePicker.current);
8736
+ _this.emit(EVENTS.control.datePanelOpenChange, open, _this.datePicker.current);
9213
8737
  }
9214
8738
  });
9215
8739
  };
@@ -9219,28 +8743,27 @@ function _set_prototype_of$6(o, p) {
9219
8743
  * @param change 是否触发 onChange 事件
9220
8744
  */ _proto.setDate = function setDate(date, change) {
9221
8745
  if (change === void 0) change = true;
9222
- var _this_dataPickerUtil;
9223
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.setDate(date, change);
9224
- if (date && !change && this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
9225
- this._value = DateTime.formate(date, 'YYYY-MM-DD');
8746
+ var _this_datePicker;
8747
+ (_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
8748
+ if (date && !change && this._value !== DateTime.format(date, 'YYYY-MM-DD')) {
8749
+ this._value = DateTime.format(date, 'YYYY-MM-DD');
9226
8750
  if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
9227
8751
  this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
9228
8752
  }
9229
8753
  }
9230
8754
  };
9231
8755
  _proto.reset = function reset() {
9232
- var _this_dataPickerUtil;
9233
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
8756
+ if (this.datePicker) this.datePicker.open = false;
9234
8757
  Control.prototype.reset.call(this);
9235
8758
  };
9236
8759
  /**
9237
8760
  * 销毁控件
9238
8761
  * @override
9239
8762
  */ _proto.destroy = function destroy() {
9240
- if (this.dataPickerUtil) {
9241
- this.dataPickerUtil.destroy();
8763
+ if (this.datePicker) {
8764
+ this.datePicker.destroy();
9242
8765
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9243
- this.dataPickerUtil = null;
8766
+ this.datePicker = null;
9244
8767
  }
9245
8768
  Control.prototype.destroy.call(this);
9246
8769
  };
@@ -9250,6 +8773,7 @@ function _set_prototype_of$6(o, p) {
9250
8773
  };
9251
8774
  /**
9252
8775
  * 点击 Control 会触发
8776
+ * @overload super._onControlClick(e: Event)
9253
8777
  */ _proto._onControlClick = function _onControlClick(e) {
9254
8778
  Control.prototype._onControlClick.call(this, e);
9255
8779
  };
@@ -10322,8 +9846,7 @@ var _renderDatePicker = function(theme, container, props) {
10322
9846
  return container;
10323
9847
  },
10324
9848
  language: theme.options.language,
10325
- locales: theme.i18n.translations,
10326
- staticPath: theme.options.staticPath
9849
+ locales: theme.i18n.translations
10327
9850
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
10328
9851
  props: props
10329
9852
  }));
@@ -10622,7 +10145,18 @@ var THEME_DEFAULT_OPTIONS = {
10622
10145
  */ _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, /**
10623
10146
  * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
10624
10147
  * @private
10625
- */ _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;
10148
+ */ _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, // /**
10149
+ // * 记录回放的月份
10150
+ // *
10151
+ // * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
10152
+ // *
10153
+ // * value: 月份列表 比如 ["2025-12-01", "2025-12-02"]
10154
+ // * @private
10155
+ // */
10156
+ // _recMonthObj: Record<string, string[]> = {};
10157
+ /**
10158
+ * 录像回放的月份列表 @private
10159
+ */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
10626
10160
  _this._initOptions(options);
10627
10161
  if (_this.options.type === 'ezopen') {
10628
10162
  var _this_urlInfo_searchParams, _this_urlInfo;
@@ -10632,7 +10166,7 @@ var THEME_DEFAULT_OPTIONS = {
10632
10166
  }
10633
10167
  if (_this.urlInfo.type === 'rec') {
10634
10168
  var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
10635
- _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');
10169
+ _this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : DateTime.toDate(DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
10636
10170
  }
10637
10171
  }
10638
10172
  _this._getRecType(_this.options.url);
@@ -10879,6 +10413,7 @@ var THEME_DEFAULT_OPTIONS = {
10879
10413
  this._themeData = null;
10880
10414
  if (this.i18n) this.i18n = null;
10881
10415
  this.recType = '';
10416
+ this.recMonth = []; // 清空数据
10882
10417
  this.emit(EVENTS.theme.destroyed);
10883
10418
  this.removeAllListeners();
10884
10419
  if (this.logger) this.logger = null;
@@ -11844,6 +11379,6 @@ var THEME_DEFAULT_OPTIONS = {
11844
11379
  zh: zh,
11845
11380
  en: en
11846
11381
  };
11847
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.1';
11382
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.10';
11848
11383
 
11849
11384
  export { Control, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume };