@nutui/nutui-react 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/form/__tests__/merge.spec.d.ts +1 -0
- package/dist/cjs/packages/form/__tests__/merge.spec.js +545 -0
- package/dist/cjs/packages/form/form.d.ts +2 -0
- package/dist/cjs/packages/form/form.js +9 -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/types.d.ts +2 -1
- package/dist/cjs/packages/form/useform.d.ts +2 -1
- package/dist/cjs/packages/form/useform.js +342 -278
- package/dist/cjs/packages/formitem/formitem.d.ts +1 -0
- package/dist/cjs/packages/formitem/formitem.js +55 -44
- package/dist/cjs/packages/formitem/style/formitem.scss +101 -21
- package/dist/cjs/packages/formitem/style/style.css +89 -12
- package/dist/cjs/packages/picker/style/index.js +1 -0
- package/dist/cjs/packages/picker/style/style.css +70 -0
- package/dist/cjs/packages/swipe/style/style.css +3 -3
- package/dist/cjs/packages/swipe/style/swipe.scss +7 -3
- 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/form/__tests__/merge.spec.d.ts +1 -0
- package/dist/es/packages/form/__tests__/merge.spec.js +541 -0
- package/dist/es/packages/form/form.d.ts +10 -0
- package/dist/es/packages/form/form.js +9 -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/types.d.ts +2 -1
- package/dist/es/packages/form/useform.d.ts +2 -1
- package/dist/es/packages/form/useform.js +340 -279
- package/dist/es/packages/formitem/formitem.d.ts +1 -0
- package/dist/es/packages/formitem/formitem.js +55 -44
- package/dist/es/packages/formitem/style/formitem.scss +101 -21
- package/dist/es/packages/formitem/style/style.css +89 -12
- package/dist/es/packages/picker/style/index.js +1 -0
- package/dist/es/packages/picker/style/style.css +70 -0
- package/dist/es/packages/swipe/style/style.css +3 -3
- package/dist/es/packages/swipe/style/swipe.scss +7 -3
- 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 +555 -422
- package/dist/style.css +1 -1
- package/dist/style.scss +41 -41
- package/package.json +1 -1
|
@@ -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%;
|
|
@@ -7,6 +7,7 @@ import { ArrowLeft } from "@nutui/icons-react";
|
|
|
7
7
|
import Overlay from "../overlay/index";
|
|
8
8
|
import { useConfig } from "../configprovider";
|
|
9
9
|
import { defaultOverlayProps } from "../overlay/overlay";
|
|
10
|
+
import Badge from "../badge/index";
|
|
10
11
|
var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps), {
|
|
11
12
|
activeText: '',
|
|
12
13
|
inactiveText: '',
|
|
@@ -43,6 +44,20 @@ export var FixedNav = function(props) {
|
|
|
43
44
|
var classes = classNames(classPrefix, {
|
|
44
45
|
active: visible
|
|
45
46
|
}, type, className);
|
|
47
|
+
var renderListItem = function(item, index) {
|
|
48
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
49
|
+
className: "".concat(classPrefix, "-list-item"),
|
|
50
|
+
onClick: function(event) {
|
|
51
|
+
return onSelect(item, event);
|
|
52
|
+
},
|
|
53
|
+
key: item.id || index
|
|
54
|
+
}, /*#__PURE__*/ React.isValidElement(item.icon) ? item.icon : /*#__PURE__*/ React.createElement("img", {
|
|
55
|
+
src: item.icon,
|
|
56
|
+
alt: ""
|
|
57
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
58
|
+
className: "".concat(classPrefix, "-list-text")
|
|
59
|
+
}, item.text));
|
|
60
|
+
};
|
|
46
61
|
return /*#__PURE__*/ React.createElement("div", _object_spread({
|
|
47
62
|
className: classes,
|
|
48
63
|
style: _object_spread({}, position, style)
|
|
@@ -57,20 +72,11 @@ export var FixedNav = function(props) {
|
|
|
57
72
|
}, children || /*#__PURE__*/ React.createElement("div", {
|
|
58
73
|
className: "".concat(classPrefix, "-list")
|
|
59
74
|
}, list.map(function(item, index) {
|
|
60
|
-
return /*#__PURE__*/ React.createElement(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
key: item.id || index
|
|
66
|
-
}, /*#__PURE__*/ React.isValidElement(item.icon) ? item.icon : /*#__PURE__*/ React.createElement("img", {
|
|
67
|
-
src: item.icon,
|
|
68
|
-
alt: ""
|
|
69
|
-
}), /*#__PURE__*/ React.createElement("div", {
|
|
70
|
-
className: "".concat(classPrefix, "-list-text")
|
|
71
|
-
}, item.text), item.num && /*#__PURE__*/ React.createElement("div", {
|
|
72
|
-
className: "b"
|
|
73
|
-
}, item.num));
|
|
75
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, item.num ? /*#__PURE__*/ React.createElement(Badge, {
|
|
76
|
+
value: item.num,
|
|
77
|
+
top: 8,
|
|
78
|
+
right: 6
|
|
79
|
+
}, renderListItem(item, index)) : /*#__PURE__*/ React.createElement(React.Fragment, null, renderListItem(item, index)));
|
|
74
80
|
}))), /*#__PURE__*/ React.createElement("div", {
|
|
75
81
|
className: "".concat(classPrefix, "-btn"),
|
|
76
82
|
onClick: function() {
|
|
@@ -95,21 +95,6 @@
|
|
|
95
95
|
.nut-fixednav-list-text {
|
|
96
96
|
font-size: 10px;
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
.b {
|
|
100
|
-
position: absolute;
|
|
101
|
-
right: 0;
|
|
102
|
-
top: 1px;
|
|
103
|
-
height: 14px;
|
|
104
|
-
line-height: 14px;
|
|
105
|
-
font-size: 10px;
|
|
106
|
-
padding: 0 3px;
|
|
107
|
-
color: white;
|
|
108
|
-
background: $color-primary;
|
|
109
|
-
border-radius: 7px;
|
|
110
|
-
text-align: center;
|
|
111
|
-
min-width: 12px;
|
|
112
|
-
}
|
|
113
98
|
}
|
|
114
99
|
}
|
|
115
100
|
|
|
@@ -57,6 +57,103 @@
|
|
|
57
57
|
right: 0;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.nut-badge {
|
|
61
|
+
position: relative;
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
width: auto;
|
|
64
|
+
}
|
|
65
|
+
.nut-badge-icon {
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
align-items: center;
|
|
69
|
+
background: var(--nutui-badge-background-color, var(--nutui-color-primary, #ff0f23));
|
|
70
|
+
padding: var(--nutui-badge-icon-padding, 2px);
|
|
71
|
+
text-align: center;
|
|
72
|
+
z-index: var(--nutui-badge-z-index, 1);
|
|
73
|
+
}
|
|
74
|
+
.nut-badge-icon .nut-icon {
|
|
75
|
+
width: var(--nutui-badge-icon-size, 10px);
|
|
76
|
+
height: var(--nutui-badge-icon-size, 10px);
|
|
77
|
+
font-size: var(--nutui-badge-icon-size, 10px);
|
|
78
|
+
}
|
|
79
|
+
.nut-badge-sup, .nut-badge-icon {
|
|
80
|
+
border-radius: var(--nutui-badge-border-radius, var(--nutui-badge-height, 14px));
|
|
81
|
+
}
|
|
82
|
+
.nut-badge-sup::after, .nut-badge-icon::after {
|
|
83
|
+
content: "";
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: -50%;
|
|
86
|
+
bottom: -50%;
|
|
87
|
+
left: -50%;
|
|
88
|
+
right: -50%;
|
|
89
|
+
transform: scale(0.5);
|
|
90
|
+
border: var(--nutui-badge-border, 1px solid #ffffff);
|
|
91
|
+
border-radius: var(--nutui-badge-border-radius, var(--nutui-badge-height, 14px));
|
|
92
|
+
}
|
|
93
|
+
.nut-badge-sup {
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
height: var(--nutui-badge-height, 14px);
|
|
97
|
+
min-width: var(--nutui-badge-min-width, 6px);
|
|
98
|
+
padding: var(--nutui-badge-padding, 1px 4px);
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
color: var(--nutui-badge-color, #ffffff);
|
|
101
|
+
font-size: var(--nutui-badge-font-size, var(--nutui-font-size-xxs, 10px));
|
|
102
|
+
line-height: 12px;
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
font-weight: normal;
|
|
105
|
+
vertical-align: middle;
|
|
106
|
+
background: var(--nutui-badge-background-color, var(--nutui-color-primary, #ff0f23));
|
|
107
|
+
z-index: 1;
|
|
108
|
+
}
|
|
109
|
+
.nut-badge-number {
|
|
110
|
+
font-family: "JD";
|
|
111
|
+
/* #ifdef harmony */
|
|
112
|
+
line-height: 12px;
|
|
113
|
+
/* #endif */
|
|
114
|
+
/* #ifndef harmony */
|
|
115
|
+
line-height: 13px;
|
|
116
|
+
/* #endif */
|
|
117
|
+
}
|
|
118
|
+
.nut-badge-one {
|
|
119
|
+
height: var(--nutui-badge-height, 14px);
|
|
120
|
+
width: var(--nutui-badge-height, 14px);
|
|
121
|
+
}
|
|
122
|
+
.nut-badge-content {
|
|
123
|
+
position: absolute;
|
|
124
|
+
transform: var(--nutui-badge-content-transform, translate(50%, -50%));
|
|
125
|
+
}
|
|
126
|
+
.nut-badge-dot {
|
|
127
|
+
padding: 0;
|
|
128
|
+
border-radius: 50%;
|
|
129
|
+
}
|
|
130
|
+
.nut-badge-dot::after {
|
|
131
|
+
border: var(--nutui-badge-dot-border, 1px solid #ffffff);
|
|
132
|
+
border-radius: 50%;
|
|
133
|
+
}
|
|
134
|
+
.nut-badge-dot-normal {
|
|
135
|
+
min-width: var(--nutui-badge-dot-width, 6px);
|
|
136
|
+
width: var(--nutui-badge-dot-width, 6px);
|
|
137
|
+
height: var(--nutui-badge-dot-width, 6px);
|
|
138
|
+
}
|
|
139
|
+
.nut-badge-dot-small {
|
|
140
|
+
min-width: var(--nutui-badge-dot-width, 4px);
|
|
141
|
+
width: var(--nutui-badge-dot-width, 4px);
|
|
142
|
+
height: var(--nutui-badge-dot-width, 4px);
|
|
143
|
+
}
|
|
144
|
+
.nut-badge-dot-large {
|
|
145
|
+
min-width: var(--nutui-badge-dot-width, 8px);
|
|
146
|
+
width: var(--nutui-badge-dot-width, 8px);
|
|
147
|
+
height: var(--nutui-badge-dot-width, 8px);
|
|
148
|
+
}
|
|
149
|
+
.nut-badge-outline {
|
|
150
|
+
background: #ffffff;
|
|
151
|
+
color: var(--nutui-badge-outline-color, var(--nutui-color-primary, #ff0f23));
|
|
152
|
+
}
|
|
153
|
+
.nut-badge-outline::after {
|
|
154
|
+
border: var(--nutui-badge-outline-border, 1px solid var(--nutui-color-primary, #ff0f23));
|
|
155
|
+
}
|
|
156
|
+
|
|
60
157
|
.nut-fixednav {
|
|
61
158
|
position: fixed;
|
|
62
159
|
z-index: var(--nutui-fixednav-index, 900);
|
|
@@ -136,20 +233,6 @@
|
|
|
136
233
|
.nut-fixednav-list-item .nut-fixednav-list-text {
|
|
137
234
|
font-size: 10px;
|
|
138
235
|
}
|
|
139
|
-
.nut-fixednav-list-item .b {
|
|
140
|
-
position: absolute;
|
|
141
|
-
right: 0;
|
|
142
|
-
top: 1px;
|
|
143
|
-
height: 14px;
|
|
144
|
-
line-height: 14px;
|
|
145
|
-
font-size: 10px;
|
|
146
|
-
padding: 0 3px;
|
|
147
|
-
color: white;
|
|
148
|
-
background: var(--nutui-color-primary, #ff0f23);
|
|
149
|
-
border-radius: 7px;
|
|
150
|
-
text-align: center;
|
|
151
|
-
min-width: 12px;
|
|
152
|
-
}
|
|
153
236
|
.nut-fixednav.left {
|
|
154
237
|
right: auto;
|
|
155
238
|
left: 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|