@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.
@@ -1,5 +1,5 @@
1
1
  import { SmartComponent } from '../common/component';
2
- import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, getInitEdgeDate, } from '../calendar-utils/utils';
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 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
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,4 +1,3 @@
1
- export const ROW_HEIGHT = 34;
2
1
  export function formatMonthTitle(date, formatter = 'YYYY-MM') {
3
2
  if (!(date instanceof Date)) {
4
3
  date = new Date(date);
@@ -103,7 +103,6 @@ var getTime = function (date) { return (date instanceof Date ? date.getTime() :
103
103
  },
104
104
  rowHeight: {
105
105
  type: null,
106
- value: utils_1.ROW_HEIGHT,
107
106
  },
108
107
  round: {
109
108
  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 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
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 = exports.ROW_HEIGHT = void 0;
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)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.6.2-beta-2",
3
+ "version": "2.6.2-beta-4",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",