@tarojs/components 3.6.6-alpha.1 → 3.6.6
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-input-core.cjs.entry.js +1 -6
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +2 -6
- package/dist/cjs/taro-textarea-core.cjs.entry.js +1 -8
- package/dist/collection/components/input/input.js +3 -7
- package/dist/collection/components/picker/picker.js +8 -8
- package/dist/collection/components/textarea/textarea.js +3 -9
- package/dist/components/taro-input-core.js +1 -6
- package/dist/components/taro-picker-core.js +2 -6
- package/dist/components/taro-textarea-core.js +1 -8
- package/dist/esm/taro-input-core.entry.js +1 -6
- package/dist/esm/taro-picker-core_2.entry.js +2 -6
- package/dist/esm/taro-textarea-core.entry.js +1 -8
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
- package/dist/taro-components/p-030715f1.system.entry.js +1 -0
- package/dist/taro-components/{p-2c89af5b.system.entry.js → p-657cb6e4.system.entry.js} +1 -1
- package/dist/taro-components/p-8414da06.system.entry.js +1 -0
- package/dist/taro-components/p-98d771c3.entry.js +1 -0
- package/dist/taro-components/p-af2cd702.entry.js +1 -0
- package/dist/taro-components/p-ed331c06.system.js +1 -1
- package/dist/taro-components/p-f02b6f70.entry.js +1 -0
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +1 -1
- package/dist/types/components/picker/picker.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +0 -1
- package/dist/types/components.d.ts +3 -3
- package/lib/react/component-lib/reactify-wc.js +1 -1
- package/lib/react/component-lib/reactify-wc.js.map +1 -1
- package/lib/vue2/components.d.ts +1 -1
- package/package.json +9 -9
- package/types/ScrollView.d.ts +2 -2
- package/types/ShareElement.d.ts +34 -0
- package/types/StickySection.d.ts +0 -1
- package/types/Swiper.d.ts +10 -0
- package/types/Textarea.d.ts +5 -0
- package/dist/taro-components/p-589293fd.entry.js +0 -1
- package/dist/taro-components/p-735c2a72.system.entry.js +0 -1
- package/dist/taro-components/p-a132ebb9.entry.js +0 -1
- package/dist/taro-components/p-cc7b95fd.system.entry.js +0 -1
- package/dist/taro-components/p-d9e2e3aa.entry.js +0 -1
|
@@ -142,7 +142,7 @@ const Input = class {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
|
-
this.value =
|
|
145
|
+
this.value = '';
|
|
146
146
|
this.type = undefined;
|
|
147
147
|
this.password = false;
|
|
148
148
|
this.placeholder = undefined;
|
|
@@ -182,11 +182,6 @@ const Input = class {
|
|
|
182
182
|
(_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.addEventListener('beforeinput', this.handleBeforeinput);
|
|
183
183
|
(_e = this.inputRef) === null || _e === void 0 ? void 0 : _e.addEventListener('textInput', this.handleBeforeinput);
|
|
184
184
|
}
|
|
185
|
-
Object.defineProperty(this.el, 'value', {
|
|
186
|
-
get: () => this.inputRef.value,
|
|
187
|
-
set: value => this.value !== value && (this.value = value),
|
|
188
|
-
configurable: true
|
|
189
|
-
});
|
|
190
185
|
}
|
|
191
186
|
disconnectedCallback() {
|
|
192
187
|
var _a, _b, _c, _d, _e;
|
|
@@ -224,7 +224,8 @@ const Picker = class {
|
|
|
224
224
|
})
|
|
225
225
|
.join('-');
|
|
226
226
|
}
|
|
227
|
-
this.
|
|
227
|
+
this.value = value;
|
|
228
|
+
this.pickerValue = this.value;
|
|
228
229
|
this.onChange.emit({
|
|
229
230
|
value
|
|
230
231
|
});
|
|
@@ -368,11 +369,6 @@ const Picker = class {
|
|
|
368
369
|
this.handleProps();
|
|
369
370
|
}
|
|
370
371
|
componentDidLoad() {
|
|
371
|
-
Object.defineProperty(this.el, 'value', {
|
|
372
|
-
get: () => this.pickerValue,
|
|
373
|
-
set: value => this.value !== value && (this.value = value),
|
|
374
|
-
configurable: true
|
|
375
|
-
});
|
|
376
372
|
if (this.overlay) {
|
|
377
373
|
document.body.appendChild(this.overlay);
|
|
378
374
|
}
|
|
@@ -111,7 +111,7 @@ const Textarea = class {
|
|
|
111
111
|
numberOfLines = Math.floor(taHeight / taLineHeight);
|
|
112
112
|
return numberOfLines;
|
|
113
113
|
};
|
|
114
|
-
this.value =
|
|
114
|
+
this.value = '';
|
|
115
115
|
this.placeholder = undefined;
|
|
116
116
|
this.disabled = false;
|
|
117
117
|
this.maxlength = 140;
|
|
@@ -130,13 +130,6 @@ const Textarea = class {
|
|
|
130
130
|
async focus() {
|
|
131
131
|
this.textareaRef.focus();
|
|
132
132
|
}
|
|
133
|
-
componentDidLoad() {
|
|
134
|
-
Object.defineProperty(this.el, 'value', {
|
|
135
|
-
get: () => this.textareaRef.value,
|
|
136
|
-
set: value => this.value !== value && (this.value = value),
|
|
137
|
-
configurable: true
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
133
|
render() {
|
|
141
134
|
const { value, placeholder, disabled, maxlength, autoFocus, autoHeight, name, nativeProps, handleInput, handleFocus, handleBlur, handleChange } = this;
|
|
142
135
|
const otherProps = {};
|
|
@@ -127,7 +127,7 @@ export class Input {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
|
-
this.value =
|
|
130
|
+
this.value = '';
|
|
131
131
|
this.type = undefined;
|
|
132
132
|
this.password = false;
|
|
133
133
|
this.placeholder = undefined;
|
|
@@ -167,11 +167,6 @@ export class Input {
|
|
|
167
167
|
(_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.addEventListener('beforeinput', this.handleBeforeinput);
|
|
168
168
|
(_e = this.inputRef) === null || _e === void 0 ? void 0 : _e.addEventListener('textInput', this.handleBeforeinput);
|
|
169
169
|
}
|
|
170
|
-
Object.defineProperty(this.el, 'value', {
|
|
171
|
-
get: () => this.inputRef.value,
|
|
172
|
-
set: value => this.value !== value && (this.value = value),
|
|
173
|
-
configurable: true
|
|
174
|
-
});
|
|
175
170
|
}
|
|
176
171
|
disconnectedCallback() {
|
|
177
172
|
var _a, _b, _c, _d, _e;
|
|
@@ -221,7 +216,8 @@ export class Input {
|
|
|
221
216
|
"text": ""
|
|
222
217
|
},
|
|
223
218
|
"attribute": "value",
|
|
224
|
-
"reflect": false
|
|
219
|
+
"reflect": false,
|
|
220
|
+
"defaultValue": "''"
|
|
225
221
|
},
|
|
226
222
|
"type": {
|
|
227
223
|
"type": "string",
|
|
@@ -68,7 +68,8 @@ export class Picker {
|
|
|
68
68
|
})
|
|
69
69
|
.join('-');
|
|
70
70
|
}
|
|
71
|
-
this.
|
|
71
|
+
this.value = value;
|
|
72
|
+
this.pickerValue = this.value;
|
|
72
73
|
this.onChange.emit({
|
|
73
74
|
value
|
|
74
75
|
});
|
|
@@ -212,11 +213,6 @@ export class Picker {
|
|
|
212
213
|
this.handleProps();
|
|
213
214
|
}
|
|
214
215
|
componentDidLoad() {
|
|
215
|
-
Object.defineProperty(this.el, 'value', {
|
|
216
|
-
get: () => this.pickerValue,
|
|
217
|
-
set: value => this.value !== value && (this.value = value),
|
|
218
|
-
configurable: true
|
|
219
|
-
});
|
|
220
216
|
if (this.overlay) {
|
|
221
217
|
document.body.appendChild(this.overlay);
|
|
222
218
|
}
|
|
@@ -426,9 +422,13 @@ export class Picker {
|
|
|
426
422
|
"type": "any",
|
|
427
423
|
"mutable": true,
|
|
428
424
|
"complexType": {
|
|
429
|
-
"original": "
|
|
425
|
+
"original": "PickerValue",
|
|
430
426
|
"resolved": "number | number[] | string",
|
|
431
|
-
"references": {
|
|
427
|
+
"references": {
|
|
428
|
+
"PickerValue": {
|
|
429
|
+
"location": "local"
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
432
|
},
|
|
433
433
|
"required": false,
|
|
434
434
|
"optional": false,
|
|
@@ -96,7 +96,7 @@ export class Textarea {
|
|
|
96
96
|
numberOfLines = Math.floor(taHeight / taLineHeight);
|
|
97
97
|
return numberOfLines;
|
|
98
98
|
};
|
|
99
|
-
this.value =
|
|
99
|
+
this.value = '';
|
|
100
100
|
this.placeholder = undefined;
|
|
101
101
|
this.disabled = false;
|
|
102
102
|
this.maxlength = 140;
|
|
@@ -115,13 +115,6 @@ export class Textarea {
|
|
|
115
115
|
async focus() {
|
|
116
116
|
this.textareaRef.focus();
|
|
117
117
|
}
|
|
118
|
-
componentDidLoad() {
|
|
119
|
-
Object.defineProperty(this.el, 'value', {
|
|
120
|
-
get: () => this.textareaRef.value,
|
|
121
|
-
set: value => this.value !== value && (this.value = value),
|
|
122
|
-
configurable: true
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
118
|
render() {
|
|
126
119
|
const { value, placeholder, disabled, maxlength, autoFocus, autoHeight, name, nativeProps, handleInput, handleFocus, handleBlur, handleChange } = this;
|
|
127
120
|
const otherProps = {};
|
|
@@ -164,7 +157,8 @@ export class Textarea {
|
|
|
164
157
|
"text": ""
|
|
165
158
|
},
|
|
166
159
|
"attribute": "value",
|
|
167
|
-
"reflect": false
|
|
160
|
+
"reflect": false,
|
|
161
|
+
"defaultValue": "''"
|
|
168
162
|
},
|
|
169
163
|
"placeholder": {
|
|
170
164
|
"type": "string",
|
|
@@ -139,7 +139,7 @@ const Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
this.value =
|
|
142
|
+
this.value = '';
|
|
143
143
|
this.type = undefined;
|
|
144
144
|
this.password = false;
|
|
145
145
|
this.placeholder = undefined;
|
|
@@ -179,11 +179,6 @@ const Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
179
179
|
(_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.addEventListener('beforeinput', this.handleBeforeinput);
|
|
180
180
|
(_e = this.inputRef) === null || _e === void 0 ? void 0 : _e.addEventListener('textInput', this.handleBeforeinput);
|
|
181
181
|
}
|
|
182
|
-
Object.defineProperty(this.el, 'value', {
|
|
183
|
-
get: () => this.inputRef.value,
|
|
184
|
-
set: value => this.value !== value && (this.value = value),
|
|
185
|
-
configurable: true
|
|
186
|
-
});
|
|
187
182
|
}
|
|
188
183
|
disconnectedCallback() {
|
|
189
184
|
var _a, _b, _c, _d, _e;
|
|
@@ -218,7 +218,8 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
218
218
|
})
|
|
219
219
|
.join('-');
|
|
220
220
|
}
|
|
221
|
-
this.
|
|
221
|
+
this.value = value;
|
|
222
|
+
this.pickerValue = this.value;
|
|
222
223
|
this.onChange.emit({
|
|
223
224
|
value
|
|
224
225
|
});
|
|
@@ -362,11 +363,6 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
362
363
|
this.handleProps();
|
|
363
364
|
}
|
|
364
365
|
componentDidLoad() {
|
|
365
|
-
Object.defineProperty(this.el, 'value', {
|
|
366
|
-
get: () => this.pickerValue,
|
|
367
|
-
set: value => this.value !== value && (this.value = value),
|
|
368
|
-
configurable: true
|
|
369
|
-
});
|
|
370
366
|
if (this.overlay) {
|
|
371
367
|
document.body.appendChild(this.overlay);
|
|
372
368
|
}
|
|
@@ -108,7 +108,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
108
108
|
numberOfLines = Math.floor(taHeight / taLineHeight);
|
|
109
109
|
return numberOfLines;
|
|
110
110
|
};
|
|
111
|
-
this.value =
|
|
111
|
+
this.value = '';
|
|
112
112
|
this.placeholder = undefined;
|
|
113
113
|
this.disabled = false;
|
|
114
114
|
this.maxlength = 140;
|
|
@@ -127,13 +127,6 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
127
127
|
async focus() {
|
|
128
128
|
this.textareaRef.focus();
|
|
129
129
|
}
|
|
130
|
-
componentDidLoad() {
|
|
131
|
-
Object.defineProperty(this.el, 'value', {
|
|
132
|
-
get: () => this.textareaRef.value,
|
|
133
|
-
set: value => this.value !== value && (this.value = value),
|
|
134
|
-
configurable: true
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
130
|
render() {
|
|
138
131
|
const { value, placeholder, disabled, maxlength, autoFocus, autoHeight, name, nativeProps, handleInput, handleFocus, handleBlur, handleChange } = this;
|
|
139
132
|
const otherProps = {};
|
|
@@ -138,7 +138,7 @@ const Input = class {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
-
this.value =
|
|
141
|
+
this.value = '';
|
|
142
142
|
this.type = undefined;
|
|
143
143
|
this.password = false;
|
|
144
144
|
this.placeholder = undefined;
|
|
@@ -178,11 +178,6 @@ const Input = class {
|
|
|
178
178
|
(_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.addEventListener('beforeinput', this.handleBeforeinput);
|
|
179
179
|
(_e = this.inputRef) === null || _e === void 0 ? void 0 : _e.addEventListener('textInput', this.handleBeforeinput);
|
|
180
180
|
}
|
|
181
|
-
Object.defineProperty(this.el, 'value', {
|
|
182
|
-
get: () => this.inputRef.value,
|
|
183
|
-
set: value => this.value !== value && (this.value = value),
|
|
184
|
-
configurable: true
|
|
185
|
-
});
|
|
186
181
|
}
|
|
187
182
|
disconnectedCallback() {
|
|
188
183
|
var _a, _b, _c, _d, _e;
|
|
@@ -220,7 +220,8 @@ const Picker = class {
|
|
|
220
220
|
})
|
|
221
221
|
.join('-');
|
|
222
222
|
}
|
|
223
|
-
this.
|
|
223
|
+
this.value = value;
|
|
224
|
+
this.pickerValue = this.value;
|
|
224
225
|
this.onChange.emit({
|
|
225
226
|
value
|
|
226
227
|
});
|
|
@@ -364,11 +365,6 @@ const Picker = class {
|
|
|
364
365
|
this.handleProps();
|
|
365
366
|
}
|
|
366
367
|
componentDidLoad() {
|
|
367
|
-
Object.defineProperty(this.el, 'value', {
|
|
368
|
-
get: () => this.pickerValue,
|
|
369
|
-
set: value => this.value !== value && (this.value = value),
|
|
370
|
-
configurable: true
|
|
371
|
-
});
|
|
372
368
|
if (this.overlay) {
|
|
373
369
|
document.body.appendChild(this.overlay);
|
|
374
370
|
}
|
|
@@ -107,7 +107,7 @@ const Textarea = class {
|
|
|
107
107
|
numberOfLines = Math.floor(taHeight / taLineHeight);
|
|
108
108
|
return numberOfLines;
|
|
109
109
|
};
|
|
110
|
-
this.value =
|
|
110
|
+
this.value = '';
|
|
111
111
|
this.placeholder = undefined;
|
|
112
112
|
this.disabled = false;
|
|
113
113
|
this.maxlength = 140;
|
|
@@ -126,13 +126,6 @@ const Textarea = class {
|
|
|
126
126
|
async focus() {
|
|
127
127
|
this.textareaRef.focus();
|
|
128
128
|
}
|
|
129
|
-
componentDidLoad() {
|
|
130
|
-
Object.defineProperty(this.el, 'value', {
|
|
131
|
-
get: () => this.textareaRef.value,
|
|
132
|
-
set: value => this.value !== value && (this.value = value),
|
|
133
|
-
configurable: true
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
129
|
render() {
|
|
137
130
|
const { value, placeholder, disabled, maxlength, autoFocus, autoHeight, name, nativeProps, handleInput, handleFocus, handleBlur, handleChange } = this;
|
|
138
131
|
const otherProps = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function r(e){try{
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function r(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i["throw"](e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(r,s)}u((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,r;return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(e){return function(t){return u([e,t])}}function u(s){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,s[0]&&(n=0)),n)try{if(i=1,o&&(a=s[0]&2?o["return"]:s[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;if(o=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1];a=s;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(s);break}if(a[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];o=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-980f930f.js";var indexCss="taro-input-core{display:block}input{display:block;overflow:hidden;height:1.4rem;text-overflow:clip;text-align:inherit;white-space:nowrap}";function getTrueType(e,t,n){if(t==="search")e="search";if(n)e="password";if(typeof e==="undefined"){return"text"}if(!e){throw new Error("unexpected type")}if(e==="digit")e="number";return e}function fixControlledValue(e){return e!==null&&e!==void 0?e:""}var Input=function(){function e(e){var t=this;registerInstance(this,e);this.onInput=createEvent(this,"input",7);this.onPaste=createEvent(this,"paste",7);this.onFocus=createEvent(this,"focus",7);this.onBlur=createEvent(this,"blur",7);this.onConfirm=createEvent(this,"confirm",7);this.onChange=createEvent(this,"change",7);this.onKeyDown=createEvent(this,"keydown",7);this.isOnComposition=false;this.isOnPaste=false;this.onInputExcuted=false;this.handleInput=function(e){e.stopPropagation();var n=t,i=n.type,o=n.maxlength,a=n.confirmType,r=n.password;if(!t.isOnComposition&&!t.onInputExcuted){var s=e.target.value;var u=getTrueType(i,a,r);t.onInputExcuted=true;if(u==="number"&&s&&o>-1&&o<=s.length){s=s.substring(0,o);e.target.value=s}t.value=s;t.onInput.emit({value:s,cursor:s.length});t.onInputExcuted=false}};this.handlePaste=function(e){e.stopPropagation();t.isOnPaste=true;t.onPaste.emit({value:e.target.value})};this.handleFocus=function(e){e.stopPropagation();t.onInputExcuted=false;t.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){e.stopPropagation();t.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();t.onChange.emit({value:e.target.value});if(t.isOnPaste){t.isOnPaste=false;t.value=e.target.value;t.onInput.emit({value:e.target.value,cursor:e.target.value.length})}};this.handleKeyDown=function(e){e.stopPropagation();var n=e.target.value;var i=e.keyCode||e.code;t.onInputExcuted=false;t.onKeyDown.emit({value:n,cursor:n.length,keyCode:i});i===13&&t.onConfirm.emit({value:n})};this.handleComposition=function(e){e.stopPropagation();if(!(e.target instanceof HTMLInputElement))return;if(e.type==="compositionend"){t.isOnComposition=false;t.value=e.target.value;t.onInput.emit({value:e.target.value,cursor:e.target.value.length})}else{t.isOnComposition=true}};this.handleBeforeinput=function(e){if(!e.data)return;var n=e.data&&/[0-9]/.test(e.data);if(t.type==="number"&&!n){e.preventDefault()}if(t.type==="digit"&&!n){if(e.data!=="."||e.data==="."&&e.target.value.indexOf(".")>-1){e.preventDefault()}}};this.value="";this.type=undefined;this.password=false;this.placeholder=undefined;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.confirmType="done";this.name=undefined;this.nativeProps={}}e.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.inputRef.focus();return[2]}))}))};e.prototype.watchAutoFocus=function(e,t){var n;if(!t&&e){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};e.prototype.watchValue=function(e){var t=fixControlledValue(e);if(this.inputRef.value!==t){this.inputRef.value=t}};e.prototype.componentDidLoad=function(){var e=this;var t,n,i,o,a;if(this.type==="file"){this.fileListener=function(){e.onInput.emit()};(t=this.inputRef)===null||t===void 0?void 0:t.addEventListener("change",this.fileListener)}else{(n=this.inputRef)===null||n===void 0?void 0:n.addEventListener("compositionstart",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.addEventListener("compositionend",this.handleComposition);(o=this.inputRef)===null||o===void 0?void 0:o.addEventListener("beforeinput",this.handleBeforeinput);(a=this.inputRef)===null||a===void 0?void 0:a.addEventListener("textInput",this.handleBeforeinput)}};e.prototype.disconnectedCallback=function(){var e,t,n,i,o;if(this.type==="file"){(e=this.inputRef)===null||e===void 0?void 0:e.removeEventListener("change",this.fileListener)}else{(t=this.inputRef)===null||t===void 0?void 0:t.removeEventListener("compositionstart",this.handleComposition);(n=this.inputRef)===null||n===void 0?void 0:n.removeEventListener("compositionend",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.removeEventListener("beforeinput",this.handleBeforeinput);(o=this.inputRef)===null||o===void 0?void 0:o.removeEventListener("textInput",this.handleBeforeinput)}};e.prototype.render=function(){var e=this;var t=this,n=t.value,i=t.type,o=t.password,a=t.placeholder,r=t.autoFocus,s=t.disabled,u=t.maxlength,l=t.confirmType,p=t.name,f=t.nativeProps;return h("input",Object.assign({ref:function(t){e.inputRef=t;if(r&&t)t.focus()},class:"weui-input",type:getTrueType(i,l,o),placeholder:a,autoFocus:r,disabled:s,maxlength:u,name:p,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},f,{value:fixControlledValue(n)}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{autoFocus:["watchAutoFocus"],value:["watchValue"]}},enumerable:false,configurable:true});return e}();Input.style=indexCss;export{Input as taro_input_core};
|
|
@@ -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-394db4c1.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.pickerValue=e;t.onChange.emit({value:e})};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.handleColumnChange=function(e,i){t.onColumnChange.emit({column:Number(i),value:(TOP-e)/LINE_HEIGHT})};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.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(){var e=this;Object.defineProperty(this.el,"value",{get:function(){return e.pickerValue},set:function(t){return e.value!==t&&(e.value=t)},configurable:true});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")}}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=this,i=t.name,n=t.mode,r=t.fadeOut,a=t.hidden;var o;switch(n){case"multiSelector":o=this.getMultiSelector();break;case"time":o=this.getTimeSelector();break;case"date":o=this.getDateSelector();break;default:o=this.getSelector()}var u=classnames("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":r});var s=classnames("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":r});var l=a?{display:"none"}:{};return h(Host,null,h("div",{onClick:this.showPicker},h("slot",null),h("input",{type:"hidden",name:i,value:formatValue(this.pickerValue)})),h("div",{class:"weui-picker__overlay",style:l,ref:function(t){e.overlay=t}},h("div",{class:u,onClick:this.handleCancel}),h("div",{class:s},h("div",{class:"weui-picker__hd"},h("div",{class:"weui-picker__action",onClick:this.handleCancel},"取消"),h("div",{class:"weui-picker__action",onClick:this.handleChange},"确定")),h("div",{class:"weui-picker__bd"},o),h("input",{type:"hidden",name:i,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.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.onColumnChange=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,p;return __generator(this,(function(v){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.onColumnChange,u=t.columnId;s=0;h=-LINE_HEIGHT*(n.length-1);l=e;this.touchEnd=true;if(!this.hadMove){d=window.innerHeight;f=d-MASK_HEIGHT/2;c=r-TOP-(l-f);if(i==="time"){if(u==="0"){if(c>-LINE_HEIGHT*2.5){return[2,this.formulaUnlimitedScroll(24,c,"up")]}if(c<-LINE_HEIGHT*28.5){return[2,this.formulaUnlimitedScroll(24,c,"down")]}}else if(u==="1"){if(c>-LINE_HEIGHT*2.5){return[2,this.formulaUnlimitedScroll(60,c,"up")]}if(c<-LINE_HEIGHT*64.5){return[2,this.formulaUnlimitedScroll(60,c,"down")]}}}}else{c=r-TOP}if(c>s)c=0;if(c<h)c=h;g=Math.round(c/-LINE_HEIGHT);p=TOP-LINE_HEIGHT*g;if(this.mode==="date"){if(this.columnId==="0"){this.updateDay(+this.range[g].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[g].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[g].replace(/[^0-9]/gi,""),2)}}a(p,u,i==="time");o&&o(p,u);return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){e.preventDefault();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){e.preventDefault();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-394db4c1.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.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.handleColumnChange=function(e,i){t.onColumnChange.emit({column:Number(i),value:(TOP-e)/LINE_HEIGHT})};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.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")}}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=this,i=t.name,n=t.mode,r=t.fadeOut,a=t.hidden;var o;switch(n){case"multiSelector":o=this.getMultiSelector();break;case"time":o=this.getTimeSelector();break;case"date":o=this.getDateSelector();break;default:o=this.getSelector()}var u=classnames("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":r});var s=classnames("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":r});var l=a?{display:"none"}:{};return h(Host,null,h("div",{onClick:this.showPicker},h("slot",null),h("input",{type:"hidden",name:i,value:formatValue(this.pickerValue)})),h("div",{class:"weui-picker__overlay",style:l,ref:function(t){e.overlay=t}},h("div",{class:u,onClick:this.handleCancel}),h("div",{class:s},h("div",{class:"weui-picker__hd"},h("div",{class:"weui-picker__action",onClick:this.handleCancel},"取消"),h("div",{class:"weui-picker__action",onClick:this.handleChange},"确定")),h("div",{class:"weui-picker__bd"},o),h("input",{type:"hidden",name:i,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.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.onColumnChange=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,p;return __generator(this,(function(v){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.onColumnChange,u=t.columnId;s=0;h=-LINE_HEIGHT*(n.length-1);l=e;this.touchEnd=true;if(!this.hadMove){d=window.innerHeight;f=d-MASK_HEIGHT/2;c=r-TOP-(l-f);if(i==="time"){if(u==="0"){if(c>-LINE_HEIGHT*2.5){return[2,this.formulaUnlimitedScroll(24,c,"up")]}if(c<-LINE_HEIGHT*28.5){return[2,this.formulaUnlimitedScroll(24,c,"down")]}}else if(u==="1"){if(c>-LINE_HEIGHT*2.5){return[2,this.formulaUnlimitedScroll(60,c,"up")]}if(c<-LINE_HEIGHT*64.5){return[2,this.formulaUnlimitedScroll(60,c,"down")]}}}}else{c=r-TOP}if(c>s)c=0;if(c<h)c=h;g=Math.round(c/-LINE_HEIGHT);p=TOP-LINE_HEIGHT*g;if(this.mode==="date"){if(this.columnId==="0"){this.updateDay(+this.range[g].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[g].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[g].replace(/[^0-9]/gi,""),2)}}a(p,u,i==="time");o&&o(p,u);return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){e.preventDefault();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){e.preventDefault();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,n,a){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function r(e){try{u(a.next(e))}catch(e){i(e)}}function l(e){try{u(a["throw"](e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(r,l)}u((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return u([e,t])}}function u(l){if(a)throw new TypeError("Generator is already executing.");while(r&&(r=0,l[0]&&(n=0)),n)try{if(a=1,o&&(i=l[0]&2?o["return"]:l[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;if(o=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1];i=l;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(l);break}if(i[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{a=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-980f930f.js";var indexCss="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";function fixControlledValue(e){return e!==null&&e!==void 0?e:""}var Textarea=function(){function e(e){var t=this;registerInstance(this,e);this.onInput=createEvent(this,"input",7);this.onFocus=createEvent(this,"focus",7);this.onBlur=createEvent(this,"blur",7);this.onConfirm=createEvent(this,"confirm",7);this.onChange=createEvent(this,"change",7);this.onLineChange=createEvent(this,"linechange",7);this.onKeyDown=createEvent(this,"keydown",7);this.handleInput=function(e){e.stopPropagation();t.handleLineChange();var n=e.target.value||"";t.onInput.emit({value:n,cursor:n.length})};this.handleFocus=function(e){e.stopPropagation();t.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){e.stopPropagation();t.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();t.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=t.getNumberOfLines();if(e!==t.line){t.line=e;t.onLineChange.emit({height:t.textareaRef.clientHeight,lineCount:t.line})}};this.handleKeyDown=function(e){e.stopPropagation();var n=e.target.value;var a=e.keyCode||e.code;t.onKeyDown.emit({value:n,cursor:n.length,keyCode:a});a===13&&t.onConfirm.emit({value:n})};this.calculateContentHeight=function(e,t){var n=e.style.height,a=e.offsetHeight,o=e.scrollHeight,i=e.style.overflow,r=e.style.minHeight||null;if(a>=o){e.style.minHeight=0;e.style.height=a+t+"px";e.style.overflow="hidden";if(o<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(a-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=a+++"px"}e.style.height=n;e.style.overflow=i;e.style.minHeight=r;return a}}else{return o}};this.getNumberOfLines=function(){var e=t.textareaRef,n=window.getComputedStyle?window.getComputedStyle(e):e.style,a=parseInt(n.lineHeight,10),o=t.calculateContentHeight(e,a),i=Math.floor(o/a);return i};this.value=
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,a){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function r(e){try{u(a.next(e))}catch(e){i(e)}}function l(e){try{u(a["throw"](e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(r,l)}u((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return u([e,t])}}function u(l){if(a)throw new TypeError("Generator is already executing.");while(r&&(r=0,l[0]&&(n=0)),n)try{if(a=1,o&&(i=l[0]&2?o["return"]:l[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;if(o=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1];i=l;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(l);break}if(i[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{a=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-980f930f.js";var indexCss="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";function fixControlledValue(e){return e!==null&&e!==void 0?e:""}var Textarea=function(){function e(e){var t=this;registerInstance(this,e);this.onInput=createEvent(this,"input",7);this.onFocus=createEvent(this,"focus",7);this.onBlur=createEvent(this,"blur",7);this.onConfirm=createEvent(this,"confirm",7);this.onChange=createEvent(this,"change",7);this.onLineChange=createEvent(this,"linechange",7);this.onKeyDown=createEvent(this,"keydown",7);this.handleInput=function(e){e.stopPropagation();t.handleLineChange();var n=e.target.value||"";t.onInput.emit({value:n,cursor:n.length})};this.handleFocus=function(e){e.stopPropagation();t.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){e.stopPropagation();t.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();t.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=t.getNumberOfLines();if(e!==t.line){t.line=e;t.onLineChange.emit({height:t.textareaRef.clientHeight,lineCount:t.line})}};this.handleKeyDown=function(e){e.stopPropagation();var n=e.target.value;var a=e.keyCode||e.code;t.onKeyDown.emit({value:n,cursor:n.length,keyCode:a});a===13&&t.onConfirm.emit({value:n})};this.calculateContentHeight=function(e,t){var n=e.style.height,a=e.offsetHeight,o=e.scrollHeight,i=e.style.overflow,r=e.style.minHeight||null;if(a>=o){e.style.minHeight=0;e.style.height=a+t+"px";e.style.overflow="hidden";if(o<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(a-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=a+++"px"}e.style.height=n;e.style.overflow=i;e.style.minHeight=r;return a}}else{return o}};this.getNumberOfLines=function(){var e=t.textareaRef,n=window.getComputedStyle?window.getComputedStyle(e):e.style,a=parseInt(n.lineHeight,10),o=t.calculateContentHeight(e,a),i=Math.floor(o/a);return i};this.value="";this.placeholder=undefined;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.autoHeight=false;this.name=undefined;this.nativeProps={};this.line=1}e.prototype.watchAutoFocus=function(e,t){var n;if(!t&&e){(n=this.textareaRef)===null||n===void 0?void 0:n.focus()}};e.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.textareaRef.focus();return[2]}))}))};e.prototype.render=function(){var e=this;var t=this,n=t.value,a=t.placeholder,o=t.disabled,i=t.maxlength,r=t.autoFocus,l=t.autoHeight,u=t.name,s=t.nativeProps,c=t.handleInput,f=t.handleFocus,g=t.handleBlur,p=t.handleChange;var d={};if(l){d.rows=this.line}return h("textarea",Object.assign({ref:function(t){if(t){e.textareaRef=t;if(r&&t)t.focus()}},class:"taro-textarea ".concat(l?"auto-height":""),value:fixControlledValue(n),placeholder:a,name:u,disabled:o,maxlength:i,autofocus:r,onInput:c,onFocus:f,onBlur:g,onChange:p,onKeyDown:this.handleKeyDown},s,d))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{autoFocus:["watchAutoFocus"]}},enumerable:false,configurable:true});return e}();Textarea.style=indexCss;export{Textarea as taro_textarea_core};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,n,i){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function r(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i["throw"](t))}catch(t){a(t)}}function u(t){t.done?n(t.value):o(t.value).then(r,s)}u((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,r;return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(t){return function(e){return u([t,e])}}function u(s){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,s[0]&&(n=0)),n)try{if(i=1,o&&(a=s[0]&2?o["return"]:s[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;if(o=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1];a=s;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(s);break}if(a[2])n.ops.pop();n.trys.pop();continue}s=e.call(t,n)}catch(t){s=[6,t];o=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-7e6b54cb.system.js"],(function(t){"use strict";var e,n,i,o;return{setters:[function(t){e=t.r;n=t.c;i=t.h;o=t.g}],execute:function(){var a="taro-input-core{display:block}input{display:block;overflow:hidden;height:1.4rem;text-overflow:clip;text-align:inherit;white-space:nowrap}";function r(t,e,n){if(e==="search")t="search";if(n)t="password";if(typeof t==="undefined"){return"text"}if(!t){throw new Error("unexpected type")}if(t==="digit")t="number";return t}function s(t){return t!==null&&t!==void 0?t:""}var u=t("taro_input_core",function(){function t(t){var i=this;e(this,t);this.onInput=n(this,"input",7);this.onPaste=n(this,"paste",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onConfirm=n(this,"confirm",7);this.onChange=n(this,"change",7);this.onKeyDown=n(this,"keydown",7);this.isOnComposition=false;this.isOnPaste=false;this.onInputExcuted=false;this.handleInput=function(t){t.stopPropagation();var e=i,n=e.type,o=e.maxlength,a=e.confirmType,s=e.password;if(!i.isOnComposition&&!i.onInputExcuted){var u=t.target.value;var l=r(n,a,s);i.onInputExcuted=true;if(l==="number"&&u&&o>-1&&o<=u.length){u=u.substring(0,o);t.target.value=u}i.value=u;i.onInput.emit({value:u,cursor:u.length});i.onInputExcuted=false}};this.handlePaste=function(t){t.stopPropagation();i.isOnPaste=true;i.onPaste.emit({value:t.target.value})};this.handleFocus=function(t){t.stopPropagation();i.onInputExcuted=false;i.onFocus.emit({value:t.target.value})};this.handleBlur=function(t){t.stopPropagation();i.onBlur.emit({value:t.target.value})};this.handleChange=function(t){t.stopPropagation();i.onChange.emit({value:t.target.value});if(i.isOnPaste){i.isOnPaste=false;i.value=t.target.value;i.onInput.emit({value:t.target.value,cursor:t.target.value.length})}};this.handleKeyDown=function(t){t.stopPropagation();var e=t.target.value;var n=t.keyCode||t.code;i.onInputExcuted=false;i.onKeyDown.emit({value:e,cursor:e.length,keyCode:n});n===13&&i.onConfirm.emit({value:e})};this.handleComposition=function(t){t.stopPropagation();if(!(t.target instanceof HTMLInputElement))return;if(t.type==="compositionend"){i.isOnComposition=false;i.value=t.target.value;i.onInput.emit({value:t.target.value,cursor:t.target.value.length})}else{i.isOnComposition=true}};this.handleBeforeinput=function(t){if(!t.data)return;var e=t.data&&/[0-9]/.test(t.data);if(i.type==="number"&&!e){t.preventDefault()}if(i.type==="digit"&&!e){if(t.data!=="."||t.data==="."&&t.target.value.indexOf(".")>-1){t.preventDefault()}}};this.value="";this.type=undefined;this.password=false;this.placeholder=undefined;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.confirmType="done";this.name=undefined;this.nativeProps={}}t.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.inputRef.focus();return[2]}))}))};t.prototype.watchAutoFocus=function(t,e){var n;if(!e&&t){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};t.prototype.watchValue=function(t){var e=s(t);if(this.inputRef.value!==e){this.inputRef.value=e}};t.prototype.componentDidLoad=function(){var t=this;var e,n,i,o,a;if(this.type==="file"){this.fileListener=function(){t.onInput.emit()};(e=this.inputRef)===null||e===void 0?void 0:e.addEventListener("change",this.fileListener)}else{(n=this.inputRef)===null||n===void 0?void 0:n.addEventListener("compositionstart",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.addEventListener("compositionend",this.handleComposition);(o=this.inputRef)===null||o===void 0?void 0:o.addEventListener("beforeinput",this.handleBeforeinput);(a=this.inputRef)===null||a===void 0?void 0:a.addEventListener("textInput",this.handleBeforeinput)}};t.prototype.disconnectedCallback=function(){var t,e,n,i,o;if(this.type==="file"){(t=this.inputRef)===null||t===void 0?void 0:t.removeEventListener("change",this.fileListener)}else{(e=this.inputRef)===null||e===void 0?void 0:e.removeEventListener("compositionstart",this.handleComposition);(n=this.inputRef)===null||n===void 0?void 0:n.removeEventListener("compositionend",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.removeEventListener("beforeinput",this.handleBeforeinput);(o=this.inputRef)===null||o===void 0?void 0:o.removeEventListener("textInput",this.handleBeforeinput)}};t.prototype.render=function(){var t=this;var e=this,n=e.value,o=e.type,a=e.password,u=e.placeholder,l=e.autoFocus,h=e.disabled,p=e.maxlength,f=e.confirmType,c=e.name,d=e.nativeProps;return i("input",Object.assign({ref:function(e){t.inputRef=e;if(l&&e)e.focus()},class:"weui-input",type:r(o,f,a),placeholder:u,autoFocus:l,disabled:h,maxlength:p,name:c,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},d,{value:s(n)}))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{autoFocus:["watchAutoFocus"],value:["watchValue"]}},enumerable:false,configurable:true});return t}());u.style=a}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function r(e){try{l(o.next(e))}catch(e){a(e)}}function u(e){try{l(o["throw"](e))}catch(e){a(e)}}function l(e){e.done?n(e.value):i(e.value).then(r,u)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,i,a,r;return r={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function u(e){return function(t){return l([e,t])}}function l(u){if(o)throw new TypeError("Generator is already executing.");while(r&&(r=0,u[0]&&(n=0)),n)try{if(o=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;i=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1];a=u;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(u);break}if(a[2])n.ops.pop();n.trys.pop();continue}u=t.call(e,n)}catch(e){u=[6,e];i=0}finally{o=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-7e6b54cb.system.js"],(function(e){"use strict";var t,n,o,i;return{setters:[function(e){t=e.r;n=e.c;o=e.h;i=e.g}],execute:function(){var a="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";function r(e){return e!==null&&e!==void 0?e:""}var u=e("taro_textarea_core",function(){function e(e){var o=this;t(this,e);this.onInput=n(this,"input",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onConfirm=n(this,"confirm",7);this.onChange=n(this,"change",7);this.onLineChange=n(this,"linechange",7);this.onKeyDown=n(this,"keydown",7);this.handleInput=function(e){e.stopPropagation();o.handleLineChange();var t=e.target.value||"";o.onInput.emit({value:t,cursor:t.length})};this.handleFocus=function(e){e.stopPropagation();o.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){e.stopPropagation();o.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();o.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=o.getNumberOfLines();if(e!==o.line){o.line=e;o.onLineChange.emit({height:o.textareaRef.clientHeight,lineCount:o.line})}};this.handleKeyDown=function(e){e.stopPropagation();var t=e.target.value;var n=e.keyCode||e.code;o.onKeyDown.emit({value:t,cursor:t.length,keyCode:n});n===13&&o.onConfirm.emit({value:t})};this.calculateContentHeight=function(e,t){var n=e.style.height,o=e.offsetHeight,i=e.scrollHeight,a=e.style.overflow,r=e.style.minHeight||null;if(o>=i){e.style.minHeight=0;e.style.height=o+t+"px";e.style.overflow="hidden";if(i<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(o-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=o+++"px"}e.style.height=n;e.style.overflow=a;e.style.minHeight=r;return o}}else{return i}};this.getNumberOfLines=function(){var e=o.textareaRef,t=window.getComputedStyle?window.getComputedStyle(e):e.style,n=parseInt(t.lineHeight,10),i=o.calculateContentHeight(e,n),a=Math.floor(i/n);return a};this.value=
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function r(e){try{l(o.next(e))}catch(e){a(e)}}function u(e){try{l(o["throw"](e))}catch(e){a(e)}}function l(e){e.done?n(e.value):i(e.value).then(r,u)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,i,a,r;return r={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function u(e){return function(t){return l([e,t])}}function l(u){if(o)throw new TypeError("Generator is already executing.");while(r&&(r=0,u[0]&&(n=0)),n)try{if(o=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;i=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1];a=u;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(u);break}if(a[2])n.ops.pop();n.trys.pop();continue}u=t.call(e,n)}catch(e){u=[6,e];i=0}finally{o=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-7e6b54cb.system.js"],(function(e){"use strict";var t,n,o,i;return{setters:[function(e){t=e.r;n=e.c;o=e.h;i=e.g}],execute:function(){var a="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";function r(e){return e!==null&&e!==void 0?e:""}var u=e("taro_textarea_core",function(){function e(e){var o=this;t(this,e);this.onInput=n(this,"input",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onConfirm=n(this,"confirm",7);this.onChange=n(this,"change",7);this.onLineChange=n(this,"linechange",7);this.onKeyDown=n(this,"keydown",7);this.handleInput=function(e){e.stopPropagation();o.handleLineChange();var t=e.target.value||"";o.onInput.emit({value:t,cursor:t.length})};this.handleFocus=function(e){e.stopPropagation();o.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){e.stopPropagation();o.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();o.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=o.getNumberOfLines();if(e!==o.line){o.line=e;o.onLineChange.emit({height:o.textareaRef.clientHeight,lineCount:o.line})}};this.handleKeyDown=function(e){e.stopPropagation();var t=e.target.value;var n=e.keyCode||e.code;o.onKeyDown.emit({value:t,cursor:t.length,keyCode:n});n===13&&o.onConfirm.emit({value:t})};this.calculateContentHeight=function(e,t){var n=e.style.height,o=e.offsetHeight,i=e.scrollHeight,a=e.style.overflow,r=e.style.minHeight||null;if(o>=i){e.style.minHeight=0;e.style.height=o+t+"px";e.style.overflow="hidden";if(i<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(o-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=o+++"px"}e.style.height=n;e.style.overflow=a;e.style.minHeight=r;return o}}else{return i}};this.getNumberOfLines=function(){var e=o.textareaRef,t=window.getComputedStyle?window.getComputedStyle(e):e.style,n=parseInt(t.lineHeight,10),i=o.calculateContentHeight(e,n),a=Math.floor(i/n);return a};this.value="";this.placeholder=undefined;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.autoHeight=false;this.name=undefined;this.nativeProps={};this.line=1}e.prototype.watchAutoFocus=function(e,t){var n;if(!t&&e){(n=this.textareaRef)===null||n===void 0?void 0:n.focus()}};e.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.textareaRef.focus();return[2]}))}))};e.prototype.render=function(){var e=this;var t=this,n=t.value,i=t.placeholder,a=t.disabled,u=t.maxlength,l=t.autoFocus,s=t.autoHeight,h=t.name,c=t.nativeProps,f=t.handleInput,g=t.handleFocus,p=t.handleBlur,d=t.handleChange;var v={};if(s){v.rows=this.line}return o("textarea",Object.assign({ref:function(t){if(t){e.textareaRef=t;if(l&&t)t.focus()}},class:"taro-textarea ".concat(s?"auto-height":""),value:r(n),placeholder:i,name:h,disabled:a,maxlength:u,autofocus:l,onInput:f,onFocus:g,onBlur:p,onChange:d,onKeyDown:this.handleKeyDown},c,v))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{autoFocus:["watchAutoFocus"]}},enumerable:false,configurable:true});return e}());u.style=a}}}));
|
|
@@ -0,0 +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-387314fa.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 M=".weui-picker,.weui-picker__hd{font-size:12px}";var D=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.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.handleColumnChange=function(e,t){r.onColumnChange.emit({column:Number(t),value:(k-e)/w})};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.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")}}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=this,i=t.name,a=t.mode,u=t.fadeOut,s=t.hidden;var h;switch(a){case"multiSelector":h=this.getMultiSelector();break;case"time":h=this.getTimeSelector();break;case"date":h=this.getDateSelector();break;default:h=this.getSelector()}var l=o("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":u});var c=o("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":u});var d=s?{display:"none"}:{};return n(r,null,n("div",{onClick:this.showPicker},n("slot",null),n("input",{type:"hidden",name:i,value:v(this.pickerValue)})),n("div",{class:"weui-picker__overlay",style:d,ref:function(t){e.overlay=t}},n("div",{class:l,onClick:this.handleCancel}),n("div",{class:c},n("div",{class:"weui-picker__hd"},n("div",{class:"weui-picker__action",onClick:this.handleCancel},"取消"),n("div",{class:"weui-picker__action",onClick:this.handleChange},"确定")),n("div",{class:"weui-picker__bd"},h),n("input",{type:"hidden",name:i,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}());D.style=M;var b=e("taro_picker_group",function(){function e(e){t(this,e);this.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.onColumnChange=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,v;return __generator(this,(function(g){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.onColumnChange,u=t.columnId;s=0;h=-w*(n.length-1);l=e;this.touchEnd=true;if(!this.hadMove){d=window.innerHeight;f=d-C/2;c=r-k-(l-f);if(i==="time"){if(u==="0"){if(c>-w*2.5){return[2,this.formulaUnlimitedScroll(24,c,"up")]}if(c<-w*28.5){return[2,this.formulaUnlimitedScroll(24,c,"down")]}}else if(u==="1"){if(c>-w*2.5){return[2,this.formulaUnlimitedScroll(60,c,"up")]}if(c<-w*64.5){return[2,this.formulaUnlimitedScroll(60,c,"down")]}}}}else{c=r-k}if(c>s)c=0;if(c<h)c=h;p=Math.round(c/-w);v=k-w*p;if(this.mode==="date"){if(this.columnId==="0"){this.updateDay(+this.range[p].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[p].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[p].replace(/[^0-9]/gi,""),2)}}a(v,u,i==="time");o&&o(v,u);return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){e.preventDefault();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){e.preventDefault();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,g as h}from"./p-9137dcab.js";function o(t,i,s){if("search"===i&&(t="search"),s&&(t="password"),void 0===t)return"text";if(!t)throw new Error("unexpected type");return"digit"===t&&(t="number"),t}function e(t){return null!=t?t:""}const n=class{constructor(s){t(this,s),this.onInput=i(this,"input",7),this.onPaste=i(this,"paste",7),this.onFocus=i(this,"focus",7),this.onBlur=i(this,"blur",7),this.onConfirm=i(this,"confirm",7),this.onChange=i(this,"change",7),this.onKeyDown=i(this,"keydown",7),this.isOnComposition=!1,this.isOnPaste=!1,this.onInputExcuted=!1,this.handleInput=t=>{t.stopPropagation();const{type:i,maxlength:s,confirmType:h,password:e}=this;if(!this.isOnComposition&&!this.onInputExcuted){let n=t.target.value;const u=o(i,h,e);this.onInputExcuted=!0,"number"===u&&n&&s>-1&&s<=n.length&&(n=n.substring(0,s),t.target.value=n),this.value=n,this.onInput.emit({value:n,cursor:n.length}),this.onInputExcuted=!1}},this.handlePaste=t=>{t.stopPropagation(),this.isOnPaste=!0,this.onPaste.emit({value:t.target.value})},this.handleFocus=t=>{t.stopPropagation(),this.onInputExcuted=!1,this.onFocus.emit({value:t.target.value})},this.handleBlur=t=>{t.stopPropagation(),this.onBlur.emit({value:t.target.value})},this.handleChange=t=>{t.stopPropagation(),this.onChange.emit({value:t.target.value}),this.isOnPaste&&(this.isOnPaste=!1,this.value=t.target.value,this.onInput.emit({value:t.target.value,cursor:t.target.value.length}))},this.handleKeyDown=t=>{t.stopPropagation();const{value:i}=t.target,s=t.keyCode||t.code;this.onInputExcuted=!1,this.onKeyDown.emit({value:i,cursor:i.length,keyCode:s}),13===s&&this.onConfirm.emit({value:i})},this.handleComposition=t=>{t.stopPropagation(),t.target instanceof HTMLInputElement&&("compositionend"===t.type?(this.isOnComposition=!1,this.value=t.target.value,this.onInput.emit({value:t.target.value,cursor:t.target.value.length})):this.isOnComposition=!0)},this.handleBeforeinput=t=>{if(!t.data)return;const i=t.data&&/[0-9]/.test(t.data);"number"!==this.type||i||t.preventDefault(),"digit"!==this.type||i||("."!==t.data||"."===t.data&&t.target.value.indexOf(".")>-1)&&t.preventDefault()},this.value="",this.type=void 0,this.password=!1,this.placeholder=void 0,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.confirmType="done",this.name=void 0,this.nativeProps={}}async focus(){this.inputRef.focus()}watchAutoFocus(t,i){var s;!i&&t&&(null===(s=this.inputRef)||void 0===s||s.focus())}watchValue(t){const i=e(t);this.inputRef.value!==i&&(this.inputRef.value=i)}componentDidLoad(){var t,i,s,h,o;"file"===this.type?(this.fileListener=()=>{this.onInput.emit()},null===(t=this.inputRef)||void 0===t||t.addEventListener("change",this.fileListener)):(null===(i=this.inputRef)||void 0===i||i.addEventListener("compositionstart",this.handleComposition),null===(s=this.inputRef)||void 0===s||s.addEventListener("compositionend",this.handleComposition),null===(h=this.inputRef)||void 0===h||h.addEventListener("beforeinput",this.handleBeforeinput),null===(o=this.inputRef)||void 0===o||o.addEventListener("textInput",this.handleBeforeinput))}disconnectedCallback(){var t,i,s,h,o;"file"===this.type?null===(t=this.inputRef)||void 0===t||t.removeEventListener("change",this.fileListener):(null===(i=this.inputRef)||void 0===i||i.removeEventListener("compositionstart",this.handleComposition),null===(s=this.inputRef)||void 0===s||s.removeEventListener("compositionend",this.handleComposition),null===(h=this.inputRef)||void 0===h||h.removeEventListener("beforeinput",this.handleBeforeinput),null===(o=this.inputRef)||void 0===o||o.removeEventListener("textInput",this.handleBeforeinput))}render(){const{value:t,type:i,password:h,placeholder:n,autoFocus:u,disabled:a,maxlength:r,confirmType:l,name:c,nativeProps:d}=this;return s("input",Object.assign({ref:t=>{this.inputRef=t,u&&t&&t.focus()},class:"weui-input",type:o(i,l,h),placeholder:n,autoFocus:u,disabled:a,maxlength:r,name:c,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},d,{value:e(t)}))}get el(){return h(this)}static get watchers(){return{autoFocus:["watchAutoFocus"],value:["watchValue"]}}};n.style="taro-input-core{display:block}input{display:block;overflow:hidden;height:1.4rem;text-overflow:clip;text-align:inherit;white-space:nowrap}";export{n as taro_input_core}
|
|
@@ -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-2fad2a65.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.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.handleColumnChange=(t,i)=>{this.onColumnChange.emit({column:Number(i),value:(_-t)/k})},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.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){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(){const{name:t,mode:i,fadeOut:h,hidden:o}=this;let r;switch(i){case"multiSelector":r=this.getMultiSelector();break;case"time":r=this.getTimeSelector();break;case"date":r=this.getDateSelector();break;default:r=this.getSelector()}const a=n("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":h}),c=n("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":h}),u=o?{display:"none"}:{};return s(e,null,s("div",{onClick:this.showPicker},s("slot",null),s("input",{type:"hidden",name:t,value:p(this.pickerValue)})),s("div",{class:"weui-picker__overlay",style:u,ref:t=>{this.overlay=t}},s("div",{class:a,onClick:this.handleCancel}),s("div",{class:c},s("div",{class:"weui-picker__hd"},s("div",{class:"weui-picker__action",onClick:this.handleCancel},"取消"),s("div",{class:"weui-picker__action",onClick:this.handleChange},"确定")),s("div",{class:"weui-picker__bd"},r),s("input",{type:"hidden",name:t,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(i){t(this,i),this.mode=void 0,this.range=[],this.rangeKey=void 0,this.height=void 0,this.columnId=void 0,this.updateHeight=void 0,this.onColumnChange=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,onColumnChange:n,columnId:o}=this,r=-34*(s.length-1),a=t;let c;if(this.touchEnd=!0,this.hadMove)c=e-_;else{const t=window.innerHeight;if(c=e-_-(a-(t-119)),"time"===i)if("0"===o){if(c>-85)return this.formulaUnlimitedScroll(24,c,"up");if(c<-969)return this.formulaUnlimitedScroll(24,c,"down")}else if("1"===o){if(c>-85)return this.formulaUnlimitedScroll(60,c,"up");if(c<-2193)return this.formulaUnlimitedScroll(60,c,"down")}}c>0&&(c=0),c<r&&(c=r);const u=Math.round(c/-34),d=_-k*u;"date"===this.mode&&("0"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),0),"1"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),1),"2"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),2)),h(d,o,"time"===i),n&&n(d,o)}onMouseDown(t){this.isMove=!0,this.handleMoveStart(t.clientY)}onMouseMove(t){t.preventDefault(),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){t.preventDefault(),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":[1],"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-edbb1a17.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-5905e3ef.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-2d1b4dcc.system",[[0,"taro-ad-core"]]],["p-052da7f0.system",[[0,"taro-ad-custom-core"]]],["p-6127b1b6.system",[[0,"taro-animation-video-core"]]],["p-5640e9f4.system",[[0,"taro-animation-view-core"]]],["p-69cd1f2a.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-b6d4634f.system",[[0,"taro-aweme-data-core"]]],["p-357ba712.system",[[0,"taro-block-core"]]],["p-cd90bead.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-907d9d01.system",[[0,"taro-camera-core"]]],["p-f7927285.system",[[0,"taro-canvas-core",{"canvasId":[1,"canvas-id"],"nativeProps":[16]}]]],["p-88d2b41b.system",[[0,"taro-channel-live-core"]]],["p-8201ee31.system",[[0,"taro-channel-video-core"]]],["p-ab726c20.system",[[0,"taro-comment-detail-core"]]],["p-f11c9c37.system",[[0,"taro-comment-list-core"]]],["p-5dab46cd.system",[[0,"taro-contact-button-core"]]],["p-7e8e355b.system",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-c2322741.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-3094bda6.system",[[0,"taro-editor-core"]]],["p-e53508c1.system",[[0,"taro-follow-swan-core"]]],["p-fd7ff0f3.system",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-85a7daeb.system",[[0,"taro-functional-page-navigator-core"]]],["p-da239b8b.system",[[0,"taro-grid-view-core"]]],["p-58b19305.system",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-e5f78321.system",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32]}]]],["p-07302165.system",[[0,"taro-inline-payment-panel-core"]]],["p-cc7b95fd.system",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-af3fa859.system",[[0,"taro-keyboard-accessory-core"]]],["p-b5b30493.system",[[4,"taro-label-core",{"for":[1]}]]],["p-afb3895c.system",[[0,"taro-lifestyle-core"]]],["p-66b0b419.system",[[0,"taro-like-core"]]],["p-0517f107.system",[[0,"taro-list-view-core"]]],["p-9d9ede17.system",[[0,"taro-live-player-core"]]],["p-1f39576a.system",[[0,"taro-live-pusher-core"]]],["p-bcf80126.system",[[0,"taro-login-core"]]],["p-6d4b7e5c.system",[[0,"taro-lottie-core"]]],["p-cc70bb7a.system",[[0,"taro-map-core"]]],["p-f534057e.system",[[0,"taro-match-media-core"]]],["p-227e33fc.system",[[0,"taro-native-slot-core"]]],["p-79c3fde3.system",[[0,"taro-navigation-bar-core"]]],["p-97f0ad72.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-57b9943c.system",[[0,"taro-official-account-core"]]],["p-81f2ad70.system",[[0,"taro-open-data-core"]]],["p-9ac947ac.system",[[0,"taro-page-container-core"]]],["p-1b3d41d3.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-6800ccdc.system",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-c43c5e89.system",[[0,"taro-rich-text-core",{"nodes":[1]}]]],["p-fa0f6dab.system",[[0,"taro-root-portal-core"]]],["p-53ef8a6c.system",[[0,"taro-rtc-room-core"]]],["p-fa6c022a.system",[[0,"taro-rtc-room-item-core"]]],["p-c0ec2f41.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"],"animated":[4,"scroll-with-animation"],"mpScrollToMethod":[64],"mpScrollIntoViewMethod":[64]},[[3,"scroll","handleScroll"]]]]],["p-1974e52e.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-c1073ed6.system",[[0,"taro-slot-core"]]],["p-5c1e6b1c.system",[[0,"taro-sticky-header-core"]]],["p-ebdd350f.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-898db637.system",[[0,"taro-tab-item-core"]]],["p-7c2454dd.system",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-90333d0a.system",[[0,"taro-tabs-core"]]],["p-fa43177b.system",[[4,"taro-text-core",{"selectable":[4]}]]],["p-2c89af5b.system",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-16336cc6.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-eaa370a9.system",[[0,"taro-voip-room-core"]]],["p-208e438c.system",[[0,"taro-web-view-core",{"src":[1]}]]],["p-735c2a72.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],"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],"onColumnChange":[16],"updateDay":[16],"startY":[32],"preY":[32],"hadMove":[32],"touchEnd":[32],"isMove":[32],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-18703731.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":[1],"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-edbb1a17.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-5905e3ef.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-2d1b4dcc.system",[[0,"taro-ad-core"]]],["p-052da7f0.system",[[0,"taro-ad-custom-core"]]],["p-6127b1b6.system",[[0,"taro-animation-video-core"]]],["p-5640e9f4.system",[[0,"taro-animation-view-core"]]],["p-69cd1f2a.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-b6d4634f.system",[[0,"taro-aweme-data-core"]]],["p-357ba712.system",[[0,"taro-block-core"]]],["p-cd90bead.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-907d9d01.system",[[0,"taro-camera-core"]]],["p-f7927285.system",[[0,"taro-canvas-core",{"canvasId":[1,"canvas-id"],"nativeProps":[16]}]]],["p-88d2b41b.system",[[0,"taro-channel-live-core"]]],["p-8201ee31.system",[[0,"taro-channel-video-core"]]],["p-ab726c20.system",[[0,"taro-comment-detail-core"]]],["p-f11c9c37.system",[[0,"taro-comment-list-core"]]],["p-5dab46cd.system",[[0,"taro-contact-button-core"]]],["p-7e8e355b.system",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-c2322741.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-3094bda6.system",[[0,"taro-editor-core"]]],["p-e53508c1.system",[[0,"taro-follow-swan-core"]]],["p-fd7ff0f3.system",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-85a7daeb.system",[[0,"taro-functional-page-navigator-core"]]],["p-da239b8b.system",[[0,"taro-grid-view-core"]]],["p-58b19305.system",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-e5f78321.system",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32]}]]],["p-07302165.system",[[0,"taro-inline-payment-panel-core"]]],["p-030715f1.system",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-af3fa859.system",[[0,"taro-keyboard-accessory-core"]]],["p-b5b30493.system",[[4,"taro-label-core",{"for":[1]}]]],["p-afb3895c.system",[[0,"taro-lifestyle-core"]]],["p-66b0b419.system",[[0,"taro-like-core"]]],["p-0517f107.system",[[0,"taro-list-view-core"]]],["p-9d9ede17.system",[[0,"taro-live-player-core"]]],["p-1f39576a.system",[[0,"taro-live-pusher-core"]]],["p-bcf80126.system",[[0,"taro-login-core"]]],["p-6d4b7e5c.system",[[0,"taro-lottie-core"]]],["p-cc70bb7a.system",[[0,"taro-map-core"]]],["p-f534057e.system",[[0,"taro-match-media-core"]]],["p-227e33fc.system",[[0,"taro-native-slot-core"]]],["p-79c3fde3.system",[[0,"taro-navigation-bar-core"]]],["p-97f0ad72.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-57b9943c.system",[[0,"taro-official-account-core"]]],["p-81f2ad70.system",[[0,"taro-open-data-core"]]],["p-9ac947ac.system",[[0,"taro-page-container-core"]]],["p-1b3d41d3.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-6800ccdc.system",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-c43c5e89.system",[[0,"taro-rich-text-core",{"nodes":[1]}]]],["p-fa0f6dab.system",[[0,"taro-root-portal-core"]]],["p-53ef8a6c.system",[[0,"taro-rtc-room-core"]]],["p-fa6c022a.system",[[0,"taro-rtc-room-item-core"]]],["p-c0ec2f41.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"],"animated":[4,"scroll-with-animation"],"mpScrollToMethod":[64],"mpScrollIntoViewMethod":[64]},[[3,"scroll","handleScroll"]]]]],["p-1974e52e.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-c1073ed6.system",[[0,"taro-slot-core"]]],["p-5c1e6b1c.system",[[0,"taro-sticky-header-core"]]],["p-ebdd350f.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-898db637.system",[[0,"taro-tab-item-core"]]],["p-7c2454dd.system",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-90333d0a.system",[[0,"taro-tabs-core"]]],["p-fa43177b.system",[[4,"taro-text-core",{"selectable":[4]}]]],["p-657cb6e4.system",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-16336cc6.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-eaa370a9.system",[[0,"taro-voip-room-core"]]],["p-208e438c.system",[[0,"taro-web-view-core",{"src":[1]}]]],["p-8414da06.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],"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],"onColumnChange":[16],"updateDay":[16],"startY":[32],"preY":[32],"hadMove":[32],"touchEnd":[32],"isMove":[32],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-18703731.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)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as s,g as i}from"./p-9137dcab.js";function h(t){return null!=t?t:""}const a=class{constructor(s){t(this,s),this.onInput=e(this,"input",7),this.onFocus=e(this,"focus",7),this.onBlur=e(this,"blur",7),this.onConfirm=e(this,"confirm",7),this.onChange=e(this,"change",7),this.onLineChange=e(this,"linechange",7),this.onKeyDown=e(this,"keydown",7),this.handleInput=t=>{t.stopPropagation(),this.handleLineChange();const e=t.target.value||"";this.onInput.emit({value:e,cursor:e.length})},this.handleFocus=t=>{t.stopPropagation(),this.onFocus.emit({value:t.target.value})},this.handleBlur=t=>{t.stopPropagation(),this.onBlur.emit({value:t.target.value})},this.handleChange=t=>{t.stopPropagation(),this.onChange.emit({value:t.target.value})},this.handleLineChange=()=>{const t=this.getNumberOfLines();t!==this.line&&(this.line=t,this.onLineChange.emit({height:this.textareaRef.clientHeight,lineCount:this.line}))},this.handleKeyDown=t=>{t.stopPropagation();const{value:e}=t.target,s=t.keyCode||t.code;this.onKeyDown.emit({value:e,cursor:e.length,keyCode:s}),13===s&&this.onConfirm.emit({value:e})},this.calculateContentHeight=(t,e)=>{let s=t.style.height,i=t.offsetHeight,h=t.scrollHeight,a=t.style.overflow,o=t.style.minHeight||null;if(!(i>=h))return h;if(t.style.minHeight=0,t.style.height=i+e+"px",t.style.overflow="hidden",h<t.scrollHeight){for(;t.offsetHeight>=t.scrollHeight;)t.style.height=(i-=e)+"px";for(;t.offsetHeight<t.scrollHeight;)t.style.height=i+++"px";return t.style.height=s,t.style.overflow=a,t.style.minHeight=o,i}},this.getNumberOfLines=()=>{const t=this.textareaRef,e=window.getComputedStyle?window.getComputedStyle(t):t.style,s=parseInt(e.lineHeight,10),i=this.calculateContentHeight(t,s);return Math.floor(i/s)},this.value="",this.placeholder=void 0,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.autoHeight=!1,this.name=void 0,this.nativeProps={},this.line=1}watchAutoFocus(t,e){var s;!e&&t&&(null===(s=this.textareaRef)||void 0===s||s.focus())}async focus(){this.textareaRef.focus()}render(){const{value:t,placeholder:e,disabled:i,maxlength:a,autoFocus:o,autoHeight:n,name:r,nativeProps:u,handleInput:c,handleFocus:l,handleBlur:d,handleChange:p}=this,g={};return n&&(g.rows=this.line),s("textarea",Object.assign({ref:t=>{t&&(this.textareaRef=t,o&&t&&t.focus())},class:"taro-textarea "+(n?"auto-height":""),value:h(t),placeholder:e,name:r,disabled:i,maxlength:a,autofocus:o,onInput:c,onFocus:l,onBlur:d,onChange:p,onKeyDown:this.handleKeyDown},u,g))}get el(){return i(this)}static get watchers(){return{autoFocus:["watchAutoFocus"]}}};a.style="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";export{a as taro_textarea_core}
|
|
@@ -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":[1],"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-31bba7c3",[[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-1e43a2d5",[[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-7b3b8057",[[0,"taro-ad-core"]]],["p-6db97374",[[0,"taro-ad-custom-core"]]],["p-2af69b72",[[0,"taro-animation-video-core"]]],["p-139e6251",[[0,"taro-animation-view-core"]]],["p-a8565231",[[0,"taro-ar-camera-core"]]],["p-bf0e0394",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["p-f7b32c6b",[[0,"taro-aweme-data-core"]]],["p-9a5fbb2e",[[0,"taro-block-core"]]],["p-c490cd45",[[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-d34a6c04",[[0,"taro-camera-core"]]],["p-469ee343",[[0,"taro-canvas-core",{"canvasId":[1,"canvas-id"],"nativeProps":[16]}]]],["p-fb983850",[[0,"taro-channel-live-core"]]],["p-c11a42e0",[[0,"taro-channel-video-core"]]],["p-9aeb7995",[[0,"taro-comment-detail-core"]]],["p-af8e521a",[[0,"taro-comment-list-core"]]],["p-b027181b",[[0,"taro-contact-button-core"]]],["p-38ee526a",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-3f9f3448",[[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-1404c119",[[0,"taro-editor-core"]]],["p-a3a1a779",[[0,"taro-follow-swan-core"]]],["p-43720011",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-1c4e3899",[[0,"taro-functional-page-navigator-core"]]],["p-8c0b740e",[[0,"taro-grid-view-core"]]],["p-4e9bd4f6",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-385d8aed",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32]}]]],["p-801f09b8",[[0,"taro-inline-payment-panel-core"]]],["p-a132ebb9",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-904df510",[[0,"taro-keyboard-accessory-core"]]],["p-f533bc2f",[[4,"taro-label-core",{"for":[1]}]]],["p-204bd245",[[0,"taro-lifestyle-core"]]],["p-407ca16e",[[0,"taro-like-core"]]],["p-355e4dbc",[[0,"taro-list-view-core"]]],["p-66f7eea6",[[0,"taro-live-player-core"]]],["p-af9ef8b4",[[0,"taro-live-pusher-core"]]],["p-50902cd0",[[0,"taro-login-core"]]],["p-9b6550fc",[[0,"taro-lottie-core"]]],["p-6e115968",[[0,"taro-map-core"]]],["p-7d635413",[[0,"taro-match-media-core"]]],["p-b4ea72ea",[[0,"taro-native-slot-core"]]],["p-9046110a",[[0,"taro-navigation-bar-core"]]],["p-b898d734",[[0,"taro-navigator-core",{"hoverClass":[1,"hover-class"],"url":[1],"openType":[1,"open-type"],"isHover":[4,"is-hover"],"delta":[2]},[[0,"click","onClick"]]]]],["p-bdc30301",[[0,"taro-official-account-core"]]],["p-b4f3d0ab",[[0,"taro-open-data-core"]]],["p-e3480c4c",[[0,"taro-page-container-core"]]],["p-86280254",[[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-ab2d4f12",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-5b67a98e",[[0,"taro-rich-text-core",{"nodes":[1]}]]],["p-5613907c",[[0,"taro-root-portal-core"]]],["p-b235e43c",[[0,"taro-rtc-room-core"]]],["p-46b8f89b",[[0,"taro-rtc-room-item-core"]]],["p-25adb80c",[[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"],"animated":[4,"scroll-with-animation"],"mpScrollToMethod":[64],"mpScrollIntoViewMethod":[64]},[[3,"scroll","handleScroll"]]]]],["p-486d0ec7",[[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-cc164fa3",[[0,"taro-slot-core"]]],["p-71b54f06",[[0,"taro-sticky-header-core"]]],["p-3d8c9dfb",[[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-6f84e936",[[0,"taro-tab-item-core"]]],["p-df4c2f21",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-968b7c1d",[[0,"taro-tabs-core"]]],["p-ed011ff9",[[4,"taro-text-core",{"selectable":[4]}]]],["p-d9e2e3aa",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-ca3a269f",[[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-137531b6",[[0,"taro-voip-room-core"]]],["p-30805bdf",[[0,"taro-web-view-core",{"src":[1]}]]],["p-589293fd",[[4,"taro-picker-core",{"mode":[1],"disabled":[4],"range":[16],"rangeKey":[1,"range-key"],"value":[1032],"start":[1],"end":[1],"fields":[1],"name":[1],"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],"onColumnChange":[16],"updateDay":[16],"startY":[32],"preY":[32],"hadMove":[32],"touchEnd":[32],"isMove":[32],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-dcbb7b2d",[[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":[1],"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-31bba7c3",[[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-1e43a2d5",[[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-7b3b8057",[[0,"taro-ad-core"]]],["p-6db97374",[[0,"taro-ad-custom-core"]]],["p-2af69b72",[[0,"taro-animation-video-core"]]],["p-139e6251",[[0,"taro-animation-view-core"]]],["p-a8565231",[[0,"taro-ar-camera-core"]]],["p-bf0e0394",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["p-f7b32c6b",[[0,"taro-aweme-data-core"]]],["p-9a5fbb2e",[[0,"taro-block-core"]]],["p-c490cd45",[[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-d34a6c04",[[0,"taro-camera-core"]]],["p-469ee343",[[0,"taro-canvas-core",{"canvasId":[1,"canvas-id"],"nativeProps":[16]}]]],["p-fb983850",[[0,"taro-channel-live-core"]]],["p-c11a42e0",[[0,"taro-channel-video-core"]]],["p-9aeb7995",[[0,"taro-comment-detail-core"]]],["p-af8e521a",[[0,"taro-comment-list-core"]]],["p-b027181b",[[0,"taro-contact-button-core"]]],["p-38ee526a",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-3f9f3448",[[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-1404c119",[[0,"taro-editor-core"]]],["p-a3a1a779",[[0,"taro-follow-swan-core"]]],["p-43720011",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-1c4e3899",[[0,"taro-functional-page-navigator-core"]]],["p-8c0b740e",[[0,"taro-grid-view-core"]]],["p-4e9bd4f6",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-385d8aed",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32]}]]],["p-801f09b8",[[0,"taro-inline-payment-panel-core"]]],["p-98d771c3",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-904df510",[[0,"taro-keyboard-accessory-core"]]],["p-f533bc2f",[[4,"taro-label-core",{"for":[1]}]]],["p-204bd245",[[0,"taro-lifestyle-core"]]],["p-407ca16e",[[0,"taro-like-core"]]],["p-355e4dbc",[[0,"taro-list-view-core"]]],["p-66f7eea6",[[0,"taro-live-player-core"]]],["p-af9ef8b4",[[0,"taro-live-pusher-core"]]],["p-50902cd0",[[0,"taro-login-core"]]],["p-9b6550fc",[[0,"taro-lottie-core"]]],["p-6e115968",[[0,"taro-map-core"]]],["p-7d635413",[[0,"taro-match-media-core"]]],["p-b4ea72ea",[[0,"taro-native-slot-core"]]],["p-9046110a",[[0,"taro-navigation-bar-core"]]],["p-b898d734",[[0,"taro-navigator-core",{"hoverClass":[1,"hover-class"],"url":[1],"openType":[1,"open-type"],"isHover":[4,"is-hover"],"delta":[2]},[[0,"click","onClick"]]]]],["p-bdc30301",[[0,"taro-official-account-core"]]],["p-b4f3d0ab",[[0,"taro-open-data-core"]]],["p-e3480c4c",[[0,"taro-page-container-core"]]],["p-86280254",[[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-ab2d4f12",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-5b67a98e",[[0,"taro-rich-text-core",{"nodes":[1]}]]],["p-5613907c",[[0,"taro-root-portal-core"]]],["p-b235e43c",[[0,"taro-rtc-room-core"]]],["p-46b8f89b",[[0,"taro-rtc-room-item-core"]]],["p-25adb80c",[[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"],"animated":[4,"scroll-with-animation"],"mpScrollToMethod":[64],"mpScrollIntoViewMethod":[64]},[[3,"scroll","handleScroll"]]]]],["p-486d0ec7",[[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-cc164fa3",[[0,"taro-slot-core"]]],["p-71b54f06",[[0,"taro-sticky-header-core"]]],["p-3d8c9dfb",[[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-6f84e936",[[0,"taro-tab-item-core"]]],["p-df4c2f21",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-968b7c1d",[[0,"taro-tabs-core"]]],["p-ed011ff9",[[4,"taro-text-core",{"selectable":[4]}]]],["p-f02b6f70",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-ca3a269f",[[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-137531b6",[[0,"taro-voip-room-core"]]],["p-30805bdf",[[0,"taro-web-view-core",{"src":[1]}]]],["p-af2cd702",[[4,"taro-picker-core",{"mode":[1],"disabled":[4],"range":[16],"rangeKey":[1,"range-key"],"value":[1032],"start":[1],"end":[1],"fields":[1],"name":[1],"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],"onColumnChange":[16],"updateDay":[16],"startY":[32],"preY":[32],"hadMove":[32],"touchEnd":[32],"isMove":[32],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-dcbb7b2d",[[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,5 +1,5 @@
|
|
|
1
1
|
import { ComponentInterface, Event, EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import { TaroEvent } from '../../../types';
|
|
2
|
+
import type { TaroEvent } from '../../../types';
|
|
3
3
|
export declare class Input implements ComponentInterface {
|
|
4
4
|
private inputRef;
|
|
5
5
|
private isOnComposition;
|
|
@@ -21,7 +21,6 @@ export declare class Textarea implements ComponentInterface {
|
|
|
21
21
|
onKeyDown: EventEmitter;
|
|
22
22
|
watchAutoFocus(newValue: boolean, oldValue: boolean): void;
|
|
23
23
|
focus(): Promise<void>;
|
|
24
|
-
componentDidLoad(): void;
|
|
25
24
|
handleInput: (e: TaroEvent<HTMLInputElement>) => void;
|
|
26
25
|
handleFocus: (e: TaroEvent<HTMLInputElement> & FocusEvent) => void;
|
|
27
26
|
handleBlur: (e: TaroEvent<HTMLInputElement> & FocusEvent) => void;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { Type } from "./components/icon/icon";
|
|
9
9
|
import { Mode } from "./components/image/image";
|
|
10
|
-
import { Fields, Mode as Mode1 } from "./components/picker/picker";
|
|
10
|
+
import { Fields, Mode as Mode1, PickerValue } from "./components/picker/picker";
|
|
11
11
|
import { Nodes } from "./components/rich-text/rich-text";
|
|
12
12
|
import { ScrollViewContext } from "@tarojs/taro";
|
|
13
13
|
import { Conf } from "./components/tabbar/tabbar";
|
|
@@ -250,7 +250,7 @@ export namespace Components {
|
|
|
250
250
|
"range": any[];
|
|
251
251
|
"rangeKey": string;
|
|
252
252
|
"start": string;
|
|
253
|
-
"value":
|
|
253
|
+
"value": PickerValue;
|
|
254
254
|
}
|
|
255
255
|
interface TaroPickerGroup {
|
|
256
256
|
"columnId": string;
|
|
@@ -1541,7 +1541,7 @@ declare namespace LocalJSX {
|
|
|
1541
1541
|
"range"?: any[];
|
|
1542
1542
|
"rangeKey"?: string;
|
|
1543
1543
|
"start"?: string;
|
|
1544
|
-
"value"?:
|
|
1544
|
+
"value"?: PickerValue;
|
|
1545
1545
|
}
|
|
1546
1546
|
interface TaroPickerGroup {
|
|
1547
1547
|
"columnId"?: string;
|
|
@@ -6,7 +6,7 @@ import React, { createRef, createElement } from 'react';
|
|
|
6
6
|
**/
|
|
7
7
|
const h = React.createElement;
|
|
8
8
|
const SCROLL_VIEW = 'taro-scroll-view-core';
|
|
9
|
-
const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
9
|
+
const IS_NON_DIMENSIONAL = /aspect|acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
10
10
|
// 为了不要覆盖 wc 中 host 内置的 class 和 stencil 加入的 class
|
|
11
11
|
function getClassName(wc, prevProps, props) {
|
|
12
12
|
const classList = Array.from(wc.classList);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactify-wc.js","sources":["../../../../taro-components-library-react/src/component-lib/reactify-wc.ts"],"sourcesContent":["/**\n * https://github.com/BBKolton/reactify-wc/\n * modified event naming\n **/\nimport React, { createElement, createRef } from 'react'\n\nconst h = React.createElement\n\nconst SCROLL_VIEW = 'taro-scroll-view-core'\n\nconst IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i\n\n// 为了不要覆盖 wc 中 host 内置的 class 和 stencil 加入的 class\nfunction getClassName (wc, prevProps, props) {\n const classList = Array.from(wc.classList)\n const oldClassNames = (prevProps.className || prevProps.class || '').split(' ')\n let incomingClassNames = (props.className || props.class || '').split(' ')\n let finalClassNames = []\n\n classList.forEach(classname => {\n if (incomingClassNames.indexOf(classname) > -1) {\n finalClassNames.push(classname)\n incomingClassNames = incomingClassNames.filter(name => name !== classname)\n } else if (oldClassNames.indexOf(classname) === -1) {\n finalClassNames.push(classname)\n }\n })\n\n finalClassNames = [...finalClassNames, ...incomingClassNames]\n\n return finalClassNames.join(' ')\n}\n\nfunction updateStyle (dom, key, val) {\n if (/^--/.test(key)) {\n // css variable\n dom.style.setProperty(key, val)\n } else if (typeof val !== 'number' || IS_NON_DIMENSIONAL.test(key)) {\n dom.style[key] = val\n } else {\n dom.style[key] = val + 'px'\n }\n}\n\nfunction updateProp (ctx, comp, propKey, prevProps, props) {\n const dom = ctx.ref.current\n const val = props[propKey]\n const prevVal = prevProps ? prevProps[propKey] : undefined\n\n if (propKey === 'children') {\n return\n }\n if (propKey.toLowerCase() === 'classname') {\n dom.className = prevProps\n ? getClassName(dom, prevProps, props)\n : val\n return\n }\n if (propKey === 'style') {\n if (typeof val === 'string') {\n dom.setAttribute(propKey, val)\n return\n }\n if (!val) {\n dom.removeAttribute(propKey)\n return\n }\n\n if (prevProps) {\n if (typeof prevVal === 'string') {\n dom.style.cssText = ''\n } else {\n for (const styleKey in prevVal) {\n updateStyle(dom, styleKey, '')\n }\n }\n }\n\n for (const styleKey in val) {\n updateStyle(dom, styleKey, val[styleKey])\n }\n return\n }\n if (/^data-.+/.test(propKey)) {\n dom.setAttribute(propKey, val)\n }\n if (comp === SCROLL_VIEW) {\n if (propKey === 'scrollTop') {\n dom.mpScrollTop = val\n return\n }\n if (propKey === 'scrollLeft') {\n dom.mpScrollLeft = val\n return\n }\n if (propKey === 'scrollIntoView') {\n dom.mpScrollIntoView = val\n return\n }\n }\n if (typeof val === 'function' && propKey.match(/^on[A-Z]/)) {\n const event = propKey.substr(2).toLowerCase()\n\n ctx.eventHandlers.push([event, val])\n return dom.addEventListener(event, val)\n }\n\n if (typeof val === 'string' || typeof val === 'number') {\n dom.setAttribute(propKey, val)\n dom[propKey] = val\n return\n }\n if (typeof val === 'boolean') {\n if (val) {\n dom[propKey] = true\n return dom.setAttribute(\n propKey,\n val\n )\n }\n dom[propKey] = false\n return dom.removeAttribute(propKey)\n }\n dom[propKey] = val\n}\n\nconst reactifyWebComponent = WC => {\n class Index extends React.Component<Record<string, any>> {\n eventHandlers: any[]\n ref: React.RefObject<HTMLElement>\n\n constructor (props) {\n super(props)\n this.eventHandlers = []\n this.ref = createRef()\n }\n\n update (prevProps) {\n this.clearEventHandlers()\n if (!this.ref.current) return\n\n Object.keys(prevProps || {}).forEach((key) => {\n if (key !== 'children' && key !== 'key' && !(key in this.props)) {\n updateProp(this, WC, key, prevProps, this.props)\n }\n })\n\n Object.keys(this.props).forEach((key) => {\n updateProp(this, WC, key, prevProps, this.props)\n })\n }\n\n componentDidUpdate (prevProps) {\n this.update(prevProps)\n }\n\n componentDidMount () {\n const { forwardRef } = this.props\n if (typeof forwardRef === 'function') {\n forwardRef(this.ref.current)\n } else if (forwardRef && typeof forwardRef === 'object' && forwardRef.hasOwnProperty('current')) {\n forwardRef.current = this.ref.current\n } else if (typeof forwardRef === 'string') {\n console.warn('内置组件不支持字符串 ref')\n }\n this.update(undefined)\n }\n\n componentWillUnmount () {\n this.clearEventHandlers()\n }\n\n clearEventHandlers () {\n this.eventHandlers.forEach(([event, handler]) => {\n if (!this.ref.current) return\n this.ref.current.removeEventListener(event, handler)\n })\n this.eventHandlers = []\n }\n\n render () {\n const { children, dangerouslySetInnerHTML } = this.props\n const props: Record<string, any> = {\n ref: this.ref\n }\n if (dangerouslySetInnerHTML) props.dangerouslySetInnerHTML = dangerouslySetInnerHTML\n return createElement(WC, props, children)\n }\n }\n\n // eslint-disable-next-line react/display-name\n return React.forwardRef((props, ref) => (\n h(Index, { ...props, forwardRef: ref })\n ))\n}\n\nexport default reactifyWebComponent\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"reactify-wc.js","sources":["../../../../taro-components-library-react/src/component-lib/reactify-wc.ts"],"sourcesContent":["/**\n * https://github.com/BBKolton/reactify-wc/\n * modified event naming\n **/\nimport React, { createElement, createRef } from 'react'\n\nconst h = React.createElement\n\nconst SCROLL_VIEW = 'taro-scroll-view-core'\n\nconst IS_NON_DIMENSIONAL = /aspect|acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i\n\n// 为了不要覆盖 wc 中 host 内置的 class 和 stencil 加入的 class\nfunction getClassName (wc, prevProps, props) {\n const classList = Array.from(wc.classList)\n const oldClassNames = (prevProps.className || prevProps.class || '').split(' ')\n let incomingClassNames = (props.className || props.class || '').split(' ')\n let finalClassNames = []\n\n classList.forEach(classname => {\n if (incomingClassNames.indexOf(classname) > -1) {\n finalClassNames.push(classname)\n incomingClassNames = incomingClassNames.filter(name => name !== classname)\n } else if (oldClassNames.indexOf(classname) === -1) {\n finalClassNames.push(classname)\n }\n })\n\n finalClassNames = [...finalClassNames, ...incomingClassNames]\n\n return finalClassNames.join(' ')\n}\n\nfunction updateStyle (dom, key, val) {\n if (/^--/.test(key)) {\n // css variable\n dom.style.setProperty(key, val)\n } else if (typeof val !== 'number' || IS_NON_DIMENSIONAL.test(key)) {\n dom.style[key] = val\n } else {\n dom.style[key] = val + 'px'\n }\n}\n\nfunction updateProp (ctx, comp, propKey, prevProps, props) {\n const dom = ctx.ref.current\n const val = props[propKey]\n const prevVal = prevProps ? prevProps[propKey] : undefined\n\n if (propKey === 'children') {\n return\n }\n if (propKey.toLowerCase() === 'classname') {\n dom.className = prevProps\n ? getClassName(dom, prevProps, props)\n : val\n return\n }\n if (propKey === 'style') {\n if (typeof val === 'string') {\n dom.setAttribute(propKey, val)\n return\n }\n if (!val) {\n dom.removeAttribute(propKey)\n return\n }\n\n if (prevProps) {\n if (typeof prevVal === 'string') {\n dom.style.cssText = ''\n } else {\n for (const styleKey in prevVal) {\n updateStyle(dom, styleKey, '')\n }\n }\n }\n\n for (const styleKey in val) {\n updateStyle(dom, styleKey, val[styleKey])\n }\n return\n }\n if (/^data-.+/.test(propKey)) {\n dom.setAttribute(propKey, val)\n }\n if (comp === SCROLL_VIEW) {\n if (propKey === 'scrollTop') {\n dom.mpScrollTop = val\n return\n }\n if (propKey === 'scrollLeft') {\n dom.mpScrollLeft = val\n return\n }\n if (propKey === 'scrollIntoView') {\n dom.mpScrollIntoView = val\n return\n }\n }\n if (typeof val === 'function' && propKey.match(/^on[A-Z]/)) {\n const event = propKey.substr(2).toLowerCase()\n\n ctx.eventHandlers.push([event, val])\n return dom.addEventListener(event, val)\n }\n\n if (typeof val === 'string' || typeof val === 'number') {\n dom.setAttribute(propKey, val)\n dom[propKey] = val\n return\n }\n if (typeof val === 'boolean') {\n if (val) {\n dom[propKey] = true\n return dom.setAttribute(\n propKey,\n val\n )\n }\n dom[propKey] = false\n return dom.removeAttribute(propKey)\n }\n dom[propKey] = val\n}\n\nconst reactifyWebComponent = WC => {\n class Index extends React.Component<Record<string, any>> {\n eventHandlers: any[]\n ref: React.RefObject<HTMLElement>\n\n constructor (props) {\n super(props)\n this.eventHandlers = []\n this.ref = createRef()\n }\n\n update (prevProps) {\n this.clearEventHandlers()\n if (!this.ref.current) return\n\n Object.keys(prevProps || {}).forEach((key) => {\n if (key !== 'children' && key !== 'key' && !(key in this.props)) {\n updateProp(this, WC, key, prevProps, this.props)\n }\n })\n\n Object.keys(this.props).forEach((key) => {\n updateProp(this, WC, key, prevProps, this.props)\n })\n }\n\n componentDidUpdate (prevProps) {\n this.update(prevProps)\n }\n\n componentDidMount () {\n const { forwardRef } = this.props\n if (typeof forwardRef === 'function') {\n forwardRef(this.ref.current)\n } else if (forwardRef && typeof forwardRef === 'object' && forwardRef.hasOwnProperty('current')) {\n forwardRef.current = this.ref.current\n } else if (typeof forwardRef === 'string') {\n console.warn('内置组件不支持字符串 ref')\n }\n this.update(undefined)\n }\n\n componentWillUnmount () {\n this.clearEventHandlers()\n }\n\n clearEventHandlers () {\n this.eventHandlers.forEach(([event, handler]) => {\n if (!this.ref.current) return\n this.ref.current.removeEventListener(event, handler)\n })\n this.eventHandlers = []\n }\n\n render () {\n const { children, dangerouslySetInnerHTML } = this.props\n const props: Record<string, any> = {\n ref: this.ref\n }\n if (dangerouslySetInnerHTML) props.dangerouslySetInnerHTML = dangerouslySetInnerHTML\n return createElement(WC, props, children)\n }\n }\n\n // eslint-disable-next-line react/display-name\n return React.forwardRef((props, ref) => (\n h(Index, { ...props, forwardRef: ref })\n ))\n}\n\nexport default reactifyWebComponent\n"],"names":[],"mappings":"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"}
|
package/lib/vue2/components.d.ts
CHANGED
|
@@ -148,7 +148,7 @@ declare const Picker: import("vue/types/vue").ExtendedVue<Vue<Record<string, any
|
|
|
148
148
|
disabled: boolean;
|
|
149
149
|
range: any[];
|
|
150
150
|
rangeKey: string;
|
|
151
|
-
value:
|
|
151
|
+
value: import("@tarojs/components/dist/types/components/picker/picker").PickerValue;
|
|
152
152
|
start: string;
|
|
153
153
|
end: string;
|
|
154
154
|
fields: import("@tarojs/components/dist/types/components/picker/picker").Fields;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/components",
|
|
3
|
-
"version": "3.6.6
|
|
3
|
+
"version": "3.6.6",
|
|
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.6.6
|
|
41
|
-
"@tarojs/router": "3.6.6
|
|
42
|
-
"@tarojs/taro": "3.6.6
|
|
40
|
+
"@tarojs/components-advanced": "3.6.6",
|
|
41
|
+
"@tarojs/router": "3.6.6",
|
|
42
|
+
"@tarojs/taro": "3.6.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@babel/generator": "^7.20.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"esbuild": "^0.14.27",
|
|
57
57
|
"jquery": "^3.4.1",
|
|
58
58
|
"lodash": "^4.17.21",
|
|
59
|
-
"miniapp-types": "1.
|
|
59
|
+
"miniapp-types": "1.5.1",
|
|
60
60
|
"puppeteer": "^19.2.0",
|
|
61
61
|
"stencil-vue2-output-target": "0.0.4",
|
|
62
62
|
"ts-node": "^10.9.1",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"dev:library-vue3": "cross-env NODE_ENV=development pnpm --filter @tarojs/components-library-vue3 run dev",
|
|
85
85
|
"generate:lib": "mkdir -p lib",
|
|
86
86
|
"generate:stencil-config": "esbuild ./scripts/stencil/stencil.config.ts --bundle --platform=node --outfile=stencil.config.js",
|
|
87
|
+
"sync:types": "ts-node scripts/json-schema-to-types.ts",
|
|
87
88
|
"test": "cross-env NODE_ENV=test stencil test --spec --e2e",
|
|
88
|
-
"test:ci": "pnpm
|
|
89
|
-
"test:coverage": "pnpm
|
|
90
|
-
"test:watch": "pnpm
|
|
91
|
-
"sync:types": "ts-node scripts/json-schema-to-types.ts"
|
|
89
|
+
"test:ci": "pnpm test -- --ci --no-build",
|
|
90
|
+
"test:coverage": "pnpm test -- --ci --screenshot --coverage",
|
|
91
|
+
"test:watch": "pnpm test -- --screenshot --watch"
|
|
92
92
|
}
|
|
93
93
|
}
|
package/types/ScrollView.d.ts
CHANGED
|
@@ -176,11 +176,11 @@ interface ScrollViewProps extends StandardProps {
|
|
|
176
176
|
/** 滚动开始事件
|
|
177
177
|
* @supported weapp
|
|
178
178
|
*/
|
|
179
|
-
onScrollStart?:BaseEventOrigFunction<ScrollViewProps.onScrollDetail>
|
|
179
|
+
onScrollStart?: BaseEventOrigFunction<ScrollViewProps.onScrollDetail>
|
|
180
180
|
/** 滚动结束事件
|
|
181
181
|
* @supported weapp
|
|
182
182
|
*/
|
|
183
|
-
onScrollEnd?:BaseEventOrigFunction<ScrollViewProps.onScrollDetail>
|
|
183
|
+
onScrollEnd?: BaseEventOrigFunction<ScrollViewProps.onScrollDetail>
|
|
184
184
|
/** 自定义下拉刷新控件被下拉
|
|
185
185
|
* @supported weapp
|
|
186
186
|
*/
|
package/types/ShareElement.d.ts
CHANGED
|
@@ -24,6 +24,40 @@ interface ShareElementProps extends StandardProps {
|
|
|
24
24
|
* @supported weapp, alipay
|
|
25
25
|
*/
|
|
26
26
|
easingFunction?: string
|
|
27
|
+
/** 手势返回时是否进行动画
|
|
28
|
+
* @supported weapp
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
transitionOnGesture?: boolean
|
|
32
|
+
/** 指定 push 阶段的飞跃物
|
|
33
|
+
* @supported weapp
|
|
34
|
+
* @default "to"
|
|
35
|
+
*/
|
|
36
|
+
shuttleOnPush?: 'from' | 'to' | 'from' | 'to'
|
|
37
|
+
/** 指定 pop 阶段的飞跃物
|
|
38
|
+
* @supported weapp
|
|
39
|
+
* @default "to"
|
|
40
|
+
*/
|
|
41
|
+
shuttleOnPop?: string
|
|
42
|
+
/** 动画插值曲线
|
|
43
|
+
* @supported weapp
|
|
44
|
+
* @default "materialRectArc"
|
|
45
|
+
*/
|
|
46
|
+
rectTweenType?:
|
|
47
|
+
| 'materialRectArc'
|
|
48
|
+
| 'materialRectCenterArc'
|
|
49
|
+
| 'linear'
|
|
50
|
+
| 'elasticIn'
|
|
51
|
+
| 'elasticOut'
|
|
52
|
+
| 'elasticInOut'
|
|
53
|
+
| 'bounceIn'
|
|
54
|
+
| 'bounceOut'
|
|
55
|
+
| 'bounceInOut'
|
|
56
|
+
| 'cubic-bezier(x1,'
|
|
57
|
+
/** 动画帧回调
|
|
58
|
+
* @supported weapp
|
|
59
|
+
*/
|
|
60
|
+
onFrame?: string
|
|
27
61
|
}
|
|
28
62
|
/** 共享元素
|
|
29
63
|
*
|
package/types/StickySection.d.ts
CHANGED
package/types/Swiper.d.ts
CHANGED
|
@@ -139,6 +139,16 @@ interface SwiperProps extends StandardProps {
|
|
|
139
139
|
* @supported swan
|
|
140
140
|
*/
|
|
141
141
|
disableTouchmove?: string
|
|
142
|
+
/** 改变 current 时使用动画过渡
|
|
143
|
+
* @supported weapp
|
|
144
|
+
* @default true
|
|
145
|
+
*/
|
|
146
|
+
scrollWithAnimation?: boolean
|
|
147
|
+
/** 缓存区域大小,值为 1 表示提前渲染上下各一屏区域(swiper 容器大小)
|
|
148
|
+
* @supported weapp
|
|
149
|
+
* @default 0
|
|
150
|
+
*/
|
|
151
|
+
cacheExtent?: number
|
|
142
152
|
/** current 改变时会触发 change 事件
|
|
143
153
|
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
144
154
|
*/
|
package/types/Textarea.d.ts
CHANGED
|
@@ -116,6 +116,11 @@ interface TextareaProps extends StandardProps, FormItemProps {
|
|
|
116
116
|
* @supported qq
|
|
117
117
|
*/
|
|
118
118
|
ariaLabel?: string
|
|
119
|
+
/** 键盘对齐位置
|
|
120
|
+
* @supported weapp
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
adjustKeyboardTo?: boolean
|
|
119
124
|
/** 输入框聚焦时触发
|
|
120
125
|
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
121
126
|
*/
|
|
@@ -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-2fad2a65.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.pickerValue=t,this.onChange.emit({value:t})},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.handleColumnChange=(t,i)=>{this.onColumnChange.emit({column:Number(i),value:(_-t)/k})},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.pickerValue=[],this.height=[],this.hidden=!0,this.fadeOut=!1,this.isWillLoadCalled=!1}componentWillLoad(){this.isWillLoadCalled=!0,this.handleProps()}componentDidLoad(){Object.defineProperty(this.el,"value",{get:()=>this.pickerValue,set:t=>this.value!==t&&(this.value=t),configurable:!0}),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){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(){const{name:t,mode:i,fadeOut:h,hidden:o}=this;let r;switch(i){case"multiSelector":r=this.getMultiSelector();break;case"time":r=this.getTimeSelector();break;case"date":r=this.getDateSelector();break;default:r=this.getSelector()}const a=n("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":h}),c=n("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":h}),u=o?{display:"none"}:{};return s(e,null,s("div",{onClick:this.showPicker},s("slot",null),s("input",{type:"hidden",name:t,value:p(this.pickerValue)})),s("div",{class:"weui-picker__overlay",style:u,ref:t=>{this.overlay=t}},s("div",{class:a,onClick:this.handleCancel}),s("div",{class:c},s("div",{class:"weui-picker__hd"},s("div",{class:"weui-picker__action",onClick:this.handleCancel},"取消"),s("div",{class:"weui-picker__action",onClick:this.handleChange},"确定")),s("div",{class:"weui-picker__bd"},r),s("input",{type:"hidden",name:t,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(i){t(this,i),this.mode=void 0,this.range=[],this.rangeKey=void 0,this.height=void 0,this.columnId=void 0,this.updateHeight=void 0,this.onColumnChange=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,onColumnChange:n,columnId:o}=this,r=-34*(s.length-1),a=t;let c;if(this.touchEnd=!0,this.hadMove)c=e-_;else{const t=window.innerHeight;if(c=e-_-(a-(t-119)),"time"===i)if("0"===o){if(c>-85)return this.formulaUnlimitedScroll(24,c,"up");if(c<-969)return this.formulaUnlimitedScroll(24,c,"down")}else if("1"===o){if(c>-85)return this.formulaUnlimitedScroll(60,c,"up");if(c<-2193)return this.formulaUnlimitedScroll(60,c,"down")}}c>0&&(c=0),c<r&&(c=r);const u=Math.round(c/-34),d=_-k*u;"date"===this.mode&&("0"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),0),"1"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),1),"2"===this.columnId&&this.updateDay(+this.range[u].replace(/[^0-9]/gi,""),2)),h(d,o,"time"===i),n&&n(d,o)}onMouseDown(t){this.isMove=!0,this.handleMoveStart(t.clientY)}onMouseMove(t){t.preventDefault(),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){t.preventDefault(),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 +0,0 @@
|
|
|
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-387314fa.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 M=".weui-picker,.weui-picker__hd{font-size:12px}";var b=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.pickerValue=e;r.onChange.emit({value:e})};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.handleColumnChange=function(e,t){r.onColumnChange.emit({column:Number(t),value:(k-e)/w})};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.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(){var e=this;Object.defineProperty(this.el,"value",{get:function(){return e.pickerValue},set:function(t){return e.value!==t&&(e.value=t)},configurable:true});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")}}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=this,i=t.name,a=t.mode,u=t.fadeOut,s=t.hidden;var h;switch(a){case"multiSelector":h=this.getMultiSelector();break;case"time":h=this.getTimeSelector();break;case"date":h=this.getDateSelector();break;default:h=this.getSelector()}var l=o("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":u});var c=o("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":u});var d=s?{display:"none"}:{};return n(r,null,n("div",{onClick:this.showPicker},n("slot",null),n("input",{type:"hidden",name:i,value:v(this.pickerValue)})),n("div",{class:"weui-picker__overlay",style:d,ref:function(t){e.overlay=t}},n("div",{class:l,onClick:this.handleCancel}),n("div",{class:c},n("div",{class:"weui-picker__hd"},n("div",{class:"weui-picker__action",onClick:this.handleCancel},"取消"),n("div",{class:"weui-picker__action",onClick:this.handleChange},"确定")),n("div",{class:"weui-picker__bd"},h),n("input",{type:"hidden",name:i,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}());b.style=M;var D=e("taro_picker_group",function(){function e(e){t(this,e);this.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.onColumnChange=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,v;return __generator(this,(function(g){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.onColumnChange,u=t.columnId;s=0;h=-w*(n.length-1);l=e;this.touchEnd=true;if(!this.hadMove){d=window.innerHeight;f=d-C/2;c=r-k-(l-f);if(i==="time"){if(u==="0"){if(c>-w*2.5){return[2,this.formulaUnlimitedScroll(24,c,"up")]}if(c<-w*28.5){return[2,this.formulaUnlimitedScroll(24,c,"down")]}}else if(u==="1"){if(c>-w*2.5){return[2,this.formulaUnlimitedScroll(60,c,"up")]}if(c<-w*64.5){return[2,this.formulaUnlimitedScroll(60,c,"down")]}}}}else{c=r-k}if(c>s)c=0;if(c<h)c=h;p=Math.round(c/-w);v=k-w*p;if(this.mode==="date"){if(this.columnId==="0"){this.updateDay(+this.range[p].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[p].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[p].replace(/[^0-9]/gi,""),2)}}a(v,u,i==="time");o&&o(v,u);return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){e.preventDefault();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){e.preventDefault();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 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as h}from"./p-9137dcab.js";function o(t,i,s){if("search"===i&&(t="search"),s&&(t="password"),void 0===t)return"text";if(!t)throw new Error("unexpected type");return"digit"===t&&(t="number"),t}function e(t){return null!=t?t:""}const n=class{constructor(s){t(this,s),this.onInput=i(this,"input",7),this.onPaste=i(this,"paste",7),this.onFocus=i(this,"focus",7),this.onBlur=i(this,"blur",7),this.onConfirm=i(this,"confirm",7),this.onChange=i(this,"change",7),this.onKeyDown=i(this,"keydown",7),this.isOnComposition=!1,this.isOnPaste=!1,this.onInputExcuted=!1,this.handleInput=t=>{t.stopPropagation();const{type:i,maxlength:s,confirmType:h,password:e}=this;if(!this.isOnComposition&&!this.onInputExcuted){let n=t.target.value;const u=o(i,h,e);this.onInputExcuted=!0,"number"===u&&n&&s>-1&&s<=n.length&&(n=n.substring(0,s),t.target.value=n),this.value=n,this.onInput.emit({value:n,cursor:n.length}),this.onInputExcuted=!1}},this.handlePaste=t=>{t.stopPropagation(),this.isOnPaste=!0,this.onPaste.emit({value:t.target.value})},this.handleFocus=t=>{t.stopPropagation(),this.onInputExcuted=!1,this.onFocus.emit({value:t.target.value})},this.handleBlur=t=>{t.stopPropagation(),this.onBlur.emit({value:t.target.value})},this.handleChange=t=>{t.stopPropagation(),this.onChange.emit({value:t.target.value}),this.isOnPaste&&(this.isOnPaste=!1,this.value=t.target.value,this.onInput.emit({value:t.target.value,cursor:t.target.value.length}))},this.handleKeyDown=t=>{t.stopPropagation();const{value:i}=t.target,s=t.keyCode||t.code;this.onInputExcuted=!1,this.onKeyDown.emit({value:i,cursor:i.length,keyCode:s}),13===s&&this.onConfirm.emit({value:i})},this.handleComposition=t=>{t.stopPropagation(),t.target instanceof HTMLInputElement&&("compositionend"===t.type?(this.isOnComposition=!1,this.value=t.target.value,this.onInput.emit({value:t.target.value,cursor:t.target.value.length})):this.isOnComposition=!0)},this.handleBeforeinput=t=>{if(!t.data)return;const i=t.data&&/[0-9]/.test(t.data);"number"!==this.type||i||t.preventDefault(),"digit"!==this.type||i||("."!==t.data||"."===t.data&&t.target.value.indexOf(".")>-1)&&t.preventDefault()},this.value=void 0,this.type=void 0,this.password=!1,this.placeholder=void 0,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.confirmType="done",this.name=void 0,this.nativeProps={}}async focus(){this.inputRef.focus()}watchAutoFocus(t,i){var s;!i&&t&&(null===(s=this.inputRef)||void 0===s||s.focus())}watchValue(t){const i=e(t);this.inputRef.value!==i&&(this.inputRef.value=i)}componentDidLoad(){var t,i,s,h,o;"file"===this.type?(this.fileListener=()=>{this.onInput.emit()},null===(t=this.inputRef)||void 0===t||t.addEventListener("change",this.fileListener)):(null===(i=this.inputRef)||void 0===i||i.addEventListener("compositionstart",this.handleComposition),null===(s=this.inputRef)||void 0===s||s.addEventListener("compositionend",this.handleComposition),null===(h=this.inputRef)||void 0===h||h.addEventListener("beforeinput",this.handleBeforeinput),null===(o=this.inputRef)||void 0===o||o.addEventListener("textInput",this.handleBeforeinput)),Object.defineProperty(this.el,"value",{get:()=>this.inputRef.value,set:t=>this.value!==t&&(this.value=t),configurable:!0})}disconnectedCallback(){var t,i,s,h,o;"file"===this.type?null===(t=this.inputRef)||void 0===t||t.removeEventListener("change",this.fileListener):(null===(i=this.inputRef)||void 0===i||i.removeEventListener("compositionstart",this.handleComposition),null===(s=this.inputRef)||void 0===s||s.removeEventListener("compositionend",this.handleComposition),null===(h=this.inputRef)||void 0===h||h.removeEventListener("beforeinput",this.handleBeforeinput),null===(o=this.inputRef)||void 0===o||o.removeEventListener("textInput",this.handleBeforeinput))}render(){const{value:t,type:i,password:h,placeholder:n,autoFocus:u,disabled:a,maxlength:r,confirmType:l,name:c,nativeProps:d}=this;return s("input",Object.assign({ref:t=>{this.inputRef=t,u&&t&&t.focus()},class:"weui-input",type:o(i,l,h),placeholder:n,autoFocus:u,disabled:a,maxlength:r,name:c,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},d,{value:e(t)}))}get el(){return h(this)}static get watchers(){return{autoFocus:["watchAutoFocus"],value:["watchValue"]}}};n.style="taro-input-core{display:block}input{display:block;overflow:hidden;height:1.4rem;text-overflow:clip;text-align:inherit;white-space:nowrap}";export{n as taro_input_core}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,n,i){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function r(t){try{s(i.next(t))}catch(t){a(t)}}function u(t){try{s(i["throw"](t))}catch(t){a(t)}}function s(t){t.done?n(t.value):o(t.value).then(r,u)}s((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,r;return r={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function u(t){return function(e){return s([t,e])}}function s(u){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,u[0]&&(n=0)),n)try{if(i=1,o&&(a=u[0]&2?o["return"]:u[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;if(o=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;o=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1];a=u;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(u);break}if(a[2])n.ops.pop();n.trys.pop();continue}u=e.call(t,n)}catch(t){u=[6,t];o=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-7e6b54cb.system.js"],(function(t){"use strict";var e,n,i,o;return{setters:[function(t){e=t.r;n=t.c;i=t.h;o=t.g}],execute:function(){var a="taro-input-core{display:block}input{display:block;overflow:hidden;height:1.4rem;text-overflow:clip;text-align:inherit;white-space:nowrap}";function r(t,e,n){if(e==="search")t="search";if(n)t="password";if(typeof t==="undefined"){return"text"}if(!t){throw new Error("unexpected type")}if(t==="digit")t="number";return t}function u(t){return t!==null&&t!==void 0?t:""}var s=t("taro_input_core",function(){function t(t){var i=this;e(this,t);this.onInput=n(this,"input",7);this.onPaste=n(this,"paste",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onConfirm=n(this,"confirm",7);this.onChange=n(this,"change",7);this.onKeyDown=n(this,"keydown",7);this.isOnComposition=false;this.isOnPaste=false;this.onInputExcuted=false;this.handleInput=function(t){t.stopPropagation();var e=i,n=e.type,o=e.maxlength,a=e.confirmType,u=e.password;if(!i.isOnComposition&&!i.onInputExcuted){var s=t.target.value;var l=r(n,a,u);i.onInputExcuted=true;if(l==="number"&&s&&o>-1&&o<=s.length){s=s.substring(0,o);t.target.value=s}i.value=s;i.onInput.emit({value:s,cursor:s.length});i.onInputExcuted=false}};this.handlePaste=function(t){t.stopPropagation();i.isOnPaste=true;i.onPaste.emit({value:t.target.value})};this.handleFocus=function(t){t.stopPropagation();i.onInputExcuted=false;i.onFocus.emit({value:t.target.value})};this.handleBlur=function(t){t.stopPropagation();i.onBlur.emit({value:t.target.value})};this.handleChange=function(t){t.stopPropagation();i.onChange.emit({value:t.target.value});if(i.isOnPaste){i.isOnPaste=false;i.value=t.target.value;i.onInput.emit({value:t.target.value,cursor:t.target.value.length})}};this.handleKeyDown=function(t){t.stopPropagation();var e=t.target.value;var n=t.keyCode||t.code;i.onInputExcuted=false;i.onKeyDown.emit({value:e,cursor:e.length,keyCode:n});n===13&&i.onConfirm.emit({value:e})};this.handleComposition=function(t){t.stopPropagation();if(!(t.target instanceof HTMLInputElement))return;if(t.type==="compositionend"){i.isOnComposition=false;i.value=t.target.value;i.onInput.emit({value:t.target.value,cursor:t.target.value.length})}else{i.isOnComposition=true}};this.handleBeforeinput=function(t){if(!t.data)return;var e=t.data&&/[0-9]/.test(t.data);if(i.type==="number"&&!e){t.preventDefault()}if(i.type==="digit"&&!e){if(t.data!=="."||t.data==="."&&t.target.value.indexOf(".")>-1){t.preventDefault()}}};this.value=undefined;this.type=undefined;this.password=false;this.placeholder=undefined;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.confirmType="done";this.name=undefined;this.nativeProps={}}t.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.inputRef.focus();return[2]}))}))};t.prototype.watchAutoFocus=function(t,e){var n;if(!e&&t){(n=this.inputRef)===null||n===void 0?void 0:n.focus()}};t.prototype.watchValue=function(t){var e=u(t);if(this.inputRef.value!==e){this.inputRef.value=e}};t.prototype.componentDidLoad=function(){var t=this;var e,n,i,o,a;if(this.type==="file"){this.fileListener=function(){t.onInput.emit()};(e=this.inputRef)===null||e===void 0?void 0:e.addEventListener("change",this.fileListener)}else{(n=this.inputRef)===null||n===void 0?void 0:n.addEventListener("compositionstart",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.addEventListener("compositionend",this.handleComposition);(o=this.inputRef)===null||o===void 0?void 0:o.addEventListener("beforeinput",this.handleBeforeinput);(a=this.inputRef)===null||a===void 0?void 0:a.addEventListener("textInput",this.handleBeforeinput)}Object.defineProperty(this.el,"value",{get:function(){return t.inputRef.value},set:function(e){return t.value!==e&&(t.value=e)},configurable:true})};t.prototype.disconnectedCallback=function(){var t,e,n,i,o;if(this.type==="file"){(t=this.inputRef)===null||t===void 0?void 0:t.removeEventListener("change",this.fileListener)}else{(e=this.inputRef)===null||e===void 0?void 0:e.removeEventListener("compositionstart",this.handleComposition);(n=this.inputRef)===null||n===void 0?void 0:n.removeEventListener("compositionend",this.handleComposition);(i=this.inputRef)===null||i===void 0?void 0:i.removeEventListener("beforeinput",this.handleBeforeinput);(o=this.inputRef)===null||o===void 0?void 0:o.removeEventListener("textInput",this.handleBeforeinput)}};t.prototype.render=function(){var t=this;var e=this,n=e.value,o=e.type,a=e.password,s=e.placeholder,l=e.autoFocus,h=e.disabled,f=e.maxlength,p=e.confirmType,c=e.name,d=e.nativeProps;return i("input",Object.assign({ref:function(e){t.inputRef=e;if(l&&e)e.focus()},class:"weui-input",type:r(o,p,a),placeholder:s,autoFocus:l,disabled:h,maxlength:f,name:c,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},d,{value:u(n)}))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{autoFocus:["watchAutoFocus"],value:["watchValue"]}},enumerable:false,configurable:true});return t}());s.style=a}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,g as s}from"./p-9137dcab.js";function h(t){return null!=t?t:""}const a=class{constructor(i){t(this,i),this.onInput=e(this,"input",7),this.onFocus=e(this,"focus",7),this.onBlur=e(this,"blur",7),this.onConfirm=e(this,"confirm",7),this.onChange=e(this,"change",7),this.onLineChange=e(this,"linechange",7),this.onKeyDown=e(this,"keydown",7),this.handleInput=t=>{t.stopPropagation(),this.handleLineChange();const e=t.target.value||"";this.onInput.emit({value:e,cursor:e.length})},this.handleFocus=t=>{t.stopPropagation(),this.onFocus.emit({value:t.target.value})},this.handleBlur=t=>{t.stopPropagation(),this.onBlur.emit({value:t.target.value})},this.handleChange=t=>{t.stopPropagation(),this.onChange.emit({value:t.target.value})},this.handleLineChange=()=>{const t=this.getNumberOfLines();t!==this.line&&(this.line=t,this.onLineChange.emit({height:this.textareaRef.clientHeight,lineCount:this.line}))},this.handleKeyDown=t=>{t.stopPropagation();const{value:e}=t.target,i=t.keyCode||t.code;this.onKeyDown.emit({value:e,cursor:e.length,keyCode:i}),13===i&&this.onConfirm.emit({value:e})},this.calculateContentHeight=(t,e)=>{let i=t.style.height,s=t.offsetHeight,h=t.scrollHeight,a=t.style.overflow,o=t.style.minHeight||null;if(!(s>=h))return h;if(t.style.minHeight=0,t.style.height=s+e+"px",t.style.overflow="hidden",h<t.scrollHeight){for(;t.offsetHeight>=t.scrollHeight;)t.style.height=(s-=e)+"px";for(;t.offsetHeight<t.scrollHeight;)t.style.height=s+++"px";return t.style.height=i,t.style.overflow=a,t.style.minHeight=o,s}},this.getNumberOfLines=()=>{const t=this.textareaRef,e=window.getComputedStyle?window.getComputedStyle(t):t.style,i=parseInt(e.lineHeight,10),s=this.calculateContentHeight(t,i);return Math.floor(s/i)},this.value=void 0,this.placeholder=void 0,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.autoHeight=!1,this.name=void 0,this.nativeProps={},this.line=1}watchAutoFocus(t,e){var i;!e&&t&&(null===(i=this.textareaRef)||void 0===i||i.focus())}async focus(){this.textareaRef.focus()}componentDidLoad(){Object.defineProperty(this.el,"value",{get:()=>this.textareaRef.value,set:t=>this.value!==t&&(this.value=t),configurable:!0})}render(){const{value:t,placeholder:e,disabled:s,maxlength:a,autoFocus:o,autoHeight:n,name:r,nativeProps:u,handleInput:c,handleFocus:l,handleBlur:d,handleChange:p}=this,g={};return n&&(g.rows=this.line),i("textarea",Object.assign({ref:t=>{t&&(this.textareaRef=t,o&&t&&t.focus())},class:"taro-textarea "+(n?"auto-height":""),value:h(t),placeholder:e,name:r,disabled:s,maxlength:a,autofocus:o,onInput:c,onFocus:l,onBlur:d,onChange:p,onKeyDown:this.handleKeyDown},u,g))}get el(){return s(this)}static get watchers(){return{autoFocus:["watchAutoFocus"]}}};a.style="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";export{a as taro_textarea_core}
|