@nutui/nutui-react 2.0.0-alpha.7 → 2.0.0-alpha.9
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 +26 -0
- package/dist/esm/Audio.js +12 -8
- package/dist/esm/Cascader.js +20 -12
- package/dist/esm/Elevator.js +6 -5
- package/dist/esm/Image.js +2 -5
- package/dist/esm/ImagePreview.js +9 -9
- package/dist/esm/Indicator.js +4 -4
- package/dist/esm/Notify.js +35 -46
- package/dist/esm/NumberKeyboard.js +137 -195
- package/dist/esm/Price.js +22 -23
- package/dist/esm/PullToRefresh.js +8 -8
- package/dist/esm/Radio.js +2 -0
- package/dist/esm/RadioGroup.js +31 -51
- package/dist/esm/Range/style/index.js +1 -1
- package/dist/esm/Range.js +119 -174
- package/dist/esm/Swiper.js +100 -111
- package/dist/esm/SwiperItem.js +1 -1
- package/dist/esm/radio2.js +52 -54
- package/dist/esm/tabs2.js +19 -8
- 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/locales/zh-UG.js +1 -1
- package/dist/nutui.react.mjs +1306 -1386
- package/dist/nutui.react.umd.js +1305 -1385
- package/dist/packages/imagepreview/imagepreview.scss +5 -0
- package/dist/packages/notify/notify.scss +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.scss +29 -77
- package/dist/packages/price/price.scss +8 -0
- package/dist/packages/pulltorefresh/pulltorefresh.scss +0 -8
- package/dist/packages/radio/radio.scss +13 -32
- package/dist/packages/radiogroup/radiogroup.scss +17 -51
- package/dist/packages/range/range.scss +24 -49
- package/dist/packages/swiper/swiper.scss +0 -15
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +61 -61
- package/dist/styles/variables.scss +61 -60
- package/dist/types/index.d.ts +84 -106
- package/package.json +1 -1
- /package/dist/esm/{UserContext3.js → context2.js} +0 -0
package/dist/esm/Range.js
CHANGED
|
@@ -22,46 +22,41 @@ function _objectSpread(target) {
|
|
|
22
22
|
return target;
|
|
23
23
|
}
|
|
24
24
|
import React__default, { useState, useRef, useEffect, useCallback } from "react";
|
|
25
|
+
import classNames from "classnames";
|
|
25
26
|
import { u as useTouch } from "./use-touch.js";
|
|
26
27
|
import { g as getRect } from "./use-client-rect.js";
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
var defaultProps = {
|
|
28
|
+
import { C as ComponentDefaults } from "./typings.js";
|
|
29
|
+
import { u as usePropsValue } from "./use-props-value.js";
|
|
30
|
+
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
30
31
|
range: false,
|
|
31
|
-
hiddenRange: false,
|
|
32
|
-
hiddenTag: false,
|
|
33
32
|
min: 0,
|
|
34
33
|
max: 100,
|
|
35
34
|
step: 1,
|
|
36
|
-
modelValue: 0,
|
|
37
35
|
vertical: false,
|
|
38
36
|
marks: {}
|
|
39
|
-
};
|
|
40
|
-
var startValue;
|
|
41
|
-
var currentValue;
|
|
37
|
+
});
|
|
42
38
|
var Range = function Range2(props) {
|
|
43
|
-
var
|
|
44
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), className = _defaultProps$props.className, range = _defaultProps$props.range, disabled = _defaultProps$props.disabled,
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
step = Number(step);
|
|
49
|
-
var _useState = useState(0), _useState2 = _slicedToArray(_useState, 2), buttonIndex = _useState2[0], SetButtonIndex = _useState2[1];
|
|
50
|
-
var _useState3 = useState(), _useState4 = _slicedToArray(_useState3, 2), initValue = _useState4[0], SetInitValue = _useState4[1];
|
|
51
|
-
var _useState5 = useState("start"), _useState6 = _slicedToArray(_useState5, 2), dragStatus = _useState6[0], SetDragStatus = _useState6[1];
|
|
39
|
+
var _classNames;
|
|
40
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), className = _defaultProps$props.className, range = _defaultProps$props.range, disabled = _defaultProps$props.disabled, button = _defaultProps$props.button, vertical = _defaultProps$props.vertical, marks = _defaultProps$props.marks, onChange = _defaultProps$props.onChange, onStart = _defaultProps$props.onStart, onEnd = _defaultProps$props.onEnd, minDescription = _defaultProps$props.minDescription, maxDescription = _defaultProps$props.maxDescription, currentDescription = _defaultProps$props.currentDescription, min = _defaultProps$props.min, max = _defaultProps$props.max, step = _defaultProps$props.step, value = _defaultProps$props.value, defaultValue = _defaultProps$props.defaultValue;
|
|
41
|
+
var classPrefix = "nut-range";
|
|
42
|
+
var _useState = useState(0), _useState2 = _slicedToArray(_useState, 2), buttonIndex = _useState2[0], setButtonIndex = _useState2[1];
|
|
43
|
+
var _useState3 = useState("start"), _useState4 = _slicedToArray(_useState3, 2), dragStatus = _useState4[0], setDragStatus = _useState4[1];
|
|
52
44
|
var touch = useTouch();
|
|
53
45
|
var root = useRef(null);
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, [
|
|
46
|
+
var _useState5 = useState([]), _useState6 = _slicedToArray(_useState5, 2), marksList = _useState6[0], setMarksList = _useState6[1];
|
|
47
|
+
var _useState7 = useState(0), _useState8 = _slicedToArray(_useState7, 2), startValue = _useState8[0], setStartValue = _useState8[1];
|
|
48
|
+
var handleChange = function handleChange2(value2) {
|
|
49
|
+
onChange && onChange(value2);
|
|
50
|
+
};
|
|
51
|
+
var _usePropsValue = usePropsValue({
|
|
52
|
+
value,
|
|
53
|
+
defaultValue,
|
|
54
|
+
finalValue: 0,
|
|
55
|
+
onChange: handleChange
|
|
56
|
+
}), _usePropsValue2 = _slicedToArray(_usePropsValue, 2), current = _usePropsValue2[0], setCurrent = _usePropsValue2[1];
|
|
57
|
+
var _useState9 = useState(function() {
|
|
58
|
+
return value || defaultValue || 0;
|
|
59
|
+
}), _useState10 = _slicedToArray(_useState9, 2), exactValue = _useState10[0], setEaxctValue = _useState10[1];
|
|
65
60
|
useEffect(function() {
|
|
66
61
|
if (marks) {
|
|
67
62
|
var marksKeys = Object.keys(marks);
|
|
@@ -70,64 +65,41 @@ var Range = function Range2(props) {
|
|
|
70
65
|
}).filter(function(point) {
|
|
71
66
|
return point >= min && point <= max;
|
|
72
67
|
});
|
|
73
|
-
|
|
68
|
+
setMarksList(list);
|
|
74
69
|
}
|
|
75
70
|
}, [marks]);
|
|
76
71
|
var scope = function scope2() {
|
|
77
|
-
return
|
|
72
|
+
return max - min;
|
|
78
73
|
};
|
|
79
|
-
var classes =
|
|
80
|
-
|
|
81
|
-
return [prefixCls, "".concat(disabled ? "".concat(prefixCls, "-disabled") : ""), "".concat(vertical ? "".concat(prefixCls, "-vertical") : ""), "".concat(!hiddenRange ? "".concat(prefixCls, "-show-number") : "")].filter(Boolean).join(" ");
|
|
82
|
-
}, [disabled, vertical, hiddenRange]);
|
|
83
|
-
var containerClasses = useCallback(function() {
|
|
84
|
-
var prefixCls = "nut-range-container";
|
|
85
|
-
return [prefixCls, "".concat(vertical ? "".concat(prefixCls, "-vertical") : ""), className].filter(Boolean).join(" ");
|
|
86
|
-
}, [vertical, className]);
|
|
74
|
+
var classes = classNames(classPrefix, (_classNames = {}, _defineProperty(_classNames, "".concat(classPrefix, "-disabled"), disabled), _defineProperty(_classNames, "".concat(classPrefix, "-vertical"), vertical), _classNames));
|
|
75
|
+
var containerClasses = classNames("".concat(classPrefix, "-container"), className, _defineProperty({}, "".concat(classPrefix, "-container-vertical"), vertical));
|
|
87
76
|
var markClassName = useCallback(function(mark) {
|
|
88
|
-
var
|
|
89
|
-
var lowerBound =
|
|
90
|
-
var upperBound =
|
|
91
|
-
if (range) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
upperBound = right;
|
|
77
|
+
var classPrefix2 = "nut-range-mark";
|
|
78
|
+
var lowerBound = min;
|
|
79
|
+
var upperBound = max;
|
|
80
|
+
if (range && Array.isArray(current)) {
|
|
81
|
+
lowerBound = current[0];
|
|
82
|
+
upperBound = current[1];
|
|
95
83
|
} else {
|
|
96
|
-
upperBound =
|
|
84
|
+
upperBound = current;
|
|
97
85
|
}
|
|
98
86
|
var isActive = mark <= upperBound && mark >= lowerBound;
|
|
99
|
-
return ["".concat(
|
|
100
|
-
}, [range,
|
|
101
|
-
var _useState9 = useState(classes()), _useState10 = _slicedToArray(_useState9, 2), rangeName = _useState10[0], setRangeName = _useState10[1];
|
|
102
|
-
var _useState11 = useState(containerClasses()), _useState12 = _slicedToArray(_useState11, 2), containerName = _useState12[0], setContainerName = _useState12[1];
|
|
103
|
-
useEffect(function() {
|
|
104
|
-
setRangeName(classes());
|
|
105
|
-
setContainerName(containerClasses());
|
|
106
|
-
}, [classes, containerClasses]);
|
|
107
|
-
var wrapperStyle = function wrapperStyle2() {
|
|
108
|
-
return {
|
|
109
|
-
background: inactiveColor
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
var buttonStyle = function buttonStyle2() {
|
|
113
|
-
return {
|
|
114
|
-
borderColor: buttonColor
|
|
115
|
-
};
|
|
116
|
-
};
|
|
87
|
+
return ["".concat(classPrefix2, "-text"), "".concat(isActive ? "".concat(classPrefix2, "-text-active") : "")].join(" ");
|
|
88
|
+
}, [range, current, min, max]);
|
|
117
89
|
var isRange = function isRange2(val) {
|
|
118
90
|
return !!range && Array.isArray(val);
|
|
119
91
|
};
|
|
120
92
|
var calcMainAxis = function calcMainAxis2() {
|
|
121
|
-
var modelVal =
|
|
93
|
+
var modelVal = current;
|
|
122
94
|
if (isRange(modelVal)) {
|
|
123
95
|
return "".concat((modelVal[1] - modelVal[0]) * 100 / scope(), "%");
|
|
124
96
|
}
|
|
125
|
-
return "".concat((modelVal -
|
|
97
|
+
return "".concat((modelVal - min) * 100 / scope(), "%");
|
|
126
98
|
};
|
|
127
99
|
var calcOffset = function calcOffset2() {
|
|
128
|
-
var modelVal =
|
|
100
|
+
var modelVal = current;
|
|
129
101
|
if (isRange(modelVal)) {
|
|
130
|
-
return "".concat((modelVal[0] -
|
|
102
|
+
return "".concat((modelVal[0] - min) * 100 / scope(), "%");
|
|
131
103
|
}
|
|
132
104
|
return "0%";
|
|
133
105
|
};
|
|
@@ -136,74 +108,61 @@ var Range = function Range2(props) {
|
|
|
136
108
|
return {
|
|
137
109
|
height: calcMainAxis(),
|
|
138
110
|
top: calcOffset(),
|
|
139
|
-
background: activeColor,
|
|
140
111
|
transition: dragStatus ? "none" : void 0
|
|
141
112
|
};
|
|
142
113
|
}
|
|
143
114
|
return {
|
|
144
115
|
width: calcMainAxis(),
|
|
145
116
|
left: calcOffset(),
|
|
146
|
-
background: activeColor,
|
|
147
117
|
transition: dragStatus ? "none" : void 0
|
|
148
118
|
};
|
|
149
119
|
};
|
|
150
120
|
var marksStyle = function marksStyle2(mark) {
|
|
151
121
|
var style = {
|
|
152
|
-
left: "".concat((mark -
|
|
122
|
+
left: "".concat((mark - min) / scope() * 100, "%")
|
|
153
123
|
};
|
|
154
124
|
if (vertical) {
|
|
155
125
|
style = {
|
|
156
|
-
top: "".concat((mark -
|
|
126
|
+
top: "".concat((mark - min) / scope() * 100, "%")
|
|
157
127
|
};
|
|
158
128
|
}
|
|
159
129
|
return style;
|
|
160
130
|
};
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (range) {
|
|
165
|
-
var _modelValue2 = _slicedToArray(modelValue, 2), left = _modelValue2[0], right = _modelValue2[1];
|
|
166
|
-
lowerBound = left;
|
|
167
|
-
upperBound = right;
|
|
131
|
+
var tickClass = function tickClass2(mark) {
|
|
132
|
+
if (range && Array.isArray(current)) {
|
|
133
|
+
return mark <= current[1] && mark >= current[0];
|
|
168
134
|
}
|
|
169
|
-
|
|
170
|
-
var style = {
|
|
171
|
-
background: !isActive ? inactiveColor : activeColor
|
|
172
|
-
};
|
|
173
|
-
return style;
|
|
135
|
+
return mark <= current;
|
|
174
136
|
};
|
|
175
|
-
var format = function format2(
|
|
176
|
-
|
|
177
|
-
return Math.round(
|
|
137
|
+
var format = function format2(value2) {
|
|
138
|
+
value2 = Math.max(+min, Math.min(value2, +max));
|
|
139
|
+
return Math.round(value2 / +step) * +step;
|
|
178
140
|
};
|
|
179
141
|
var isSameValue = function isSameValue2(newValue, oldValue) {
|
|
180
142
|
return JSON.stringify(newValue) === JSON.stringify(oldValue);
|
|
181
143
|
};
|
|
182
|
-
var handleOverlap = function handleOverlap2(
|
|
183
|
-
if (
|
|
184
|
-
return
|
|
144
|
+
var handleOverlap = function handleOverlap2(value2) {
|
|
145
|
+
if (value2[0] > value2[1]) {
|
|
146
|
+
return value2.slice(0).reverse();
|
|
185
147
|
}
|
|
186
|
-
return
|
|
148
|
+
return value2;
|
|
187
149
|
};
|
|
188
|
-
var updateValue = function updateValue2(
|
|
189
|
-
if (isRange(
|
|
190
|
-
|
|
150
|
+
var updateValue = function updateValue2(value2, end) {
|
|
151
|
+
if (isRange(value2)) {
|
|
152
|
+
value2 = handleOverlap(value2).map(format);
|
|
191
153
|
} else {
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
var modelVal = initValue || initValue === 0 ? initValue : modelValue;
|
|
195
|
-
if (!isSameValue(value, modelVal)) {
|
|
196
|
-
SetInitValue(value);
|
|
154
|
+
value2 = format(value2);
|
|
197
155
|
}
|
|
198
|
-
if (
|
|
199
|
-
|
|
156
|
+
if (!isSameValue(value2, current)) {
|
|
157
|
+
setCurrent(value2);
|
|
200
158
|
}
|
|
159
|
+
end && onEnd && onEnd(value2);
|
|
201
160
|
};
|
|
202
161
|
var click = function click2(event) {
|
|
203
162
|
if (disabled || !root.current) {
|
|
204
163
|
return;
|
|
205
164
|
}
|
|
206
|
-
|
|
165
|
+
setDragStatus("");
|
|
207
166
|
var rect = getRect(root.current);
|
|
208
167
|
var delta = event.clientX - rect.left;
|
|
209
168
|
var total = rect.width;
|
|
@@ -211,18 +170,18 @@ var Range = function Range2(props) {
|
|
|
211
170
|
delta = event.clientY - rect.top;
|
|
212
171
|
total = rect.height;
|
|
213
172
|
}
|
|
214
|
-
var
|
|
215
|
-
|
|
216
|
-
if (isRange(
|
|
217
|
-
var
|
|
173
|
+
var value2 = min + delta / total * scope();
|
|
174
|
+
setEaxctValue(current);
|
|
175
|
+
if (isRange(current)) {
|
|
176
|
+
var _current = _slicedToArray(current, 2), left = _current[0], right = _current[1];
|
|
218
177
|
var middle = (left + right) / 2;
|
|
219
|
-
if (
|
|
220
|
-
updateValue([
|
|
178
|
+
if (value2 <= middle) {
|
|
179
|
+
updateValue([value2, right], true);
|
|
221
180
|
} else {
|
|
222
|
-
updateValue([left,
|
|
181
|
+
updateValue([left, value2], true);
|
|
223
182
|
}
|
|
224
183
|
} else {
|
|
225
|
-
updateValue(
|
|
184
|
+
updateValue(value2, true);
|
|
226
185
|
}
|
|
227
186
|
};
|
|
228
187
|
var _onTouchStart = function onTouchStart(event) {
|
|
@@ -230,24 +189,24 @@ var Range = function Range2(props) {
|
|
|
230
189
|
return;
|
|
231
190
|
}
|
|
232
191
|
touch.start(event);
|
|
233
|
-
|
|
234
|
-
if (isRange(
|
|
235
|
-
|
|
192
|
+
setEaxctValue(current);
|
|
193
|
+
if (isRange(current)) {
|
|
194
|
+
setStartValue(current.map(format));
|
|
236
195
|
} else {
|
|
237
|
-
|
|
196
|
+
setStartValue(format(current));
|
|
238
197
|
}
|
|
239
|
-
|
|
198
|
+
setDragStatus("start");
|
|
240
199
|
};
|
|
241
200
|
var _onTouchMove = function onTouchMove(event) {
|
|
201
|
+
event.stopPropagation();
|
|
242
202
|
if (disabled || !root.current) {
|
|
243
203
|
return;
|
|
244
204
|
}
|
|
245
205
|
if (dragStatus === "start") {
|
|
246
|
-
|
|
247
|
-
onDragStart && onDragStart();
|
|
206
|
+
onStart && onStart();
|
|
248
207
|
}
|
|
249
208
|
touch.move(event);
|
|
250
|
-
|
|
209
|
+
setDragStatus("draging");
|
|
251
210
|
var rect = getRect(root.current);
|
|
252
211
|
var delta = touch.deltaX;
|
|
253
212
|
var total = rect.width;
|
|
@@ -257,41 +216,48 @@ var Range = function Range2(props) {
|
|
|
257
216
|
total = rect.height;
|
|
258
217
|
diff = delta / total * scope();
|
|
259
218
|
}
|
|
219
|
+
var newValue;
|
|
260
220
|
if (isRange(startValue)) {
|
|
261
|
-
|
|
221
|
+
newValue = exactValue.slice();
|
|
222
|
+
newValue[buttonIndex] = startValue[buttonIndex] + diff;
|
|
262
223
|
} else {
|
|
263
|
-
|
|
224
|
+
newValue = startValue + diff;
|
|
264
225
|
}
|
|
265
|
-
|
|
226
|
+
setEaxctValue(newValue);
|
|
227
|
+
updateValue(newValue);
|
|
266
228
|
};
|
|
267
229
|
var _onTouchEnd = function onTouchEnd(event) {
|
|
268
230
|
if (disabled) {
|
|
269
231
|
return;
|
|
270
232
|
}
|
|
271
233
|
if (dragStatus === "draging") {
|
|
272
|
-
updateValue(
|
|
273
|
-
dragEnd && dragEnd();
|
|
274
|
-
onDragEnd && onDragEnd();
|
|
234
|
+
updateValue(current, true);
|
|
275
235
|
}
|
|
276
|
-
|
|
236
|
+
setDragStatus("");
|
|
277
237
|
};
|
|
278
238
|
var curValue = function curValue2(idx) {
|
|
279
|
-
var modelVal =
|
|
280
|
-
var
|
|
281
|
-
return
|
|
239
|
+
var modelVal = current;
|
|
240
|
+
var value2 = typeof idx === "number" ? modelVal[idx] : modelVal;
|
|
241
|
+
return value2;
|
|
242
|
+
};
|
|
243
|
+
var renderButton = function renderButton2(index) {
|
|
244
|
+
return React__default.createElement(React__default.Fragment, null, button || React__default.createElement("div", {
|
|
245
|
+
className: "nut-range-button"
|
|
246
|
+
}, currentDescription !== null && React__default.createElement("div", {
|
|
247
|
+
className: "number"
|
|
248
|
+
}, currentDescription ? currentDescription(curValue(index)) : curValue(index))));
|
|
282
249
|
};
|
|
283
250
|
return React__default.createElement("div", {
|
|
284
|
-
className:
|
|
285
|
-
},
|
|
251
|
+
className: containerClasses
|
|
252
|
+
}, minDescription !== null && React__default.createElement("div", {
|
|
286
253
|
className: "min"
|
|
287
|
-
},
|
|
254
|
+
}, minDescription || min), React__default.createElement("div", {
|
|
288
255
|
ref: root,
|
|
289
|
-
|
|
290
|
-
className: "".concat(rangeName),
|
|
256
|
+
className: classes,
|
|
291
257
|
onClick: function onClick(e) {
|
|
292
|
-
click(e);
|
|
258
|
+
return click(e);
|
|
293
259
|
}
|
|
294
|
-
}, marksList.length > 0
|
|
260
|
+
}, marksList.length > 0 && React__default.createElement("div", {
|
|
295
261
|
className: "nut-range-mark"
|
|
296
262
|
}, marksList.map(function(marks2) {
|
|
297
263
|
return React__default.createElement("span", {
|
|
@@ -299,77 +265,56 @@ var Range = function Range2(props) {
|
|
|
299
265
|
className: markClassName(marks2),
|
|
300
266
|
style: marksStyle(marks2)
|
|
301
267
|
}, marks2, React__default.createElement("span", {
|
|
302
|
-
className: "nut-range-tick",
|
|
303
|
-
|
|
268
|
+
className: classNames("nut-range-tick", {
|
|
269
|
+
active: tickClass(marks2)
|
|
270
|
+
})
|
|
304
271
|
}));
|
|
305
|
-
}))
|
|
272
|
+
})), React__default.createElement("div", {
|
|
306
273
|
className: "nut-range-bar",
|
|
307
274
|
style: barStyle()
|
|
308
275
|
}, range ? [0, 1].map(function(item, index) {
|
|
309
276
|
return React__default.createElement("div", {
|
|
310
|
-
role: "slider",
|
|
311
277
|
key: index,
|
|
312
278
|
className: "".concat(index === 0 ? "nut-range-button-wrapper-left" : "", "\n ").concat(index === 1 ? "nut-range-button-wrapper-right" : ""),
|
|
313
|
-
tabIndex: disabled ? -1 : 0,
|
|
314
|
-
"aria-valuemin": +min,
|
|
315
|
-
"aria-valuenow": curValue(index),
|
|
316
|
-
"aria-valuemax": +max,
|
|
317
|
-
"aria-orientation": vertical ? "vertical" : "horizontal",
|
|
318
279
|
onTouchStart: function onTouchStart(e) {
|
|
319
280
|
if (typeof index === "number") {
|
|
320
|
-
|
|
281
|
+
setButtonIndex(index);
|
|
321
282
|
}
|
|
322
283
|
_onTouchStart(e);
|
|
323
284
|
},
|
|
324
285
|
onTouchMove: function onTouchMove(e) {
|
|
325
|
-
_onTouchMove(e);
|
|
286
|
+
return _onTouchMove(e);
|
|
326
287
|
},
|
|
327
288
|
onTouchEnd: function onTouchEnd(e) {
|
|
328
|
-
_onTouchEnd();
|
|
289
|
+
return _onTouchEnd();
|
|
329
290
|
},
|
|
330
291
|
onTouchCancel: function onTouchCancel(e) {
|
|
331
|
-
_onTouchEnd();
|
|
292
|
+
return _onTouchEnd();
|
|
332
293
|
},
|
|
333
294
|
onClick: function onClick(e) {
|
|
334
|
-
e.stopPropagation();
|
|
295
|
+
return e.stopPropagation();
|
|
335
296
|
}
|
|
336
|
-
},
|
|
337
|
-
className: "nut-range-button",
|
|
338
|
-
style: buttonStyle()
|
|
339
|
-
}, !hiddenTag ? React__default.createElement("div", {
|
|
340
|
-
className: "number"
|
|
341
|
-
}, curValueDesc || curValue(index)) : null));
|
|
297
|
+
}, renderButton(index));
|
|
342
298
|
}) : React__default.createElement("div", {
|
|
343
|
-
role: "slider",
|
|
344
299
|
className: "nut-range-button-wrapper",
|
|
345
|
-
tabIndex: disabled ? -1 : 0,
|
|
346
|
-
"aria-valuemin": +min,
|
|
347
|
-
"aria-valuenow": curValue(),
|
|
348
|
-
"aria-valuemax": +max,
|
|
349
|
-
"aria-orientation": vertical ? "vertical" : "horizontal",
|
|
350
300
|
onTouchStart: function onTouchStart(e) {
|
|
351
|
-
_onTouchStart(e);
|
|
301
|
+
return _onTouchStart(e);
|
|
352
302
|
},
|
|
353
303
|
onTouchMove: function onTouchMove(e) {
|
|
354
|
-
_onTouchMove(e);
|
|
304
|
+
return _onTouchMove(e);
|
|
355
305
|
},
|
|
356
306
|
onTouchEnd: function onTouchEnd(e) {
|
|
357
|
-
_onTouchEnd();
|
|
307
|
+
return _onTouchEnd();
|
|
358
308
|
},
|
|
359
309
|
onTouchCancel: function onTouchCancel(e) {
|
|
360
|
-
_onTouchEnd();
|
|
310
|
+
return _onTouchEnd();
|
|
361
311
|
},
|
|
362
312
|
onClick: function onClick(e) {
|
|
363
|
-
e.stopPropagation();
|
|
313
|
+
return e.stopPropagation();
|
|
364
314
|
}
|
|
365
|
-
},
|
|
366
|
-
className: "nut-range-button",
|
|
367
|
-
style: buttonStyle()
|
|
368
|
-
}, !hiddenTag ? React__default.createElement("div", {
|
|
369
|
-
className: "number"
|
|
370
|
-
}, curValueDesc || curValue()) : null)))), !hiddenRange ? React__default.createElement("div", {
|
|
315
|
+
}, renderButton()))), maxDescription !== null && React__default.createElement("div", {
|
|
371
316
|
className: "max"
|
|
372
|
-
},
|
|
317
|
+
}, maxDescription || max));
|
|
373
318
|
};
|
|
374
319
|
Range.defaultProps = defaultProps;
|
|
375
320
|
Range.displayName = "NutRange";
|