@ezuikit/player-theme 2.0.0-beta.6 → 2.0.1-beta.1
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 +72 -431
- package/dist/index.mjs +72 -431
- package/dist/index.umd.js +2586 -453
- package/dist/style.css +3 -2
- package/dist/style.js +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.0.
|
|
3
|
-
* Copyright (c) 2025-
|
|
2
|
+
* @ezuikit/player-theme v2.0.1-beta.1
|
|
3
|
+
* Copyright (c) 2025-12-03 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
|
/**
|
|
@@ -4648,12 +4649,12 @@ function getDefaultExportFromCjs (x) {
|
|
|
4648
4649
|
* Released under the MIT License.
|
|
4649
4650
|
*/
|
|
4650
4651
|
|
|
4651
|
-
var dist$
|
|
4652
|
-
var hasRequiredDist$
|
|
4652
|
+
var dist$1;
|
|
4653
|
+
var hasRequiredDist$1;
|
|
4653
4654
|
|
|
4654
|
-
function requireDist$
|
|
4655
|
-
if (hasRequiredDist$
|
|
4656
|
-
hasRequiredDist$
|
|
4655
|
+
function requireDist$1 () {
|
|
4656
|
+
if (hasRequiredDist$1) return dist$1;
|
|
4657
|
+
hasRequiredDist$1 = 1;
|
|
4657
4658
|
|
|
4658
4659
|
/**
|
|
4659
4660
|
* Zoom position
|
|
@@ -5360,12 +5361,12 @@ function requireDist$2 () {
|
|
|
5360
5361
|
}();
|
|
5361
5362
|
Zoom.VERSION = '0.0.2';
|
|
5362
5363
|
|
|
5363
|
-
dist$
|
|
5364
|
-
return dist$
|
|
5364
|
+
dist$1 = Zoom;
|
|
5365
|
+
return dist$1;
|
|
5365
5366
|
}
|
|
5366
5367
|
|
|
5367
|
-
var distExports$
|
|
5368
|
-
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$
|
|
5368
|
+
var distExports$1 = requireDist$1();
|
|
5369
|
+
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
|
|
5369
5370
|
|
|
5370
5371
|
function _extends$h() {
|
|
5371
5372
|
_extends$h = Object.assign || function(target) {
|
|
@@ -6440,7 +6441,7 @@ function _set_prototype_of$d(o, p) {
|
|
|
6440
6441
|
return CapturePicture;
|
|
6441
6442
|
}(Control);
|
|
6442
6443
|
|
|
6443
|
-
var dist
|
|
6444
|
+
var dist = {};
|
|
6444
6445
|
|
|
6445
6446
|
/*
|
|
6446
6447
|
* @ezuikit/control-ptz v0.0.1
|
|
@@ -6448,11 +6449,11 @@ var dist$1 = {};
|
|
|
6448
6449
|
* Released under the MIT License.
|
|
6449
6450
|
*/
|
|
6450
6451
|
|
|
6451
|
-
var hasRequiredDist
|
|
6452
|
+
var hasRequiredDist;
|
|
6452
6453
|
|
|
6453
|
-
function requireDist
|
|
6454
|
-
if (hasRequiredDist
|
|
6455
|
-
hasRequiredDist
|
|
6454
|
+
function requireDist () {
|
|
6455
|
+
if (hasRequiredDist) return dist;
|
|
6456
|
+
hasRequiredDist = 1;
|
|
6456
6457
|
|
|
6457
6458
|
var deepmerge$1 = deepmerge;
|
|
6458
6459
|
var utilsTools = require$$1;
|
|
@@ -7375,13 +7376,13 @@ function requireDist$1 () {
|
|
|
7375
7376
|
return Ptz;
|
|
7376
7377
|
}(BasePtz);
|
|
7377
7378
|
|
|
7378
|
-
dist
|
|
7379
|
-
dist
|
|
7380
|
-
dist
|
|
7381
|
-
return dist
|
|
7379
|
+
dist.BasePtz = BasePtz;
|
|
7380
|
+
dist.MobilePtz = MobilePtz;
|
|
7381
|
+
dist.Ptz = Ptz;
|
|
7382
|
+
return dist;
|
|
7382
7383
|
}
|
|
7383
7384
|
|
|
7384
|
-
var distExports
|
|
7385
|
+
var distExports = requireDist();
|
|
7385
7386
|
|
|
7386
7387
|
function _defineProperties$4(target, props) {
|
|
7387
7388
|
for(var i = 0; i < props.length; i++){
|
|
@@ -7480,7 +7481,7 @@ function _set_prototype_of$c(o, p) {
|
|
|
7480
7481
|
this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
|
|
7481
7482
|
this.$panel.appendChild(this.$turntable);
|
|
7482
7483
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7483
|
-
this._ptzControl = new distExports
|
|
7484
|
+
this._ptzControl = new distExports.Ptz(this.$turntable, _extends$b({}, this._options, {
|
|
7484
7485
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
7485
7486
|
onDirection: this._onDirection.bind(this)
|
|
7486
7487
|
}));
|
|
@@ -7489,7 +7490,7 @@ function _set_prototype_of$c(o, p) {
|
|
|
7489
7490
|
};
|
|
7490
7491
|
_proto.renderMobileExtend = function renderMobileExtend($container) {
|
|
7491
7492
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7492
|
-
if (!this._ptzControl1) this._ptzControl1 = new distExports
|
|
7493
|
+
if (!this._ptzControl1) this._ptzControl1 = new distExports.MobilePtz($container, _extends$b({}, this._options, {
|
|
7493
7494
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
7494
7495
|
onDirection: this._onDirection.bind(this)
|
|
7495
7496
|
}));
|
|
@@ -8366,6 +8367,10 @@ function _set_prototype_of$8(o, p) {
|
|
|
8366
8367
|
};
|
|
8367
8368
|
return _set_prototype_of$8(o, p);
|
|
8368
8369
|
}
|
|
8370
|
+
function _type_of(obj) {
|
|
8371
|
+
"@swc/helpers - typeof";
|
|
8372
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
8373
|
+
}
|
|
8369
8374
|
var DEFINITION_LEVELS_LOCALE = [
|
|
8370
8375
|
'VIDEO_LEVEL_FLUENT',
|
|
8371
8376
|
'VIDEO_LEVEL_STANDARD',
|
|
@@ -8459,7 +8464,7 @@ function __filter(list, locale) {
|
|
|
8459
8464
|
Select.prototype.updateOptions.call(_assert_this_initialized$1(_this), __filter(list, _this.locale));
|
|
8460
8465
|
});
|
|
8461
8466
|
_this.on(EVENTS.currentVideoLevel, function(item, realLevel) {
|
|
8462
|
-
var l = typeof item === 'object' ? item.level : item;
|
|
8467
|
+
var l = (typeof item === "undefined" ? "undefined" : _type_of(item)) === 'object' ? item.level : item;
|
|
8463
8468
|
_this._level = realLevel + '';
|
|
8464
8469
|
if (l === 'auto') {
|
|
8465
8470
|
var _options_locales_options_language;
|
|
@@ -8588,394 +8593,6 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8588
8593
|
return Speed;
|
|
8589
8594
|
}(Select);
|
|
8590
8595
|
|
|
8591
|
-
/*
|
|
8592
|
-
* @ezuikit/control-date-picker v0.0.1-alpha.2
|
|
8593
|
-
* Copyright (c) 2025-11-12 Ezviz-OpenBiz
|
|
8594
|
-
* Released under the MIT License.
|
|
8595
|
-
*/
|
|
8596
|
-
|
|
8597
|
-
var dist;
|
|
8598
|
-
var hasRequiredDist;
|
|
8599
|
-
|
|
8600
|
-
function requireDist () {
|
|
8601
|
-
if (hasRequiredDist) return dist;
|
|
8602
|
-
hasRequiredDist = 1;
|
|
8603
|
-
|
|
8604
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8605
|
-
try {
|
|
8606
|
-
var info = gen[key](arg);
|
|
8607
|
-
var value = info.value;
|
|
8608
|
-
} catch (error) {
|
|
8609
|
-
reject(error);
|
|
8610
|
-
return;
|
|
8611
|
-
}
|
|
8612
|
-
if (info.done) {
|
|
8613
|
-
resolve(value);
|
|
8614
|
-
} else {
|
|
8615
|
-
Promise.resolve(value).then(_next, _throw);
|
|
8616
|
-
}
|
|
8617
|
-
}
|
|
8618
|
-
function _async_to_generator(fn) {
|
|
8619
|
-
return function() {
|
|
8620
|
-
var self = this, args = arguments;
|
|
8621
|
-
return new Promise(function(resolve, reject) {
|
|
8622
|
-
var gen = fn.apply(self, args);
|
|
8623
|
-
function _next(value) {
|
|
8624
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
8625
|
-
}
|
|
8626
|
-
function _throw(err) {
|
|
8627
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8628
|
-
}
|
|
8629
|
-
_next(undefined);
|
|
8630
|
-
});
|
|
8631
|
-
};
|
|
8632
|
-
}
|
|
8633
|
-
function _ts_generator(thisArg, body) {
|
|
8634
|
-
var f, y, t, _ = {
|
|
8635
|
-
label: 0,
|
|
8636
|
-
sent: function() {
|
|
8637
|
-
if (t[0] & 1) throw t[1];
|
|
8638
|
-
return t[1];
|
|
8639
|
-
},
|
|
8640
|
-
trys: [],
|
|
8641
|
-
ops: []
|
|
8642
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
8643
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
8644
|
-
return this;
|
|
8645
|
-
}), g;
|
|
8646
|
-
function verb(n) {
|
|
8647
|
-
return function(v) {
|
|
8648
|
-
return step([
|
|
8649
|
-
n,
|
|
8650
|
-
v
|
|
8651
|
-
]);
|
|
8652
|
-
};
|
|
8653
|
-
}
|
|
8654
|
-
function step(op) {
|
|
8655
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8656
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
8657
|
-
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;
|
|
8658
|
-
if (y = 0, t) op = [
|
|
8659
|
-
op[0] & 2,
|
|
8660
|
-
t.value
|
|
8661
|
-
];
|
|
8662
|
-
switch(op[0]){
|
|
8663
|
-
case 0:
|
|
8664
|
-
case 1:
|
|
8665
|
-
t = op;
|
|
8666
|
-
break;
|
|
8667
|
-
case 4:
|
|
8668
|
-
_.label++;
|
|
8669
|
-
return {
|
|
8670
|
-
value: op[1],
|
|
8671
|
-
done: false
|
|
8672
|
-
};
|
|
8673
|
-
case 5:
|
|
8674
|
-
_.label++;
|
|
8675
|
-
y = op[1];
|
|
8676
|
-
op = [
|
|
8677
|
-
0
|
|
8678
|
-
];
|
|
8679
|
-
continue;
|
|
8680
|
-
case 7:
|
|
8681
|
-
op = _.ops.pop();
|
|
8682
|
-
_.trys.pop();
|
|
8683
|
-
continue;
|
|
8684
|
-
default:
|
|
8685
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
8686
|
-
_ = 0;
|
|
8687
|
-
continue;
|
|
8688
|
-
}
|
|
8689
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
8690
|
-
_.label = op[1];
|
|
8691
|
-
break;
|
|
8692
|
-
}
|
|
8693
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
8694
|
-
_.label = t[1];
|
|
8695
|
-
t = op;
|
|
8696
|
-
break;
|
|
8697
|
-
}
|
|
8698
|
-
if (t && _.label < t[2]) {
|
|
8699
|
-
_.label = t[2];
|
|
8700
|
-
_.ops.push(op);
|
|
8701
|
-
break;
|
|
8702
|
-
}
|
|
8703
|
-
if (t[2]) _.ops.pop();
|
|
8704
|
-
_.trys.pop();
|
|
8705
|
-
continue;
|
|
8706
|
-
}
|
|
8707
|
-
op = body.call(thisArg, _);
|
|
8708
|
-
} catch (e) {
|
|
8709
|
-
op = [
|
|
8710
|
-
6,
|
|
8711
|
-
e
|
|
8712
|
-
];
|
|
8713
|
-
y = 0;
|
|
8714
|
-
} finally{
|
|
8715
|
-
f = t = 0;
|
|
8716
|
-
}
|
|
8717
|
-
if (op[0] & 5) throw op[1];
|
|
8718
|
-
return {
|
|
8719
|
-
value: op[0] ? op[1] : void 0,
|
|
8720
|
-
done: true
|
|
8721
|
-
};
|
|
8722
|
-
}
|
|
8723
|
-
}
|
|
8724
|
-
var AppendJS = /*#__PURE__*/ function() {
|
|
8725
|
-
function AppendJS() {}
|
|
8726
|
-
AppendJS.loadScript = function loadScript(src) {
|
|
8727
|
-
return _async_to_generator(function() {
|
|
8728
|
-
return _ts_generator(this, function(_state) {
|
|
8729
|
-
switch(_state.label){
|
|
8730
|
-
case 0:
|
|
8731
|
-
return [
|
|
8732
|
-
4,
|
|
8733
|
-
new Promise(function(resolve, reject) {
|
|
8734
|
-
if (AppendJS.LoadedScr.includes(src)) {
|
|
8735
|
-
return resolve(src);
|
|
8736
|
-
}
|
|
8737
|
-
if (AppendJS.LoadingScrQueue[src]) {
|
|
8738
|
-
return AppendJS.LoadingScrQueue[src].push(resolve);
|
|
8739
|
-
} else {
|
|
8740
|
-
AppendJS.LoadingScrQueue[src] = [
|
|
8741
|
-
resolve
|
|
8742
|
-
];
|
|
8743
|
-
}
|
|
8744
|
-
var link;
|
|
8745
|
-
if (src.includes('.js')) {
|
|
8746
|
-
link = document.createElement('script');
|
|
8747
|
-
link.src = src;
|
|
8748
|
-
link.async = true;
|
|
8749
|
-
} else if (src.includes('.css')) {
|
|
8750
|
-
link = document.createElement('link');
|
|
8751
|
-
link.rel = 'stylesheet';
|
|
8752
|
-
link.href = src;
|
|
8753
|
-
}
|
|
8754
|
-
link.onload = function() {
|
|
8755
|
-
AppendJS.LoadedScr.push(src);
|
|
8756
|
-
AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
|
|
8757
|
-
return resolve(src);
|
|
8758
|
-
});
|
|
8759
|
-
AppendJS.LoadingScrQueue[src] = [];
|
|
8760
|
-
};
|
|
8761
|
-
link.onerror = function() {
|
|
8762
|
-
return reject(new Error('Failed to load ' + src));
|
|
8763
|
-
};
|
|
8764
|
-
document.head.appendChild(link);
|
|
8765
|
-
})
|
|
8766
|
-
];
|
|
8767
|
-
case 1:
|
|
8768
|
-
return [
|
|
8769
|
-
2,
|
|
8770
|
-
_state.sent()
|
|
8771
|
-
];
|
|
8772
|
-
}
|
|
8773
|
-
});
|
|
8774
|
-
})();
|
|
8775
|
-
};
|
|
8776
|
-
AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
|
|
8777
|
-
return _async_to_generator(function() {
|
|
8778
|
-
return _ts_generator(this, function(_state) {
|
|
8779
|
-
switch(_state.label){
|
|
8780
|
-
case 0:
|
|
8781
|
-
return [
|
|
8782
|
-
4,
|
|
8783
|
-
Promise.all(srcArr.map(AppendJS.loadScript))
|
|
8784
|
-
];
|
|
8785
|
-
case 1:
|
|
8786
|
-
return [
|
|
8787
|
-
2,
|
|
8788
|
-
_state.sent()
|
|
8789
|
-
];
|
|
8790
|
-
}
|
|
8791
|
-
});
|
|
8792
|
-
})();
|
|
8793
|
-
};
|
|
8794
|
-
AppendJS.remove = function remove(src) {
|
|
8795
|
-
src.forEach(function(item) {
|
|
8796
|
-
var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
|
|
8797
|
-
if (link) {
|
|
8798
|
-
link.remove();
|
|
8799
|
-
}
|
|
8800
|
-
});
|
|
8801
|
-
};
|
|
8802
|
-
AppendJS.clear = function clear() {
|
|
8803
|
-
AppendJS.remove(AppendJS.LoadedScr);
|
|
8804
|
-
};
|
|
8805
|
-
return AppendJS;
|
|
8806
|
-
}();
|
|
8807
|
-
/** 已经加载完的js/css */ AppendJS.LoadedScr = [];
|
|
8808
|
-
/** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
|
|
8809
|
-
|
|
8810
|
-
function _defineProperties(target, props) {
|
|
8811
|
-
for(var i = 0; i < props.length; i++){
|
|
8812
|
-
var descriptor = props[i];
|
|
8813
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
8814
|
-
descriptor.configurable = true;
|
|
8815
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
8816
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
8817
|
-
}
|
|
8818
|
-
}
|
|
8819
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
8820
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
8821
|
-
return Constructor;
|
|
8822
|
-
}
|
|
8823
|
-
var DEFAULT_OPTIONS = {
|
|
8824
|
-
staticPath: '.',
|
|
8825
|
-
place: 'top-right',
|
|
8826
|
-
language: 'zh-CN',
|
|
8827
|
-
current: new Date(),
|
|
8828
|
-
maxDate: new Date()
|
|
8829
|
-
};
|
|
8830
|
-
/**
|
|
8831
|
-
* 日期选择器
|
|
8832
|
-
*/ var DatePicker = /*#__PURE__*/ function() {
|
|
8833
|
-
function DatePicker(container, options) {
|
|
8834
|
-
var _this = this;
|
|
8835
|
-
this._open = false;
|
|
8836
|
-
this._change = true;
|
|
8837
|
-
this.$container = container;
|
|
8838
|
-
this.options = Object.assign({}, DEFAULT_OPTIONS, options);
|
|
8839
|
-
this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
|
|
8840
|
-
if (this.options.current) {
|
|
8841
|
-
this._date = this.options.current;
|
|
8842
|
-
}
|
|
8843
|
-
this._init();
|
|
8844
|
-
this.$container.addEventListener('click', function() {
|
|
8845
|
-
if (_this._open) _this.hide();
|
|
8846
|
-
else _this.show();
|
|
8847
|
-
});
|
|
8848
|
-
document.body.addEventListener('click', function(e) {
|
|
8849
|
-
if (!_this.$container.contains(e.target)) {
|
|
8850
|
-
_this.hide();
|
|
8851
|
-
}
|
|
8852
|
-
});
|
|
8853
|
-
}
|
|
8854
|
-
var _proto = DatePicker.prototype;
|
|
8855
|
-
_proto._init = function _init() {
|
|
8856
|
-
var _this = this;
|
|
8857
|
-
// 因为挂载在行内,需要父标签设置 position: relative;
|
|
8858
|
-
this.$container.style.cssText += ";position: relative;";
|
|
8859
|
-
this.$container.classList.add("datepicker-inline-" + this.options.place);
|
|
8860
|
-
AppendJS.loadScriptsBatch([
|
|
8861
|
-
"" + this.options.staticPath + "/rec/jquery.min.js",
|
|
8862
|
-
"" + this.options.staticPath + "/rec/datepicker.min.css"
|
|
8863
|
-
]).then(function() {
|
|
8864
|
-
AppendJS.loadScriptsBatch([
|
|
8865
|
-
"" + _this.options.staticPath + "/rec/datepicker.js"
|
|
8866
|
-
]).then(function() {
|
|
8867
|
-
AppendJS.loadScriptsBatch([
|
|
8868
|
-
"" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
|
|
8869
|
-
"" + _this.options.staticPath + "/rec/datepicker.en-US.js"
|
|
8870
|
-
]).then(function() {
|
|
8871
|
-
window.$(_this.$container).datepicker({
|
|
8872
|
-
date: _this.options.current,
|
|
8873
|
-
language: _this.options.language,
|
|
8874
|
-
endDate: _this.options.maxDate,
|
|
8875
|
-
inline: true
|
|
8876
|
-
});
|
|
8877
|
-
_this.hide();
|
|
8878
|
-
window.$(_this.$container).on('pick.datepicker', function(e) {
|
|
8879
|
-
var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
|
|
8880
|
-
if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
|
|
8881
|
-
_this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
|
|
8882
|
-
} 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())) {
|
|
8883
|
-
_this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
|
|
8884
|
-
} else if ([
|
|
8885
|
-
'day',
|
|
8886
|
-
'pick'
|
|
8887
|
-
].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())) {
|
|
8888
|
-
if (_this._change) {
|
|
8889
|
-
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
|
|
8890
|
-
}
|
|
8891
|
-
_this._date = new Date(e.date.getTime());
|
|
8892
|
-
}
|
|
8893
|
-
if (e.view === 'day') _this.hide();
|
|
8894
|
-
_this._change = true;
|
|
8895
|
-
});
|
|
8896
|
-
});
|
|
8897
|
-
});
|
|
8898
|
-
});
|
|
8899
|
-
};
|
|
8900
|
-
/**
|
|
8901
|
-
* 设置日期, change = true 时触发 onChange 事件
|
|
8902
|
-
*
|
|
8903
|
-
* @param date 设置的日期
|
|
8904
|
-
* @param change 是否触发 onChange 事件
|
|
8905
|
-
*/ _proto.setDate = function setDate(date, change) {
|
|
8906
|
-
if (change === void 0) change = true;
|
|
8907
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8908
|
-
if ($datepicker) {
|
|
8909
|
-
this._change = change;
|
|
8910
|
-
window.$(this.$container).datepicker('setDate', date);
|
|
8911
|
-
}
|
|
8912
|
-
};
|
|
8913
|
-
/**
|
|
8914
|
-
* 隐藏面板, 会触发 onPanelChange 事件
|
|
8915
|
-
*/ _proto.hide = function hide() {
|
|
8916
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8917
|
-
if ($datepicker) {
|
|
8918
|
-
if (this._open) {
|
|
8919
|
-
this._open = false;
|
|
8920
|
-
this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
|
|
8921
|
-
}
|
|
8922
|
-
$datepicker.classList.add('datepicker-hide');
|
|
8923
|
-
}
|
|
8924
|
-
};
|
|
8925
|
-
/**
|
|
8926
|
-
* 显示面板, 会触发 onPanelChange 事件
|
|
8927
|
-
*/ _proto.show = function show() {
|
|
8928
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8929
|
-
if ($datepicker) {
|
|
8930
|
-
var _window_$_datepicker, _window_$;
|
|
8931
|
-
if (!this._open) {
|
|
8932
|
-
this._open = true;
|
|
8933
|
-
this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
|
|
8934
|
-
}
|
|
8935
|
-
if (this._date) this.setDate(this._date, false);
|
|
8936
|
-
(_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
|
|
8937
|
-
if (this.options.place === 'bottom-left') {
|
|
8938
|
-
$datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
|
|
8939
|
-
} else {
|
|
8940
|
-
$datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
|
|
8941
|
-
}
|
|
8942
|
-
$datepicker.classList.remove('datepicker-hide');
|
|
8943
|
-
}
|
|
8944
|
-
};
|
|
8945
|
-
/**
|
|
8946
|
-
* 销毁
|
|
8947
|
-
*/ _proto.destroy = function destroy() {
|
|
8948
|
-
this.hide();
|
|
8949
|
-
this._date = undefined;
|
|
8950
|
-
window.$(this.$container).datepicker('destroy');
|
|
8951
|
-
// AppendJS.remove([
|
|
8952
|
-
// `${this.options.staticPath}/rec/jquery.min.js`,
|
|
8953
|
-
// `${this.options.staticPath}/rec/datepicker.min.css`,
|
|
8954
|
-
// `${this.options.staticPath}/rec/datepicker.js`,
|
|
8955
|
-
// `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
|
|
8956
|
-
// `${this.options.staticPath}/rec/datepicker.en-US.js`,
|
|
8957
|
-
// ]);
|
|
8958
|
-
};
|
|
8959
|
-
_create_class(DatePicker, [
|
|
8960
|
-
{
|
|
8961
|
-
key: "date",
|
|
8962
|
-
get: /**
|
|
8963
|
-
* 获取日期
|
|
8964
|
-
*/ function get() {
|
|
8965
|
-
return this._date;
|
|
8966
|
-
}
|
|
8967
|
-
}
|
|
8968
|
-
]);
|
|
8969
|
-
return DatePicker;
|
|
8970
|
-
}();
|
|
8971
|
-
|
|
8972
|
-
dist = DatePicker;
|
|
8973
|
-
return dist;
|
|
8974
|
-
}
|
|
8975
|
-
|
|
8976
|
-
var distExports = requireDist();
|
|
8977
|
-
var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
8978
|
-
|
|
8979
8596
|
/**
|
|
8980
8597
|
* @description 时间操作
|
|
8981
8598
|
*/ var DateTime = /*#__PURE__*/ function() {
|
|
@@ -9165,7 +8782,9 @@ function _set_prototype_of$6(o, p) {
|
|
|
9165
8782
|
function DatePickerControl(options) {
|
|
9166
8783
|
var _this;
|
|
9167
8784
|
var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
|
|
9168
|
-
_this = Control.call(this, _extends$5({
|
|
8785
|
+
_this = Control.call(this, _extends$5({
|
|
8786
|
+
maxDate: new Date()
|
|
8787
|
+
}, options, {
|
|
9169
8788
|
tagName: 'span',
|
|
9170
8789
|
controlType: 'button',
|
|
9171
8790
|
classNameSuffix: 'date'
|
|
@@ -9178,7 +8797,8 @@ function _set_prototype_of$6(o, p) {
|
|
|
9178
8797
|
var _proto = DatePickerControl.prototype;
|
|
9179
8798
|
_proto._render = function _render() {
|
|
9180
8799
|
var _this = this;
|
|
9181
|
-
|
|
8800
|
+
var isMobile1 = require$$1.isMobile();
|
|
8801
|
+
if (isMobile1) {
|
|
9182
8802
|
var _this_locale;
|
|
9183
8803
|
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>";
|
|
9184
8804
|
} else {
|
|
@@ -9187,14 +8807,35 @@ function _set_prototype_of$6(o, p) {
|
|
|
9187
8807
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
|
|
9188
8808
|
});
|
|
9189
8809
|
}
|
|
9190
|
-
this.
|
|
9191
|
-
|
|
9192
|
-
|
|
8810
|
+
this.dataPicker = new controlDatePicker.DatePicker(this.$container, {
|
|
8811
|
+
isMobile: isMobile1,
|
|
8812
|
+
getPopupContainer: function() {
|
|
8813
|
+
return _this.$container;
|
|
8814
|
+
},
|
|
8815
|
+
mode: 'date',
|
|
8816
|
+
offset: [
|
|
8817
|
+
0,
|
|
8818
|
+
-10
|
|
8819
|
+
],
|
|
8820
|
+
badges: this.options.badges || [],
|
|
8821
|
+
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
9193
8822
|
current: new Date(this._value + ' 00:00:00'),
|
|
9194
|
-
|
|
9195
|
-
|
|
8823
|
+
disabledDate: function(date) {
|
|
8824
|
+
return date.getTime() > (_this.options.maxDate || new Date()).getTime();
|
|
8825
|
+
},
|
|
8826
|
+
placement: 'tr',
|
|
8827
|
+
onOk: function(date, mode) {
|
|
8828
|
+
if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD') && isMobile1) {
|
|
8829
|
+
_this._value = DateTime.formate(date, 'YYYY-MM-DD');
|
|
8830
|
+
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
|
|
8831
|
+
_this.emit(EVENTS.control.dateChange, date);
|
|
8832
|
+
if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
8833
|
+
_this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
|
|
8834
|
+
}
|
|
8835
|
+
}
|
|
8836
|
+
},
|
|
9196
8837
|
onChange: function(date) {
|
|
9197
|
-
if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
|
|
8838
|
+
if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD') && !isMobile1) {
|
|
9198
8839
|
_this._value = DateTime.formate(date, 'YYYY-MM-DD');
|
|
9199
8840
|
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
|
|
9200
8841
|
_this.emit(EVENTS.control.dateChange, date);
|
|
@@ -9203,9 +8844,9 @@ function _set_prototype_of$6(o, p) {
|
|
|
9203
8844
|
}
|
|
9204
8845
|
}
|
|
9205
8846
|
},
|
|
9206
|
-
|
|
9207
|
-
_this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open,
|
|
9208
|
-
_this.emit(EVENTS.control.datePanelOpenChange, open,
|
|
8847
|
+
onOpenChange: function(open) {
|
|
8848
|
+
_this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.dataPicker.current);
|
|
8849
|
+
_this.emit(EVENTS.control.datePanelOpenChange, open, _this.dataPicker.current);
|
|
9209
8850
|
}
|
|
9210
8851
|
});
|
|
9211
8852
|
};
|
|
@@ -9215,8 +8856,8 @@ function _set_prototype_of$6(o, p) {
|
|
|
9215
8856
|
* @param change 是否触发 onChange 事件
|
|
9216
8857
|
*/ _proto.setDate = function setDate(date, change) {
|
|
9217
8858
|
if (change === void 0) change = true;
|
|
9218
|
-
var
|
|
9219
|
-
(
|
|
8859
|
+
var _this_dataPicker;
|
|
8860
|
+
(_this_dataPicker = this.dataPicker) == null ? void 0 : _this_dataPicker.setCurrent(date, change);
|
|
9220
8861
|
if (date && !change && this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
|
|
9221
8862
|
this._value = DateTime.formate(date, 'YYYY-MM-DD');
|
|
9222
8863
|
if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
@@ -9225,18 +8866,17 @@ function _set_prototype_of$6(o, p) {
|
|
|
9225
8866
|
}
|
|
9226
8867
|
};
|
|
9227
8868
|
_proto.reset = function reset() {
|
|
9228
|
-
|
|
9229
|
-
(_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
|
|
8869
|
+
if (this.dataPicker) this.dataPicker.open = false;
|
|
9230
8870
|
Control.prototype.reset.call(this);
|
|
9231
8871
|
};
|
|
9232
8872
|
/**
|
|
9233
8873
|
* 销毁控件
|
|
9234
8874
|
* @override
|
|
9235
8875
|
*/ _proto.destroy = function destroy() {
|
|
9236
|
-
if (this.
|
|
9237
|
-
this.
|
|
8876
|
+
if (this.dataPicker) {
|
|
8877
|
+
this.dataPicker.destroy();
|
|
9238
8878
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9239
|
-
this.
|
|
8879
|
+
this.dataPicker = null;
|
|
9240
8880
|
}
|
|
9241
8881
|
Control.prototype.destroy.call(this);
|
|
9242
8882
|
};
|
|
@@ -9246,6 +8886,7 @@ function _set_prototype_of$6(o, p) {
|
|
|
9246
8886
|
};
|
|
9247
8887
|
/**
|
|
9248
8888
|
* 点击 Control 会触发
|
|
8889
|
+
* @overload super._onControlClick(e: Event)
|
|
9249
8890
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9250
8891
|
Control.prototype._onControlClick.call(this, e);
|
|
9251
8892
|
};
|
|
@@ -11840,7 +11481,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11840
11481
|
zh: zh,
|
|
11841
11482
|
en: en
|
|
11842
11483
|
};
|
|
11843
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.
|
|
11484
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.1-beta.1';
|
|
11844
11485
|
|
|
11845
11486
|
exports.Control = Control;
|
|
11846
11487
|
exports.Fullscreen = Fullscreen;
|