@tuya-miniapp/smart-ui 2.6.2-beta-2 → 2.6.2-beta-4
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/index.js +1 -2
- package/dist/calendar-month/index.wxs +3 -6
- package/dist/calendar-utils/utils.d.ts +0 -1
- package/dist/calendar-utils/utils.js +0 -1
- package/lib/calendar/index.js +0 -1
- package/lib/calendar-month/index.wxs +3 -6
- package/lib/calendar-utils/utils.d.ts +0 -1
- package/lib/calendar-utils/utils.js +1 -2
- package/package.json +1 -1
package/dist/calendar/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { SmartComponent } from '../common/component';
|
2
|
-
import {
|
2
|
+
import { getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, getInitEdgeDate, } from '../calendar-utils/utils';
|
3
3
|
const dateEdge = getInitEdgeDate('year');
|
4
4
|
const getTime = (date) => (date instanceof Date ? date.getTime() : date);
|
5
5
|
SmartComponent({
|
@@ -92,7 +92,6 @@ SmartComponent({
|
|
92
92
|
},
|
93
93
|
rowHeight: {
|
94
94
|
type: null,
|
95
|
-
value: ROW_HEIGHT,
|
96
95
|
},
|
97
96
|
round: {
|
98
97
|
type: Boolean,
|
@@ -21,7 +21,7 @@ function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
|
|
21
21
|
style.push(['margin-left', (100 * offset) / 7 + '%']);
|
22
22
|
}
|
23
23
|
|
24
|
-
if (rowHeight !== ROW_HEIGHT) {
|
24
|
+
if (rowHeight && rowHeight !== ROW_HEIGHT) {
|
25
25
|
style.push(['height', rowHeight + 'px']);
|
26
26
|
}
|
27
27
|
|
@@ -49,7 +49,7 @@ function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
|
|
49
49
|
function formatMonthTitle(date, formatter = 'YYYY-MM') {
|
50
50
|
date = getDate(date);
|
51
51
|
var year = date.getFullYear();
|
52
|
-
var month = date.getMonth() + 1 < 10 ?
|
52
|
+
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + '';
|
53
53
|
return formatter.replace('YYYY', year + '').replace('MM', month);
|
54
54
|
}
|
55
55
|
|
@@ -57,10 +57,7 @@ function getMonthStyle(visible, date, rowHeight) {
|
|
57
57
|
if (!visible) {
|
58
58
|
date = getDate(date);
|
59
59
|
|
60
|
-
var totalDay = utils.getMonthEndDay(
|
61
|
-
date.getFullYear(),
|
62
|
-
date.getMonth() + 1
|
63
|
-
);
|
60
|
+
var totalDay = utils.getMonthEndDay(date.getFullYear(), date.getMonth() + 1);
|
64
61
|
var offset = getDate(date).getDay();
|
65
62
|
var padding = Math.ceil((totalDay + offset) / 7) * rowHeight;
|
66
63
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
export declare const ROW_HEIGHT = 34;
|
2
1
|
export declare function formatMonthTitle(date: Date, formatter?: string): string;
|
3
2
|
export declare function compareMonth(date1: Date | number, date2: Date | number): 0 | 1 | -1;
|
4
3
|
export declare function compareDay(day1: Date | number, day2: Date | number): 0 | 1 | -1;
|
package/lib/calendar/index.js
CHANGED
@@ -21,7 +21,7 @@ function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
|
|
21
21
|
style.push(['margin-left', (100 * offset) / 7 + '%']);
|
22
22
|
}
|
23
23
|
|
24
|
-
if (rowHeight !== ROW_HEIGHT) {
|
24
|
+
if (rowHeight && rowHeight !== ROW_HEIGHT) {
|
25
25
|
style.push(['height', rowHeight + 'px']);
|
26
26
|
}
|
27
27
|
|
@@ -49,7 +49,7 @@ function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
|
|
49
49
|
function formatMonthTitle(date, formatter = 'YYYY-MM') {
|
50
50
|
date = getDate(date);
|
51
51
|
var year = date.getFullYear();
|
52
|
-
var month = date.getMonth() + 1 < 10 ?
|
52
|
+
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + '';
|
53
53
|
return formatter.replace('YYYY', year + '').replace('MM', month);
|
54
54
|
}
|
55
55
|
|
@@ -57,10 +57,7 @@ function getMonthStyle(visible, date, rowHeight) {
|
|
57
57
|
if (!visible) {
|
58
58
|
date = getDate(date);
|
59
59
|
|
60
|
-
var totalDay = utils.getMonthEndDay(
|
61
|
-
date.getFullYear(),
|
62
|
-
date.getMonth() + 1
|
63
|
-
);
|
60
|
+
var totalDay = utils.getMonthEndDay(date.getFullYear(), date.getMonth() + 1);
|
64
61
|
var offset = getDate(date).getDay();
|
65
62
|
var padding = Math.ceil((totalDay + offset) / 7) * rowHeight;
|
66
63
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
export declare const ROW_HEIGHT = 34;
|
2
1
|
export declare function formatMonthTitle(date: Date, formatter?: string): string;
|
3
2
|
export declare function compareMonth(date1: Date | number, date2: Date | number): 0 | 1 | -1;
|
4
3
|
export declare function compareDay(day1: Date | number, day2: Date | number): 0 | 1 | -1;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getInitEdgeDate = exports.getWeekStartAndEnd = exports.getCurrentIndex = exports.getYears = exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getToday = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle =
|
4
|
-
exports.ROW_HEIGHT = 34;
|
3
|
+
exports.getInitEdgeDate = exports.getWeekStartAndEnd = exports.getCurrentIndex = exports.getYears = exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getToday = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = void 0;
|
5
4
|
function formatMonthTitle(date, formatter) {
|
6
5
|
if (formatter === void 0) { formatter = 'YYYY-MM'; }
|
7
6
|
if (!(date instanceof Date)) {
|