@nutui/nutui-react-taro 1.3.9 → 1.3.10-beta.0
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/CHANGELOG.md +36 -0
- package/dist/esm/Address.js +4 -2
- package/dist/esm/Audio.js +3 -3
- package/dist/esm/Button.js +2 -2
- package/dist/esm/Card.js +4 -4
- package/dist/esm/Checkbox.js +2 -3
- package/dist/esm/CheckboxGroup.js +4 -2
- package/dist/esm/Dialog.js +3 -3
- package/dist/esm/Elevator.js +2 -2
- package/dist/esm/Input.js +2 -2
- package/dist/esm/Menu.js +2 -2
- package/dist/esm/MenuItem.js +2 -2
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/Price.js +2 -2
- package/dist/esm/Radio.js +1 -3
- package/dist/esm/RadioGroup.js +4 -2
- package/dist/esm/Signature.js +3 -3
- package/dist/esm/TabbarItem.js +2 -2
- package/dist/esm/Tag.js +2 -2
- package/dist/esm/Uploader.js +3 -3
- package/dist/esm/{address.taro-f16cef31.js → address.taro-8d642b4a.js} +11 -1
- package/dist/esm/{audio.taro-c2f9948a.js → audio.taro-b42a082b.js} +1 -1
- package/dist/esm/{button.taro-a9ebb937.js → button.taro-7e924b72.js} +3 -1
- package/dist/esm/{card.taro-1bc35ebe.js → card.taro-59f65b66.js} +2 -2
- package/dist/esm/checkbox.taro-d8656076.js +249 -0
- package/dist/esm/{dialog.taro-492e2b9a.js → dialog.taro-0c35b35f.js} +1 -1
- package/dist/esm/{elevator.taro-ead49158.js → elevator.taro-d7d65470.js} +1 -1
- package/dist/esm/index.taro-c092d216.js +227 -0
- package/dist/esm/{input.taro-39b99dbc.js → input.taro-cc46bbc3.js} +11 -4
- package/dist/esm/{menu.taro-f8ca86db.js → menu.taro-4abed328.js} +3 -2
- package/dist/esm/{menuitem.taro-7bf564c9.js → menuitem.taro-06a135a5.js} +1 -2
- package/dist/esm/{noticebar.taro-77b5a2c9.js → noticebar.taro-4915fed3.js} +12 -16
- package/dist/esm/nutui-react.es.js +17 -19
- package/dist/esm/{price.taro-97393d8f.js → price.taro-8801462e.js} +28 -22
- package/dist/esm/{signature.taro-0b3abea5.js → signature.taro-57f8de06.js} +1 -1
- package/dist/esm/{tabbaritem.taro-94cd62c2.js → tabbaritem.taro-fb90f659.js} +6 -5
- package/dist/esm/{tag.taro-95d7f5c2.js → tag.taro-84d40117.js} +6 -4
- package/dist/esm/types/src/packages/checkbox/checkbox.d.ts +6 -1
- package/dist/esm/types/src/packages/checkbox/checkbox.taro.d.ts +6 -1
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +2 -0
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/checkboxgroup/type.d.ts +6 -0
- package/dist/esm/types/src/packages/input/input.d.ts +1 -0
- package/dist/esm/types/src/packages/input/input.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/nutui.react.taro.scss.d.ts +91 -0
- package/dist/esm/types/src/packages/price/price.d.ts +2 -0
- package/dist/esm/types/src/packages/price/price.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/radiogroup/radiogroup.d.ts +2 -0
- package/dist/esm/types/src/packages/radiogroup/radiogroup.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/radiogroup/type.d.ts +7 -0
- package/dist/esm/types/src/packages/tabbaritem/tabbaritem.d.ts +1 -1
- package/dist/esm/types/src/packages/tabbaritem/tabbaritem.taro.d.ts +1 -1
- package/dist/esm/{uploader.taro-63a36a30.js → uploader.taro-a03bb003.js} +1 -1
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +170 -78
- package/dist/nutui.react.umd.js +169 -77
- package/dist/packages/badge/badge.scss +10 -10
- package/dist/packages/button/button.scss +3 -3
- package/dist/packages/cell/cell.scss +1 -4
- package/dist/packages/cellgroup/cellgroup.scss +8 -0
- package/dist/packages/countdown/countdown.scss +1 -1
- package/dist/packages/infiniteloading/infiniteloading.scss +1 -1
- package/dist/packages/inputnumber/inputnumber.scss +3 -3
- package/dist/packages/noticebar/noticebar.scss +3 -0
- package/dist/packages/price/price.scss +27 -11
- package/dist/packages/radio/radio.scss +8 -7
- package/dist/packages/shortpassword/shortpassword.scss +4 -4
- package/dist/packages/skeleton/skeleton.scss +1 -1
- package/dist/packages/swiper/swiper.scss +4 -4
- package/dist/packages/switch/switch.scss +8 -8
- package/dist/packages/timepannel/timepannel.scss +3 -3
- package/dist/packages/timeselect/timeselect.scss +4 -4
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +573 -248
- package/dist/types/index.d.ts +19 -3
- package/package.json +1 -1
- package/dist/esm/checkbox.taro-104557c1.js +0 -121
- package/dist/esm/checkboxgroup.taro-3d380042.js +0 -110
- package/dist/esm/radio.taro-95d43860.js +0 -112
- package/dist/esm/radiogroup.taro-b5dad516.js +0 -95
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
var _excluded = ["className", "value", "onChange", "textPosition", "direction", "options"],
|
|
5
|
+
_excluded2 = ["label", "value", "disabled", "onChange"],
|
|
6
|
+
_excluded3 = ["className", "disabled", "checked", "shape", "textPosition", "value", "iconName", "iconActiveName", "iconSize", "onChange", "iconClassPrefix", "iconFontClassName"];
|
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
+
import React__default, { useState, useEffect, useCallback, useContext } from 'react';
|
|
10
|
+
import { I as Icon } from './icon.taro-1d0d4fb7.js';
|
|
11
|
+
import { c as cn } from './bem-893ad28d.js';
|
|
12
|
+
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
13
|
+
var radioContext = {
|
|
14
|
+
onChange: function onChange(val) {}
|
|
15
|
+
};
|
|
16
|
+
var RadioContext = React__default.createContext(radioContext);
|
|
17
|
+
var defaultProps$1 = {
|
|
18
|
+
value: null,
|
|
19
|
+
textPosition: 'right',
|
|
20
|
+
onChange: function onChange(value) {},
|
|
21
|
+
direction: 'vertical',
|
|
22
|
+
options: []
|
|
23
|
+
};
|
|
24
|
+
var RadioGroup = React__default.forwardRef(function (props, ref) {
|
|
25
|
+
var _defaultProps$1$props = _objectSpread(_objectSpread({}, defaultProps$1), props),
|
|
26
|
+
children = _defaultProps$1$props.children;
|
|
27
|
+
cn('RadioGroup');
|
|
28
|
+
var className = props.className,
|
|
29
|
+
value = props.value,
|
|
30
|
+
_onChange = props.onChange,
|
|
31
|
+
textPosition = props.textPosition,
|
|
32
|
+
direction = props.direction,
|
|
33
|
+
options = props.options,
|
|
34
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
35
|
+
var _useState = useState(value),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
val2State = _useState2[0],
|
|
38
|
+
setVal2State = _useState2[1];
|
|
39
|
+
// useImperativeHandle(ref, () => ({
|
|
40
|
+
// toggleAll(state: boolean) {
|
|
41
|
+
// console.log(state)
|
|
42
|
+
// if (state === false) {
|
|
43
|
+
// setInnerValue([])
|
|
44
|
+
// } else {
|
|
45
|
+
// const childrenLabel: string[] = []
|
|
46
|
+
// React.Children.map(children, (child) => {
|
|
47
|
+
// const childProps = (child as any).props
|
|
48
|
+
// childrenLabel.push(childProps.label || (child as any).children)
|
|
49
|
+
// })
|
|
50
|
+
// setInnerValue(childrenLabel)
|
|
51
|
+
// }
|
|
52
|
+
// },
|
|
53
|
+
// }))
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
setVal2State(value);
|
|
56
|
+
}, [value]);
|
|
57
|
+
// function handleChildChange(state: boolean, label: string) {
|
|
58
|
+
// if (innerValue) {
|
|
59
|
+
// let clippedValue = []
|
|
60
|
+
// if (state) {
|
|
61
|
+
// clippedValue = [...innerValue, label]
|
|
62
|
+
// } else {
|
|
63
|
+
// innerValue?.splice(innerValue?.indexOf(label), 1)
|
|
64
|
+
// clippedValue = [...innerValue]
|
|
65
|
+
// }
|
|
66
|
+
// setInnerValue(clippedValue)
|
|
67
|
+
// onChange && onChange(clippedValue)
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
|
+
function validateChildChecked(child) {
|
|
71
|
+
if (val2State === null) return false;
|
|
72
|
+
return val2State === child.props.value;
|
|
73
|
+
}
|
|
74
|
+
function validateChecked(value) {
|
|
75
|
+
if (val2State === null) return false;
|
|
76
|
+
return val2State === value;
|
|
77
|
+
}
|
|
78
|
+
function cloneChildren() {
|
|
79
|
+
return React__default.Children.map(children, function (child, index) {
|
|
80
|
+
var childChecked = validateChildChecked(child);
|
|
81
|
+
if (child.type.displayName !== 'NutRadio') {
|
|
82
|
+
return React__default.cloneElement(child);
|
|
83
|
+
}
|
|
84
|
+
return React__default.cloneElement(child, {
|
|
85
|
+
textPosition: textPosition,
|
|
86
|
+
checked: childChecked
|
|
87
|
+
// onChange: handleChildChange,
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
var renderOptionsChildren = useCallback(function () {
|
|
93
|
+
return options === null || options === void 0 ? void 0 : options.map(function (_ref) {
|
|
94
|
+
var label = _ref.label,
|
|
95
|
+
value = _ref.value,
|
|
96
|
+
disabled = _ref.disabled,
|
|
97
|
+
onChange = _ref.onChange,
|
|
98
|
+
rest = _objectWithoutProperties(_ref, _excluded2);
|
|
99
|
+
var childChecked = validateChecked(value);
|
|
100
|
+
return React__default.createElement(Radio, _objectSpread(_objectSpread({
|
|
101
|
+
key: value === null || value === void 0 ? void 0 : value.toString(),
|
|
102
|
+
children: label,
|
|
103
|
+
value: value,
|
|
104
|
+
disabled: disabled,
|
|
105
|
+
onChange: onChange
|
|
106
|
+
}, rest), {}, {
|
|
107
|
+
textPosition: textPosition,
|
|
108
|
+
checked: childChecked
|
|
109
|
+
}));
|
|
110
|
+
});
|
|
111
|
+
}, [val2State]);
|
|
112
|
+
return React__default.createElement(RadioContext.Provider, {
|
|
113
|
+
value: {
|
|
114
|
+
onChange: function onChange(val) {
|
|
115
|
+
setVal2State(val);
|
|
116
|
+
_onChange && _onChange(val);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}, React__default.createElement("div", _objectSpread({
|
|
120
|
+
className: "nut-radiogroup nut-radiogroup--".concat(props.direction, " ").concat(className || '')
|
|
121
|
+
}, rest), options !== null && options !== void 0 && options.length ? renderOptionsChildren() : cloneChildren()));
|
|
122
|
+
});
|
|
123
|
+
RadioGroup.defaultProps = defaultProps$1;
|
|
124
|
+
RadioGroup.displayName = 'NutRadioGroup';
|
|
125
|
+
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
126
|
+
disabled: false,
|
|
127
|
+
checked: false,
|
|
128
|
+
shape: 'round',
|
|
129
|
+
value: '',
|
|
130
|
+
textPosition: 'right',
|
|
131
|
+
iconName: 'check-normal',
|
|
132
|
+
iconActiveName: 'check-checked',
|
|
133
|
+
iconSize: 18,
|
|
134
|
+
onChange: function onChange(e) {}
|
|
135
|
+
});
|
|
136
|
+
var Radio$1 = function Radio$1(props) {
|
|
137
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
138
|
+
children = _defaultProps$props.children;
|
|
139
|
+
var className = props.className,
|
|
140
|
+
disabled = props.disabled,
|
|
141
|
+
checked = props.checked,
|
|
142
|
+
shape = props.shape,
|
|
143
|
+
textPosition = props.textPosition,
|
|
144
|
+
value = props.value,
|
|
145
|
+
iconName = props.iconName,
|
|
146
|
+
iconActiveName = props.iconActiveName,
|
|
147
|
+
iconSize = props.iconSize,
|
|
148
|
+
onChange = props.onChange,
|
|
149
|
+
iconClassPrefix = props.iconClassPrefix,
|
|
150
|
+
iconFontClassName = props.iconFontClassName,
|
|
151
|
+
rest = _objectWithoutProperties(props, _excluded3);
|
|
152
|
+
var componentName = 'nut-radio';
|
|
153
|
+
var _useState3 = useState(checked),
|
|
154
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
155
|
+
checkedStatement = _useState4[0],
|
|
156
|
+
setCheckedStatement = _useState4[1];
|
|
157
|
+
var _useState5 = useState(value),
|
|
158
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
159
|
+
valueStatement = _useState6[0],
|
|
160
|
+
setValueStatement = _useState6[1];
|
|
161
|
+
var _useState7 = useState(disabled),
|
|
162
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
163
|
+
disabledStatement = _useState8[0],
|
|
164
|
+
setDisabledStatement = _useState8[1];
|
|
165
|
+
var context = useContext(RadioContext);
|
|
166
|
+
useEffect(function () {
|
|
167
|
+
setDisabledStatement(disabled);
|
|
168
|
+
setValueStatement(value);
|
|
169
|
+
setCheckedStatement(checked);
|
|
170
|
+
}, [disabled, value, checked]);
|
|
171
|
+
var renderLabel = function renderLabel() {
|
|
172
|
+
return React__default.createElement("div", {
|
|
173
|
+
className: "".concat(componentName, "__label ").concat(disabledStatement ? "".concat(componentName, "__label--disabled") : '')
|
|
174
|
+
}, children);
|
|
175
|
+
};
|
|
176
|
+
var renderButton = function renderButton() {
|
|
177
|
+
return React__default.createElement("div", {
|
|
178
|
+
className: "".concat(componentName, "__button ").concat(checkedStatement && "".concat(componentName, "__button--active"), " ").concat(disabledStatement ? "".concat(componentName, "__button--disabled") : '')
|
|
179
|
+
}, children);
|
|
180
|
+
};
|
|
181
|
+
var color = function color() {
|
|
182
|
+
if (disabledStatement) {
|
|
183
|
+
return 'nut-radio__icon--disable';
|
|
184
|
+
}
|
|
185
|
+
if (checkedStatement) {
|
|
186
|
+
return 'nut-radio__icon';
|
|
187
|
+
}
|
|
188
|
+
return 'nut-radio__icon--unchecked';
|
|
189
|
+
};
|
|
190
|
+
var renderIcon = function renderIcon() {
|
|
191
|
+
var iconName = props.iconName,
|
|
192
|
+
iconSize = props.iconSize,
|
|
193
|
+
iconActiveName = props.iconActiveName;
|
|
194
|
+
return React__default.createElement(Icon, {
|
|
195
|
+
classPrefix: iconClassPrefix,
|
|
196
|
+
fontClassName: iconFontClassName,
|
|
197
|
+
name: checkedStatement ? iconActiveName : iconName,
|
|
198
|
+
size: iconSize,
|
|
199
|
+
className: color()
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
var renderRadioItem = function renderRadioItem() {
|
|
203
|
+
if (shape === 'button') {
|
|
204
|
+
return renderButton();
|
|
205
|
+
}
|
|
206
|
+
if (reverseState) {
|
|
207
|
+
return [renderLabel(), renderIcon()];
|
|
208
|
+
}
|
|
209
|
+
return [renderIcon(), renderLabel()];
|
|
210
|
+
};
|
|
211
|
+
var handleClick = function handleClick(e) {
|
|
212
|
+
if (disabledStatement || checkedStatement) return;
|
|
213
|
+
setCheckedStatement(!checkedStatement);
|
|
214
|
+
onChange && onChange(e);
|
|
215
|
+
context && context.onChange(valueStatement);
|
|
216
|
+
};
|
|
217
|
+
var reverseState = textPosition === 'left';
|
|
218
|
+
return React__default.createElement("div", _objectSpread({
|
|
219
|
+
className: "nut-radio ".concat(className),
|
|
220
|
+
onClick: handleClick
|
|
221
|
+
}, rest), renderRadioItem());
|
|
222
|
+
};
|
|
223
|
+
Radio$1.defaultProps = defaultProps;
|
|
224
|
+
Radio$1.displayName = 'NutRadio';
|
|
225
|
+
Radio$1.RadioGroup = RadioGroup;
|
|
226
|
+
var Radio = Radio$1;
|
|
227
|
+
export { Radio as R, RadioGroup as a };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _excluded = ["children", "type", "defaultValue", "placeholder", "label", "labelClass", "labelWidth", "labelAlign", "colon", "inputAlign", "center", "required", "disabled", "readonly", "error", "maxlength", "leftIcon", "leftIconSize", "rightIcon", "rightIconSize", "clearable", "clearIcon", "clearSize", "border", "formatTrigger", "rules", "errorMessage", "errorMessageAlign", "showWordLimit", "autofocus", "style", "className", "rows", "slotButton", "slotInput", "onChange", "onBlur", "onFocus", "onClear", "formatter", "keypress", "onClickInput", "onClickLeftIcon", "onClickRightIcon", "onClick", "change", "blur", "focus", "clear", "clickInput", "clickLeftIcon", "clickRightIcon", "click", "iconClassPrefix", "iconFontClassName"];
|
|
4
|
+
var _excluded = ["children", "type", "name", "defaultValue", "placeholder", "label", "labelClass", "labelWidth", "labelAlign", "colon", "inputAlign", "center", "required", "disabled", "readonly", "error", "maxlength", "leftIcon", "leftIconSize", "rightIcon", "rightIconSize", "clearable", "clearIcon", "clearSize", "border", "formatTrigger", "rules", "errorMessage", "errorMessageAlign", "showWordLimit", "autofocus", "style", "className", "rows", "slotButton", "slotInput", "onChange", "onBlur", "onFocus", "onClear", "formatter", "keypress", "onClickInput", "onClickLeftIcon", "onClickRightIcon", "onClick", "change", "blur", "focus", "clear", "clickInput", "clickLeftIcon", "clickRightIcon", "click", "iconClassPrefix", "iconFontClassName"];
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
-
import React__default, { useState, useRef, useLayoutEffect, useEffect, useCallback } from 'react';
|
|
7
|
+
import React__default, { forwardRef, useState, useRef, useLayoutEffect, useEffect, useImperativeHandle, useCallback } from 'react';
|
|
8
8
|
import { I as Icon } from './icon.taro-1d0d4fb7.js';
|
|
9
9
|
import { u as useConfig } from './configprovider.taro-6c7b3056.js';
|
|
10
10
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
@@ -36,6 +36,7 @@ function formatNumber(value) {
|
|
|
36
36
|
}
|
|
37
37
|
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
38
38
|
type: 'text',
|
|
39
|
+
name: '',
|
|
39
40
|
defaultValue: '',
|
|
40
41
|
placeholder: '',
|
|
41
42
|
label: '',
|
|
@@ -68,12 +69,13 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
68
69
|
slotButton: null,
|
|
69
70
|
slotInput: null
|
|
70
71
|
});
|
|
71
|
-
var Input = function
|
|
72
|
+
var Input = forwardRef(function (props, ref) {
|
|
72
73
|
var _useConfig = useConfig(),
|
|
73
74
|
locale = _useConfig.locale;
|
|
74
75
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
75
76
|
children = _defaultProps$props.children,
|
|
76
77
|
type = _defaultProps$props.type,
|
|
78
|
+
name = _defaultProps$props.name,
|
|
77
79
|
defaultValue = _defaultProps$props.defaultValue,
|
|
78
80
|
placeholder = _defaultProps$props.placeholder,
|
|
79
81
|
label = _defaultProps$props.label,
|
|
@@ -160,6 +162,9 @@ var Input = function Input(props) {
|
|
|
160
162
|
resetValidation();
|
|
161
163
|
}
|
|
162
164
|
}, [inputValue]);
|
|
165
|
+
useImperativeHandle(ref, function () {
|
|
166
|
+
return inputRef.current;
|
|
167
|
+
});
|
|
163
168
|
var inputClass = useCallback(function () {
|
|
164
169
|
var prefixCls = 'nut-input';
|
|
165
170
|
return [prefixCls, "".concat(center ? 'center' : ''), "".concat(disabled ? "".concat(prefixCls, "-disabled") : ''), "".concat(required ? "".concat(prefixCls, "-required") : ''), "".concat(error ? "".concat(prefixCls, "-error") : ''), "".concat(border ? "".concat(prefixCls, "-border") : '')].filter(Boolean).join(' ');
|
|
@@ -293,6 +298,7 @@ var Input = function Input(props) {
|
|
|
293
298
|
handleClickInput(e);
|
|
294
299
|
}
|
|
295
300
|
}, type === 'textarea' ? React__default.createElement("textarea", {
|
|
301
|
+
name: name,
|
|
296
302
|
className: "input-text",
|
|
297
303
|
ref: inputRef,
|
|
298
304
|
style: {
|
|
@@ -315,6 +321,7 @@ var Input = function Input(props) {
|
|
|
315
321
|
handleInput(e);
|
|
316
322
|
}
|
|
317
323
|
}) : React__default.createElement("input", {
|
|
324
|
+
name: name,
|
|
318
325
|
className: "input-text",
|
|
319
326
|
ref: inputRef,
|
|
320
327
|
style: {
|
|
@@ -367,7 +374,7 @@ var Input = function Input(props) {
|
|
|
367
374
|
textAlign: errorMessageAlign
|
|
368
375
|
}
|
|
369
376
|
}, errorMessage) : null)));
|
|
370
|
-
};
|
|
377
|
+
});
|
|
371
378
|
Input.defaultProps = defaultProps;
|
|
372
379
|
Input.displayName = 'NutInput';
|
|
373
380
|
export { Input as I };
|
|
@@ -98,7 +98,8 @@ var Menu = function Menu(props) {
|
|
|
98
98
|
title = _child$props.title,
|
|
99
99
|
value = _child$props.value,
|
|
100
100
|
direction = _child$props.direction,
|
|
101
|
-
options = _child$props.options
|
|
101
|
+
options = _child$props.options,
|
|
102
|
+
className = _child$props.className;
|
|
102
103
|
var currentTitle = options === null || options === void 0 ? void 0 : options.filter(function (option) {
|
|
103
104
|
return option.value === value;
|
|
104
105
|
});
|
|
@@ -112,7 +113,7 @@ var Menu = function Menu(props) {
|
|
|
112
113
|
className: "nut-menu__item ".concat(classNames({
|
|
113
114
|
active: itemShow[index],
|
|
114
115
|
disabled: disabled
|
|
115
|
-
})),
|
|
116
|
+
}), " ").concat(className),
|
|
116
117
|
style: {
|
|
117
118
|
color: itemShow[index] ? activeColor : ''
|
|
118
119
|
},
|
|
@@ -29,7 +29,6 @@ var MenuItem = function MenuItem(props) {
|
|
|
29
29
|
useConfig();
|
|
30
30
|
var mergedProps = _objectSpread(_objectSpread({}, defaultProps), props);
|
|
31
31
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
32
|
-
className = _defaultProps$props.className,
|
|
33
32
|
style = _defaultProps$props.style,
|
|
34
33
|
options = _defaultProps$props.options,
|
|
35
34
|
value = _defaultProps$props.value,
|
|
@@ -135,7 +134,7 @@ var MenuItem = function MenuItem(props) {
|
|
|
135
134
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
136
135
|
className: "placeholder-element ".concat(classNames({
|
|
137
136
|
up: direction === 'up'
|
|
138
|
-
})
|
|
137
|
+
})),
|
|
139
138
|
style: placeholderStyle(),
|
|
140
139
|
onClick: function onClick() {
|
|
141
140
|
return parent.toggleItemShow(orderKey);
|
|
@@ -242,13 +242,11 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
242
242
|
/**
|
|
243
243
|
* 点击滚动单元
|
|
244
244
|
*/
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
close && close(scrollList[0]);
|
|
251
|
-
onClose && onClose(scrollList[0]);
|
|
245
|
+
var handleClickIcon = function handleClickIcon(event) {
|
|
246
|
+
event.stopPropagation();
|
|
247
|
+
SetShowNoticeBar(!closeMode);
|
|
248
|
+
close && close(event);
|
|
249
|
+
onClose && onClose(event);
|
|
252
250
|
};
|
|
253
251
|
var iconShow = function iconShow() {
|
|
254
252
|
if (leftIcon === 'close') {
|
|
@@ -326,9 +324,10 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
326
324
|
fontClassName: iconFontClassName,
|
|
327
325
|
name: rightIcon || 'close',
|
|
328
326
|
color: color
|
|
329
|
-
})) : null) : null, scrollList.current.length > 0 && direction === 'vertical' ? React__default.createElement("div", {
|
|
327
|
+
})) : null) : null, showNoticeBar && scrollList.current.length > 0 && direction === 'vertical' ? React__default.createElement("div", {
|
|
330
328
|
className: "nut-noticebar-vertical",
|
|
331
|
-
style: barStyle
|
|
329
|
+
style: barStyle,
|
|
330
|
+
onClick: handleClick
|
|
332
331
|
}, children ? React__default.createElement("div", {
|
|
333
332
|
className: "horseLamp_list",
|
|
334
333
|
style: horseLampStyle
|
|
@@ -345,21 +344,18 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
345
344
|
style: {
|
|
346
345
|
height: height
|
|
347
346
|
},
|
|
348
|
-
key: index
|
|
349
|
-
onClick: function onClick() {
|
|
350
|
-
go(item);
|
|
351
|
-
}
|
|
347
|
+
key: index
|
|
352
348
|
}, item)
|
|
353
349
|
);
|
|
354
350
|
})), React__default.createElement("div", {
|
|
355
351
|
className: "go",
|
|
356
|
-
onClick: function onClick() {
|
|
357
|
-
handleClickIcon();
|
|
352
|
+
onClick: function onClick(e) {
|
|
353
|
+
handleClickIcon(e);
|
|
358
354
|
}
|
|
359
355
|
}, rightIcon || (closeMode ? React__default.createElement(Icon, {
|
|
360
356
|
classPrefix: iconClassPrefix,
|
|
361
357
|
fontClassName: iconFontClassName,
|
|
362
|
-
name:
|
|
358
|
+
name: rightIcon || 'close',
|
|
363
359
|
color: color,
|
|
364
360
|
size: "11px"
|
|
365
361
|
}) : null))) : null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as Button } from './button.taro-
|
|
1
|
+
export { B as Button } from './button.taro-7e924b72.js';
|
|
2
2
|
export { C as Cell } from './cell.taro-6daf51a0.js';
|
|
3
3
|
export { C as CellGroup } from './cellgroup.taro-e094471c.js';
|
|
4
4
|
export { I as Icon } from './icon.taro-1d0d4fb7.js';
|
|
@@ -15,8 +15,8 @@ export { S as Sticky } from './sticky.taro-30d4e453.js';
|
|
|
15
15
|
export { N as NavBar } from './navbar.taro-c931c078.js';
|
|
16
16
|
export { F as FixedNav } from './fixednav.taro-582322a1.js';
|
|
17
17
|
export { T as Tabbar } from './tabbar.taro-86cece39.js';
|
|
18
|
-
export { T as TabbarItem } from './tabbaritem.taro-
|
|
19
|
-
export { E as Elevator } from './elevator.taro-
|
|
18
|
+
export { T as TabbarItem } from './tabbaritem.taro-fb90f659.js';
|
|
19
|
+
export { E as Elevator } from './elevator.taro-d7d65470.js';
|
|
20
20
|
export { P as Pagination } from './pagination.taro-62bbd23f.js';
|
|
21
21
|
export { T as Tabs } from './tabs.taro-e71875fa.js';
|
|
22
22
|
export { T as TabPane } from './tabpane.taro-91cd6cf4.js';
|
|
@@ -24,30 +24,28 @@ export { I as Indicator } from './indicator.taro-183ea169.js';
|
|
|
24
24
|
export { S as SideNavBar } from './sidenavbar.taro-4297f552.js';
|
|
25
25
|
export { S as SubSideNavBar } from './subsidenavbar.taro-4c80ad38.js';
|
|
26
26
|
export { S as SideNavBarItem } from './sidenavbaritem.taro-fee11d26.js';
|
|
27
|
-
export { M as Menu } from './menu.taro-
|
|
28
|
-
export { M as MenuItem } from './menuitem.taro-
|
|
27
|
+
export { M as Menu } from './menu.taro-4abed328.js';
|
|
28
|
+
export { M as MenuItem } from './menuitem.taro-06a135a5.js';
|
|
29
29
|
export { R as Range } from './range.taro-4232e6a7.js';
|
|
30
30
|
export { C as Calendar } from './calendar.taro-533b3219.js';
|
|
31
|
-
export { C as Checkbox } from './checkbox.taro-
|
|
32
|
-
export { C as CheckboxGroup } from './checkboxgroup.taro-3d380042.js';
|
|
31
|
+
export { C as Checkbox, a as CheckboxGroup } from './checkbox.taro-d8656076.js';
|
|
33
32
|
export { D as DatePicker } from './datepicker.taro-9f8afe51.js';
|
|
34
33
|
export { I as InputNumber } from './inputnumber.taro-0a01f6e1.js';
|
|
35
|
-
export { I as Input } from './input.taro-
|
|
36
|
-
export { R as Radio } from './
|
|
37
|
-
export { R as RadioGroup } from './radiogroup.taro-b5dad516.js';
|
|
34
|
+
export { I as Input } from './input.taro-cc46bbc3.js';
|
|
35
|
+
export { R as Radio, a as RadioGroup } from './index.taro-c092d216.js';
|
|
38
36
|
export { R as Rate } from './rate.taro-69c85081.js';
|
|
39
37
|
export { C as CalendarItem } from './calendaritem.taro-fe5dd4bd.js';
|
|
40
38
|
export { P as Picker } from './picker.taro-f003b725.js';
|
|
41
39
|
export { S as ShortPassword } from './shortpassword.taro-2e96ca22.js';
|
|
42
40
|
export { T as TextArea } from './textarea.taro-388d1f90.js';
|
|
43
|
-
export { U as Uploader } from './uploader.taro-
|
|
41
|
+
export { U as Uploader } from './uploader.taro-a03bb003.js';
|
|
44
42
|
export { C as Cascader } from './cascader.taro-8c9891b4.js';
|
|
45
43
|
export { S as SearchBar } from './searchbar.taro-0d3c0081.js';
|
|
46
44
|
export { N as NumberKeyboard } from './numberkeyboard.taro-53c350b8.js';
|
|
47
45
|
export { A as ActionSheet } from './actionsheet.taro-360d8d34.js';
|
|
48
46
|
export { B as BackTop } from './backtop.taro-99107c30.js';
|
|
49
47
|
export { D as Drag } from './drag.taro-0717c783.js';
|
|
50
|
-
export { D as Dialog } from './dialog.taro-
|
|
48
|
+
export { D as Dialog } from './dialog.taro-0c35b35f.js';
|
|
51
49
|
export { I as Infiniteloading } from './infiniteloading.taro-b95e62bf.js';
|
|
52
50
|
export { N as Notify } from './notify.taro-d9c48fae.js';
|
|
53
51
|
export { S as Switch } from './switch.taro-bae2dca0.js';
|
|
@@ -55,16 +53,16 @@ export { T as Toast } from './toast.taro-86862dff.js';
|
|
|
55
53
|
export { S as Swipe } from './swipe.taro-83bc248f.js';
|
|
56
54
|
export { P as PullToRefresh } from './pulltorefresh.taro-e66c78ad.js';
|
|
57
55
|
export { C as CircleProgress } from './circleprogress.taro-3c89a157.js';
|
|
58
|
-
export { N as NoticeBar } from './noticebar.taro-
|
|
56
|
+
export { N as NoticeBar } from './noticebar.taro-4915fed3.js';
|
|
59
57
|
export { S as Steps } from './steps.taro-acf205a0.js';
|
|
60
58
|
export { S as Step } from './step.taro-1c94e067.js';
|
|
61
59
|
export { S as Swiper } from './swiper.taro-f314d67a.js';
|
|
62
60
|
export { S as SwiperItem } from './swiperitem-d00e7513.js';
|
|
63
61
|
export { A as Avatar } from './avatar.taro-deabe88a.js';
|
|
64
62
|
export { A as AvatarGroup } from './avatargroup-5b2584d9.js';
|
|
65
|
-
export { P as Price } from './price.taro-
|
|
63
|
+
export { P as Price } from './price.taro-8801462e.js';
|
|
66
64
|
export { B as Badge } from './badge.taro-38684262.js';
|
|
67
|
-
export { T as Tag } from './tag.taro-
|
|
65
|
+
export { T as Tag } from './tag.taro-84d40117.js';
|
|
68
66
|
export { P as Popover } from './popover.taro-7e5dff8c.js';
|
|
69
67
|
export { S as Skeleton } from './skeleton.taro-acca102c.js';
|
|
70
68
|
export { C as CountDown } from './countdown.taro-f2d9ffed.js';
|
|
@@ -76,12 +74,12 @@ export { V as VirtualList } from './virtuallist.taro-e3035825.js';
|
|
|
76
74
|
export { T as Table } from './table.taro-7ac89a6c.js';
|
|
77
75
|
export { V as Video } from './video-8a3518c5.js';
|
|
78
76
|
export { P as Progress } from './progress.taro-623bc807.js';
|
|
79
|
-
export { A as Audio } from './audio.taro-
|
|
77
|
+
export { A as Audio } from './audio.taro-b42a082b.js';
|
|
80
78
|
export { I as ImagePreview } from './imagepreview.taro-1199e977.js';
|
|
81
|
-
export { A as Address } from './address.taro-
|
|
79
|
+
export { A as Address } from './address.taro-8d642b4a.js';
|
|
82
80
|
export { B as Barrage } from './barrage.taro-d86c367a.js';
|
|
83
|
-
export { S as Signature } from './signature.taro-
|
|
84
|
-
export { C as Card } from './card.taro-
|
|
81
|
+
export { S as Signature } from './signature.taro-57f8de06.js';
|
|
82
|
+
export { C as Card } from './card.taro-59f65b66.js';
|
|
85
83
|
export { T as TimePannel } from './timepannel.taro-9904f6e6.js';
|
|
86
84
|
export { T as TimeDetail } from './timedetail.taro-519808cf.js';
|
|
87
85
|
export { T as TimeSelect } from './timeselect.taro-8c4439a8.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["price", "needSymbol", "symbol", "decimalDigits", "thousands", "className"];
|
|
3
|
+
var _excluded = ["price", "needSymbol", "symbol", "decimalDigits", "thousands", "position", "size", "className"];
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import React__default from 'react';
|
|
@@ -11,6 +11,8 @@ var defaultProps = {
|
|
|
11
11
|
symbol: '¥',
|
|
12
12
|
decimalDigits: 2,
|
|
13
13
|
thousands: false,
|
|
14
|
+
position: 'before',
|
|
15
|
+
size: 'large',
|
|
14
16
|
className: ''
|
|
15
17
|
};
|
|
16
18
|
var Price = function Price(props) {
|
|
@@ -20,22 +22,23 @@ var Price = function Price(props) {
|
|
|
20
22
|
symbol = _defaultProps$props.symbol,
|
|
21
23
|
decimalDigits = _defaultProps$props.decimalDigits,
|
|
22
24
|
thousands = _defaultProps$props.thousands,
|
|
25
|
+
position = _defaultProps$props.position,
|
|
26
|
+
size = _defaultProps$props.size,
|
|
23
27
|
className = _defaultProps$props.className,
|
|
24
28
|
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
25
29
|
var b = cn('price');
|
|
26
|
-
var replaceSpecialChar = function replaceSpecialChar(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return desSymbol;
|
|
30
|
+
var replaceSpecialChar = function replaceSpecialChar(url) {
|
|
31
|
+
url = url.replace(/"/g, '"');
|
|
32
|
+
url = url.replace(/&/g, '&');
|
|
33
|
+
url = url.replace(/</g, '<');
|
|
34
|
+
url = url.replace(/>/g, '>');
|
|
35
|
+
url = url.replace(/ /g, ' ');
|
|
36
|
+
url = url.replace(/¥/g, '¥');
|
|
37
|
+
return url;
|
|
35
38
|
};
|
|
36
39
|
var showSymbol = function showSymbol() {
|
|
37
40
|
return {
|
|
38
|
-
__html:
|
|
41
|
+
__html: needSymbol ? replaceSpecialChar(symbol) : ''
|
|
39
42
|
};
|
|
40
43
|
};
|
|
41
44
|
var checkPoint = function checkPoint(price) {
|
|
@@ -62,7 +65,7 @@ var Price = function Price(props) {
|
|
|
62
65
|
}
|
|
63
66
|
if (checkPoint(decimalNum)) {
|
|
64
67
|
decimalNum = Number(decimalNum).toFixed(decimalDigits);
|
|
65
|
-
decimalNum = typeof decimalNum.split('.') === 'string' ? 0 : decimalNum.split('.')[1];
|
|
68
|
+
decimalNum = typeof decimalNum.split('.') === 'string' ? 0 : decimalNum.split('.')[1] || 0;
|
|
66
69
|
} else {
|
|
67
70
|
decimalNum = 0;
|
|
68
71
|
}
|
|
@@ -70,18 +73,21 @@ var Price = function Price(props) {
|
|
|
70
73
|
var resultFixed = Number(result).toFixed(decimalDigits);
|
|
71
74
|
return String(resultFixed).substring(2, resultFixed.length);
|
|
72
75
|
};
|
|
76
|
+
var renderSymbol = function renderSymbol() {
|
|
77
|
+
return React__default.createElement("div", {
|
|
78
|
+
className: "".concat(b('symbol'), " ").concat(b("symbol-".concat(size))),
|
|
79
|
+
dangerouslySetInnerHTML: showSymbol()
|
|
80
|
+
});
|
|
81
|
+
};
|
|
73
82
|
return React__default.createElement("div", _objectSpread({
|
|
74
83
|
className: "".concat(b(), " ").concat(className)
|
|
75
|
-
}, rest), needSymbol ? React__default.createElement("div", {
|
|
76
|
-
className: "".concat(b('
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}, "."), React__default.createElement("div", {
|
|
83
|
-
className: "".concat(b('small'))
|
|
84
|
-
}, formatDecimal(price)));
|
|
84
|
+
}, rest), needSymbol && position === 'before' ? renderSymbol() : null, React__default.createElement("div", {
|
|
85
|
+
className: "".concat(b('integer'), " ").concat(b("integer-".concat(size)))
|
|
86
|
+
}, formatThousands(price)), decimalDigits !== 0 ? React__default.createElement("div", {
|
|
87
|
+
className: "".concat(b('decimal'), " ").concat(b("decimal-".concat(size)))
|
|
88
|
+
}, ".") : null, React__default.createElement("div", {
|
|
89
|
+
className: "".concat(b('decimal'), " ").concat(b("decimal-".concat(size)))
|
|
90
|
+
}, formatDecimal(price)), needSymbol && position === 'after' ? renderSymbol() : null);
|
|
85
91
|
};
|
|
86
92
|
Price.defaultProps = defaultProps;
|
|
87
93
|
Price.displayName = 'NutPrice';
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
import React__default, { useRef, useState } from 'react';
|
|
8
8
|
import Taro, { useReady } from '@tarojs/taro';
|
|
9
|
-
import { B as Button } from './button.taro-
|
|
9
|
+
import { B as Button } from './button.taro-7e924b72.js';
|
|
10
10
|
import { c as cn } from './bem-893ad28d.js';
|
|
11
11
|
import { u as useConfig } from './configprovider.taro-6c7b3056.js';
|
|
12
12
|
var defaultProps = {
|
|
@@ -9,7 +9,7 @@ import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
|
9
9
|
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
10
10
|
dot: false,
|
|
11
11
|
size: '',
|
|
12
|
-
|
|
12
|
+
className: '',
|
|
13
13
|
tabTitle: '',
|
|
14
14
|
icon: '',
|
|
15
15
|
href: '',
|
|
@@ -25,7 +25,8 @@ var TabbarItem = function TabbarItem(props) {
|
|
|
25
25
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
26
26
|
dot = _defaultProps$props.dot,
|
|
27
27
|
size = _defaultProps$props.size,
|
|
28
|
-
|
|
28
|
+
className = _defaultProps$props.className,
|
|
29
|
+
style = _defaultProps$props.style,
|
|
29
30
|
tabTitle = _defaultProps$props.tabTitle,
|
|
30
31
|
icon = _defaultProps$props.icon,
|
|
31
32
|
href = _defaultProps$props.href,
|
|
@@ -53,10 +54,10 @@ var TabbarItem = function TabbarItem(props) {
|
|
|
53
54
|
return React__default.createElement("div", {
|
|
54
55
|
className: "".concat(b({
|
|
55
56
|
active: active
|
|
56
|
-
})),
|
|
57
|
-
style: {
|
|
57
|
+
}), " ").concat(className),
|
|
58
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
58
59
|
color: active ? activeColor : unactiveColor
|
|
59
|
-
},
|
|
60
|
+
}),
|
|
60
61
|
onClick: function onClick() {
|
|
61
62
|
handleClick(index);
|
|
62
63
|
}
|
|
@@ -19,6 +19,8 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
19
19
|
});
|
|
20
20
|
var Tag = function Tag(props) {
|
|
21
21
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
22
|
+
className = _defaultProps$props.className,
|
|
23
|
+
style = _defaultProps$props.style,
|
|
22
24
|
color = _defaultProps$props.color,
|
|
23
25
|
plain = _defaultProps$props.plain,
|
|
24
26
|
type = _defaultProps$props.type,
|
|
@@ -68,8 +70,8 @@ var Tag = function Tag(props) {
|
|
|
68
70
|
return style;
|
|
69
71
|
};
|
|
70
72
|
return React__default.createElement("div", null, closeable ? isTagShow && React__default.createElement("div", {
|
|
71
|
-
className: "".concat(btnName),
|
|
72
|
-
style: getStyle(),
|
|
73
|
+
className: "".concat(btnName, " ").concat(className),
|
|
74
|
+
style: _objectSpread(_objectSpread({}, style), getStyle()),
|
|
73
75
|
onClick: function onClick(e) {
|
|
74
76
|
return handleClick(e);
|
|
75
77
|
}
|
|
@@ -88,8 +90,8 @@ var Tag = function Tag(props) {
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
})) : React__default.createElement("div", {
|
|
91
|
-
className: "".concat(btnName),
|
|
92
|
-
style: getStyle(),
|
|
93
|
+
className: "".concat(btnName, " ").concat(className),
|
|
94
|
+
style: _objectSpread(_objectSpread({}, style), getStyle()),
|
|
93
95
|
onClick: function onClick(e) {
|
|
94
96
|
return handleClick(e);
|
|
95
97
|
}
|