@nutui/nutui-react 1.2.0 → 1.2.1

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 (58) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/AnimatingNumbers.js +9 -11
  3. package/dist/esm/BackTop.js +8 -6
  4. package/dist/esm/Checkbox.js +54 -8
  5. package/dist/esm/CheckboxGroup.js +26 -4
  6. package/dist/esm/Elevator.js +129 -36
  7. package/dist/esm/Icon.js +5 -3
  8. package/dist/esm/Input.js +252 -57
  9. package/dist/esm/NavBar/style/index.js +1 -1
  10. package/dist/esm/NavBar.js +89 -32
  11. package/dist/esm/Step.js +20 -3
  12. package/dist/esm/TabPane.js +3 -2
  13. package/dist/esm/Tabs.js +13 -3
  14. package/dist/esm/Video/style/index.js +2 -0
  15. package/dist/esm/Video.js +97 -0
  16. package/dist/esm/nutui-react.es.js +1 -0
  17. package/dist/locales/base.js +1 -1
  18. package/dist/locales/en-US.js +1 -1
  19. package/dist/locales/id-ID.js +1 -1
  20. package/dist/locales/zh-CN.js +1 -1
  21. package/dist/locales/zh-TW.js +1 -1
  22. package/dist/nutui.react.es.js +770 -321
  23. package/dist/nutui.react.umd.js +18 -18
  24. package/dist/packages/animatingnumbers/animatingnumbers.scss +0 -2
  25. package/dist/packages/animatingnumbers/countup.scss +10 -10
  26. package/dist/packages/backtop/backtop.scss +8 -0
  27. package/dist/packages/checkbox/checkbox.scss +21 -3
  28. package/dist/packages/col/col.scss +1 -1
  29. package/dist/packages/elevator/elevator.scss +71 -39
  30. package/dist/packages/input/input.scss +131 -3
  31. package/dist/packages/navbar/navbar.scss +114 -21
  32. package/dist/packages/price/price.scss +0 -1
  33. package/dist/packages/row/row.scss +14 -0
  34. package/dist/packages/tabpane/tabpane.scss +5 -0
  35. package/dist/packages/video/video.scss +18 -0
  36. package/dist/style.css +1 -1
  37. package/dist/style.es.js +1 -1
  38. package/dist/styles/themes/default.scss +1 -0
  39. package/dist/styles/variables.scss +94 -4
  40. package/dist/types/animatingnumbers/__tests__/animatingnumbers.spec.d.ts +1 -0
  41. package/dist/types/backtop/backtop.d.ts +4 -4
  42. package/dist/types/checkbox/checkbox.d.ts +4 -0
  43. package/dist/types/checkbox/demo.d.ts +1 -0
  44. package/dist/types/checkboxgroup/checkboxgroup.d.ts +1 -0
  45. package/dist/types/elevator/__tests__/elevator.spec.d.ts +1 -0
  46. package/dist/types/elevator/elevator.d.ts +6 -1
  47. package/dist/types/icon/icon.d.ts +1 -0
  48. package/dist/types/input/input.d.ts +42 -5
  49. package/dist/types/navbar/navbar.d.ts +9 -4
  50. package/dist/types/nutui.react.d.ts +2 -1
  51. package/dist/types/tabpane/tabpane.d.ts +1 -0
  52. package/dist/types/tabs/__test__/tabs.spec.d.ts +1 -0
  53. package/dist/types/tabs/tabs.d.ts +1 -0
  54. package/dist/types/video/__tests__/video.spec.d.ts +1 -0
  55. package/dist/types/video/demo.d.ts +4 -0
  56. package/dist/types/video/index.d.ts +2 -0
  57. package/dist/types/video/video.d.ts +21 -0
  58. package/package.json +2 -2
@@ -1,2 +0,0 @@
1
- .nut-animatingnumbers {
2
- }
@@ -1,13 +1,13 @@
1
1
  .nut-countup {
2
2
  &__list {
3
3
  display: inline-flex;
4
- height: 32px;
4
+ height: $countup-height;
5
5
  overflow: hidden;
6
6
  }
7
7
  &__listitem {
8
- height: 32px;
8
+ height: $countup-height;
9
9
  overflow: hidden;
10
- font-size: 18px;
10
+ font-size: $countup-base-size;
11
11
  color: #000;
12
12
  font-weight: bold;
13
13
  }
@@ -17,20 +17,20 @@
17
17
  flex-direction: column;
18
18
  align-items: center;
19
19
  span {
20
- height: 32px;
21
- line-height: 32px;
20
+ height: $countup-height;
21
+ line-height: $countup-height;
22
22
  }
23
23
  }
24
24
  }
25
25
  // 自定义样式
26
26
  .custom-coutup {
27
27
  .nut-countup__listitem--number {
28
- margin: 0 1px;
29
- border-radius: 4px;
30
- color: #fff;
31
- background-color: #031f63;
28
+ margin: 0 $countup-lr-margin;
29
+ border-radius: $countup-border-raduis;
30
+ color: $countup-color;
31
+ background-color: $countup-bgcolor;
32
32
  }
33
33
  .nut-countup__number {
34
- width: 24px;
34
+ width: $countup-width;
35
35
  }
36
36
  }
@@ -1,3 +1,11 @@
1
+ .nut-theme-dark {
2
+ .nut-backtop {
3
+ &.show {
4
+ background: $dark-background;
5
+ color: $dark-color;
6
+ }
7
+ }
8
+ }
1
9
  .nut-backtop {
2
10
  display: none;
3
11
  position: fixed;
@@ -4,16 +4,34 @@
4
4
  &--reverse {
5
5
  flex-direction: row-reverse;
6
6
  .nut-checkbox__label {
7
- margin-right: 15px;
7
+ margin-right: $checkbox-label-margin-left;
8
8
  margin-left: 0;
9
9
  }
10
10
  }
11
11
  &__label {
12
- margin-left: 15px;
13
- font-size: 16px;
12
+ margin-left: $checkbox-label-margin-left;
13
+ font-size: $checkbox-label-font-size;
14
14
  color: $checkbox-label-color;
15
15
  &--disabled {
16
16
  color: $checkbox-label-disable-color;
17
17
  }
18
18
  }
19
+ &__icon {
20
+ color: $primary-color;
21
+ font-size: $checkbox-icon-font-size;
22
+ transition-duration: 0.3s;
23
+ transition-property: color, border-color, background-color;
24
+ }
25
+ &__icon--unchecked {
26
+ color: $checkbox-icon-disable-color;
27
+ font-size: $checkbox-icon-font-size;
28
+ }
29
+ &__icon--indeterminate {
30
+ color: $primary-color;
31
+ font-size: $checkbox-icon-font-size;
32
+ }
33
+ &__icon--disable {
34
+ color: $help-color;
35
+ font-size: $checkbox-icon-font-size;
36
+ }
19
37
  }
@@ -2,7 +2,7 @@
2
2
  float: left;
3
3
  box-sizing: border-box;
4
4
  word-break: break-all;
5
-
5
+ margin-bottom: $col-default-margin-bottom;
6
6
  &-gutter {
7
7
  &:last-child {
8
8
  padding-right: 0 !important;
@@ -2,69 +2,101 @@
2
2
  width: 100%;
3
3
  display: block;
4
4
  position: relative;
5
+ overflow: hidden;
5
6
  &__list {
6
7
  display: block;
7
- overflow: auto;
8
+ position: relative;
9
+ top: 1px;
10
+ overflow: hidden;
11
+ &__inner {
12
+ height: 100%;
13
+ width: 100%;
14
+ display: block;
15
+ overflow: auto;
16
+ }
8
17
  &__item {
9
18
  display: block;
10
- font-size: 12px;
11
- color: #333;
19
+ font-size: $elevator-list-item-font-size;
20
+ color: $elevator-list-item-font-color;
12
21
  &__code {
13
- display: inline-flex;
22
+ display: flex;
14
23
  position: relative;
15
- height: 35px;
16
- line-height: 35px;
17
- font-size: 14px;
18
- color: #1a1a1a;
19
- padding: 0 20px;
20
- font-weight: 500;
24
+ height: $elevator-list-item-code-height;
25
+ line-height: $elevator-list-item-code-line-height;
26
+ font-size: $elevator-list-item-code-font-size;
27
+ color: $elevator-list-item-code-font-color;
28
+ padding: $elevator-list-item-code-padding;
29
+ font-weight: $elevator-list-item-code-font-weight;
30
+ box-sizing: border-box;
21
31
  &::after {
22
32
  content: ' ';
23
- width: 100%;
24
- height: 1px;
33
+ width: $elevator-list-item-code-after-width;
34
+ height: $elevator-list-item-code-after-height;
25
35
  position: absolute;
26
36
  left: 0;
27
- bottom: 7px;
28
- background-color: #eeeff2;
37
+ bottom: 0;
38
+ background-color: $elevator-list-item-code-after-bg-color;
29
39
  }
30
40
  }
31
41
  &__name {
32
42
  display: flex;
33
43
  align-items: center;
34
- padding: 0 20px;
35
- height: 30px;
36
- line-height: 30px;
44
+ padding: $elevator-list-item-name-padding;
45
+ height: $elevator-list-item-name-height;
46
+ line-height: $elevator-list-item-name-line-height;
47
+ &--highcolor {
48
+ color: $elevator-list-item-highcolor;
49
+ }
37
50
  }
38
51
  }
52
+ &__fixed {
53
+ width: 100%;
54
+ position: absolute;
55
+ top: 0;
56
+ left: 0;
57
+ z-index: 1;
58
+ padding: $elevator-list-item-code-padding;
59
+ height: $elevator-list-item-code-height;
60
+ line-height: $elevator-list-item-code-line-height;
61
+ font-size: $elevator-list-item-code-font-size;
62
+ color: $elevator-list-fixed-color;
63
+ font-weight: $elevator-list-item-code-font-weight;
64
+ background-color: $elevator-list-fixed-bg-color;
65
+ box-sizing: border-box;
66
+ box-shadow: $elevator-list-fixed-box-shadow;
67
+ }
39
68
  }
40
69
  &__code--current {
41
- position: absolute;
42
- right: 60px;
43
- top: 50%;
44
- transform: translateY(-50%);
45
- width: 45px;
46
- height: 45px;
47
- line-height: 45px;
48
- border-radius: 50%;
49
- background: $white;
50
- box-shadow: 0 3px 3px 1px rgba(240, 240, 240, 1);
51
- text-align: center;
70
+ position: $elevator-list-item-code-current-position;
71
+ right: $elevator-list-item-code-current-right;
72
+ top: $elevator-list-item-code-current-top;
73
+ transform: $elevator-list-item-code-current-transform;
74
+ width: $elevator-list-item-code-current-width;
75
+ height: $elevator-list-item-code-current-height;
76
+ line-height: $elevator-list-item-code-current-line-height;
77
+ border-radius: $elevator-list-item-code-current-border-radius;
78
+ background: $elevator-list-item-code-current-bg-color;
79
+ box-shadow: $elevator-list-item-code-current-box-shadow;
80
+ text-align: $elevator-list-item-code-current-text-align;
52
81
  }
53
82
  &__bars {
54
- position: absolute;
55
- right: 8px;
56
- top: 50%;
57
- transform: translateY(-50%);
58
- padding: 15px 0;
59
- background-color: #eeeff2;
60
- border-radius: 6px;
61
- text-align: center;
62
- z-index: 10;
83
+ position: $elevator-list-item-bars-position;
84
+ right: $elevator-list-item-bars-right;
85
+ top: $elevator-list-item-bars-top;
86
+ transform: $elevator-list-item-bars-transform;
87
+ padding: $elevator-list-item-bars-padding;
88
+ background-color: $elevator-list-item-bars-background-color;
89
+ border-radius: $elevator-list-item-bars-border-radius;
90
+ text-align: $elevator-list-item-bars-text-align;
91
+ z-index: $elevator-list-item-bars-z-index;
63
92
  &__inner {
64
93
  &__item {
65
94
  display: block;
66
- padding: 3px;
67
- font-size: 10px;
95
+ padding: $elevator-list-item-bars-inner-item-padding;
96
+ font-size: $elevator-list-item-bars-inner-item-font-size;
97
+ &--active {
98
+ color: $elevator-list-item-bars-inner-item-active-color;
99
+ }
68
100
  }
69
101
  }
70
102
  }
@@ -1,11 +1,35 @@
1
+ .nut-theme-dark {
2
+ .nut-input {
3
+ background: $dark-background;
4
+ &-label {
5
+ color: $dark-color;
6
+ }
7
+ .input-text,
8
+ &__text--readonly {
9
+ color: $dark-color;
10
+ }
11
+ }
12
+ }
13
+ input,
14
+ textarea {
15
+ font: inherit;
16
+ }
17
+
1
18
  .nut-input {
2
19
  position: relative;
3
20
  width: 100%;
4
- padding: 10px 0px 10px 25px;
21
+ padding: $input-padding;
5
22
  display: flex;
23
+ line-height: 24px;
6
24
  background: $white;
7
- border-bottom: 1px solid $input-border-bottom;
8
- font-size: 14px;
25
+ font-size: $input-font-size;
26
+ box-sizing: border-box;
27
+ &.center {
28
+ align-items: center;
29
+ }
30
+ &.nut-input-border {
31
+ border-bottom: 1px solid $input-border-bottom;
32
+ }
9
33
  input {
10
34
  width: 230px;
11
35
  flex: 1;
@@ -47,4 +71,108 @@
47
71
  display: inline-block;
48
72
  margin-right: 5px;
49
73
  }
74
+
75
+ .input-text,
76
+ &__text--readonly {
77
+ width: 90%;
78
+ padding: 0;
79
+ line-height: inherit;
80
+ text-align: left;
81
+ outline: 0 none;
82
+ border: 0;
83
+ text-decoration: none;
84
+ background: transparent;
85
+ resize: none;
86
+ }
87
+
88
+ &-label {
89
+ width: 80px;
90
+ overflow: hidden;
91
+ margin-right: 6px;
92
+ text-align: left;
93
+ }
94
+ &-value {
95
+ flex: 1;
96
+ vertical-align: middle;
97
+ }
98
+ &-inner {
99
+ position: relative;
100
+ display: flex;
101
+ align-items: center;
102
+ }
103
+ &-box {
104
+ position: relative;
105
+ width: 100%;
106
+ }
107
+ &-disabled-mask {
108
+ position: absolute;
109
+ width: 100%;
110
+ height: 100%;
111
+ top: 0;
112
+ left: 0;
113
+ z-index: 2;
114
+ }
115
+ &-error-message {
116
+ color: $input-required-color;
117
+ font-size: 12px;
118
+ }
119
+ &-word-limit {
120
+ display: flex;
121
+ justify-content: flex-end;
122
+ margin-top: 4px;
123
+ color: #808080;
124
+ font-size: 12px;
125
+ // line-height: var(--van-field-word-limit-line-height);
126
+ }
127
+ &-left-icon,
128
+ &-right-icon {
129
+ display: flex;
130
+ align-items: center;
131
+ font-size: 0;
132
+ }
133
+ &-clear,
134
+ &-right-icon {
135
+ margin-left: 4px;
136
+ }
137
+ &-left-icon {
138
+ margin-right: 4px;
139
+ }
140
+ &-clear-box {
141
+ height: 100%;
142
+ .nut-input-clear {
143
+ vertical-align: -2px;
144
+ }
145
+ }
146
+ &-clear {
147
+ width: 16px;
148
+ height: 16px;
149
+ color: #c8c9cc;
150
+ cursor: pointer;
151
+ }
152
+ .nut-button {
153
+ margin-left: 10px;
154
+ }
155
+ &.nut-input-required {
156
+ &::before {
157
+ position: absolute;
158
+ left: 14px;
159
+ color: $input-required-color;
160
+ content: '*';
161
+ }
162
+ }
163
+ &-disabled {
164
+ color: $input-disabled-color !important;
165
+ input:disabled {
166
+ background: none;
167
+ color: $input-disabled-color;
168
+ cursor: not-allowed;
169
+ opacity: 1;
170
+ -webkit-text-fill-color: $input-disabled-color;
171
+ }
172
+ }
173
+ &-error,
174
+ &-error::placeholder {
175
+ color: $input-required-color;
176
+ -webkit-text-fill-color: $input-required-color;
177
+ }
50
178
  }
@@ -1,39 +1,132 @@
1
-
2
1
  .nut-navbar {
3
2
  position: relative;
4
3
  display: flex;
5
- justify-content: space-around;
6
4
  align-items: center;
7
- height: 44px;
8
- padding: 13px 16px;
9
- background: #fff;
10
- box-shadow: 0 1px 7px 0 #edeef1;
11
- font-size: 14px;
12
- color: #666;
13
- margin-bottom: 20px;
14
- &__back {
15
- padding: 0 16px;
16
- &:before {
17
- content: '\e673';
5
+ height: $navbar-height;
6
+ box-sizing: border-box;
7
+ padding: $navbar-padding;
8
+ background: $navbar-background;
9
+ box-shadow: $navbar-box-shadow;
10
+ font-size: $navbar-title-base-font;
11
+ color: $navbar-color;
12
+ margin-bottom: $navbar-margin-bottom;
13
+ overflow: hidden;
14
+ &:active::before {
15
+ opacity: 0.1;
16
+ }
17
+ &--border {
18
+ border-bottom: 1px solid #eee;
19
+ }
20
+ &--fixed {
21
+ position: fixed;
22
+ top: 0;
23
+ left: 0;
24
+ width: 100%;
25
+ }
26
+ &--placeholder {
27
+ display: inline-block;
28
+ width: 100%;
29
+ }
30
+ &--safe-area-inset-top {
31
+ padding-top: constant(safe-area-inset-top);
32
+ padding-top: env(safe-area-inset-top);
33
+ }
34
+ &--clickable {
35
+ &::before {
18
36
  position: absolute;
37
+ content: ' ';
19
38
  top: 50%;
20
39
  left: 50%;
40
+ width: 100%;
41
+ height: 100%;
42
+ background-color: $black;
43
+ border: inherit;
44
+ border-color: $black;
45
+ border-radius: inherit;
21
46
  transform: translate(-50%, -50%);
47
+ opacity: 0;
22
48
  }
23
49
  }
24
- &__icon {
25
- display: flex;
26
- margin-left: 16px;
27
- .nut-icon:before {
28
- max-width: 100%;
50
+
51
+ .nutui-iconfont {
52
+ .nut-icon-left {
53
+ text-align: left;
29
54
  }
30
55
  }
56
+
31
57
  &__title {
32
- flex: 1;
58
+ min-width: 53%;
59
+ margin: 0 auto;
33
60
  text-align: center;
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+ .title {
65
+ min-width: $navbar-title-width;
66
+ font-size: $navbar-title-font;
67
+ font-weight: $navbar-title-font-weight;
68
+ color: $navbar-title-font-color;
69
+ display: -webkit-box;
70
+ -webkit-box-orient: vertical;
71
+ -webkit-line-clamp: 1;
72
+ overflow: hidden;
73
+ }
74
+ &.icon {
75
+ .icon {
76
+ margin: $navbar-title-icon-margin;
77
+ }
78
+ }
34
79
  .nut-icon {
35
- vertical-align: middle;
36
- margin-top: -2px;
80
+ display: inline;
81
+ }
82
+ &-desc {
83
+ font-size: $cell-title-desc-font;
84
+ }
85
+ .text__title {
86
+ display: inline-block;
87
+ }
88
+
89
+ .nut-tabs__titles {
90
+ background: $white;
91
+ }
92
+
93
+ .nut-tabpane {
94
+ display: none;
95
+ }
96
+ }
97
+
98
+ &__title ::-webkit-scrollbar {
99
+ display: none;
100
+ }
101
+
102
+ &__left {
103
+ font-size: $cell-desc-font;
104
+ color: $cell-desc-color;
105
+ position: absolute;
106
+ left: 0;
107
+ top: 0;
108
+ bottom: 0;
109
+ display: flex;
110
+ align-items: center;
111
+ cursor: pointer;
112
+ padding: 0 16px;
113
+ }
114
+ &__right {
115
+ font-size: $cell-desc-font;
116
+ color: $cell-desc-color;
117
+ position: absolute;
118
+ right: 0;
119
+ top: 0;
120
+ bottom: 0;
121
+ display: flex;
122
+ align-items: center;
123
+ padding: 0 16px;
124
+ cursor: pointer;
125
+ .rightIcon {
126
+ margin-left: 16px;
127
+ }
128
+ .leftIcon {
129
+ margin-left: 16px;
37
130
  }
38
131
  }
39
132
  }
@@ -5,7 +5,6 @@
5
5
  &__symbol {
6
6
  display: inline-block;
7
7
  font-size: $font-size-3;
8
- margin-right: 4px;
9
8
  }
10
9
  &__big {
11
10
  display: inline-block;
@@ -1,5 +1,19 @@
1
+ .flex-content {
2
+ line-height: $row-content-line-height;
3
+ color: $row-content-color;
4
+ text-align: center;
5
+ border-radius: $row-content-border-radius;
6
+ background: $row-content-background-color;
7
+ &.flex-content-light {
8
+ background: $row-content-light-background-color;
9
+ }
10
+ &.flex-content-height {
11
+ height: $row-content-height;
12
+ }
13
+ }
1
14
  .nut-row {
2
15
  width: 100%;
16
+ overflow: hidden;
3
17
  &:after {
4
18
  display: block;
5
19
  height: 0;
@@ -9,4 +9,9 @@
9
9
  &.active {
10
10
  // overflow: visible;
11
11
  }
12
+
13
+ &.inactive {
14
+ overflow: visible;
15
+ height: 0;
16
+ }
12
17
  }
@@ -0,0 +1,18 @@
1
+ .nut-video {
2
+ width: 100%;
3
+ height: 100%;
4
+ position: relative;
5
+ display: flex;
6
+ &-player {
7
+ width: 100%;
8
+ background: #000;
9
+ &:focus {
10
+ outline: none;
11
+ }
12
+ }
13
+ video {
14
+ width: 100%;
15
+ height: 100%;
16
+ object-fit: fill;
17
+ }
18
+ }