@nutui/nutui-react 3.1.0-beta.1 → 4.0.0-beta.2
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 +27 -0
- package/dist/cjs/locales/base.d.ts +6 -0
- package/dist/cjs/locales/en-US.js +17 -1
- package/dist/cjs/locales/id-ID.js +17 -1
- package/dist/cjs/locales/ja-JP.js +16 -2
- package/dist/cjs/locales/tr-TR.js +17 -1
- package/dist/cjs/locales/vi-VN.js +17 -1
- package/dist/cjs/locales/zh-CN.js +15 -1
- package/dist/cjs/locales/zh-TW.js +15 -1
- package/dist/cjs/locales/zh-UG.js +17 -1
- package/dist/cjs/packages/address/style/style.css +2 -2
- package/dist/cjs/packages/audio/audio.js +2 -2
- package/dist/cjs/packages/button/button.js +30 -6
- package/dist/cjs/packages/button/style/button.scss +327 -227
- package/dist/cjs/packages/button/style/style.css +292 -47
- package/dist/cjs/packages/button/style-jmapp/button.scss +327 -227
- package/dist/cjs/packages/button/style-jmapp/style.css +268 -23
- package/dist/cjs/packages/button/style-jrkf/button.scss +327 -227
- package/dist/cjs/packages/button/style-jrkf/style.css +268 -23
- package/dist/cjs/packages/calendar/style/style.css +2 -2
- package/dist/cjs/packages/calendarcard/style/style.css +1 -1
- package/dist/cjs/packages/checkbox/checkbox.js +4 -3
- package/dist/cjs/packages/checkbox/style/checkbox.scss +19 -3
- package/dist/cjs/packages/checkbox/style/style.css +21 -6
- package/dist/cjs/packages/checkbox/style-jmapp/checkbox.scss +19 -3
- package/dist/cjs/packages/checkbox/style-jmapp/style.css +18 -3
- package/dist/cjs/packages/checkbox/style-jrkf/checkbox.scss +19 -3
- package/dist/cjs/packages/checkbox/style-jrkf/style.css +18 -3
- package/dist/cjs/packages/checkboxgroup/style/style.css +2 -2
- package/dist/cjs/packages/circleprogress/circleprogress.js +1 -1
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/countdown/style/style.css +1 -1
- package/dist/cjs/packages/datepicker/datepicker.js +3 -5
- package/dist/cjs/packages/datepicker/utils.js +7 -0
- package/dist/cjs/packages/elevator/style/elevator.scss +6 -2
- package/dist/cjs/packages/elevator/style/style.css +2 -2
- package/dist/cjs/packages/elevator/style-jmapp/elevator.scss +6 -2
- package/dist/cjs/packages/elevator/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/elevator/style-jrkf/elevator.scss +6 -2
- package/dist/cjs/packages/elevator/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/ellipsis/style/style.css +1 -1
- package/dist/cjs/packages/inputnumber/inputnumber.js +5 -1
- package/dist/cjs/packages/inputnumber/style/inputnumber.scss +11 -5
- package/dist/cjs/packages/inputnumber/style/style.css +16 -11
- package/dist/cjs/packages/inputnumber/style-jmapp/inputnumber.scss +11 -5
- package/dist/cjs/packages/inputnumber/style-jmapp/style.css +10 -5
- package/dist/cjs/packages/inputnumber/style-jrkf/inputnumber.scss +11 -5
- package/dist/cjs/packages/inputnumber/style-jrkf/style.css +10 -5
- package/dist/cjs/packages/progress/progress.js +1 -1
- package/dist/cjs/packages/radio/radio.js +3 -2
- package/dist/cjs/packages/radio/style/radio.scss +9 -3
- package/dist/cjs/packages/radio/style/style.css +10 -5
- package/dist/cjs/packages/radio/style-jmapp/radio.scss +9 -3
- package/dist/cjs/packages/radio/style-jmapp/style.css +8 -3
- package/dist/cjs/packages/radio/style-jrkf/radio.scss +9 -3
- package/dist/cjs/packages/radio/style-jrkf/style.css +8 -3
- package/dist/cjs/packages/radiogroup/style/style.css +2 -2
- package/dist/cjs/packages/range/style/style.css +3 -3
- package/dist/cjs/packages/resultpage/resultpage.js +5 -5
- package/dist/cjs/packages/searchbar/style/searchbar.scss +5 -5
- package/dist/cjs/packages/searchbar/style/style.css +5 -5
- package/dist/cjs/packages/searchbar/style-jmapp/searchbar.scss +5 -5
- package/dist/cjs/packages/searchbar/style-jmapp/style.css +5 -5
- package/dist/cjs/packages/searchbar/style-jrkf/searchbar.scss +5 -5
- package/dist/cjs/packages/searchbar/style-jrkf/style.css +5 -5
- package/dist/cjs/packages/signature/signature.js +1 -1
- package/dist/cjs/packages/steps/style/style.css +2 -2
- package/dist/cjs/packages/swipe/swipe.js +20 -16
- package/dist/cjs/packages/switch/style/style.css +2 -2
- package/dist/cjs/packages/tabs/style/style.css +2 -2
- package/dist/cjs/packages/tag/style/style.css +2 -2
- package/dist/cjs/packages/timedetail/style/style.css +1 -1
- package/dist/cjs/packages/toast/Notification.js +1 -1
- package/dist/cjs/packages/toast/style/style.css +18 -15
- package/dist/cjs/packages/toast/style/toast.scss +23 -16
- package/dist/cjs/packages/toast/style-jmapp/style.css +17 -14
- package/dist/cjs/packages/toast/style-jmapp/toast.scss +23 -16
- package/dist/cjs/packages/toast/style-jrkf/style.css +17 -14
- package/dist/cjs/packages/toast/style-jrkf/toast.scss +23 -16
- package/dist/cjs/packages/toast/toast.js +1 -1
- package/dist/cjs/types/base/atoms.d.ts +3 -3
- package/dist/cjs/types/spec/button/base.d.ts +1 -0
- package/dist/cjs/utils/scale-f.d.ts +0 -17
- package/dist/cjs/utils/scale-f.js +14 -105
- package/dist/cjs/utils/taro/get-system-info.d.ts +0 -5
- package/dist/cjs/utils/taro/get-system-info.js +2 -7
- package/dist/es/hooks/taro/use-custom-event.js +1 -0
- package/dist/es/locales/base.d.ts +6 -0
- package/dist/es/locales/en-US.js +17 -1
- package/dist/es/locales/id-ID.js +17 -1
- package/dist/es/locales/ja-JP.js +16 -2
- package/dist/es/locales/tr-TR.js +17 -1
- package/dist/es/locales/vi-VN.js +17 -1
- package/dist/es/locales/zh-CN.js +15 -1
- package/dist/es/locales/zh-TW.js +15 -1
- package/dist/es/locales/zh-UG.js +17 -1
- package/dist/es/packages/address/style/style.css +2 -2
- package/dist/es/packages/audio/audio.js +2 -2
- package/dist/es/packages/button/button.js +30 -6
- package/dist/es/packages/button/style/button.scss +327 -227
- package/dist/es/packages/button/style/style.css +292 -47
- package/dist/es/packages/button/style-jmapp/button.scss +327 -227
- package/dist/es/packages/button/style-jmapp/style.css +268 -23
- package/dist/es/packages/button/style-jrkf/button.scss +327 -227
- package/dist/es/packages/button/style-jrkf/style.css +268 -23
- package/dist/es/packages/calendar/style/style.css +2 -2
- package/dist/es/packages/calendarcard/style/style.css +1 -1
- package/dist/es/packages/checkbox/checkbox.js +4 -3
- package/dist/es/packages/checkbox/style/checkbox.scss +19 -3
- package/dist/es/packages/checkbox/style/style.css +21 -6
- package/dist/es/packages/checkbox/style-jmapp/checkbox.scss +19 -3
- package/dist/es/packages/checkbox/style-jmapp/style.css +18 -3
- package/dist/es/packages/checkbox/style-jrkf/checkbox.scss +19 -3
- package/dist/es/packages/checkbox/style-jrkf/style.css +18 -3
- package/dist/es/packages/checkboxgroup/style/style.css +2 -2
- package/dist/es/packages/circleprogress/circleprogress.js +1 -1
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/countdown/style/style.css +1 -1
- package/dist/es/packages/datepicker/datepicker.js +3 -5
- package/dist/es/packages/datepicker/utils.js +7 -0
- package/dist/es/packages/elevator/style/elevator.scss +6 -2
- package/dist/es/packages/elevator/style/style.css +2 -2
- package/dist/es/packages/elevator/style-jmapp/elevator.scss +6 -2
- package/dist/es/packages/elevator/style-jmapp/style.css +2 -2
- package/dist/es/packages/elevator/style-jrkf/elevator.scss +6 -2
- package/dist/es/packages/elevator/style-jrkf/style.css +2 -2
- package/dist/es/packages/ellipsis/style/style.css +1 -1
- package/dist/es/packages/inputnumber/inputnumber.js +5 -1
- package/dist/es/packages/inputnumber/style/inputnumber.scss +11 -5
- package/dist/es/packages/inputnumber/style/style.css +16 -11
- package/dist/es/packages/inputnumber/style-jmapp/inputnumber.scss +11 -5
- package/dist/es/packages/inputnumber/style-jmapp/style.css +10 -5
- package/dist/es/packages/inputnumber/style-jrkf/inputnumber.scss +11 -5
- package/dist/es/packages/inputnumber/style-jrkf/style.css +10 -5
- package/dist/es/packages/progress/progress.js +1 -1
- package/dist/es/packages/radio/radio.js +3 -2
- package/dist/es/packages/radio/style/radio.scss +9 -3
- package/dist/es/packages/radio/style/style.css +10 -5
- package/dist/es/packages/radio/style-jmapp/radio.scss +9 -3
- package/dist/es/packages/radio/style-jmapp/style.css +8 -3
- package/dist/es/packages/radio/style-jrkf/radio.scss +9 -3
- package/dist/es/packages/radio/style-jrkf/style.css +8 -3
- package/dist/es/packages/radiogroup/style/style.css +2 -2
- package/dist/es/packages/range/style/style.css +3 -3
- package/dist/es/packages/resultpage/resultpage.js +5 -5
- package/dist/es/packages/searchbar/style/searchbar.scss +5 -5
- package/dist/es/packages/searchbar/style/style.css +5 -5
- package/dist/es/packages/searchbar/style-jmapp/searchbar.scss +5 -5
- package/dist/es/packages/searchbar/style-jmapp/style.css +5 -5
- package/dist/es/packages/searchbar/style-jrkf/searchbar.scss +5 -5
- package/dist/es/packages/searchbar/style-jrkf/style.css +5 -5
- package/dist/es/packages/signature/signature.js +1 -1
- package/dist/es/packages/steps/style/style.css +2 -2
- package/dist/es/packages/swipe/swipe.js +20 -16
- package/dist/es/packages/switch/style/style.css +2 -2
- package/dist/es/packages/tabs/style/style.css +2 -2
- package/dist/es/packages/tag/style/style.css +2 -2
- package/dist/es/packages/timedetail/style/style.css +1 -1
- package/dist/es/packages/toast/Notification.js +1 -1
- package/dist/es/packages/toast/style/style.css +18 -15
- package/dist/es/packages/toast/style/toast.scss +23 -16
- package/dist/es/packages/toast/style-jmapp/style.css +17 -14
- package/dist/es/packages/toast/style-jmapp/toast.scss +23 -16
- package/dist/es/packages/toast/style-jrkf/style.css +17 -14
- package/dist/es/packages/toast/style-jrkf/toast.scss +23 -16
- package/dist/es/packages/toast/toast.js +1 -1
- package/dist/es/types/base/atoms.d.ts +3 -3
- package/dist/es/types/spec/button/base.d.ts +1 -0
- package/dist/es/utils/scale-f.d.ts +0 -17
- package/dist/es/utils/scale-f.js +15 -106
- package/dist/es/utils/taro/get-system-info.d.ts +0 -5
- package/dist/es/utils/taro/get-system-info.js +8 -7
- package/dist/nutui.react.umd.js +109 -145
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +30 -30
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +38 -38
- package/dist/style.css +1 -1
- package/dist/style.scss +31 -31
- package/dist/styles/theme-daojia.scss +55 -48
- package/dist/styles/theme-dark-daojia.scss +55 -47
- package/dist/styles/theme-dark.scss +108 -109
- package/dist/styles/theme-default.scss +110 -111
- package/dist/styles/theme-jmapp.scss +1 -1
- package/dist/styles/theme-jrkf.scss +1 -1
- package/dist/styles/themes/daojia.css +1 -1
- package/dist/styles/themes/dark-daojia.css +1 -1
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/themes/jrkf.css +1 -1
- package/dist/styles/variables-daojia.scss +1055 -1976
- package/dist/styles/variables-jmapp.scss +96 -5
- package/dist/styles/variables-jrkf.scss +96 -5
- package/dist/styles/variables.scss +141 -37
- package/package.json +1 -1
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
justify-content: center;
|
|
44
44
|
align-items: center;
|
|
45
|
-
min-width: scale-px(
|
|
46
|
-
max-width:
|
|
45
|
+
min-width: var(--nutui-toast-inner-min-width, scale-px(88px));
|
|
46
|
+
max-width: var(--nutui-toast-inner-max-width, scale-px(200px));
|
|
47
47
|
box-sizing: border-box;
|
|
48
48
|
font-size: var(--nutui-toast-text-font-size, 14px);
|
|
49
49
|
text-align: var(--nutui-toast-inner-text-align, center);
|
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
border-radius: var(--nutui-toast-inner-border-radius, var(--nutui-radius-xs));
|
|
54
54
|
color: var(--nutui-toast-font-color, #ffffff);
|
|
55
55
|
}
|
|
56
|
-
.nut-toast-
|
|
57
|
-
|
|
56
|
+
.nut-toast-has-icon .nut-toast-inner {
|
|
57
|
+
min-width: var(--nutui-toast-inner-has-icon-min-width, scale-px(97px));
|
|
58
|
+
max-width: var(--nutui-toast-inner-has-icon-max-width, scale-px(225px));
|
|
58
59
|
}
|
|
59
60
|
.nut-toast-inner-normal {
|
|
60
61
|
word-break: normal;
|
|
@@ -80,8 +81,9 @@
|
|
|
80
81
|
top: var(--nutui-toast-inner-top, 20%);
|
|
81
82
|
}
|
|
82
83
|
.nut-toast-text {
|
|
83
|
-
color: #ffffff;
|
|
84
|
+
color: var(--nutui-toast-font-color, var(--nutui-white, #ffffff));
|
|
84
85
|
text-align: var(--nutui-toast-inner-text-align, center);
|
|
86
|
+
font-weight: var(--nutui-toast-text-font-weight, 400);
|
|
85
87
|
/* #ifdef harmony dynamic*/
|
|
86
88
|
line-height: normal;
|
|
87
89
|
/* #endif */
|
|
@@ -91,9 +93,9 @@
|
|
|
91
93
|
height: auto;
|
|
92
94
|
}
|
|
93
95
|
.nut-toast-title {
|
|
94
|
-
color: #ffffff;
|
|
96
|
+
color: var(--nutui-toast-font-color, var(--nutui-white, #ffffff));
|
|
95
97
|
font-size: var(--nutui-toast-title-font-size, 16px);
|
|
96
|
-
font-weight: 600;
|
|
98
|
+
font-weight: var(--nutui-toast-title-font-weight, 600);
|
|
97
99
|
text-align: var(--nutui-toast-inner-text-align, center);
|
|
98
100
|
/* #ifdef harmony dynamic*/
|
|
99
101
|
line-height: normal;
|
|
@@ -103,21 +105,22 @@
|
|
|
103
105
|
/* #endif */
|
|
104
106
|
}
|
|
105
107
|
.nut-toast .nut-icon {
|
|
106
|
-
width: scale-px(
|
|
107
|
-
height: scale-px(
|
|
108
|
-
color: #ffffff;
|
|
108
|
+
width: scale-px(20px);
|
|
109
|
+
height: scale-px(20px);
|
|
110
|
+
color: var(--nutui-toast-icon-color, var(--nutui-toast-font-color, var(--nutui-white, #ffffff)));
|
|
109
111
|
}
|
|
110
112
|
.nut-toast-icon-wrapper {
|
|
111
113
|
width: 100%;
|
|
112
114
|
display: flex;
|
|
113
115
|
align-items: center;
|
|
114
116
|
justify-content: center;
|
|
115
|
-
margin:
|
|
116
|
-
|
|
117
|
+
margin: 0;
|
|
118
|
+
padding: scale-px(10px) 0;
|
|
119
|
+
color: var(--nutui-toast-icon-color, var(--nutui-toast-font-color, var(--nutui-white, #ffffff)));
|
|
117
120
|
}
|
|
118
121
|
.nut-toast-icon-wrapper-icon {
|
|
119
|
-
width: scale-px(
|
|
120
|
-
height: scale-px(
|
|
122
|
+
width: scale-px(20px);
|
|
123
|
+
height: scale-px(20px);
|
|
121
124
|
}
|
|
122
125
|
.nut-toast-rtl {
|
|
123
126
|
left: auto;
|
|
@@ -42,9 +42,8 @@
|
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
justify-content: center;
|
|
44
44
|
align-items: center;
|
|
45
|
-
min-width: scale-px(
|
|
46
|
-
max-width:
|
|
47
|
-
// max-width: 224px;
|
|
45
|
+
min-width: var(--nutui-toast-inner-min-width, scale-px(88px));
|
|
46
|
+
max-width: var(--nutui-toast-inner-max-width, scale-px(200px));
|
|
48
47
|
box-sizing: border-box;
|
|
49
48
|
font-size: $toast-text-font-size;
|
|
50
49
|
text-align: $toast-inner-text-align;
|
|
@@ -54,9 +53,9 @@
|
|
|
54
53
|
border-radius: $toast-inner-border-radius;
|
|
55
54
|
color: $toast-font-color;
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
.nut-toast-has-icon & {
|
|
57
|
+
min-width: var(--nutui-toast-inner-has-icon-min-width, scale-px(97px));
|
|
58
|
+
max-width: var(--nutui-toast-inner-has-icon-max-width, scale-px(225px));
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
&-normal {
|
|
@@ -91,8 +90,9 @@
|
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
&-text {
|
|
94
|
-
color: #ffffff;
|
|
93
|
+
color: var(--nutui-toast-font-color, var(--nutui-white, #ffffff));
|
|
95
94
|
text-align: $toast-inner-text-align;
|
|
95
|
+
font-weight: var(--nutui-toast-text-font-weight, 400);
|
|
96
96
|
/* #ifdef harmony dynamic*/
|
|
97
97
|
line-height: normal;
|
|
98
98
|
/* #endif */
|
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
&-title {
|
|
106
|
-
color: #ffffff;
|
|
106
|
+
color: var(--nutui-toast-font-color, var(--nutui-white, #ffffff));
|
|
107
107
|
font-size: $toast-title-font-size;
|
|
108
|
-
font-weight: 600;
|
|
108
|
+
font-weight: var(--nutui-toast-title-font-weight, 600);
|
|
109
109
|
text-align: $toast-inner-text-align;
|
|
110
110
|
/* #ifdef harmony dynamic*/
|
|
111
111
|
line-height: normal;
|
|
@@ -116,9 +116,12 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.nut-icon {
|
|
119
|
-
width: scale-px(
|
|
120
|
-
height: scale-px(
|
|
121
|
-
color:
|
|
119
|
+
width: scale-px(20px);
|
|
120
|
+
height: scale-px(20px);
|
|
121
|
+
color: var(
|
|
122
|
+
--nutui-toast-icon-color,
|
|
123
|
+
var(--nutui-toast-font-color, var(--nutui-white, #ffffff))
|
|
124
|
+
);
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
&-icon-wrapper {
|
|
@@ -126,12 +129,16 @@
|
|
|
126
129
|
display: flex;
|
|
127
130
|
align-items: center;
|
|
128
131
|
justify-content: center;
|
|
129
|
-
margin:
|
|
130
|
-
|
|
132
|
+
margin: 0;
|
|
133
|
+
padding: scale-px(10px) 0;
|
|
134
|
+
color: var(
|
|
135
|
+
--nutui-toast-icon-color,
|
|
136
|
+
var(--nutui-toast-font-color, var(--nutui-white, #ffffff))
|
|
137
|
+
);
|
|
131
138
|
|
|
132
139
|
&-icon {
|
|
133
|
-
width: scale-px(
|
|
134
|
-
height: scale-px(
|
|
140
|
+
width: scale-px(20px);
|
|
141
|
+
height: scale-px(20px);
|
|
135
142
|
}
|
|
136
143
|
}
|
|
137
144
|
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
justify-content: center;
|
|
44
44
|
align-items: center;
|
|
45
|
-
min-width: scale-px(
|
|
46
|
-
max-width:
|
|
45
|
+
min-width: var(--nutui-toast-inner-min-width, scale-px(88px));
|
|
46
|
+
max-width: var(--nutui-toast-inner-max-width, scale-px(200px));
|
|
47
47
|
box-sizing: border-box;
|
|
48
48
|
font-size: var(--nutui-toast-text-font-size, 14px);
|
|
49
49
|
text-align: var(--nutui-toast-inner-text-align, center);
|
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
border-radius: var(--nutui-toast-inner-border-radius, var(--nutui-radius-xs));
|
|
54
54
|
color: var(--nutui-toast-font-color, #ffffff);
|
|
55
55
|
}
|
|
56
|
-
.nut-toast-
|
|
57
|
-
|
|
56
|
+
.nut-toast-has-icon .nut-toast-inner {
|
|
57
|
+
min-width: var(--nutui-toast-inner-has-icon-min-width, scale-px(97px));
|
|
58
|
+
max-width: var(--nutui-toast-inner-has-icon-max-width, scale-px(225px));
|
|
58
59
|
}
|
|
59
60
|
.nut-toast-inner-normal {
|
|
60
61
|
word-break: normal;
|
|
@@ -80,8 +81,9 @@
|
|
|
80
81
|
top: var(--nutui-toast-inner-top, 20%);
|
|
81
82
|
}
|
|
82
83
|
.nut-toast-text {
|
|
83
|
-
color: #ffffff;
|
|
84
|
+
color: var(--nutui-toast-font-color, var(--nutui-white, #ffffff));
|
|
84
85
|
text-align: var(--nutui-toast-inner-text-align, center);
|
|
86
|
+
font-weight: var(--nutui-toast-text-font-weight, 400);
|
|
85
87
|
/* #ifdef harmony dynamic*/
|
|
86
88
|
line-height: normal;
|
|
87
89
|
/* #endif */
|
|
@@ -91,9 +93,9 @@
|
|
|
91
93
|
height: auto;
|
|
92
94
|
}
|
|
93
95
|
.nut-toast-title {
|
|
94
|
-
color: #ffffff;
|
|
96
|
+
color: var(--nutui-toast-font-color, var(--nutui-white, #ffffff));
|
|
95
97
|
font-size: var(--nutui-toast-title-font-size, 16px);
|
|
96
|
-
font-weight: 600;
|
|
98
|
+
font-weight: var(--nutui-toast-title-font-weight, 600);
|
|
97
99
|
text-align: var(--nutui-toast-inner-text-align, center);
|
|
98
100
|
/* #ifdef harmony dynamic*/
|
|
99
101
|
line-height: normal;
|
|
@@ -103,21 +105,22 @@
|
|
|
103
105
|
/* #endif */
|
|
104
106
|
}
|
|
105
107
|
.nut-toast .nut-icon {
|
|
106
|
-
width: scale-px(
|
|
107
|
-
height: scale-px(
|
|
108
|
-
color: #ffffff;
|
|
108
|
+
width: scale-px(20px);
|
|
109
|
+
height: scale-px(20px);
|
|
110
|
+
color: var(--nutui-toast-icon-color, var(--nutui-toast-font-color, var(--nutui-white, #ffffff)));
|
|
109
111
|
}
|
|
110
112
|
.nut-toast-icon-wrapper {
|
|
111
113
|
width: 100%;
|
|
112
114
|
display: flex;
|
|
113
115
|
align-items: center;
|
|
114
116
|
justify-content: center;
|
|
115
|
-
margin:
|
|
116
|
-
|
|
117
|
+
margin: 0;
|
|
118
|
+
padding: scale-px(10px) 0;
|
|
119
|
+
color: var(--nutui-toast-icon-color, var(--nutui-toast-font-color, var(--nutui-white, #ffffff)));
|
|
117
120
|
}
|
|
118
121
|
.nut-toast-icon-wrapper-icon {
|
|
119
|
-
width: scale-px(
|
|
120
|
-
height: scale-px(
|
|
122
|
+
width: scale-px(20px);
|
|
123
|
+
height: scale-px(20px);
|
|
121
124
|
}
|
|
122
125
|
.nut-toast-rtl {
|
|
123
126
|
left: auto;
|
|
@@ -42,9 +42,8 @@
|
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
justify-content: center;
|
|
44
44
|
align-items: center;
|
|
45
|
-
min-width: scale-px(
|
|
46
|
-
max-width:
|
|
47
|
-
// max-width: 224px;
|
|
45
|
+
min-width: var(--nutui-toast-inner-min-width, scale-px(88px));
|
|
46
|
+
max-width: var(--nutui-toast-inner-max-width, scale-px(200px));
|
|
48
47
|
box-sizing: border-box;
|
|
49
48
|
font-size: $toast-text-font-size;
|
|
50
49
|
text-align: $toast-inner-text-align;
|
|
@@ -54,9 +53,9 @@
|
|
|
54
53
|
border-radius: $toast-inner-border-radius;
|
|
55
54
|
color: $toast-font-color;
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
.nut-toast-has-icon & {
|
|
57
|
+
min-width: var(--nutui-toast-inner-has-icon-min-width, scale-px(97px));
|
|
58
|
+
max-width: var(--nutui-toast-inner-has-icon-max-width, scale-px(225px));
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
&-normal {
|
|
@@ -91,8 +90,9 @@
|
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
&-text {
|
|
94
|
-
color: #ffffff;
|
|
93
|
+
color: var(--nutui-toast-font-color, var(--nutui-white, #ffffff));
|
|
95
94
|
text-align: $toast-inner-text-align;
|
|
95
|
+
font-weight: var(--nutui-toast-text-font-weight, 400);
|
|
96
96
|
/* #ifdef harmony dynamic*/
|
|
97
97
|
line-height: normal;
|
|
98
98
|
/* #endif */
|
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
&-title {
|
|
106
|
-
color: #ffffff;
|
|
106
|
+
color: var(--nutui-toast-font-color, var(--nutui-white, #ffffff));
|
|
107
107
|
font-size: $toast-title-font-size;
|
|
108
|
-
font-weight: 600;
|
|
108
|
+
font-weight: var(--nutui-toast-title-font-weight, 600);
|
|
109
109
|
text-align: $toast-inner-text-align;
|
|
110
110
|
/* #ifdef harmony dynamic*/
|
|
111
111
|
line-height: normal;
|
|
@@ -116,9 +116,12 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.nut-icon {
|
|
119
|
-
width: scale-px(
|
|
120
|
-
height: scale-px(
|
|
121
|
-
color:
|
|
119
|
+
width: scale-px(20px);
|
|
120
|
+
height: scale-px(20px);
|
|
121
|
+
color: var(
|
|
122
|
+
--nutui-toast-icon-color,
|
|
123
|
+
var(--nutui-toast-font-color, var(--nutui-white, #ffffff))
|
|
124
|
+
);
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
&-icon-wrapper {
|
|
@@ -126,12 +129,16 @@
|
|
|
126
129
|
display: flex;
|
|
127
130
|
align-items: center;
|
|
128
131
|
justify-content: center;
|
|
129
|
-
margin:
|
|
130
|
-
|
|
132
|
+
margin: 0;
|
|
133
|
+
padding: scale-px(10px) 0;
|
|
134
|
+
color: var(
|
|
135
|
+
--nutui-toast-icon-color,
|
|
136
|
+
var(--nutui-toast-font-color, var(--nutui-white, #ffffff))
|
|
137
|
+
);
|
|
131
138
|
|
|
132
139
|
&-icon {
|
|
133
|
-
width: scale-px(
|
|
134
|
-
height: scale-px(
|
|
140
|
+
width: scale-px(20px);
|
|
141
|
+
height: scale-px(20px);
|
|
135
142
|
}
|
|
136
143
|
}
|
|
137
144
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type SimpleValue = string | number;
|
|
2
2
|
export type SimpleValues = string[] | number[];
|
|
3
|
-
export type UIType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
4
|
-
export type UISize = 'xlarge' | 'large' | 'normal' | 'small' | 'mini';
|
|
3
|
+
export type UIType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger' | 'service';
|
|
4
|
+
export type UISize = 'xlarge' | 'large' | 'normal' | 'small' | 'mini' | '48' | '44' | '40' | '36' | '32' | '28' | '24';
|
|
5
5
|
export type UIRound = 'square' | 'round';
|
|
6
|
-
export type UIFill = 'solid' | 'outline' | 'dashed' | 'none';
|
|
6
|
+
export type UIFill = 'solid' | 'outline' | 'dashed' | 'none' | 'light';
|
|
7
7
|
export type UILayout = 'row' | 'col';
|
|
8
8
|
export type UITheme = 'light' | 'dark';
|
|
9
9
|
export type FlexAlign = 'flex-start' | 'center' | 'flex-end' | 'baseline';
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/** 原生 DongScreenAdapterPlugin.getScale 的典型返回结构 */
|
|
2
|
-
type NativeScaleResponse = {
|
|
3
|
-
status?: string;
|
|
4
|
-
data?: {
|
|
5
|
-
scale?: number | string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
/** jmfe 通用 callNative 签名 */
|
|
9
|
-
type NativeCaller = (plugin: string, method: string, params: string, extra: string) => Promise<NativeScaleResponse>;
|
|
10
|
-
/** 站内容器的 jmfe 桥接方法(可选) */
|
|
11
|
-
declare global {
|
|
12
|
-
interface Window {
|
|
13
|
-
jmfe?: {
|
|
14
|
-
callNative?: NativeCaller;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
1
|
/** 字体档位:标准、大字、老年 */
|
|
19
2
|
export type ScaleProfile = 'standard' | 'large' | 'elderly';
|
|
20
3
|
/** 不同场景可选用不同放大比例(layout 等默认可不额外放大) */
|
package/dist/es/utils/scale-f.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 响应式缩放系数(--nut-scale-f
|
|
2
|
+
* 响应式缩放系数(--nut-scale-f):按视口宽度计算,
|
|
3
3
|
* 写入根节点 CSS 变量(--nut-scale-f / --nut-scale-font / --nut-scale-icon),
|
|
4
4
|
* 供布局/字号/icon 等按比例换算(见 calcByProfile)。H5 与 Taro WebView 共用此实现。
|
|
5
|
-
*/ import {
|
|
6
|
-
|
|
7
|
-
import { canUseDom } from "./can-use-dom";
|
|
8
|
-
/** 当前基准缩放(来自原生或视口计算) */ var scale = 1;
|
|
5
|
+
*/ import { canUseDom } from "./can-use-dom";
|
|
6
|
+
/** 当前基准缩放(来自视口计算) */ var scale = 1;
|
|
9
7
|
/** 大字模式下仅 font 场景的相对倍率 */ var LARGE_FONT_RATIO = 1.15;
|
|
10
8
|
/** 老年模式下 font/icon/lego 场景的相对倍率 */ var ELDERLY_RATIO = 1.3;
|
|
11
9
|
/** 全局当前档位,与 scale 共同参与 calcByProfile */ var profile = 'standard';
|
|
@@ -49,7 +47,7 @@ import { canUseDom } from "./can-use-dom";
|
|
|
49
47
|
}
|
|
50
48
|
return Math.round(value);
|
|
51
49
|
}
|
|
52
|
-
/**
|
|
50
|
+
/** 按屏宽推算 scale(含平板与 375 基准窄屏区间) */ function getScaleByViewport() {
|
|
53
51
|
if (!canUseDom) return 1;
|
|
54
52
|
var deviceWidth = window.innerWidth;
|
|
55
53
|
if (!deviceWidth) return 1;
|
|
@@ -62,81 +60,8 @@ import { canUseDom } from "./can-use-dom";
|
|
|
62
60
|
}
|
|
63
61
|
return 1;
|
|
64
62
|
}
|
|
65
|
-
/**
|
|
66
|
-
return
|
|
67
|
-
var _window_jmfe, _res_data, res, parsed, e;
|
|
68
|
-
return _ts_generator(this, function(_state) {
|
|
69
|
-
switch(_state.label){
|
|
70
|
-
case 0:
|
|
71
|
-
if (!canUseDom || !((_window_jmfe = window.jmfe) === null || _window_jmfe === void 0 ? void 0 : _window_jmfe.callNative)) return [
|
|
72
|
-
2,
|
|
73
|
-
null
|
|
74
|
-
];
|
|
75
|
-
_state.label = 1;
|
|
76
|
-
case 1:
|
|
77
|
-
_state.trys.push([
|
|
78
|
-
1,
|
|
79
|
-
3,
|
|
80
|
-
,
|
|
81
|
-
4
|
|
82
|
-
]);
|
|
83
|
-
return [
|
|
84
|
-
4,
|
|
85
|
-
window.jmfe.callNative('DongScreenAdapterPlugin', 'getScale', JSON.stringify({}), '')
|
|
86
|
-
];
|
|
87
|
-
case 2:
|
|
88
|
-
res = _state.sent();
|
|
89
|
-
if ((res === null || res === void 0 ? void 0 : res.status) === '0' && ((_res_data = res.data) === null || _res_data === void 0 ? void 0 : _res_data.scale) !== undefined) {
|
|
90
|
-
parsed = Number(res.data.scale);
|
|
91
|
-
if (Number.isFinite(parsed) && parsed > 0) {
|
|
92
|
-
return [
|
|
93
|
-
2,
|
|
94
|
-
parsed
|
|
95
|
-
];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return [
|
|
99
|
-
3,
|
|
100
|
-
4
|
|
101
|
-
];
|
|
102
|
-
case 3:
|
|
103
|
-
e = _state.sent();
|
|
104
|
-
return [
|
|
105
|
-
3,
|
|
106
|
-
4
|
|
107
|
-
];
|
|
108
|
-
case 4:
|
|
109
|
-
return [
|
|
110
|
-
2,
|
|
111
|
-
null
|
|
112
|
-
];
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
})();
|
|
116
|
-
}
|
|
117
|
-
/** 统一获取缩放:站内原生优先,失败则用视口规则 */ function getScaleF() {
|
|
118
|
-
return _async_to_generator(function() {
|
|
119
|
-
var nativeScale;
|
|
120
|
-
return _ts_generator(this, function(_state) {
|
|
121
|
-
switch(_state.label){
|
|
122
|
-
case 0:
|
|
123
|
-
return [
|
|
124
|
-
4,
|
|
125
|
-
getScaleByNative()
|
|
126
|
-
];
|
|
127
|
-
case 1:
|
|
128
|
-
nativeScale = _state.sent();
|
|
129
|
-
if (nativeScale) return [
|
|
130
|
-
2,
|
|
131
|
-
nativeScale
|
|
132
|
-
];
|
|
133
|
-
return [
|
|
134
|
-
2,
|
|
135
|
-
getScaleByViewport()
|
|
136
|
-
];
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
})();
|
|
63
|
+
/** 统一获取缩放:按视口规则计算 */ function getScaleF() {
|
|
64
|
+
return getScaleByViewport();
|
|
140
65
|
}
|
|
141
66
|
/** 校验后更新内存中的 scale,并写入 --nut-scale-f */ function setScaleF(nextScale) {
|
|
142
67
|
var validScale = Number.isFinite(nextScale) && nextScale > 0 ? nextScale : 1;
|
|
@@ -144,31 +69,15 @@ import { canUseDom } from "./can-use-dom";
|
|
|
144
69
|
applyScaleCssVars(validScale);
|
|
145
70
|
return scale;
|
|
146
71
|
}
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return [
|
|
157
|
-
4,
|
|
158
|
-
getScaleF()
|
|
159
|
-
];
|
|
160
|
-
case 1:
|
|
161
|
-
nextScale = _state.sent();
|
|
162
|
-
if (!scale || nextScale !== scale) {
|
|
163
|
-
setScaleF(nextScale);
|
|
164
|
-
}
|
|
165
|
-
return [
|
|
166
|
-
2,
|
|
167
|
-
scale
|
|
168
|
-
];
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
})();
|
|
72
|
+
/** 重新计算缩放;可选同时切换 profile,避免与当前值相同时重复写 DOM */ function refreshScaleF(nextProfile) {
|
|
73
|
+
if (nextProfile) {
|
|
74
|
+
setScaleProfile(nextProfile);
|
|
75
|
+
}
|
|
76
|
+
var nextScale = getScaleF();
|
|
77
|
+
if (!scale || nextScale !== scale) {
|
|
78
|
+
setScaleF(nextScale);
|
|
79
|
+
}
|
|
80
|
+
return scale;
|
|
172
81
|
}
|
|
173
82
|
/** 首次计算缩放并订阅 resize;返回卸载函数(SSR 下为空函数) */ export function initScaleF(nextProfile) {
|
|
174
83
|
if (!canUseDom) return function() {};
|
|
@@ -14,9 +14,4 @@ export declare const getDeviceInfo: () => IDeviceInfo;
|
|
|
14
14
|
* @returns {Taro.getWindowInfo.Result} 窗口信息
|
|
15
15
|
*/
|
|
16
16
|
export declare const getWindowInfo: () => Taro.getWindowInfo.Result;
|
|
17
|
-
/**
|
|
18
|
-
* 获取应用基础信息,兼容新旧 API
|
|
19
|
-
* @returns {Taro.getAppBaseInfo.Result} 应用基础信息
|
|
20
|
-
*/
|
|
21
|
-
export declare const getAppBaseInfo: () => Taro.getAppBaseInfo.Result;
|
|
22
17
|
export {};
|
|
@@ -13,10 +13,11 @@ import Taro from "@tarojs/taro";
|
|
|
13
13
|
* @returns {Taro.getWindowInfo.Result} 窗口信息
|
|
14
14
|
*/ export var getWindowInfo = function() {
|
|
15
15
|
return typeof Taro.getWindowInfo === 'function' ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
16
|
+
} // /**
|
|
17
|
+
// * 获取应用基础信息,兼容新旧 API
|
|
18
|
+
// * @returns {Taro.getAppBaseInfo.Result} 应用基础信息
|
|
19
|
+
// */
|
|
20
|
+
// export const getAppBaseInfo = (): Taro.getAppBaseInfo.Result => {
|
|
21
|
+
// return canIUse('getAppBaseInfo') ? taroGetAppBaseInfo() : getSystemInfoSync()
|
|
22
|
+
// }
|
|
23
|
+
;
|