@nutui/nutui-react 3.0.5 → 3.0.6

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/dist/cjs/packages/badge/badge.js +4 -3
  3. package/dist/cjs/packages/badge/style/badge.scss +4 -0
  4. package/dist/cjs/packages/badge/style/style.css +9 -6
  5. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  6. package/dist/cjs/packages/datepicker/style/style.css +3 -0
  7. package/dist/cjs/packages/datepickerview/style/style.css +3 -0
  8. package/dist/cjs/packages/fixednav/style/style.css +9 -6
  9. package/dist/cjs/packages/indicator/indicator.js +1 -1
  10. package/dist/cjs/packages/lottie/index.d.ts +1 -1
  11. package/dist/cjs/packages/lottie/index.js +2 -2
  12. package/dist/cjs/packages/notify/Notification.d.ts +3 -9
  13. package/dist/cjs/packages/notify/Notification.js +27 -7
  14. package/dist/cjs/packages/notify/notify.d.ts +0 -4
  15. package/dist/cjs/packages/notify/notify.js +6 -34
  16. package/dist/cjs/packages/notify/style/notify.scss +39 -36
  17. package/dist/cjs/packages/notify/style/style.css +36 -31
  18. package/dist/cjs/packages/picker/style/style.css +3 -0
  19. package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -0
  20. package/dist/cjs/packages/pickerview/style/style.css +3 -0
  21. package/dist/cjs/packages/skeleton/skeleton.js +64 -49
  22. package/dist/cjs/packages/skeleton/style/index.js +0 -1
  23. package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
  24. package/dist/cjs/packages/skeleton/style/style.css +32 -175
  25. package/dist/cjs/packages/switch/style/style.css +5 -0
  26. package/dist/cjs/packages/switch/style/switch.scss +5 -0
  27. package/dist/cjs/packages/switch/switch.js +22 -11
  28. package/dist/cjs/packages/tabbar/style/style.css +54 -45
  29. package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
  30. package/dist/cjs/packages/tabbar/tabbar.js +28 -10
  31. package/dist/cjs/packages/tabbaritem/style/style.css +30 -27
  32. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
  33. package/dist/cjs/packages/tabbaritem/tabbaritem.js +34 -13
  34. package/dist/cjs/types/spec/badge/base.d.ts +1 -0
  35. package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
  36. package/dist/cjs/types/spec/notify/base.d.ts +7 -2
  37. package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
  38. package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
  39. package/dist/cjs/types/spec/switch/base.d.ts +3 -2
  40. package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
  41. package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
  42. package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
  43. package/dist/es/packages/badge/badge.js +4 -3
  44. package/dist/es/packages/badge/style/badge.scss +4 -0
  45. package/dist/es/packages/badge/style/style.css +9 -6
  46. package/dist/es/packages/configprovider/types.d.ts +1 -1
  47. package/dist/es/packages/datepicker/style/style.css +3 -0
  48. package/dist/es/packages/datepickerview/style/style.css +3 -0
  49. package/dist/es/packages/fixednav/style/style.css +9 -6
  50. package/dist/es/packages/indicator/indicator.js +1 -1
  51. package/dist/es/packages/lottie/index.d.ts +1 -1
  52. package/dist/es/packages/lottie/index.js +1 -1
  53. package/dist/es/packages/notify/Notification.d.ts +3 -9
  54. package/dist/es/packages/notify/Notification.js +27 -7
  55. package/dist/es/packages/notify/notify.d.ts +0 -4
  56. package/dist/es/packages/notify/notify.js +6 -34
  57. package/dist/es/packages/notify/style/notify.scss +39 -36
  58. package/dist/es/packages/notify/style/style.css +36 -31
  59. package/dist/es/packages/picker/style/style.css +3 -0
  60. package/dist/es/packages/pickerview/style/pickerview.scss +3 -0
  61. package/dist/es/packages/pickerview/style/style.css +3 -0
  62. package/dist/es/packages/skeleton/skeleton.js +63 -49
  63. package/dist/es/packages/skeleton/style/index.js +0 -1
  64. package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
  65. package/dist/es/packages/skeleton/style/style.css +32 -175
  66. package/dist/es/packages/switch/style/style.css +5 -0
  67. package/dist/es/packages/switch/style/switch.scss +5 -0
  68. package/dist/es/packages/switch/switch.js +21 -11
  69. package/dist/es/packages/tabbar/style/style.css +54 -45
  70. package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
  71. package/dist/es/packages/tabbar/tabbar.js +27 -10
  72. package/dist/es/packages/tabbaritem/style/style.css +30 -27
  73. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
  74. package/dist/es/packages/tabbaritem/tabbaritem.js +34 -13
  75. package/dist/es/types/spec/badge/base.d.ts +4 -0
  76. package/dist/es/types/spec/indicator/base.d.ts +1 -1
  77. package/dist/es/types/spec/notify/base.d.ts +22 -5
  78. package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
  79. package/dist/es/types/spec/skeleton/base.d.ts +19 -14
  80. package/dist/es/types/spec/switch/base.d.ts +6 -2
  81. package/dist/es/types/spec/switch/h5.d.ts +1 -1
  82. package/dist/es/types/spec/switch/taro.d.ts +1 -4
  83. package/dist/es/types/spec/tabbar/base.d.ts +7 -4
  84. package/dist/nutui.react.umd.js +334 -284
  85. package/dist/style.css +1 -1
  86. package/dist/style.scss +45 -45
  87. package/dist/styles/variables-jmapp.scss +23 -1
  88. package/dist/styles/variables-jrkf.scss +23 -1
  89. package/dist/styles/variables.scss +35 -37
  90. package/package.json +1 -1
  91. /package/dist/cjs/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
  92. /package/dist/cjs/packages/lottie/{web.js → lottie.js} +0 -0
  93. /package/dist/es/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
  94. /package/dist/es/packages/lottie/{web.js → lottie.js} +0 -0
@@ -11,7 +11,7 @@
11
11
  /*入场动画过程*/
12
12
  .fade-enter-active {
13
13
  opacity: 1;
14
- transition: opacity 1s;
14
+ transition: opacity 300ms ease-in;
15
15
  }
16
16
 
17
17
  /*入场动画结束*/
@@ -27,7 +27,7 @@
27
27
  /*离场动画过程*/
28
28
  .fade-exit-active {
29
29
  opacity: 0;
30
- transition: opacity 1s;
30
+ transition: opacity 300ms ease-out;
31
31
  }
32
32
 
33
33
  /*离场动画结束*/
@@ -43,47 +43,52 @@
43
43
  /*页面第一次加载时的动画过程*/
44
44
  .fade-appear-active {
45
45
  opacity: 1;
46
- transition: opacity 1s;
46
+ transition: opacity 300ms;
47
47
  }
48
48
 
49
49
  .nut-notify {
50
+ position: fixed;
51
+ left: 8px;
52
+ right: 8px;
53
+ z-index: var(--nutui-notify-z-index, 1000);
50
54
  display: flex;
51
- justify-content: center;
52
55
  align-items: center;
53
56
  box-sizing: border-box;
54
- padding: var(--nutui-notify-padding, 0px 10px);
55
- color: var(--nutui-notify-text-color, #ffffff);
56
- font-size: var(--nutui-notify-font-size, var(--nutui-font-size-base, 14px));
57
- white-space: pre-wrap;
58
- word-wrap: break-word;
59
57
  height: var(--nutui-notify-height, 40px);
58
+ padding: var(--nutui-notify-padding, 0px 12px);
59
+ border-radius: var(--nutui-notify-border-radius, 8px);
60
+ box-shadow: var(--nutui-notify-box-shadow, 0px 4px 12px 0px rgba(0, 0, 0, 0.06));
61
+ background-color: var(--nutui-notify-background-color, #ffffff);
62
+ }
63
+ .nut-notify-content {
64
+ flex: 1;
65
+ text-align: center;
66
+ min-width: 0;
67
+ font-size: var(--nutui-notify-font-size, var(--nutui-font-size-base, 14px));
68
+ color: var(--nutui-notify-text-color, var(--nutui-color-title, #1a1a1a));
69
+ white-space: nowrap;
70
+ overflow: hidden;
60
71
  }
61
- .nut-notify-popup-top, .nut-notify-popup-bottom {
62
- position: fixed;
63
- left: 0;
64
- right: 0;
65
- overflow-y: auto;
66
- transition: transform 0.3s;
67
- z-index: 9999;
68
- }
69
- .nut-notify-popup-top {
70
- top: 0;
72
+ .nut-notify-ellipsis {
73
+ text-overflow: ellipsis;
71
74
  }
72
- .nut-notify-popup-bottom {
73
- bottom: 0;
75
+ .nut-notify-layout-left {
76
+ text-align: left;
74
77
  }
75
- .nut-notify-base {
76
- background: var(--nutui-notify-base-background-color, var(--nutui-color-primary, #ff0f23));
78
+ .nut-notify-left-icon, .nut-notify-right-icon {
79
+ display: inline-flex;
77
80
  }
78
- .nut-notify-primary {
79
- background: var(--nutui-notify-primary-background-color, var(--nutui-color-info, #0073ff));
81
+ .nut-notify-left-icon {
82
+ margin-right: 6px;
80
83
  }
81
- .nut-notify-success {
82
- background: var(--nutui-notify-success-background-color, var(--nutui-color-success, #00d900));
84
+ .nut-notify-left-icon .nut-icon {
85
+ height: 16px;
86
+ width: 16px;
83
87
  }
84
- .nut-notify-danger {
85
- background: var(--nutui-notify-danger-background-color, var(--nutui-color-primary, #ff0f23));
88
+ .nut-notify-right-icon {
89
+ margin-left: 6px;
86
90
  }
87
- .nut-notify-warning {
88
- background: var(--nutui-notify-warning-background-color, var(--nutui-color-warning, #ffbf00));
91
+ .nut-notify-right-icon .nut-icon {
92
+ height: 12px;
93
+ width: 12px;
89
94
  }
@@ -429,6 +429,9 @@
429
429
  z-index: 1;
430
430
  transform-style: preserve-3d;
431
431
  }
432
+ .nut-pickerview-roller-placeholder {
433
+ height: var(--nutui-picker-item-height, 36px);
434
+ }
432
435
  .nut-pickerview-roller-item {
433
436
  position: absolute;
434
437
  top: 0;
@@ -49,6 +49,9 @@
49
49
  height: $picker-item-height;
50
50
  z-index: 1;
51
51
  transform-style: preserve-3d;
52
+ &-placeholder {
53
+ height: $picker-item-height;
54
+ }
52
55
  }
53
56
 
54
57
  &-roller-item {
@@ -48,6 +48,9 @@
48
48
  z-index: 1;
49
49
  transform-style: preserve-3d;
50
50
  }
51
+ .nut-pickerview-roller-placeholder {
52
+ height: var(--nutui-picker-item-height, 36px);
53
+ }
51
54
  .nut-pickerview-roller-item {
52
55
  position: absolute;
53
56
  top: 0;
@@ -9,80 +9,95 @@ Object.defineProperty(exports, "Skeleton", {
9
9
  }
10
10
  });
11
11
  var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
- var _define_property = require("@swc/helpers/_/_define_property");
12
+ var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
13
  var _object_spread = require("@swc/helpers/_/_object_spread");
14
14
  var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
15
15
  var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
16
- var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
16
+ var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
17
+ var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
17
18
  var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
18
- var _avatar = /*#__PURE__*/ _interop_require_default._(require("../avatar"));
19
19
  var _typings = require("../../utils/typings");
20
20
  var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
21
21
  rows: 1,
22
- animated: false,
23
- title: false,
24
- avatar: false,
25
- avatarSize: '50px',
22
+ animated: true,
26
23
  visible: false,
27
- avatarShape: 'round'
24
+ size: 'normal',
25
+ shape: 'round',
26
+ duration: 0.6,
27
+ inline: false
28
28
  });
29
29
  var Skeleton = function Skeleton(props) {
30
- var _ref = (0, _object_spread._)({}, defaultProps, props), className = _ref.className, animated = _ref.animated, rows = _ref.rows, title = _ref.title, avatar = _ref.avatar, avatarSize = _ref.avatarSize, visible = _ref.visible, children = _ref.children, avatarShape = _ref.avatarShape, rest = (0, _object_without_properties._)(_ref, [
30
+ var shapeStyle = function shapeStyle() {
31
+ if (shape === 'circle') return {
32
+ borderRadius: '50%'
33
+ };
34
+ if (shape === 'square') return {
35
+ borderRadius: '0'
36
+ };
37
+ return {};
38
+ };
39
+ var durationStyle = function durationStyle() {
40
+ if (typeof duration !== 'undefined') return {
41
+ animationDuration: "".concat(duration, "s")
42
+ };
43
+ return {};
44
+ };
45
+ var _ref = (0, _object_spread._)({}, defaultProps, props), className = _ref.className, width = _ref.width, height = _ref.height, shape = _ref.shape, animated = _ref.animated, rows = _ref.rows, visible = _ref.visible, size = _ref.size, duration = _ref.duration, children = _ref.children, rest = (0, _object_without_properties._)(_ref, [
31
46
  "className",
47
+ "width",
48
+ "height",
49
+ "shape",
32
50
  "animated",
33
51
  "rows",
34
- "title",
35
- "avatar",
36
- "avatarSize",
37
52
  "visible",
38
- "children",
39
- "avatarShape"
53
+ "size",
54
+ "duration",
55
+ "children"
40
56
  ]);
41
57
  var classPrefix = 'nut-skeleton';
42
58
  var classes = (0, _classnames.default)(classPrefix, className);
43
- var _obj;
44
- var avatarClass = (0, _classnames.default)((_obj = {}, (0, _define_property._)(_obj, "nut-avatar", true), (0, _define_property._)(_obj, "nut-skeleton-content-avatar", true), (0, _define_property._)(_obj, "avatar-".concat(avatarShape), avatarShape), _obj));
45
- var repeatLines = function repeatLines(num) {
59
+ var repeatCount = function repeatCount(num) {
46
60
  return Array.from({
47
61
  length: num
48
62
  }, function(v, i) {
49
63
  return i;
50
64
  });
51
65
  };
52
- var getStyle = function getStyle() {
53
- if (avatarSize) {
54
- return {
55
- width: avatarSize,
56
- height: avatarSize
57
- };
58
- }
59
- return {
60
- width: '50px',
61
- height: '50px'
62
- };
66
+ var _useState = (0, _sliced_to_array._)((0, _react.useState)(false), 2), animate = _useState[0], setAnimate = _useState[1];
67
+ var playAnimation = function playAnimation() {
68
+ setAnimate(false) // 首先将 animate 设置为 false
69
+ ;
70
+ setTimeout(function() {
71
+ setAnimate(true) // 1 毫秒后再设置为 true,触发动画
72
+ ;
73
+ }, 10);
63
74
  };
64
- return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, visible ? /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, children) : /*#__PURE__*/ _react.default.createElement("div", (0, _object_spread._)({
75
+ (0, _react.useEffect)(function() {
76
+ if (!animated) return;
77
+ playAnimation();
78
+ // 每隔 3 秒播放一次动画
79
+ var intervalId = setInterval(playAnimation, 1000 + duration * 1000) // xs 动画 + 1s 间隔
80
+ ;
81
+ // 清理定时器
82
+ return function() {
83
+ return clearInterval(intervalId);
84
+ };
85
+ }, []);
86
+ return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, visible ? children : /*#__PURE__*/ _react.default.createElement("div", (0, _object_spread._)({
65
87
  className: classes
66
- }, rest), animated && /*#__PURE__*/ _react.default.createElement("div", {
67
- className: "".concat(classPrefix, "-animation")
68
- }), /*#__PURE__*/ _react.default.createElement("div", {
69
- className: "".concat(classPrefix, "-content")
70
- }, avatar && /*#__PURE__*/ _react.default.createElement(_avatar.default, {
71
- className: avatarClass,
72
- shape: avatarShape,
73
- style: getStyle(),
74
- icon: "null"
75
- }), rows === 1 ? /*#__PURE__*/ _react.default.createElement("div", {
76
- className: "".concat(classPrefix, "-content-block")
77
- }) : /*#__PURE__*/ _react.default.createElement("div", {
78
- className: "".concat(classPrefix, "-content-line")
79
- }, title && /*#__PURE__*/ _react.default.createElement("div", {
80
- className: "".concat(classPrefix, "-content-title")
81
- }), repeatLines(rows).map(function(item, index) {
88
+ }, rest), repeatCount(rows).map(function(item, index) {
89
+ var contentClass = "".concat(classPrefix, "-content ").concat(classPrefix, "-content-").concat(size, " ").concat(classPrefix, "-content-").concat(size, "-").concat(index);
82
90
  return /*#__PURE__*/ _react.default.createElement("div", {
83
- className: "".concat(classPrefix, "-content-block"),
84
- key: index
85
- });
86
- })))));
91
+ className: "".concat(contentClass),
92
+ key: index,
93
+ style: (0, _object_spread._)({
94
+ width: width,
95
+ height: height
96
+ }, shapeStyle())
97
+ }, animated && /*#__PURE__*/ _react.default.createElement("div", {
98
+ className: "".concat(classPrefix, "-animated ").concat(animate ? "".concat(classPrefix, "-animation") : ''),
99
+ style: durationStyle()
100
+ }));
101
+ })));
87
102
  };
88
103
  Skeleton.displayName = 'NutSkeleton';
@@ -1,2 +1 @@
1
- import '../../avatar/style';
2
1
  import './skeleton.scss';
@@ -1,44 +1,29 @@
1
1
  .nut-skeleton {
2
- display: inline-block;
3
- position: relative;
4
- overflow: hidden;
5
- vertical-align: middle;
6
- width: 100%;
2
+ line-height: 0px;
3
+ font-size: 0px;
7
4
 
8
5
  &-content {
9
- display: flex;
10
- flex-direction: row;
6
+ position: relative;
7
+ display: inline-flex;
8
+ width: $skeleton-line-width;
9
+ background: $skeleton-background;
10
+ border-radius: $skeleton-line-border-radius;
11
+ overflow: hidden;
11
12
 
12
- &-avatar {
13
- margin-right: 20px;
14
- background: $skeleton-background !important;
13
+ &-normal {
14
+ height: $skeleton-line-normal-height;
15
15
  }
16
16
 
17
- &-block {
18
- width: $skeleton-line-width;
19
- height: $skeleton-line-height;
20
- background: $skeleton-background;
21
- margin-top: 10px;
22
- border-radius: $skeleton-line-border-radius;
17
+ &-large {
18
+ height: $skeleton-line-large-height;
23
19
  }
24
20
 
25
- &-line {
26
- width: 100%;
27
- display: flex;
28
- flex-direction: column;
29
- .nut-skeleton-content-block:last-child {
30
- width: 70%;
31
- }
21
+ &-small {
22
+ height: $skeleton-line-small-height;
23
+ margin-top: 8px;
32
24
  }
33
-
34
- &-title {
35
- width: 30%;
36
- height: $skeleton-line-height;
37
- background: $skeleton-background;
38
- }
39
-
40
- &-block-last-child {
41
- width: 55%;
25
+ &-small-0 {
26
+ margin-top: 0;
42
27
  }
43
28
  }
44
29
 
@@ -49,41 +34,50 @@
49
34
  width: 100%;
50
35
  height: 100%;
51
36
  z-index: 1;
52
- animation: nut-skeleton 2s ease-in-out 0s infinite;
37
+ background: linear-gradient(
38
+ 90deg,
39
+ rgba(0, 0, 0, 0) 0%,
40
+ rgba(0, 0, 0, 0.02) 50%,
41
+ rgba(0, 0, 0, 0) 100%
42
+ );
43
+ animation-name: nut-skeleton;
44
+ animation-delay: 0s;
45
+ animation-duration: 0.6s;
46
+ animation-direction: normal;
47
+ animation-fill-mode: both;
48
+ animation-play-state: running;
49
+ animation-iteration-count: 1;
50
+ animation-timing-function: linear;
53
51
  }
54
52
 
55
53
  @keyframes nut-skeleton {
56
- 0% {
57
- background-position-x: -500px;
54
+ from {
55
+ transform: translateX(-100%);
58
56
  }
59
57
 
60
58
  to {
61
- background-position-x: calc(500px + 100%);
59
+ transform: translateX(100%);
62
60
  }
63
61
  }
64
62
  }
65
63
 
66
64
  [dir='rtl'] .nut-skeleton,
67
65
  .nut-rtl .nut-skeleton {
68
- &-content {
69
- .nut-avatar {
70
- margin-right: 0;
71
- margin-left: 20px;
72
- }
73
- }
74
66
  &-animation {
75
67
  left: auto;
76
68
  right: 0;
77
- animation: nut-skeleton-rtl 2s ease-in-out 0s infinite;
69
+ animation: nut-skeleton-rtl 2s linear 0s infinite;
78
70
  }
79
71
 
80
72
  @keyframes nut-skeleton-rtl {
81
- 0% {
82
- background-position-x: calc(500px + 100%);
73
+ from {
74
+ //background-position: -200% 0;
75
+ transform: translateX(100%);
83
76
  }
84
77
 
85
78
  to {
86
- background-position-x: -500px;
79
+ //background-position: 200% 0;
80
+ transform: translateX(-100%);
87
81
  }
88
82
  }
89
83
  }
@@ -2,176 +2,30 @@
2
2
  /* #endif */
3
3
  /* #ifndef harmony */
4
4
  /* #endif */
5
- .nut-image {
6
- display: block;
7
- position: relative;
8
- }
9
- .nut-image-default {
10
- display: block;
11
- width: 100%;
12
- height: 100%;
13
- }
14
- .nut-image.nut-image-round {
15
- border-radius: 50%;
16
- overflow: hidden;
17
- }
18
- .nut-image-loading {
19
- width: 100%;
20
- height: 100%;
21
- position: absolute;
22
- top: 0;
23
- left: 0;
24
- display: flex;
25
- flex-direction: column;
26
- align-items: center;
27
- justify-content: center;
28
- background: var(--nutui-color-background, #f2f3f5);
29
- background-size: 100% 100%;
30
- }
31
- .nut-image-error {
32
- width: 100%;
33
- height: 100%;
34
- position: absolute;
35
- top: 0;
36
- left: 0;
37
- display: flex;
38
- flex-direction: column;
39
- align-items: center;
40
- justify-content: center;
41
- background: var(--nutui-color-background, #f2f3f5);
42
- background-size: 100% 100%;
43
- }
44
-
45
- [dir=rtl] .nut-image .nut-img-loading,
46
- .nut-rtl .nut-image .nut-img-loading {
47
- left: auto;
48
- right: 0;
49
- }
50
- [dir=rtl] .nut-image .nut-img-error,
51
- .nut-rtl .nut-image .nut-img-error {
52
- left: auto;
53
- right: 0;
54
- }
55
-
56
- .nut-avatar-group {
57
- display: flex;
58
- flex-direction: row;
59
- flex: 0 0 auto;
60
- }
61
- .nut-avatar-group-avatar,
62
- .nut-avatar-group .nut-avatar {
63
- border: 1px solid #fff;
64
- margin-left: -8px;
65
- }
66
- .nut-avatar-group-avatar:not(:first-of-type),
67
- .nut-avatar-group .nut-avatar:not(:first-of-type) {
68
- margin-left: -8px;
69
- }
70
-
71
- [dir=rtl] .nut-avatar-group .nut-avatar:not(:first-of-type),
72
- .nut-rtl .nut-avatar-group .nut-avatar:not(:first-of-type) {
73
- margin-left: 0;
74
- margin-right: -8px;
75
- }
76
-
77
- .nut-avatar {
78
- position: relative;
79
- flex: 0 0 auto;
80
- display: flex;
81
- justify-content: center;
82
- align-items: center;
83
- width: var(--nutui-avatar-normal-width, 40px);
84
- height: var(--nutui-avatar-normal-height, 40px);
85
- }
86
- .nut-avatar-round {
87
- border-radius: 999px;
88
- overflow: hidden;
89
- }
90
- .nut-avatar-square {
91
- border-radius: var(--nutui-avatar-square, 5px);
92
- }
93
- .nut-avatar-first-child {
94
- margin-left: 0;
95
- margin-right: 0;
96
- }
97
- .nut-avatar-img {
98
- width: 100%;
99
- height: 100%;
100
- flex-shrink: 0;
101
- background-size: 100% 100%;
102
- background-repeat: no-repeat;
103
- background-position: center center;
104
- }
105
- .nut-avatar-icon {
106
- background-size: 100% 100%;
107
- }
108
- .nut-avatar-text {
109
- display: flex;
110
- justify-content: center;
111
- align-items: center;
112
- }
113
- .nut-avatar-large {
114
- width: var(--nutui-avatar-large-width, 60px);
115
- height: var(--nutui-avatar-large-height, 60px);
116
- }
117
- .nut-avatar-large-img {
118
- width: var(--nutui-avatar-large-width, 60px);
119
- height: var(--nutui-avatar-large-height, 60px);
120
- }
121
- .nut-avatar-large-icon {
122
- width: var(--nutui-avatar-large-width, 60px);
123
- height: var(--nutui-avatar-large-height, 60px);
124
- }
125
- .nut-avatar-large-text {
126
- width: var(--nutui-avatar-large-width, 60px);
127
- height: var(--nutui-avatar-large-height, 60px);
128
- }
129
- .nut-avatar-small {
130
- width: var(--nutui-avatar-small-width, 32px);
131
- height: var(--nutui-avatar-small-height, 32px);
132
- }
133
- .nut-avatar-small-text {
134
- width: var(--nutui-avatar-small-width, 32px);
135
- height: var(--nutui-avatar-small-height, 32px);
136
- }
137
-
138
5
  .nut-skeleton {
139
- display: inline-block;
140
- position: relative;
141
- overflow: hidden;
142
- vertical-align: middle;
143
- width: 100%;
6
+ line-height: 0px;
7
+ font-size: 0px;
144
8
  }
145
9
  .nut-skeleton-content {
146
- display: flex;
147
- flex-direction: row;
148
- }
149
- .nut-skeleton-content-avatar {
150
- margin-right: 20px;
151
- background: var(--nutui-skeleton-background, var(--nutui-color-background, #f2f3f5)) !important;
152
- }
153
- .nut-skeleton-content-block {
10
+ position: relative;
11
+ display: inline-flex;
154
12
  width: var(--nutui-skeleton-line-width, 100%);
155
- height: var(--nutui-skeleton-line-height, 15px);
156
- background: var(--nutui-skeleton-background, var(--nutui-color-background, #f2f3f5));
157
- margin-top: 10px;
158
- border-radius: var(--nutui-skeleton-line-border-radius, 0);
13
+ background: var(--nutui-skeleton-background, var(--nutui-color-background-sunken, #f7f8fc));
14
+ border-radius: var(--nutui-skeleton-line-border-radius, var(--nutui-radius-xs, 4px));
15
+ overflow: hidden;
159
16
  }
160
- .nut-skeleton-content-line {
161
- width: 100%;
162
- display: flex;
163
- flex-direction: column;
17
+ .nut-skeleton-content-normal {
18
+ height: var(--nutui-skeleton-line-normal-height, 24px);
164
19
  }
165
- .nut-skeleton-content-line .nut-skeleton-content-block:last-child {
166
- width: 70%;
20
+ .nut-skeleton-content-large {
21
+ height: var(--nutui-skeleton-line-large-height, 32px);
167
22
  }
168
- .nut-skeleton-content-title {
169
- width: 30%;
170
- height: var(--nutui-skeleton-line-height, 15px);
171
- background: var(--nutui-skeleton-background, var(--nutui-color-background, #f2f3f5));
23
+ .nut-skeleton-content-small {
24
+ height: var(--nutui-skeleton-line-small-height, 16px);
25
+ margin-top: 8px;
172
26
  }
173
- .nut-skeleton-content-block-last-child {
174
- width: 55%;
27
+ .nut-skeleton-content-small-0 {
28
+ margin-top: 0;
175
29
  }
176
30
  .nut-skeleton-animation {
177
31
  position: absolute;
@@ -180,33 +34,36 @@
180
34
  width: 100%;
181
35
  height: 100%;
182
36
  z-index: 1;
183
- animation: nut-skeleton 2s ease-in-out 0s infinite;
37
+ background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.02) 50%, rgba(0, 0, 0, 0) 100%);
38
+ animation-name: nut-skeleton;
39
+ animation-delay: 0s;
40
+ animation-duration: 0.6s;
41
+ animation-direction: normal;
42
+ animation-fill-mode: both;
43
+ animation-play-state: running;
44
+ animation-iteration-count: 1;
45
+ animation-timing-function: linear;
184
46
  }
185
47
  @keyframes nut-skeleton {
186
- 0% {
187
- background-position-x: -500px;
48
+ from {
49
+ transform: translateX(-100%);
188
50
  }
189
51
  to {
190
- background-position-x: calc(500px + 100%);
52
+ transform: translateX(100%);
191
53
  }
192
54
  }
193
55
 
194
- [dir=rtl] .nut-skeleton-content .nut-avatar,
195
- .nut-rtl .nut-skeleton-content .nut-avatar {
196
- margin-right: 0;
197
- margin-left: 20px;
198
- }
199
56
  [dir=rtl] .nut-skeleton-animation,
200
57
  .nut-rtl .nut-skeleton-animation {
201
58
  left: auto;
202
59
  right: 0;
203
- animation: nut-skeleton-rtl 2s ease-in-out 0s infinite;
60
+ animation: nut-skeleton-rtl 2s linear 0s infinite;
204
61
  }
205
62
  @keyframes nut-skeleton-rtl {
206
- 0% {
207
- background-position-x: calc(500px + 100%);
63
+ from {
64
+ transform: translateX(100%);
208
65
  }
209
66
  to {
210
- background-position-x: -500px;
67
+ transform: translateX(-100%);
211
68
  }
212
69
  }
@@ -45,6 +45,11 @@
45
45
  .nut-switch-button-close-rtl {
46
46
  left: calc(100% - var(--nutui-switch-height, 28px) + var(--nutui-switch-border-width, 2px));
47
47
  }
48
+ .nut-switch-button .nut-icon {
49
+ width: calc((var(--nutui-switch-height, 28px) - var(--nutui-switch-border-width, 2px) * 2) / 2);
50
+ height: calc((var(--nutui-switch-height, 28px) - var(--nutui-switch-border-width, 2px) * 2) / 2);
51
+ color: var(--nutui-switch-active-disabled-background-color, var(--nutui-color-primary-disabled-special, #ffadbe));
52
+ }
48
53
  .nut-switch-close {
49
54
  background-color: var(--nutui-switch-inactive-background-color, var(--nutui-color-text-disabled, #c2c4cc));
50
55
  }
@@ -40,6 +40,11 @@
40
40
  left: calc(100% - $switch-height + $switch-border-width);
41
41
  }
42
42
  }
43
+ .nut-icon {
44
+ width: calc(($switch-height - $switch-border-width * 2) / 2);
45
+ height: calc(($switch-height - $switch-border-width * 2) / 2);
46
+ color: $switch-active-disabled-background-color;
47
+ }
43
48
  }
44
49
 
45
50
  &-close {