@tarojs/components 3.7.0-alpha.20 → 3.7.0-alpha.23
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/cjs/taro-picker-core_2.cjs.entry.js +31 -30
- package/dist/collection/components/picker/picker.js +31 -30
- package/dist/components/taro-picker-core.js +31 -30
- package/dist/esm/taro-picker-core_2.entry.js +31 -30
- package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
- package/dist/taro-components/{p-c39a46ca.system.entry.js → p-0cedad18.system.entry.js} +1 -1
- package/dist/taro-components/p-99e16df8.entry.js +1 -0
- package/dist/taro-components/p-ed331c06.system.js +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/package.json +4 -4
- package/types/Video.d.ts +10 -2
- package/dist/taro-components/p-6cde180b.entry.js +0 -1
|
@@ -413,40 +413,41 @@ const Picker = class {
|
|
|
413
413
|
}
|
|
414
414
|
else if (mode === 'date') {
|
|
415
415
|
const value = this.value;
|
|
416
|
-
|
|
416
|
+
let _value = verifyDate(value) || new Date(new Date().setHours(0, 0, 0, 0)); // 没传值或值的合法性错误默认今天时间
|
|
417
417
|
const _start = verifyDate(start) || new Date('1970/01/01');
|
|
418
418
|
const _end = verifyDate(end) || new Date('2999/01/01');
|
|
419
419
|
// 时间区间有效性
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
const monthRange = getMonthRange(_start, _end, currentYear);
|
|
426
|
-
const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
|
|
427
|
-
this.index = [
|
|
428
|
-
yearRange.indexOf(currentYear),
|
|
429
|
-
monthRange.indexOf(currentMonth),
|
|
430
|
-
dayRange.indexOf(currentDay)
|
|
431
|
-
];
|
|
432
|
-
if (!this.pickerDate ||
|
|
433
|
-
this.pickerDate._value.getTime() !== _value.getTime() ||
|
|
434
|
-
this.pickerDate._start.getTime() !== _start.getTime() ||
|
|
435
|
-
this.pickerDate._end.getTime() !== _end.getTime()) {
|
|
436
|
-
this.pickerDate = {
|
|
437
|
-
_value,
|
|
438
|
-
_start,
|
|
439
|
-
_end,
|
|
440
|
-
_updateValue: [
|
|
441
|
-
currentYear,
|
|
442
|
-
currentMonth,
|
|
443
|
-
currentDay
|
|
444
|
-
]
|
|
445
|
-
};
|
|
446
|
-
}
|
|
420
|
+
if (!(_start <= _end)) {
|
|
421
|
+
throw new Error(`Picker start time must be less than end time.`);
|
|
422
|
+
}
|
|
423
|
+
if (!(_value >= _start && _value <= _end)) {
|
|
424
|
+
_value = _start;
|
|
447
425
|
}
|
|
448
|
-
|
|
449
|
-
|
|
426
|
+
const currentYear = _value.getFullYear();
|
|
427
|
+
const currentMonth = _value.getMonth() + 1;
|
|
428
|
+
const currentDay = _value.getDate();
|
|
429
|
+
const yearRange = getYearRange(_start.getFullYear(), _end.getFullYear());
|
|
430
|
+
const monthRange = getMonthRange(_start, _end, currentYear);
|
|
431
|
+
const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
|
|
432
|
+
this.index = [
|
|
433
|
+
yearRange.indexOf(currentYear),
|
|
434
|
+
monthRange.indexOf(currentMonth),
|
|
435
|
+
dayRange.indexOf(currentDay)
|
|
436
|
+
];
|
|
437
|
+
if (!this.pickerDate ||
|
|
438
|
+
this.pickerDate._value.getTime() !== _value.getTime() ||
|
|
439
|
+
this.pickerDate._start.getTime() !== _start.getTime() ||
|
|
440
|
+
this.pickerDate._end.getTime() !== _end.getTime()) {
|
|
441
|
+
this.pickerDate = {
|
|
442
|
+
_value,
|
|
443
|
+
_start,
|
|
444
|
+
_end,
|
|
445
|
+
_updateValue: [
|
|
446
|
+
currentYear,
|
|
447
|
+
currentMonth,
|
|
448
|
+
currentDay
|
|
449
|
+
]
|
|
450
|
+
};
|
|
450
451
|
}
|
|
451
452
|
}
|
|
452
453
|
else {
|
|
@@ -257,40 +257,41 @@ export class Picker {
|
|
|
257
257
|
}
|
|
258
258
|
else if (mode === 'date') {
|
|
259
259
|
const value = this.value;
|
|
260
|
-
|
|
260
|
+
let _value = verifyDate(value) || new Date(new Date().setHours(0, 0, 0, 0)); // 没传值或值的合法性错误默认今天时间
|
|
261
261
|
const _start = verifyDate(start) || new Date('1970/01/01');
|
|
262
262
|
const _end = verifyDate(end) || new Date('2999/01/01');
|
|
263
263
|
// 时间区间有效性
|
|
264
|
-
if (
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const monthRange = getMonthRange(_start, _end, currentYear);
|
|
270
|
-
const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
|
|
271
|
-
this.index = [
|
|
272
|
-
yearRange.indexOf(currentYear),
|
|
273
|
-
monthRange.indexOf(currentMonth),
|
|
274
|
-
dayRange.indexOf(currentDay)
|
|
275
|
-
];
|
|
276
|
-
if (!this.pickerDate ||
|
|
277
|
-
this.pickerDate._value.getTime() !== _value.getTime() ||
|
|
278
|
-
this.pickerDate._start.getTime() !== _start.getTime() ||
|
|
279
|
-
this.pickerDate._end.getTime() !== _end.getTime()) {
|
|
280
|
-
this.pickerDate = {
|
|
281
|
-
_value,
|
|
282
|
-
_start,
|
|
283
|
-
_end,
|
|
284
|
-
_updateValue: [
|
|
285
|
-
currentYear,
|
|
286
|
-
currentMonth,
|
|
287
|
-
currentDay
|
|
288
|
-
]
|
|
289
|
-
};
|
|
290
|
-
}
|
|
264
|
+
if (!(_start <= _end)) {
|
|
265
|
+
throw new Error(`Picker start time must be less than end time.`);
|
|
266
|
+
}
|
|
267
|
+
if (!(_value >= _start && _value <= _end)) {
|
|
268
|
+
_value = _start;
|
|
291
269
|
}
|
|
292
|
-
|
|
293
|
-
|
|
270
|
+
const currentYear = _value.getFullYear();
|
|
271
|
+
const currentMonth = _value.getMonth() + 1;
|
|
272
|
+
const currentDay = _value.getDate();
|
|
273
|
+
const yearRange = getYearRange(_start.getFullYear(), _end.getFullYear());
|
|
274
|
+
const monthRange = getMonthRange(_start, _end, currentYear);
|
|
275
|
+
const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
|
|
276
|
+
this.index = [
|
|
277
|
+
yearRange.indexOf(currentYear),
|
|
278
|
+
monthRange.indexOf(currentMonth),
|
|
279
|
+
dayRange.indexOf(currentDay)
|
|
280
|
+
];
|
|
281
|
+
if (!this.pickerDate ||
|
|
282
|
+
this.pickerDate._value.getTime() !== _value.getTime() ||
|
|
283
|
+
this.pickerDate._start.getTime() !== _start.getTime() ||
|
|
284
|
+
this.pickerDate._end.getTime() !== _end.getTime()) {
|
|
285
|
+
this.pickerDate = {
|
|
286
|
+
_value,
|
|
287
|
+
_start,
|
|
288
|
+
_end,
|
|
289
|
+
_updateValue: [
|
|
290
|
+
currentYear,
|
|
291
|
+
currentMonth,
|
|
292
|
+
currentDay
|
|
293
|
+
]
|
|
294
|
+
};
|
|
294
295
|
}
|
|
295
296
|
}
|
|
296
297
|
else {
|
|
@@ -407,40 +407,41 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
407
407
|
}
|
|
408
408
|
else if (mode === 'date') {
|
|
409
409
|
const value = this.value;
|
|
410
|
-
|
|
410
|
+
let _value = verifyDate(value) || new Date(new Date().setHours(0, 0, 0, 0)); // 没传值或值的合法性错误默认今天时间
|
|
411
411
|
const _start = verifyDate(start) || new Date('1970/01/01');
|
|
412
412
|
const _end = verifyDate(end) || new Date('2999/01/01');
|
|
413
413
|
// 时间区间有效性
|
|
414
|
-
if (
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const monthRange = getMonthRange(_start, _end, currentYear);
|
|
420
|
-
const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
|
|
421
|
-
this.index = [
|
|
422
|
-
yearRange.indexOf(currentYear),
|
|
423
|
-
monthRange.indexOf(currentMonth),
|
|
424
|
-
dayRange.indexOf(currentDay)
|
|
425
|
-
];
|
|
426
|
-
if (!this.pickerDate ||
|
|
427
|
-
this.pickerDate._value.getTime() !== _value.getTime() ||
|
|
428
|
-
this.pickerDate._start.getTime() !== _start.getTime() ||
|
|
429
|
-
this.pickerDate._end.getTime() !== _end.getTime()) {
|
|
430
|
-
this.pickerDate = {
|
|
431
|
-
_value,
|
|
432
|
-
_start,
|
|
433
|
-
_end,
|
|
434
|
-
_updateValue: [
|
|
435
|
-
currentYear,
|
|
436
|
-
currentMonth,
|
|
437
|
-
currentDay
|
|
438
|
-
]
|
|
439
|
-
};
|
|
440
|
-
}
|
|
414
|
+
if (!(_start <= _end)) {
|
|
415
|
+
throw new Error(`Picker start time must be less than end time.`);
|
|
416
|
+
}
|
|
417
|
+
if (!(_value >= _start && _value <= _end)) {
|
|
418
|
+
_value = _start;
|
|
441
419
|
}
|
|
442
|
-
|
|
443
|
-
|
|
420
|
+
const currentYear = _value.getFullYear();
|
|
421
|
+
const currentMonth = _value.getMonth() + 1;
|
|
422
|
+
const currentDay = _value.getDate();
|
|
423
|
+
const yearRange = getYearRange(_start.getFullYear(), _end.getFullYear());
|
|
424
|
+
const monthRange = getMonthRange(_start, _end, currentYear);
|
|
425
|
+
const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
|
|
426
|
+
this.index = [
|
|
427
|
+
yearRange.indexOf(currentYear),
|
|
428
|
+
monthRange.indexOf(currentMonth),
|
|
429
|
+
dayRange.indexOf(currentDay)
|
|
430
|
+
];
|
|
431
|
+
if (!this.pickerDate ||
|
|
432
|
+
this.pickerDate._value.getTime() !== _value.getTime() ||
|
|
433
|
+
this.pickerDate._start.getTime() !== _start.getTime() ||
|
|
434
|
+
this.pickerDate._end.getTime() !== _end.getTime()) {
|
|
435
|
+
this.pickerDate = {
|
|
436
|
+
_value,
|
|
437
|
+
_start,
|
|
438
|
+
_end,
|
|
439
|
+
_updateValue: [
|
|
440
|
+
currentYear,
|
|
441
|
+
currentMonth,
|
|
442
|
+
currentDay
|
|
443
|
+
]
|
|
444
|
+
};
|
|
444
445
|
}
|
|
445
446
|
}
|
|
446
447
|
else {
|
|
@@ -409,40 +409,41 @@ const Picker = class {
|
|
|
409
409
|
}
|
|
410
410
|
else if (mode === 'date') {
|
|
411
411
|
const value = this.value;
|
|
412
|
-
|
|
412
|
+
let _value = verifyDate(value) || new Date(new Date().setHours(0, 0, 0, 0)); // 没传值或值的合法性错误默认今天时间
|
|
413
413
|
const _start = verifyDate(start) || new Date('1970/01/01');
|
|
414
414
|
const _end = verifyDate(end) || new Date('2999/01/01');
|
|
415
415
|
// 时间区间有效性
|
|
416
|
-
if (
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
const monthRange = getMonthRange(_start, _end, currentYear);
|
|
422
|
-
const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
|
|
423
|
-
this.index = [
|
|
424
|
-
yearRange.indexOf(currentYear),
|
|
425
|
-
monthRange.indexOf(currentMonth),
|
|
426
|
-
dayRange.indexOf(currentDay)
|
|
427
|
-
];
|
|
428
|
-
if (!this.pickerDate ||
|
|
429
|
-
this.pickerDate._value.getTime() !== _value.getTime() ||
|
|
430
|
-
this.pickerDate._start.getTime() !== _start.getTime() ||
|
|
431
|
-
this.pickerDate._end.getTime() !== _end.getTime()) {
|
|
432
|
-
this.pickerDate = {
|
|
433
|
-
_value,
|
|
434
|
-
_start,
|
|
435
|
-
_end,
|
|
436
|
-
_updateValue: [
|
|
437
|
-
currentYear,
|
|
438
|
-
currentMonth,
|
|
439
|
-
currentDay
|
|
440
|
-
]
|
|
441
|
-
};
|
|
442
|
-
}
|
|
416
|
+
if (!(_start <= _end)) {
|
|
417
|
+
throw new Error(`Picker start time must be less than end time.`);
|
|
418
|
+
}
|
|
419
|
+
if (!(_value >= _start && _value <= _end)) {
|
|
420
|
+
_value = _start;
|
|
443
421
|
}
|
|
444
|
-
|
|
445
|
-
|
|
422
|
+
const currentYear = _value.getFullYear();
|
|
423
|
+
const currentMonth = _value.getMonth() + 1;
|
|
424
|
+
const currentDay = _value.getDate();
|
|
425
|
+
const yearRange = getYearRange(_start.getFullYear(), _end.getFullYear());
|
|
426
|
+
const monthRange = getMonthRange(_start, _end, currentYear);
|
|
427
|
+
const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
|
|
428
|
+
this.index = [
|
|
429
|
+
yearRange.indexOf(currentYear),
|
|
430
|
+
monthRange.indexOf(currentMonth),
|
|
431
|
+
dayRange.indexOf(currentDay)
|
|
432
|
+
];
|
|
433
|
+
if (!this.pickerDate ||
|
|
434
|
+
this.pickerDate._value.getTime() !== _value.getTime() ||
|
|
435
|
+
this.pickerDate._start.getTime() !== _start.getTime() ||
|
|
436
|
+
this.pickerDate._end.getTime() !== _end.getTime()) {
|
|
437
|
+
this.pickerDate = {
|
|
438
|
+
_value,
|
|
439
|
+
_start,
|
|
440
|
+
_end,
|
|
441
|
+
_updateValue: [
|
|
442
|
+
currentYear,
|
|
443
|
+
currentMonth,
|
|
444
|
+
currentDay
|
|
445
|
+
]
|
|
446
|
+
};
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
449
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?i(e.value):r(e.value).then(o,u)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(i=0)),i)try{if(n=1,r&&(a=u[0]&2?r["return"]:u[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;if(r=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:i.label++;return{value:u[1],done:false};case 5:i.label++;r=u[1];u=[0];continue;case 7:u=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){i=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(u[0]===6&&i.label<a[1]){i.label=a[1];a=u;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(u);break}if(a[2])i.ops.pop();i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e];r=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,a;n<r;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-980f930f.js";import{c as classnames}from"./index-c3e4004b.js";function getTimeRange(e,t){var i=[];for(var n=e;n<=t;n++){i.push("".concat(n<10?"0":"").concat(n))}return i}var hoursRange=__spreadArray(__spreadArray(["20","21","22","23"],getTimeRange(0,23),true),["00","01","02","03"],false);var minutesRange=__spreadArray(__spreadArray(["56","57","58","59"],getTimeRange(0,59),true),["00","01","02","03"],false);function verifyValue(e,t){if(!isNaN(+e)&&e>=0&&e<t.length)return true;return false}function verifyTime(e){if(!/^\d{1,2}:\d{1,2}$/.test(e))return false;var t=e.split(":").map((function(e){return+e}));if(t[0]<0||t[0]>23)return false;if(t[1]<0||t[1]>59)return false;return true}function compareTime(e,t){var i=e.split(":").map((function(e){return+e}));var n=t.split(":").map((function(e){return+e}));if(i[0]<n[0])return true;if(i[0]===n[0]&&i[1]<=n[1])return true;return false}function verifyDate(e){if(!e)return false;var t=new Date(e.replace(/-/g,"/"));return isNaN(t.getMonth())?false:t}function getMaxDay(e,t){if(t===4||t===6||t===9||t===11)return 30;if(t===2){if(e%4===0&&e%100!==0||e%400===0)return 29;else return 28}return 31}function formatValue(e){var t;if(Array.isArray(e)){t=e.map((function(e){return String(e)}))}else{t=e}return t}function getDateRange(e,t){var i=[];for(var n=e;n<=t;n++){i.push(n)}return i}function getYearRange(e,t){return getDateRange(e,t)}function getMonthRange(e,t,i){var n=1;var r=12;if(e.getFullYear()===i){n=e.getMonth()+1}if(t.getFullYear()===i){r=t.getMonth()+1}return getDateRange(n,r)}function getDayRange(e,t,i,n){var r=1;var a=getMaxDay(i,n);if(e.getFullYear()===i&&e.getMonth()+1===n){r=e.getDate()}if(t.getFullYear()===i&&t.getMonth()+1===n){a=t.getDate()}return getDateRange(r,a)}var TOP=102;var LINE_HEIGHT=34;var MASK_HEIGHT=LINE_HEIGHT*7;var indexCss=".weui-picker,.weui-picker__hd{font-size:12px}";var Picker=function(){function e(e){var t=this;registerInstance(this,e);this.onChange=createEvent(this,"change",7);this.onColumnChange=createEvent(this,"columnchange",7);this.onCancel=createEvent(this,"cancel",7);this.index=[];this.showPicker=function(){if(t.disabled)return;t.height=t.getHeightByIndex();t.hidden=false};this.getHeightByIndex=function(){var e=t.index.map((function(e){var i=0;if(t.mode==="time"){i=LINE_HEIGHT*4}return TOP-LINE_HEIGHT*e-i}));return e};this.hidePicker=function(){t.fadeOut=true;setTimeout((function(){t.hidden=true;t.fadeOut=false}),350)};this.handleChange=function(){t.hidePicker();t.index=t.height.map((function(e){return(TOP-e)/LINE_HEIGHT}));var e=t.index.length&&t.mode!=="selector"?t.index:t.index[0];if(t.mode==="time"){var i=[hoursRange.slice(),minutesRange.slice()];var n=t.index.map((function(e,t){return i[t][e]}));t.index=n.map((function(e){return parseInt(e)}));e=n.join(":")}if(t.mode==="date"){var r=t.pickerDate,a=r._start,o=r._end,u=r._updateValue;var s=u[0];var h=u[1];var l=getYearRange(a.getFullYear(),o.getFullYear());var c=getMonthRange(a,o,s);var d=getDayRange(a,o,s,h);var f=l[t.index[0]];var g=c[t.index[1]];var p=d[t.index[2]];if(t.fields==="year"){e=[f]}else if(t.fields==="month"){e=[f,g]}else{e=[f,g,p]}e=e.map((function(e){return e<10?"0".concat(e):e})).join("-")}t.value=e;t.pickerValue=t.value;t.onChange.emit({value:e})};this.handleColumnChange=function(e){var i=e.detail,n=i.columnId,r=i.height;t.onColumnChange.emit({column:Number(n),value:(TOP-r)/LINE_HEIGHT})};this.handleCancel=function(){t.hidePicker();t.onCancel.emit()};this.updateHeight=function(e,i,n){if(n===void 0){n=false}var r=__spreadArray([],t.height,true);r[i]=e;t.height=r;if(n){var a=t,o=a.start,u=a.end;if(!verifyTime(o))o="00:00";if(!verifyTime(u))u="23:59";if(!compareTime(o,u))return;var s=[hoursRange.slice(),minutesRange.slice()];var h=t.height.map((function(e){return(TOP-e)/LINE_HEIGHT}));var l=h.map((function(e,t){return s[t][e]})).join(":");if(!compareTime(o,l)){var c=o.split(":").map((function(e){return TOP-LINE_HEIGHT*(+e+4)}));requestAnimationFrame((function(){return t.height=c}))}else if(!compareTime(l,u)){var d=u.split(":").map((function(e){return TOP-LINE_HEIGHT*(+e+4)}));requestAnimationFrame((function(){return t.height=d}))}}};this.updateDay=function(e,i){var n=t.pickerDate,r=n._start,a=n._end,o=n._updateValue;o[i]=e;var u=o[0];var s=o[1];var h=o[2];if(i===0){var l=getMonthRange(r,a,u);var c=l[l.length-1];var d=l[0];if(s>c)o[1]=c;if(s<d)o[1]=d;var f=l.indexOf(o[1]);var g=TOP-LINE_HEIGHT*f;t.updateDay(o[1],1);t.updateHeight(g,"1")}else if(i===1){var p=getDayRange(r,a,u,s);var c=p[p.length-1];var d=p[0];if(h>c)o[2]=c;if(h<d)o[2]=d;var f=p.indexOf(o[2]);var g=TOP-LINE_HEIGHT*f;t.updateDay(o[2],2);t.updateHeight(g,"2")}};this.getSelector=function(){return h("taro-picker-group",{range:t.range,rangeKey:t.rangeKey,height:t.height[0],updateHeight:t.updateHeight,columnId:"0"})};this.getMultiSelector=function(){return t.range.map((function(e,i){return h("taro-picker-group",{range:e,rangeKey:t.rangeKey,height:t.height[i],updateHeight:t.updateHeight,onColumnChange:t.handleColumnChange,columnId:String(i)})}))};this.getTimeSelector=function(){var e=hoursRange.slice();var i=minutesRange.slice();return[h("taro-picker-group",{mode:"time",range:e,height:t.height[0],updateHeight:t.updateHeight,columnId:"0"}),h("taro-picker-group",{mode:"time",range:i,height:t.height[1],updateHeight:t.updateHeight,columnId:"1"})]};this.getDateSelector=function(){var e=t,i=e.fields,n=e.height;var r=t.pickerDate,a=r._start,o=r._end,u=r._updateValue;var s=u[0];var l=u[1];var c=getYearRange(a.getFullYear(),o.getFullYear()).map((function(e){return"".concat(e,"年")}));var d=getMonthRange(a,o,s).map((function(e){return"".concat(e<10?"0".concat(e):e,"月")}));var f=getDayRange(a,o,s,l).map((function(e){return"".concat(e<10?"0".concat(e):e,"日")}));var g=[h("taro-picker-group",{mode:"date",range:c,height:n[0],updateDay:t.updateDay,updateHeight:t.updateHeight,columnId:"0"})];if(i==="month"||i==="day"){g.push(h("taro-picker-group",{mode:"date",range:d,height:n[1],updateDay:t.updateDay,updateHeight:t.updateHeight,columnId:"1"}))}if(i==="day"){g.push(h("taro-picker-group",{mode:"date",range:f,height:n[2],updateDay:t.updateDay,updateHeight:t.updateHeight,columnId:"2"}))}return g};this.mode="selector";this.disabled=false;this.range=[];this.rangeKey=undefined;this.value=undefined;this.start="";this.end="";this.fields="day";this.name="";this.textProps={};this.pickerValue=[];this.height=[];this.hidden=true;this.fadeOut=false;this.isWillLoadCalled=false}e.prototype.componentWillLoad=function(){this.isWillLoadCalled=true;this.handleProps()};e.prototype.componentDidLoad=function(){if(this.overlay){document.body.appendChild(this.overlay)}};e.prototype.disconnectedCallback=function(){var e;if(this.overlay){(e=this.overlay.parentNode)===null||e===void 0?void 0:e.removeChild(this.overlay)}};e.prototype.onPropsChange=function(){if(!this.isWillLoadCalled)return;this.handleProps()};e.prototype.handleProps=function(){var e=this;var t=this,i=t.mode,n=t.start,r=t.end;if(i==="selector"){var a=this.value;this.index=[verifyValue(a,this.range)?Math.floor(a):0]}else if(i==="multiSelector"){var o=this.value;this.index=[];this.range.forEach((function(t,i){var n=o===null||o===void 0?void 0:o[i];var r=verifyValue(n,t)?Math.floor(n):0;e.index.push(r)}))}else if(i==="time"){var a=this.value;if(!verifyTime(a)){console.warn("time picker value illegal");a="0:0"}var u=a.split(":").map((function(e){return+e}));this.index=u}else if(i==="date"){var a=this.value;var s=verifyDate(a)||new Date((new Date).setHours(0,0,0,0));var h=verifyDate(n)||new Date("1970/01/01");var l=verifyDate(r)||new Date("2999/01/01");if(s>=h&&s<=l){var c=s.getFullYear();var d=s.getMonth()+1;var f=s.getDate();var g=getYearRange(h.getFullYear(),l.getFullYear());var p=getMonthRange(h,l,c);var v=getDayRange(h,l,c,d);this.index=[g.indexOf(c),p.indexOf(d),v.indexOf(f)];if(!this.pickerDate||this.pickerDate._value.getTime()!==s.getTime()||this.pickerDate._start.getTime()!==h.getTime()||this.pickerDate._end.getTime()!==l.getTime()){this.pickerDate={_value:s,_start:h,_end:l,_updateValue:[c,d,f]}}}else{throw new Error("Date Interval Error")}}else{throw new Error('Picker not support "'.concat(i,'" mode.'))}this.height=this.getHeightByIndex();this.pickerValue=this.value;if(i==="date"){var m=this.pickerValue;if(this.fields==="month"){this.pickerValue=m.split("-").slice(0,2).join("-")}else if(this.fields==="year"){this.pickerValue=m.split("-")[0]}}};e.prototype.render=function(){var e=this;var t,i;var n=this,r=n.name,a=n.mode,o=n.fadeOut,u=n.hidden;var s;switch(a){case"multiSelector":s=this.getMultiSelector();break;case"time":s=this.getTimeSelector();break;case"date":s=this.getDateSelector();break;default:s=this.getSelector()}var l=classnames("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":o});var c=classnames("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":o});var d=u?{display:"none"}:{};return h(Host,null,h("div",{onClick:this.showPicker},h("slot",null),h("input",{type:"hidden",name:r,value:formatValue(this.pickerValue)})),h("div",{class:"weui-picker__overlay",style:d,ref:function(t){e.overlay=t}},h("div",{class:l,onClick:this.handleCancel}),h("div",{class:c},h("div",{class:"weui-picker__hd"},h("div",{class:"weui-picker__action",onClick:this.handleCancel},(t=this.textProps.cancelText)!==null&&t!==void 0?t:"取消"),h("div",{class:"weui-picker__action",onClick:this.handleChange},(i=this.textProps.okText)!==null&&i!==void 0?i:"确定")),h("div",{class:"weui-picker__bd"},s),h("input",{type:"hidden",name:r,value:formatValue(this.pickerValue)}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}},enumerable:false,configurable:true});return e}();Picker.style=indexCss;var TaroPickerGroup=function(){function e(e){registerInstance(this,e);this.onColumnChange=createEvent(this,"columnChange",7);this.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.updateDay=undefined;this.startY=undefined;this.preY=undefined;this.hadMove=undefined;this.touchEnd=undefined;this.isMove=undefined}e.prototype.getPosition=function(){var e=this.touchEnd?.3:0;var t="translate3d(0, ".concat(this.height,"px, 0)");var i="transform ".concat(e,"s");return{transform:t,"-webkit-transform":t,transition:i,"-webkit-transition":i}};e.prototype.formulaUnlimitedScroll=function(e,t,i){var n=this;var r=this,a=r.height,o=r.updateHeight,u=r.columnId;var s=i==="up"?1:-1;this.touchEnd=false;o(-e*s*LINE_HEIGHT+a,u);requestAnimationFrame((function(){n.touchEnd=true;var i=Math.round(t/-LINE_HEIGHT)+e*s;var r=TOP-LINE_HEIGHT*i;o(r,u,true)}))};e.prototype.handleMoveStart=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.startY=e;this.preY=e;this.hadMove=false;return[2]}))}))};e.prototype.handleMoving=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n;return __generator(this,(function(r){t=e;i=t-this.preY;this.preY=t;this.touchEnd=false;if(Math.abs(t-this.startY)>10)this.hadMove=true;n=this.height+i;if(this.mode==="time"){if(this.columnId==="0"){if(n>TOP-LINE_HEIGHT*3){n=TOP-LINE_HEIGHT*27+i}if(n<TOP-LINE_HEIGHT*28){n=TOP-LINE_HEIGHT*4+i}}else if(this.columnId==="1"){if(n>TOP-LINE_HEIGHT*3){n=TOP-LINE_HEIGHT*63+i}if(n<TOP-LINE_HEIGHT*64){n=TOP-LINE_HEIGHT*4+i}}}this.updateHeight(n,this.columnId);return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,a,o,u,s,h,l,c,d,f,g;return __generator(this,(function(p){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.columnId;u=0;s=-LINE_HEIGHT*(n.length-1);h=e;this.touchEnd=true;if(!this.hadMove){c=window.innerHeight;d=c-MASK_HEIGHT/2;l=r-TOP-(h-d);if(i==="time"){if(o==="0"){if(l>-LINE_HEIGHT*2.5){return[2,this.formulaUnlimitedScroll(24,l,"up")]}if(l<-LINE_HEIGHT*28.5){return[2,this.formulaUnlimitedScroll(24,l,"down")]}}else if(o==="1"){if(l>-LINE_HEIGHT*2.5){return[2,this.formulaUnlimitedScroll(60,l,"up")]}if(l<-LINE_HEIGHT*64.5){return[2,this.formulaUnlimitedScroll(60,l,"down")]}}}}else{l=r-TOP}if(l>u)l=0;if(l<s)l=s;f=Math.round(l/-LINE_HEIGHT);g=TOP-LINE_HEIGHT*f;if(this.mode==="date"&&typeof this.updateDay==="function"){if(this.columnId==="0"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),2)}}a(g,o,i==="time");this.onColumnChange.emit({columnId:o,height:g});return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){if(!this.isMove)return;this.handleMoving(e.clientY)};e.prototype.onMouseMoveEnd=function(e){if(!this.isMove)return;this.isMove=false;this.handleMoveEnd(e.clientY)};e.prototype.onTouchStart=function(e){this.handleMoveStart(e.changedTouches[0].clientY)};e.prototype.onTouchMove=function(e){this.handleMoving(e.changedTouches[0].clientY)};e.prototype.onTouchEnd=function(e){this.handleMoveEnd(e.changedTouches[0].clientY)};e.prototype.render=function(){var e=this,t=e.range,i=e.rangeKey;var n=t.map((function(e){var t=i?e[i]:e;return h("div",{class:"weui-picker__item"},t)}));return h(Host,{class:"weui-picker__group"},h("div",{class:"weui-picker__mask"}),h("div",{class:"weui-picker__indicator"}),h("div",{class:"weui-picker__content",style:this.getPosition()},n))};return e}();export{Picker as taro_picker_core,TaroPickerGroup as taro_picker_group};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?i(e.value):r(e.value).then(o,u)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(i=0)),i)try{if(n=1,r&&(a=u[0]&2?r["return"]:u[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;if(r=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:i.label++;return{value:u[1],done:false};case 5:i.label++;r=u[1];u=[0];continue;case 7:u=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){i=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(u[0]===6&&i.label<a[1]){i.label=a[1];a=u;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(u);break}if(a[2])i.ops.pop();i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e];r=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,a;n<r;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-980f930f.js";import{c as classnames}from"./index-c3e4004b.js";function getTimeRange(e,t){var i=[];for(var n=e;n<=t;n++){i.push("".concat(n<10?"0":"").concat(n))}return i}var hoursRange=__spreadArray(__spreadArray(["20","21","22","23"],getTimeRange(0,23),true),["00","01","02","03"],false);var minutesRange=__spreadArray(__spreadArray(["56","57","58","59"],getTimeRange(0,59),true),["00","01","02","03"],false);function verifyValue(e,t){if(!isNaN(+e)&&e>=0&&e<t.length)return true;return false}function verifyTime(e){if(!/^\d{1,2}:\d{1,2}$/.test(e))return false;var t=e.split(":").map((function(e){return+e}));if(t[0]<0||t[0]>23)return false;if(t[1]<0||t[1]>59)return false;return true}function compareTime(e,t){var i=e.split(":").map((function(e){return+e}));var n=t.split(":").map((function(e){return+e}));if(i[0]<n[0])return true;if(i[0]===n[0]&&i[1]<=n[1])return true;return false}function verifyDate(e){if(!e)return false;var t=new Date(e.replace(/-/g,"/"));return isNaN(t.getMonth())?false:t}function getMaxDay(e,t){if(t===4||t===6||t===9||t===11)return 30;if(t===2){if(e%4===0&&e%100!==0||e%400===0)return 29;else return 28}return 31}function formatValue(e){var t;if(Array.isArray(e)){t=e.map((function(e){return String(e)}))}else{t=e}return t}function getDateRange(e,t){var i=[];for(var n=e;n<=t;n++){i.push(n)}return i}function getYearRange(e,t){return getDateRange(e,t)}function getMonthRange(e,t,i){var n=1;var r=12;if(e.getFullYear()===i){n=e.getMonth()+1}if(t.getFullYear()===i){r=t.getMonth()+1}return getDateRange(n,r)}function getDayRange(e,t,i,n){var r=1;var a=getMaxDay(i,n);if(e.getFullYear()===i&&e.getMonth()+1===n){r=e.getDate()}if(t.getFullYear()===i&&t.getMonth()+1===n){a=t.getDate()}return getDateRange(r,a)}var TOP=102;var LINE_HEIGHT=34;var MASK_HEIGHT=LINE_HEIGHT*7;var indexCss=".weui-picker,.weui-picker__hd{font-size:12px}";var Picker=function(){function e(e){var t=this;registerInstance(this,e);this.onChange=createEvent(this,"change",7);this.onColumnChange=createEvent(this,"columnchange",7);this.onCancel=createEvent(this,"cancel",7);this.index=[];this.showPicker=function(){if(t.disabled)return;t.height=t.getHeightByIndex();t.hidden=false};this.getHeightByIndex=function(){var e=t.index.map((function(e){var i=0;if(t.mode==="time"){i=LINE_HEIGHT*4}return TOP-LINE_HEIGHT*e-i}));return e};this.hidePicker=function(){t.fadeOut=true;setTimeout((function(){t.hidden=true;t.fadeOut=false}),350)};this.handleChange=function(){t.hidePicker();t.index=t.height.map((function(e){return(TOP-e)/LINE_HEIGHT}));var e=t.index.length&&t.mode!=="selector"?t.index:t.index[0];if(t.mode==="time"){var i=[hoursRange.slice(),minutesRange.slice()];var n=t.index.map((function(e,t){return i[t][e]}));t.index=n.map((function(e){return parseInt(e)}));e=n.join(":")}if(t.mode==="date"){var r=t.pickerDate,a=r._start,o=r._end,u=r._updateValue;var s=u[0];var h=u[1];var l=getYearRange(a.getFullYear(),o.getFullYear());var c=getMonthRange(a,o,s);var d=getDayRange(a,o,s,h);var f=l[t.index[0]];var g=c[t.index[1]];var p=d[t.index[2]];if(t.fields==="year"){e=[f]}else if(t.fields==="month"){e=[f,g]}else{e=[f,g,p]}e=e.map((function(e){return e<10?"0".concat(e):e})).join("-")}t.value=e;t.pickerValue=t.value;t.onChange.emit({value:e})};this.handleColumnChange=function(e){var i=e.detail,n=i.columnId,r=i.height;t.onColumnChange.emit({column:Number(n),value:(TOP-r)/LINE_HEIGHT})};this.handleCancel=function(){t.hidePicker();t.onCancel.emit()};this.updateHeight=function(e,i,n){if(n===void 0){n=false}var r=__spreadArray([],t.height,true);r[i]=e;t.height=r;if(n){var a=t,o=a.start,u=a.end;if(!verifyTime(o))o="00:00";if(!verifyTime(u))u="23:59";if(!compareTime(o,u))return;var s=[hoursRange.slice(),minutesRange.slice()];var h=t.height.map((function(e){return(TOP-e)/LINE_HEIGHT}));var l=h.map((function(e,t){return s[t][e]})).join(":");if(!compareTime(o,l)){var c=o.split(":").map((function(e){return TOP-LINE_HEIGHT*(+e+4)}));requestAnimationFrame((function(){return t.height=c}))}else if(!compareTime(l,u)){var d=u.split(":").map((function(e){return TOP-LINE_HEIGHT*(+e+4)}));requestAnimationFrame((function(){return t.height=d}))}}};this.updateDay=function(e,i){var n=t.pickerDate,r=n._start,a=n._end,o=n._updateValue;o[i]=e;var u=o[0];var s=o[1];var h=o[2];if(i===0){var l=getMonthRange(r,a,u);var c=l[l.length-1];var d=l[0];if(s>c)o[1]=c;if(s<d)o[1]=d;var f=l.indexOf(o[1]);var g=TOP-LINE_HEIGHT*f;t.updateDay(o[1],1);t.updateHeight(g,"1")}else if(i===1){var p=getDayRange(r,a,u,s);var c=p[p.length-1];var d=p[0];if(h>c)o[2]=c;if(h<d)o[2]=d;var f=p.indexOf(o[2]);var g=TOP-LINE_HEIGHT*f;t.updateDay(o[2],2);t.updateHeight(g,"2")}};this.getSelector=function(){return h("taro-picker-group",{range:t.range,rangeKey:t.rangeKey,height:t.height[0],updateHeight:t.updateHeight,columnId:"0"})};this.getMultiSelector=function(){return t.range.map((function(e,i){return h("taro-picker-group",{range:e,rangeKey:t.rangeKey,height:t.height[i],updateHeight:t.updateHeight,onColumnChange:t.handleColumnChange,columnId:String(i)})}))};this.getTimeSelector=function(){var e=hoursRange.slice();var i=minutesRange.slice();return[h("taro-picker-group",{mode:"time",range:e,height:t.height[0],updateHeight:t.updateHeight,columnId:"0"}),h("taro-picker-group",{mode:"time",range:i,height:t.height[1],updateHeight:t.updateHeight,columnId:"1"})]};this.getDateSelector=function(){var e=t,i=e.fields,n=e.height;var r=t.pickerDate,a=r._start,o=r._end,u=r._updateValue;var s=u[0];var l=u[1];var c=getYearRange(a.getFullYear(),o.getFullYear()).map((function(e){return"".concat(e,"年")}));var d=getMonthRange(a,o,s).map((function(e){return"".concat(e<10?"0".concat(e):e,"月")}));var f=getDayRange(a,o,s,l).map((function(e){return"".concat(e<10?"0".concat(e):e,"日")}));var g=[h("taro-picker-group",{mode:"date",range:c,height:n[0],updateDay:t.updateDay,updateHeight:t.updateHeight,columnId:"0"})];if(i==="month"||i==="day"){g.push(h("taro-picker-group",{mode:"date",range:d,height:n[1],updateDay:t.updateDay,updateHeight:t.updateHeight,columnId:"1"}))}if(i==="day"){g.push(h("taro-picker-group",{mode:"date",range:f,height:n[2],updateDay:t.updateDay,updateHeight:t.updateHeight,columnId:"2"}))}return g};this.mode="selector";this.disabled=false;this.range=[];this.rangeKey=undefined;this.value=undefined;this.start="";this.end="";this.fields="day";this.name="";this.textProps={};this.pickerValue=[];this.height=[];this.hidden=true;this.fadeOut=false;this.isWillLoadCalled=false}e.prototype.componentWillLoad=function(){this.isWillLoadCalled=true;this.handleProps()};e.prototype.componentDidLoad=function(){if(this.overlay){document.body.appendChild(this.overlay)}};e.prototype.disconnectedCallback=function(){var e;if(this.overlay){(e=this.overlay.parentNode)===null||e===void 0?void 0:e.removeChild(this.overlay)}};e.prototype.onPropsChange=function(){if(!this.isWillLoadCalled)return;this.handleProps()};e.prototype.handleProps=function(){var e=this;var t=this,i=t.mode,n=t.start,r=t.end;if(i==="selector"){var a=this.value;this.index=[verifyValue(a,this.range)?Math.floor(a):0]}else if(i==="multiSelector"){var o=this.value;this.index=[];this.range.forEach((function(t,i){var n=o===null||o===void 0?void 0:o[i];var r=verifyValue(n,t)?Math.floor(n):0;e.index.push(r)}))}else if(i==="time"){var a=this.value;if(!verifyTime(a)){console.warn("time picker value illegal");a="0:0"}var u=a.split(":").map((function(e){return+e}));this.index=u}else if(i==="date"){var a=this.value;var s=verifyDate(a)||new Date((new Date).setHours(0,0,0,0));var h=verifyDate(n)||new Date("1970/01/01");var l=verifyDate(r)||new Date("2999/01/01");if(!(h<=l)){throw new Error("Picker start time must be less than end time.")}if(!(s>=h&&s<=l)){s=h}var c=s.getFullYear();var d=s.getMonth()+1;var f=s.getDate();var g=getYearRange(h.getFullYear(),l.getFullYear());var p=getMonthRange(h,l,c);var v=getDayRange(h,l,c,d);this.index=[g.indexOf(c),p.indexOf(d),v.indexOf(f)];if(!this.pickerDate||this.pickerDate._value.getTime()!==s.getTime()||this.pickerDate._start.getTime()!==h.getTime()||this.pickerDate._end.getTime()!==l.getTime()){this.pickerDate={_value:s,_start:h,_end:l,_updateValue:[c,d,f]}}}else{throw new Error('Picker not support "'.concat(i,'" mode.'))}this.height=this.getHeightByIndex();this.pickerValue=this.value;if(i==="date"){var m=this.pickerValue;if(this.fields==="month"){this.pickerValue=m.split("-").slice(0,2).join("-")}else if(this.fields==="year"){this.pickerValue=m.split("-")[0]}}};e.prototype.render=function(){var e=this;var t,i;var n=this,r=n.name,a=n.mode,o=n.fadeOut,u=n.hidden;var s;switch(a){case"multiSelector":s=this.getMultiSelector();break;case"time":s=this.getTimeSelector();break;case"date":s=this.getDateSelector();break;default:s=this.getSelector()}var l=classnames("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":o});var c=classnames("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":o});var d=u?{display:"none"}:{};return h(Host,null,h("div",{onClick:this.showPicker},h("slot",null),h("input",{type:"hidden",name:r,value:formatValue(this.pickerValue)})),h("div",{class:"weui-picker__overlay",style:d,ref:function(t){e.overlay=t}},h("div",{class:l,onClick:this.handleCancel}),h("div",{class:c},h("div",{class:"weui-picker__hd"},h("div",{class:"weui-picker__action",onClick:this.handleCancel},(t=this.textProps.cancelText)!==null&&t!==void 0?t:"取消"),h("div",{class:"weui-picker__action",onClick:this.handleChange},(i=this.textProps.okText)!==null&&i!==void 0?i:"确定")),h("div",{class:"weui-picker__bd"},s),h("input",{type:"hidden",name:r,value:formatValue(this.pickerValue)}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}},enumerable:false,configurable:true});return e}();Picker.style=indexCss;var TaroPickerGroup=function(){function e(e){registerInstance(this,e);this.onColumnChange=createEvent(this,"columnChange",7);this.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.updateDay=undefined;this.startY=undefined;this.preY=undefined;this.hadMove=undefined;this.touchEnd=undefined;this.isMove=undefined}e.prototype.getPosition=function(){var e=this.touchEnd?.3:0;var t="translate3d(0, ".concat(this.height,"px, 0)");var i="transform ".concat(e,"s");return{transform:t,"-webkit-transform":t,transition:i,"-webkit-transition":i}};e.prototype.formulaUnlimitedScroll=function(e,t,i){var n=this;var r=this,a=r.height,o=r.updateHeight,u=r.columnId;var s=i==="up"?1:-1;this.touchEnd=false;o(-e*s*LINE_HEIGHT+a,u);requestAnimationFrame((function(){n.touchEnd=true;var i=Math.round(t/-LINE_HEIGHT)+e*s;var r=TOP-LINE_HEIGHT*i;o(r,u,true)}))};e.prototype.handleMoveStart=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.startY=e;this.preY=e;this.hadMove=false;return[2]}))}))};e.prototype.handleMoving=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n;return __generator(this,(function(r){t=e;i=t-this.preY;this.preY=t;this.touchEnd=false;if(Math.abs(t-this.startY)>10)this.hadMove=true;n=this.height+i;if(this.mode==="time"){if(this.columnId==="0"){if(n>TOP-LINE_HEIGHT*3){n=TOP-LINE_HEIGHT*27+i}if(n<TOP-LINE_HEIGHT*28){n=TOP-LINE_HEIGHT*4+i}}else if(this.columnId==="1"){if(n>TOP-LINE_HEIGHT*3){n=TOP-LINE_HEIGHT*63+i}if(n<TOP-LINE_HEIGHT*64){n=TOP-LINE_HEIGHT*4+i}}}this.updateHeight(n,this.columnId);return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,a,o,u,s,h,l,c,d,f,g;return __generator(this,(function(p){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.columnId;u=0;s=-LINE_HEIGHT*(n.length-1);h=e;this.touchEnd=true;if(!this.hadMove){c=window.innerHeight;d=c-MASK_HEIGHT/2;l=r-TOP-(h-d);if(i==="time"){if(o==="0"){if(l>-LINE_HEIGHT*2.5){return[2,this.formulaUnlimitedScroll(24,l,"up")]}if(l<-LINE_HEIGHT*28.5){return[2,this.formulaUnlimitedScroll(24,l,"down")]}}else if(o==="1"){if(l>-LINE_HEIGHT*2.5){return[2,this.formulaUnlimitedScroll(60,l,"up")]}if(l<-LINE_HEIGHT*64.5){return[2,this.formulaUnlimitedScroll(60,l,"down")]}}}}else{l=r-TOP}if(l>u)l=0;if(l<s)l=s;f=Math.round(l/-LINE_HEIGHT);g=TOP-LINE_HEIGHT*f;if(this.mode==="date"&&typeof this.updateDay==="function"){if(this.columnId==="0"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),2)}}a(g,o,i==="time");this.onColumnChange.emit({columnId:o,height:g});return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){if(!this.isMove)return;this.handleMoving(e.clientY)};e.prototype.onMouseMoveEnd=function(e){if(!this.isMove)return;this.isMove=false;this.handleMoveEnd(e.clientY)};e.prototype.onTouchStart=function(e){this.handleMoveStart(e.changedTouches[0].clientY)};e.prototype.onTouchMove=function(e){this.handleMoving(e.changedTouches[0].clientY)};e.prototype.onTouchEnd=function(e){this.handleMoveEnd(e.changedTouches[0].clientY)};e.prototype.render=function(){var e=this,t=e.range,i=e.rangeKey;var n=t.map((function(e){var t=i?e[i]:e;return h("div",{class:"weui-picker__item"},t)}));return h(Host,{class:"weui-picker__group"},h("div",{class:"weui-picker__mask"}),h("div",{class:"weui-picker__indicator"}),h("div",{class:"weui-picker__content",style:this.getPosition()},n))};return e}();export{Picker as taro_picker_core,TaroPickerGroup as taro_picker_group};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?i(e.value):r(e.value).then(o,u)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(i=0)),i)try{if(n=1,r&&(a=u[0]&2?r["return"]:u[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;if(r=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:i.label++;return{value:u[1],done:false};case 5:i.label++;r=u[1];u=[0];continue;case 7:u=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){i=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(u[0]===6&&i.label<a[1]){i.label=a[1];a=u;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(u);break}if(a[2])i.ops.pop();i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e];r=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,a;n<r;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};System.register(["./p-7e6b54cb.system.js","./p-2ec68968.system.js"],(function(e){"use strict";var t,i,n,r,a,o;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;a=e.g},function(e){o=e.c}],execute:function(){function u(e,t){var i=[];for(var n=e;n<=t;n++){i.push("".concat(n<10?"0":"").concat(n))}return i}var s=__spreadArray(__spreadArray(["20","21","22","23"],u(0,23),true),["00","01","02","03"],false);var h=__spreadArray(__spreadArray(["56","57","58","59"],u(0,59),true),["00","01","02","03"],false);function l(e,t){if(!isNaN(+e)&&e>=0&&e<t.length)return true;return false}function c(e){if(!/^\d{1,2}:\d{1,2}$/.test(e))return false;var t=e.split(":").map((function(e){return+e}));if(t[0]<0||t[0]>23)return false;if(t[1]<0||t[1]>59)return false;return true}function d(e,t){var i=e.split(":").map((function(e){return+e}));var n=t.split(":").map((function(e){return+e}));if(i[0]<n[0])return true;if(i[0]===n[0]&&i[1]<=n[1])return true;return false}function f(e){if(!e)return false;var t=new Date(e.replace(/-/g,"/"));return isNaN(t.getMonth())?false:t}function p(e,t){if(t===4||t===6||t===9||t===11)return 30;if(t===2){if(e%4===0&&e%100!==0||e%400===0)return 29;else return 28}return 31}function v(e){var t;if(Array.isArray(e)){t=e.map((function(e){return String(e)}))}else{t=e}return t}function g(e,t){var i=[];for(var n=e;n<=t;n++){i.push(n)}return i}function m(e,t){return g(e,t)}function y(e,t,i){var n=1;var r=12;if(e.getFullYear()===i){n=e.getMonth()+1}if(t.getFullYear()===i){r=t.getMonth()+1}return g(n,r)}function _(e,t,i,n){var r=1;var a=p(i,n);if(e.getFullYear()===i&&e.getMonth()+1===n){r=e.getDate()}if(t.getFullYear()===i&&t.getMonth()+1===n){a=t.getDate()}return g(r,a)}var k=102;var w=34;var C=w*7;var x=".weui-picker,.weui-picker__hd{font-size:12px}";var M=e("taro_picker_core",function(){function e(e){var r=this;t(this,e);this.onChange=i(this,"change",7);this.onColumnChange=i(this,"columnchange",7);this.onCancel=i(this,"cancel",7);this.index=[];this.showPicker=function(){if(r.disabled)return;r.height=r.getHeightByIndex();r.hidden=false};this.getHeightByIndex=function(){var e=r.index.map((function(e){var t=0;if(r.mode==="time"){t=w*4}return k-w*e-t}));return e};this.hidePicker=function(){r.fadeOut=true;setTimeout((function(){r.hidden=true;r.fadeOut=false}),350)};this.handleChange=function(){r.hidePicker();r.index=r.height.map((function(e){return(k-e)/w}));var e=r.index.length&&r.mode!=="selector"?r.index:r.index[0];if(r.mode==="time"){var t=[s.slice(),h.slice()];var i=r.index.map((function(e,i){return t[i][e]}));r.index=i.map((function(e){return parseInt(e)}));e=i.join(":")}if(r.mode==="date"){var n=r.pickerDate,a=n._start,o=n._end,u=n._updateValue;var l=u[0];var c=u[1];var d=m(a.getFullYear(),o.getFullYear());var f=y(a,o,l);var p=_(a,o,l,c);var v=d[r.index[0]];var g=f[r.index[1]];var C=p[r.index[2]];if(r.fields==="year"){e=[v]}else if(r.fields==="month"){e=[v,g]}else{e=[v,g,C]}e=e.map((function(e){return e<10?"0".concat(e):e})).join("-")}r.value=e;r.pickerValue=r.value;r.onChange.emit({value:e})};this.handleColumnChange=function(e){var t=e.detail,i=t.columnId,n=t.height;r.onColumnChange.emit({column:Number(i),value:(k-n)/w})};this.handleCancel=function(){r.hidePicker();r.onCancel.emit()};this.updateHeight=function(e,t,i){if(i===void 0){i=false}var n=__spreadArray([],r.height,true);n[t]=e;r.height=n;if(i){var a=r,o=a.start,u=a.end;if(!c(o))o="00:00";if(!c(u))u="23:59";if(!d(o,u))return;var l=[s.slice(),h.slice()];var f=r.height.map((function(e){return(k-e)/w}));var p=f.map((function(e,t){return l[t][e]})).join(":");if(!d(o,p)){var v=o.split(":").map((function(e){return k-w*(+e+4)}));requestAnimationFrame((function(){return r.height=v}))}else if(!d(p,u)){var g=u.split(":").map((function(e){return k-w*(+e+4)}));requestAnimationFrame((function(){return r.height=g}))}}};this.updateDay=function(e,t){var i=r.pickerDate,n=i._start,a=i._end,o=i._updateValue;o[t]=e;var u=o[0];var s=o[1];var h=o[2];if(t===0){var l=y(n,a,u);var c=l[l.length-1];var d=l[0];if(s>c)o[1]=c;if(s<d)o[1]=d;var f=l.indexOf(o[1]);var p=k-w*f;r.updateDay(o[1],1);r.updateHeight(p,"1")}else if(t===1){var v=_(n,a,u,s);var c=v[v.length-1];var d=v[0];if(h>c)o[2]=c;if(h<d)o[2]=d;var f=v.indexOf(o[2]);var p=k-w*f;r.updateDay(o[2],2);r.updateHeight(p,"2")}};this.getSelector=function(){return n("taro-picker-group",{range:r.range,rangeKey:r.rangeKey,height:r.height[0],updateHeight:r.updateHeight,columnId:"0"})};this.getMultiSelector=function(){return r.range.map((function(e,t){return n("taro-picker-group",{range:e,rangeKey:r.rangeKey,height:r.height[t],updateHeight:r.updateHeight,onColumnChange:r.handleColumnChange,columnId:String(t)})}))};this.getTimeSelector=function(){var e=s.slice();var t=h.slice();return[n("taro-picker-group",{mode:"time",range:e,height:r.height[0],updateHeight:r.updateHeight,columnId:"0"}),n("taro-picker-group",{mode:"time",range:t,height:r.height[1],updateHeight:r.updateHeight,columnId:"1"})]};this.getDateSelector=function(){var e=r,t=e.fields,i=e.height;var a=r.pickerDate,o=a._start,u=a._end,s=a._updateValue;var h=s[0];var l=s[1];var c=m(o.getFullYear(),u.getFullYear()).map((function(e){return"".concat(e,"年")}));var d=y(o,u,h).map((function(e){return"".concat(e<10?"0".concat(e):e,"月")}));var f=_(o,u,h,l).map((function(e){return"".concat(e<10?"0".concat(e):e,"日")}));var p=[n("taro-picker-group",{mode:"date",range:c,height:i[0],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"0"})];if(t==="month"||t==="day"){p.push(n("taro-picker-group",{mode:"date",range:d,height:i[1],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"1"}))}if(t==="day"){p.push(n("taro-picker-group",{mode:"date",range:f,height:i[2],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"2"}))}return p};this.mode="selector";this.disabled=false;this.range=[];this.rangeKey=undefined;this.value=undefined;this.start="";this.end="";this.fields="day";this.name="";this.textProps={};this.pickerValue=[];this.height=[];this.hidden=true;this.fadeOut=false;this.isWillLoadCalled=false}e.prototype.componentWillLoad=function(){this.isWillLoadCalled=true;this.handleProps()};e.prototype.componentDidLoad=function(){if(this.overlay){document.body.appendChild(this.overlay)}};e.prototype.disconnectedCallback=function(){var e;if(this.overlay){(e=this.overlay.parentNode)===null||e===void 0?void 0:e.removeChild(this.overlay)}};e.prototype.onPropsChange=function(){if(!this.isWillLoadCalled)return;this.handleProps()};e.prototype.handleProps=function(){var e=this;var t=this,i=t.mode,n=t.start,r=t.end;if(i==="selector"){var a=this.value;this.index=[l(a,this.range)?Math.floor(a):0]}else if(i==="multiSelector"){var o=this.value;this.index=[];this.range.forEach((function(t,i){var n=o===null||o===void 0?void 0:o[i];var r=l(n,t)?Math.floor(n):0;e.index.push(r)}))}else if(i==="time"){var a=this.value;if(!c(a)){console.warn("time picker value illegal");a="0:0"}var u=a.split(":").map((function(e){return+e}));this.index=u}else if(i==="date"){var a=this.value;var s=f(a)||new Date((new Date).setHours(0,0,0,0));var h=f(n)||new Date("1970/01/01");var d=f(r)||new Date("2999/01/01");if(s>=h&&s<=d){var p=s.getFullYear();var v=s.getMonth()+1;var g=s.getDate();var k=m(h.getFullYear(),d.getFullYear());var w=y(h,d,p);var C=_(h,d,p,v);this.index=[k.indexOf(p),w.indexOf(v),C.indexOf(g)];if(!this.pickerDate||this.pickerDate._value.getTime()!==s.getTime()||this.pickerDate._start.getTime()!==h.getTime()||this.pickerDate._end.getTime()!==d.getTime()){this.pickerDate={_value:s,_start:h,_end:d,_updateValue:[p,v,g]}}}else{throw new Error("Date Interval Error")}}else{throw new Error('Picker not support "'.concat(i,'" mode.'))}this.height=this.getHeightByIndex();this.pickerValue=this.value;if(i==="date"){var x=this.pickerValue;if(this.fields==="month"){this.pickerValue=x.split("-").slice(0,2).join("-")}else if(this.fields==="year"){this.pickerValue=x.split("-")[0]}}};e.prototype.render=function(){var e=this;var t,i;var a=this,u=a.name,s=a.mode,h=a.fadeOut,l=a.hidden;var c;switch(s){case"multiSelector":c=this.getMultiSelector();break;case"time":c=this.getTimeSelector();break;case"date":c=this.getDateSelector();break;default:c=this.getSelector()}var d=o("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":h});var f=o("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":h});var p=l?{display:"none"}:{};return n(r,null,n("div",{onClick:this.showPicker},n("slot",null),n("input",{type:"hidden",name:u,value:v(this.pickerValue)})),n("div",{class:"weui-picker__overlay",style:p,ref:function(t){e.overlay=t}},n("div",{class:d,onClick:this.handleCancel}),n("div",{class:f},n("div",{class:"weui-picker__hd"},n("div",{class:"weui-picker__action",onClick:this.handleCancel},(t=this.textProps.cancelText)!==null&&t!==void 0?t:"取消"),n("div",{class:"weui-picker__action",onClick:this.handleChange},(i=this.textProps.okText)!==null&&i!==void 0?i:"确定")),n("div",{class:"weui-picker__bd"},c),n("input",{type:"hidden",name:u,value:v(this.pickerValue)}))))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}},enumerable:false,configurable:true});return e}());M.style=x;var D=e("taro_picker_group",function(){function e(e){t(this,e);this.onColumnChange=i(this,"columnChange",7);this.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.updateDay=undefined;this.startY=undefined;this.preY=undefined;this.hadMove=undefined;this.touchEnd=undefined;this.isMove=undefined}e.prototype.getPosition=function(){var e=this.touchEnd?.3:0;var t="translate3d(0, ".concat(this.height,"px, 0)");var i="transform ".concat(e,"s");return{transform:t,"-webkit-transform":t,transition:i,"-webkit-transition":i}};e.prototype.formulaUnlimitedScroll=function(e,t,i){var n=this;var r=this,a=r.height,o=r.updateHeight,u=r.columnId;var s=i==="up"?1:-1;this.touchEnd=false;o(-e*s*w+a,u);requestAnimationFrame((function(){n.touchEnd=true;var i=Math.round(t/-w)+e*s;var r=k-w*i;o(r,u,true)}))};e.prototype.handleMoveStart=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.startY=e;this.preY=e;this.hadMove=false;return[2]}))}))};e.prototype.handleMoving=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n;return __generator(this,(function(r){t=e;i=t-this.preY;this.preY=t;this.touchEnd=false;if(Math.abs(t-this.startY)>10)this.hadMove=true;n=this.height+i;if(this.mode==="time"){if(this.columnId==="0"){if(n>k-w*3){n=k-w*27+i}if(n<k-w*28){n=k-w*4+i}}else if(this.columnId==="1"){if(n>k-w*3){n=k-w*63+i}if(n<k-w*64){n=k-w*4+i}}}this.updateHeight(n,this.columnId);return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,a,o,u,s,h,l,c,d,f,p;return __generator(this,(function(v){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.columnId;u=0;s=-w*(n.length-1);h=e;this.touchEnd=true;if(!this.hadMove){c=window.innerHeight;d=c-C/2;l=r-k-(h-d);if(i==="time"){if(o==="0"){if(l>-w*2.5){return[2,this.formulaUnlimitedScroll(24,l,"up")]}if(l<-w*28.5){return[2,this.formulaUnlimitedScroll(24,l,"down")]}}else if(o==="1"){if(l>-w*2.5){return[2,this.formulaUnlimitedScroll(60,l,"up")]}if(l<-w*64.5){return[2,this.formulaUnlimitedScroll(60,l,"down")]}}}}else{l=r-k}if(l>u)l=0;if(l<s)l=s;f=Math.round(l/-w);p=k-w*f;if(this.mode==="date"&&typeof this.updateDay==="function"){if(this.columnId==="0"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),2)}}a(p,o,i==="time");this.onColumnChange.emit({columnId:o,height:p});return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){if(!this.isMove)return;this.handleMoving(e.clientY)};e.prototype.onMouseMoveEnd=function(e){if(!this.isMove)return;this.isMove=false;this.handleMoveEnd(e.clientY)};e.prototype.onTouchStart=function(e){this.handleMoveStart(e.changedTouches[0].clientY)};e.prototype.onTouchMove=function(e){this.handleMoving(e.changedTouches[0].clientY)};e.prototype.onTouchEnd=function(e){this.handleMoveEnd(e.changedTouches[0].clientY)};e.prototype.render=function(){var e=this,t=e.range,i=e.rangeKey;var a=t.map((function(e){var t=i?e[i]:e;return n("div",{class:"weui-picker__item"},t)}));return n(r,{class:"weui-picker__group"},n("div",{class:"weui-picker__mask"}),n("div",{class:"weui-picker__indicator"}),n("div",{class:"weui-picker__content",style:this.getPosition()},a))};return e}())}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?i(e.value):r(e.value).then(o,u)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(i=0)),i)try{if(n=1,r&&(a=u[0]&2?r["return"]:u[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;if(r=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:i.label++;return{value:u[1],done:false};case 5:i.label++;r=u[1];u=[0];continue;case 7:u=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){i=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(u[0]===6&&i.label<a[1]){i.label=a[1];a=u;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(u);break}if(a[2])i.ops.pop();i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e];r=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,a;n<r;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};System.register(["./p-7e6b54cb.system.js","./p-2ec68968.system.js"],(function(e){"use strict";var t,i,n,r,a,o;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;a=e.g},function(e){o=e.c}],execute:function(){function u(e,t){var i=[];for(var n=e;n<=t;n++){i.push("".concat(n<10?"0":"").concat(n))}return i}var s=__spreadArray(__spreadArray(["20","21","22","23"],u(0,23),true),["00","01","02","03"],false);var h=__spreadArray(__spreadArray(["56","57","58","59"],u(0,59),true),["00","01","02","03"],false);function l(e,t){if(!isNaN(+e)&&e>=0&&e<t.length)return true;return false}function c(e){if(!/^\d{1,2}:\d{1,2}$/.test(e))return false;var t=e.split(":").map((function(e){return+e}));if(t[0]<0||t[0]>23)return false;if(t[1]<0||t[1]>59)return false;return true}function d(e,t){var i=e.split(":").map((function(e){return+e}));var n=t.split(":").map((function(e){return+e}));if(i[0]<n[0])return true;if(i[0]===n[0]&&i[1]<=n[1])return true;return false}function f(e){if(!e)return false;var t=new Date(e.replace(/-/g,"/"));return isNaN(t.getMonth())?false:t}function p(e,t){if(t===4||t===6||t===9||t===11)return 30;if(t===2){if(e%4===0&&e%100!==0||e%400===0)return 29;else return 28}return 31}function v(e){var t;if(Array.isArray(e)){t=e.map((function(e){return String(e)}))}else{t=e}return t}function g(e,t){var i=[];for(var n=e;n<=t;n++){i.push(n)}return i}function m(e,t){return g(e,t)}function y(e,t,i){var n=1;var r=12;if(e.getFullYear()===i){n=e.getMonth()+1}if(t.getFullYear()===i){r=t.getMonth()+1}return g(n,r)}function _(e,t,i,n){var r=1;var a=p(i,n);if(e.getFullYear()===i&&e.getMonth()+1===n){r=e.getDate()}if(t.getFullYear()===i&&t.getMonth()+1===n){a=t.getDate()}return g(r,a)}var k=102;var w=34;var C=w*7;var x=".weui-picker,.weui-picker__hd{font-size:12px}";var M=e("taro_picker_core",function(){function e(e){var r=this;t(this,e);this.onChange=i(this,"change",7);this.onColumnChange=i(this,"columnchange",7);this.onCancel=i(this,"cancel",7);this.index=[];this.showPicker=function(){if(r.disabled)return;r.height=r.getHeightByIndex();r.hidden=false};this.getHeightByIndex=function(){var e=r.index.map((function(e){var t=0;if(r.mode==="time"){t=w*4}return k-w*e-t}));return e};this.hidePicker=function(){r.fadeOut=true;setTimeout((function(){r.hidden=true;r.fadeOut=false}),350)};this.handleChange=function(){r.hidePicker();r.index=r.height.map((function(e){return(k-e)/w}));var e=r.index.length&&r.mode!=="selector"?r.index:r.index[0];if(r.mode==="time"){var t=[s.slice(),h.slice()];var i=r.index.map((function(e,i){return t[i][e]}));r.index=i.map((function(e){return parseInt(e)}));e=i.join(":")}if(r.mode==="date"){var n=r.pickerDate,a=n._start,o=n._end,u=n._updateValue;var l=u[0];var c=u[1];var d=m(a.getFullYear(),o.getFullYear());var f=y(a,o,l);var p=_(a,o,l,c);var v=d[r.index[0]];var g=f[r.index[1]];var C=p[r.index[2]];if(r.fields==="year"){e=[v]}else if(r.fields==="month"){e=[v,g]}else{e=[v,g,C]}e=e.map((function(e){return e<10?"0".concat(e):e})).join("-")}r.value=e;r.pickerValue=r.value;r.onChange.emit({value:e})};this.handleColumnChange=function(e){var t=e.detail,i=t.columnId,n=t.height;r.onColumnChange.emit({column:Number(i),value:(k-n)/w})};this.handleCancel=function(){r.hidePicker();r.onCancel.emit()};this.updateHeight=function(e,t,i){if(i===void 0){i=false}var n=__spreadArray([],r.height,true);n[t]=e;r.height=n;if(i){var a=r,o=a.start,u=a.end;if(!c(o))o="00:00";if(!c(u))u="23:59";if(!d(o,u))return;var l=[s.slice(),h.slice()];var f=r.height.map((function(e){return(k-e)/w}));var p=f.map((function(e,t){return l[t][e]})).join(":");if(!d(o,p)){var v=o.split(":").map((function(e){return k-w*(+e+4)}));requestAnimationFrame((function(){return r.height=v}))}else if(!d(p,u)){var g=u.split(":").map((function(e){return k-w*(+e+4)}));requestAnimationFrame((function(){return r.height=g}))}}};this.updateDay=function(e,t){var i=r.pickerDate,n=i._start,a=i._end,o=i._updateValue;o[t]=e;var u=o[0];var s=o[1];var h=o[2];if(t===0){var l=y(n,a,u);var c=l[l.length-1];var d=l[0];if(s>c)o[1]=c;if(s<d)o[1]=d;var f=l.indexOf(o[1]);var p=k-w*f;r.updateDay(o[1],1);r.updateHeight(p,"1")}else if(t===1){var v=_(n,a,u,s);var c=v[v.length-1];var d=v[0];if(h>c)o[2]=c;if(h<d)o[2]=d;var f=v.indexOf(o[2]);var p=k-w*f;r.updateDay(o[2],2);r.updateHeight(p,"2")}};this.getSelector=function(){return n("taro-picker-group",{range:r.range,rangeKey:r.rangeKey,height:r.height[0],updateHeight:r.updateHeight,columnId:"0"})};this.getMultiSelector=function(){return r.range.map((function(e,t){return n("taro-picker-group",{range:e,rangeKey:r.rangeKey,height:r.height[t],updateHeight:r.updateHeight,onColumnChange:r.handleColumnChange,columnId:String(t)})}))};this.getTimeSelector=function(){var e=s.slice();var t=h.slice();return[n("taro-picker-group",{mode:"time",range:e,height:r.height[0],updateHeight:r.updateHeight,columnId:"0"}),n("taro-picker-group",{mode:"time",range:t,height:r.height[1],updateHeight:r.updateHeight,columnId:"1"})]};this.getDateSelector=function(){var e=r,t=e.fields,i=e.height;var a=r.pickerDate,o=a._start,u=a._end,s=a._updateValue;var h=s[0];var l=s[1];var c=m(o.getFullYear(),u.getFullYear()).map((function(e){return"".concat(e,"年")}));var d=y(o,u,h).map((function(e){return"".concat(e<10?"0".concat(e):e,"月")}));var f=_(o,u,h,l).map((function(e){return"".concat(e<10?"0".concat(e):e,"日")}));var p=[n("taro-picker-group",{mode:"date",range:c,height:i[0],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"0"})];if(t==="month"||t==="day"){p.push(n("taro-picker-group",{mode:"date",range:d,height:i[1],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"1"}))}if(t==="day"){p.push(n("taro-picker-group",{mode:"date",range:f,height:i[2],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"2"}))}return p};this.mode="selector";this.disabled=false;this.range=[];this.rangeKey=undefined;this.value=undefined;this.start="";this.end="";this.fields="day";this.name="";this.textProps={};this.pickerValue=[];this.height=[];this.hidden=true;this.fadeOut=false;this.isWillLoadCalled=false}e.prototype.componentWillLoad=function(){this.isWillLoadCalled=true;this.handleProps()};e.prototype.componentDidLoad=function(){if(this.overlay){document.body.appendChild(this.overlay)}};e.prototype.disconnectedCallback=function(){var e;if(this.overlay){(e=this.overlay.parentNode)===null||e===void 0?void 0:e.removeChild(this.overlay)}};e.prototype.onPropsChange=function(){if(!this.isWillLoadCalled)return;this.handleProps()};e.prototype.handleProps=function(){var e=this;var t=this,i=t.mode,n=t.start,r=t.end;if(i==="selector"){var a=this.value;this.index=[l(a,this.range)?Math.floor(a):0]}else if(i==="multiSelector"){var o=this.value;this.index=[];this.range.forEach((function(t,i){var n=o===null||o===void 0?void 0:o[i];var r=l(n,t)?Math.floor(n):0;e.index.push(r)}))}else if(i==="time"){var a=this.value;if(!c(a)){console.warn("time picker value illegal");a="0:0"}var u=a.split(":").map((function(e){return+e}));this.index=u}else if(i==="date"){var a=this.value;var s=f(a)||new Date((new Date).setHours(0,0,0,0));var h=f(n)||new Date("1970/01/01");var d=f(r)||new Date("2999/01/01");if(!(h<=d)){throw new Error("Picker start time must be less than end time.")}if(!(s>=h&&s<=d)){s=h}var p=s.getFullYear();var v=s.getMonth()+1;var g=s.getDate();var k=m(h.getFullYear(),d.getFullYear());var w=y(h,d,p);var C=_(h,d,p,v);this.index=[k.indexOf(p),w.indexOf(v),C.indexOf(g)];if(!this.pickerDate||this.pickerDate._value.getTime()!==s.getTime()||this.pickerDate._start.getTime()!==h.getTime()||this.pickerDate._end.getTime()!==d.getTime()){this.pickerDate={_value:s,_start:h,_end:d,_updateValue:[p,v,g]}}}else{throw new Error('Picker not support "'.concat(i,'" mode.'))}this.height=this.getHeightByIndex();this.pickerValue=this.value;if(i==="date"){var x=this.pickerValue;if(this.fields==="month"){this.pickerValue=x.split("-").slice(0,2).join("-")}else if(this.fields==="year"){this.pickerValue=x.split("-")[0]}}};e.prototype.render=function(){var e=this;var t,i;var a=this,u=a.name,s=a.mode,h=a.fadeOut,l=a.hidden;var c;switch(s){case"multiSelector":c=this.getMultiSelector();break;case"time":c=this.getTimeSelector();break;case"date":c=this.getDateSelector();break;default:c=this.getSelector()}var d=o("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":h});var f=o("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":h});var p=l?{display:"none"}:{};return n(r,null,n("div",{onClick:this.showPicker},n("slot",null),n("input",{type:"hidden",name:u,value:v(this.pickerValue)})),n("div",{class:"weui-picker__overlay",style:p,ref:function(t){e.overlay=t}},n("div",{class:d,onClick:this.handleCancel}),n("div",{class:f},n("div",{class:"weui-picker__hd"},n("div",{class:"weui-picker__action",onClick:this.handleCancel},(t=this.textProps.cancelText)!==null&&t!==void 0?t:"取消"),n("div",{class:"weui-picker__action",onClick:this.handleChange},(i=this.textProps.okText)!==null&&i!==void 0?i:"确定")),n("div",{class:"weui-picker__bd"},c),n("input",{type:"hidden",name:u,value:v(this.pickerValue)}))))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}},enumerable:false,configurable:true});return e}());M.style=x;var b=e("taro_picker_group",function(){function e(e){t(this,e);this.onColumnChange=i(this,"columnChange",7);this.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.updateDay=undefined;this.startY=undefined;this.preY=undefined;this.hadMove=undefined;this.touchEnd=undefined;this.isMove=undefined}e.prototype.getPosition=function(){var e=this.touchEnd?.3:0;var t="translate3d(0, ".concat(this.height,"px, 0)");var i="transform ".concat(e,"s");return{transform:t,"-webkit-transform":t,transition:i,"-webkit-transition":i}};e.prototype.formulaUnlimitedScroll=function(e,t,i){var n=this;var r=this,a=r.height,o=r.updateHeight,u=r.columnId;var s=i==="up"?1:-1;this.touchEnd=false;o(-e*s*w+a,u);requestAnimationFrame((function(){n.touchEnd=true;var i=Math.round(t/-w)+e*s;var r=k-w*i;o(r,u,true)}))};e.prototype.handleMoveStart=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.startY=e;this.preY=e;this.hadMove=false;return[2]}))}))};e.prototype.handleMoving=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n;return __generator(this,(function(r){t=e;i=t-this.preY;this.preY=t;this.touchEnd=false;if(Math.abs(t-this.startY)>10)this.hadMove=true;n=this.height+i;if(this.mode==="time"){if(this.columnId==="0"){if(n>k-w*3){n=k-w*27+i}if(n<k-w*28){n=k-w*4+i}}else if(this.columnId==="1"){if(n>k-w*3){n=k-w*63+i}if(n<k-w*64){n=k-w*4+i}}}this.updateHeight(n,this.columnId);return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,a,o,u,s,h,l,c,d,f,p;return __generator(this,(function(v){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.columnId;u=0;s=-w*(n.length-1);h=e;this.touchEnd=true;if(!this.hadMove){c=window.innerHeight;d=c-C/2;l=r-k-(h-d);if(i==="time"){if(o==="0"){if(l>-w*2.5){return[2,this.formulaUnlimitedScroll(24,l,"up")]}if(l<-w*28.5){return[2,this.formulaUnlimitedScroll(24,l,"down")]}}else if(o==="1"){if(l>-w*2.5){return[2,this.formulaUnlimitedScroll(60,l,"up")]}if(l<-w*64.5){return[2,this.formulaUnlimitedScroll(60,l,"down")]}}}}else{l=r-k}if(l>u)l=0;if(l<s)l=s;f=Math.round(l/-w);p=k-w*f;if(this.mode==="date"&&typeof this.updateDay==="function"){if(this.columnId==="0"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),2)}}a(p,o,i==="time");this.onColumnChange.emit({columnId:o,height:p});return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){if(!this.isMove)return;this.handleMoving(e.clientY)};e.prototype.onMouseMoveEnd=function(e){if(!this.isMove)return;this.isMove=false;this.handleMoveEnd(e.clientY)};e.prototype.onTouchStart=function(e){this.handleMoveStart(e.changedTouches[0].clientY)};e.prototype.onTouchMove=function(e){this.handleMoving(e.changedTouches[0].clientY)};e.prototype.onTouchEnd=function(e){this.handleMoveEnd(e.changedTouches[0].clientY)};e.prototype.render=function(){var e=this,t=e.range,i=e.rangeKey;var a=t.map((function(e){var t=i?e[i]:e;return n("div",{class:"weui-picker__item"},t)}));return n(r,{class:"weui-picker__group"},n("div",{class:"weui-picker__mask"}),n("div",{class:"weui-picker__indicator"}),n("div",{class:"weui-picker__content",style:this.getPosition()},a))};return e}())}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as h}from"./p-9137dcab.js";import{c as n}from"./p-de951a46.js";function o(t,i){const s=[];for(let e=t;e<=i;e++)s.push(`${e<10?"0":""}${e}`);return s}const r=["20","21","22","23",...o(0,23),"00","01","02","03"],a=["56","57","58","59",...o(0,59),"00","01","02","03"];function c(t,i){return!isNaN(+t)&&t>=0&&t<i.length}function u(t){if(!/^\d{1,2}:\d{1,2}$/.test(t))return!1;const i=t.split(":").map((t=>+t));return!(i[0]<0||i[0]>23||i[1]<0||i[1]>59)}function d(t,i){const s=t.split(":").map((t=>+t)),e=i.split(":").map((t=>+t));return s[0]<e[0]||s[0]===e[0]&&s[1]<=e[1]}function l(t){if(!t)return!1;const i=new Date(t.replace(/-/g,"/"));return!isNaN(i.getMonth())&&i}function p(t){let i;return i=Array.isArray(t)?t.map((t=>String(t))):t,i}function m(t,i){const s=[];for(let e=t;e<=i;e++)s.push(e);return s}function g(t,i){return m(t,i)}function f(t,i,s){let e=1,h=12;return t.getFullYear()===s&&(e=t.getMonth()+1),i.getFullYear()===s&&(h=i.getMonth()+1),m(e,h)}function v(t,i,s,e){let h=1,n=function(t,i){return 4===i||6===i||9===i||11===i?30:2===i?t%4==0&&t%100!=0||t%400==0?29:28:31}(s,e);return t.getFullYear()===s&&t.getMonth()+1===e&&(h=t.getDate()),i.getFullYear()===s&&i.getMonth()+1===e&&(n=i.getDate()),m(h,n)}const _=102,k=34,w=class{constructor(e){t(this,e),this.onChange=i(this,"change",7),this.onColumnChange=i(this,"columnchange",7),this.onCancel=i(this,"cancel",7),this.index=[],this.showPicker=()=>{this.disabled||(this.height=this.getHeightByIndex(),this.hidden=!1)},this.getHeightByIndex=()=>this.index.map((t=>{let i=0;return"time"===this.mode&&(i=136),_-k*t-i})),this.hidePicker=()=>{this.fadeOut=!0,setTimeout((()=>{this.hidden=!0,this.fadeOut=!1}),350)},this.handleChange=()=>{this.hidePicker(),this.index=this.height.map((t=>(_-t)/k));let t=this.index.length&&"selector"!==this.mode?this.index:this.index[0];if("time"===this.mode){const i=[r.slice(),a.slice()],s=this.index.map(((t,s)=>i[s][t]));this.index=s.map((t=>parseInt(t))),t=s.join(":")}if("date"===this.mode){const{_start:i,_end:s,_updateValue:e}=this.pickerDate,h=e[0],n=e[1],o=g(i.getFullYear(),s.getFullYear()),r=f(i,s,h),a=v(i,s,h,n),c=o[this.index[0]],u=r[this.index[1]];t="year"===this.fields?[c]:"month"===this.fields?[c,u]:[c,u,a[this.index[2]]],t=t.map((t=>t<10?`0${t}`:t)).join("-")}this.value=t,this.pickerValue=this.value,this.onChange.emit({value:t})},this.handleColumnChange=t=>{const{columnId:i,height:s}=t.detail;this.onColumnChange.emit({column:Number(i),value:(_-s)/k})},this.handleCancel=()=>{this.hidePicker(),this.onCancel.emit()},this.updateHeight=(t,i,s=!1)=>{const e=[...this.height];if(e[i]=t,this.height=e,s){let{start:t,end:i}=this;if(u(t)||(t="00:00"),u(i)||(i="23:59"),!d(t,i))return;const s=[r.slice(),a.slice()],e=this.height.map((t=>(_-t)/k)),h=e.map(((t,i)=>s[i][t])).join(":");if(d(t,h)){if(!d(h,i)){const t=i.split(":").map((t=>_-k*(+t+4)));requestAnimationFrame((()=>this.height=t))}}else{const i=t.split(":").map((t=>_-k*(+t+4)));requestAnimationFrame((()=>this.height=i))}}},this.updateDay=(t,i)=>{const{_start:s,_end:e,_updateValue:h}=this.pickerDate;h[i]=t;const n=h[0],o=h[1],r=h[2];if(0===i){const t=f(s,e,n),i=t[t.length-1],r=t[0];o>i&&(h[1]=i),o<r&&(h[1]=r);const a=t.indexOf(h[1]),c=_-k*a;this.updateDay(h[1],1),this.updateHeight(c,"1")}else if(1===i){const t=v(s,e,n,o),i=t[t.length-1],a=t[0];r>i&&(h[2]=i),r<a&&(h[2]=a);const c=t.indexOf(h[2]),u=_-k*c;this.updateDay(h[2],2),this.updateHeight(u,"2")}},this.getSelector=()=>s("taro-picker-group",{range:this.range,rangeKey:this.rangeKey,height:this.height[0],updateHeight:this.updateHeight,columnId:"0"}),this.getMultiSelector=()=>this.range.map(((t,i)=>s("taro-picker-group",{range:t,rangeKey:this.rangeKey,height:this.height[i],updateHeight:this.updateHeight,onColumnChange:this.handleColumnChange,columnId:String(i)}))),this.getTimeSelector=()=>{const t=r.slice(),i=a.slice();return[s("taro-picker-group",{mode:"time",range:t,height:this.height[0],updateHeight:this.updateHeight,columnId:"0"}),s("taro-picker-group",{mode:"time",range:i,height:this.height[1],updateHeight:this.updateHeight,columnId:"1"})]},this.getDateSelector=()=>{const{fields:t,height:i}=this,{_start:e,_end:h,_updateValue:n}=this.pickerDate,o=n[0],r=n[1],a=g(e.getFullYear(),h.getFullYear()).map((t=>`${t}年`)),c=f(e,h,o).map((t=>`${t<10?`0${t}`:t}月`)),u=v(e,h,o,r).map((t=>`${t<10?`0${t}`:t}日`)),d=[s("taro-picker-group",{mode:"date",range:a,height:i[0],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"0"})];return"month"!==t&&"day"!==t||d.push(s("taro-picker-group",{mode:"date",range:c,height:i[1],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"1"})),"day"===t&&d.push(s("taro-picker-group",{mode:"date",range:u,height:i[2],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"2"})),d},this.mode="selector",this.disabled=!1,this.range=[],this.rangeKey=void 0,this.value=void 0,this.start="",this.end="",this.fields="day",this.name="",this.textProps={},this.pickerValue=[],this.height=[],this.hidden=!0,this.fadeOut=!1,this.isWillLoadCalled=!1}componentWillLoad(){this.isWillLoadCalled=!0,this.handleProps()}componentDidLoad(){this.overlay&&document.body.appendChild(this.overlay)}disconnectedCallback(){var t;this.overlay&&(null===(t=this.overlay.parentNode)||void 0===t||t.removeChild(this.overlay))}onPropsChange(){this.isWillLoadCalled&&this.handleProps()}handleProps(){const{mode:t,start:i,end:s}=this;if("selector"===t){const t=this.value;this.index=[c(t,this.range)?Math.floor(t):0]}else if("multiSelector"===t){const t=this.value;this.index=[],this.range.forEach(((i,s)=>{const e=null==t?void 0:t[s],h=c(e,i)?Math.floor(e):0;this.index.push(h)}))}else if("time"===t){let t=this.value;u(t)||(console.warn("time picker value illegal"),t="0:0");const i=t.split(":").map((t=>+t));this.index=i}else{if("date"!==t)throw new Error(`Picker not support "${t}" mode.`);{let t=l(this.value)||new Date((new Date).setHours(0,0,0,0));const e=l(i)||new Date("1970/01/01"),h=l(s)||new Date("2999/01/01");if(!(e<=h))throw new Error("Picker start time must be less than end time.");t>=e&&t<=h||(t=e);const n=t.getFullYear(),o=t.getMonth()+1,r=t.getDate(),a=g(e.getFullYear(),h.getFullYear()),c=f(e,h,n),u=v(e,h,n,o);this.index=[a.indexOf(n),c.indexOf(o),u.indexOf(r)],this.pickerDate&&this.pickerDate._value.getTime()===t.getTime()&&this.pickerDate._start.getTime()===e.getTime()&&this.pickerDate._end.getTime()===h.getTime()||(this.pickerDate={_value:t,_start:e,_end:h,_updateValue:[n,o,r]})}}if(this.height=this.getHeightByIndex(),this.pickerValue=this.value,"date"===t){const t=this.pickerValue;"month"===this.fields?this.pickerValue=t.split("-").slice(0,2).join("-"):"year"===this.fields&&(this.pickerValue=t.split("-")[0])}}render(){var t,i;const{name:h,mode:o,fadeOut:r,hidden:a}=this;let c;switch(o){case"multiSelector":c=this.getMultiSelector();break;case"time":c=this.getTimeSelector();break;case"date":c=this.getDateSelector();break;default:c=this.getSelector()}const u=n("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":r}),d=n("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":r}),l=a?{display:"none"}:{};return s(e,null,s("div",{onClick:this.showPicker},s("slot",null),s("input",{type:"hidden",name:h,value:p(this.pickerValue)})),s("div",{class:"weui-picker__overlay",style:l,ref:t=>{this.overlay=t}},s("div",{class:u,onClick:this.handleCancel}),s("div",{class:d},s("div",{class:"weui-picker__hd"},s("div",{class:"weui-picker__action",onClick:this.handleCancel},null!==(t=this.textProps.cancelText)&&void 0!==t?t:"取消"),s("div",{class:"weui-picker__action",onClick:this.handleChange},null!==(i=this.textProps.okText)&&void 0!==i?i:"确定")),s("div",{class:"weui-picker__bd"},c),s("input",{type:"hidden",name:h,value:p(this.pickerValue)}))))}get el(){return h(this)}static get watchers(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}}};w.style=".weui-picker,.weui-picker__hd{font-size:12px}";const y=class{constructor(s){t(this,s),this.onColumnChange=i(this,"columnChange",7),this.mode=void 0,this.range=[],this.rangeKey=void 0,this.height=void 0,this.columnId=void 0,this.updateHeight=void 0,this.updateDay=void 0,this.startY=void 0,this.preY=void 0,this.hadMove=void 0,this.touchEnd=void 0,this.isMove=void 0}getPosition(){const t=`translate3d(0, ${this.height}px, 0)`,i=`transform ${this.touchEnd?.3:0}s`;return{transform:t,"-webkit-transform":t,transition:i,"-webkit-transition":i}}formulaUnlimitedScroll(t,i,s){const{height:e,updateHeight:h,columnId:n}=this,o="up"===s?1:-1;this.touchEnd=!1,h(-t*o*k+e,n),requestAnimationFrame((()=>{this.touchEnd=!0;const s=Math.round(i/-34)+t*o;h(_-k*s,n,!0)}))}async handleMoveStart(t){this.startY=t,this.preY=t,this.hadMove=!1}async handleMoving(t){const i=t,s=i-this.preY;this.preY=i,this.touchEnd=!1,Math.abs(i-this.startY)>10&&(this.hadMove=!0);let e=this.height+s;"time"===this.mode&&("0"===this.columnId?(e>0&&(e=-816+s),e<-850&&(e=-34+s)):"1"===this.columnId&&(e>0&&(e=-2040+s),e<-2074&&(e=-34+s))),this.updateHeight(e,this.columnId)}async handleMoveEnd(t){const{mode:i,range:s,height:e,updateHeight:h,columnId:n}=this,o=-34*(s.length-1),r=t;let a;if(this.touchEnd=!0,this.hadMove)a=e-_;else{const t=window.innerHeight;if(a=e-_-(r-(t-119)),"time"===i)if("0"===n){if(a>-85)return this.formulaUnlimitedScroll(24,a,"up");if(a<-969)return this.formulaUnlimitedScroll(24,a,"down")}else if("1"===n){if(a>-85)return this.formulaUnlimitedScroll(60,a,"up");if(a<-2193)return this.formulaUnlimitedScroll(60,a,"down")}}a>0&&(a=0),a<o&&(a=o);const c=Math.round(a/-34),u=_-k*c;"date"===this.mode&&"function"==typeof this.updateDay&&("0"===this.columnId&&this.updateDay(+this.range[c].replace(/[^0-9]/gi,""),0),"1"===this.columnId&&this.updateDay(+this.range[c].replace(/[^0-9]/gi,""),1),"2"===this.columnId&&this.updateDay(+this.range[c].replace(/[^0-9]/gi,""),2)),h(u,n,"time"===i),this.onColumnChange.emit({columnId:n,height:u})}onMouseDown(t){this.isMove=!0,this.handleMoveStart(t.clientY)}onMouseMove(t){this.isMove&&this.handleMoving(t.clientY)}onMouseMoveEnd(t){this.isMove&&(this.isMove=!1,this.handleMoveEnd(t.clientY))}onTouchStart(t){this.handleMoveStart(t.changedTouches[0].clientY)}onTouchMove(t){this.handleMoving(t.changedTouches[0].clientY)}onTouchEnd(t){this.handleMoveEnd(t.changedTouches[0].clientY)}render(){const{range:t,rangeKey:i}=this,h=t.map((t=>s("div",{class:"weui-picker__item"},i?t[i]:t)));return s(e,{class:"weui-picker__group"},s("div",{class:"weui-picker__mask"}),s("div",{class:"weui-picker__indicator"}),s("div",{class:"weui-picker__content",style:this.getPosition()},h))}};export{w as taro_picker_core,y as taro_picker_group}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-7e6b54cb.system.js"],(function(e,o){"use strict";var t,r;return{setters:[function(o){t=o.p;r=o.b;e("setNonce",o.s)}],execute:function(){var e=function(){var e=o.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return t(r)};e().then((function(e){return r(JSON.parse('[["p-2a071adf.system",[[4,"taro-checkbox-core",{"name":[1],"value":[1032],"color":[1],"id":[1025],"checked":[4],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-checkbox-group-core",{"name":[8]},[[0,"checkboxchange","function"]]]]],["p-e67755f0.system",[[0,"taro-movable-area-core",{"scaleArea":[4,"scale-area"]}],[0,"taro-movable-view-core",{"x":[8],"y":[8],"direction":[1],"outOfBounds":[4,"out-of-bounds"],"inertia":[4],"friction":[2],"damping":[2],"disabled":[4],"scale":[4],"scaleMin":[2,"scale-min"],"scaleMax":[2,"scale-max"],"scaleValue":[2,"scale-value"],"animation":[4],"setParent":[64],"endScale":[64],"setScale":[64]}]]],["p-1991cc1a.system",[[0,"taro-picker-view-column-core",{"col":[1],"initialPosition":[1,"initial-position"],"paddingVertical":[2,"padding-vertical"],"isInit":[32],"isMove":[32]},[[1,"scroll","onScroll"],[1,"mouseup","onMouseEnd"],[1,"mouseout","onMouseEnd"],[1,"mouseleave","onMouseEnd"],[1,"touchend","onTouchEnd"]]],[4,"taro-picker-view-core",{"indicatorStyle":[1,"indicator-style"],"indicatorClass":[1,"indicator-class"],"value":[16],"maskStyle":[1,"mask-style"],"maskClass":[1,"mask-class"]},[[0,"onselect","onSelect"],[0,"onselectstart","onSelectStart"],[0,"onselectend","onPickerColEnd"]]]]],["p-0d7a705b.system",[[4,"taro-radio-core",{"name":[1],"value":[1],"id":[1025],"checked":[1540],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-radio-group-core",{"name":[8]},[[0,"radiochange","function"]]]]],["p-85fce63e.system",[[4,"taro-swiper-core",{"indicatorDots":[4,"indicator-dots"],"indicatorColor":[1,"indicator-color"],"indicatorActiveColor":[1,"indicator-active-color"],"autoplay":[4],"current":[2],"interval":[2],"duration":[2],"circular":[4],"vertical":[4],"previousMargin":[1,"previous-margin"],"nextMargin":[1,"next-margin"],"displayMultipleItems":[2,"display-multiple-items"],"full":[4],"zoom":[4],"swiperWrapper":[32],"swiper":[32],"isWillLoadCalled":[32],"observer":[32],"observerFirst":[32],"observerLast":[32]}],[0,"taro-swiper-item-core",{"itemId":[1,"item-id"]}]]],["p-5ebc7010.system",[[0,"taro-ad-core"]]],["p-08b7ecd7.system",[[0,"taro-ad-custom-core"]]],["p-9e03bc7a.system",[[0,"taro-animation-video-core"]]],["p-3004e71a.system",[[0,"taro-animation-view-core"]]],["p-15624788.system",[[0,"taro-ar-camera-core"]]],["p-473afc8e.system",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["p-7726b789.system",[[0,"taro-aweme-data-core"]]],["p-357ba712.system",[[0,"taro-block-core"]]],["p-dab28e1f.system",[[4,"taro-button-core",{"disabled":[4],"hoverClass":[1,"hover-class"],"type":[1],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"size":[1],"plain":[4],"loading":[4],"formType":[513,"form-type"],"hover":[32],"touch":[32]},[[0,"click","onClick"],[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-e2cd5dd3.system",[[0,"taro-camera-core"]]],["p-5e91398a.system",[[0,"taro-canvas-core",{"canvasId":[1,"id"],"height":[1537],"width":[1537],"nativeProps":[16]}]]],["p-5870248f.system",[[0,"taro-channel-live-core"]]],["p-c913b635.system",[[0,"taro-channel-video-core"]]],["p-de96861c.system",[[0,"taro-comment-detail-core"]]],["p-b07cd197.system",[[0,"taro-comment-list-core"]]],["p-d867e333.system",[[0,"taro-contact-button-core"]]],["p-7e8e355b.system",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-b1d2b575.system",[[4,"taro-cover-view-core",{"animation":[1],"hoverClass":[1,"hover-class"],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"hover":[32],"touch":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-f420680c.system",[[0,"taro-custom-wrapper-core"]]],["p-1f118969.system",[[0,"taro-editor-core"]]],["p-a7d31b01.system",[[0,"taro-follow-swan-core"]]],["p-fd7ff0f3.system",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-cb406f85.system",[[0,"taro-functional-page-navigator-core"]]],["p-bf0c8449.system",[[0,"taro-grid-view-core"]]],["p-f6f6a996.system",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-d5c8380d.system",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32],"didLoad":[32]}]]],["p-92d04741.system",[[0,"taro-inline-payment-panel-core"]]],["p-01e163f8.system",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-0a250d71.system",[[0,"taro-keyboard-accessory-core"]]],["p-b5b30493.system",[[4,"taro-label-core",{"for":[1]}]]],["p-600e89cc.system",[[0,"taro-lifestyle-core"]]],["p-a74c970c.system",[[0,"taro-like-core"]]],["p-8d990f1c.system",[[0,"taro-list-view-core"]]],["p-a90221ab.system",[[0,"taro-live-player-core"]]],["p-a2141e85.system",[[0,"taro-live-pusher-core"]]],["p-3f3abe55.system",[[0,"taro-login-core"]]],["p-519fbe84.system",[[0,"taro-lottie-core"]]],["p-dc5d65a0.system",[[0,"taro-map-core"]]],["p-36d4407e.system",[[0,"taro-match-media-core"]]],["p-fac4ce6f.system",[[0,"taro-native-slot-core"]]],["p-ce303d12.system",[[0,"taro-navigation-bar-core"]]],["p-085076c5.system",[[0,"taro-navigator-core",{"hoverClass":[1,"hover-class"],"url":[1],"openType":[1,"open-type"],"isHover":[4,"is-hover"],"delta":[2]},[[0,"click","onClick"]]]]],["p-d550aea9.system",[[0,"taro-official-account-core"]]],["p-58cc2e6d.system",[[0,"taro-open-data-core"]]],["p-5994d9f2.system",[[0,"taro-page-container-core"]]],["p-be96eb59.system",[[0,"taro-page-meta-core"]]],["p-e6481671.system",[[0,"taro-progress-core",{"percent":[2],"showInfo":[4,"show-info"],"borderRadius":[8,"border-radius"],"fontSize":[8,"font-size"],"strokeWidth":[8,"stroke-width"],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"active":[4]}]]],["p-60faf73e.system",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-e09451c5.system",[[0,"taro-rich-text-core",{"nodes":[1],"selectable":[1028],"userSelect":[1028,"user-select"],"space":[1]}]]],["p-9d76d7a9.system",[[0,"taro-root-portal-core"]]],["p-ccc64042.system",[[0,"taro-rtc-room-core"]]],["p-ea0d5d4f.system",[[0,"taro-rtc-room-item-core"]]],["p-d35c8257.system",[[4,"taro-scroll-view-core",{"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"upperThreshold":[8,"upper-threshold"],"lowerThreshold":[8,"lower-threshold"],"mpScrollTop":[520,"scroll-top"],"mpScrollLeft":[520,"scroll-left"],"mpScrollIntoView":[513,"scroll-into-view"],"mpScrollIntoViewAlignment":[1,"scroll-into-view-alignment"],"animated":[4,"scroll-with-animation"],"mpScrollToMethod":[64],"mpScrollIntoViewMethod":[64]},[[1,"scroll","handleScroll"],[1,"touchmove","handleTouchMove"]]]]],["p-32e9981a.system",[[0,"taro-share-element-core"]]],["p-117633e9.system",[[0,"taro-slider-core",{"min":[2],"max":[2],"step":[2],"disabled":[4],"value":[1538],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"blockSize":[2,"block-size"],"blockColor":[1,"block-color"],"showValue":[4,"show-value"],"name":[1],"totalWidth":[32],"touching":[32],"ogX":[32],"touchId":[32],"percent":[32],"ogPercent":[32],"isWillLoadCalled":[32]}]]],["p-4cedbe5e.system",[[0,"taro-slot-core"]]],["p-e976c6c9.system",[[0,"taro-snapshot-core"]]],["p-c1a3fecf.system",[[0,"taro-sticky-header-core"]]],["p-6cde54e5.system",[[0,"taro-sticky-section-core"]]],["p-1e739fcb.system",[[0,"taro-switch-core",{"type":[1],"checked":[4],"color":[1],"name":[1],"disabled":[4],"nativeProps":[16],"isChecked":[32],"isWillLoadCalled":[32]}]]],["p-21c07cb3.system",[[0,"taro-tab-item-core"]]],["p-6aa2ac6a.system",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-5756cf00.system",[[0,"taro-tabs-core"]]],["p-9edea30f.system",[[4,"taro-text-core",{"selectable":[1028],"userSelect":[1028,"user-select"],"space":[1025],"numberOfLines":[2,"number-of-lines"]}]]],["p-657cb6e4.system",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-a94e3347.system",[[4,"taro-view-core",{"animation":[1],"hoverClass":[1,"hover-class"],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"hover":[32],"touch":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-1b789738.system",[[0,"taro-voip-room-core"]]],["p-208e438c.system",[[0,"taro-web-view-core",{"src":[1]}]]],["p-c39a46ca.system",[[4,"taro-picker-core",{"mode":[1],"disabled":[4],"range":[16],"rangeKey":[1,"range-key"],"value":[1032],"start":[1],"end":[1],"fields":[1],"name":[1],"textProps":[16],"pickerValue":[32],"height":[32],"hidden":[32],"fadeOut":[32],"isWillLoadCalled":[32]}],[0,"taro-picker-group",{"mode":[1],"range":[16],"rangeKey":[1,"range-key"],"height":[2],"columnId":[1,"column-id"],"updateHeight":[16],"updateDay":[16],"startY":[32],"preY":[32],"hadMove":[32],"touchEnd":[32],"isMove":[32],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[3,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[3,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-7fb57a30.system",[[0,"taro-video-core",{"src":[1],"duration":[2],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"initialTime":[2,"initial-time"],"poster":[1],"objectFit":[1,"object-fit"],"showProgress":[4,"show-progress"],"showFullscreenBtn":[4,"show-fullscreen-btn"],"showPlayBtn":[4,"show-play-btn"],"showCenterPlayBtn":[4,"show-center-play-btn"],"showMuteBtn":[4,"show-mute-btn"],"danmuList":[16],"danmuBtn":[4,"danmu-btn"],"enableDanmu":[4,"enable-danmu"],"enablePlayGesture":[4,"enable-play-gesture"],"enableProgressGesture":[4,"enable-progress-gesture"],"vslideGesture":[4,"vslide-gesture"],"vslideGestureInFullscreen":[4,"vslide-gesture-in-fullscreen"],"nativeProps":[16],"_duration":[32],"_enableDanmu":[32],"isPlaying":[32],"isFirst":[32],"isFullScreen":[32],"fullScreenTimestamp":[32],"isMute":[32],"getHlsObject":[64],"play":[64],"pause":[64],"stop":[64],"seek":[64],"requestFullScreen":[64],"exitFullScreen":[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{"controls":[4],"currentTime":[2,"current-time"],"duration":[2],"isPlaying":[4,"is-playing"],"pauseFunc":[16],"playFunc":[16],"seekFunc":[16],"showPlayBtn":[4,"show-play-btn"],"showProgress":[4,"show-progress"],"setProgressBall":[64],"toggleVisibility":[64],"getIsDraggingProgressBall":[64],"setCurrentTime":[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{"enable":[4],"danmuList":[32],"sendDanmu":[64],"tick":[64]}]]]]'),e)}))}}}));
|
|
1
|
+
System.register(["./p-7e6b54cb.system.js"],(function(e,o){"use strict";var t,r;return{setters:[function(o){t=o.p;r=o.b;e("setNonce",o.s)}],execute:function(){var e=function(){var e=o.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return t(r)};e().then((function(e){return r(JSON.parse('[["p-2a071adf.system",[[4,"taro-checkbox-core",{"name":[1],"value":[1032],"color":[1],"id":[1025],"checked":[4],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-checkbox-group-core",{"name":[8]},[[0,"checkboxchange","function"]]]]],["p-e67755f0.system",[[0,"taro-movable-area-core",{"scaleArea":[4,"scale-area"]}],[0,"taro-movable-view-core",{"x":[8],"y":[8],"direction":[1],"outOfBounds":[4,"out-of-bounds"],"inertia":[4],"friction":[2],"damping":[2],"disabled":[4],"scale":[4],"scaleMin":[2,"scale-min"],"scaleMax":[2,"scale-max"],"scaleValue":[2,"scale-value"],"animation":[4],"setParent":[64],"endScale":[64],"setScale":[64]}]]],["p-1991cc1a.system",[[0,"taro-picker-view-column-core",{"col":[1],"initialPosition":[1,"initial-position"],"paddingVertical":[2,"padding-vertical"],"isInit":[32],"isMove":[32]},[[1,"scroll","onScroll"],[1,"mouseup","onMouseEnd"],[1,"mouseout","onMouseEnd"],[1,"mouseleave","onMouseEnd"],[1,"touchend","onTouchEnd"]]],[4,"taro-picker-view-core",{"indicatorStyle":[1,"indicator-style"],"indicatorClass":[1,"indicator-class"],"value":[16],"maskStyle":[1,"mask-style"],"maskClass":[1,"mask-class"]},[[0,"onselect","onSelect"],[0,"onselectstart","onSelectStart"],[0,"onselectend","onPickerColEnd"]]]]],["p-0d7a705b.system",[[4,"taro-radio-core",{"name":[1],"value":[1],"id":[1025],"checked":[1540],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-radio-group-core",{"name":[8]},[[0,"radiochange","function"]]]]],["p-85fce63e.system",[[4,"taro-swiper-core",{"indicatorDots":[4,"indicator-dots"],"indicatorColor":[1,"indicator-color"],"indicatorActiveColor":[1,"indicator-active-color"],"autoplay":[4],"current":[2],"interval":[2],"duration":[2],"circular":[4],"vertical":[4],"previousMargin":[1,"previous-margin"],"nextMargin":[1,"next-margin"],"displayMultipleItems":[2,"display-multiple-items"],"full":[4],"zoom":[4],"swiperWrapper":[32],"swiper":[32],"isWillLoadCalled":[32],"observer":[32],"observerFirst":[32],"observerLast":[32]}],[0,"taro-swiper-item-core",{"itemId":[1,"item-id"]}]]],["p-5ebc7010.system",[[0,"taro-ad-core"]]],["p-08b7ecd7.system",[[0,"taro-ad-custom-core"]]],["p-9e03bc7a.system",[[0,"taro-animation-video-core"]]],["p-3004e71a.system",[[0,"taro-animation-view-core"]]],["p-15624788.system",[[0,"taro-ar-camera-core"]]],["p-473afc8e.system",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["p-7726b789.system",[[0,"taro-aweme-data-core"]]],["p-357ba712.system",[[0,"taro-block-core"]]],["p-dab28e1f.system",[[4,"taro-button-core",{"disabled":[4],"hoverClass":[1,"hover-class"],"type":[1],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"size":[1],"plain":[4],"loading":[4],"formType":[513,"form-type"],"hover":[32],"touch":[32]},[[0,"click","onClick"],[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-e2cd5dd3.system",[[0,"taro-camera-core"]]],["p-5e91398a.system",[[0,"taro-canvas-core",{"canvasId":[1,"id"],"height":[1537],"width":[1537],"nativeProps":[16]}]]],["p-5870248f.system",[[0,"taro-channel-live-core"]]],["p-c913b635.system",[[0,"taro-channel-video-core"]]],["p-de96861c.system",[[0,"taro-comment-detail-core"]]],["p-b07cd197.system",[[0,"taro-comment-list-core"]]],["p-d867e333.system",[[0,"taro-contact-button-core"]]],["p-7e8e355b.system",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-b1d2b575.system",[[4,"taro-cover-view-core",{"animation":[1],"hoverClass":[1,"hover-class"],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"hover":[32],"touch":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-f420680c.system",[[0,"taro-custom-wrapper-core"]]],["p-1f118969.system",[[0,"taro-editor-core"]]],["p-a7d31b01.system",[[0,"taro-follow-swan-core"]]],["p-fd7ff0f3.system",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-cb406f85.system",[[0,"taro-functional-page-navigator-core"]]],["p-bf0c8449.system",[[0,"taro-grid-view-core"]]],["p-f6f6a996.system",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-d5c8380d.system",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32],"didLoad":[32]}]]],["p-92d04741.system",[[0,"taro-inline-payment-panel-core"]]],["p-01e163f8.system",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-0a250d71.system",[[0,"taro-keyboard-accessory-core"]]],["p-b5b30493.system",[[4,"taro-label-core",{"for":[1]}]]],["p-600e89cc.system",[[0,"taro-lifestyle-core"]]],["p-a74c970c.system",[[0,"taro-like-core"]]],["p-8d990f1c.system",[[0,"taro-list-view-core"]]],["p-a90221ab.system",[[0,"taro-live-player-core"]]],["p-a2141e85.system",[[0,"taro-live-pusher-core"]]],["p-3f3abe55.system",[[0,"taro-login-core"]]],["p-519fbe84.system",[[0,"taro-lottie-core"]]],["p-dc5d65a0.system",[[0,"taro-map-core"]]],["p-36d4407e.system",[[0,"taro-match-media-core"]]],["p-fac4ce6f.system",[[0,"taro-native-slot-core"]]],["p-ce303d12.system",[[0,"taro-navigation-bar-core"]]],["p-085076c5.system",[[0,"taro-navigator-core",{"hoverClass":[1,"hover-class"],"url":[1],"openType":[1,"open-type"],"isHover":[4,"is-hover"],"delta":[2]},[[0,"click","onClick"]]]]],["p-d550aea9.system",[[0,"taro-official-account-core"]]],["p-58cc2e6d.system",[[0,"taro-open-data-core"]]],["p-5994d9f2.system",[[0,"taro-page-container-core"]]],["p-be96eb59.system",[[0,"taro-page-meta-core"]]],["p-e6481671.system",[[0,"taro-progress-core",{"percent":[2],"showInfo":[4,"show-info"],"borderRadius":[8,"border-radius"],"fontSize":[8,"font-size"],"strokeWidth":[8,"stroke-width"],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"active":[4]}]]],["p-60faf73e.system",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-e09451c5.system",[[0,"taro-rich-text-core",{"nodes":[1],"selectable":[1028],"userSelect":[1028,"user-select"],"space":[1]}]]],["p-9d76d7a9.system",[[0,"taro-root-portal-core"]]],["p-ccc64042.system",[[0,"taro-rtc-room-core"]]],["p-ea0d5d4f.system",[[0,"taro-rtc-room-item-core"]]],["p-d35c8257.system",[[4,"taro-scroll-view-core",{"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"upperThreshold":[8,"upper-threshold"],"lowerThreshold":[8,"lower-threshold"],"mpScrollTop":[520,"scroll-top"],"mpScrollLeft":[520,"scroll-left"],"mpScrollIntoView":[513,"scroll-into-view"],"mpScrollIntoViewAlignment":[1,"scroll-into-view-alignment"],"animated":[4,"scroll-with-animation"],"mpScrollToMethod":[64],"mpScrollIntoViewMethod":[64]},[[1,"scroll","handleScroll"],[1,"touchmove","handleTouchMove"]]]]],["p-32e9981a.system",[[0,"taro-share-element-core"]]],["p-117633e9.system",[[0,"taro-slider-core",{"min":[2],"max":[2],"step":[2],"disabled":[4],"value":[1538],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"blockSize":[2,"block-size"],"blockColor":[1,"block-color"],"showValue":[4,"show-value"],"name":[1],"totalWidth":[32],"touching":[32],"ogX":[32],"touchId":[32],"percent":[32],"ogPercent":[32],"isWillLoadCalled":[32]}]]],["p-4cedbe5e.system",[[0,"taro-slot-core"]]],["p-e976c6c9.system",[[0,"taro-snapshot-core"]]],["p-c1a3fecf.system",[[0,"taro-sticky-header-core"]]],["p-6cde54e5.system",[[0,"taro-sticky-section-core"]]],["p-1e739fcb.system",[[0,"taro-switch-core",{"type":[1],"checked":[4],"color":[1],"name":[1],"disabled":[4],"nativeProps":[16],"isChecked":[32],"isWillLoadCalled":[32]}]]],["p-21c07cb3.system",[[0,"taro-tab-item-core"]]],["p-6aa2ac6a.system",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-5756cf00.system",[[0,"taro-tabs-core"]]],["p-9edea30f.system",[[4,"taro-text-core",{"selectable":[1028],"userSelect":[1028,"user-select"],"space":[1025],"numberOfLines":[2,"number-of-lines"]}]]],["p-657cb6e4.system",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-a94e3347.system",[[4,"taro-view-core",{"animation":[1],"hoverClass":[1,"hover-class"],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"hover":[32],"touch":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-1b789738.system",[[0,"taro-voip-room-core"]]],["p-208e438c.system",[[0,"taro-web-view-core",{"src":[1]}]]],["p-0cedad18.system",[[4,"taro-picker-core",{"mode":[1],"disabled":[4],"range":[16],"rangeKey":[1,"range-key"],"value":[1032],"start":[1],"end":[1],"fields":[1],"name":[1],"textProps":[16],"pickerValue":[32],"height":[32],"hidden":[32],"fadeOut":[32],"isWillLoadCalled":[32]}],[0,"taro-picker-group",{"mode":[1],"range":[16],"rangeKey":[1,"range-key"],"height":[2],"columnId":[1,"column-id"],"updateHeight":[16],"updateDay":[16],"startY":[32],"preY":[32],"hadMove":[32],"touchEnd":[32],"isMove":[32],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[3,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[3,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-7fb57a30.system",[[0,"taro-video-core",{"src":[1],"duration":[2],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"initialTime":[2,"initial-time"],"poster":[1],"objectFit":[1,"object-fit"],"showProgress":[4,"show-progress"],"showFullscreenBtn":[4,"show-fullscreen-btn"],"showPlayBtn":[4,"show-play-btn"],"showCenterPlayBtn":[4,"show-center-play-btn"],"showMuteBtn":[4,"show-mute-btn"],"danmuList":[16],"danmuBtn":[4,"danmu-btn"],"enableDanmu":[4,"enable-danmu"],"enablePlayGesture":[4,"enable-play-gesture"],"enableProgressGesture":[4,"enable-progress-gesture"],"vslideGesture":[4,"vslide-gesture"],"vslideGestureInFullscreen":[4,"vslide-gesture-in-fullscreen"],"nativeProps":[16],"_duration":[32],"_enableDanmu":[32],"isPlaying":[32],"isFirst":[32],"isFullScreen":[32],"fullScreenTimestamp":[32],"isMute":[32],"getHlsObject":[64],"play":[64],"pause":[64],"stop":[64],"seek":[64],"requestFullScreen":[64],"exitFullScreen":[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{"controls":[4],"currentTime":[2,"current-time"],"duration":[2],"isPlaying":[4,"is-playing"],"pauseFunc":[16],"playFunc":[16],"seekFunc":[16],"showPlayBtn":[4,"show-play-btn"],"showProgress":[4,"show-progress"],"setProgressBall":[64],"toggleVisibility":[64],"getIsDraggingProgressBall":[64],"setCurrentTime":[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{"enable":[4],"danmuList":[32],"sendDanmu":[64],"tick":[64]}]]]]'),e)}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-9137dcab.js";export{s as setNonce}from"./p-9137dcab.js";(()=>{const o=import.meta.url,r={};return""!==o&&(r.resourcesUrl=new URL(".",o).href),e(r)})().then((e=>o(JSON.parse('[["p-962f28cb",[[4,"taro-checkbox-core",{"name":[1],"value":[1032],"color":[1],"id":[1025],"checked":[4],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-checkbox-group-core",{"name":[8]},[[0,"checkboxchange","function"]]]]],["p-f0340edf",[[0,"taro-movable-area-core",{"scaleArea":[4,"scale-area"]}],[0,"taro-movable-view-core",{"x":[8],"y":[8],"direction":[1],"outOfBounds":[4,"out-of-bounds"],"inertia":[4],"friction":[2],"damping":[2],"disabled":[4],"scale":[4],"scaleMin":[2,"scale-min"],"scaleMax":[2,"scale-max"],"scaleValue":[2,"scale-value"],"animation":[4],"setParent":[64],"endScale":[64],"setScale":[64]}]]],["p-a20ecd3b",[[0,"taro-picker-view-column-core",{"col":[1],"initialPosition":[1,"initial-position"],"paddingVertical":[2,"padding-vertical"],"isInit":[32],"isMove":[32]},[[1,"scroll","onScroll"],[1,"mouseup","onMouseEnd"],[1,"mouseout","onMouseEnd"],[1,"mouseleave","onMouseEnd"],[1,"touchend","onTouchEnd"]]],[4,"taro-picker-view-core",{"indicatorStyle":[1,"indicator-style"],"indicatorClass":[1,"indicator-class"],"value":[16],"maskStyle":[1,"mask-style"],"maskClass":[1,"mask-class"]},[[0,"onselect","onSelect"],[0,"onselectstart","onSelectStart"],[0,"onselectend","onPickerColEnd"]]]]],["p-b641e598",[[4,"taro-radio-core",{"name":[1],"value":[1],"id":[1025],"checked":[1540],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-radio-group-core",{"name":[8]},[[0,"radiochange","function"]]]]],["p-fefedf44",[[4,"taro-swiper-core",{"indicatorDots":[4,"indicator-dots"],"indicatorColor":[1,"indicator-color"],"indicatorActiveColor":[1,"indicator-active-color"],"autoplay":[4],"current":[2],"interval":[2],"duration":[2],"circular":[4],"vertical":[4],"previousMargin":[1,"previous-margin"],"nextMargin":[1,"next-margin"],"displayMultipleItems":[2,"display-multiple-items"],"full":[4],"zoom":[4],"swiperWrapper":[32],"swiper":[32],"isWillLoadCalled":[32],"observer":[32],"observerFirst":[32],"observerLast":[32]}],[0,"taro-swiper-item-core",{"itemId":[1,"item-id"]}]]],["p-a6e2dd48",[[0,"taro-ad-core"]]],["p-d1756770",[[0,"taro-ad-custom-core"]]],["p-f23cfdc8",[[0,"taro-animation-video-core"]]],["p-b201ff38",[[0,"taro-animation-view-core"]]],["p-f78823a1",[[0,"taro-ar-camera-core"]]],["p-bf0e0394",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["p-fbb2446e",[[0,"taro-aweme-data-core"]]],["p-9a5fbb2e",[[0,"taro-block-core"]]],["p-7b68dee8",[[4,"taro-button-core",{"disabled":[4],"hoverClass":[1,"hover-class"],"type":[1],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"size":[1],"plain":[4],"loading":[4],"formType":[513,"form-type"],"hover":[32],"touch":[32]},[[0,"click","onClick"],[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-00ed4bbb",[[0,"taro-camera-core"]]],["p-2da9c8fd",[[0,"taro-canvas-core",{"canvasId":[1,"id"],"height":[1537],"width":[1537],"nativeProps":[16]}]]],["p-862b38b9",[[0,"taro-channel-live-core"]]],["p-f4d86882",[[0,"taro-channel-video-core"]]],["p-da3db323",[[0,"taro-comment-detail-core"]]],["p-bd4ed8b1",[[0,"taro-comment-list-core"]]],["p-ad9b04e0",[[0,"taro-contact-button-core"]]],["p-38ee526a",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-9fe49bab",[[4,"taro-cover-view-core",{"animation":[1],"hoverClass":[1,"hover-class"],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"hover":[32],"touch":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-72b118b0",[[0,"taro-custom-wrapper-core"]]],["p-e598f47b",[[0,"taro-editor-core"]]],["p-29638de3",[[0,"taro-follow-swan-core"]]],["p-43720011",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-64eb91f7",[[0,"taro-functional-page-navigator-core"]]],["p-f658de2e",[[0,"taro-grid-view-core"]]],["p-a20fed0a",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-6b454506",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32],"didLoad":[32]}]]],["p-a2d590ad",[[0,"taro-inline-payment-panel-core"]]],["p-ebc7b6fc",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-e740320c",[[0,"taro-keyboard-accessory-core"]]],["p-f533bc2f",[[4,"taro-label-core",{"for":[1]}]]],["p-a4951dd6",[[0,"taro-lifestyle-core"]]],["p-76996fcb",[[0,"taro-like-core"]]],["p-4fc40739",[[0,"taro-list-view-core"]]],["p-f1304456",[[0,"taro-live-player-core"]]],["p-22bf7daf",[[0,"taro-live-pusher-core"]]],["p-d9dcc6c6",[[0,"taro-login-core"]]],["p-065a10d7",[[0,"taro-lottie-core"]]],["p-8ca82a56",[[0,"taro-map-core"]]],["p-f2c86846",[[0,"taro-match-media-core"]]],["p-d2e0b15c",[[0,"taro-native-slot-core"]]],["p-c0080d83",[[0,"taro-navigation-bar-core"]]],["p-78e4805e",[[0,"taro-navigator-core",{"hoverClass":[1,"hover-class"],"url":[1],"openType":[1,"open-type"],"isHover":[4,"is-hover"],"delta":[2]},[[0,"click","onClick"]]]]],["p-7bfc5f3d",[[0,"taro-official-account-core"]]],["p-ef322936",[[0,"taro-open-data-core"]]],["p-1cf16dfa",[[0,"taro-page-container-core"]]],["p-0e8199b7",[[0,"taro-page-meta-core"]]],["p-a940a65b",[[0,"taro-progress-core",{"percent":[2],"showInfo":[4,"show-info"],"borderRadius":[8,"border-radius"],"fontSize":[8,"font-size"],"strokeWidth":[8,"stroke-width"],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"active":[4]}]]],["p-4f1d180d",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-0fa96970",[[0,"taro-rich-text-core",{"nodes":[1],"selectable":[1028],"userSelect":[1028,"user-select"],"space":[1]}]]],["p-bc541cd8",[[0,"taro-root-portal-core"]]],["p-0e3b37e9",[[0,"taro-rtc-room-core"]]],["p-a5a51112",[[0,"taro-rtc-room-item-core"]]],["p-4a3357a4",[[4,"taro-scroll-view-core",{"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"upperThreshold":[8,"upper-threshold"],"lowerThreshold":[8,"lower-threshold"],"mpScrollTop":[520,"scroll-top"],"mpScrollLeft":[520,"scroll-left"],"mpScrollIntoView":[513,"scroll-into-view"],"mpScrollIntoViewAlignment":[1,"scroll-into-view-alignment"],"animated":[4,"scroll-with-animation"],"mpScrollToMethod":[64],"mpScrollIntoViewMethod":[64]},[[1,"scroll","handleScroll"],[1,"touchmove","handleTouchMove"]]]]],["p-24d9836e",[[0,"taro-share-element-core"]]],["p-a1763153",[[0,"taro-slider-core",{"min":[2],"max":[2],"step":[2],"disabled":[4],"value":[1538],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"blockSize":[2,"block-size"],"blockColor":[1,"block-color"],"showValue":[4,"show-value"],"name":[1],"totalWidth":[32],"touching":[32],"ogX":[32],"touchId":[32],"percent":[32],"ogPercent":[32],"isWillLoadCalled":[32]}]]],["p-0ec2e88a",[[0,"taro-slot-core"]]],["p-9ea4f297",[[0,"taro-snapshot-core"]]],["p-84958ace",[[0,"taro-sticky-header-core"]]],["p-f2235cbb",[[0,"taro-sticky-section-core"]]],["p-0fe855c6",[[0,"taro-switch-core",{"type":[1],"checked":[4],"color":[1],"name":[1],"disabled":[4],"nativeProps":[16],"isChecked":[32],"isWillLoadCalled":[32]}]]],["p-aa04f605",[[0,"taro-tab-item-core"]]],["p-9eeba192",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-124ac21f",[[0,"taro-tabs-core"]]],["p-425c209a",[[4,"taro-text-core",{"selectable":[1028],"userSelect":[1028,"user-select"],"space":[1025],"numberOfLines":[2,"number-of-lines"]}]]],["p-f02b6f70",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-8ccaf5e8",[[4,"taro-view-core",{"animation":[1],"hoverClass":[1,"hover-class"],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"hover":[32],"touch":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-69c43a81",[[0,"taro-voip-room-core"]]],["p-30805bdf",[[0,"taro-web-view-core",{"src":[1]}]]],["p-6cde180b",[[4,"taro-picker-core",{"mode":[1],"disabled":[4],"range":[16],"rangeKey":[1,"range-key"],"value":[1032],"start":[1],"end":[1],"fields":[1],"name":[1],"textProps":[16],"pickerValue":[32],"height":[32],"hidden":[32],"fadeOut":[32],"isWillLoadCalled":[32]}],[0,"taro-picker-group",{"mode":[1],"range":[16],"rangeKey":[1,"range-key"],"height":[2],"columnId":[1,"column-id"],"updateHeight":[16],"updateDay":[16],"startY":[32],"preY":[32],"hadMove":[32],"touchEnd":[32],"isMove":[32],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[3,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[3,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-25632af9",[[0,"taro-video-core",{"src":[1],"duration":[2],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"initialTime":[2,"initial-time"],"poster":[1],"objectFit":[1,"object-fit"],"showProgress":[4,"show-progress"],"showFullscreenBtn":[4,"show-fullscreen-btn"],"showPlayBtn":[4,"show-play-btn"],"showCenterPlayBtn":[4,"show-center-play-btn"],"showMuteBtn":[4,"show-mute-btn"],"danmuList":[16],"danmuBtn":[4,"danmu-btn"],"enableDanmu":[4,"enable-danmu"],"enablePlayGesture":[4,"enable-play-gesture"],"enableProgressGesture":[4,"enable-progress-gesture"],"vslideGesture":[4,"vslide-gesture"],"vslideGestureInFullscreen":[4,"vslide-gesture-in-fullscreen"],"nativeProps":[16],"_duration":[32],"_enableDanmu":[32],"isPlaying":[32],"isFirst":[32],"isFullScreen":[32],"fullScreenTimestamp":[32],"isMute":[32],"getHlsObject":[64],"play":[64],"pause":[64],"stop":[64],"seek":[64],"requestFullScreen":[64],"exitFullScreen":[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{"controls":[4],"currentTime":[2,"current-time"],"duration":[2],"isPlaying":[4,"is-playing"],"pauseFunc":[16],"playFunc":[16],"seekFunc":[16],"showPlayBtn":[4,"show-play-btn"],"showProgress":[4,"show-progress"],"setProgressBall":[64],"toggleVisibility":[64],"getIsDraggingProgressBall":[64],"setCurrentTime":[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{"enable":[4],"danmuList":[32],"sendDanmu":[64],"tick":[64]}]]]]'),e)));
|
|
1
|
+
import{p as e,b as o}from"./p-9137dcab.js";export{s as setNonce}from"./p-9137dcab.js";(()=>{const o=import.meta.url,r={};return""!==o&&(r.resourcesUrl=new URL(".",o).href),e(r)})().then((e=>o(JSON.parse('[["p-962f28cb",[[4,"taro-checkbox-core",{"name":[1],"value":[1032],"color":[1],"id":[1025],"checked":[4],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-checkbox-group-core",{"name":[8]},[[0,"checkboxchange","function"]]]]],["p-f0340edf",[[0,"taro-movable-area-core",{"scaleArea":[4,"scale-area"]}],[0,"taro-movable-view-core",{"x":[8],"y":[8],"direction":[1],"outOfBounds":[4,"out-of-bounds"],"inertia":[4],"friction":[2],"damping":[2],"disabled":[4],"scale":[4],"scaleMin":[2,"scale-min"],"scaleMax":[2,"scale-max"],"scaleValue":[2,"scale-value"],"animation":[4],"setParent":[64],"endScale":[64],"setScale":[64]}]]],["p-a20ecd3b",[[0,"taro-picker-view-column-core",{"col":[1],"initialPosition":[1,"initial-position"],"paddingVertical":[2,"padding-vertical"],"isInit":[32],"isMove":[32]},[[1,"scroll","onScroll"],[1,"mouseup","onMouseEnd"],[1,"mouseout","onMouseEnd"],[1,"mouseleave","onMouseEnd"],[1,"touchend","onTouchEnd"]]],[4,"taro-picker-view-core",{"indicatorStyle":[1,"indicator-style"],"indicatorClass":[1,"indicator-class"],"value":[16],"maskStyle":[1,"mask-style"],"maskClass":[1,"mask-class"]},[[0,"onselect","onSelect"],[0,"onselectstart","onSelectStart"],[0,"onselectend","onPickerColEnd"]]]]],["p-b641e598",[[4,"taro-radio-core",{"name":[1],"value":[1],"id":[1025],"checked":[1540],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-radio-group-core",{"name":[8]},[[0,"radiochange","function"]]]]],["p-fefedf44",[[4,"taro-swiper-core",{"indicatorDots":[4,"indicator-dots"],"indicatorColor":[1,"indicator-color"],"indicatorActiveColor":[1,"indicator-active-color"],"autoplay":[4],"current":[2],"interval":[2],"duration":[2],"circular":[4],"vertical":[4],"previousMargin":[1,"previous-margin"],"nextMargin":[1,"next-margin"],"displayMultipleItems":[2,"display-multiple-items"],"full":[4],"zoom":[4],"swiperWrapper":[32],"swiper":[32],"isWillLoadCalled":[32],"observer":[32],"observerFirst":[32],"observerLast":[32]}],[0,"taro-swiper-item-core",{"itemId":[1,"item-id"]}]]],["p-a6e2dd48",[[0,"taro-ad-core"]]],["p-d1756770",[[0,"taro-ad-custom-core"]]],["p-f23cfdc8",[[0,"taro-animation-video-core"]]],["p-b201ff38",[[0,"taro-animation-view-core"]]],["p-f78823a1",[[0,"taro-ar-camera-core"]]],["p-bf0e0394",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["p-fbb2446e",[[0,"taro-aweme-data-core"]]],["p-9a5fbb2e",[[0,"taro-block-core"]]],["p-7b68dee8",[[4,"taro-button-core",{"disabled":[4],"hoverClass":[1,"hover-class"],"type":[1],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"size":[1],"plain":[4],"loading":[4],"formType":[513,"form-type"],"hover":[32],"touch":[32]},[[0,"click","onClick"],[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-00ed4bbb",[[0,"taro-camera-core"]]],["p-2da9c8fd",[[0,"taro-canvas-core",{"canvasId":[1,"id"],"height":[1537],"width":[1537],"nativeProps":[16]}]]],["p-862b38b9",[[0,"taro-channel-live-core"]]],["p-f4d86882",[[0,"taro-channel-video-core"]]],["p-da3db323",[[0,"taro-comment-detail-core"]]],["p-bd4ed8b1",[[0,"taro-comment-list-core"]]],["p-ad9b04e0",[[0,"taro-contact-button-core"]]],["p-38ee526a",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-9fe49bab",[[4,"taro-cover-view-core",{"animation":[1],"hoverClass":[1,"hover-class"],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"hover":[32],"touch":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-72b118b0",[[0,"taro-custom-wrapper-core"]]],["p-e598f47b",[[0,"taro-editor-core"]]],["p-29638de3",[[0,"taro-follow-swan-core"]]],["p-43720011",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-64eb91f7",[[0,"taro-functional-page-navigator-core"]]],["p-f658de2e",[[0,"taro-grid-view-core"]]],["p-a20fed0a",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-6b454506",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32],"didLoad":[32]}]]],["p-a2d590ad",[[0,"taro-inline-payment-panel-core"]]],["p-ebc7b6fc",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-e740320c",[[0,"taro-keyboard-accessory-core"]]],["p-f533bc2f",[[4,"taro-label-core",{"for":[1]}]]],["p-a4951dd6",[[0,"taro-lifestyle-core"]]],["p-76996fcb",[[0,"taro-like-core"]]],["p-4fc40739",[[0,"taro-list-view-core"]]],["p-f1304456",[[0,"taro-live-player-core"]]],["p-22bf7daf",[[0,"taro-live-pusher-core"]]],["p-d9dcc6c6",[[0,"taro-login-core"]]],["p-065a10d7",[[0,"taro-lottie-core"]]],["p-8ca82a56",[[0,"taro-map-core"]]],["p-f2c86846",[[0,"taro-match-media-core"]]],["p-d2e0b15c",[[0,"taro-native-slot-core"]]],["p-c0080d83",[[0,"taro-navigation-bar-core"]]],["p-78e4805e",[[0,"taro-navigator-core",{"hoverClass":[1,"hover-class"],"url":[1],"openType":[1,"open-type"],"isHover":[4,"is-hover"],"delta":[2]},[[0,"click","onClick"]]]]],["p-7bfc5f3d",[[0,"taro-official-account-core"]]],["p-ef322936",[[0,"taro-open-data-core"]]],["p-1cf16dfa",[[0,"taro-page-container-core"]]],["p-0e8199b7",[[0,"taro-page-meta-core"]]],["p-a940a65b",[[0,"taro-progress-core",{"percent":[2],"showInfo":[4,"show-info"],"borderRadius":[8,"border-radius"],"fontSize":[8,"font-size"],"strokeWidth":[8,"stroke-width"],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"active":[4]}]]],["p-4f1d180d",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-0fa96970",[[0,"taro-rich-text-core",{"nodes":[1],"selectable":[1028],"userSelect":[1028,"user-select"],"space":[1]}]]],["p-bc541cd8",[[0,"taro-root-portal-core"]]],["p-0e3b37e9",[[0,"taro-rtc-room-core"]]],["p-a5a51112",[[0,"taro-rtc-room-item-core"]]],["p-4a3357a4",[[4,"taro-scroll-view-core",{"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"upperThreshold":[8,"upper-threshold"],"lowerThreshold":[8,"lower-threshold"],"mpScrollTop":[520,"scroll-top"],"mpScrollLeft":[520,"scroll-left"],"mpScrollIntoView":[513,"scroll-into-view"],"mpScrollIntoViewAlignment":[1,"scroll-into-view-alignment"],"animated":[4,"scroll-with-animation"],"mpScrollToMethod":[64],"mpScrollIntoViewMethod":[64]},[[1,"scroll","handleScroll"],[1,"touchmove","handleTouchMove"]]]]],["p-24d9836e",[[0,"taro-share-element-core"]]],["p-a1763153",[[0,"taro-slider-core",{"min":[2],"max":[2],"step":[2],"disabled":[4],"value":[1538],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"blockSize":[2,"block-size"],"blockColor":[1,"block-color"],"showValue":[4,"show-value"],"name":[1],"totalWidth":[32],"touching":[32],"ogX":[32],"touchId":[32],"percent":[32],"ogPercent":[32],"isWillLoadCalled":[32]}]]],["p-0ec2e88a",[[0,"taro-slot-core"]]],["p-9ea4f297",[[0,"taro-snapshot-core"]]],["p-84958ace",[[0,"taro-sticky-header-core"]]],["p-f2235cbb",[[0,"taro-sticky-section-core"]]],["p-0fe855c6",[[0,"taro-switch-core",{"type":[1],"checked":[4],"color":[1],"name":[1],"disabled":[4],"nativeProps":[16],"isChecked":[32],"isWillLoadCalled":[32]}]]],["p-aa04f605",[[0,"taro-tab-item-core"]]],["p-9eeba192",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-124ac21f",[[0,"taro-tabs-core"]]],["p-425c209a",[[4,"taro-text-core",{"selectable":[1028],"userSelect":[1028,"user-select"],"space":[1025],"numberOfLines":[2,"number-of-lines"]}]]],["p-f02b6f70",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-8ccaf5e8",[[4,"taro-view-core",{"animation":[1],"hoverClass":[1,"hover-class"],"hoverStartTime":[2,"hover-start-time"],"hoverStayTime":[2,"hover-stay-time"],"hover":[32],"touch":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-69c43a81",[[0,"taro-voip-room-core"]]],["p-30805bdf",[[0,"taro-web-view-core",{"src":[1]}]]],["p-99e16df8",[[4,"taro-picker-core",{"mode":[1],"disabled":[4],"range":[16],"rangeKey":[1,"range-key"],"value":[1032],"start":[1],"end":[1],"fields":[1],"name":[1],"textProps":[16],"pickerValue":[32],"height":[32],"hidden":[32],"fadeOut":[32],"isWillLoadCalled":[32]}],[0,"taro-picker-group",{"mode":[1],"range":[16],"rangeKey":[1,"range-key"],"height":[2],"columnId":[1,"column-id"],"updateHeight":[16],"updateDay":[16],"startY":[32],"preY":[32],"hadMove":[32],"touchEnd":[32],"isMove":[32],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[3,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[3,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-25632af9",[[0,"taro-video-core",{"src":[1],"duration":[2],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"initialTime":[2,"initial-time"],"poster":[1],"objectFit":[1,"object-fit"],"showProgress":[4,"show-progress"],"showFullscreenBtn":[4,"show-fullscreen-btn"],"showPlayBtn":[4,"show-play-btn"],"showCenterPlayBtn":[4,"show-center-play-btn"],"showMuteBtn":[4,"show-mute-btn"],"danmuList":[16],"danmuBtn":[4,"danmu-btn"],"enableDanmu":[4,"enable-danmu"],"enablePlayGesture":[4,"enable-play-gesture"],"enableProgressGesture":[4,"enable-progress-gesture"],"vslideGesture":[4,"vslide-gesture"],"vslideGestureInFullscreen":[4,"vslide-gesture-in-fullscreen"],"nativeProps":[16],"_duration":[32],"_enableDanmu":[32],"isPlaying":[32],"isFirst":[32],"isFullScreen":[32],"fullScreenTimestamp":[32],"isMute":[32],"getHlsObject":[64],"play":[64],"pause":[64],"stop":[64],"seek":[64],"requestFullScreen":[64],"exitFullScreen":[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{"controls":[4],"currentTime":[2,"current-time"],"duration":[2],"isPlaying":[4,"is-playing"],"pauseFunc":[16],"playFunc":[16],"seekFunc":[16],"showPlayBtn":[4,"show-play-btn"],"showProgress":[4,"show-progress"],"setProgressBall":[64],"toggleVisibility":[64],"getIsDraggingProgressBall":[64],"setCurrentTime":[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{"enable":[4],"danmuList":[32],"sendDanmu":[64],"tick":[64]}]]]]'),e)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/components",
|
|
3
|
-
"version": "3.7.0-alpha.
|
|
3
|
+
"version": "3.7.0-alpha.23",
|
|
4
4
|
"description": "Taro 组件库",
|
|
5
5
|
"browser": "dist/index.js",
|
|
6
6
|
"main:h5": "dist/index.js",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"resolve-pathname": "^3.0.0",
|
|
38
38
|
"swiper": "6.8.0",
|
|
39
39
|
"weui": "^1.1.2",
|
|
40
|
-
"@tarojs/components-advanced": "3.7.0-alpha.
|
|
41
|
-
"@tarojs/
|
|
42
|
-
"@tarojs/
|
|
40
|
+
"@tarojs/components-advanced": "3.7.0-alpha.23",
|
|
41
|
+
"@tarojs/taro": "3.7.0-alpha.23",
|
|
42
|
+
"@tarojs/router": "3.7.0-alpha.23"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@babel/generator": "^7.20.0",
|
package/types/Video.d.ts
CHANGED
|
@@ -236,7 +236,7 @@ interface VideoProps extends StandardProps {
|
|
|
236
236
|
*
|
|
237
237
|
* @supported alipay, jd
|
|
238
238
|
*/
|
|
239
|
-
mobilenetHintType?:
|
|
239
|
+
mobilenetHintType?: number
|
|
240
240
|
/** 浮窗设置。暂时不支持全局浮窗。
|
|
241
241
|
* 可选值:
|
|
242
242
|
*
|
|
@@ -315,7 +315,7 @@ interface VideoProps extends StandardProps {
|
|
|
315
315
|
onTimeUpdate?: CommonEventFunction<VideoProps.onTimeUpdateEventDetail>
|
|
316
316
|
/** 当视频进入和退出全屏时触发
|
|
317
317
|
*
|
|
318
|
-
* @supported h5, rn
|
|
318
|
+
* @supported h5, rn, alipay
|
|
319
319
|
*/
|
|
320
320
|
onFullscreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
|
|
321
321
|
/** 视频出现缓冲时触发
|
|
@@ -488,6 +488,14 @@ declare namespace VideoProps {
|
|
|
488
488
|
currentTime: number
|
|
489
489
|
/** 持续时间 */
|
|
490
490
|
duration: number
|
|
491
|
+
/** 用户实际观看时长
|
|
492
|
+
* @supported alipay
|
|
493
|
+
*/
|
|
494
|
+
userPlayDuration: number
|
|
495
|
+
/** 视频总时长
|
|
496
|
+
* @supported alipay
|
|
497
|
+
*/
|
|
498
|
+
videoDuration: number
|
|
491
499
|
}
|
|
492
500
|
interface onFullscreenChangeEventDetail {
|
|
493
501
|
/** 方向 */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as h}from"./p-9137dcab.js";import{c as n}from"./p-de951a46.js";function o(t,i){const s=[];for(let e=t;e<=i;e++)s.push(`${e<10?"0":""}${e}`);return s}const r=["20","21","22","23",...o(0,23),"00","01","02","03"],a=["56","57","58","59",...o(0,59),"00","01","02","03"];function c(t,i){return!isNaN(+t)&&t>=0&&t<i.length}function u(t){if(!/^\d{1,2}:\d{1,2}$/.test(t))return!1;const i=t.split(":").map((t=>+t));return!(i[0]<0||i[0]>23||i[1]<0||i[1]>59)}function d(t,i){const s=t.split(":").map((t=>+t)),e=i.split(":").map((t=>+t));return s[0]<e[0]||s[0]===e[0]&&s[1]<=e[1]}function l(t){if(!t)return!1;const i=new Date(t.replace(/-/g,"/"));return!isNaN(i.getMonth())&&i}function p(t){let i;return i=Array.isArray(t)?t.map((t=>String(t))):t,i}function m(t,i){const s=[];for(let e=t;e<=i;e++)s.push(e);return s}function g(t,i){return m(t,i)}function f(t,i,s){let e=1,h=12;return t.getFullYear()===s&&(e=t.getMonth()+1),i.getFullYear()===s&&(h=i.getMonth()+1),m(e,h)}function v(t,i,s,e){let h=1,n=function(t,i){return 4===i||6===i||9===i||11===i?30:2===i?t%4==0&&t%100!=0||t%400==0?29:28:31}(s,e);return t.getFullYear()===s&&t.getMonth()+1===e&&(h=t.getDate()),i.getFullYear()===s&&i.getMonth()+1===e&&(n=i.getDate()),m(h,n)}const _=102,w=34,k=class{constructor(e){t(this,e),this.onChange=i(this,"change",7),this.onColumnChange=i(this,"columnchange",7),this.onCancel=i(this,"cancel",7),this.index=[],this.showPicker=()=>{this.disabled||(this.height=this.getHeightByIndex(),this.hidden=!1)},this.getHeightByIndex=()=>this.index.map((t=>{let i=0;return"time"===this.mode&&(i=136),_-w*t-i})),this.hidePicker=()=>{this.fadeOut=!0,setTimeout((()=>{this.hidden=!0,this.fadeOut=!1}),350)},this.handleChange=()=>{this.hidePicker(),this.index=this.height.map((t=>(_-t)/w));let t=this.index.length&&"selector"!==this.mode?this.index:this.index[0];if("time"===this.mode){const i=[r.slice(),a.slice()],s=this.index.map(((t,s)=>i[s][t]));this.index=s.map((t=>parseInt(t))),t=s.join(":")}if("date"===this.mode){const{_start:i,_end:s,_updateValue:e}=this.pickerDate,h=e[0],n=e[1],o=g(i.getFullYear(),s.getFullYear()),r=f(i,s,h),a=v(i,s,h,n),c=o[this.index[0]],u=r[this.index[1]];t="year"===this.fields?[c]:"month"===this.fields?[c,u]:[c,u,a[this.index[2]]],t=t.map((t=>t<10?`0${t}`:t)).join("-")}this.value=t,this.pickerValue=this.value,this.onChange.emit({value:t})},this.handleColumnChange=t=>{const{columnId:i,height:s}=t.detail;this.onColumnChange.emit({column:Number(i),value:(_-s)/w})},this.handleCancel=()=>{this.hidePicker(),this.onCancel.emit()},this.updateHeight=(t,i,s=!1)=>{const e=[...this.height];if(e[i]=t,this.height=e,s){let{start:t,end:i}=this;if(u(t)||(t="00:00"),u(i)||(i="23:59"),!d(t,i))return;const s=[r.slice(),a.slice()],e=this.height.map((t=>(_-t)/w)),h=e.map(((t,i)=>s[i][t])).join(":");if(d(t,h)){if(!d(h,i)){const t=i.split(":").map((t=>_-w*(+t+4)));requestAnimationFrame((()=>this.height=t))}}else{const i=t.split(":").map((t=>_-w*(+t+4)));requestAnimationFrame((()=>this.height=i))}}},this.updateDay=(t,i)=>{const{_start:s,_end:e,_updateValue:h}=this.pickerDate;h[i]=t;const n=h[0],o=h[1],r=h[2];if(0===i){const t=f(s,e,n),i=t[t.length-1],r=t[0];o>i&&(h[1]=i),o<r&&(h[1]=r);const a=t.indexOf(h[1]),c=_-w*a;this.updateDay(h[1],1),this.updateHeight(c,"1")}else if(1===i){const t=v(s,e,n,o),i=t[t.length-1],a=t[0];r>i&&(h[2]=i),r<a&&(h[2]=a);const c=t.indexOf(h[2]),u=_-w*c;this.updateDay(h[2],2),this.updateHeight(u,"2")}},this.getSelector=()=>s("taro-picker-group",{range:this.range,rangeKey:this.rangeKey,height:this.height[0],updateHeight:this.updateHeight,columnId:"0"}),this.getMultiSelector=()=>this.range.map(((t,i)=>s("taro-picker-group",{range:t,rangeKey:this.rangeKey,height:this.height[i],updateHeight:this.updateHeight,onColumnChange:this.handleColumnChange,columnId:String(i)}))),this.getTimeSelector=()=>{const t=r.slice(),i=a.slice();return[s("taro-picker-group",{mode:"time",range:t,height:this.height[0],updateHeight:this.updateHeight,columnId:"0"}),s("taro-picker-group",{mode:"time",range:i,height:this.height[1],updateHeight:this.updateHeight,columnId:"1"})]},this.getDateSelector=()=>{const{fields:t,height:i}=this,{_start:e,_end:h,_updateValue:n}=this.pickerDate,o=n[0],r=n[1],a=g(e.getFullYear(),h.getFullYear()).map((t=>`${t}年`)),c=f(e,h,o).map((t=>`${t<10?`0${t}`:t}月`)),u=v(e,h,o,r).map((t=>`${t<10?`0${t}`:t}日`)),d=[s("taro-picker-group",{mode:"date",range:a,height:i[0],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"0"})];return"month"!==t&&"day"!==t||d.push(s("taro-picker-group",{mode:"date",range:c,height:i[1],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"1"})),"day"===t&&d.push(s("taro-picker-group",{mode:"date",range:u,height:i[2],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"2"})),d},this.mode="selector",this.disabled=!1,this.range=[],this.rangeKey=void 0,this.value=void 0,this.start="",this.end="",this.fields="day",this.name="",this.textProps={},this.pickerValue=[],this.height=[],this.hidden=!0,this.fadeOut=!1,this.isWillLoadCalled=!1}componentWillLoad(){this.isWillLoadCalled=!0,this.handleProps()}componentDidLoad(){this.overlay&&document.body.appendChild(this.overlay)}disconnectedCallback(){var t;this.overlay&&(null===(t=this.overlay.parentNode)||void 0===t||t.removeChild(this.overlay))}onPropsChange(){this.isWillLoadCalled&&this.handleProps()}handleProps(){const{mode:t,start:i,end:s}=this;if("selector"===t){const t=this.value;this.index=[c(t,this.range)?Math.floor(t):0]}else if("multiSelector"===t){const t=this.value;this.index=[],this.range.forEach(((i,s)=>{const e=null==t?void 0:t[s],h=c(e,i)?Math.floor(e):0;this.index.push(h)}))}else if("time"===t){let t=this.value;u(t)||(console.warn("time picker value illegal"),t="0:0");const i=t.split(":").map((t=>+t));this.index=i}else{if("date"!==t)throw new Error(`Picker not support "${t}" mode.`);{const t=l(this.value)||new Date((new Date).setHours(0,0,0,0)),e=l(i)||new Date("1970/01/01"),h=l(s)||new Date("2999/01/01");if(!(t>=e&&t<=h))throw new Error("Date Interval Error");{const i=t.getFullYear(),s=t.getMonth()+1,n=t.getDate(),o=g(e.getFullYear(),h.getFullYear()),r=f(e,h,i),a=v(e,h,i,s);this.index=[o.indexOf(i),r.indexOf(s),a.indexOf(n)],this.pickerDate&&this.pickerDate._value.getTime()===t.getTime()&&this.pickerDate._start.getTime()===e.getTime()&&this.pickerDate._end.getTime()===h.getTime()||(this.pickerDate={_value:t,_start:e,_end:h,_updateValue:[i,s,n]})}}}if(this.height=this.getHeightByIndex(),this.pickerValue=this.value,"date"===t){const t=this.pickerValue;"month"===this.fields?this.pickerValue=t.split("-").slice(0,2).join("-"):"year"===this.fields&&(this.pickerValue=t.split("-")[0])}}render(){var t,i;const{name:h,mode:o,fadeOut:r,hidden:a}=this;let c;switch(o){case"multiSelector":c=this.getMultiSelector();break;case"time":c=this.getTimeSelector();break;case"date":c=this.getDateSelector();break;default:c=this.getSelector()}const u=n("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":r}),d=n("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":r}),l=a?{display:"none"}:{};return s(e,null,s("div",{onClick:this.showPicker},s("slot",null),s("input",{type:"hidden",name:h,value:p(this.pickerValue)})),s("div",{class:"weui-picker__overlay",style:l,ref:t=>{this.overlay=t}},s("div",{class:u,onClick:this.handleCancel}),s("div",{class:d},s("div",{class:"weui-picker__hd"},s("div",{class:"weui-picker__action",onClick:this.handleCancel},null!==(t=this.textProps.cancelText)&&void 0!==t?t:"取消"),s("div",{class:"weui-picker__action",onClick:this.handleChange},null!==(i=this.textProps.okText)&&void 0!==i?i:"确定")),s("div",{class:"weui-picker__bd"},c),s("input",{type:"hidden",name:h,value:p(this.pickerValue)}))))}get el(){return h(this)}static get watchers(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}}};k.style=".weui-picker,.weui-picker__hd{font-size:12px}";const y=class{constructor(s){t(this,s),this.onColumnChange=i(this,"columnChange",7),this.mode=void 0,this.range=[],this.rangeKey=void 0,this.height=void 0,this.columnId=void 0,this.updateHeight=void 0,this.updateDay=void 0,this.startY=void 0,this.preY=void 0,this.hadMove=void 0,this.touchEnd=void 0,this.isMove=void 0}getPosition(){const t=`translate3d(0, ${this.height}px, 0)`,i=`transform ${this.touchEnd?.3:0}s`;return{transform:t,"-webkit-transform":t,transition:i,"-webkit-transition":i}}formulaUnlimitedScroll(t,i,s){const{height:e,updateHeight:h,columnId:n}=this,o="up"===s?1:-1;this.touchEnd=!1,h(-t*o*w+e,n),requestAnimationFrame((()=>{this.touchEnd=!0;const s=Math.round(i/-34)+t*o;h(_-w*s,n,!0)}))}async handleMoveStart(t){this.startY=t,this.preY=t,this.hadMove=!1}async handleMoving(t){const i=t,s=i-this.preY;this.preY=i,this.touchEnd=!1,Math.abs(i-this.startY)>10&&(this.hadMove=!0);let e=this.height+s;"time"===this.mode&&("0"===this.columnId?(e>0&&(e=-816+s),e<-850&&(e=-34+s)):"1"===this.columnId&&(e>0&&(e=-2040+s),e<-2074&&(e=-34+s))),this.updateHeight(e,this.columnId)}async handleMoveEnd(t){const{mode:i,range:s,height:e,updateHeight:h,columnId:n}=this,o=-34*(s.length-1),r=t;let a;if(this.touchEnd=!0,this.hadMove)a=e-_;else{const t=window.innerHeight;if(a=e-_-(r-(t-119)),"time"===i)if("0"===n){if(a>-85)return this.formulaUnlimitedScroll(24,a,"up");if(a<-969)return this.formulaUnlimitedScroll(24,a,"down")}else if("1"===n){if(a>-85)return this.formulaUnlimitedScroll(60,a,"up");if(a<-2193)return this.formulaUnlimitedScroll(60,a,"down")}}a>0&&(a=0),a<o&&(a=o);const c=Math.round(a/-34),u=_-w*c;"date"===this.mode&&"function"==typeof this.updateDay&&("0"===this.columnId&&this.updateDay(+this.range[c].replace(/[^0-9]/gi,""),0),"1"===this.columnId&&this.updateDay(+this.range[c].replace(/[^0-9]/gi,""),1),"2"===this.columnId&&this.updateDay(+this.range[c].replace(/[^0-9]/gi,""),2)),h(u,n,"time"===i),this.onColumnChange.emit({columnId:n,height:u})}onMouseDown(t){this.isMove=!0,this.handleMoveStart(t.clientY)}onMouseMove(t){this.isMove&&this.handleMoving(t.clientY)}onMouseMoveEnd(t){this.isMove&&(this.isMove=!1,this.handleMoveEnd(t.clientY))}onTouchStart(t){this.handleMoveStart(t.changedTouches[0].clientY)}onTouchMove(t){this.handleMoving(t.changedTouches[0].clientY)}onTouchEnd(t){this.handleMoveEnd(t.changedTouches[0].clientY)}render(){const{range:t,rangeKey:i}=this,h=t.map((t=>s("div",{class:"weui-picker__item"},i?t[i]:t)));return s(e,{class:"weui-picker__group"},s("div",{class:"weui-picker__mask"}),s("div",{class:"weui-picker__indicator"}),s("div",{class:"weui-picker__content",style:this.getPosition()},h))}};export{k as taro_picker_core,y as taro_picker_group}
|