@tuya-miniapp/smart-ui 2.3.9-beta-2 → 2.4.0-beta-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.
- package/dist/calendar/calendar.wxml +4 -1
- package/dist/calendar/index.js +9 -10
- package/dist/circle/index.wxml +2 -2
- package/dist/toast/index.css +1 -1
- package/dist/toast/index.wxss +1 -1
- package/lib/calendar/calendar.wxml +4 -1
- package/lib/calendar/index.js +10 -13
- package/lib/circle/index.wxml +2 -2
- package/lib/toast/index.css +1 -1
- package/lib/toast/index.wxss +1 -1
- package/package.json +1 -1
@@ -76,5 +76,8 @@
|
|
76
76
|
readonly="{{readonly}}"
|
77
77
|
/>
|
78
78
|
</block>
|
79
|
-
<smart-toast wx:if="{{
|
79
|
+
<smart-toast wx:if="{{showRangePrompt}}" show="{{showToast}}">
|
80
|
+
<text wx:if="{{rangePrompt}}" style="text-align:center;">{{ rangePrompt }}</text>
|
81
|
+
<text style="text-align:center;" wx:else>Days selected over {{maxRange}} days</text>
|
82
|
+
</smart-toast>
|
80
83
|
</view>
|
package/dist/calendar/index.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import { SmartComponent } from '../common/component';
|
2
2
|
import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, getInitEdgeDate, } from '../calendar-utils/utils';
|
3
|
-
import Toast from '../toast/toast';
|
4
3
|
const dateEdge = getInitEdgeDate('year');
|
5
4
|
const getTime = (date) => (date instanceof Date ? date.getTime() : date);
|
6
5
|
SmartComponent({
|
@@ -143,10 +142,6 @@ SmartComponent({
|
|
143
142
|
dayClassMap: {
|
144
143
|
type: null,
|
145
144
|
},
|
146
|
-
toastId: {
|
147
|
-
type: String,
|
148
|
-
value: 'smart-toast-calendar',
|
149
|
-
},
|
150
145
|
},
|
151
146
|
data: {
|
152
147
|
subtitle: '',
|
@@ -155,6 +150,7 @@ SmartComponent({
|
|
155
150
|
scrollIntoView: '',
|
156
151
|
visibleIndex: 0,
|
157
152
|
months: [],
|
153
|
+
showToast: false,
|
158
154
|
},
|
159
155
|
watch: {
|
160
156
|
minDate() {
|
@@ -416,14 +412,17 @@ SmartComponent({
|
|
416
412
|
this.$emit('select', copyDates(date));
|
417
413
|
},
|
418
414
|
checkRange(date) {
|
419
|
-
const { maxRange,
|
415
|
+
const { maxRange, showRangePrompt } = this.data;
|
420
416
|
if (maxRange && calcDateNum(date) > maxRange) {
|
421
417
|
if (showRangePrompt) {
|
422
|
-
|
423
|
-
|
424
|
-
context: this,
|
425
|
-
message: rangePrompt || `选择天数不能超过 ${maxRange} 天`,
|
418
|
+
this.setData({
|
419
|
+
showToast: true,
|
426
420
|
});
|
421
|
+
setTimeout(() => {
|
422
|
+
this.setData({
|
423
|
+
showToast: false,
|
424
|
+
});
|
425
|
+
}, 2000);
|
427
426
|
}
|
428
427
|
this.$emit('over-range');
|
429
428
|
return false;
|
package/dist/circle/index.wxml
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
<view class="smart-progress-circle" style="width:{{width}}px;height:{{height}}px">
|
1
|
+
<view class="smart-progress-circle" style="width:{{width}}px;height:{{height}}px;{{customStyle}}">
|
2
2
|
<canvas
|
3
3
|
type="2d"
|
4
4
|
wx:if="{{canvasId}}"
|
5
5
|
canvas-id="{{canvasId}}"
|
6
|
-
style="
|
6
|
+
style="width:100%;height:100%;"
|
7
7
|
></canvas>
|
8
8
|
</view>
|
package/dist/toast/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
1
|
+
@import '../common/index.css';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;right:-1000px;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
package/dist/toast/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
1
|
+
@import '../common/index.wxss';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;right:-1000px;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
@@ -76,5 +76,8 @@
|
|
76
76
|
readonly="{{readonly}}"
|
77
77
|
/>
|
78
78
|
</block>
|
79
|
-
<smart-toast wx:if="{{
|
79
|
+
<smart-toast wx:if="{{showRangePrompt}}" show="{{showToast}}">
|
80
|
+
<text wx:if="{{rangePrompt}}" style="text-align:center;">{{ rangePrompt }}</text>
|
81
|
+
<text style="text-align:center;" wx:else>Days selected over {{maxRange}} days</text>
|
82
|
+
</smart-toast>
|
80
83
|
</view>
|
package/lib/calendar/index.js
CHANGED
@@ -8,13 +8,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
8
8
|
}
|
9
9
|
return to.concat(ar || Array.prototype.slice.call(from));
|
10
10
|
};
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
-
};
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
12
|
var component_1 = require("../common/component");
|
16
13
|
var utils_1 = require("../calendar-utils/utils");
|
17
|
-
var toast_1 = __importDefault(require("../toast/toast"));
|
18
14
|
var dateEdge = (0, utils_1.getInitEdgeDate)('year');
|
19
15
|
var getTime = function (date) { return (date instanceof Date ? date.getTime() : date); };
|
20
16
|
(0, component_1.SmartComponent)({
|
@@ -157,10 +153,6 @@ var getTime = function (date) { return (date instanceof Date ? date.getTime() :
|
|
157
153
|
dayClassMap: {
|
158
154
|
type: null,
|
159
155
|
},
|
160
|
-
toastId: {
|
161
|
-
type: String,
|
162
|
-
value: 'smart-toast-calendar',
|
163
|
-
},
|
164
156
|
},
|
165
157
|
data: {
|
166
158
|
subtitle: '',
|
@@ -169,6 +161,7 @@ var getTime = function (date) { return (date instanceof Date ? date.getTime() :
|
|
169
161
|
scrollIntoView: '',
|
170
162
|
visibleIndex: 0,
|
171
163
|
months: [],
|
164
|
+
showToast: false,
|
172
165
|
},
|
173
166
|
watch: {
|
174
167
|
minDate: function () {
|
@@ -434,14 +427,18 @@ var getTime = function (date) { return (date instanceof Date ? date.getTime() :
|
|
434
427
|
this.$emit('select', (0, utils_1.copyDates)(date));
|
435
428
|
},
|
436
429
|
checkRange: function (date) {
|
437
|
-
var
|
430
|
+
var _this = this;
|
431
|
+
var _a = this.data, maxRange = _a.maxRange, showRangePrompt = _a.showRangePrompt;
|
438
432
|
if (maxRange && (0, utils_1.calcDateNum)(date) > maxRange) {
|
439
433
|
if (showRangePrompt) {
|
440
|
-
|
441
|
-
|
442
|
-
context: this,
|
443
|
-
message: rangePrompt || "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ".concat(maxRange, " \u5929"),
|
434
|
+
this.setData({
|
435
|
+
showToast: true,
|
444
436
|
});
|
437
|
+
setTimeout(function () {
|
438
|
+
_this.setData({
|
439
|
+
showToast: false,
|
440
|
+
});
|
441
|
+
}, 2000);
|
445
442
|
}
|
446
443
|
this.$emit('over-range');
|
447
444
|
return false;
|
package/lib/circle/index.wxml
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
<view class="smart-progress-circle" style="width:{{width}}px;height:{{height}}px">
|
1
|
+
<view class="smart-progress-circle" style="width:{{width}}px;height:{{height}}px;{{customStyle}}">
|
2
2
|
<canvas
|
3
3
|
type="2d"
|
4
4
|
wx:if="{{canvasId}}"
|
5
5
|
canvas-id="{{canvasId}}"
|
6
|
-
style="
|
6
|
+
style="width:100%;height:100%;"
|
7
7
|
></canvas>
|
8
8
|
</view>
|
package/lib/toast/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
1
|
+
@import '../common/index.css';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;right:-1000px;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
package/lib/toast/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
1
|
+
@import '../common/index.wxss';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;right:-1000px;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|