taro-ui 3.1.0-beta.2 → 3.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +14 -29
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -28
- package/dist/index.js.map +1 -1
- package/dist/style/components/avatar.rn.scss +4 -3
- package/dist/style/components/avatar.scss +4 -3
- package/dist/style/components/badge.rn.scss +2 -1
- package/dist/style/components/button.rn.scss +3 -2
- package/dist/style/components/button.scss +2 -2
- package/dist/style/components/checkbox.rn.scss +2 -1
- package/dist/style/components/curtain.rn.scss +5 -4
- package/dist/style/components/curtain.scss +3 -3
- package/dist/style/components/fab.rn.scss +2 -1
- package/dist/style/components/flex.rn.scss +2 -1
- package/dist/style/components/flex.scss +2 -1
- package/dist/style/components/progress.rn.scss +3 -2
- package/dist/style/components/progress.scss +3 -3
- package/dist/style/components/range.rn.scss +4 -3
- package/dist/style/components/range.scss +2 -2
- package/dist/style/components/search-bar.rn.scss +2 -1
- package/dist/style/components/search-bar.scss +2 -1
- package/dist/style/components/steps.rn.scss +2 -1
- package/dist/style/components/tag.rn.scss +3 -2
- package/dist/style/components/tag.scss +4 -3
- package/dist/style/components/timeline.rn.scss +6 -5
- package/dist/style/components/timeline.scss +4 -3
- package/dist/style/components/toast.scss +2 -1
- package/lib/components/button/index.js +2 -24
- package/lib/components/button/index.js.map +1 -1
- package/lib/components/divider/index.js +1 -1
- package/lib/components/divider/index.js.map +1 -1
- package/lib/components/input/index.js +6 -4
- package/lib/components/input/index.js.map +1 -1
- package/lib/components/search-bar/index.js +5 -0
- package/lib/components/search-bar/index.js.map +1 -1
- package/package.json +2 -2
- package/rn/components/input/index.tsx +7 -5
- package/rn/style/components/avatar.scss +4 -3
- package/rn/style/components/badge.scss +2 -1
- package/rn/style/components/button.scss +3 -2
- package/rn/style/components/checkbox.scss +2 -1
- package/rn/style/components/curtain.scss +5 -4
- package/rn/style/components/fab.scss +2 -1
- package/rn/style/components/flex.scss +2 -1
- package/rn/style/components/progress.scss +3 -2
- package/rn/style/components/range.scss +4 -3
- package/rn/style/components/search-bar.scss +2 -1
- package/rn/style/components/steps.scss +2 -1
- package/rn/style/components/tag.scss +3 -2
- package/rn/style/components/timeline.scss +6 -5
- package/types/base.d.ts +2 -1
- package/types/input.d.ts +6 -0
- package/types/modal.d.ts +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { View, Text, OpenData, Image, Button,
|
|
2
|
+
import { View, Text, OpenData, Image, Button, Switch, ScrollView, Form, Label, Input, Textarea, Slider, MovableArea, MovableView, Swiper, SwiperItem, Picker } from '@tarojs/components';
|
|
3
3
|
import Taro from '@tarojs/taro';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
@@ -1759,28 +1759,6 @@ var AtButton = /** @class */ (function (_super) {
|
|
|
1759
1759
|
AtButton.prototype.onOpenSetting = function (event) {
|
|
1760
1760
|
this.props.onOpenSetting && this.props.onOpenSetting(event);
|
|
1761
1761
|
};
|
|
1762
|
-
AtButton.prototype.onSumit = function (event) {
|
|
1763
|
-
if (this.state.isWEAPP || this.state.isWEB) {
|
|
1764
|
-
// TODO: 3.0 this.$scope
|
|
1765
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
1766
|
-
// @ts-ignore
|
|
1767
|
-
this.$scope.triggerEvent('submit', event.detail, {
|
|
1768
|
-
bubbles: true,
|
|
1769
|
-
composed: true
|
|
1770
|
-
});
|
|
1771
|
-
}
|
|
1772
|
-
};
|
|
1773
|
-
AtButton.prototype.onReset = function (event) {
|
|
1774
|
-
if (this.state.isWEAPP || this.state.isWEB) {
|
|
1775
|
-
// TODO: 3.0 this.$scope
|
|
1776
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
1777
|
-
// @ts-ignore
|
|
1778
|
-
this.$scope.triggerEvent('reset', event.detail, {
|
|
1779
|
-
bubbles: true,
|
|
1780
|
-
composed: true
|
|
1781
|
-
});
|
|
1782
|
-
}
|
|
1783
|
-
};
|
|
1784
1762
|
AtButton.prototype.render = function () {
|
|
1785
1763
|
var _a;
|
|
1786
1764
|
var _b = this.props, _c = _b.size, size = _c === void 0 ? 'normal' : _c, _d = _b.type, type = _d === void 0 ? '' : _d, circle = _b.circle, full = _b.full, loading = _b.loading, disabled = _b.disabled, customStyle = _b.customStyle, formType = _b.formType, openType = _b.openType, lang = _b.lang, sessionFrom = _b.sessionFrom, sendMessageTitle = _b.sendMessageTitle, sendMessagePath = _b.sendMessagePath, sendMessageImg = _b.sendMessageImg, showMessageCard = _b.showMessageCard, appParameter = _b.appParameter;
|
|
@@ -1805,7 +1783,7 @@ var AtButton = /** @class */ (function (_super) {
|
|
|
1805
1783
|
var button = (React.createElement(Button, { className: 'at-button__wxbutton', formType: formType, openType: openType, lang: lang, sessionFrom: sessionFrom, sendMessageTitle: sendMessageTitle, sendMessagePath: sendMessagePath, sendMessageImg: sendMessageImg, showMessageCard: showMessageCard, appParameter: appParameter, onGetUserInfo: this.onGetUserInfo.bind(this), onGetPhoneNumber: this.onGetPhoneNumber.bind(this), onOpenSetting: this.onOpenSetting.bind(this), onError: this.onError.bind(this), onContact: this.onContact.bind(this) }));
|
|
1806
1784
|
return (React.createElement(View, { className: classnames(rootClassName, classObject, this.props.className), style: customStyle, onClick: this.onClick.bind(this) },
|
|
1807
1785
|
isWEB && !disabled && webButton,
|
|
1808
|
-
isWEAPP && !disabled &&
|
|
1786
|
+
isWEAPP && !disabled && button,
|
|
1809
1787
|
isALIPAY && !disabled && button,
|
|
1810
1788
|
loadingComponent,
|
|
1811
1789
|
React.createElement(View, { className: 'at-button__text' }, this.props.children)));
|
|
@@ -3069,14 +3047,14 @@ AtIcon.propTypes = {
|
|
|
3069
3047
|
function getInputProps(props) {
|
|
3070
3048
|
var actualProps = {
|
|
3071
3049
|
type: props.type,
|
|
3072
|
-
|
|
3050
|
+
maxLength: props.maxLength || props.maxlength,
|
|
3073
3051
|
disabled: props.disabled,
|
|
3074
3052
|
password: false
|
|
3075
3053
|
};
|
|
3076
3054
|
switch (actualProps.type) {
|
|
3077
3055
|
case 'phone':
|
|
3078
3056
|
actualProps.type = 'number';
|
|
3079
|
-
actualProps.
|
|
3057
|
+
actualProps.maxLength = 11;
|
|
3080
3058
|
break;
|
|
3081
3059
|
case 'password':
|
|
3082
3060
|
actualProps.type = 'text';
|
|
@@ -3141,7 +3119,7 @@ var AtInput = /** @class */ (function (_super) {
|
|
|
3141
3119
|
}
|
|
3142
3120
|
AtInput.prototype.render = function () {
|
|
3143
3121
|
var _a = this.props, className = _a.className, customStyle = _a.customStyle, name = _a.name, cursorSpacing = _a.cursorSpacing, confirmType = _a.confirmType, cursor = _a.cursor, selectionStart = _a.selectionStart, selectionEnd = _a.selectionEnd, adjustPosition = _a.adjustPosition, border = _a.border, title = _a.title, error = _a.error, clear = _a.clear, placeholder = _a.placeholder, placeholderStyle = _a.placeholderStyle, placeholderClass = _a.placeholderClass, autoFocus = _a.autoFocus, focus = _a.focus, value = _a.value, required = _a.required;
|
|
3144
|
-
var _b = getInputProps(this.props), type = _b.type,
|
|
3122
|
+
var _b = getInputProps(this.props), type = _b.type, maxLength = _b.maxLength, disabled = _b.disabled, password = _b.password;
|
|
3145
3123
|
var rootCls = classnames('at-input', {
|
|
3146
3124
|
'at-input--without-border': !border
|
|
3147
3125
|
}, className);
|
|
@@ -3158,7 +3136,7 @@ var AtInput = /** @class */ (function (_super) {
|
|
|
3158
3136
|
React.createElement(View, { className: containerCls },
|
|
3159
3137
|
React.createElement(View, { className: overlayCls, onClick: this.handleClick }),
|
|
3160
3138
|
title && (React.createElement(Label, { className: "at-input__title " + (required && 'at-input__title--required'), for: name }, title)),
|
|
3161
|
-
React.createElement(Input, __assign({ className: 'at-input__input' }, id, { name: name, type: type, password: password, placeholderStyle: placeholderStyle, placeholderClass: placeholderCls, placeholder: placeholder, cursorSpacing: cursorSpacing, maxlength:
|
|
3139
|
+
React.createElement(Input, __assign({ className: 'at-input__input' }, id, { name: name, type: type, disabled: disabled, password: password, placeholderStyle: placeholderStyle, placeholderClass: placeholderCls, placeholder: placeholder, cursorSpacing: cursorSpacing, maxlength: maxLength, autoFocus: autoFocus, focus: focus, value: value, confirmType: confirmType, cursor: cursor, selectionStart: selectionStart, selectionEnd: selectionEnd, adjustPosition: adjustPosition, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onConfirm: this.handleConfirm,
|
|
3162
3140
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
3163
3141
|
// @ts-ignore
|
|
3164
3142
|
onKeyboardHeightChange: this.handleKeyboardHeightChange })),
|
|
@@ -3186,6 +3164,7 @@ AtInput.defaultProps = {
|
|
|
3186
3164
|
selectionEnd: -1,
|
|
3187
3165
|
adjustPosition: true,
|
|
3188
3166
|
maxlength: 140,
|
|
3167
|
+
maxLength: 140,
|
|
3189
3168
|
type: 'text',
|
|
3190
3169
|
disabled: false,
|
|
3191
3170
|
border: true,
|
|
@@ -3214,6 +3193,7 @@ AtInput.propTypes = {
|
|
|
3214
3193
|
adjustPosition: propTypes.bool,
|
|
3215
3194
|
cursorSpacing: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
|
3216
3195
|
maxlength: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
|
3196
|
+
maxLength: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
|
3217
3197
|
type: propTypes.string,
|
|
3218
3198
|
disabled: propTypes.bool,
|
|
3219
3199
|
border: propTypes.bool,
|
|
@@ -5328,6 +5308,11 @@ var AtSearchBar = /** @class */ (function (_super) {
|
|
|
5328
5308
|
};
|
|
5329
5309
|
return _this;
|
|
5330
5310
|
}
|
|
5311
|
+
AtSearchBar.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
|
|
5312
|
+
if (nextProps.focus !== this.props.focus) {
|
|
5313
|
+
this.setState({ isFocus: !!nextProps.focus });
|
|
5314
|
+
}
|
|
5315
|
+
};
|
|
5331
5316
|
AtSearchBar.prototype.render = function () {
|
|
5332
5317
|
var _a = this.props, value = _a.value, placeholder = _a.placeholder, maxLength = _a.maxLength, fixed = _a.fixed, disabled = _a.disabled, showActionButton = _a.showActionButton, _b = _a.actionName, actionName = _b === void 0 ? '搜索' : _b, inputType = _a.inputType, // 处理issue#464
|
|
5333
5318
|
className = _a.className, customStyle = _a.customStyle;
|
|
@@ -5460,7 +5445,7 @@ var AtDivider = /** @class */ (function (_super) {
|
|
|
5460
5445
|
};
|
|
5461
5446
|
var fontStyle = {
|
|
5462
5447
|
color: fontColor,
|
|
5463
|
-
'
|
|
5448
|
+
'fontSize': fontSize ? "" + pxTransform(Number(fontSize)) : ''
|
|
5464
5449
|
};
|
|
5465
5450
|
var lineStyle = {
|
|
5466
5451
|
backgroundColor: lineColor
|