@nutui/nutui-react-taro 3.0.1 → 3.0.3-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 +19 -0
- package/dist/cjs/hooks/use-client-rect.js +1 -0
- package/dist/cjs/packages/datepicker/style/style.css +70 -0
- package/dist/cjs/packages/datepickerview/style/index.js +1 -0
- package/dist/cjs/packages/datepickerview/style/style.css +70 -0
- package/dist/cjs/packages/fixednav/fixednav.js +20 -14
- package/dist/cjs/packages/fixednav/style/fixednav.scss +0 -15
- package/dist/cjs/packages/fixednav/style/index.js +1 -0
- package/dist/cjs/packages/fixednav/style/style.css +97 -14
- package/dist/cjs/packages/fixednav/style/style.harmony.css +0 -14
- package/dist/cjs/packages/form/form.d.ts +2 -0
- package/dist/cjs/packages/form/form.js +11 -2
- package/dist/cjs/packages/form/index.d.ts +2 -1
- package/dist/cjs/packages/form/index.js +1 -0
- package/dist/cjs/packages/form/style/form.scss +0 -66
- package/dist/cjs/packages/form/style/style.css +31 -21
- package/dist/cjs/packages/form/style/style.harmony.css +1 -67
- package/dist/cjs/packages/form/types.d.ts +2 -1
- package/dist/cjs/packages/form/useform.d.ts +2 -1
- package/dist/cjs/packages/form/useform.js +338 -247
- package/dist/cjs/packages/formitem/formitem.d.ts +1 -0
- package/dist/cjs/packages/formitem/formitem.js +57 -45
- package/dist/cjs/packages/formitem/style/formitem.scss +101 -21
- package/dist/cjs/packages/formitem/style/style.css +89 -12
- package/dist/cjs/packages/formitem/style/style.harmony.css +89 -12
- package/dist/cjs/packages/input/input.js +3 -1
- package/dist/cjs/packages/picker/style/index.js +1 -0
- package/dist/cjs/packages/picker/style/style.css +70 -0
- package/dist/cjs/packages/signature/signature.js +1 -1
- package/dist/cjs/packages/swipe/style/style.css +3 -3
- package/dist/cjs/packages/swipe/style/style.harmony.css +3 -3
- package/dist/cjs/packages/swipe/style/swipe.scss +7 -3
- package/dist/cjs/packages/swipe/swipe.js +14 -15
- package/dist/cjs/utils/get-rect-by-taro.d.ts +1 -1
- package/dist/cjs/utils/get-rect-by-taro.js +4 -1
- package/dist/cjs/utils/get-system-info.js +4 -5
- package/dist/cjs/utils/merge.d.ts +14 -0
- package/dist/cjs/utils/merge.js +98 -0
- package/dist/cjs/utils/platform-taro.js +4 -5
- package/dist/cjs/utils/to-array.d.ts +1 -0
- package/dist/cjs/utils/to-array.js +18 -0
- package/dist/es/hooks/use-client-rect.js +1 -0
- package/dist/es/packages/datepicker/style/style.css +70 -0
- package/dist/es/packages/datepickerview/style/index.js +1 -0
- package/dist/es/packages/datepickerview/style/style.css +70 -0
- package/dist/es/packages/fixednav/fixednav.js +20 -14
- package/dist/es/packages/fixednav/style/fixednav.scss +0 -15
- package/dist/es/packages/fixednav/style/index.js +1 -0
- package/dist/es/packages/fixednav/style/style.css +97 -14
- package/dist/es/packages/fixednav/style/style.harmony.css +0 -14
- package/dist/es/packages/form/form.d.ts +10 -0
- package/dist/es/packages/form/form.js +11 -2
- package/dist/es/packages/form/index.d.ts +2 -1
- package/dist/es/packages/form/index.js +2 -1
- package/dist/es/packages/form/style/form.scss +0 -66
- package/dist/es/packages/form/style/style.css +31 -21
- package/dist/es/packages/form/style/style.harmony.css +1 -67
- package/dist/es/packages/form/types.d.ts +2 -1
- package/dist/es/packages/form/useform.d.ts +2 -1
- package/dist/es/packages/form/useform.js +336 -248
- package/dist/es/packages/formitem/formitem.d.ts +1 -0
- package/dist/es/packages/formitem/formitem.js +58 -46
- package/dist/es/packages/formitem/style/formitem.scss +101 -21
- package/dist/es/packages/formitem/style/style.css +89 -12
- package/dist/es/packages/formitem/style/style.harmony.css +89 -12
- package/dist/es/packages/input/input.js +3 -1
- package/dist/es/packages/picker/style/index.js +1 -0
- package/dist/es/packages/picker/style/style.css +70 -0
- package/dist/es/packages/signature/signature.js +2 -2
- package/dist/es/packages/swipe/style/style.css +3 -3
- package/dist/es/packages/swipe/style/style.harmony.css +3 -3
- package/dist/es/packages/swipe/style/swipe.scss +7 -3
- package/dist/es/packages/swipe/swipe.js +14 -15
- package/dist/es/utils/get-rect-by-taro.d.ts +1 -1
- package/dist/es/utils/get-rect-by-taro.js +4 -1
- package/dist/es/utils/get-system-info.js +4 -4
- package/dist/es/utils/merge.d.ts +14 -0
- package/dist/es/utils/merge.js +68 -0
- package/dist/es/utils/platform-taro.js +4 -4
- package/dist/es/utils/to-array.d.ts +1 -0
- package/dist/es/utils/to-array.js +8 -0
- package/dist/nutui.react.umd.js +4301 -4084
- package/dist/style.css +1 -1
- package/dist/style.scss +30 -30
- package/package.json +1 -1
|
@@ -383,6 +383,76 @@
|
|
|
383
383
|
right: 0;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
+
.nut-pickerview {
|
|
387
|
+
--nutui-picker-item-height: 36px;
|
|
388
|
+
position: relative;
|
|
389
|
+
display: flex;
|
|
390
|
+
width: 100%;
|
|
391
|
+
height: calc(var(--nutui-picker-item-height, 36px) * 7);
|
|
392
|
+
overflow: hidden;
|
|
393
|
+
}
|
|
394
|
+
.nut-pickerview-mask, .nut-pickerview-indicator {
|
|
395
|
+
position: absolute;
|
|
396
|
+
left: 0;
|
|
397
|
+
right: 0;
|
|
398
|
+
z-index: 3;
|
|
399
|
+
pointer-events: none;
|
|
400
|
+
}
|
|
401
|
+
.nut-pickerview-mask {
|
|
402
|
+
top: 0;
|
|
403
|
+
bottom: 0;
|
|
404
|
+
background-image: var(--picker-mask-background, linear-gradient(180deg, var(--nutui-white-12), var(--nutui-white-7)), linear-gradient(0deg, var(--nutui-white-12), var(--nutui-white-7)));
|
|
405
|
+
background-position: top, bottom;
|
|
406
|
+
background-size: 100% calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
407
|
+
background-repeat: no-repeat;
|
|
408
|
+
transform: translateZ(0);
|
|
409
|
+
}
|
|
410
|
+
.nut-pickerview-indicator {
|
|
411
|
+
top: calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
412
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
413
|
+
border: var(--nutui-picker-item-active-line-border, 1px solid var(--nutui-color-border, rgba(0, 0, 0, 0.06)));
|
|
414
|
+
border-left: 0;
|
|
415
|
+
border-right: 0;
|
|
416
|
+
box-sizing: border-box;
|
|
417
|
+
}
|
|
418
|
+
.nut-pickerview-list {
|
|
419
|
+
position: relative;
|
|
420
|
+
flex: 1;
|
|
421
|
+
height: calc(var(--nutui-picker-item-height, 36px) * 7);
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
touch-action: none;
|
|
424
|
+
}
|
|
425
|
+
.nut-pickerview-roller {
|
|
426
|
+
position: absolute;
|
|
427
|
+
top: calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
428
|
+
width: 100%;
|
|
429
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
430
|
+
z-index: 1;
|
|
431
|
+
transform-style: preserve-3d;
|
|
432
|
+
}
|
|
433
|
+
.nut-pickerview-roller-item {
|
|
434
|
+
position: absolute;
|
|
435
|
+
top: 0;
|
|
436
|
+
backface-visibility: hidden;
|
|
437
|
+
-moz-backface-visibility: hidden;
|
|
438
|
+
-webkit-backface-visibility: hidden;
|
|
439
|
+
}
|
|
440
|
+
.nut-pickerview-roller-item-hidden {
|
|
441
|
+
visibility: hidden;
|
|
442
|
+
opacity: 0;
|
|
443
|
+
}
|
|
444
|
+
.nut-pickerview-roller-item, .nut-pickerview-roller-item-tiled {
|
|
445
|
+
width: 100%;
|
|
446
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
447
|
+
line-height: var(--nutui-picker-item-height, 36px);
|
|
448
|
+
color: var(--nutui-picker-item-text-color, var(--nutui-color-title, #1a1a1a));
|
|
449
|
+
font-size: var(--nutui-picker-item-text-font-size, var(--nutui-font-size-base, 14px));
|
|
450
|
+
text-align: center;
|
|
451
|
+
overflow: hidden;
|
|
452
|
+
text-overflow: ellipsis;
|
|
453
|
+
white-space: nowrap;
|
|
454
|
+
}
|
|
455
|
+
|
|
386
456
|
.nut-picker {
|
|
387
457
|
background-color: var(--nutui-color-background-overlay, #ffffff);
|
|
388
458
|
width: 100%;
|
|
@@ -164,7 +164,7 @@ var InternalSignature = function InternalSignature(props, ref) {
|
|
|
164
164
|
onTouchStart: startEventHandler,
|
|
165
165
|
onTouchMove: moveEventHandler,
|
|
166
166
|
onTouchEnd: endEventHandler
|
|
167
|
-
}) : /*#__PURE__*/ _react.default.createElement(
|
|
167
|
+
}) : /*#__PURE__*/ _react.default.createElement(_components.Canvas, {
|
|
168
168
|
id: canvasId,
|
|
169
169
|
ref: canvasRef,
|
|
170
170
|
"canvas-id": canvasId,
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
.nut-swipe-left, .nut-swipe-right {
|
|
23
23
|
position: absolute;
|
|
24
24
|
top: 0;
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: row;
|
|
27
25
|
}
|
|
28
26
|
.nut-swipe-left {
|
|
29
27
|
left: 0;
|
|
28
|
+
transform: translate(-100%, 0px);
|
|
30
29
|
}
|
|
31
30
|
.nut-swipe-right {
|
|
32
|
-
|
|
31
|
+
right: 0px;
|
|
32
|
+
transform: translate(100%, 0px);
|
|
33
33
|
}
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
.nut-swipe-left, .nut-swipe-right {
|
|
23
23
|
position: absolute;
|
|
24
24
|
top: 0;
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: row;
|
|
27
25
|
}
|
|
28
26
|
.nut-swipe-left {
|
|
29
27
|
left: 0;
|
|
28
|
+
transform: translate(-100%, 0px);
|
|
30
29
|
}
|
|
31
30
|
.nut-swipe-right {
|
|
32
|
-
|
|
31
|
+
right: 0px;
|
|
32
|
+
transform: translate(100%, 0px);
|
|
33
33
|
}
|
|
@@ -20,15 +20,19 @@
|
|
|
20
20
|
&-right {
|
|
21
21
|
position: absolute;
|
|
22
22
|
top: 0;
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: row;
|
|
23
|
+
//display: flex;
|
|
24
|
+
//flex-direction: row;
|
|
25
|
+
//flex-shrink: 0;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
&-left {
|
|
28
29
|
left: 0;
|
|
30
|
+
transform: translate(-100%, 0px);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
&-right {
|
|
32
|
-
left: 100%;
|
|
34
|
+
//left: 100%;
|
|
35
|
+
right: 0px;
|
|
36
|
+
transform: translate(100%, 0px);
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -18,12 +18,13 @@ var _ts_generator = require("@swc/helpers/_/_ts_generator");
|
|
|
18
18
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
19
19
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
20
20
|
var _components = require("@tarojs/components");
|
|
21
|
+
var _taro = require("@tarojs/taro");
|
|
21
22
|
var _usetouch = require("../../hooks/use-touch");
|
|
22
23
|
var _getrectbytaro = require("../../utils/get-rect-by-taro");
|
|
23
24
|
var _typings = require("../../utils/typings");
|
|
24
25
|
var _platformtaro = require("../../utils/platform-taro");
|
|
25
|
-
var _pxtransform = /*#__PURE__*/ _interop_require_default._(require("../../utils/px-transform"));
|
|
26
26
|
var _userefstate = require("../../hooks/use-ref-state");
|
|
27
|
+
var _useuuid = /*#__PURE__*/ _interop_require_default._(require("../../hooks/use-uuid"));
|
|
27
28
|
function preventDefault(event, isStopPropagation) {
|
|
28
29
|
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
29
30
|
event.preventDefault();
|
|
@@ -38,8 +39,11 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
38
39
|
var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
39
40
|
var classPrefix = 'nut-swipe';
|
|
40
41
|
var touch = (0, _usetouch.useTouch)();
|
|
42
|
+
var uid = (0, _useuuid.default)();
|
|
43
|
+
var leftId = "swipe-left-".concat(uid);
|
|
44
|
+
var rightId = "swipe-right-".concat(uid);
|
|
41
45
|
// 获取元素的时候要在页面 onReady 后,需要参考小程序的事件周期
|
|
42
|
-
(0,
|
|
46
|
+
(0, _taro.useReady)(function() {
|
|
43
47
|
var getWidth = /*#__PURE__*/ function() {
|
|
44
48
|
var _ref = (0, _async_to_generator._)(function() {
|
|
45
49
|
var leftRect, rightRect;
|
|
@@ -52,7 +56,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
|
52
56
|
];
|
|
53
57
|
return [
|
|
54
58
|
4,
|
|
55
|
-
(0, _getrectbytaro.getRectByTaro)(leftWrapper.current)
|
|
59
|
+
(0, _getrectbytaro.getRectByTaro)(leftWrapper.current, leftId)
|
|
56
60
|
];
|
|
57
61
|
case 1:
|
|
58
62
|
leftRect = _state.sent();
|
|
@@ -69,11 +73,10 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
|
69
73
|
];
|
|
70
74
|
return [
|
|
71
75
|
4,
|
|
72
|
-
(0, _getrectbytaro.getRectByTaro)(rightWrapper.current)
|
|
76
|
+
(0, _getrectbytaro.getRectByTaro)(rightWrapper.current, rightId)
|
|
73
77
|
];
|
|
74
78
|
case 3:
|
|
75
79
|
rightRect = _state.sent();
|
|
76
|
-
console.log('actionWidth.current.left', rightRect.width);
|
|
77
80
|
rightRect && setActionWidth(function(v) {
|
|
78
81
|
return (0, _object_spread_props._)((0, _object_spread._)({}, v), {
|
|
79
82
|
right: rightRect.width
|
|
@@ -94,7 +97,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
|
94
97
|
setTimeout(function() {
|
|
95
98
|
return getWidth();
|
|
96
99
|
});
|
|
97
|
-
}
|
|
100
|
+
});
|
|
98
101
|
var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), children = _$_object_spread.children, className = _$_object_spread.className, style = _$_object_spread.style;
|
|
99
102
|
var root = (0, _react.useRef)();
|
|
100
103
|
var opened = (0, _react.useRef)(false);
|
|
@@ -122,7 +125,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
|
122
125
|
}
|
|
123
126
|
};
|
|
124
127
|
var wrapperStyle = {
|
|
125
|
-
transform: "translate(".concat(state.offset,
|
|
128
|
+
transform: "translate(".concat(state.offset).concat(!(0, _platformtaro.harmony)() ? 'px' : '', ", 0)"),
|
|
126
129
|
transitionDuration: state.dragging ? '0s' : '.6s'
|
|
127
130
|
};
|
|
128
131
|
var onTouchStart = /*#__PURE__*/ function() {
|
|
@@ -131,14 +134,13 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
|
131
134
|
return (0, _ts_generator._)(this, function(_state) {
|
|
132
135
|
switch(_state.label){
|
|
133
136
|
case 0:
|
|
134
|
-
console.log('ontouchstart');
|
|
135
137
|
if (!leftWrapper.current) return [
|
|
136
138
|
3,
|
|
137
139
|
2
|
|
138
140
|
];
|
|
139
141
|
return [
|
|
140
142
|
4,
|
|
141
|
-
(0, _getrectbytaro.getRectByTaro)(leftWrapper.current)
|
|
143
|
+
(0, _getrectbytaro.getRectByTaro)(leftWrapper.current, leftId)
|
|
142
144
|
];
|
|
143
145
|
case 1:
|
|
144
146
|
leftRect = _state.sent();
|
|
@@ -155,7 +157,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
|
155
157
|
];
|
|
156
158
|
return [
|
|
157
159
|
4,
|
|
158
|
-
(0, _getrectbytaro.getRectByTaro)(rightWrapper.current)
|
|
160
|
+
(0, _getrectbytaro.getRectByTaro)(rightWrapper.current, rightId)
|
|
159
161
|
];
|
|
160
162
|
case 3:
|
|
161
163
|
rightRect = _state.sent();
|
|
@@ -198,7 +200,7 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
|
198
200
|
if (isEdge) {
|
|
199
201
|
preventDefault(event, true);
|
|
200
202
|
}
|
|
201
|
-
newState.offset = rangeCalculation(
|
|
203
|
+
newState.offset = rangeCalculation(touch.deltaX.current + startOffset.current, -actionWidth.current.right || 0, actionWidth.current.left || 0);
|
|
202
204
|
setState(newState);
|
|
203
205
|
}
|
|
204
206
|
};
|
|
@@ -265,13 +267,10 @@ var Swipe = /*#__PURE__*/ (0, _react.forwardRef)(function(props, instanceRef) {
|
|
|
265
267
|
var rightWrapper = (0, _react.useRef)(null);
|
|
266
268
|
var renderActionContent = function renderActionContent(side) {
|
|
267
269
|
if (props["".concat(side, "Action")]) {
|
|
268
|
-
console.log('actionWidth xxx', actionWidth.current.left);
|
|
269
270
|
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
270
271
|
ref: side === 'left' ? leftWrapper : rightWrapper,
|
|
271
272
|
className: "".concat(classPrefix, "-").concat(side),
|
|
272
|
-
|
|
273
|
-
left: Number("".concat(-actionWidth.current.left))
|
|
274
|
-
} : {}),
|
|
273
|
+
id: side === 'left' ? leftId : rightId,
|
|
275
274
|
onClick: function onClick(e) {
|
|
276
275
|
return handleOperate(e, side);
|
|
277
276
|
}
|
|
@@ -9,4 +9,4 @@ export interface Rect {
|
|
|
9
9
|
height: number;
|
|
10
10
|
}
|
|
11
11
|
export declare function makeRect(width: number, height: number): Rect;
|
|
12
|
-
export declare const getRectByTaro: (element: any) => Promise<Rect>;
|
|
12
|
+
export declare const getRectByTaro: (element: any, harmonyId?: string) => Promise<Rect>;
|
|
@@ -33,7 +33,10 @@ function makeRect(width, height) {
|
|
|
33
33
|
}
|
|
34
34
|
var getRectByTaro = /*#__PURE__*/ function() {
|
|
35
35
|
var _ref = (0, _async_to_generator._)(function(element) {
|
|
36
|
+
var harmonyId;
|
|
37
|
+
var _arguments = arguments;
|
|
36
38
|
return (0, _ts_generator._)(this, function(_state) {
|
|
39
|
+
harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
|
|
37
40
|
if (element) {
|
|
38
41
|
if (_useclientrect.inBrowser) {
|
|
39
42
|
return [
|
|
@@ -45,7 +48,7 @@ var getRectByTaro = /*#__PURE__*/ function() {
|
|
|
45
48
|
return [
|
|
46
49
|
2,
|
|
47
50
|
new Promise(function(resolve, reject) {
|
|
48
|
-
(0, _taro.createSelectorQuery)().select("#".concat(element.uid)).boundingClientRect().exec(function(param) {
|
|
51
|
+
(0, _taro.createSelectorQuery)().select("#".concat(harmonyId || element.uid)).boundingClientRect().exec(function(param) {
|
|
49
52
|
var _param = (0, _sliced_to_array._)(param, 1), rects = _param[0];
|
|
50
53
|
resolve(rects);
|
|
51
54
|
});
|
|
@@ -19,14 +19,13 @@ _export(exports, {
|
|
|
19
19
|
return getWindowInfo;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
var
|
|
23
|
-
var _taro = /*#__PURE__*/ _interop_require_default._(require("@tarojs/taro"));
|
|
22
|
+
var _taro = require("@tarojs/taro");
|
|
24
23
|
var getDeviceInfo = function getDeviceInfo() {
|
|
25
|
-
return _taro.
|
|
24
|
+
return (0, _taro.canIUse)('getDeviceInfo') ? (0, _taro.getDeviceInfo)() : (0, _taro.getSystemInfoSync)();
|
|
26
25
|
};
|
|
27
26
|
var getWindowInfo = function getWindowInfo() {
|
|
28
|
-
return _taro.
|
|
27
|
+
return (0, _taro.canIUse)('getWindowInfo') ? (0, _taro.getWindowInfo)() : (0, _taro.getSystemInfoSync)();
|
|
29
28
|
};
|
|
30
29
|
var getAppBaseInfo = function getAppBaseInfo() {
|
|
31
|
-
return _taro.
|
|
30
|
+
return (0, _taro.canIUse)('getAppBaseInfo') ? (0, _taro.getAppBaseInfo)() : (0, _taro.getSystemInfoSync)();
|
|
32
31
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default main;
|
|
2
|
+
export declare function main(clone: boolean, ...items: any[]): any;
|
|
3
|
+
export declare function main(...items: any[]): any;
|
|
4
|
+
export declare namespace main {
|
|
5
|
+
var clone: typeof import("./merge").clone;
|
|
6
|
+
var isPlainObject: typeof import("./merge").isPlainObject;
|
|
7
|
+
var recursive: typeof import("./merge").recursive;
|
|
8
|
+
}
|
|
9
|
+
export declare function merge(clone: boolean, ...items: any[]): any;
|
|
10
|
+
export declare function merge(...items: any[]): any;
|
|
11
|
+
export declare function recursive(clone: boolean, ...items: any[]): any;
|
|
12
|
+
export declare function recursive(...items: any[]): any;
|
|
13
|
+
export declare function clone<T>(input: T): T;
|
|
14
|
+
export declare function isPlainObject(input: unknown): input is NonNullable<any>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
clone: function() {
|
|
13
|
+
return clone;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
},
|
|
18
|
+
isPlainObject: function() {
|
|
19
|
+
return isPlainObject;
|
|
20
|
+
},
|
|
21
|
+
main: function() {
|
|
22
|
+
return main;
|
|
23
|
+
},
|
|
24
|
+
merge: function() {
|
|
25
|
+
return merge;
|
|
26
|
+
},
|
|
27
|
+
recursive: function() {
|
|
28
|
+
return recursive;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
var _to_consumable_array = require("@swc/helpers/_/_to_consumable_array");
|
|
32
|
+
var _type_of = require("@swc/helpers/_/_type_of");
|
|
33
|
+
var _default = main;
|
|
34
|
+
function main() {
|
|
35
|
+
for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
|
|
36
|
+
items[_key] = arguments[_key];
|
|
37
|
+
}
|
|
38
|
+
return merge.apply(void 0, (0, _to_consumable_array._)(items));
|
|
39
|
+
}
|
|
40
|
+
main.clone = clone;
|
|
41
|
+
main.isPlainObject = isPlainObject;
|
|
42
|
+
main.recursive = recursive;
|
|
43
|
+
function merge() {
|
|
44
|
+
for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
|
|
45
|
+
items[_key] = arguments[_key];
|
|
46
|
+
}
|
|
47
|
+
return _merge(items[0] === true, false, items);
|
|
48
|
+
}
|
|
49
|
+
function recursive() {
|
|
50
|
+
for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
|
|
51
|
+
items[_key] = arguments[_key];
|
|
52
|
+
}
|
|
53
|
+
return _merge(items[0] === true, true, items);
|
|
54
|
+
}
|
|
55
|
+
function clone(input) {
|
|
56
|
+
if (Array.isArray(input)) {
|
|
57
|
+
var output = [];
|
|
58
|
+
for(var index = 0; index < input.length; ++index)output.push(clone(input[index]));
|
|
59
|
+
return output;
|
|
60
|
+
}
|
|
61
|
+
if (isPlainObject(input)) {
|
|
62
|
+
var output1 = {};
|
|
63
|
+
// eslint-disable-next-line guard-for-in
|
|
64
|
+
for(var index1 in input)output1[index1] = clone(input[index1]);
|
|
65
|
+
return output1;
|
|
66
|
+
}
|
|
67
|
+
return input;
|
|
68
|
+
}
|
|
69
|
+
function isPlainObject(input) {
|
|
70
|
+
if (input === null || (typeof input === "undefined" ? "undefined" : (0, _type_of._)(input)) !== 'object') return false;
|
|
71
|
+
if (Object.getPrototypeOf(input) === null) return true;
|
|
72
|
+
var ref = input;
|
|
73
|
+
while(Object.getPrototypeOf(ref) !== null)ref = Object.getPrototypeOf(ref);
|
|
74
|
+
return Object.getPrototypeOf(input) === ref;
|
|
75
|
+
}
|
|
76
|
+
function _recursiveMerge(base, extend) {
|
|
77
|
+
if (!isPlainObject(base) || !isPlainObject(extend)) return extend;
|
|
78
|
+
for(var key in extend){
|
|
79
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue;
|
|
80
|
+
base[key] = isPlainObject(base[key]) && isPlainObject(extend[key]) ? _recursiveMerge(base[key], extend[key]) : extend[key];
|
|
81
|
+
}
|
|
82
|
+
return base;
|
|
83
|
+
}
|
|
84
|
+
function _merge(isClone, isRecursive, items) {
|
|
85
|
+
var result;
|
|
86
|
+
if (isClone || !isPlainObject(result = items.shift())) result = {};
|
|
87
|
+
for(var index = 0; index < items.length; ++index){
|
|
88
|
+
var item = items[index];
|
|
89
|
+
// eslint-disable-next-line no-continue
|
|
90
|
+
if (!isPlainObject(item)) continue;
|
|
91
|
+
for(var key in item){
|
|
92
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue;
|
|
93
|
+
var value = isClone ? clone(item[key]) : item[key];
|
|
94
|
+
result[key] = isRecursive ? _recursiveMerge(result[key], value) : value;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
@@ -19,22 +19,21 @@ _export(exports, {
|
|
|
19
19
|
return web;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
var
|
|
23
|
-
var _taro = /*#__PURE__*/ _interop_require_default._(require("@tarojs/taro"));
|
|
22
|
+
var _taro = require("@tarojs/taro");
|
|
24
23
|
var harmony = function harmony() {
|
|
25
24
|
return [
|
|
26
25
|
'harmony',
|
|
27
26
|
'harmonyhybrid',
|
|
28
27
|
'jdharmony'
|
|
29
|
-
].includes(_taro.
|
|
28
|
+
].includes((0, _taro.getEnv)().toLowerCase());
|
|
30
29
|
};
|
|
31
30
|
var web = function web() {
|
|
32
31
|
return [
|
|
33
32
|
'web'
|
|
34
|
-
].includes(_taro.
|
|
33
|
+
].includes((0, _taro.getEnv)().toLowerCase());
|
|
35
34
|
};
|
|
36
35
|
var miniprogram = function miniprogram() {
|
|
37
36
|
return [
|
|
38
37
|
'mini'
|
|
39
|
-
].includes(_taro.
|
|
38
|
+
].includes((0, _taro.getEnv)().toLowerCase());
|
|
40
39
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toArray<T>(value?: T | T[] | null): T[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "toArray", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return toArray;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function toArray(value) {
|
|
12
|
+
if (value === undefined || value === null) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
return Array.isArray(value) ? value : [
|
|
16
|
+
value
|
|
17
|
+
];
|
|
18
|
+
}
|
|
@@ -383,6 +383,76 @@
|
|
|
383
383
|
right: 0;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
+
.nut-pickerview {
|
|
387
|
+
--nutui-picker-item-height: 36px;
|
|
388
|
+
position: relative;
|
|
389
|
+
display: flex;
|
|
390
|
+
width: 100%;
|
|
391
|
+
height: calc(var(--nutui-picker-item-height, 36px) * 7);
|
|
392
|
+
overflow: hidden;
|
|
393
|
+
}
|
|
394
|
+
.nut-pickerview-mask, .nut-pickerview-indicator {
|
|
395
|
+
position: absolute;
|
|
396
|
+
left: 0;
|
|
397
|
+
right: 0;
|
|
398
|
+
z-index: 3;
|
|
399
|
+
pointer-events: none;
|
|
400
|
+
}
|
|
401
|
+
.nut-pickerview-mask {
|
|
402
|
+
top: 0;
|
|
403
|
+
bottom: 0;
|
|
404
|
+
background-image: var(--picker-mask-background, linear-gradient(180deg, var(--nutui-white-12), var(--nutui-white-7)), linear-gradient(0deg, var(--nutui-white-12), var(--nutui-white-7)));
|
|
405
|
+
background-position: top, bottom;
|
|
406
|
+
background-size: 100% calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
407
|
+
background-repeat: no-repeat;
|
|
408
|
+
transform: translateZ(0);
|
|
409
|
+
}
|
|
410
|
+
.nut-pickerview-indicator {
|
|
411
|
+
top: calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
412
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
413
|
+
border: var(--nutui-picker-item-active-line-border, 1px solid var(--nutui-color-border, rgba(0, 0, 0, 0.06)));
|
|
414
|
+
border-left: 0;
|
|
415
|
+
border-right: 0;
|
|
416
|
+
box-sizing: border-box;
|
|
417
|
+
}
|
|
418
|
+
.nut-pickerview-list {
|
|
419
|
+
position: relative;
|
|
420
|
+
flex: 1;
|
|
421
|
+
height: calc(var(--nutui-picker-item-height, 36px) * 7);
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
touch-action: none;
|
|
424
|
+
}
|
|
425
|
+
.nut-pickerview-roller {
|
|
426
|
+
position: absolute;
|
|
427
|
+
top: calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
428
|
+
width: 100%;
|
|
429
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
430
|
+
z-index: 1;
|
|
431
|
+
transform-style: preserve-3d;
|
|
432
|
+
}
|
|
433
|
+
.nut-pickerview-roller-item {
|
|
434
|
+
position: absolute;
|
|
435
|
+
top: 0;
|
|
436
|
+
backface-visibility: hidden;
|
|
437
|
+
-moz-backface-visibility: hidden;
|
|
438
|
+
-webkit-backface-visibility: hidden;
|
|
439
|
+
}
|
|
440
|
+
.nut-pickerview-roller-item-hidden {
|
|
441
|
+
visibility: hidden;
|
|
442
|
+
opacity: 0;
|
|
443
|
+
}
|
|
444
|
+
.nut-pickerview-roller-item, .nut-pickerview-roller-item-tiled {
|
|
445
|
+
width: 100%;
|
|
446
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
447
|
+
line-height: var(--nutui-picker-item-height, 36px);
|
|
448
|
+
color: var(--nutui-picker-item-text-color, var(--nutui-color-title, #1a1a1a));
|
|
449
|
+
font-size: var(--nutui-picker-item-text-font-size, var(--nutui-font-size-base, 14px));
|
|
450
|
+
text-align: center;
|
|
451
|
+
overflow: hidden;
|
|
452
|
+
text-overflow: ellipsis;
|
|
453
|
+
white-space: nowrap;
|
|
454
|
+
}
|
|
455
|
+
|
|
386
456
|
.nut-picker {
|
|
387
457
|
background-color: var(--nutui-color-background-overlay, #ffffff);
|
|
388
458
|
width: 100%;
|
|
@@ -2,6 +2,76 @@
|
|
|
2
2
|
/* #endif */
|
|
3
3
|
/* #ifndef harmony */
|
|
4
4
|
/* #endif */
|
|
5
|
+
.nut-pickerview {
|
|
6
|
+
--nutui-picker-item-height: 36px;
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: calc(var(--nutui-picker-item-height, 36px) * 7);
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
.nut-pickerview-mask, .nut-pickerview-indicator {
|
|
14
|
+
position: absolute;
|
|
15
|
+
left: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
z-index: 3;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
}
|
|
20
|
+
.nut-pickerview-mask {
|
|
21
|
+
top: 0;
|
|
22
|
+
bottom: 0;
|
|
23
|
+
background-image: var(--picker-mask-background, linear-gradient(180deg, var(--nutui-white-12), var(--nutui-white-7)), linear-gradient(0deg, var(--nutui-white-12), var(--nutui-white-7)));
|
|
24
|
+
background-position: top, bottom;
|
|
25
|
+
background-size: 100% calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
26
|
+
background-repeat: no-repeat;
|
|
27
|
+
transform: translateZ(0);
|
|
28
|
+
}
|
|
29
|
+
.nut-pickerview-indicator {
|
|
30
|
+
top: calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
31
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
32
|
+
border: var(--nutui-picker-item-active-line-border, 1px solid var(--nutui-color-border, rgba(0, 0, 0, 0.06)));
|
|
33
|
+
border-left: 0;
|
|
34
|
+
border-right: 0;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
}
|
|
37
|
+
.nut-pickerview-list {
|
|
38
|
+
position: relative;
|
|
39
|
+
flex: 1;
|
|
40
|
+
height: calc(var(--nutui-picker-item-height, 36px) * 7);
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
touch-action: none;
|
|
43
|
+
}
|
|
44
|
+
.nut-pickerview-roller {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
49
|
+
z-index: 1;
|
|
50
|
+
transform-style: preserve-3d;
|
|
51
|
+
}
|
|
52
|
+
.nut-pickerview-roller-item {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 0;
|
|
55
|
+
backface-visibility: hidden;
|
|
56
|
+
-moz-backface-visibility: hidden;
|
|
57
|
+
-webkit-backface-visibility: hidden;
|
|
58
|
+
}
|
|
59
|
+
.nut-pickerview-roller-item-hidden {
|
|
60
|
+
visibility: hidden;
|
|
61
|
+
opacity: 0;
|
|
62
|
+
}
|
|
63
|
+
.nut-pickerview-roller-item, .nut-pickerview-roller-item-tiled {
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
66
|
+
line-height: var(--nutui-picker-item-height, 36px);
|
|
67
|
+
color: var(--nutui-picker-item-text-color, var(--nutui-color-title, #1a1a1a));
|
|
68
|
+
font-size: var(--nutui-picker-item-text-font-size, var(--nutui-font-size-base, 14px));
|
|
69
|
+
text-align: center;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
text-overflow: ellipsis;
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
5
75
|
.nut-datepickerview {
|
|
6
76
|
display: flex;
|
|
7
77
|
width: 100%;
|