@tuya-miniapp/smart-ui 2.7.4-beta-2 → 2.7.4-beta-3

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.
@@ -10,6 +10,11 @@ SmartComponent({
10
10
  message: String,
11
11
  forbidClick: Boolean,
12
12
  nativeDisabled: Boolean,
13
+ iconColor: {
14
+ type: String,
15
+ value: 'white',
16
+ },
17
+ textColor: String,
13
18
  zIndex: {
14
19
  type: Number,
15
20
  value: 1000,
@@ -16,16 +16,16 @@
16
16
  >
17
17
 
18
18
  <!-- text only -->
19
- <text class="smart-toast__text" wx:if="{{ type === 'text' }}">{{ message }}</text>
19
+ <text class="smart-toast__text" style="{{ textColor ? ('color: ' + textColor) : '' }}" wx:if="{{ type === 'text' }}">{{ message }}</text>
20
20
 
21
21
  <!-- html only -->
22
- <rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}"></rich-text>
22
+ <rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}" style="{{ textColor ? ('color: ' + textColor) : '' }}"></rich-text>
23
23
 
24
24
  <!-- with icon -->
25
25
  <block wx:else>
26
- <smart-loading wx:if="{{ type === 'loading' }}" color="white" style="transform:scale(1.6);" type="{{loadingType}}" />
27
- <smart-icon wx:else color="white" class="smart-toast__icon" style="transform:scale({{ type === 'success' ? 1.4 : type === 'fail' ? 1.1 : 1 }})" name="{{ type === 'success' ? success : type === 'fail' ? error : type === 'warn' ? warn : success }}" />
28
- <text wx:if="{{ message }}" class="smart-toast__text">{{ message }}</text>
26
+ <smart-loading wx:if="{{ type === 'loading' }}" color="{{iconColor}}" style="transform:scale(1.6);" type="{{loadingType}}" />
27
+ <smart-icon wx:else color="{{iconColor}}" class="smart-toast__icon" style="transform:scale({{ type === 'success' ? 1.4 : type === 'fail' ? 1.1 : 1 }})" name="{{ type === 'success' ? success : type === 'fail' ? error : type === 'warn' ? warn : success }}" />
28
+ <text wx:if="{{ message }}" class="smart-toast__text" style="{{ textColor ? ('color: ' + textColor) : '' }}">{{ message }}</text>
29
29
  </block>
30
30
 
31
31
  <slot />
@@ -11,6 +11,8 @@ interface ToastOptions {
11
11
  context?: (() => ToastContext) | ToastContext;
12
12
  position?: string;
13
13
  duration?: number;
14
+ textColor?: string;
15
+ iconColor?: string;
14
16
  selector?: string;
15
17
  forbidClick?: boolean;
16
18
  ignoreQueue?: boolean;
@@ -15,6 +15,11 @@ var appLog_1 = __importDefault(require("../common/appLog"));
15
15
  message: String,
16
16
  forbidClick: Boolean,
17
17
  nativeDisabled: Boolean,
18
+ iconColor: {
19
+ type: String,
20
+ value: 'white',
21
+ },
22
+ textColor: String,
18
23
  zIndex: {
19
24
  type: Number,
20
25
  value: 1000,
@@ -16,16 +16,16 @@
16
16
  >
17
17
 
18
18
  <!-- text only -->
19
- <text class="smart-toast__text" wx:if="{{ type === 'text' }}">{{ message }}</text>
19
+ <text class="smart-toast__text" style="{{ textColor ? ('color: ' + textColor) : '' }}" wx:if="{{ type === 'text' }}">{{ message }}</text>
20
20
 
21
21
  <!-- html only -->
22
- <rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}"></rich-text>
22
+ <rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}" style="{{ textColor ? ('color: ' + textColor) : '' }}"></rich-text>
23
23
 
24
24
  <!-- with icon -->
25
25
  <block wx:else>
26
- <smart-loading wx:if="{{ type === 'loading' }}" color="white" style="transform:scale(1.6);" type="{{loadingType}}" />
27
- <smart-icon wx:else color="white" class="smart-toast__icon" style="transform:scale({{ type === 'success' ? 1.4 : type === 'fail' ? 1.1 : 1 }})" name="{{ type === 'success' ? success : type === 'fail' ? error : type === 'warn' ? warn : success }}" />
28
- <text wx:if="{{ message }}" class="smart-toast__text">{{ message }}</text>
26
+ <smart-loading wx:if="{{ type === 'loading' }}" color="{{iconColor}}" style="transform:scale(1.6);" type="{{loadingType}}" />
27
+ <smart-icon wx:else color="{{iconColor}}" class="smart-toast__icon" style="transform:scale({{ type === 'success' ? 1.4 : type === 'fail' ? 1.1 : 1 }})" name="{{ type === 'success' ? success : type === 'fail' ? error : type === 'warn' ? warn : success }}" />
28
+ <text wx:if="{{ message }}" class="smart-toast__text" style="{{ textColor ? ('color: ' + textColor) : '' }}">{{ message }}</text>
29
29
  </block>
30
30
 
31
31
  <slot />
@@ -11,6 +11,8 @@ interface ToastOptions {
11
11
  context?: (() => ToastContext) | ToastContext;
12
12
  position?: string;
13
13
  duration?: number;
14
+ textColor?: string;
15
+ iconColor?: string;
14
16
  selector?: string;
15
17
  forbidClick?: boolean;
16
18
  ignoreQueue?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.7.4-beta-2",
3
+ "version": "2.7.4-beta-3",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",