@douyinfe/semi-foundation 2.33.0 → 2.33.2-alpha.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/breadcrumb/breadcrumb.scss +4 -4
- package/calendar/eventUtil.ts +9 -7
- package/calendar/foundation.ts +4 -4
- package/lib/cjs/breadcrumb/breadcrumb.css +0 -3
- package/lib/cjs/breadcrumb/breadcrumb.scss +4 -4
- package/lib/cjs/calendar/eventUtil.d.ts +7 -6
- package/lib/cjs/calendar/eventUtil.js +8 -6
- package/lib/cjs/calendar/foundation.d.ts +2 -2
- package/lib/cjs/calendar/foundation.js +2 -2
- package/lib/cjs/radio/radio.css +1 -0
- package/lib/cjs/radio/radio.scss +1 -0
- package/lib/cjs/timePicker/foundation.js +15 -1
- package/lib/es/breadcrumb/breadcrumb.css +0 -3
- package/lib/es/breadcrumb/breadcrumb.scss +4 -4
- package/lib/es/calendar/eventUtil.d.ts +7 -6
- package/lib/es/calendar/eventUtil.js +8 -6
- package/lib/es/calendar/foundation.d.ts +2 -2
- package/lib/es/calendar/foundation.js +2 -2
- package/lib/es/radio/radio.css +1 -0
- package/lib/es/radio/radio.scss +1 -0
- package/lib/es/timePicker/foundation.js +14 -1
- package/package.json +2 -2
- package/radio/radio.scss +1 -0
- package/timePicker/foundation.ts +12 -3
|
@@ -82,14 +82,14 @@ $module: #{$prefix}-breadcrumb;
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
&-item-icon+&-item-title {
|
|
86
|
-
|
|
87
|
-
}
|
|
85
|
+
// &-item-icon+&-item-title {
|
|
86
|
+
// margin-left: $spacing-breadcrumb_item_text-marginLeft;
|
|
87
|
+
// }
|
|
88
88
|
|
|
89
89
|
&-item-link {
|
|
90
90
|
display: inline-flex;
|
|
91
91
|
align-items: center;
|
|
92
|
-
column-gap:
|
|
92
|
+
column-gap: $spacing-breadcrumb_item_text-marginLeft;
|
|
93
93
|
text-decoration: inherit;
|
|
94
94
|
transition: color $transition_duration-breadcrumb_link-text $transition-function_breadcrumb_link-text $transition_delay-breadcrumb_link-text;
|
|
95
95
|
transform: scale($transform_scale-breadcrumb_link-text);
|
package/calendar/eventUtil.ts
CHANGED
|
@@ -96,9 +96,9 @@ export interface DateObj {
|
|
|
96
96
|
month: string
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export type
|
|
99
|
+
export type weekStartsOnEnum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
100
100
|
|
|
101
|
-
export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn:
|
|
101
|
+
export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum) => {
|
|
102
102
|
const today = getCurrDate();
|
|
103
103
|
const arr: Array<DateObj> = [];
|
|
104
104
|
[...Array(rangeLen).keys()].map(ind => {
|
|
@@ -121,15 +121,17 @@ export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode:
|
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
123
|
*
|
|
124
|
-
* @param {
|
|
124
|
+
* @param {Date} date
|
|
125
|
+
* @param {Date} monthStart current month start date, using for month mode
|
|
125
126
|
* @param {string} mode
|
|
126
127
|
* @param {string} locale
|
|
127
128
|
* @returns {object[]} { date: Date, dayString: string, ind: number, isToday: boolean, isWeekend: boolean, weekday: string }
|
|
128
129
|
* create weekly object array
|
|
129
130
|
*/
|
|
130
|
-
export const calcWeekData = (value: Date, mode = 'week', locale: Locale, weekStartsOn:
|
|
131
|
+
export const calcWeekData = (value: Date, monthStart: Date | null, mode = 'week', locale: Locale, weekStartsOn: weekStartsOnEnum) => {
|
|
131
132
|
const start = startOfWeek(value, { weekStartsOn });
|
|
132
|
-
|
|
133
|
+
const realValue = monthStart || value;
|
|
134
|
+
return calcRangeData(realValue, start, 7, mode, locale, weekStartsOn);
|
|
133
135
|
};
|
|
134
136
|
|
|
135
137
|
/**
|
|
@@ -250,7 +252,7 @@ export const filterEvents = (events: Map<string, EventObject[]>, start: Date, en
|
|
|
250
252
|
* filter out event that is not in the week range
|
|
251
253
|
*/
|
|
252
254
|
// eslint-disable-next-line max-len
|
|
253
|
-
export const filterWeeklyEvents = (events: Map<string, EventObject[]>, weekStart: Date, weekStartsOn:
|
|
255
|
+
export const filterWeeklyEvents = (events: Map<string, EventObject[]>, weekStart: Date, weekStartsOn: weekStartsOnEnum ) => filterEvents(events, weekStart, addDays(endOfWeek(weekStart, { weekStartsOn }), 1));
|
|
254
256
|
|
|
255
257
|
/**
|
|
256
258
|
* @returns {arr}
|
|
@@ -309,7 +311,7 @@ export const parseWeeklyAllDayEvent = (
|
|
|
309
311
|
startDate: Date,
|
|
310
312
|
weekStart: Date,
|
|
311
313
|
parsed: Array<Array<ParsedRangeEvent>>,
|
|
312
|
-
weekStartsOn:
|
|
314
|
+
weekStartsOn: weekStartsOnEnum
|
|
313
315
|
) => parseRangeAllDayEvent(event, startDate, weekStart, addDays(endOfWeek(startDate, { weekStartsOn }), 1), parsed);
|
|
314
316
|
|
|
315
317
|
|
package/calendar/foundation.ts
CHANGED
|
@@ -33,9 +33,9 @@ import {
|
|
|
33
33
|
DateObj,
|
|
34
34
|
checkWeekend,
|
|
35
35
|
} from './eventUtil';
|
|
36
|
-
import type {
|
|
36
|
+
import type { weekStartsOnEnum } from './eventUtil';
|
|
37
37
|
|
|
38
|
-
export {
|
|
38
|
+
export { weekStartsOnEnum };
|
|
39
39
|
export interface EventObject {
|
|
40
40
|
[x: string]: any;
|
|
41
41
|
key: string;
|
|
@@ -191,7 +191,7 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
|
|
|
191
191
|
const data = {} as WeeklyData;
|
|
192
192
|
const { weekStartsOn } = this.getProps();
|
|
193
193
|
data.month = format(value, 'LLL', { locale: dateFnsLocale, weekStartsOn });
|
|
194
|
-
data.week = calcWeekData(value, 'week', dateFnsLocale, weekStartsOn);
|
|
194
|
+
data.week = calcWeekData(value, null, 'week', dateFnsLocale, weekStartsOn);
|
|
195
195
|
this._adapter.setWeeklyData(data);
|
|
196
196
|
return data;
|
|
197
197
|
}
|
|
@@ -212,7 +212,7 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
|
|
|
212
212
|
const { weekStartsOn } = this.getProps();
|
|
213
213
|
const numberOfWeek = getWeeksInMonth(value, { weekStartsOn });
|
|
214
214
|
[...Array(numberOfWeek).keys()].map(ind => {
|
|
215
|
-
data[ind] = calcWeekData(addDays(monthStart, ind * 7), 'month', dateFnsLocale, weekStartsOn);
|
|
215
|
+
data[ind] = calcWeekData(addDays(monthStart, ind * 7), monthStart, 'month', dateFnsLocale, weekStartsOn);
|
|
216
216
|
});
|
|
217
217
|
this._adapter.setMonthlyData(data);
|
|
218
218
|
return data;
|
|
@@ -82,14 +82,14 @@ $module: #{$prefix}-breadcrumb;
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
&-item-icon+&-item-title {
|
|
86
|
-
|
|
87
|
-
}
|
|
85
|
+
// &-item-icon+&-item-title {
|
|
86
|
+
// margin-left: $spacing-breadcrumb_item_text-marginLeft;
|
|
87
|
+
// }
|
|
88
88
|
|
|
89
89
|
&-item-link {
|
|
90
90
|
display: inline-flex;
|
|
91
91
|
align-items: center;
|
|
92
|
-
column-gap:
|
|
92
|
+
column-gap: $spacing-breadcrumb_item_text-marginLeft;
|
|
93
93
|
text-decoration: inherit;
|
|
94
94
|
transition: color $transition_duration-breadcrumb_link-text $transition-function_breadcrumb_link-text $transition_delay-breadcrumb_link-text;
|
|
95
95
|
transform: scale($transform_scale-breadcrumb_link-text);
|
|
@@ -30,17 +30,18 @@ export interface DateObj {
|
|
|
30
30
|
isSameMonth: boolean;
|
|
31
31
|
month: string;
|
|
32
32
|
}
|
|
33
|
-
export declare type
|
|
34
|
-
export declare const calcRangeData: (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn:
|
|
33
|
+
export declare type weekStartsOnEnum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
34
|
+
export declare const calcRangeData: (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum) => DateObj[];
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
|
-
* @param {
|
|
37
|
+
* @param {Date} date
|
|
38
|
+
* @param {Date} monthStart current month start date, using for month mode
|
|
38
39
|
* @param {string} mode
|
|
39
40
|
* @param {string} locale
|
|
40
41
|
* @returns {object[]} { date: Date, dayString: string, ind: number, isToday: boolean, isWeekend: boolean, weekday: string }
|
|
41
42
|
* create weekly object array
|
|
42
43
|
*/
|
|
43
|
-
export declare const calcWeekData: (value: Date, mode: string, locale: Locale, weekStartsOn:
|
|
44
|
+
export declare const calcWeekData: (value: Date, monthStart: Date | null, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum) => DateObj[];
|
|
44
45
|
/**
|
|
45
46
|
*
|
|
46
47
|
* @param {object} event
|
|
@@ -74,7 +75,7 @@ export declare const filterEvents: (events: Map<string, EventObject[]>, start: D
|
|
|
74
75
|
* @returns {arr}
|
|
75
76
|
* filter out event that is not in the week range
|
|
76
77
|
*/
|
|
77
|
-
export declare const filterWeeklyEvents: (events: Map<string, EventObject[]>, weekStart: Date, weekStartsOn:
|
|
78
|
+
export declare const filterWeeklyEvents: (events: Map<string, EventObject[]>, weekStart: Date, weekStartsOn: weekStartsOnEnum) => Map<string, EventObject[]>;
|
|
78
79
|
/**
|
|
79
80
|
* @returns {arr}
|
|
80
81
|
* arrange and sort all day event for a range
|
|
@@ -84,7 +85,7 @@ export declare const parseRangeAllDayEvent: (event: EventObject[], startDate: Da
|
|
|
84
85
|
* @returns {arr}
|
|
85
86
|
* arrange and sort weekly all day event
|
|
86
87
|
*/
|
|
87
|
-
export declare const parseWeeklyAllDayEvent: (event: EventObject[], startDate: Date, weekStart: Date, parsed: Array<Array<ParsedRangeEvent>>, weekStartsOn:
|
|
88
|
+
export declare const parseWeeklyAllDayEvent: (event: EventObject[], startDate: Date, weekStart: Date, parsed: Array<Array<ParsedRangeEvent>>, weekStartsOn: weekStartsOnEnum) => ParsedRangeEvent[][];
|
|
88
89
|
export declare const collectDailyEvents: (events: ParsedRangeEvent[][]) => ParsedRangeEvent[][];
|
|
89
90
|
export declare const renderDailyEvent: (event: EventObject) => {
|
|
90
91
|
startPos: number;
|
|
@@ -127,7 +127,8 @@ const calcRangeData = (value, start, rangeLen, mode, locale, weekStartsOn) => {
|
|
|
127
127
|
};
|
|
128
128
|
/**
|
|
129
129
|
*
|
|
130
|
-
* @param {
|
|
130
|
+
* @param {Date} date
|
|
131
|
+
* @param {Date} monthStart current month start date, using for month mode
|
|
131
132
|
* @param {string} mode
|
|
132
133
|
* @param {string} locale
|
|
133
134
|
* @returns {object[]} { date: Date, dayString: string, ind: number, isToday: boolean, isWeekend: boolean, weekday: string }
|
|
@@ -137,14 +138,15 @@ const calcRangeData = (value, start, rangeLen, mode, locale, weekStartsOn) => {
|
|
|
137
138
|
|
|
138
139
|
exports.calcRangeData = calcRangeData;
|
|
139
140
|
|
|
140
|
-
const calcWeekData = function (value) {
|
|
141
|
-
let mode = arguments.length >
|
|
142
|
-
let locale = arguments.length >
|
|
143
|
-
let weekStartsOn = arguments.length >
|
|
141
|
+
const calcWeekData = function (value, monthStart) {
|
|
142
|
+
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'week';
|
|
143
|
+
let locale = arguments.length > 3 ? arguments[3] : undefined;
|
|
144
|
+
let weekStartsOn = arguments.length > 4 ? arguments[4] : undefined;
|
|
144
145
|
const start = (0, _dateFns.startOfWeek)(value, {
|
|
145
146
|
weekStartsOn
|
|
146
147
|
});
|
|
147
|
-
|
|
148
|
+
const realValue = monthStart || value;
|
|
149
|
+
return calcRangeData(realValue, start, 7, mode, locale, weekStartsOn);
|
|
148
150
|
};
|
|
149
151
|
/**
|
|
150
152
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
2
2
|
import { Locale } from 'date-fns';
|
|
3
3
|
import { DateObj } from './eventUtil';
|
|
4
|
-
import type {
|
|
5
|
-
export {
|
|
4
|
+
import type { weekStartsOnEnum } from './eventUtil';
|
|
5
|
+
export { weekStartsOnEnum };
|
|
6
6
|
export interface EventObject {
|
|
7
7
|
[x: string]: any;
|
|
8
8
|
key: string;
|
|
@@ -119,7 +119,7 @@ class CalendarFoundation extends _foundation.default {
|
|
|
119
119
|
locale: dateFnsLocale,
|
|
120
120
|
weekStartsOn
|
|
121
121
|
});
|
|
122
|
-
data.week = (0, _eventUtil.calcWeekData)(value, 'week', dateFnsLocale, weekStartsOn);
|
|
122
|
+
data.week = (0, _eventUtil.calcWeekData)(value, null, 'week', dateFnsLocale, weekStartsOn);
|
|
123
123
|
|
|
124
124
|
this._adapter.setWeeklyData(data);
|
|
125
125
|
|
|
@@ -154,7 +154,7 @@ class CalendarFoundation extends _foundation.default {
|
|
|
154
154
|
weekStartsOn
|
|
155
155
|
});
|
|
156
156
|
[...Array(numberOfWeek).keys()].map(ind => {
|
|
157
|
-
data[ind] = (0, _eventUtil.calcWeekData)((0, _dateFns.addDays)(monthStart, ind * 7), 'month', dateFnsLocale, weekStartsOn);
|
|
157
|
+
data[ind] = (0, _eventUtil.calcWeekData)((0, _dateFns.addDays)(monthStart, ind * 7), monthStart, 'month', dateFnsLocale, weekStartsOn);
|
|
158
158
|
});
|
|
159
159
|
|
|
160
160
|
this._adapter.setMonthlyData(data);
|
package/lib/cjs/radio/radio.css
CHANGED
package/lib/cjs/radio/radio.scss
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
|
|
9
|
+
|
|
8
10
|
var _split2 = _interopRequireDefault(require("lodash/split"));
|
|
9
11
|
|
|
10
12
|
var _constants = require("./constants");
|
|
@@ -374,7 +376,19 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
374
376
|
}
|
|
375
377
|
|
|
376
378
|
if (_dates && Array.isArray(_dates)) {
|
|
377
|
-
|
|
379
|
+
const result = _dates.map(date => {
|
|
380
|
+
let str;
|
|
381
|
+
|
|
382
|
+
if ((0, _isUndefined2.default)(date)) {
|
|
383
|
+
str = '';
|
|
384
|
+
} else {
|
|
385
|
+
str = (0, _utils.formatToString)(date, validFormat, dateFnsLocale);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return str;
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
return result.join(rangeSeparator);
|
|
378
392
|
}
|
|
379
393
|
|
|
380
394
|
return undefined;
|
|
@@ -82,14 +82,14 @@ $module: #{$prefix}-breadcrumb;
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
&-item-icon+&-item-title {
|
|
86
|
-
|
|
87
|
-
}
|
|
85
|
+
// &-item-icon+&-item-title {
|
|
86
|
+
// margin-left: $spacing-breadcrumb_item_text-marginLeft;
|
|
87
|
+
// }
|
|
88
88
|
|
|
89
89
|
&-item-link {
|
|
90
90
|
display: inline-flex;
|
|
91
91
|
align-items: center;
|
|
92
|
-
column-gap:
|
|
92
|
+
column-gap: $spacing-breadcrumb_item_text-marginLeft;
|
|
93
93
|
text-decoration: inherit;
|
|
94
94
|
transition: color $transition_duration-breadcrumb_link-text $transition-function_breadcrumb_link-text $transition_delay-breadcrumb_link-text;
|
|
95
95
|
transform: scale($transform_scale-breadcrumb_link-text);
|
|
@@ -30,17 +30,18 @@ export interface DateObj {
|
|
|
30
30
|
isSameMonth: boolean;
|
|
31
31
|
month: string;
|
|
32
32
|
}
|
|
33
|
-
export declare type
|
|
34
|
-
export declare const calcRangeData: (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn:
|
|
33
|
+
export declare type weekStartsOnEnum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
34
|
+
export declare const calcRangeData: (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum) => DateObj[];
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
|
-
* @param {
|
|
37
|
+
* @param {Date} date
|
|
38
|
+
* @param {Date} monthStart current month start date, using for month mode
|
|
38
39
|
* @param {string} mode
|
|
39
40
|
* @param {string} locale
|
|
40
41
|
* @returns {object[]} { date: Date, dayString: string, ind: number, isToday: boolean, isWeekend: boolean, weekday: string }
|
|
41
42
|
* create weekly object array
|
|
42
43
|
*/
|
|
43
|
-
export declare const calcWeekData: (value: Date, mode: string, locale: Locale, weekStartsOn:
|
|
44
|
+
export declare const calcWeekData: (value: Date, monthStart: Date | null, mode: string, locale: Locale, weekStartsOn: weekStartsOnEnum) => DateObj[];
|
|
44
45
|
/**
|
|
45
46
|
*
|
|
46
47
|
* @param {object} event
|
|
@@ -74,7 +75,7 @@ export declare const filterEvents: (events: Map<string, EventObject[]>, start: D
|
|
|
74
75
|
* @returns {arr}
|
|
75
76
|
* filter out event that is not in the week range
|
|
76
77
|
*/
|
|
77
|
-
export declare const filterWeeklyEvents: (events: Map<string, EventObject[]>, weekStart: Date, weekStartsOn:
|
|
78
|
+
export declare const filterWeeklyEvents: (events: Map<string, EventObject[]>, weekStart: Date, weekStartsOn: weekStartsOnEnum) => Map<string, EventObject[]>;
|
|
78
79
|
/**
|
|
79
80
|
* @returns {arr}
|
|
80
81
|
* arrange and sort all day event for a range
|
|
@@ -84,7 +85,7 @@ export declare const parseRangeAllDayEvent: (event: EventObject[], startDate: Da
|
|
|
84
85
|
* @returns {arr}
|
|
85
86
|
* arrange and sort weekly all day event
|
|
86
87
|
*/
|
|
87
|
-
export declare const parseWeeklyAllDayEvent: (event: EventObject[], startDate: Date, weekStart: Date, parsed: Array<Array<ParsedRangeEvent>>, weekStartsOn:
|
|
88
|
+
export declare const parseWeeklyAllDayEvent: (event: EventObject[], startDate: Date, weekStart: Date, parsed: Array<Array<ParsedRangeEvent>>, weekStartsOn: weekStartsOnEnum) => ParsedRangeEvent[][];
|
|
88
89
|
export declare const collectDailyEvents: (events: ParsedRangeEvent[][]) => ParsedRangeEvent[][];
|
|
89
90
|
export declare const renderDailyEvent: (event: EventObject) => {
|
|
90
91
|
startPos: number;
|
|
@@ -96,21 +96,23 @@ export const calcRangeData = (value, start, rangeLen, mode, locale, weekStartsOn
|
|
|
96
96
|
};
|
|
97
97
|
/**
|
|
98
98
|
*
|
|
99
|
-
* @param {
|
|
99
|
+
* @param {Date} date
|
|
100
|
+
* @param {Date} monthStart current month start date, using for month mode
|
|
100
101
|
* @param {string} mode
|
|
101
102
|
* @param {string} locale
|
|
102
103
|
* @returns {object[]} { date: Date, dayString: string, ind: number, isToday: boolean, isWeekend: boolean, weekday: string }
|
|
103
104
|
* create weekly object array
|
|
104
105
|
*/
|
|
105
106
|
|
|
106
|
-
export const calcWeekData = function (value) {
|
|
107
|
-
let mode = arguments.length >
|
|
108
|
-
let locale = arguments.length >
|
|
109
|
-
let weekStartsOn = arguments.length >
|
|
107
|
+
export const calcWeekData = function (value, monthStart) {
|
|
108
|
+
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'week';
|
|
109
|
+
let locale = arguments.length > 3 ? arguments[3] : undefined;
|
|
110
|
+
let weekStartsOn = arguments.length > 4 ? arguments[4] : undefined;
|
|
110
111
|
const start = startOfWeek(value, {
|
|
111
112
|
weekStartsOn
|
|
112
113
|
});
|
|
113
|
-
|
|
114
|
+
const realValue = monthStart || value;
|
|
115
|
+
return calcRangeData(realValue, start, 7, mode, locale, weekStartsOn);
|
|
114
116
|
};
|
|
115
117
|
/**
|
|
116
118
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
2
2
|
import { Locale } from 'date-fns';
|
|
3
3
|
import { DateObj } from './eventUtil';
|
|
4
|
-
import type {
|
|
5
|
-
export {
|
|
4
|
+
import type { weekStartsOnEnum } from './eventUtil';
|
|
5
|
+
export { weekStartsOnEnum };
|
|
6
6
|
export interface EventObject {
|
|
7
7
|
[x: string]: any;
|
|
8
8
|
key: string;
|
|
@@ -107,7 +107,7 @@ export default class CalendarFoundation extends BaseFoundation {
|
|
|
107
107
|
locale: dateFnsLocale,
|
|
108
108
|
weekStartsOn
|
|
109
109
|
});
|
|
110
|
-
data.week = calcWeekData(value, 'week', dateFnsLocale, weekStartsOn);
|
|
110
|
+
data.week = calcWeekData(value, null, 'week', dateFnsLocale, weekStartsOn);
|
|
111
111
|
|
|
112
112
|
this._adapter.setWeeklyData(data);
|
|
113
113
|
|
|
@@ -142,7 +142,7 @@ export default class CalendarFoundation extends BaseFoundation {
|
|
|
142
142
|
weekStartsOn
|
|
143
143
|
});
|
|
144
144
|
[...Array(numberOfWeek).keys()].map(ind => {
|
|
145
|
-
data[ind] = calcWeekData(addDays(monthStart, ind * 7), 'month', dateFnsLocale, weekStartsOn);
|
|
145
|
+
data[ind] = calcWeekData(addDays(monthStart, ind * 7), monthStart, 'month', dateFnsLocale, weekStartsOn);
|
|
146
146
|
});
|
|
147
147
|
|
|
148
148
|
this._adapter.setMonthlyData(data);
|
package/lib/es/radio/radio.css
CHANGED
package/lib/es/radio/radio.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _isUndefined from "lodash/isUndefined";
|
|
1
2
|
import _split from "lodash/split";
|
|
2
3
|
|
|
3
4
|
/* eslint-disable max-len */
|
|
@@ -359,7 +360,19 @@ class TimePickerFoundation extends BaseFoundation {
|
|
|
359
360
|
}
|
|
360
361
|
|
|
361
362
|
if (_dates && Array.isArray(_dates)) {
|
|
362
|
-
|
|
363
|
+
const result = _dates.map(date => {
|
|
364
|
+
let str;
|
|
365
|
+
|
|
366
|
+
if (_isUndefined(date)) {
|
|
367
|
+
str = '';
|
|
368
|
+
} else {
|
|
369
|
+
str = formatToString(date, validFormat, dateFnsLocale);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return str;
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
return result.join(rangeSeparator);
|
|
363
376
|
}
|
|
364
377
|
|
|
365
378
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.2-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"*.scss",
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "2deb728849055607d3d4019fecd2eee522b74f52",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
29
29
|
"@babel/preset-env": "^7.15.8",
|
package/radio/radio.scss
CHANGED
package/timePicker/foundation.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
transformToArray,
|
|
11
11
|
isTimeFormatLike
|
|
12
12
|
} from './utils';
|
|
13
|
-
import { split } from 'lodash';
|
|
13
|
+
import { split, isUndefined } from 'lodash';
|
|
14
14
|
import { isValid, format, getHours } from 'date-fns';
|
|
15
15
|
import { utcToZonedTime, zonedTimeToUtc } from '../utils/date-fns-extra';
|
|
16
16
|
import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
@@ -182,7 +182,7 @@ class TimePickerFoundation<P = Record<string, any>, S = Record<string, any>> ext
|
|
|
182
182
|
isAM[index] = panelIsAM;
|
|
183
183
|
const inputValue = this.formatValue(value);
|
|
184
184
|
|
|
185
|
-
if (this.getState('isAM')[index] !== result.isAM){
|
|
185
|
+
if (this.getState('isAM')[index] !== result.isAM) {
|
|
186
186
|
this.setState({ isAM } as any);
|
|
187
187
|
}
|
|
188
188
|
if (!this._isControlledComponent('value')) {
|
|
@@ -369,7 +369,16 @@ class TimePickerFoundation<P = Record<string, any>, S = Record<string, any>> ext
|
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
if (_dates && Array.isArray(_dates)) {
|
|
372
|
-
|
|
372
|
+
const result = _dates.map(date => {
|
|
373
|
+
let str;
|
|
374
|
+
if (isUndefined(date)) {
|
|
375
|
+
str = '';
|
|
376
|
+
} else {
|
|
377
|
+
str = formatToString(date, validFormat, dateFnsLocale);
|
|
378
|
+
}
|
|
379
|
+
return str;
|
|
380
|
+
});
|
|
381
|
+
return result.join(rangeSeparator);
|
|
373
382
|
}
|
|
374
383
|
return undefined;
|
|
375
384
|
}
|